@guardian/stand 0.0.21 → 0.0.23
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/dist/checkbox.cjs +11 -0
- package/dist/checkbox.js +3 -0
- package/dist/components/checkbox/Checkbox.cjs +54 -0
- package/dist/components/checkbox/Checkbox.js +17 -0
- package/dist/components/checkbox/CheckboxGroup.cjs +35 -0
- package/dist/components/checkbox/CheckboxGroup.js +26 -0
- package/dist/components/checkbox/styles.cjs +109 -0
- package/dist/components/checkbox/styles.js +101 -0
- package/dist/components/form/types.cjs +6 -1
- package/dist/components/form/types.js +7 -2
- package/dist/components/inline-message/InlineMessage.cjs +9 -1
- package/dist/components/inline-message/InlineMessage.js +2 -2
- package/dist/components/inline-message/styles.cjs +6 -0
- package/dist/components/inline-message/styles.js +6 -1
- package/dist/components/radio-group/RadioGroup.cjs +65 -0
- package/dist/components/radio-group/RadioGroup.js +31 -0
- package/dist/components/radio-group/styles.cjs +78 -0
- package/dist/components/radio-group/styles.js +73 -0
- package/dist/components/topbar/topBarToolName/TopBarToolName.cjs +21 -2
- package/dist/components/topbar/topBarToolName/TopBarToolName.js +11 -3
- package/dist/components/topbar/topBarToolName/styles.cjs +39 -0
- package/dist/components/topbar/topBarToolName/styles.js +38 -1
- package/dist/fonts/MaterialSymbolsOutlined.css +1 -1
- package/dist/fonts/MaterialSymbolsRound.css +1 -1
- package/dist/fonts/MaterialSymbolsSharp.css +1 -1
- package/dist/fonts/material-symbols-types.ts +34 -3
- package/dist/index.cjs +4 -0
- package/dist/index.js +2 -0
- package/dist/radio-group.cjs +10 -0
- package/dist/radio-group.js +2 -0
- package/dist/styleD/build/css/base/typography.css +1 -1
- package/dist/styleD/build/css/component/TopBar.css +22 -0
- package/dist/styleD/build/css/component/checkbox.css +57 -0
- package/dist/styleD/build/css/component/inlineMessage.css +1 -0
- package/dist/styleD/build/css/component/radioGroup.css +52 -0
- package/dist/styleD/build/css/semantic/colors.css +3 -1
- package/dist/styleD/build/css/semantic/sizing.css +1 -0
- package/dist/styleD/build/css/semantic/typography.css +88 -0
- package/dist/styleD/build/typescript/base/typography.cjs +3 -3
- package/dist/styleD/build/typescript/base/typography.js +3 -3
- package/dist/styleD/build/typescript/component/TopBar.cjs +32 -0
- package/dist/styleD/build/typescript/component/TopBar.js +32 -0
- package/dist/styleD/build/typescript/component/checkbox.cjs +100 -0
- package/dist/styleD/build/typescript/component/checkbox.js +98 -0
- package/dist/styleD/build/typescript/component/inlineMessage.cjs +2 -1
- package/dist/styleD/build/typescript/component/inlineMessage.js +2 -1
- package/dist/styleD/build/typescript/component/radioGroup.cjs +85 -0
- package/dist/styleD/build/typescript/component/radioGroup.js +83 -0
- package/dist/styleD/build/typescript/semantic/colors.cjs +3 -1
- package/dist/styleD/build/typescript/semantic/colors.js +3 -1
- package/dist/styleD/build/typescript/semantic/sizing.cjs +1 -0
- package/dist/styleD/build/typescript/semantic/sizing.js +1 -0
- package/dist/styleD/build/typescript/semantic/typography.cjs +120 -0
- package/dist/styleD/build/typescript/semantic/typography.js +120 -0
- package/dist/types/TopBar.d.ts +1 -0
- package/dist/types/checkbox.d.ts +21 -0
- package/dist/types/components/checkbox/Checkbox.d.ts +2 -0
- package/dist/types/components/checkbox/CheckboxGroup.d.ts +2 -0
- package/dist/types/components/checkbox/CheckboxGroupSandbox.d.ts +5 -0
- package/dist/types/components/checkbox/CheckboxSandbox.d.ts +5 -0
- package/dist/types/components/checkbox/styles.d.ts +10 -0
- package/dist/types/components/checkbox/types.d.ts +11 -0
- package/dist/types/components/form/types.d.ts +1 -1
- package/dist/types/components/inline-message/styles.d.ts +1 -0
- package/dist/types/components/radio-group/RadioGroup.d.ts +3 -0
- package/dist/types/components/radio-group/sandbox.d.ts +5 -0
- package/dist/types/components/radio-group/styles.d.ts +9 -0
- package/dist/types/components/radio-group/types.d.ts +10 -0
- package/dist/types/components/topbar/topBarToolName/TopBarToolName.d.ts +1 -1
- package/dist/types/components/topbar/topBarToolName/styles.d.ts +2 -0
- package/dist/types/components/topbar/topBarToolName/types.d.ts +7 -1
- package/dist/types/fonts/material-symbols-types.d.ts +33 -2
- package/dist/types/index.d.ts +4 -0
- package/dist/types/radio-group.d.ts +20 -0
- package/dist/types/styleD/build/typescript/base/typography.d.ts +3 -3
- package/dist/types/styleD/build/typescript/component/TopBar.d.ts +32 -0
- package/dist/types/styleD/build/typescript/component/checkbox.d.ts +100 -0
- package/dist/types/styleD/build/typescript/component/inlineMessage.d.ts +1 -0
- package/dist/types/styleD/build/typescript/component/radioGroup.d.ts +85 -0
- package/dist/types/styleD/build/typescript/semantic/colors.d.ts +2 -0
- package/dist/types/styleD/build/typescript/semantic/sizing.d.ts +1 -0
- package/dist/types/styleD/build/typescript/semantic/typography.d.ts +120 -0
- package/package.json +29 -11
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const componentRadioGroup = {
|
|
2
|
+
shared: {
|
|
3
|
+
marginTop: "0.5rem",
|
|
4
|
+
marginBottom: "0.5rem",
|
|
5
|
+
display: "flex",
|
|
6
|
+
flexDirection: "column",
|
|
7
|
+
radio: {
|
|
8
|
+
color: "#000000",
|
|
9
|
+
disabled: {
|
|
10
|
+
color: "#999999"
|
|
11
|
+
},
|
|
12
|
+
display: "flex",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
gap: "0.5rem"
|
|
15
|
+
},
|
|
16
|
+
indicator: {
|
|
17
|
+
position: "relative",
|
|
18
|
+
after: {
|
|
19
|
+
position: "absolute",
|
|
20
|
+
borderRadius: "inherit",
|
|
21
|
+
inset: "0px",
|
|
22
|
+
scale: "0"
|
|
23
|
+
},
|
|
24
|
+
borderRadius: "50%",
|
|
25
|
+
border: "0.0625rem solid #545454",
|
|
26
|
+
focused: {
|
|
27
|
+
outline: "0.125rem solid #0072a9",
|
|
28
|
+
outlineOffset: "0.125rem"
|
|
29
|
+
},
|
|
30
|
+
invalid: {
|
|
31
|
+
border: "0.0625rem solid #b42a19",
|
|
32
|
+
after: {
|
|
33
|
+
backgroundColor: "#b42a19"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
disabled: {
|
|
37
|
+
border: "0.0625rem solid #dcdcdc"
|
|
38
|
+
},
|
|
39
|
+
selected: {
|
|
40
|
+
after: {
|
|
41
|
+
backgroundColor: "#005d8b",
|
|
42
|
+
scale: "0.6"
|
|
43
|
+
},
|
|
44
|
+
border: "0.125rem solid #0072a9",
|
|
45
|
+
invalid: {
|
|
46
|
+
border: "0.125rem solid #b42a19"
|
|
47
|
+
},
|
|
48
|
+
disabled: {
|
|
49
|
+
border: "0.125rem solid #dcdcdc",
|
|
50
|
+
after: {
|
|
51
|
+
backgroundColor: "#dcdcdc"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
sm: {
|
|
58
|
+
gap: "1rem",
|
|
59
|
+
typography: {
|
|
60
|
+
font: "normal 460 0.875rem/1.3 Open Sans",
|
|
61
|
+
letterSpacing: "0rem",
|
|
62
|
+
fontWidth: 95
|
|
63
|
+
},
|
|
64
|
+
indicator: {
|
|
65
|
+
width: "1.25rem",
|
|
66
|
+
height: "1.25rem"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
md: {
|
|
70
|
+
gap: "1.25rem",
|
|
71
|
+
typography: {
|
|
72
|
+
font: "normal 460 1rem/1.3 Open Sans",
|
|
73
|
+
letterSpacing: "0rem",
|
|
74
|
+
fontWidth: 95
|
|
75
|
+
},
|
|
76
|
+
indicator: {
|
|
77
|
+
width: "1.5rem",
|
|
78
|
+
height: "1.5rem"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export { componentRadioGroup };
|
|
@@ -10,6 +10,7 @@ const semanticColors = {
|
|
|
10
10
|
error: "#8c2113",
|
|
11
11
|
warning: "#433608",
|
|
12
12
|
success: "#326528",
|
|
13
|
+
"success-inverse": "#cde4c9",
|
|
13
14
|
information: "#00344e",
|
|
14
15
|
disabled: "#999999",
|
|
15
16
|
green: "#24491d",
|
|
@@ -69,7 +70,8 @@ const semanticColors = {
|
|
|
69
70
|
"information-weak": "#e8f0fb",
|
|
70
71
|
"error-weak": "#f5c6c0",
|
|
71
72
|
"error-strong": "#b42a19",
|
|
72
|
-
"success-weak": "#
|
|
73
|
+
"success-weak": "#cde4c9",
|
|
74
|
+
"success-strong": "#326528"
|
|
73
75
|
}
|
|
74
76
|
};
|
|
75
77
|
|
|
@@ -8,6 +8,7 @@ const semanticColors = {
|
|
|
8
8
|
error: "#8c2113",
|
|
9
9
|
warning: "#433608",
|
|
10
10
|
success: "#326528",
|
|
11
|
+
"success-inverse": "#cde4c9",
|
|
11
12
|
information: "#00344e",
|
|
12
13
|
disabled: "#999999",
|
|
13
14
|
green: "#24491d",
|
|
@@ -67,7 +68,8 @@ const semanticColors = {
|
|
|
67
68
|
"information-weak": "#e8f0fb",
|
|
68
69
|
"error-weak": "#f5c6c0",
|
|
69
70
|
"error-strong": "#b42a19",
|
|
70
|
-
"success-weak": "#
|
|
71
|
+
"success-weak": "#cde4c9",
|
|
72
|
+
"success-strong": "#326528"
|
|
71
73
|
}
|
|
72
74
|
};
|
|
73
75
|
|
|
@@ -81,6 +81,11 @@ const semanticTypography = {
|
|
|
81
81
|
letterSpacing: "-0.03125rem",
|
|
82
82
|
fontWidth: 88
|
|
83
83
|
},
|
|
84
|
+
"body-xs": {
|
|
85
|
+
font: "normal 460 0.75rem/1.3 Open Sans",
|
|
86
|
+
letterSpacing: "0rem",
|
|
87
|
+
fontWidth: 95
|
|
88
|
+
},
|
|
84
89
|
"body-sm": {
|
|
85
90
|
font: "normal 460 0.875rem/1.3 Open Sans",
|
|
86
91
|
letterSpacing: "0rem",
|
|
@@ -101,6 +106,36 @@ const semanticTypography = {
|
|
|
101
106
|
letterSpacing: "0rem",
|
|
102
107
|
fontWidth: 95
|
|
103
108
|
},
|
|
109
|
+
"body-bold-xs": {
|
|
110
|
+
font: "normal 700 0.75rem/1.3 Open Sans",
|
|
111
|
+
letterSpacing: "0rem",
|
|
112
|
+
fontWidth: 95
|
|
113
|
+
},
|
|
114
|
+
"body-bold-sm": {
|
|
115
|
+
font: "normal 700 0.875rem/1.3 Open Sans",
|
|
116
|
+
letterSpacing: "0rem",
|
|
117
|
+
fontWidth: 95
|
|
118
|
+
},
|
|
119
|
+
"body-bold-md": {
|
|
120
|
+
font: "normal 700 1rem/1.3 Open Sans",
|
|
121
|
+
letterSpacing: "0rem",
|
|
122
|
+
fontWidth: 95
|
|
123
|
+
},
|
|
124
|
+
"body-bold-lg": {
|
|
125
|
+
font: "normal 700 1.125rem/1.3 Open Sans",
|
|
126
|
+
letterSpacing: "0rem",
|
|
127
|
+
fontWidth: 95
|
|
128
|
+
},
|
|
129
|
+
"body-bold-xl": {
|
|
130
|
+
font: "normal 700 1.25rem/1.3 Open Sans",
|
|
131
|
+
letterSpacing: "0rem",
|
|
132
|
+
fontWidth: 95
|
|
133
|
+
},
|
|
134
|
+
"body-italic-xs": {
|
|
135
|
+
font: "italic 460 0.75rem/1.3 Open Sans",
|
|
136
|
+
letterSpacing: "0rem",
|
|
137
|
+
fontWidth: 95
|
|
138
|
+
},
|
|
104
139
|
"body-italic-sm": {
|
|
105
140
|
font: "italic 460 0.875rem/1.3 Open Sans",
|
|
106
141
|
letterSpacing: "0rem",
|
|
@@ -121,6 +156,36 @@ const semanticTypography = {
|
|
|
121
156
|
letterSpacing: "0rem",
|
|
122
157
|
fontWidth: 95
|
|
123
158
|
},
|
|
159
|
+
"body-italic-bold-xs": {
|
|
160
|
+
font: "italic 700 0.75rem/1.3 Open Sans",
|
|
161
|
+
letterSpacing: "0rem",
|
|
162
|
+
fontWidth: 95
|
|
163
|
+
},
|
|
164
|
+
"body-italic-bold-sm": {
|
|
165
|
+
font: "italic 700 0.875rem/1.3 Open Sans",
|
|
166
|
+
letterSpacing: "0rem",
|
|
167
|
+
fontWidth: 95
|
|
168
|
+
},
|
|
169
|
+
"body-italic-bold-md": {
|
|
170
|
+
font: "italic 700 1rem/1.3 Open Sans",
|
|
171
|
+
letterSpacing: "0rem",
|
|
172
|
+
fontWidth: 95
|
|
173
|
+
},
|
|
174
|
+
"body-italic-bold-lg": {
|
|
175
|
+
font: "italic 700 1.125rem/1.3 Open Sans",
|
|
176
|
+
letterSpacing: "0rem",
|
|
177
|
+
fontWidth: 95
|
|
178
|
+
},
|
|
179
|
+
"body-italic-bold-xl": {
|
|
180
|
+
font: "italic 700 1.25rem/1.3 Open Sans",
|
|
181
|
+
letterSpacing: "0rem",
|
|
182
|
+
fontWidth: 95
|
|
183
|
+
},
|
|
184
|
+
"body-compact-xs": {
|
|
185
|
+
font: "normal 460 0.75rem/1.3 Open Sans",
|
|
186
|
+
letterSpacing: "0rem",
|
|
187
|
+
fontWidth: 88
|
|
188
|
+
},
|
|
124
189
|
"body-compact-sm": {
|
|
125
190
|
font: "normal 460 0.875rem/1.3 Open Sans",
|
|
126
191
|
letterSpacing: "0rem",
|
|
@@ -141,6 +206,36 @@ const semanticTypography = {
|
|
|
141
206
|
letterSpacing: "0rem",
|
|
142
207
|
fontWidth: 88
|
|
143
208
|
},
|
|
209
|
+
"body-compact-bold-xs": {
|
|
210
|
+
font: "normal 700 0.75rem/1.3 Open Sans",
|
|
211
|
+
letterSpacing: "0rem",
|
|
212
|
+
fontWidth: 88
|
|
213
|
+
},
|
|
214
|
+
"body-compact-bold-sm": {
|
|
215
|
+
font: "normal 700 0.875rem/1.3 Open Sans",
|
|
216
|
+
letterSpacing: "0rem",
|
|
217
|
+
fontWidth: 88
|
|
218
|
+
},
|
|
219
|
+
"body-compact-bold-md": {
|
|
220
|
+
font: "normal 700 1rem/1.3 Open Sans",
|
|
221
|
+
letterSpacing: "0rem",
|
|
222
|
+
fontWidth: 88
|
|
223
|
+
},
|
|
224
|
+
"body-compact-bold-lg": {
|
|
225
|
+
font: "normal 700 1.125rem/1.3 Open Sans",
|
|
226
|
+
letterSpacing: "0rem",
|
|
227
|
+
fontWidth: 88
|
|
228
|
+
},
|
|
229
|
+
"body-compact-bold-xl": {
|
|
230
|
+
font: "normal 700 1.25rem/1.3 Open Sans",
|
|
231
|
+
letterSpacing: "0rem",
|
|
232
|
+
fontWidth: 88
|
|
233
|
+
},
|
|
234
|
+
"body-compact-italic-xs": {
|
|
235
|
+
font: "italic 460 0.75rem/1.3 Open Sans",
|
|
236
|
+
letterSpacing: "0rem",
|
|
237
|
+
fontWidth: 88
|
|
238
|
+
},
|
|
144
239
|
"body-compact-italic-sm": {
|
|
145
240
|
font: "italic 460 0.875rem/1.3 Open Sans",
|
|
146
241
|
letterSpacing: "0rem",
|
|
@@ -161,6 +256,31 @@ const semanticTypography = {
|
|
|
161
256
|
letterSpacing: "0rem",
|
|
162
257
|
fontWidth: 88
|
|
163
258
|
},
|
|
259
|
+
"body-compact-italic-bold-xs": {
|
|
260
|
+
font: "italic 700 0.75rem/1.3 Open Sans",
|
|
261
|
+
letterSpacing: "0rem",
|
|
262
|
+
fontWidth: 88
|
|
263
|
+
},
|
|
264
|
+
"body-compact-italic-bold-sm": {
|
|
265
|
+
font: "italic 700 0.875rem/1.3 Open Sans",
|
|
266
|
+
letterSpacing: "0rem",
|
|
267
|
+
fontWidth: 88
|
|
268
|
+
},
|
|
269
|
+
"body-compact-italic-bold-md": {
|
|
270
|
+
font: "italic 700 1rem/1.3 Open Sans",
|
|
271
|
+
letterSpacing: "0rem",
|
|
272
|
+
fontWidth: 88
|
|
273
|
+
},
|
|
274
|
+
"body-compact-italic-bold-lg": {
|
|
275
|
+
font: "italic 700 1.125rem/1.3 Open Sans",
|
|
276
|
+
letterSpacing: "0rem",
|
|
277
|
+
fontWidth: 88
|
|
278
|
+
},
|
|
279
|
+
"body-compact-italic-bold-xl": {
|
|
280
|
+
font: "italic 700 1.25rem/1.3 Open Sans",
|
|
281
|
+
letterSpacing: "0rem",
|
|
282
|
+
fontWidth: 88
|
|
283
|
+
},
|
|
164
284
|
"meta-md": {
|
|
165
285
|
font: "normal 460 0.75rem/1.3 Open Sans",
|
|
166
286
|
letterSpacing: "0rem",
|
|
@@ -79,6 +79,11 @@ const semanticTypography = {
|
|
|
79
79
|
letterSpacing: "-0.03125rem",
|
|
80
80
|
fontWidth: 88
|
|
81
81
|
},
|
|
82
|
+
"body-xs": {
|
|
83
|
+
font: "normal 460 0.75rem/1.3 Open Sans",
|
|
84
|
+
letterSpacing: "0rem",
|
|
85
|
+
fontWidth: 95
|
|
86
|
+
},
|
|
82
87
|
"body-sm": {
|
|
83
88
|
font: "normal 460 0.875rem/1.3 Open Sans",
|
|
84
89
|
letterSpacing: "0rem",
|
|
@@ -99,6 +104,36 @@ const semanticTypography = {
|
|
|
99
104
|
letterSpacing: "0rem",
|
|
100
105
|
fontWidth: 95
|
|
101
106
|
},
|
|
107
|
+
"body-bold-xs": {
|
|
108
|
+
font: "normal 700 0.75rem/1.3 Open Sans",
|
|
109
|
+
letterSpacing: "0rem",
|
|
110
|
+
fontWidth: 95
|
|
111
|
+
},
|
|
112
|
+
"body-bold-sm": {
|
|
113
|
+
font: "normal 700 0.875rem/1.3 Open Sans",
|
|
114
|
+
letterSpacing: "0rem",
|
|
115
|
+
fontWidth: 95
|
|
116
|
+
},
|
|
117
|
+
"body-bold-md": {
|
|
118
|
+
font: "normal 700 1rem/1.3 Open Sans",
|
|
119
|
+
letterSpacing: "0rem",
|
|
120
|
+
fontWidth: 95
|
|
121
|
+
},
|
|
122
|
+
"body-bold-lg": {
|
|
123
|
+
font: "normal 700 1.125rem/1.3 Open Sans",
|
|
124
|
+
letterSpacing: "0rem",
|
|
125
|
+
fontWidth: 95
|
|
126
|
+
},
|
|
127
|
+
"body-bold-xl": {
|
|
128
|
+
font: "normal 700 1.25rem/1.3 Open Sans",
|
|
129
|
+
letterSpacing: "0rem",
|
|
130
|
+
fontWidth: 95
|
|
131
|
+
},
|
|
132
|
+
"body-italic-xs": {
|
|
133
|
+
font: "italic 460 0.75rem/1.3 Open Sans",
|
|
134
|
+
letterSpacing: "0rem",
|
|
135
|
+
fontWidth: 95
|
|
136
|
+
},
|
|
102
137
|
"body-italic-sm": {
|
|
103
138
|
font: "italic 460 0.875rem/1.3 Open Sans",
|
|
104
139
|
letterSpacing: "0rem",
|
|
@@ -119,6 +154,36 @@ const semanticTypography = {
|
|
|
119
154
|
letterSpacing: "0rem",
|
|
120
155
|
fontWidth: 95
|
|
121
156
|
},
|
|
157
|
+
"body-italic-bold-xs": {
|
|
158
|
+
font: "italic 700 0.75rem/1.3 Open Sans",
|
|
159
|
+
letterSpacing: "0rem",
|
|
160
|
+
fontWidth: 95
|
|
161
|
+
},
|
|
162
|
+
"body-italic-bold-sm": {
|
|
163
|
+
font: "italic 700 0.875rem/1.3 Open Sans",
|
|
164
|
+
letterSpacing: "0rem",
|
|
165
|
+
fontWidth: 95
|
|
166
|
+
},
|
|
167
|
+
"body-italic-bold-md": {
|
|
168
|
+
font: "italic 700 1rem/1.3 Open Sans",
|
|
169
|
+
letterSpacing: "0rem",
|
|
170
|
+
fontWidth: 95
|
|
171
|
+
},
|
|
172
|
+
"body-italic-bold-lg": {
|
|
173
|
+
font: "italic 700 1.125rem/1.3 Open Sans",
|
|
174
|
+
letterSpacing: "0rem",
|
|
175
|
+
fontWidth: 95
|
|
176
|
+
},
|
|
177
|
+
"body-italic-bold-xl": {
|
|
178
|
+
font: "italic 700 1.25rem/1.3 Open Sans",
|
|
179
|
+
letterSpacing: "0rem",
|
|
180
|
+
fontWidth: 95
|
|
181
|
+
},
|
|
182
|
+
"body-compact-xs": {
|
|
183
|
+
font: "normal 460 0.75rem/1.3 Open Sans",
|
|
184
|
+
letterSpacing: "0rem",
|
|
185
|
+
fontWidth: 88
|
|
186
|
+
},
|
|
122
187
|
"body-compact-sm": {
|
|
123
188
|
font: "normal 460 0.875rem/1.3 Open Sans",
|
|
124
189
|
letterSpacing: "0rem",
|
|
@@ -139,6 +204,36 @@ const semanticTypography = {
|
|
|
139
204
|
letterSpacing: "0rem",
|
|
140
205
|
fontWidth: 88
|
|
141
206
|
},
|
|
207
|
+
"body-compact-bold-xs": {
|
|
208
|
+
font: "normal 700 0.75rem/1.3 Open Sans",
|
|
209
|
+
letterSpacing: "0rem",
|
|
210
|
+
fontWidth: 88
|
|
211
|
+
},
|
|
212
|
+
"body-compact-bold-sm": {
|
|
213
|
+
font: "normal 700 0.875rem/1.3 Open Sans",
|
|
214
|
+
letterSpacing: "0rem",
|
|
215
|
+
fontWidth: 88
|
|
216
|
+
},
|
|
217
|
+
"body-compact-bold-md": {
|
|
218
|
+
font: "normal 700 1rem/1.3 Open Sans",
|
|
219
|
+
letterSpacing: "0rem",
|
|
220
|
+
fontWidth: 88
|
|
221
|
+
},
|
|
222
|
+
"body-compact-bold-lg": {
|
|
223
|
+
font: "normal 700 1.125rem/1.3 Open Sans",
|
|
224
|
+
letterSpacing: "0rem",
|
|
225
|
+
fontWidth: 88
|
|
226
|
+
},
|
|
227
|
+
"body-compact-bold-xl": {
|
|
228
|
+
font: "normal 700 1.25rem/1.3 Open Sans",
|
|
229
|
+
letterSpacing: "0rem",
|
|
230
|
+
fontWidth: 88
|
|
231
|
+
},
|
|
232
|
+
"body-compact-italic-xs": {
|
|
233
|
+
font: "italic 460 0.75rem/1.3 Open Sans",
|
|
234
|
+
letterSpacing: "0rem",
|
|
235
|
+
fontWidth: 88
|
|
236
|
+
},
|
|
142
237
|
"body-compact-italic-sm": {
|
|
143
238
|
font: "italic 460 0.875rem/1.3 Open Sans",
|
|
144
239
|
letterSpacing: "0rem",
|
|
@@ -159,6 +254,31 @@ const semanticTypography = {
|
|
|
159
254
|
letterSpacing: "0rem",
|
|
160
255
|
fontWidth: 88
|
|
161
256
|
},
|
|
257
|
+
"body-compact-italic-bold-xs": {
|
|
258
|
+
font: "italic 700 0.75rem/1.3 Open Sans",
|
|
259
|
+
letterSpacing: "0rem",
|
|
260
|
+
fontWidth: 88
|
|
261
|
+
},
|
|
262
|
+
"body-compact-italic-bold-sm": {
|
|
263
|
+
font: "italic 700 0.875rem/1.3 Open Sans",
|
|
264
|
+
letterSpacing: "0rem",
|
|
265
|
+
fontWidth: 88
|
|
266
|
+
},
|
|
267
|
+
"body-compact-italic-bold-md": {
|
|
268
|
+
font: "italic 700 1rem/1.3 Open Sans",
|
|
269
|
+
letterSpacing: "0rem",
|
|
270
|
+
fontWidth: 88
|
|
271
|
+
},
|
|
272
|
+
"body-compact-italic-bold-lg": {
|
|
273
|
+
font: "italic 700 1.125rem/1.3 Open Sans",
|
|
274
|
+
letterSpacing: "0rem",
|
|
275
|
+
fontWidth: 88
|
|
276
|
+
},
|
|
277
|
+
"body-compact-italic-bold-xl": {
|
|
278
|
+
font: "italic 700 1.25rem/1.3 Open Sans",
|
|
279
|
+
letterSpacing: "0rem",
|
|
280
|
+
fontWidth: 88
|
|
281
|
+
},
|
|
162
282
|
"meta-md": {
|
|
163
283
|
font: "normal 460 0.75rem/1.3 Open Sans",
|
|
164
284
|
letterSpacing: "0rem",
|
package/dist/types/TopBar.d.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkbox and CheckboxGroup components entry point
|
|
3
|
+
*
|
|
4
|
+
* Peer dependencies required to use these components:
|
|
5
|
+
* - `@emotion/react`
|
|
6
|
+
* - `react`
|
|
7
|
+
* - `react-dom`
|
|
8
|
+
* - `typescript`
|
|
9
|
+
* - `react-aria-components`
|
|
10
|
+
*
|
|
11
|
+
* See the `peerDependencies` section of package.json for compatible versions.
|
|
12
|
+
*
|
|
13
|
+
* If you only need the built CSS (./component/checkbox.css),
|
|
14
|
+
* you don't need to install these.
|
|
15
|
+
*/
|
|
16
|
+
export { Checkbox } from './components/checkbox/Checkbox';
|
|
17
|
+
export { CheckboxGroup } from './components/checkbox/CheckboxGroup';
|
|
18
|
+
export type { CheckboxProps, CheckboxGroupProps, } from './components/checkbox/types';
|
|
19
|
+
export type { PartialCheckboxTheme as CheckboxTheme } from './components/checkbox/styles';
|
|
20
|
+
export { componentCheckbox } from './styleD/build/typescript/component/checkbox';
|
|
21
|
+
export type { ComponentCheckbox } from './styleD/build/typescript/component/checkbox';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const componentName = "CheckboxGroup";
|
|
2
|
+
export declare const componentTsx = "import { Checkbox, CheckboxGroup } from '@guardian/stand/checkbox';\n\nexport const Component = () => (\n\t<>\n\t\t<CheckboxGroup label=\"Notifications\" description=\"Choose what to receive.\">\n\t\t\t<Checkbox value=\"email\">Email</Checkbox>\n\t\t\t<Checkbox value=\"sms\">SMS</Checkbox>\n\t\t\t<Checkbox value=\"push\">Push notification</Checkbox>\n\t\t</CheckboxGroup>\n\n\t\t<CheckboxGroup\n\t\t\tlabel=\"Preferences\"\n\t\t\tsize=\"sm\"\n\t\t\tisInvalid\n\t\t\terror=\"Please select at least one option.\"\n\t\t>\n\t\t\t<Checkbox value=\"news\">News</Checkbox>\n\t\t\t<Checkbox value=\"offers\">Offers</Checkbox>\n\t\t</CheckboxGroup>\n\t</>\n);\n";
|
|
3
|
+
export declare const componentCss = "\n/* import the checkbox, form, inline message styles */\n@import '@guardian/stand/component/inlineMessage.css';\n@import '@guardian/stand/component/form.css';\n@import '@guardian/stand/component/checkbox.css';\n\n/* inline message styles - error */\n.stand-inline-message {\n display: var(--component-inline-message-shared-display);\n align-items: var(--component-inline-message-shared-align-items);\n gap: var(--component-inline-message-shared-gap);\n font: var(--component-inline-message-shared-typography-font);\n letter-spacing: var(\n --component-inline-message-shared-typography-letter-spacing\n );\n font-variation-settings: \"wdth\"\n var(--component-inline-message-shared-typography-font-width);\n}\n\n.stand-inline-message > .material-symbols {\n font-size: var(--component-inline-message-shared-icon-size);\n}\n\n.stand-inline-message > svg {\n width: var(--component-inline-message-shared-icon-size);\n height: var(--component-inline-message-shared-icon-size);\n}\n\n.stand-inline-message-error {\n color: var(--component-inline-message-error-color);\n fill: var(--component-inline-message-error-color);\n}\n\n/* form input container styles */\n\n.stand-form-input-container {\n\tdisplay: var(--component-form-input-shared-container-display);\n\tflex-direction: var(--component-form-input-shared-container-flex-direction);\n\tgap: var(--component-form-input-shared-container-gap);\n\twidth: var(--component-form-input-shared-container-width);\n}\n\n.stand-form-input-container.sm {\n\tmax-width: var(--component-form-input-sm-container-max-width);\n}\n\n.stand-form-input-container.md {\n\tmax-width: var(--component-form-input-md-container-max-width);\n}\n\n.stand-form-input-container > label {\n\tcolor: var(--component-form-input-shared-label-color);\n\tfont: var(--component-form-input-md-label-typography-font);\n\tletter-spacing: var(--component-form-input-md-label-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-form-input-md-label-typography-font-width);\n}\n\n.stand-form-input-container[data-disabled] > label {\n\tcolor: var(--component-form-input-shared-label-disabled-color);\n}\n\n.stand-form-input-container > span.description {\n\tcolor: var(--component-form-input-shared-description-color);\n\tfont: var(--component-form-input-shared-description-typography-font);\n\tletter-spacing: var(--component-form-input-shared-description-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-form-input-shared-description-typography-font-width);\n}\n\n.stand-form-input-container[data-disabled] > span.description {\n\tcolor: var(--component-form-input-shared-description-disabled-color);\n}\n\n/* checkbox styles */\n\n.stand-checkbox {\n display: var(--component-checkbox-input-shared-display);\n position: var(--component-checkbox-input-shared-position);\n align-items: var(--component-checkbox-input-shared-align-items);\n gap: var(--component-checkbox-input-shared-gap);\n cursor: var(--component-checkbox-input-shared-cursor);\n color: var(--component-checkbox-input-shared-color);\n}\n\n.stand-checkbox.md {\n font: var(--component-checkbox-input-md-typography-font);\n letter-spacing: var(--component-checkbox-input-md-typography-letter-spacing);\n font-variation-settings: \"wdth\"\n var(--component-checkbox-input-md-typography-font-width);\n}\n\n.stand-checkbox.sm {\n font: var(--component-checkbox-input-sm-typography-font);\n letter-spacing: var(--component-checkbox-input-sm-typography-letter-spacing);\n font-variation-settings: \"wdth\"\n\tvar(--component-checkbox-input-sm-typography-font-width);\n}\n\n.stand-checkbox > label {\n cursor: var(--component-checkbox-input-shared-cursor);\n}\n\n.stand-checkbox-indicator {\n /* Reset browser default styles for checkboxes */\n margin: 0;\n background-color: transparent;\n outline: none;\n\n /* component styles */\n cursor: var(--component-checkbox-input-shared-cursor);\n border: var(--component-checkbox-input-shared-indicator-border);\n border-radius: var(--component-checkbox-input-shared-indicator-border-radius);\n accent-color: var(\n --component-checkbox-input-shared-indicator-selected-background-color\n );\n}\n\n.stand-checkbox.md > .stand-checkbox-indicator {\n width: var(--component-checkbox-input-md-indicator-size);\n height: var(--component-checkbox-input-md-indicator-size);\n}\n\n.stand-checkbox.sm > .stand-checkbox-indicator {\n width: var(--component-checkbox-input-sm-indicator-size);\n height: var(--component-checkbox-input-sm-indicator-size);\n}\n\n/* CheckboxGroup styles */\n\n.stand-checkbox-group {\n\tdisplay: var(--component-checkbox-group-shared-display);\n\tflex-direction: var(--component-checkbox-group-shared-flex-direction);\n}\n\n.stand-checkbox-group.sm {\n\tgap: var(--component-checkbox-group-sm-gap);\n\tmargin-top: var(--component-checkbox-group-sm-margin-top);\n}\n\n.stand-checkbox-group.md {\n\tgap: var(--component-checkbox-group-md-gap);\n\tmargin-top: var(--component-checkbox-group-md-margin-top);\n}\n";
|
|
4
|
+
export declare const componentHtml = "<div class=\"container flow-column\">\n\t<div>\n\t\tCheckboxes can be built with the input HTML element, but this can be difficult to style. These examples only show basic size and color customisation.\n\t</div>\n\t<div class=\"stand-form-input-container md\">\n\t\t<label>Notifications</label>\n\t\t<span class=\"description\">Choose what to receive.</span>\n\t\t<div class=\"stand-checkbox-group md\">\n\t\t\t<div class=\"stand-checkbox md\">\n\t\t\t\t<input class=\"stand-checkbox-indicator\" type=\"checkbox\" id=\"email\" name=\"email\" />\n\t\t\t\t<label for=\"email\">Email</label>\n\t\t\t</div>\n\t\t\t<div class=\"stand-checkbox md\">\n\t\t\t\t<input class=\"stand-checkbox-indicator\" type=\"checkbox\" id=\"sms\" name=\"sms\" />\n\t\t\t\t<label for=\"sms\">SMS</label>\n\t\t\t</div>\n\t\t\t<div class=\"stand-checkbox md\">\n\t\t\t\t<input class=\"stand-checkbox-indicator\" type=\"checkbox\" id=\"push\" name=\"push\" />\n\t\t\t\t<label for=\"push\">Push notification</label>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class=\"stand-form-input-container sm\" data-invalid>\n\t\t<label>Preferences</label>\n\t\t<span class=\"description\">Please select at least one option.</span>\n\t\t<div class=\"stand-checkbox-group sm\">\n\t\t\t<div class=\"stand-checkbox sm\">\n\t\t\t\t<input class=\"stand-checkbox-indicator\" type=\"checkbox\" id=\"news\" name=\"news\" />\n\t\t\t\t<label for=\"news\">News</label>\n\t\t\t</div>\n\t\t\t<div class=\"stand-checkbox sm\">\n\t\t\t\t<input class=\"stand-checkbox-indicator\" type=\"checkbox\" id=\"offers\" name=\"offers\" />\n\t\t\t\t<label for=\"offers\">Offers</label>\n\t\t\t</div>\n\t\t</div>\n\t\t<span class=\"stand-inline-message stand-inline-message-error\"><span class=\"material-symbols\">warning</span> Username is already taken</span>\n\t</div>\n</div>\n";
|
|
5
|
+
export declare const componentJs = "\nimport { componentCheckbox, componentForm, componentInlineMessage } from \"@guardian/stand\";\n\n// example of creating a stylesheet in js\nconst sheet = new CSSStyleSheet();\n\n// apply the rules to the sheet\nsheet.replaceSync(`\n/* inline message styles - error */\n.js-stand-inline-message {\n display: ${componentInlineMessage.shared.display};\n align-items: ${componentInlineMessage.shared['align-items']};\n gap: ${componentInlineMessage.shared.gap};\n font: ${componentInlineMessage.shared.typography.font};\n letter-spacing: ${componentInlineMessage.shared.typography.letterSpacing};\n font-variation-settings: \"wdth\" ${componentInlineMessage.shared.typography.fontWidth};\n}\n\n.js-stand-inline-message > .material-symbols {\n font-size: ${componentInlineMessage.shared.icon.size};\n}\n\n.js-stand-inline-message > svg {\n width: ${componentInlineMessage.shared.icon.size};\n height: ${componentInlineMessage.shared.icon.size};\n}\n\n.js-stand-inline-message-error {\n color: ${componentInlineMessage.error.color};\n fill: ${componentInlineMessage.error.color};\n}\n\n/* form input container styles */\n\n.js-stand-form-input-container {\n\tdisplay: ${componentForm.input.shared.container.display};\n\tflex-direction: ${componentForm.input.shared.container[\"flex-direction\"]};\n\tgap: ${componentForm.input.shared.container.gap};\n\twidth: ${componentForm.input.shared.container.width};\n}\n\n.js-stand-form-input-container.sm {\n\tmax-width: ${componentForm.input.sm.container.maxWidth};\n}\n\n.js-stand-form-input-container.md {\n\tmax-width: ${componentForm.input.md.container.maxWidth};\n}\n\n.js-stand-form-input-container > label {\n\tcolor: ${componentForm.input.shared.label.color};\n\tfont: ${componentForm.input.md.label.typography.font};\n\tletter-spacing: ${componentForm.input.md.label.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentForm.input.md.label.typography.fontWidth};\n}\n\n.js-stand-form-input-container[data-disabled] > label {\n\tcolor: ${componentForm.input.shared.label.disabledColor};\n}\n\n.js-stand-form-input-container > span.description {\n\tcolor: ${componentForm.input.shared.description.color};\n\tfont: ${componentForm.input.shared.description.typography.font};\n\tletter-spacing: ${componentForm.input.shared.description.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentForm.input.shared.description.typography.fontWidth};\n}\n\n.js-stand-form-input-container[data-disabled] > span.description {\n\tcolor: ${componentForm.input.shared.description.disabledColor};\n}\n\n/* checkbox styles */\n\n.js-stand-checkbox {\n display: ${componentCheckbox.input.shared.display};\n position: ${componentCheckbox.input.shared.position};\n align-items: ${componentCheckbox.input.shared['align-items']};\n gap: ${componentCheckbox.input.shared.gap};\n cursor: ${componentCheckbox.input.shared.cursor};\n color: ${componentCheckbox.input.shared.color};\n font: ${componentCheckbox.input.md.typography.font};\n letter-spacing: ${componentCheckbox.input.md.typography.letterSpacing};\n font-variation-settings: \"wdth\" ${componentCheckbox.input.md.typography.fontWidth};\n}\n\n.js-stand-checkbox.sm {\n font: ${componentCheckbox.input.sm.typography.font};\n letter-spacing: ${componentCheckbox.input.sm.typography.letterSpacing};\n font-variation-settings: \"wdth\"\n\t${componentCheckbox.input.sm.typography.fontWidth};\n}\n\n.js-stand-checkbox > label {\n cursor: ${componentCheckbox.input.shared.cursor};\n}\n\n.js-stand-checkbox-indicator {\n /* Reset browser default styles for checkboxes */\n margin: 0;\n background-color: transparent;\n outline: none;\n\n /* component styles */\n cursor: ${componentCheckbox.input.shared.cursor};\n border: ${componentCheckbox.input.shared.indicator.border};\n border-radius: ${componentCheckbox.input.shared.indicator['border-radius']};\n accent-color: ${componentCheckbox.input.shared.indicator.selected['background-color']};\n}\n\n.js-stand-checkbox.md > .js-stand-checkbox-indicator {\n width: ${componentCheckbox.input.md.indicator.size};\n height: ${componentCheckbox.input.md.indicator.size};\n}\n\n.js-stand-checkbox.sm > .js-stand-checkbox-indicator {\n width: ${componentCheckbox.input.sm.indicator.size};\n height: ${componentCheckbox.input.sm.indicator.size};\n}\n\n/* CheckboxGroup styles */\n\n.js-stand-checkbox-group {\n\tdisplay: ${componentCheckbox.group.shared.display};\n\tflex-direction: ${componentCheckbox.group.shared[\"flex-direction\"]};\n}\n\n.js-stand-checkbox-group.sm {\n\tgap: ${componentCheckbox.group.sm.gap};\n\tmargin-top: ${componentCheckbox.group.sm.marginTop};\n}\n\n.js-stand-checkbox-group.md {\n\tgap: ${componentCheckbox.group.md.gap};\n\tmargin-top: ${componentCheckbox.group.md.marginTop};\n}\n`);\n\n// update the document with the sheet\ndocument.adoptedStyleSheets.push(sheet);\n\n// modify the dom with the button components using the generated stylesheet\ndocument.getElementById(\"app\").innerHTML = `\n<div class=\"container flow-column\">\n\t<div>\n\t\tCheckboxes can be built with the input HTML element, but this can be difficult to style. These examples only show basic size and color customisation.\n\t</div>\n\t<div class=\"js-stand-form-input-container md\">\n\t\t<label>Notifications</label>\n\t\t<span class=\"description\">Choose what to receive.</span>\n\t\t<div class=\"js-stand-checkbox-group md\">\n\t\t\t<div class=\"js-stand-checkbox md\">\n\t\t\t\t<input class=\"js-stand-checkbox-indicator\" type=\"checkbox\" id=\"email\" name=\"email\" />\n\t\t\t\t<label for=\"email\">Email</label>\n\t\t\t</div>\n\t\t\t<div class=\"js-stand-checkbox md\">\n\t\t\t\t<input class=\"js-stand-checkbox-indicator\" type=\"checkbox\" id=\"sms\" name=\"sms\" />\n\t\t\t\t<label for=\"sms\">SMS</label>\n\t\t\t</div>\n\t\t\t<div class=\"js-stand-checkbox md\">\n\t\t\t\t<input class=\"js-stand-checkbox-indicator\" type=\"checkbox\" id=\"push\" name=\"push\" />\n\t\t\t\t<label for=\"push\">Push notification</label>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class=\"js-stand-form-input-container sm\" data-invalid>\n\t\t<label>Preferences</label>\n\t\t<span class=\"description\">Please select at least one option.</span>\n\t\t<div class=\"js-stand-checkbox-group sm\">\n\t\t\t<div class=\"js-stand-checkbox sm\">\n\t\t\t\t<input class=\"js-stand-checkbox-indicator\" type=\"checkbox\" id=\"news\" name=\"news\" />\n\t\t\t\t<label for=\"news\">News</label>\n\t\t\t</div>\n\t\t\t<div class=\"js-stand-checkbox sm\">\n\t\t\t\t<input class=\"js-stand-checkbox-indicator\" type=\"checkbox\" id=\"offers\" name=\"offers\" />\n\t\t\t\t<label for=\"offers\">Offers</label>\n\t\t\t</div>\n\t\t</div>\n\t\t<span class=\"js-stand-inline-message js-stand-inline-message-error\"><span class=\"material-symbols\">warning</span> Username is already taken</span>\n\t</div>\n</div>\n`;\n\n";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const componentName = "Checkbox";
|
|
2
|
+
export declare const componentTsx = "import { Checkbox } from '@guardian/stand/checkbox';\n\nexport const Component = () => (\n\t<>\n\t\t<Checkbox>Accept terms and conditions</Checkbox>\n\n\t\t<Checkbox isInvalid>Required option</Checkbox>\n\n\t\t<Checkbox isDisabled>Unavailable option</Checkbox>\n\n\t\t<Checkbox size=\"sm\" isIndeterminate isSelected>\n\t\t\tSelect all\n\t\t</Checkbox>\n\t</>\n);\n";
|
|
3
|
+
export declare const componentCss = "\n/* import the checkbox styles */\n@import \"@guardian/stand/component/checkbox.css\";\n\n.stand-checkbox {\n display: var(--component-checkbox-input-shared-display);\n position: var(--component-checkbox-input-shared-position);\n align-items: var(--component-checkbox-input-shared-align-items);\n gap: var(--component-checkbox-input-shared-gap);\n cursor: var(--component-checkbox-input-shared-cursor);\n color: var(--component-checkbox-input-shared-color);\n}\n\n.stand-checkbox.md {\n font: var(--component-checkbox-input-md-typography-font);\n letter-spacing: var(--component-checkbox-input-md-typography-letter-spacing);\n font-variation-settings: \"wdth\"\n var(--component-checkbox-input-md-typography-font-width);\n}\n\n.stand-checkbox.sm {\n font: var(--component-checkbox-input-sm-typography-font);\n letter-spacing: var(--component-checkbox-input-sm-typography-letter-spacing);\n font-variation-settings: \"wdth\"\n\tvar(--component-checkbox-input-sm-typography-font-width);\n}\n\n.stand-checkbox > label {\n cursor: var(--component-checkbox-input-shared-cursor);\n}\n\n.stand-checkbox-indicator {\n /* Reset browser default styles for checkboxes */\n margin: 0;\n background-color: transparent;\n outline: none;\n\n /* component styles */\n cursor: var(--component-checkbox-input-shared-cursor);\n border: var(--component-checkbox-input-shared-indicator-border);\n border-radius: var(--component-checkbox-input-shared-indicator-border-radius);\n accent-color: var(\n --component-checkbox-input-shared-indicator-selected-background-color\n );\n}\n\n.stand-checkbox.md > .stand-checkbox-indicator {\n width: var(--component-checkbox-input-md-indicator-size);\n height: var(--component-checkbox-input-md-indicator-size);\n}\n\n.stand-checkbox.sm > .stand-checkbox-indicator {\n width: var(--component-checkbox-input-sm-indicator-size);\n height: var(--component-checkbox-input-sm-indicator-size);\n}\n";
|
|
4
|
+
export declare const componentHtml = "<div class=\"container flow-column\">\n\t<div>\n\t\tCheckboxes can be built with the input HTML element, but this can be difficult to style. These examples only show basic size and color customisation.\n\t</div>\n\t<div class=\"stand-checkbox md\">\n \t<input class=\"stand-checkbox-indicator\" type=\"checkbox\" id=\"terms\" name=\"terms\" />\n \t<label for=\"terms\">Accept terms and conditions</label>\n \t</div>\n\t<div class=\"stand-checkbox sm\">\n \t<input class=\"stand-checkbox-indicator\" type=\"checkbox\" id=\"terms\" name=\"terms\" />\n \t<label for=\"terms\">Required option</label>\n \t</div>\n</div>\n";
|
|
5
|
+
export declare const componentJs = "\nimport { componentCheckbox } from \"@guardian/stand\";\n\n// example of creating a stylesheet in js\nconst sheet = new CSSStyleSheet();\n\n// apply the rules to the sheet\nsheet.replaceSync(`\n .js-stand-checkbox {\n\tdisplay: ${componentCheckbox.input.shared.display};\n\tposition: ${componentCheckbox.input.shared.position};\n\talign-items: ${componentCheckbox.input.shared['align-items']};\n\tgap: ${componentCheckbox.input.shared.gap};\n\tcursor: ${componentCheckbox.input.shared.cursor};\n\tcolor: ${componentCheckbox.input.shared.color};\n\tfont: ${componentCheckbox.input.md.typography.font};\n\tletter-spacing: ${componentCheckbox.input.md.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentCheckbox.input.md.typography.fontWidth};\n }\n\n .js-stand-checkbox.md {\n\tfont: ${componentCheckbox.input.md.typography.font};\n\tletter-spacing: ${componentCheckbox.input.md.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentCheckbox.input.md.typography.fontWidth};\n }\n\n .js-stand-checkbox.sm {\n\tfont: ${componentCheckbox.input.sm.typography.font};\n\tletter-spacing: ${componentCheckbox.input.sm.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentCheckbox.input.sm.typography.fontWidth};\n }\n\n .js-stand-checkbox > label {\n\tcursor: ${componentCheckbox.input.shared.cursor};\n }\n\n .js-stand-checkbox-indicator {\n\t/* Reset browser default styles for checkboxes */\n\tmargin: 0;\n\tbackground-color: transparent;\n\toutline: none;\n\n\t/* component styles */\n\tcursor: ${componentCheckbox.input.shared.cursor};\n\tborder: ${componentCheckbox.input.shared.indicator.border};\n\tborder-radius: ${componentCheckbox.input.shared.indicator['border-radius']};\n\taccent-color: ${componentCheckbox.input.shared.indicator.selected['background-color']};\n }\n\n .js-stand-checkbox.md > .js-stand-checkbox-indicator {\n\twidth: ${componentCheckbox.input.md.indicator.size};\n\theight: ${componentCheckbox.input.md.indicator.size};\n }\n\n .js-stand-checkbox.sm > .js-stand-checkbox-indicator {\n\twidth: ${componentCheckbox.input.sm.indicator.size};\n\theight: ${componentCheckbox.input.sm.indicator.size};\n }\n`);\n\n// update the document with the sheet\ndocument.adoptedStyleSheets.push(sheet);\n\n// modify the dom with the button components using the generated stylesheet\ndocument.getElementById(\"app\").innerHTML = `\n<div class=\"container flow-column\">\n\t<div>\n\t\tCheckboxes can be built with the input HTML element, but this can be difficult to style. These examples only show basic size and color customisation.\n\t</div>\n\t<div class=\"js-stand-checkbox md\">\n\t\t<input class=\"js-stand-checkbox-indicator\" type=\"checkbox\" id=\"terms\" name=\"terms\" />\n\t\t<label for=\"terms\">Accept terms and conditions</label>\n\t</div>\n\t<div class=\"js-stand-checkbox sm\">\n\t\t<input class=\"js-stand-checkbox-indicator\" type=\"checkbox\" id=\"terms\" name=\"terms\" />\n\t\t<label for=\"terms\">Required option</label>\n\t</div>\n</div>\n`;\n\n";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import type { ComponentCheckbox } from '../../styleD/build/typescript/component/checkbox';
|
|
3
|
+
import type { Prettify } from '../../util/types';
|
|
4
|
+
import type { CheckboxGroupProps, CheckboxProps } from './types';
|
|
5
|
+
export type CheckboxTheme = Prettify<ComponentCheckbox>;
|
|
6
|
+
export type PartialCheckboxTheme = Prettify<Partial<CheckboxTheme>>;
|
|
7
|
+
export declare const defaultCheckboxTheme: CheckboxTheme;
|
|
8
|
+
export declare const checkboxStyles: (theme: CheckboxTheme, { size, isIndeterminate, }: Required<Pick<CheckboxProps, 'size' | 'isIndeterminate'>>) => SerializedStyles;
|
|
9
|
+
export declare const checkboxLabelStyles: (theme: CheckboxTheme) => SerializedStyles;
|
|
10
|
+
export declare const checkboxGroupStyles: (theme: CheckboxTheme, { size }: Required<Pick<CheckboxGroupProps, 'size'>>, hasError?: boolean) => SerializedStyles;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CheckboxGroupProps as RACCheckboxGroupProps, CheckboxProps as RACCheckboxProps } from 'react-aria-components';
|
|
2
|
+
import type { DefaultPropsWithChildren } from '../../util/types';
|
|
3
|
+
import type { FormInputContainerDefaultProps } from '../form/types';
|
|
4
|
+
import type { CheckboxTheme } from './styles';
|
|
5
|
+
export interface CheckboxProps extends DefaultPropsWithChildren<CheckboxTheme, RACCheckboxProps['className']>, Omit<RACCheckboxProps, 'children'> {
|
|
6
|
+
/**
|
|
7
|
+
* Size variant of the Checkbox
|
|
8
|
+
*/
|
|
9
|
+
size?: keyof Omit<CheckboxTheme['input'], 'shared'>;
|
|
10
|
+
}
|
|
11
|
+
export type CheckboxGroupProps = FormInputContainerDefaultProps<RACCheckboxGroupProps, CheckboxTheme['group']>;
|
|
@@ -36,5 +36,5 @@ export type FormInputContainerDefaultProps<ReactAriaInput extends {
|
|
|
36
36
|
* The React Aria form container components FormInputContainer supports.
|
|
37
37
|
* Add new components here
|
|
38
38
|
*/
|
|
39
|
-
export declare const ALLOWED_FORM_CONTAINERS: readonly [(props: import("react-aria-components").TextFieldProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null, <T extends object = {}, M extends "single" | "multiple" = "single">(props: import("react-aria-components").SelectProps<T, M> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null];
|
|
39
|
+
export declare const ALLOWED_FORM_CONTAINERS: readonly [(props: import("react-aria-components").TextFieldProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null, <T extends object = {}, M extends "single" | "multiple" = "single">(props: import("react-aria-components").SelectProps<T, M> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null, (props: import("react-aria-components").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null, (props: import("react-aria-components").CheckboxGroupProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null];
|
|
40
40
|
export type AllowedContainer = (typeof ALLOWED_FORM_CONTAINERS)[number];
|
|
@@ -6,3 +6,4 @@ export type InlineMessageTheme = Prettify<ComponentInlineMessage>;
|
|
|
6
6
|
export type PartialInlineMessageTheme = DeepPartial<InlineMessageTheme>;
|
|
7
7
|
export declare const defaultInlineMessageTheme: InlineMessageTheme;
|
|
8
8
|
export declare const inlineMessageStyles: (theme: InlineMessageTheme, { level }: Required<Pick<InlineMessageProps, 'level'>>) => SerializedStyles;
|
|
9
|
+
export declare const inlineMessageIconStyles: (theme: InlineMessageTheme) => SerializedStyles;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { RadioGroupProps, RadioProps } from './types';
|
|
2
|
+
export declare function RadioGroup({ size, isInvalid, theme, children, ...props }: RadioGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function Radio({ theme, size, children, isInvalid, ...props }: RadioProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const componentName = "RadioGroup";
|
|
2
|
+
export declare const componentTsx = "import { Radio, RadioGroup } from '@guardian/stand/radio-group';\n\nexport const Component = () => (\n\t<RadioGroup\n\t\tlabel=\"Option\"\n\t\tdescription=\"This is a description for the radio button input\"\n\t>\n\t\t<Radio value=\"one\">Option 1</Radio>\n\t\t<Radio value=\"two\">Option 2</Radio>\n\t</RadioGroup>\n);\n";
|
|
3
|
+
export declare const componentCss = "\n/* import the radiogroup styles */\n@import '@guardian/stand/component/radioGroup.css';\n@import '@guardian/stand/component/form.css';\n\n/* form input container styles */\n\n.stand-form-input-container {\n\tdisplay: var(--component-form-input-shared-container-display);\n\tflex-direction: var(--component-form-input-shared-container-flex-direction);\n\tgap: var(--component-form-input-shared-container-gap);\n\twidth: var(--component-form-input-shared-container-width);\n}\n\n.stand-form-input-container > label {\n\tcolor: var(--component-form-input-shared-label-color);\n\tfont: var(--component-form-input-md-label-typography-font);\n\tletter-spacing: var(--component-form-input-md-label-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-form-input-md-label-typography-font-width);\n}\n\n.stand-form-input-container > span.description {\n\tcolor: var(--component-form-input-shared-description-color);\n\tfont: var(--component-form-input-shared-description-typography-font);\n\tletter-spacing: var(--component-form-input-shared-description-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-form-input-shared-description-typography-font-width);\n}\n\n/* radiogroup styles */\n\n.stand-radio-group {\n\tdisplay: var(--component-radio-group-shared-display);\n\tflex-direction: var(--component-radio-group-shared-flex-direction);\n\tgap: var(--component-radio-group-md-gap);\n\tmargin-top: var(--component-radio-group-shared-margin-top);\n\tmargin-bottom: var(--component-radio-group-shared-margin-bottom);\n}\n\n.stand-radio {\n\tdisplay: var(--component-radio-group-shared-radio-display);\n\talign-items: var(--component-radio-group-shared-radio-align-items);\n\tgap: var(--component-radio-group-shared-radio-gap);\n\tfont: var(--component-radio-group-md-typography-font);\n\tletter-spacing: var(--component-radio-group-md-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-radio-group-md-typography-font-width);\n\tcolor: var(--component-radio-group-shared-radio-color);\n}\n\n.stand-radio input {\n\tposition: var(--component-radio-group-shared-indicator-position);\n\twidth: var(--component-radio-group-md-indicator-width);\n\theight: var(--component-radio-group-md-indicator-height);\n\tborder-radius: var(--component-radio-group-shared-indicator-border-radius);\n\tborder: var(--component-radio-group-shared-indicator-border);\n}\n\n.stand-radio > input::after {\n\tcontent: '';\n\tposition: var(--component-radio-group-shared-indicator-after-position);\n\tborder-radius: var(--component-radio-group-shared-indicator-after-border-radius);\n\tinset: var(--component-radio-group-shared-indicator-after-inset);\n\tscale: var(--component-radio-group-shared-indicator-after-scale);\n}\n";
|
|
4
|
+
export declare const componentHtml = "<div class=\"container\">\n<div class=\"stand-form-input-container\">\n\t<label>Options</label>\n\t<span class=\"description\">This is a description for the radio group.</span>\n\t<div class=\"stand-radio-group\">\n\t\t<div class=\"stand-radio\">\n\t\t\t<input type=\"radio\" value=\"one\" name=\"option\" />\n\t\t\t<label>Option 1</label>\n\t\t</div>\n\t\t<div class=\"stand-radio\">\n\t\t\t<input type=\"radio\" value=\"two\" name=\"option\" />\n\t\t\t<label>Option 2</label>\n\t\t</div>\n\t</div>\n</div>\n</div>\n";
|
|
5
|
+
export declare const componentJs = "\nimport { componentRadioGroup, componentForm } from \"@guardian/stand\";\n\n// example of creating a stylesheet in js\nconst sheet = new CSSStyleSheet();\n\n// apply the rules to the sheet\nsheet.replaceSync(`\n/* form input container styles */\n\n.stand-form-input-container {\n\tdisplay: ${componentForm.input.shared.container.display};\n\tflex-direction: ${componentForm.input.shared.container['flex-direction']};\n\tgap: ${componentForm.input.shared.container.gap};\n\twidth: ${componentForm.input.shared.container.width};\n}\n\n.stand-form-input-container > label {\n\tcolor: ${componentForm.input.shared.label.color};\n\tfont: ${componentForm.input.shared.label.font};\n\tletter-spacing: ${componentForm.input.shared.label.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentForm.input.shared.label.fontWidth};\n}\n\n.stand-form-input-container > span.description {\n\tcolor: ${componentForm.input.shared.description.color};\n\tfont: ${componentForm.input.shared.description.font};\n\tletter-spacing: ${componentForm.input.shared.description.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentForm.input.shared.description.fontWidth};\n}\n\n.stand-radio-group {\n\tdisplay: ${componentRadioGroup.shared.display};\n\tflex-direction: ${componentRadioGroup.shared.flexDirection};\n\tgap: ${componentRadioGroup.md.gap};\n\tmargin-top: ${componentRadioGroup.shared.marginTop};\n\tmargin-bottom: ${componentRadioGroup.shared.marginBottom};\n}\n\n.stand-radio {\n\tdisplay: ${componentRadioGroup.shared.radio.display};\n\talign-items: ${componentRadioGroup.shared.radio.alignItems};\n\tgap: ${componentRadioGroup.shared.radio.gap};\n\tfont: ${componentRadioGroup.md.typography.font};\n\tletter-spacing: ${componentRadioGroup.md.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentRadioGroup.md.typography.fontWidth};\n\tcolor: ${componentRadioGroup.shared.radio.color};\n}\n\n.stand-radio input {\n\tposition: ${componentRadioGroup.shared.indicator.position};\n\twidth: ${componentRadioGroup.md.indicator.width};\n\theight: ${componentRadioGroup.md.indicator.height};\n\tborder-radius: ${componentRadioGroup.shared.indicator.borderRadius};\n\tborder: ${componentRadioGroup.shared.indicator.border};\n}\n\n.stand-radio > input::after {\n\tcontent: '';\n\tposition: ${componentRadioGroup.shared.indicator.after.position};\n\tborder-radius: ${componentRadioGroup.shared.indicator.after.borderRadius};\n\tinset: ${componentRadioGroup.shared.indicator.after.inset};\n\tscale: ${componentRadioGroup.shared.indicator.after.scale};\n}\n`);\n\n// update the document with the sheet\ndocument.adoptedStyleSheets.push(sheet);\n\n// modify the dom with the button components using the generated stylesheet\ndocument.getElementById(\"app\").innerHTML = `\n<div class=\"container\">\n<div class=\"stand-form-input-container\">\n\t<label>Options</label>\n\t<span class=\"description\">This is a description for the radio group.</span>\n\t<div class=\"stand-radio-group\">\n\t\t<div class=\"stand-radio\">\n\t\t\t<input type=\"radio\" value=\"one\" name=\"option\" />\n\t\t\t<label>Option 1</label>\n\t\t</div>\n\t\t<div class=\"stand-radio\">\n\t\t\t<input type=\"radio\" value=\"two\" name=\"option\" />\n\t\t\t<label>Option 2</label>\n\t\t</div>\n\t</div>\n</div>\n</div>\n`;\n";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import type { ComponentRadioGroup } from '../../styleD/build/typescript/component/radioGroup';
|
|
3
|
+
import type { Prettify } from '../../util/types';
|
|
4
|
+
import type { RadioGroupProps } from './types';
|
|
5
|
+
export type RadioGroupTheme = Prettify<ComponentRadioGroup>;
|
|
6
|
+
export declare const defaultRadioGroupTheme: RadioGroupTheme;
|
|
7
|
+
export declare const radioGroupStyles: (theme: RadioGroupTheme, { size }: Required<Pick<RadioGroupProps, 'size'>>) => SerializedStyles;
|
|
8
|
+
export declare const radioStyles: (theme: RadioGroupTheme, { size, isInvalid }: Required<Pick<RadioGroupProps, 'size' | 'isInvalid'>>) => SerializedStyles;
|
|
9
|
+
export declare const radioIndicatorStyles: (theme: RadioGroupTheme, { size, isInvalid }: Required<Pick<RadioGroupProps, 'size' | 'isInvalid'>>) => SerializedStyles;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RadioGroupProps as RACRadioGroupProps, RadioProps as RACRadioProps } from 'react-aria-components';
|
|
2
|
+
import type { DefaultProps } from '../../util/types';
|
|
3
|
+
import type { FormInputContainerDefaultProps } from '../form/types';
|
|
4
|
+
import type { RadioGroupTheme } from './styles';
|
|
5
|
+
export type RadioGroupProps = FormInputContainerDefaultProps<RACRadioGroupProps, RadioGroupTheme>;
|
|
6
|
+
export interface RadioProps extends DefaultProps<RadioGroupTheme, RACRadioProps['className']>, RACRadioProps {
|
|
7
|
+
size?: keyof Omit<RadioGroupTheme, 'shared'>;
|
|
8
|
+
/** Whether the input value is invalid. */
|
|
9
|
+
isInvalid?: boolean;
|
|
10
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { TopBarToolNameProps } from './types';
|
|
2
|
-
export declare const TopBarToolName: (
|
|
2
|
+
export declare const TopBarToolName: (props: TopBarToolNameProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -4,6 +4,8 @@ import type { DeepPartial, Prettify } from '../../../util/types';
|
|
|
4
4
|
export type TopBarToolNameTheme = Prettify<ComponentTopBar['ToolName']>;
|
|
5
5
|
export type PartialTopBarToolNameTheme = DeepPartial<TopBarToolNameTheme>;
|
|
6
6
|
export declare const defaultToolNameTheme: TopBarToolNameTheme;
|
|
7
|
+
export declare const toolNameHoverLinkStyles: (theme: TopBarToolNameTheme) => SerializedStyles;
|
|
8
|
+
export declare const toolNameLinkStyles: (theme: TopBarToolNameTheme) => SerializedStyles;
|
|
7
9
|
export declare const toolNameStyles: (theme: TopBarToolNameTheme) => SerializedStyles;
|
|
8
10
|
export declare const toolNameTypography: (theme: TopBarToolNameTheme) => SerializedStyles;
|
|
9
11
|
export declare const dividerStyles: (theme: TopBarToolNameTheme) => SerializedStyles;
|