@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.
@@ -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
  }
@@ -50,6 +50,8 @@ const generateComponentTheme = (theme: Theme): HeadingTheme => {
50
50
  }
51
51
 
52
52
  const componentVariables: HeadingTheme = {
53
+ ...typography,
54
+
53
55
  lineHeight: typography?.lineHeightCondensed,
54
56
 
55
57
  h1FontSize: typography?.fontSizeXXLarge,