Skip to content

Commit 38ae3f8

Browse files
committed
Typography variants
[ignore-commit-lint]
1 parent b32b339 commit 38ae3f8

File tree

2 files changed

+33
-12
lines changed

2 files changed

+33
-12
lines changed

packages/HorizonUI/Sources/HorizonUI/Sources/Foundation/Typography/HorizonUI.Typography.Storybook.swift

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,21 @@ public extension HorizonUI.Typography {
2424
private let text = "This is an example text."
2525

2626
public var body: some View {
27-
VStack(spacing: 16) {
28-
ForEach(HorizonUI.Typography.Name.allCases) { typography in
29-
VStack(alignment: .leading, spacing: 4) {
30-
Text("\(typography)")
31-
.font(typography.font)
32-
HorizonUI.Typography(
33-
text: text,
34-
name: typography.id,
35-
color: .black
36-
)
27+
ScrollView(showsIndicators: false) {
28+
VStack(spacing: 16) {
29+
ForEach(HorizonUI.Typography.Name.allCases) { typography in
30+
VStack(alignment: .leading, spacing: 4) {
31+
Text("\(typography)")
32+
.font(typography.font)
33+
HorizonUI.Typography(
34+
text: text,
35+
name: typography.id,
36+
color: .black
37+
)
38+
}
39+
.frame(maxWidth: .infinity, alignment: .leading)
3740
}
38-
.frame(maxWidth: .infinity, alignment: .leading)
3941
}
40-
Spacer()
4142
}
4243
.padding(.all, 16)
4344
.navigationTitle("Typography")

packages/HorizonUI/Sources/HorizonUI/Sources/Foundation/Typography/HorizonUI.Typography.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,32 @@ public extension HorizonUI {
2424
case h1
2525
case h2
2626
case h3
27+
case p1
28+
case p2
29+
case p3
30+
case tag
31+
case labelLargeBold
32+
case labelMediumBold
33+
case labelSmallBold
34+
case labelSmall
35+
case buttonTextLarge
36+
case buttonTextMedium
2737

2838
var font: Font {
2939
switch self {
3040
case .h1: return .huiFonts.manropeBold28
3141
case .h2: return .huiFonts.manropeBold24
3242
case .h3: return .huiFonts.manropeBold20
43+
case .p1: return .huiFonts.figtreeRegular16
44+
case .p2: return .huiFonts.figtreeRegular14
45+
case .p3: return .huiFonts.figtreeRegular12
46+
case .tag: return .huiFonts.manropeRegular12
47+
case .labelLargeBold: return .huiFonts.figtreeSemibold16
48+
case .labelMediumBold: return .huiFonts.figtreeSemibolt14
49+
case .labelSmallBold: return .huiFonts.figtreeSemibold12
50+
case .labelSmall: return .huiFonts.figtreeRegular12
51+
case .buttonTextLarge: return .huiFonts.figtreeRegular16
52+
case .buttonTextMedium: return .huiFonts.figtreeRegular14
3353
}
3454
}
3555
}

0 commit comments

Comments
 (0)