@juwel-development/design-system 2.0.0 → 2.1.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/README.md +19 -3
- package/dist/design-system.js +177 -165
- package/dist/index.css +1 -1
- package/dist/types/Display/Checklist/Checklist.d.ts +4 -3
- package/dist/types/Interaction/Input/Input.d.ts +2 -0
- package/dist/types/Interaction/TextArea/TextArea.d.ts +2 -0
- package/dist/types/Theme/renderTokens.d.ts +16 -3
- package/package.json +5 -1
- package/src/Display/Checklist/Checklist.tsx +23 -15
- package/src/Interaction/Button/Button.tsx +2 -2
- package/src/Interaction/Input/Input.tsx +18 -1
- package/src/Interaction/TextArea/TextArea.tsx +18 -1
- package/src/Theme/renderTokens.ts +89 -29
- package/src/styles.dark.css +9 -0
- package/src/styles.light.css +9 -0
- package/src/tokens.css +5 -0
- package/src/tokens.dark.css +169 -0
- package/src/tokens.light.css +169 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/* GENERATED from src/Theme/Palette.ts by `npm run build:tokens` - do not edit by hand.
|
|
2
|
+
*
|
|
3
|
+
* The dark-only variant (issue #62): the dark values live in :root, ungated, and the @theme inline
|
|
4
|
+
* block maps each onto a Tailwind colour. A dark-only consumer imports it instead of tokens.css; it
|
|
5
|
+
* is the only theme, so no class toggle or variant is needed to select it. */
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--color-surface: #0f172a;
|
|
9
|
+
--color-foreground: #f8fafc;
|
|
10
|
+
--color-muted: #94a3b8;
|
|
11
|
+
--color-border: #334155;
|
|
12
|
+
--color-control-border: #94a3b8;
|
|
13
|
+
--color-rule: #5b6a80;
|
|
14
|
+
--color-backing: #1e293b;
|
|
15
|
+
--color-primary: #7c3aed;
|
|
16
|
+
--color-primary-hover: #8b5cf6;
|
|
17
|
+
--color-primary-foreground: #f8fafc;
|
|
18
|
+
--color-secondary: #0284c7;
|
|
19
|
+
--color-secondary-hover: #0ea5e9;
|
|
20
|
+
--color-secondary-foreground: #f8fafc;
|
|
21
|
+
--color-disabled: #475569;
|
|
22
|
+
--color-disabled-hover: #334155;
|
|
23
|
+
--color-focus-ring: var(--color-ring, #cbd5e1);
|
|
24
|
+
--color-link: #60a5fa;
|
|
25
|
+
--color-success: #34d399;
|
|
26
|
+
--color-warning: #fbbf24;
|
|
27
|
+
--color-error: #f48fb1;
|
|
28
|
+
--color-info: #22d3ee;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@theme inline {
|
|
32
|
+
--color-surface: var(--color-surface);
|
|
33
|
+
--color-foreground: var(--color-foreground);
|
|
34
|
+
--color-muted: var(--color-muted);
|
|
35
|
+
--color-border: var(--color-border);
|
|
36
|
+
--color-control-border: var(--color-control-border);
|
|
37
|
+
--color-rule: var(--color-rule);
|
|
38
|
+
--color-backing: var(--color-backing);
|
|
39
|
+
--color-primary: var(--color-primary);
|
|
40
|
+
--color-primary-hover: var(--color-primary-hover);
|
|
41
|
+
--color-primary-foreground: var(--color-primary-foreground);
|
|
42
|
+
--color-secondary: var(--color-secondary);
|
|
43
|
+
--color-secondary-hover: var(--color-secondary-hover);
|
|
44
|
+
--color-secondary-foreground: var(--color-secondary-foreground);
|
|
45
|
+
--color-disabled: var(--color-disabled);
|
|
46
|
+
--color-disabled-hover: var(--color-disabled-hover);
|
|
47
|
+
--color-focus-ring: var(--color-focus-ring);
|
|
48
|
+
--color-link: var(--color-link);
|
|
49
|
+
--color-success: var(--color-success);
|
|
50
|
+
--color-warning: var(--color-warning);
|
|
51
|
+
--color-error: var(--color-error);
|
|
52
|
+
--color-info: var(--color-info);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Motion is not a colour: it is carried in :root only, never mapped into @theme inline. */
|
|
56
|
+
:root {
|
|
57
|
+
--motion-duration-color: 150ms;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Honour prefers-reduced-motion for the one motion the library performs, by re-pointing the token
|
|
61
|
+
to 0ms. Deliberately no blanket transition reset - only what the library performs is zeroed. */
|
|
62
|
+
@media (prefers-reduced-motion: reduce) {
|
|
63
|
+
:root {
|
|
64
|
+
--motion-duration-color: 0ms;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* The focus ring's dimensions are not colours either, and sit in :root beside the motion block. */
|
|
69
|
+
:root {
|
|
70
|
+
--focus-ring-width: 3px;
|
|
71
|
+
--focus-ring-offset: 2px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Radius is not a colour either: one token for the corner every control reads, beside the others. */
|
|
75
|
+
:root {
|
|
76
|
+
--radius-control: 0.5rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* The control minimum width is not a colour either, and sits in :root beside radius. */
|
|
80
|
+
:root {
|
|
81
|
+
--control-min-width: 10.5rem;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* The library's underline dimensions are not colours either, and sit in :root beside radius. They are
|
|
85
|
+
not prose's alone: every Link treatment that draws a line draws it from these (docs/adr/0006). */
|
|
86
|
+
:root {
|
|
87
|
+
--underline-offset: 0.18em;
|
|
88
|
+
--underline-thickness: 1px;
|
|
89
|
+
--underline-thickness-hover: 2px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Typography is a set of Tailwind theme namespaces, not colours: its own @theme block generates the
|
|
93
|
+
utilities, so it is not carried in @theme inline with the palette. */
|
|
94
|
+
@theme {
|
|
95
|
+
/* Both faces default to inherit, so the library ships no @font-face and no face and a one-face
|
|
96
|
+
consumer renders as today. --font-primary is carried by content, --font-secondary by labels; a
|
|
97
|
+
component sets font-variant-numeric: tabular-nums only on a --font-primary carrying tnum and
|
|
98
|
+
font-variant-caps: small-caps only on a --font-secondary carrying smcp - both fail silently otherwise. */
|
|
99
|
+
--font-primary: inherit;
|
|
100
|
+
--font-secondary: inherit;
|
|
101
|
+
|
|
102
|
+
/* Type roles, not a scale: one role per job, so a component asks for what its text is, never a rung.
|
|
103
|
+
display > title > subtitle are the three heading steps H1-H3 bind to; H4-H6 share body and split
|
|
104
|
+
by weight, so there is no fourth role. display is the hero and must out-scale every subpage head. */
|
|
105
|
+
--text-display: clamp(3rem, 7vw, 6rem);
|
|
106
|
+
--leading-display: 1.05;
|
|
107
|
+
--text-title: clamp(2.25rem, 5vw, 4.25rem);
|
|
108
|
+
--leading-title: 1.1;
|
|
109
|
+
--text-subtitle: clamp(1.5rem, 3vw, 2.25rem);
|
|
110
|
+
--leading-subtitle: 1.2;
|
|
111
|
+
|
|
112
|
+
/* The reading block's opening paragraph (Prose #21): sized above body and below subtitle, led
|
|
113
|
+
tighter than body's 1.6 but not as tight as a heading's 1.2 - it is running text, not a head, so
|
|
114
|
+
it keeps running-text leading. A role, not a rung: one lede per block, nothing to choose. Reusing
|
|
115
|
+
subtitle was rejected in ADR 0004 - it welds the lede's size to H3's and its leading to a head's. */
|
|
116
|
+
--text-lede: 1.25rem; /* 20px */
|
|
117
|
+
--leading-lede: 1.4;
|
|
118
|
+
--text-body: 1.0625rem; /* 17px */
|
|
119
|
+
--leading-body: 1.6;
|
|
120
|
+
--text-small: 0.9375rem; /* 15px floor: below it tabular figures stop comparing column to column */
|
|
121
|
+
--text-label: 0.8125rem; /* 13px floor: below it the tracking reads as damage, not a device */
|
|
122
|
+
|
|
123
|
+
/* Two quantities on one property that must not collapse: --tracking-label is a fixed letter-spaced
|
|
124
|
+
style, --tracking-optical a correction that varies with size. The names say which is which, so the
|
|
125
|
+
distinction survives without the ADR in hand. Scope: the title role and above - H1, H2 and the page
|
|
126
|
+
head's h1 - and never below it, where the correction would read as damage. See the ADR. */
|
|
127
|
+
--tracking-label: 0.14em;
|
|
128
|
+
--tracking-optical: -0.02em;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* The aspect roles are Tailwind theme namespaces like typography, so they take their own @theme block
|
|
132
|
+
after it and are not carried in @theme inline with the palette. */
|
|
133
|
+
@theme {
|
|
134
|
+
--aspect-portrait: 4 / 5;
|
|
135
|
+
--aspect-square: 1 / 1;
|
|
136
|
+
--aspect-landscape: 3 / 2;
|
|
137
|
+
--aspect-wide: 16 / 9;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* The reading measure has no Tailwind namespace, so it sits in :root beside radius. */
|
|
141
|
+
:root {
|
|
142
|
+
--measure: 66ch;
|
|
143
|
+
--measure-display: 36ch;
|
|
144
|
+
--measure-wide: 72ch;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Spacing has no Tailwind namespace either - --spacing is a single base multiplier ADR 0004 forbids
|
|
148
|
+
re-pointing - so the three roles sit in :root beside the measure. */
|
|
149
|
+
:root {
|
|
150
|
+
--space-stack: 0.5em;
|
|
151
|
+
--space-region: 1.5em;
|
|
152
|
+
--space-band: 4em;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* The gutter has no Tailwind namespace either, so it sits in :root beside the space roles. */
|
|
156
|
+
:root {
|
|
157
|
+
--gutter: clamp(1.5rem, 5vw, 4rem);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* The fold height has no Tailwind namespace either, so it sits in :root beside the gutter. */
|
|
161
|
+
:root {
|
|
162
|
+
--fold-height: min(70vh, 40rem);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* The checklist tick's dimensions are not colours either, and sit in :root beside the underline block. */
|
|
166
|
+
:root {
|
|
167
|
+
--tick-length: 0.9rem;
|
|
168
|
+
--tick-thickness: 1px;
|
|
169
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/* GENERATED from src/Theme/Palette.ts by `npm run build:tokens` - do not edit by hand.
|
|
2
|
+
*
|
|
3
|
+
* The light-only variant (issue #62): the light values live in :root and the @theme inline block
|
|
4
|
+
* maps each onto a Tailwind colour. It carries no dark rule, so a light-only consumer imports it
|
|
5
|
+
* instead of tokens.css and bundles no second theme it cannot remove. */
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--color-surface: #ffffff;
|
|
9
|
+
--color-foreground: #0f172a;
|
|
10
|
+
--color-muted: #64748b;
|
|
11
|
+
--color-border: #e2e8f0;
|
|
12
|
+
--color-control-border: #64748b;
|
|
13
|
+
--color-rule: #808fa3;
|
|
14
|
+
--color-backing: #f1f5f9;
|
|
15
|
+
--color-primary: #8b5cf6;
|
|
16
|
+
--color-primary-hover: #7c3aed;
|
|
17
|
+
--color-primary-foreground: #f8fafc;
|
|
18
|
+
--color-secondary: #0ea5e9;
|
|
19
|
+
--color-secondary-hover: #0284c7;
|
|
20
|
+
--color-secondary-foreground: #f8fafc;
|
|
21
|
+
--color-disabled: #94a3b8;
|
|
22
|
+
--color-disabled-hover: #64748b;
|
|
23
|
+
--color-focus-ring: var(--color-ring, #475569);
|
|
24
|
+
--color-link: #2563eb;
|
|
25
|
+
--color-success: #10b981;
|
|
26
|
+
--color-warning: #f59e0b;
|
|
27
|
+
--color-error: #d63384;
|
|
28
|
+
--color-info: #06b6d4;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@theme inline {
|
|
32
|
+
--color-surface: var(--color-surface);
|
|
33
|
+
--color-foreground: var(--color-foreground);
|
|
34
|
+
--color-muted: var(--color-muted);
|
|
35
|
+
--color-border: var(--color-border);
|
|
36
|
+
--color-control-border: var(--color-control-border);
|
|
37
|
+
--color-rule: var(--color-rule);
|
|
38
|
+
--color-backing: var(--color-backing);
|
|
39
|
+
--color-primary: var(--color-primary);
|
|
40
|
+
--color-primary-hover: var(--color-primary-hover);
|
|
41
|
+
--color-primary-foreground: var(--color-primary-foreground);
|
|
42
|
+
--color-secondary: var(--color-secondary);
|
|
43
|
+
--color-secondary-hover: var(--color-secondary-hover);
|
|
44
|
+
--color-secondary-foreground: var(--color-secondary-foreground);
|
|
45
|
+
--color-disabled: var(--color-disabled);
|
|
46
|
+
--color-disabled-hover: var(--color-disabled-hover);
|
|
47
|
+
--color-focus-ring: var(--color-focus-ring);
|
|
48
|
+
--color-link: var(--color-link);
|
|
49
|
+
--color-success: var(--color-success);
|
|
50
|
+
--color-warning: var(--color-warning);
|
|
51
|
+
--color-error: var(--color-error);
|
|
52
|
+
--color-info: var(--color-info);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Motion is not a colour: it is carried in :root only, never mapped into @theme inline. */
|
|
56
|
+
:root {
|
|
57
|
+
--motion-duration-color: 150ms;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Honour prefers-reduced-motion for the one motion the library performs, by re-pointing the token
|
|
61
|
+
to 0ms. Deliberately no blanket transition reset - only what the library performs is zeroed. */
|
|
62
|
+
@media (prefers-reduced-motion: reduce) {
|
|
63
|
+
:root {
|
|
64
|
+
--motion-duration-color: 0ms;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* The focus ring's dimensions are not colours either, and sit in :root beside the motion block. */
|
|
69
|
+
:root {
|
|
70
|
+
--focus-ring-width: 3px;
|
|
71
|
+
--focus-ring-offset: 2px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Radius is not a colour either: one token for the corner every control reads, beside the others. */
|
|
75
|
+
:root {
|
|
76
|
+
--radius-control: 0.5rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* The control minimum width is not a colour either, and sits in :root beside radius. */
|
|
80
|
+
:root {
|
|
81
|
+
--control-min-width: 10.5rem;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* The library's underline dimensions are not colours either, and sit in :root beside radius. They are
|
|
85
|
+
not prose's alone: every Link treatment that draws a line draws it from these (docs/adr/0006). */
|
|
86
|
+
:root {
|
|
87
|
+
--underline-offset: 0.18em;
|
|
88
|
+
--underline-thickness: 1px;
|
|
89
|
+
--underline-thickness-hover: 2px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Typography is a set of Tailwind theme namespaces, not colours: its own @theme block generates the
|
|
93
|
+
utilities, so it is not carried in @theme inline with the palette. */
|
|
94
|
+
@theme {
|
|
95
|
+
/* Both faces default to inherit, so the library ships no @font-face and no face and a one-face
|
|
96
|
+
consumer renders as today. --font-primary is carried by content, --font-secondary by labels; a
|
|
97
|
+
component sets font-variant-numeric: tabular-nums only on a --font-primary carrying tnum and
|
|
98
|
+
font-variant-caps: small-caps only on a --font-secondary carrying smcp - both fail silently otherwise. */
|
|
99
|
+
--font-primary: inherit;
|
|
100
|
+
--font-secondary: inherit;
|
|
101
|
+
|
|
102
|
+
/* Type roles, not a scale: one role per job, so a component asks for what its text is, never a rung.
|
|
103
|
+
display > title > subtitle are the three heading steps H1-H3 bind to; H4-H6 share body and split
|
|
104
|
+
by weight, so there is no fourth role. display is the hero and must out-scale every subpage head. */
|
|
105
|
+
--text-display: clamp(3rem, 7vw, 6rem);
|
|
106
|
+
--leading-display: 1.05;
|
|
107
|
+
--text-title: clamp(2.25rem, 5vw, 4.25rem);
|
|
108
|
+
--leading-title: 1.1;
|
|
109
|
+
--text-subtitle: clamp(1.5rem, 3vw, 2.25rem);
|
|
110
|
+
--leading-subtitle: 1.2;
|
|
111
|
+
|
|
112
|
+
/* The reading block's opening paragraph (Prose #21): sized above body and below subtitle, led
|
|
113
|
+
tighter than body's 1.6 but not as tight as a heading's 1.2 - it is running text, not a head, so
|
|
114
|
+
it keeps running-text leading. A role, not a rung: one lede per block, nothing to choose. Reusing
|
|
115
|
+
subtitle was rejected in ADR 0004 - it welds the lede's size to H3's and its leading to a head's. */
|
|
116
|
+
--text-lede: 1.25rem; /* 20px */
|
|
117
|
+
--leading-lede: 1.4;
|
|
118
|
+
--text-body: 1.0625rem; /* 17px */
|
|
119
|
+
--leading-body: 1.6;
|
|
120
|
+
--text-small: 0.9375rem; /* 15px floor: below it tabular figures stop comparing column to column */
|
|
121
|
+
--text-label: 0.8125rem; /* 13px floor: below it the tracking reads as damage, not a device */
|
|
122
|
+
|
|
123
|
+
/* Two quantities on one property that must not collapse: --tracking-label is a fixed letter-spaced
|
|
124
|
+
style, --tracking-optical a correction that varies with size. The names say which is which, so the
|
|
125
|
+
distinction survives without the ADR in hand. Scope: the title role and above - H1, H2 and the page
|
|
126
|
+
head's h1 - and never below it, where the correction would read as damage. See the ADR. */
|
|
127
|
+
--tracking-label: 0.14em;
|
|
128
|
+
--tracking-optical: -0.02em;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* The aspect roles are Tailwind theme namespaces like typography, so they take their own @theme block
|
|
132
|
+
after it and are not carried in @theme inline with the palette. */
|
|
133
|
+
@theme {
|
|
134
|
+
--aspect-portrait: 4 / 5;
|
|
135
|
+
--aspect-square: 1 / 1;
|
|
136
|
+
--aspect-landscape: 3 / 2;
|
|
137
|
+
--aspect-wide: 16 / 9;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* The reading measure has no Tailwind namespace, so it sits in :root beside radius. */
|
|
141
|
+
:root {
|
|
142
|
+
--measure: 66ch;
|
|
143
|
+
--measure-display: 36ch;
|
|
144
|
+
--measure-wide: 72ch;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Spacing has no Tailwind namespace either - --spacing is a single base multiplier ADR 0004 forbids
|
|
148
|
+
re-pointing - so the three roles sit in :root beside the measure. */
|
|
149
|
+
:root {
|
|
150
|
+
--space-stack: 0.5em;
|
|
151
|
+
--space-region: 1.5em;
|
|
152
|
+
--space-band: 4em;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* The gutter has no Tailwind namespace either, so it sits in :root beside the space roles. */
|
|
156
|
+
:root {
|
|
157
|
+
--gutter: clamp(1.5rem, 5vw, 4rem);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* The fold height has no Tailwind namespace either, so it sits in :root beside the gutter. */
|
|
161
|
+
:root {
|
|
162
|
+
--fold-height: min(70vh, 40rem);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* The checklist tick's dimensions are not colours either, and sit in :root beside the underline block. */
|
|
166
|
+
:root {
|
|
167
|
+
--tick-length: 0.9rem;
|
|
168
|
+
--tick-thickness: 1px;
|
|
169
|
+
}
|