orcs-design-system 3.2.4 → 3.2.6
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/es/GlobalStyles.js +1 -31
- package/es/SystemThemeProvider.js +11 -5
- package/es/assets/Colour/Colour.stories.js +211 -0
- package/es/assets/Colour/index.js +3 -3
- package/es/components/ActionsMenu/ActionsMenu.stories.js +260 -233
- package/es/components/ActionsMenu/index.js +144 -229
- package/es/components/Avatar/Avatar.stories.js +212 -196
- package/es/components/Avatar/index.js +280 -307
- package/es/components/Badge/Badge.stories.js +71 -46
- package/es/components/Badge/index.js +71 -74
- package/es/components/Box/Box.stories.js +51 -35
- package/es/components/Box/index.js +33 -34
- package/es/components/Button/Button.stories.js +161 -145
- package/es/components/Button/ButtonLink.stories.js +152 -139
- package/es/components/Button/index.js +79 -99
- package/es/components/ButtonGroup/ButtonGroup.stories.js +43 -42
- package/es/components/ButtonGroup/ButtonGroupItem.stories.js +11 -13
- package/es/components/ButtonGroup/index.js +103 -99
- package/es/components/Card/Card.stories.js +94 -62
- package/es/components/Card/index.js +50 -71
- package/es/components/Checkbox/Checkbox.stories.js +37 -43
- package/es/components/Checkbox/index.js +61 -76
- package/es/components/DatePicker/DatePicker.stories.js +86 -118
- package/es/components/DatePicker/index.js +71 -187
- package/es/components/Divider/Divider.stories.js +39 -42
- package/es/components/Divider/index.js +21 -27
- package/es/components/Expandable/Expandable.stories.js +46 -36
- package/es/components/Expandable/index.js +55 -82
- package/es/components/Flex/Flex.stories.js +19 -5
- package/es/components/Flex/FlexItem.stories.js +10 -9
- package/es/components/Flex/index.js +34 -27
- package/es/components/Grid/Grid.stories.js +129 -55
- package/es/components/Grid/index.js +25 -24
- package/es/components/Header/Header.stories.js +101 -92
- package/es/components/Header/index.js +433 -436
- package/es/components/HeaderSimple/HeaderSimple.stories.js +23 -27
- package/es/components/HeaderSimple/index.js +73 -68
- package/es/components/Icon/Icon.stories.js +58 -57
- package/es/components/Icon/index.js +48 -46
- package/es/components/Loading/Loading.stories.js +32 -39
- package/es/components/Loading/index.js +44 -51
- package/es/components/Modal/Modal.stories.js +172 -153
- package/es/components/Modal/index.js +126 -134
- package/es/components/Notification/Notification.stories.js +59 -58
- package/es/components/Notification/index.js +123 -133
- package/es/components/Popover/Popover.stories.js +134 -102
- package/es/components/Popover/index.js +65 -111
- package/es/components/ProgressBar/ProgressBar.stories.js +36 -39
- package/es/components/ProgressBar/index.js +29 -34
- package/es/components/RadioButton/RadioButton.stories.js +32 -37
- package/es/components/RadioButton/index.js +170 -184
- package/es/components/Range/Range.stories.js +19 -19
- package/es/components/Range/index.js +35 -45
- package/es/components/Select/Select.stories.js +107 -128
- package/es/components/Select/index.js +324 -336
- package/es/components/SideNav/NavItem.js +112 -122
- package/es/components/SideNav/SideNav.stories.js +84 -57
- package/es/components/SideNav/index.js +161 -185
- package/es/components/Sidebar/Sidebar.stories.js +50 -33
- package/es/components/Sidebar/index.js +152 -155
- package/es/components/Spacer/Spacer.stories.js +35 -32
- package/es/components/Spacer/index.js +20 -20
- package/es/components/StatusDot/StatusDot.stories.js +103 -90
- package/es/components/StatusDot/index.js +36 -38
- package/es/components/StyledLink/StyledLink.stories.js +68 -69
- package/es/components/StyledLink/index.js +47 -48
- package/es/components/Table/Table.stories.js +118 -112
- package/es/components/Table/getExpandColumnConfig.js +67 -62
- package/es/components/Table/index.js +24 -27
- package/es/components/Table/muiStyleOverrides.js +10 -8
- package/es/components/Tabs/Tab.stories.js +55 -38
- package/es/components/Tabs/TabsContainer.stories.js +30 -22
- package/es/components/Tabs/index.js +95 -92
- package/es/components/Tag/Tag.stories.js +250 -220
- package/es/components/Tag/index.js +118 -190
- package/es/components/TextArea/TextArea.stories.js +76 -89
- package/es/components/TextArea/index.js +117 -115
- package/es/components/TextInput/TextInput.stories.js +41 -61
- package/es/components/TextInput/index.js +127 -171
- package/es/components/Toggle/Toggle.stories.js +63 -62
- package/es/components/Toggle/index.js +43 -77
- package/es/components/TreeNav/TreeNav.stories.js +7 -8
- package/es/components/TreeNav/index.js +72 -69
- package/es/components/Typography/Typography.stories.js +174 -0
- package/es/components/Typography/index.js +252 -308
- package/es/components.test.js +1 -1
- package/es/hooks/isVisible.js +6 -10
- package/es/hooks/keepInView.js +27 -32
- package/es/hooks/keypress.js +14 -14
- package/es/hooks/useInputFocus.js +5 -5
- package/es/hooks/usePrevious.js +3 -3
- package/es/systemThemeCollapsed.js +53 -53
- package/es/systemtheme.js +53 -53
- package/es/utils/selectUtil.js +1 -1
- package/es/utils/selectUtil.test.js +6 -6
- package/package.json +29 -38
|
@@ -3,355 +3,299 @@ import { typography, space, layout, color, variant, compose } from "styled-syste
|
|
|
3
3
|
import css from "@styled-system/css";
|
|
4
4
|
import shouldForwardProp from "@styled-system/should-forward-prop";
|
|
5
5
|
import { themeGet } from "@styled-system/theme-get";
|
|
6
|
-
|
|
7
|
-
export
|
|
6
|
+
const typeStyles = compose(typography, color, space, layout);
|
|
7
|
+
export const H1 = styled("h1").withConfig({
|
|
8
8
|
displayName: "Typography__H1",
|
|
9
9
|
componentId: "sc-1613j99-0"
|
|
10
|
-
})(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
bold: {
|
|
26
|
-
fontWeight: themeGet("fontWeights.2")(props)
|
|
27
|
-
}
|
|
10
|
+
})(props => css({
|
|
11
|
+
fontFamily: themeGet("fonts.main")(props),
|
|
12
|
+
fontSize: themeGet("fontSizes.6")(props),
|
|
13
|
+
fontWeight: themeGet("fontWeights.1")(props),
|
|
14
|
+
textTransform: props.uppercase ? "uppercase" : "none",
|
|
15
|
+
wordBreak: props.breakWord ? "break-word" : "normal"
|
|
16
|
+
}), props => variant({
|
|
17
|
+
prop: "weight",
|
|
18
|
+
variants: {
|
|
19
|
+
light: {
|
|
20
|
+
fontWeight: themeGet("fontWeights.0")(props)
|
|
21
|
+
},
|
|
22
|
+
bold: {
|
|
23
|
+
fontWeight: themeGet("fontWeights.2")(props)
|
|
28
24
|
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
fontSize: themeGet("fontSizes.5")(props)
|
|
39
|
-
}
|
|
25
|
+
}
|
|
26
|
+
}), props => variant({
|
|
27
|
+
prop: "sizing",
|
|
28
|
+
variants: {
|
|
29
|
+
large: {
|
|
30
|
+
fontSize: themeGet("fontSizes.7")(props)
|
|
31
|
+
},
|
|
32
|
+
small: {
|
|
33
|
+
fontSize: themeGet("fontSizes.5")(props)
|
|
40
34
|
}
|
|
41
|
-
}
|
|
42
|
-
}, typeStyles);
|
|
43
|
-
export
|
|
35
|
+
}
|
|
36
|
+
}), typeStyles);
|
|
37
|
+
export const H2 = styled("h2").withConfig({
|
|
44
38
|
displayName: "Typography__H2",
|
|
45
39
|
componentId: "sc-1613j99-1"
|
|
46
|
-
})(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
bold: {
|
|
62
|
-
fontWeight: themeGet("fontWeights.2")(props)
|
|
63
|
-
}
|
|
40
|
+
})(props => css({
|
|
41
|
+
fontFamily: themeGet("fonts.main")(props),
|
|
42
|
+
fontSize: themeGet("fontSizes.5")(props),
|
|
43
|
+
fontWeight: themeGet("fontWeights.1")(props),
|
|
44
|
+
textTransform: props.uppercase ? "uppercase" : "none",
|
|
45
|
+
wordBreak: props.breakWord ? "break-word" : "normal"
|
|
46
|
+
}), props => variant({
|
|
47
|
+
prop: "weight",
|
|
48
|
+
variants: {
|
|
49
|
+
light: {
|
|
50
|
+
fontWeight: themeGet("fontWeights.0")(props)
|
|
51
|
+
},
|
|
52
|
+
bold: {
|
|
53
|
+
fontWeight: themeGet("fontWeights.2")(props)
|
|
64
54
|
}
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
fontSize: themeGet("fontSizes.4")(props)
|
|
75
|
-
}
|
|
55
|
+
}
|
|
56
|
+
}), props => variant({
|
|
57
|
+
prop: "sizing",
|
|
58
|
+
variants: {
|
|
59
|
+
large: {
|
|
60
|
+
fontSize: themeGet("fontSizes.6")(props)
|
|
61
|
+
},
|
|
62
|
+
small: {
|
|
63
|
+
fontSize: themeGet("fontSizes.4")(props)
|
|
76
64
|
}
|
|
77
|
-
}
|
|
78
|
-
}, typeStyles);
|
|
79
|
-
export
|
|
65
|
+
}
|
|
66
|
+
}), typeStyles);
|
|
67
|
+
export const H3 = styled("h3").withConfig({
|
|
80
68
|
displayName: "Typography__H3",
|
|
81
69
|
componentId: "sc-1613j99-2"
|
|
82
|
-
})(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
bold: {
|
|
98
|
-
fontWeight: themeGet("fontWeights.2")(props)
|
|
99
|
-
}
|
|
70
|
+
})(props => css({
|
|
71
|
+
fontFamily: themeGet("fonts.main")(props),
|
|
72
|
+
fontSize: themeGet("fontSizes.4")(props),
|
|
73
|
+
fontWeight: themeGet("fontWeights.1")(props),
|
|
74
|
+
textTransform: props.uppercase ? "uppercase" : "none",
|
|
75
|
+
wordBreak: props.breakWord ? "break-word" : "normal"
|
|
76
|
+
}), props => variant({
|
|
77
|
+
prop: "weight",
|
|
78
|
+
variants: {
|
|
79
|
+
light: {
|
|
80
|
+
fontWeight: themeGet("fontWeights.0")(props)
|
|
81
|
+
},
|
|
82
|
+
bold: {
|
|
83
|
+
fontWeight: themeGet("fontWeights.2")(props)
|
|
100
84
|
}
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
fontSize: themeGet("fontSizes.3")(props)
|
|
111
|
-
}
|
|
85
|
+
}
|
|
86
|
+
}), props => variant({
|
|
87
|
+
prop: "sizing",
|
|
88
|
+
variants: {
|
|
89
|
+
large: {
|
|
90
|
+
fontSize: themeGet("fontSizes.5")(props)
|
|
91
|
+
},
|
|
92
|
+
small: {
|
|
93
|
+
fontSize: themeGet("fontSizes.3")(props)
|
|
112
94
|
}
|
|
113
|
-
}
|
|
114
|
-
}, typeStyles);
|
|
115
|
-
export
|
|
95
|
+
}
|
|
96
|
+
}), typeStyles);
|
|
97
|
+
export const H4 = styled("h4").withConfig({
|
|
116
98
|
displayName: "Typography__H4",
|
|
117
99
|
componentId: "sc-1613j99-3"
|
|
118
|
-
})(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
},
|
|
133
|
-
bold: {
|
|
134
|
-
fontWeight: themeGet("fontWeights.2")(props)
|
|
135
|
-
}
|
|
100
|
+
})(props => css({
|
|
101
|
+
fontFamily: themeGet("fonts.main")(props),
|
|
102
|
+
fontSize: themeGet("fontSizes.3")(props),
|
|
103
|
+
fontWeight: themeGet("fontWeights.1")(props),
|
|
104
|
+
textTransform: props.uppercase ? "uppercase" : "none",
|
|
105
|
+
wordBreak: props.breakWord ? "break-word" : "normal"
|
|
106
|
+
}), props => variant({
|
|
107
|
+
prop: "weight",
|
|
108
|
+
variants: {
|
|
109
|
+
light: {
|
|
110
|
+
fontWeight: themeGet("fontWeights.0")(props)
|
|
111
|
+
},
|
|
112
|
+
bold: {
|
|
113
|
+
fontWeight: themeGet("fontWeights.2")(props)
|
|
136
114
|
}
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
fontSize: themeGet("fontSizes.2")(props)
|
|
147
|
-
}
|
|
115
|
+
}
|
|
116
|
+
}), props => variant({
|
|
117
|
+
prop: "sizing",
|
|
118
|
+
variants: {
|
|
119
|
+
large: {
|
|
120
|
+
fontSize: themeGet("fontSizes.4")(props)
|
|
121
|
+
},
|
|
122
|
+
small: {
|
|
123
|
+
fontSize: themeGet("fontSizes.2")(props)
|
|
148
124
|
}
|
|
149
|
-
}
|
|
150
|
-
}, typeStyles);
|
|
151
|
-
export
|
|
125
|
+
}
|
|
126
|
+
}), typeStyles);
|
|
127
|
+
export const H5 = styled("h5").withConfig({
|
|
152
128
|
displayName: "Typography__H5",
|
|
153
129
|
componentId: "sc-1613j99-4"
|
|
154
|
-
})(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
bold: {
|
|
170
|
-
fontWeight: themeGet("fontWeights.2")(props)
|
|
171
|
-
}
|
|
130
|
+
})(props => css({
|
|
131
|
+
fontFamily: themeGet("fonts.main")(props),
|
|
132
|
+
fontSize: themeGet("fontSizes.2")(props),
|
|
133
|
+
fontWeight: themeGet("fontWeights.1")(props),
|
|
134
|
+
textTransform: props.uppercase ? "uppercase" : "none",
|
|
135
|
+
wordBreak: props.breakWord ? "break-word" : "normal"
|
|
136
|
+
}), props => variant({
|
|
137
|
+
prop: "weight",
|
|
138
|
+
variants: {
|
|
139
|
+
light: {
|
|
140
|
+
fontWeight: themeGet("fontWeights.0")(props)
|
|
141
|
+
},
|
|
142
|
+
bold: {
|
|
143
|
+
fontWeight: themeGet("fontWeights.2")(props)
|
|
172
144
|
}
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
fontSize: themeGet("fontSizes.1")(props)
|
|
183
|
-
}
|
|
145
|
+
}
|
|
146
|
+
}), props => variant({
|
|
147
|
+
prop: "sizing",
|
|
148
|
+
variants: {
|
|
149
|
+
large: {
|
|
150
|
+
fontSize: themeGet("fontSizes.3")(props)
|
|
151
|
+
},
|
|
152
|
+
small: {
|
|
153
|
+
fontSize: themeGet("fontSizes.1")(props)
|
|
184
154
|
}
|
|
185
|
-
}
|
|
186
|
-
}, typeStyles);
|
|
187
|
-
export
|
|
155
|
+
}
|
|
156
|
+
}), typeStyles);
|
|
157
|
+
export const H6 = styled("h6").withConfig({
|
|
188
158
|
displayName: "Typography__H6",
|
|
189
159
|
componentId: "sc-1613j99-5"
|
|
190
|
-
})(
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
},
|
|
205
|
-
bold: {
|
|
206
|
-
fontWeight: themeGet("fontWeights.2")(props)
|
|
207
|
-
}
|
|
160
|
+
})(props => css({
|
|
161
|
+
fontFamily: themeGet("fonts.main")(props),
|
|
162
|
+
fontSize: themeGet("fontSizes.1")(props),
|
|
163
|
+
fontWeight: themeGet("fontWeights.1")(props),
|
|
164
|
+
textTransform: props.uppercase ? "uppercase" : "none",
|
|
165
|
+
wordBreak: props.breakWord ? "break-word" : "normal"
|
|
166
|
+
}), props => variant({
|
|
167
|
+
prop: "weight",
|
|
168
|
+
variants: {
|
|
169
|
+
light: {
|
|
170
|
+
fontWeight: themeGet("fontWeights.0")(props)
|
|
171
|
+
},
|
|
172
|
+
bold: {
|
|
173
|
+
fontWeight: themeGet("fontWeights.2")(props)
|
|
208
174
|
}
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
fontSize: themeGet("fontSizes.0")(props)
|
|
219
|
-
}
|
|
175
|
+
}
|
|
176
|
+
}), props => variant({
|
|
177
|
+
prop: "sizing",
|
|
178
|
+
variants: {
|
|
179
|
+
large: {
|
|
180
|
+
fontSize: themeGet("fontSizes.2")(props)
|
|
181
|
+
},
|
|
182
|
+
small: {
|
|
183
|
+
fontSize: themeGet("fontSizes.0")(props)
|
|
220
184
|
}
|
|
221
|
-
}
|
|
222
|
-
}, typeStyles);
|
|
223
|
-
export
|
|
185
|
+
}
|
|
186
|
+
}), typeStyles);
|
|
187
|
+
export const P = styled("p").withConfig({
|
|
224
188
|
displayName: "Typography__P",
|
|
225
189
|
componentId: "sc-1613j99-6"
|
|
226
|
-
})(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
},
|
|
241
|
-
bold: {
|
|
242
|
-
fontWeight: themeGet("fontWeights.2")(props)
|
|
243
|
-
}
|
|
190
|
+
})(props => css({
|
|
191
|
+
fontFamily: themeGet("fonts.main")(props),
|
|
192
|
+
fontSize: themeGet("fontSizes.2")(props),
|
|
193
|
+
fontWeight: themeGet("fontWeights.1")(props),
|
|
194
|
+
textTransform: props.uppercase ? "uppercase" : "none",
|
|
195
|
+
wordBreak: props.breakWord ? "break-word" : "normal"
|
|
196
|
+
}), props => variant({
|
|
197
|
+
prop: "weight",
|
|
198
|
+
variants: {
|
|
199
|
+
light: {
|
|
200
|
+
fontWeight: themeGet("fontWeights.0")(props)
|
|
201
|
+
},
|
|
202
|
+
bold: {
|
|
203
|
+
fontWeight: themeGet("fontWeights.2")(props)
|
|
244
204
|
}
|
|
245
|
-
}
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
fontSize: themeGet("fontSizes.3")(props)
|
|
252
|
-
}
|
|
205
|
+
}
|
|
206
|
+
}), props => variant({
|
|
207
|
+
prop: "sizing",
|
|
208
|
+
variants: {
|
|
209
|
+
large: {
|
|
210
|
+
fontSize: themeGet("fontSizes.3")(props)
|
|
253
211
|
}
|
|
254
|
-
}
|
|
255
|
-
}, typeStyles);
|
|
256
|
-
export
|
|
257
|
-
shouldForwardProp
|
|
212
|
+
}
|
|
213
|
+
}), typeStyles);
|
|
214
|
+
export const Small = styled("small").withConfig({
|
|
215
|
+
shouldForwardProp,
|
|
258
216
|
displayName: "Typography__Small",
|
|
259
217
|
componentId: "sc-1613j99-7"
|
|
260
218
|
}).attrs({
|
|
261
219
|
className: "Small"
|
|
262
|
-
})(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
},
|
|
275
|
-
bold: {
|
|
276
|
-
fontWeight: themeGet("fontWeights.2")(props)
|
|
277
|
-
}
|
|
220
|
+
})(props => css({
|
|
221
|
+
fontSize: themeGet("fontSizes.1")(props),
|
|
222
|
+
textTransform: props.uppercase ? "uppercase" : "none",
|
|
223
|
+
wordBreak: props.breakWord ? "break-word" : "normal"
|
|
224
|
+
}), props => variant({
|
|
225
|
+
prop: "weight",
|
|
226
|
+
variants: {
|
|
227
|
+
light: {
|
|
228
|
+
fontWeight: themeGet("fontWeights.0")(props)
|
|
229
|
+
},
|
|
230
|
+
bold: {
|
|
231
|
+
fontWeight: themeGet("fontWeights.2")(props)
|
|
278
232
|
}
|
|
279
|
-
}
|
|
280
|
-
}, typeStyles);
|
|
281
|
-
export
|
|
233
|
+
}
|
|
234
|
+
}), typeStyles);
|
|
235
|
+
export const Text = styled("span").withConfig({
|
|
282
236
|
displayName: "Typography__Text",
|
|
283
237
|
componentId: "sc-1613j99-8"
|
|
284
|
-
})(
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
},
|
|
299
|
-
bold: {
|
|
300
|
-
fontWeight: themeGet("fontWeights.2")(props)
|
|
301
|
-
}
|
|
238
|
+
})(props => css({
|
|
239
|
+
fontFamily: themeGet("fonts.main")(props),
|
|
240
|
+
fontSize: themeGet("fontSizes.2")(props),
|
|
241
|
+
fontWeight: themeGet("fontWeights.1")(props),
|
|
242
|
+
textTransform: props.uppercase ? "uppercase" : "none",
|
|
243
|
+
wordBreak: props.breakWord ? "break-word" : "normal"
|
|
244
|
+
}), props => variant({
|
|
245
|
+
prop: "weight",
|
|
246
|
+
variants: {
|
|
247
|
+
light: {
|
|
248
|
+
fontWeight: themeGet("fontWeights.0")(props)
|
|
249
|
+
},
|
|
250
|
+
bold: {
|
|
251
|
+
fontWeight: themeGet("fontWeights.2")(props)
|
|
302
252
|
}
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
fontSize: themeGet("fontSizes.3")(props)
|
|
310
|
-
}
|
|
253
|
+
}
|
|
254
|
+
}), props => variant({
|
|
255
|
+
prop: "sizing",
|
|
256
|
+
variants: {
|
|
257
|
+
large: {
|
|
258
|
+
fontSize: themeGet("fontSizes.3")(props)
|
|
311
259
|
}
|
|
312
|
-
}
|
|
313
|
-
}, typeStyles);
|
|
314
|
-
export
|
|
260
|
+
}
|
|
261
|
+
}), typeStyles);
|
|
262
|
+
export const Quote = styled("blockquote").withConfig({
|
|
315
263
|
displayName: "Typography__Quote",
|
|
316
264
|
componentId: "sc-1613j99-9"
|
|
317
|
-
})(
|
|
318
|
-
|
|
265
|
+
})(props => css({
|
|
266
|
+
display: "block",
|
|
267
|
+
fontSize: themeGet("fontSizes.3")(props),
|
|
268
|
+
fontWeight: themeGet("fontWeights.1")(props),
|
|
269
|
+
borderLeftStyle: "solid",
|
|
270
|
+
borderLeftWidth: 3,
|
|
271
|
+
borderLeftColor: "greyLight",
|
|
272
|
+
p: 4,
|
|
273
|
+
em: {
|
|
319
274
|
display: "block",
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
em: {
|
|
327
|
-
display: "block",
|
|
328
|
-
fontStyle: "italic",
|
|
329
|
-
fontSize: themeGet("fontSizes.2")(props),
|
|
330
|
-
color: themeGet("colors.greyDark")(props)
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
}, typeStyles);
|
|
334
|
-
export var Code = styled("div").withConfig({
|
|
275
|
+
fontStyle: "italic",
|
|
276
|
+
fontSize: themeGet("fontSizes.2")(props),
|
|
277
|
+
color: themeGet("colors.greyDark")(props)
|
|
278
|
+
}
|
|
279
|
+
}), typeStyles);
|
|
280
|
+
export const Code = styled("div").withConfig({
|
|
335
281
|
displayName: "Typography__Code",
|
|
336
282
|
componentId: "sc-1613j99-10"
|
|
337
|
-
})(
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
});
|
|
344
|
-
});
|
|
283
|
+
})(props => css({
|
|
284
|
+
padding: 3,
|
|
285
|
+
fontSize: themeGet("fontSizes.2")(props),
|
|
286
|
+
fontFamily: "monospace",
|
|
287
|
+
backgroundColor: themeGet("colors.warningLightest")(props)
|
|
288
|
+
}));
|
|
345
289
|
export default {
|
|
346
|
-
H1
|
|
347
|
-
H2
|
|
348
|
-
H3
|
|
349
|
-
H4
|
|
350
|
-
H5
|
|
351
|
-
H6
|
|
352
|
-
P
|
|
353
|
-
Text
|
|
354
|
-
Quote
|
|
355
|
-
Small
|
|
356
|
-
Code
|
|
290
|
+
H1,
|
|
291
|
+
H2,
|
|
292
|
+
H3,
|
|
293
|
+
H4,
|
|
294
|
+
H5,
|
|
295
|
+
H6,
|
|
296
|
+
P,
|
|
297
|
+
Text,
|
|
298
|
+
Quote,
|
|
299
|
+
Small,
|
|
300
|
+
Code
|
|
357
301
|
};
|
package/es/components.test.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as components from ".";
|
|
2
|
-
test("all components exported",
|
|
2
|
+
test("all components exported", () => {
|
|
3
3
|
expect(Object.keys(components)).toMatchInlineSnapshot("\n Array [\n \"ActionsMenu\",\n \"ActionsMenuBody\",\n \"ActionsMenuHeading\",\n \"ActionsMenuItem\",\n \"Avatar\",\n \"Badge\",\n \"Box\",\n \"Button\",\n \"ButtonGroupContainer\",\n \"ButtonGroupItem\",\n \"ButtonLink\",\n \"Card\",\n \"Checkbox\",\n \"Code\",\n \"DatePicker\",\n \"Divider\",\n \"Expandable\",\n \"Flex\",\n \"FlexItem\",\n \"GlobalStyles\",\n \"Grid\",\n \"GridItem\",\n \"H1\",\n \"H2\",\n \"H3\",\n \"H4\",\n \"H5\",\n \"H6\",\n \"Header\",\n \"HeaderSimple\",\n \"Icon\",\n \"Loading\",\n \"Modal\",\n \"Notification\",\n \"P\",\n \"Popover\",\n \"ProgressBar\",\n \"Quote\",\n \"RadioButton\",\n \"Range\",\n \"Select\",\n \"SideNav\",\n \"Sidebar\",\n \"SidebarClose\",\n \"SidebarPanel\",\n \"SidebarPanels\",\n \"SidebarTab\",\n \"SidebarTabs\",\n \"Small\",\n \"Spacer\",\n \"StatusDot\",\n \"StyledLink\",\n \"SystemThemeProvider\",\n \"Tab\",\n \"Table\",\n \"TabsContainer\",\n \"Tag\",\n \"Text\",\n \"TextArea\",\n \"TextInput\",\n \"Toggle\",\n \"TreeNav\",\n \"Typography\",\n \"VARIANT_COLORS\",\n \"getOptionByValue\",\n \"styleLink\",\n \"systemThemeCollapsed\",\n \"systemtheme\",\n ]\n ");
|
|
4
4
|
});
|
package/es/hooks/isVisible.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
1
|
import { useEffect, useRef, useState } from "react";
|
|
3
2
|
export default function useIsVisible() {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
setIsVisible = _useState2[1];
|
|
8
|
-
var ref = useRef();
|
|
9
|
-
useEffect(function () {
|
|
3
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
4
|
+
const ref = useRef();
|
|
5
|
+
useEffect(() => {
|
|
10
6
|
if (!ref.current) return;
|
|
11
|
-
|
|
7
|
+
const interval = window.setInterval(() => {
|
|
12
8
|
if (ref.current) {
|
|
13
|
-
|
|
9
|
+
const currentIsVisible = window.getComputedStyle(ref.current).visibility === "visible";
|
|
14
10
|
if (isVisible !== currentIsVisible) {
|
|
15
11
|
setIsVisible(currentIsVisible);
|
|
16
12
|
}
|
|
17
13
|
}
|
|
18
14
|
}, 250);
|
|
19
|
-
return
|
|
15
|
+
return () => {
|
|
20
16
|
clearInterval(interval);
|
|
21
17
|
};
|
|
22
18
|
}, [ref, isVisible]);
|