Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update iOS size formatter to enable usage of DesignSystem enum #52

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules
.DS_STORE
**/.DS_Store
.swiftpm/xcode/package.xcworkspace/xcuserdata/andrea.agudo.xcuserdatad/UserInterfaceState.xcuserstate
.build/
4 changes: 2 additions & 2 deletions formats/swiftSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ module.exports = function({ dictionary, options }) {
return `import Foundation
import UIKit

enum DesignSystem {\n\n` +
public enum DesignSystem {\n\n` +
types.map(type => {
return ` enum ${capitalizeFirstLetter(type)} {\n\n` +
return `public enum ${capitalizeFirstLetter(type)} {\n\n` +
dictionary.allProperties
.filter(token => token.type === type)
.map(token => {
Expand Down
14 changes: 7 additions & 7 deletions ios/Sources/DesignSystem/DesignSystem.swift
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import Foundation
import UIKit

enum DesignSystem {
public enum DesignSystem {

enum BorderWidth {
public enum BorderWidth {

public static let xs = CGFloat(0.5)
public static let sm = CGFloat(1)
public static let md = CGFloat(2)
public static let lg = CGFloat(3)
}

enum BorderRadius {
public enum BorderRadius {

public static let none = CGFloat(0)
public static let xxs = CGFloat(4)
Expand All @@ -23,7 +23,7 @@ enum DesignSystem {
public static let full = CGFloat(100)
}

enum LineHeights {
public enum LineHeights {

public static let leading01 = CGFloat(16)
public static let leading02 = CGFloat(20)
Expand All @@ -37,7 +37,7 @@ enum DesignSystem {
public static let leading10 = CGFloat(64)
}

enum FontSizes {
public enum FontSizes {

public static let fontSize01 = CGFloat(11)
public static let fontSize02 = CGFloat(12)
Expand All @@ -52,14 +52,14 @@ enum DesignSystem {
public static let fontSize11 = CGFloat(57)
}

enum LetterSpacing {
public enum LetterSpacing {

public static let tracking06 = CGFloat(0.4)
public static let tracking07 = CGFloat(0.25)
public static let tracking08 = CGFloat(0.5)
}

enum Spacing {
public enum Spacing {

public static let space01 = CGFloat(2)
public static let space02 = CGFloat(4)
Expand Down