@instructure/ui-heading 10.9.1-snapshot-4 → 10.9.1-snapshot-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -2
- package/es/Heading/__examples__/Heading.examples.js +4 -2
- package/es/Heading/index.js +45 -15
- package/es/Heading/props.js +3 -2
- package/es/Heading/styles.js +65 -2
- package/es/Heading/theme.js +1 -0
- package/lib/Heading/__examples__/Heading.examples.js +4 -2
- package/lib/Heading/index.js +45 -15
- package/lib/Heading/props.js +3 -2
- package/lib/Heading/styles.js +65 -2
- package/lib/Heading/theme.js +1 -0
- package/package.json +12 -12
- package/src/Heading/README.md +26 -5
- package/src/Heading/__examples__/Heading.examples.ts +5 -2
- package/src/Heading/index.tsx +37 -1
- package/src/Heading/props.ts +30 -2
- package/src/Heading/styles.ts +65 -2
- package/src/Heading/theme.ts +2 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Heading/__examples__/Heading.examples.d.ts.map +1 -1
- package/types/Heading/index.d.ts +3 -0
- package/types/Heading/index.d.ts.map +1 -1
- package/types/Heading/props.d.ts +5 -0
- package/types/Heading/props.d.ts.map +1 -1
- package/types/Heading/styles.d.ts.map +1 -1
- package/types/Heading/theme.d.ts.map +1 -1
package/src/Heading/styles.ts
CHANGED
|
@@ -39,7 +39,70 @@ const generateStyle = (
|
|
|
39
39
|
componentTheme: HeadingTheme,
|
|
40
40
|
props: HeadingProps
|
|
41
41
|
): HeadingStyle => {
|
|
42
|
-
const { level, color, border } = props
|
|
42
|
+
const { level, color, border, variant } = props
|
|
43
|
+
|
|
44
|
+
const variants: Record<NonNullable<HeadingProps['variant']>, object> = {
|
|
45
|
+
titlePageDesktop: {
|
|
46
|
+
fontStyle: 'normal',
|
|
47
|
+
fontWeight: componentTheme.weightImportant,
|
|
48
|
+
fontSize: componentTheme.titlePageDesktop,
|
|
49
|
+
lineHeight: componentTheme.lineHeight125
|
|
50
|
+
},
|
|
51
|
+
titlePageMobile: {
|
|
52
|
+
fontStyle: 'normal',
|
|
53
|
+
fontWeight: componentTheme.weightImportant,
|
|
54
|
+
fontSize: componentTheme.titlePageMobile,
|
|
55
|
+
lineHeight: componentTheme.lineHeight125
|
|
56
|
+
},
|
|
57
|
+
titleSection: {
|
|
58
|
+
fontStyle: 'normal',
|
|
59
|
+
fontWeight: componentTheme.weightImportant,
|
|
60
|
+
fontSize: componentTheme.titleSection,
|
|
61
|
+
lineHeight: componentTheme.lineHeight125
|
|
62
|
+
},
|
|
63
|
+
titleCardSection: {
|
|
64
|
+
fontStyle: 'normal',
|
|
65
|
+
fontWeight: componentTheme.weightImportant,
|
|
66
|
+
fontSize: componentTheme.titleSection,
|
|
67
|
+
lineHeight: componentTheme.lineHeight125
|
|
68
|
+
},
|
|
69
|
+
titleModule: {
|
|
70
|
+
fontStyle: 'normal',
|
|
71
|
+
fontWeight: componentTheme.weightImportant,
|
|
72
|
+
fontSize: componentTheme.titleModule,
|
|
73
|
+
lineHeight: componentTheme.lineHeight125
|
|
74
|
+
},
|
|
75
|
+
titleCardLarge: {
|
|
76
|
+
fontStyle: 'normal',
|
|
77
|
+
fontWeight: componentTheme.weightImportant,
|
|
78
|
+
fontSize: componentTheme.titleCardLarge,
|
|
79
|
+
lineHeight: componentTheme.lineHeight125
|
|
80
|
+
},
|
|
81
|
+
titleCardRegular: {
|
|
82
|
+
fontStyle: 'normal',
|
|
83
|
+
fontWeight: componentTheme.weightImportant,
|
|
84
|
+
fontSize: componentTheme.titleCardRegular,
|
|
85
|
+
lineHeight: componentTheme.lineHeight125
|
|
86
|
+
},
|
|
87
|
+
titleCardMini: {
|
|
88
|
+
fontStyle: 'normal',
|
|
89
|
+
fontWeight: componentTheme.weightImportant,
|
|
90
|
+
fontSize: componentTheme.titleCardMini,
|
|
91
|
+
lineHeight: componentTheme.lineHeight125
|
|
92
|
+
},
|
|
93
|
+
label: {
|
|
94
|
+
fontStyle: 'normal',
|
|
95
|
+
fontWeight: componentTheme.weightImportant,
|
|
96
|
+
fontSize: componentTheme.label,
|
|
97
|
+
lineHeight: componentTheme.lineHeight125
|
|
98
|
+
},
|
|
99
|
+
labelInline: {
|
|
100
|
+
fontStyle: 'normal',
|
|
101
|
+
fontWeight: componentTheme.weightImportant,
|
|
102
|
+
fontSize: componentTheme.label,
|
|
103
|
+
lineHeight: componentTheme.lineHeight150
|
|
104
|
+
}
|
|
105
|
+
}
|
|
43
106
|
|
|
44
107
|
const levelStyles = {
|
|
45
108
|
h1: {
|
|
@@ -125,7 +188,7 @@ const generateStyle = (
|
|
|
125
188
|
'&:is(input)[type]': inputStyles,
|
|
126
189
|
'&:-webkit-any(input)[type]': inputStyles,
|
|
127
190
|
|
|
128
|
-
...levelStyles[level!],
|
|
191
|
+
...(variant ? variants[variant] : levelStyles[level!]),
|
|
129
192
|
...colorStyles[color!],
|
|
130
193
|
...borderStyles[border!]
|
|
131
194
|
}
|
package/src/Heading/theme.ts
CHANGED