@raspberrypifoundation/design-system-react 1.6.0 → 2.0.0-beta.1
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 +16 -1
- package/README.md +63 -10
- package/dist/rpf-design-system-react.css +1 -0
- package/dist/rpf-design-system-react.js +2744 -0
- package/dist/rpf-design-system-react.umd.cjs +35 -0
- package/dist/scss/components/accordion.scss +94 -0
- package/dist/scss/components/alert.scss +131 -0
- package/dist/scss/components/burger-menu.scss +89 -0
- package/dist/scss/components/button.scss +321 -0
- package/dist/scss/components/forms/error-message.scss +20 -0
- package/dist/scss/components/forms/fieldset.scss +42 -0
- package/dist/scss/components/forms/input-checkbox.scss +62 -0
- package/dist/scss/components/forms/input-label.scss +36 -0
- package/dist/scss/components/forms/input-number.scss +61 -0
- package/dist/scss/components/forms/input-password.scss +109 -0
- package/dist/scss/components/forms/input-radio.scss +63 -0
- package/dist/scss/components/forms/input-search.scss +65 -0
- package/dist/scss/components/forms/input-select.scss +14 -0
- package/dist/scss/components/forms/input-text.scss +5 -0
- package/dist/scss/components/forms/input-textarea.scss +12 -0
- package/dist/scss/components/forms/inputs.scss +40 -0
- package/dist/scss/components/layout/decorative-section.scss +185 -0
- package/dist/scss/components/link.scss +51 -0
- package/dist/scss/components/menu-item.scss +66 -0
- package/dist/scss/components/menu-title.scss +25 -0
- package/dist/scss/components/menu.scss +31 -0
- package/dist/scss/components/progress-bar.scss +43 -0
- package/dist/scss/components/squiggle.scss +46 -0
- package/dist/scss/components/table/table-cell.scss +82 -0
- package/dist/scss/components/table/table.scss +32 -0
- package/dist/scss/components/tag.scss +50 -0
- package/dist/scss/design-system-core.scss +37 -0
- package/dist/scss/mixins/_inputs.scss +19 -0
- package/dist/scss/mixins/_typography.scss +75 -0
- package/dist/scss/properties/_border.scss +13 -0
- package/dist/scss/properties/_font-size.scss +14 -0
- package/dist/scss/properties/_font-weight.scss +4 -0
- package/dist/scss/properties/_line-height.scss +15 -0
- package/dist/scss/properties/_shadows.scss +7 -0
- package/dist/scss/properties/_sizing.scss +6 -0
- package/dist/scss/properties/_spacing.scss +16 -0
- package/dist/scss/properties/colors/_alert.scss +10 -0
- package/dist/scss/properties/colors/_brand.scss +14 -0
- package/dist/scss/properties/colors/_decorative.scss +58 -0
- package/dist/scss/properties/colors/_greys.scss +18 -0
- package/dist/scss/properties/colors/_inputs.scss +13 -0
- package/dist/scss/properties/colors/_text.scss +7 -0
- package/package.json +59 -84
- package/dist/cjs/bundle.js +0 -1809
- package/dist/esm/bundle.js +0 -1791
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
@forward '../properties/colors/brand';
|
|
2
|
+
@forward '../properties/colors/decorative';
|
|
3
|
+
@forward '../properties/colors/greys';
|
|
4
|
+
@forward '../properties/colors/alert';
|
|
5
|
+
@forward '../properties/font-size';
|
|
6
|
+
@forward '../properties/font-weight';
|
|
7
|
+
@forward '../properties/border';
|
|
8
|
+
@forward '../properties/spacing';
|
|
9
|
+
@forward '../properties/sizing';
|
|
10
|
+
|
|
11
|
+
.rpf-button {
|
|
12
|
+
// Default button variables
|
|
13
|
+
--rpf-button-background-color: var(--rpf-navy-800);
|
|
14
|
+
--rpf-button-background-color-hover: var(--rpf-navy-900);
|
|
15
|
+
--rpf-button-background-color-active: var(--rpf-navy-600);
|
|
16
|
+
--rpf-button-background-color-disabled: var(--rpf-grey-600);
|
|
17
|
+
--rpf-button-text-color: var(--rpf-white);
|
|
18
|
+
|
|
19
|
+
--rpf-button-border-color: var(--rpf-button-background-color);
|
|
20
|
+
--rpf-button-border-color-hover: var(--rpf-button-background-color-hover);
|
|
21
|
+
--rpf-button-border-color-active: var(--rpf-button-background-color-active);
|
|
22
|
+
--rpf-button-border-color-disabled: var(--rpf-button-background-color-disabled);
|
|
23
|
+
|
|
24
|
+
// Danger button variables
|
|
25
|
+
--rpf-button-danger-background-color: var(--rpf-alert-error);
|
|
26
|
+
--rpf-button-danger-background-color-hover: var(--rpf-alert-error);
|
|
27
|
+
--rpf-button-danger-background-color-active: var(--rpf-red-900);
|
|
28
|
+
--rpf-button-danger-background-color-disabled: var(--rpf-grey-600);
|
|
29
|
+
--rpf-button-danger-text-color: var(--rpf-white);
|
|
30
|
+
|
|
31
|
+
--rpf-button-danger-border-color: var(--rpf-button-danger-background-color);
|
|
32
|
+
--rpf-button-danger-border-color-hover: var(--rpf-button-danger-background-color-hover);
|
|
33
|
+
--rpf-button-danger-border-color-active: var(--rpf-button-danger-background-color-active);
|
|
34
|
+
--rpf-button-danger-border-color-disabled: var(--rpf-button-danger-background-color-disabled);
|
|
35
|
+
|
|
36
|
+
--rpf-button-border-radius: var(--border-radius);
|
|
37
|
+
--rpf-button-border-width: var(--border-width-md); // After a 3D effect? Use combined values, e.g. `2px 2px 4px 2px`
|
|
38
|
+
|
|
39
|
+
--rpf-button-lg-height: var(--lg-target-size);
|
|
40
|
+
--rpf-button-sm-height: var(--sm-target-size);
|
|
41
|
+
--rpf-button-min-target-size: var(--min-target-size);
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
all: unset;
|
|
45
|
+
align-items: center;
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
color: var(--rpf-button-text-color);
|
|
48
|
+
/*
|
|
49
|
+
* We've decided to follow the masses on this and have a pointer on buttons.
|
|
50
|
+
* Google, Facebook, Twitter, Mozilla, and Microsoft amongst many others have a pointer on buttons.
|
|
51
|
+
*/
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
display: flex;
|
|
54
|
+
font-size: var(--font-size-1-5);
|
|
55
|
+
font-weight: var(--font-weight-bold);
|
|
56
|
+
gap: var(--space-1);
|
|
57
|
+
min-block-size: var(--rpf-button-lg-height);
|
|
58
|
+
padding: var(--space-1) var(--space-2);
|
|
59
|
+
position: relative;
|
|
60
|
+
text-align: center;
|
|
61
|
+
text-decoration: none;
|
|
62
|
+
/* Fixes a rendering error that sometimes occurs due to negative z-index */
|
|
63
|
+
transform: scale(1);
|
|
64
|
+
inline-size: fit-content;
|
|
65
|
+
|
|
66
|
+
/* A bit of a hack to allow for separate visual and target heights */
|
|
67
|
+
&::before {
|
|
68
|
+
background-color: var(--rpf-button-background-color);
|
|
69
|
+
border-color: var(--rpf-button-border-color);
|
|
70
|
+
border-radius: var(--rpf-button-border-radius);
|
|
71
|
+
border-style: solid;
|
|
72
|
+
border-width: var(--rpf-button-border-width);
|
|
73
|
+
content: '';
|
|
74
|
+
display: block;
|
|
75
|
+
inset: 0;
|
|
76
|
+
position: absolute;
|
|
77
|
+
/* To ensure it renders under its siblings */
|
|
78
|
+
z-index: -1;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:hover::before {
|
|
82
|
+
background-color: var(--rpf-button-background-color-hover);
|
|
83
|
+
border-color: var(--rpf-button-border-color-hover);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:active::before {
|
|
87
|
+
background-color: var(--rpf-button-background-color-active);
|
|
88
|
+
border-color: var(--rpf-button-border-color-active);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&:focus-visible::before {
|
|
92
|
+
outline: var(--border-width-md) solid var(--rpf-button-background-color);
|
|
93
|
+
outline-offset: 3px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&:disabled,
|
|
97
|
+
&--disabled {
|
|
98
|
+
cursor: default;
|
|
99
|
+
|
|
100
|
+
&::before,
|
|
101
|
+
&:hover::before {
|
|
102
|
+
border-color: var(--rpf-button-border-color-disabled);
|
|
103
|
+
background-color: var(--rpf-button-background-color-disabled);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&--secondary {
|
|
108
|
+
color: var(--rpf-button-background-color);
|
|
109
|
+
|
|
110
|
+
&::before {
|
|
111
|
+
background-color: var(--rpf-button-text-color);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:hover {
|
|
115
|
+
color: var(--rpf-button-background-color-hover);
|
|
116
|
+
|
|
117
|
+
&::before {
|
|
118
|
+
background-color: var(--rpf-button-text-color);
|
|
119
|
+
border-color: var(--rpf-button-border-color-hover);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&:active {
|
|
124
|
+
color: var(--rpf-button-background-color-active);
|
|
125
|
+
|
|
126
|
+
&::before {
|
|
127
|
+
background-color: var(--rpf-button-text-color);
|
|
128
|
+
border-color: var(--rpf-button-border-color-active);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&:disabled,
|
|
133
|
+
&.rpf-button--disabled {
|
|
134
|
+
color: var(--rpf-button-background-color-disabled);
|
|
135
|
+
|
|
136
|
+
&:hover::before,
|
|
137
|
+
&:before {
|
|
138
|
+
background-color: var(--rpf-button-text-color);
|
|
139
|
+
border-color: var(--rpf-button-border-color-disabled);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&.rpf-button--danger {
|
|
144
|
+
color: var(--rpf-button-danger-background-color);
|
|
145
|
+
|
|
146
|
+
&::before {
|
|
147
|
+
background-color: var(--rpf-button-danger-text-color);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&:hover {
|
|
151
|
+
color: var(--rpf-button-danger-background-color-hover);
|
|
152
|
+
|
|
153
|
+
&::before {
|
|
154
|
+
background-color: var(--rpf-button-danger-text-color);
|
|
155
|
+
border-color: var(--rpf-button-danger-border-color-hover);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&:active {
|
|
160
|
+
color: var(--rpf-button-danger-background-color-active);
|
|
161
|
+
|
|
162
|
+
&::before {
|
|
163
|
+
background-color: var(--rpf-button-danger-text-color);
|
|
164
|
+
border-color: var(--rpf-button-danger-border-color-active);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&:disabled,
|
|
169
|
+
&.rpf-button--disabled {
|
|
170
|
+
color: var(--rpf-button-danger-background-color-disabled);
|
|
171
|
+
|
|
172
|
+
&:hover::before,
|
|
173
|
+
&:before {
|
|
174
|
+
background-color: var(--rpf-button-danger-text-color);
|
|
175
|
+
border-color: var(--rpf-button-danger-border-color-disabled);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&--tertiary {
|
|
182
|
+
color: var(--rpf-button-background-color);
|
|
183
|
+
|
|
184
|
+
&::before {
|
|
185
|
+
background-color: transparent;
|
|
186
|
+
border-color: transparent;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&:hover {
|
|
190
|
+
color: var(--rpf-button-background-color-hover);
|
|
191
|
+
|
|
192
|
+
&::before {
|
|
193
|
+
background-color: transparent;
|
|
194
|
+
border-color: transparent;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&:active {
|
|
199
|
+
color: var(--rpf-button-background-color-active);
|
|
200
|
+
|
|
201
|
+
&::before {
|
|
202
|
+
background-color: transparent;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
&:disabled,
|
|
207
|
+
&.rpf-button--disabled {
|
|
208
|
+
color: var(--rpf-button-background-color-disabled);
|
|
209
|
+
|
|
210
|
+
&::before,
|
|
211
|
+
&:hover::before {
|
|
212
|
+
background-color: transparent;
|
|
213
|
+
border-color: transparent;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&.rpf-button--danger {
|
|
218
|
+
color: var(--rpf-button-danger-background-color);
|
|
219
|
+
|
|
220
|
+
&::before {
|
|
221
|
+
background-color: transparent;
|
|
222
|
+
border-color: transparent;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&:hover {
|
|
226
|
+
color: var(--rpf-button-danger-background-color-hover);
|
|
227
|
+
|
|
228
|
+
&::before {
|
|
229
|
+
background-color: transparent;
|
|
230
|
+
border-color: transparent;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
&:active {
|
|
235
|
+
color: var(--rpf-button-danger-background-color-active);
|
|
236
|
+
|
|
237
|
+
&::before {
|
|
238
|
+
background-color: transparent;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
&:disabled,
|
|
243
|
+
&.rpf-button--disabled {
|
|
244
|
+
color: var(--rpf-button-danger-background-color-disabled);
|
|
245
|
+
|
|
246
|
+
&::before,
|
|
247
|
+
&:hover::before {
|
|
248
|
+
background-color: transparent;
|
|
249
|
+
border-color: transparent;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
&--danger {
|
|
256
|
+
color: var(--rpf-button-danger-text-color);
|
|
257
|
+
|
|
258
|
+
&::before {
|
|
259
|
+
background-color: var(--rpf-button-danger-background-color);
|
|
260
|
+
border-color: var(--rpf-button-danger-border-color);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
&:hover::before {
|
|
264
|
+
background-color: var(--rpf-button-danger-background-color-hover);
|
|
265
|
+
border-color: var(--rpf-button-danger-border-color-hover);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
&:active::before {
|
|
269
|
+
background-color: var(--rpf-button-danger-background-color-active);
|
|
270
|
+
border-color: var(--rpf-button-danger-border-color-active);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
&:focus-visible::before {
|
|
274
|
+
outline: var(--border-width-md) solid var(--rpf-button-danger-background-color);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
&--icon-only {
|
|
279
|
+
block-size: var(--rpf-button-lg-height);
|
|
280
|
+
line-height: var(--rpf-button-lg-height);
|
|
281
|
+
padding: 0;
|
|
282
|
+
text-align: center;
|
|
283
|
+
inline-size: var(--rpf-button-lg-height);
|
|
284
|
+
|
|
285
|
+
.rpf-button__icon {
|
|
286
|
+
margin: 0 auto;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
&--sm {
|
|
291
|
+
font-size: var(--font-size-1);
|
|
292
|
+
min-block-size: var(--rpf-button-min-target-size);
|
|
293
|
+
padding: var(--space-1) var(--space-1);
|
|
294
|
+
|
|
295
|
+
/* To account for 32px visual height and 44px target height */
|
|
296
|
+
&::before {
|
|
297
|
+
inset: calc(calc(var(--rpf-button-min-target-size) - var(--rpf-button-sm-height)) / 2) 0;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
&.rpf-button--icon-only {
|
|
301
|
+
block-size: var(--rpf-button-min-target-size);
|
|
302
|
+
line-height: var(--rpf-button-min-target-size);
|
|
303
|
+
padding: 0;
|
|
304
|
+
inline-size: var(--rpf-button-min-target-size);
|
|
305
|
+
|
|
306
|
+
&::before {
|
|
307
|
+
inset: calc(calc(var(--rpf-button-min-target-size) - var(--rpf-button-sm-height)) / 2);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.material-symbols-sharp {
|
|
312
|
+
font-size: 20px;
|
|
313
|
+
font-variation-settings: 'OPSZ' 20;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
&--full-width {
|
|
318
|
+
justify-content: center;
|
|
319
|
+
inline-size: 100%;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@forward '../../properties/colors/alert';
|
|
2
|
+
@forward '../../properties/font-weight';
|
|
3
|
+
@forward '../../properties/spacing';
|
|
4
|
+
|
|
5
|
+
:root, :host {
|
|
6
|
+
--rpf-message-text-color: var(--rpf-alert-error);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.rpf-error-message {
|
|
10
|
+
all: unset;
|
|
11
|
+
align-items: center;
|
|
12
|
+
color: var(--rpf-message-text-color);
|
|
13
|
+
display: flex;
|
|
14
|
+
font-weight: var(--font-weight-bold);
|
|
15
|
+
padding-block: var(--space-1);
|
|
16
|
+
|
|
17
|
+
&__icon {
|
|
18
|
+
margin-inline-end: var(--space-1);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
@forward '../../properties/border';
|
|
2
|
+
@forward '../../properties/colors/inputs';
|
|
3
|
+
|
|
4
|
+
.rpf-fieldset {
|
|
5
|
+
all: unset;
|
|
6
|
+
|
|
7
|
+
background-color: var(--rpf-input-background-color);
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
display: block;
|
|
10
|
+
color: var(--rpf-input-color);
|
|
11
|
+
margin-block-end: var(--space-3);
|
|
12
|
+
max-inline-size: fit-content;
|
|
13
|
+
|
|
14
|
+
legend {
|
|
15
|
+
background-color: var(--rpf-input-background-color);
|
|
16
|
+
color: var(--rpf-input-color);
|
|
17
|
+
inline-size: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&--full-width,
|
|
21
|
+
&--full-width &__inputs * {
|
|
22
|
+
max-inline-size: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&__inputs *:last-child {
|
|
26
|
+
margin-block-end: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&--error &__inputs {
|
|
30
|
+
border-color: var(--rpf-input-color-error);
|
|
31
|
+
border-radius: var(--border-radius);
|
|
32
|
+
border-style: solid;
|
|
33
|
+
border-width: var(--fieldset-border-width);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&--disabled &__inputs,
|
|
37
|
+
&:disabled &__inputs {
|
|
38
|
+
background-color: var(--rpf-input-background-color-disabled);
|
|
39
|
+
border-radius: var(--border-radius);
|
|
40
|
+
color: var(--rpf-input-color);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
@forward '../../properties/colors/inputs';
|
|
2
|
+
@forward '../../properties/sizing';
|
|
3
|
+
|
|
4
|
+
.rpf-input-checkbox {
|
|
5
|
+
--rpf-input-checkbox-hit-target: var(--min-target-size);
|
|
6
|
+
--rpf-input-checkbox-size: var(--space-3);
|
|
7
|
+
|
|
8
|
+
align-items: center;
|
|
9
|
+
border-radius: var(--space-1);
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: var(--space-1-5);
|
|
13
|
+
margin-block-end: var(--space-1);
|
|
14
|
+
max-width: 50ch;
|
|
15
|
+
min-height: var(--rpf-input-checkbox-hit-target);
|
|
16
|
+
min-width: 240px;
|
|
17
|
+
padding-block: calc((var(--rpf-input-checkbox-hit-target) - var(--rpf-input-checkbox-size)) / 2);
|
|
18
|
+
padding-inline: var(--space-1);
|
|
19
|
+
width: 100%;
|
|
20
|
+
|
|
21
|
+
input[type='checkbox'] {
|
|
22
|
+
align-self: flex-start;
|
|
23
|
+
appearance: none;
|
|
24
|
+
background: var(--rpf-white);
|
|
25
|
+
border: var(--space-0-25) solid var(--rpf-grey-850);
|
|
26
|
+
border-radius: var(--space-0-5);
|
|
27
|
+
flex-shrink: 0;
|
|
28
|
+
height: var(--rpf-input-checkbox-size);
|
|
29
|
+
margin: 0;
|
|
30
|
+
width: var(--rpf-input-checkbox-size);
|
|
31
|
+
|
|
32
|
+
&:checked {
|
|
33
|
+
background: var(--rpf-grey-850);
|
|
34
|
+
background-image: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.95834 15.0003L3.20834 10.2503L4.39584 9.06283L7.95834 12.6253L15.6042 4.97949L16.7917 6.16699L7.95834 15.0003Z" fill="white"/></svg>');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:disabled {
|
|
38
|
+
border-color: var(--rpf-grey-600);
|
|
39
|
+
|
|
40
|
+
&:checked {
|
|
41
|
+
background-color: var(--rpf-grey-600);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.rpf-input--full-width {
|
|
47
|
+
max-width: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:has(> input[type='checkbox']:disabled), &--disabled {
|
|
51
|
+
background-color: var(--rpf-input-background-color-disabled);
|
|
52
|
+
color: var(--rpf-grey-400);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:has(> input[type='checkbox']:focus-visible) {
|
|
56
|
+
outline: 3px solid var(--rpf-input-outline-color);
|
|
57
|
+
|
|
58
|
+
> input[type='checkbox']:focus-visible {
|
|
59
|
+
outline: none;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@forward '../../properties/colors/greys';
|
|
2
|
+
@forward '../../properties/colors/text';
|
|
3
|
+
@forward '../../properties/font-weight';
|
|
4
|
+
@forward '../../properties/spacing';
|
|
5
|
+
@forward '../../properties/line-height';
|
|
6
|
+
|
|
7
|
+
:root, :host {
|
|
8
|
+
--rpf-label-hint-color: var(--rpf-text-secondary);
|
|
9
|
+
--rpf-label-text-color: var(--rpf-text-primary);
|
|
10
|
+
--rpf-label-text-color-disabled: var(--rpf-grey-500);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.rpf-label {
|
|
14
|
+
all: unset;
|
|
15
|
+
color: var(--rpf-label-text-color);
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
font-weight: var(--font-weight-bold);
|
|
19
|
+
padding-block-end: var(--space-1);
|
|
20
|
+
font-size: var(--font-size-1);
|
|
21
|
+
line-height: var(--line-height-1-5);
|
|
22
|
+
|
|
23
|
+
&__hint {
|
|
24
|
+
color: var(--rpf-label-hint-color);
|
|
25
|
+
font-size: var(--font-size-1);
|
|
26
|
+
font-weight: var(--font-weight-regular);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&--disabled {
|
|
30
|
+
color: var(--rpf-label-text-color-disabled);
|
|
31
|
+
|
|
32
|
+
.rpf-label__hint {
|
|
33
|
+
color: var(--rpf-label-text-color-disabled);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@forward '../../properties/colors/greys';
|
|
2
|
+
@forward '../../properties/colors/inputs';
|
|
3
|
+
@forward '../../properties/font-size';
|
|
4
|
+
@forward '../../properties/spacing';
|
|
5
|
+
@use '../../mixins/inputs';
|
|
6
|
+
|
|
7
|
+
.rpf-input-number {
|
|
8
|
+
padding: 0;
|
|
9
|
+
align-items: center;
|
|
10
|
+
|
|
11
|
+
@include inputs.disabled;
|
|
12
|
+
|
|
13
|
+
input[type='number'] {
|
|
14
|
+
all: unset;
|
|
15
|
+
-webkit-appearance: textfield;
|
|
16
|
+
-moz-appearance: textfield;
|
|
17
|
+
appearance: textfield;
|
|
18
|
+
inline-size: 100%;
|
|
19
|
+
margin-block: calc(var(--space-1) - 2px);
|
|
20
|
+
margin-inline-start: var(--space-1-5);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
input[type='number']::-webkit-inner-spin-button,
|
|
24
|
+
input[type='number']::-webkit-outer-spin-button {
|
|
25
|
+
-webkit-appearance: none;
|
|
26
|
+
margin: 0;
|
|
27
|
+
padding: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
button {
|
|
31
|
+
// Prevent button shrink
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
// Prevent text selection on multiple clicks
|
|
34
|
+
user-select: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.rpf-input--disabled {
|
|
38
|
+
button,
|
|
39
|
+
hr {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.rpf-input--readonly {
|
|
45
|
+
button,
|
|
46
|
+
hr {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
hr {
|
|
52
|
+
border: none;
|
|
53
|
+
border-inline-start: var(--space-0-125) solid var(--rpf-grey-150);
|
|
54
|
+
block-size: var(--space-3);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Add outline to wrapper when input is focused
|
|
58
|
+
&:has(input:focus-visible) {
|
|
59
|
+
outline: 3px solid var(--rpf-input-outline-color);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
@forward '../../properties/colors/inputs';
|
|
2
|
+
@forward '../../properties/colors/text';
|
|
3
|
+
@forward '../../properties/border';
|
|
4
|
+
@forward '../../properties/spacing';
|
|
5
|
+
@forward '../../properties/font-size';
|
|
6
|
+
@forward '../../properties/sizing';
|
|
7
|
+
|
|
8
|
+
@use '../../mixins/inputs';
|
|
9
|
+
@use '../../mixins/typography';
|
|
10
|
+
|
|
11
|
+
.rpf-input-password {
|
|
12
|
+
// Specificity is needed to override the default rpf-input styles
|
|
13
|
+
&.rpf-input {
|
|
14
|
+
border-inline-end: 0;
|
|
15
|
+
border-end-start-radius: var(--border-radius);
|
|
16
|
+
border-end-end-radius: 0;
|
|
17
|
+
border-start-end-radius: 0;
|
|
18
|
+
border-start-start-radius: var(--border-radius);
|
|
19
|
+
min-block-size: calc(var(--lg-target-size) - calc(var(--input-border-width) * 2));
|
|
20
|
+
min-inline-size: 0;
|
|
21
|
+
|
|
22
|
+
@include inputs.disabled;
|
|
23
|
+
@include inputs.readonly;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&[type='password'] {
|
|
27
|
+
font-family: caption;
|
|
28
|
+
font-size: var(--font-size-2);
|
|
29
|
+
letter-spacing: var(--space-0-125);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&--readonly,
|
|
33
|
+
&--read-only,
|
|
34
|
+
&:read-only {
|
|
35
|
+
border-radius: var(--border-radius);
|
|
36
|
+
border-right: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:focus-visible {
|
|
40
|
+
z-index: 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&__button {
|
|
44
|
+
background-color: var(--rpf-input-background-color);
|
|
45
|
+
border-end-end-radius: var(--border-radius);
|
|
46
|
+
border-end-start-radius: 0;
|
|
47
|
+
border-start-end-radius: var(--border-radius);
|
|
48
|
+
border-start-start-radius: 0;
|
|
49
|
+
font-size: var(--font-size-1);
|
|
50
|
+
justify-content: center;
|
|
51
|
+
min-block-size: calc(var(--lg-target-size) - calc(var(--input-border-width) * 2));
|
|
52
|
+
min-inline-size: var(--space-9);
|
|
53
|
+
text-decoration: underline;
|
|
54
|
+
|
|
55
|
+
&::before {
|
|
56
|
+
border: var(--input-border-width) solid var(--rpf-input-color);
|
|
57
|
+
border-end-end-radius: var(--border-radius);
|
|
58
|
+
border-end-start-radius: 0;
|
|
59
|
+
border-start-end-radius: var(--border-radius);
|
|
60
|
+
border-start-start-radius: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&--error {
|
|
64
|
+
&::before {
|
|
65
|
+
border: var(--input-border-width) solid var(--rpf-input-color-error);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Override default rpf-button active and focus styles
|
|
70
|
+
&:active::before {
|
|
71
|
+
border-color: transparent;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:focus-visible {
|
|
75
|
+
outline: 3px solid var(--rpf-input-outline-color);
|
|
76
|
+
|
|
77
|
+
&::before {
|
|
78
|
+
outline: none;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&:active, &:hover {
|
|
83
|
+
&::before {
|
|
84
|
+
border: var(--input-border-width) solid var(--rpf-input-color);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&__container {
|
|
90
|
+
display: flex;
|
|
91
|
+
max-width: 50ch;
|
|
92
|
+
|
|
93
|
+
&--full-width {
|
|
94
|
+
max-width: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&--error {
|
|
98
|
+
border-color: var(--rpf-input-color-error);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&--readonly,
|
|
102
|
+
&--read-only,
|
|
103
|
+
&--disabled {
|
|
104
|
+
button {
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|