@juwel-development/design-system 3.3.0 → 3.5.0
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/README.md +20 -0
- package/dist/design-system.js +237 -126
- package/dist/index.css +1 -1
- package/dist/types/Display/Meter/Meter.d.ts +59 -0
- package/dist/types/Display/Meter/MeterConfigurationError.d.ts +3 -0
- package/dist/types/Display/Typography/Eyebrow/Eyebrow.d.ts +5 -2
- package/dist/types/Display/Typography/H1/H1.d.ts +5 -2
- package/dist/types/Display/Typography/H2/H2.d.ts +5 -2
- package/dist/types/Display/Typography/H3/H3.d.ts +5 -2
- package/dist/types/Display/Typography/H4/H4.d.ts +5 -2
- package/dist/types/Display/Typography/H5/H5.d.ts +5 -2
- package/dist/types/Display/Typography/H6/H6.d.ts +5 -2
- package/dist/types/Display/Typography/Note/Note.d.ts +5 -2
- package/dist/types/Display/Typography/P/P.d.ts +5 -2
- package/dist/types/Display/Typography/Prose/Prose.d.ts +6 -3
- package/dist/types/Interaction/Slider/Slider.d.ts +41 -0
- package/dist/types/Interaction/Slider/SliderConfigurationError.d.ts +3 -0
- package/dist/types/Theme/Palette.d.ts +22 -2
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/Display/Meter/Meter.tsx +136 -0
- package/src/Display/Meter/MeterConfigurationError.ts +6 -0
- package/src/Display/Typography/Eyebrow/Eyebrow.tsx +12 -2
- package/src/Display/Typography/H1/H1.tsx +12 -2
- package/src/Display/Typography/H2/H2.tsx +12 -2
- package/src/Display/Typography/H3/H3.tsx +12 -2
- package/src/Display/Typography/H4/H4.tsx +12 -2
- package/src/Display/Typography/H5/H5.tsx +12 -2
- package/src/Display/Typography/H6/H6.tsx +12 -2
- package/src/Display/Typography/Note/Note.tsx +12 -2
- package/src/Display/Typography/P/P.tsx +12 -2
- package/src/Display/Typography/Prose/Prose.tsx +13 -3
- package/src/Interaction/Slider/Slider.tsx +125 -0
- package/src/Interaction/Slider/SliderConfigurationError.ts +6 -0
- package/src/Theme/Palette.ts +32 -5
- package/src/Theme/renderTokens.ts +23 -0
- package/src/index.ts +2 -0
- package/src/tokens.css +19 -3
- package/src/tokens.dark.css +14 -0
- package/src/tokens.light.css +17 -3
package/src/Theme/Palette.ts
CHANGED
|
@@ -39,6 +39,20 @@ export type PaletteTokens = {
|
|
|
39
39
|
* keeps it near `surface` rather than a mid grey. */
|
|
40
40
|
backing: string;
|
|
41
41
|
|
|
42
|
+
/** The colour of a Meter's filled share when it states an amount without judgment - neither an
|
|
43
|
+
* action fill nor text ink. The depletion treatment mixes it toward `error` in OKLab, so the
|
|
44
|
+
* constraint covers the whole path (WCAG 2.2 SC 1.4.11): this value, `error`, and every colour
|
|
45
|
+
* the mix produces between them stay at least 3:1 against `meterTrack` in the same theme. A
|
|
46
|
+
* distinct role even while its shipped value matches `foreground` - a consumer re-points either
|
|
47
|
+
* without moving the other. See docs/adr/0010-meter-depletion-is-a-treatment.md. */
|
|
48
|
+
meterFill: string;
|
|
49
|
+
/** The colour of a Meter's whole capacity behind its filled share. It makes the scale visible
|
|
50
|
+
* without turning it into a boundary - the persistent one-pixel `rule` outline is what
|
|
51
|
+
* identifies the capacity against `surface`, so this role carries no floor of its own; the
|
|
52
|
+
* 3:1 floor is stated from the fill side, on `meterFill`. A distinct role even while its
|
|
53
|
+
* shipped value matches `border`. See docs/adr/0010-meter-depletion-is-a-treatment.md. */
|
|
54
|
+
meterTrack: string;
|
|
55
|
+
|
|
42
56
|
/** The main call-to-action fill. A filled control draws no border, so the fill is the only thing
|
|
43
57
|
* separating the control from the surface - what `controlBorder` is for an unfilled one.
|
|
44
58
|
* Constraint (WCAG 2.2 SC 1.4.11): at least 3:1 against `surface` in the same theme,
|
|
@@ -88,11 +102,18 @@ export type PaletteTokens = {
|
|
|
88
102
|
* least 4.5:1 against `surface` in the same theme. */
|
|
89
103
|
link: string;
|
|
90
104
|
|
|
91
|
-
/**
|
|
92
|
-
*
|
|
105
|
+
/** The success status tone. Status tones reinforce content independently of their carrier and
|
|
106
|
+
* carry no announcement behavior. Constraint (WCAG 2.2 SC 1.4.3): at least 4.5:1 against
|
|
107
|
+
* `surface` in the same theme. */
|
|
93
108
|
success: string;
|
|
109
|
+
/** The warning status tone. Carries the general status-tone contract and 4.5:1-against-`surface`
|
|
110
|
+
* constraint stated on `success`. */
|
|
94
111
|
warning: string;
|
|
112
|
+
/** The error status tone. Carries the general status-tone contract and 4.5:1-against-`surface`
|
|
113
|
+
* constraint stated on `success`, plus the depletion-path constraint stated on `meterFill`. */
|
|
95
114
|
error: string;
|
|
115
|
+
/** The informational status tone. Carries the general status-tone contract and
|
|
116
|
+
* 4.5:1-against-`surface` constraint stated on `success`. */
|
|
96
117
|
info: string;
|
|
97
118
|
};
|
|
98
119
|
|
|
@@ -124,6 +145,9 @@ export const light: PaletteTokens = {
|
|
|
124
145
|
rule: '#808fa3',
|
|
125
146
|
backing: '#f1f5f9',
|
|
126
147
|
|
|
148
|
+
meterFill: '#0f172a',
|
|
149
|
+
meterTrack: '#e2e8f0',
|
|
150
|
+
|
|
127
151
|
primary: '#7c3aed',
|
|
128
152
|
primaryHover: '#6d28d9',
|
|
129
153
|
primaryForeground: '#f8fafc',
|
|
@@ -139,10 +163,10 @@ export const light: PaletteTokens = {
|
|
|
139
163
|
|
|
140
164
|
link: '#2563eb',
|
|
141
165
|
|
|
142
|
-
success: '#
|
|
143
|
-
warning: '#
|
|
166
|
+
success: '#047857',
|
|
167
|
+
warning: '#b45309',
|
|
144
168
|
error: '#d63384',
|
|
145
|
-
info: '#
|
|
169
|
+
info: '#0e7490',
|
|
146
170
|
};
|
|
147
171
|
|
|
148
172
|
/**
|
|
@@ -169,6 +193,9 @@ export const dark: PaletteTokens = {
|
|
|
169
193
|
rule: '#5b6a80',
|
|
170
194
|
backing: '#1e293b',
|
|
171
195
|
|
|
196
|
+
meterFill: '#f8fafc',
|
|
197
|
+
meterTrack: '#334155',
|
|
198
|
+
|
|
172
199
|
primary: '#8b5cf6',
|
|
173
200
|
primaryHover: '#a78bfa',
|
|
174
201
|
primaryForeground: '#020617',
|
|
@@ -227,6 +227,24 @@ const TAB_MARKER = `:root {
|
|
|
227
227
|
--tab-marker-thickness: 2px;
|
|
228
228
|
}`;
|
|
229
229
|
|
|
230
|
+
/* The slider's two dimensions are not colours: like the tick they live in :root only, never @theme
|
|
231
|
+
inline. Named because both are drawn on vendor pseudo-elements (::-webkit-slider-thumb and kin)
|
|
232
|
+
no consumer selector can reach - ADR 0004's test. The control takes its height from the thumb, so
|
|
233
|
+
1.5rem keeps the pointer target at WCAG 2.5.8's 24px minimum; a brand re-pointing it lower gives
|
|
234
|
+
that up knowingly. Constraint: thumb > track, or the thumb vanishes into the line it rides. */
|
|
235
|
+
const SLIDER = `:root {
|
|
236
|
+
--slider-track-thickness: 0.25rem;
|
|
237
|
+
--slider-thumb-size: 1.5rem;
|
|
238
|
+
}`;
|
|
239
|
+
|
|
240
|
+
/* Not a colour: like the tick it lives in :root only, never @theme inline, so a brand can
|
|
241
|
+
re-point the bar's weight. Meter reads it as h-[var(--meter-track-thickness)]. Constraint:
|
|
242
|
+
> 0 - a zero-thickness track erases the display. 0.5rem is the height the accepted Negotiation
|
|
243
|
+
prototype hand-rolled (#105), carried over so the first consumer changes nothing visually. */
|
|
244
|
+
const METER_TRACK = `:root {
|
|
245
|
+
--meter-track-thickness: 0.5rem;
|
|
246
|
+
}`;
|
|
247
|
+
|
|
230
248
|
const toKebabCase = (name: string): string =>
|
|
231
249
|
name.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);
|
|
232
250
|
|
|
@@ -313,6 +331,11 @@ ${TICK}
|
|
|
313
331
|
${TAB_MARKER}
|
|
314
332
|
|
|
315
333
|
${TAB_INSETS}
|
|
334
|
+
|
|
335
|
+
${SLIDER}
|
|
336
|
+
|
|
337
|
+
/* The meter track's thickness is not a colour either, and sits in :root beside the tab blocks. */
|
|
338
|
+
${METER_TRACK}
|
|
316
339
|
`;
|
|
317
340
|
|
|
318
341
|
/**
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { Checklist } from 'Display/Checklist/Checklist';
|
|
|
7
7
|
export { Collection } from 'Display/Collection/Collection';
|
|
8
8
|
export { DefinitionList } from 'Display/DefinitionList/DefinitionList';
|
|
9
9
|
export { Figure } from 'Display/Figure/Figure';
|
|
10
|
+
export { Meter } from 'Display/Meter/Meter';
|
|
10
11
|
export { Rail } from 'Display/Rail/Rail';
|
|
11
12
|
export { Table } from 'Display/Table/Table';
|
|
12
13
|
export { Eyebrow } from 'Display/Typography/Eyebrow/Eyebrow';
|
|
@@ -22,6 +23,7 @@ export { Prose } from 'Display/Typography/Prose/Prose';
|
|
|
22
23
|
export { Button } from 'Interaction/Button/Button';
|
|
23
24
|
export { Input } from 'Interaction/Input/Input';
|
|
24
25
|
export { Link } from 'Interaction/Link/Link';
|
|
26
|
+
export { Slider } from 'Interaction/Slider/Slider';
|
|
25
27
|
export { Tabs } from 'Interaction/Tabs/Tabs';
|
|
26
28
|
export { TextArea } from 'Interaction/TextArea/TextArea';
|
|
27
29
|
export { Cover } from 'Layout/Cover/Cover';
|
package/src/tokens.css
CHANGED
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
--color-control-border: #64748b;
|
|
18
18
|
--color-rule: #808fa3;
|
|
19
19
|
--color-backing: #f1f5f9;
|
|
20
|
+
--color-meter-fill: #0f172a;
|
|
21
|
+
--color-meter-track: #e2e8f0;
|
|
20
22
|
--color-primary: #7c3aed;
|
|
21
23
|
--color-primary-hover: #6d28d9;
|
|
22
24
|
--color-primary-foreground: #f8fafc;
|
|
@@ -27,10 +29,10 @@
|
|
|
27
29
|
--color-disabled-hover: #64748b;
|
|
28
30
|
--color-focus-ring: var(--color-ring, #475569);
|
|
29
31
|
--color-link: #2563eb;
|
|
30
|
-
--color-success: #
|
|
31
|
-
--color-warning: #
|
|
32
|
+
--color-success: #047857;
|
|
33
|
+
--color-warning: #b45309;
|
|
32
34
|
--color-error: #d63384;
|
|
33
|
-
--color-info: #
|
|
35
|
+
--color-info: #0e7490;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
.dark {
|
|
@@ -41,6 +43,8 @@
|
|
|
41
43
|
--color-control-border: #94a3b8;
|
|
42
44
|
--color-rule: #5b6a80;
|
|
43
45
|
--color-backing: #1e293b;
|
|
46
|
+
--color-meter-fill: #f8fafc;
|
|
47
|
+
--color-meter-track: #334155;
|
|
44
48
|
--color-primary: #8b5cf6;
|
|
45
49
|
--color-primary-hover: #a78bfa;
|
|
46
50
|
--color-primary-foreground: #020617;
|
|
@@ -65,6 +69,8 @@
|
|
|
65
69
|
--color-control-border: var(--color-control-border);
|
|
66
70
|
--color-rule: var(--color-rule);
|
|
67
71
|
--color-backing: var(--color-backing);
|
|
72
|
+
--color-meter-fill: var(--color-meter-fill);
|
|
73
|
+
--color-meter-track: var(--color-meter-track);
|
|
68
74
|
--color-primary: var(--color-primary);
|
|
69
75
|
--color-primary-hover: var(--color-primary-hover);
|
|
70
76
|
--color-primary-foreground: var(--color-primary-foreground);
|
|
@@ -230,3 +236,13 @@
|
|
|
230
236
|
--tab-inset-inline: 1em;
|
|
231
237
|
--tab-inset-block: 0.5em;
|
|
232
238
|
}
|
|
239
|
+
|
|
240
|
+
:root {
|
|
241
|
+
--slider-track-thickness: 0.25rem;
|
|
242
|
+
--slider-thumb-size: 1.5rem;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* The meter track's thickness is not a colour either, and sits in :root beside the tab blocks. */
|
|
246
|
+
:root {
|
|
247
|
+
--meter-track-thickness: 0.5rem;
|
|
248
|
+
}
|
package/src/tokens.dark.css
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
--color-control-border: #94a3b8;
|
|
13
13
|
--color-rule: #5b6a80;
|
|
14
14
|
--color-backing: #1e293b;
|
|
15
|
+
--color-meter-fill: #f8fafc;
|
|
16
|
+
--color-meter-track: #334155;
|
|
15
17
|
--color-primary: #8b5cf6;
|
|
16
18
|
--color-primary-hover: #a78bfa;
|
|
17
19
|
--color-primary-foreground: #020617;
|
|
@@ -36,6 +38,8 @@
|
|
|
36
38
|
--color-control-border: var(--color-control-border);
|
|
37
39
|
--color-rule: var(--color-rule);
|
|
38
40
|
--color-backing: var(--color-backing);
|
|
41
|
+
--color-meter-fill: var(--color-meter-fill);
|
|
42
|
+
--color-meter-track: var(--color-meter-track);
|
|
39
43
|
--color-primary: var(--color-primary);
|
|
40
44
|
--color-primary-hover: var(--color-primary-hover);
|
|
41
45
|
--color-primary-foreground: var(--color-primary-foreground);
|
|
@@ -201,3 +205,13 @@
|
|
|
201
205
|
--tab-inset-inline: 1em;
|
|
202
206
|
--tab-inset-block: 0.5em;
|
|
203
207
|
}
|
|
208
|
+
|
|
209
|
+
:root {
|
|
210
|
+
--slider-track-thickness: 0.25rem;
|
|
211
|
+
--slider-thumb-size: 1.5rem;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* The meter track's thickness is not a colour either, and sits in :root beside the tab blocks. */
|
|
215
|
+
:root {
|
|
216
|
+
--meter-track-thickness: 0.5rem;
|
|
217
|
+
}
|
package/src/tokens.light.css
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
--color-control-border: #64748b;
|
|
13
13
|
--color-rule: #808fa3;
|
|
14
14
|
--color-backing: #f1f5f9;
|
|
15
|
+
--color-meter-fill: #0f172a;
|
|
16
|
+
--color-meter-track: #e2e8f0;
|
|
15
17
|
--color-primary: #7c3aed;
|
|
16
18
|
--color-primary-hover: #6d28d9;
|
|
17
19
|
--color-primary-foreground: #f8fafc;
|
|
@@ -22,10 +24,10 @@
|
|
|
22
24
|
--color-disabled-hover: #64748b;
|
|
23
25
|
--color-focus-ring: var(--color-ring, #475569);
|
|
24
26
|
--color-link: #2563eb;
|
|
25
|
-
--color-success: #
|
|
26
|
-
--color-warning: #
|
|
27
|
+
--color-success: #047857;
|
|
28
|
+
--color-warning: #b45309;
|
|
27
29
|
--color-error: #d63384;
|
|
28
|
-
--color-info: #
|
|
30
|
+
--color-info: #0e7490;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
@theme inline {
|
|
@@ -36,6 +38,8 @@
|
|
|
36
38
|
--color-control-border: var(--color-control-border);
|
|
37
39
|
--color-rule: var(--color-rule);
|
|
38
40
|
--color-backing: var(--color-backing);
|
|
41
|
+
--color-meter-fill: var(--color-meter-fill);
|
|
42
|
+
--color-meter-track: var(--color-meter-track);
|
|
39
43
|
--color-primary: var(--color-primary);
|
|
40
44
|
--color-primary-hover: var(--color-primary-hover);
|
|
41
45
|
--color-primary-foreground: var(--color-primary-foreground);
|
|
@@ -201,3 +205,13 @@
|
|
|
201
205
|
--tab-inset-inline: 1em;
|
|
202
206
|
--tab-inset-block: 0.5em;
|
|
203
207
|
}
|
|
208
|
+
|
|
209
|
+
:root {
|
|
210
|
+
--slider-track-thickness: 0.25rem;
|
|
211
|
+
--slider-thumb-size: 1.5rem;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* The meter track's thickness is not a colour either, and sits in :root beside the tab blocks. */
|
|
215
|
+
:root {
|
|
216
|
+
--meter-track-thickness: 0.5rem;
|
|
217
|
+
}
|