@juwel-development/design-system 3.3.0 → 3.4.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.
@@ -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,
@@ -124,6 +138,9 @@ export const light: PaletteTokens = {
124
138
  rule: '#808fa3',
125
139
  backing: '#f1f5f9',
126
140
 
141
+ meterFill: '#0f172a',
142
+ meterTrack: '#e2e8f0',
143
+
127
144
  primary: '#7c3aed',
128
145
  primaryHover: '#6d28d9',
129
146
  primaryForeground: '#f8fafc',
@@ -169,6 +186,9 @@ export const dark: PaletteTokens = {
169
186
  rule: '#5b6a80',
170
187
  backing: '#1e293b',
171
188
 
189
+ meterFill: '#f8fafc',
190
+ meterTrack: '#334155',
191
+
172
192
  primary: '#8b5cf6',
173
193
  primaryHover: '#a78bfa',
174
194
  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;
@@ -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
+ }
@@ -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
+ }
@@ -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;
@@ -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
+ }