@prunellejs/ui 0.0.0-stage → 0.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/llms.txt +70 -0
- package/package.json +32 -4
- package/src/CommandPalette.tsx +207 -0
- package/src/DataTable.tsx +165 -0
- package/src/Dialog.tsx +165 -0
- package/src/Drawer.tsx +4 -0
- package/src/Menu.tsx +115 -0
- package/src/Select.tsx +114 -0
- package/src/Tabs.tsx +63 -0
- package/src/Toaster.tsx +31 -0
- package/src/behaviors.ts +287 -0
- package/src/field-context.ts +21 -0
- package/src/index.ts +72 -0
- package/src/platform-fallback.ts +36 -0
- package/src/plugin.ts +105 -0
- package/src/primitives.tsx +237 -0
- package/src/static.tsx +319 -0
- package/src/styles/bare.css +315 -0
- package/src/styles/grammars/console.css +321 -0
- package/src/styles/grammars/editorial.css +334 -0
- package/src/styles/grammars/orbit.css +538 -0
- package/src/styles/grammars/prunelle.css +652 -0
- package/src/styles/grammars/soft.css +294 -0
- package/src/styles/grammars/workshop.css +313 -0
- package/src/table-state.ts +126 -0
- package/src/tabs-state.ts +39 -0
- package/src/toast.ts +68 -0
- package/README.md +0 -3
|
@@ -0,0 +1,652 @@
|
|
|
1
|
+
/* Grammar: Prunelle, prunelle's own look: a printed book. Porcelaine paper and plum in light, Velours and gold in dark, via native light-dark() with zero JS.
|
|
2
|
+
* Rules instead of boxes, nearly square corners, titles in Fraunces (load it, or Georgia stands in), text in the system's sans.
|
|
3
|
+
* The eye is the only ornament: a radio is an eye, shut until checked; a switch's knob opens its eye when on; Progress looks left and right while it waits, and its pupil widens until it fills the eye.
|
|
4
|
+
* Eject via `prunelle ui-eject prunelle`. */
|
|
5
|
+
|
|
6
|
+
@import '../bare.css';
|
|
7
|
+
|
|
8
|
+
@property --ui-progress { syntax: '<number>'; inherits: true; initial-value: 0; }
|
|
9
|
+
@property --ui-lid-ink { syntax: '<color>'; inherits: true; initial-value: transparent; }
|
|
10
|
+
|
|
11
|
+
@layer kui {
|
|
12
|
+
:root {
|
|
13
|
+
color-scheme: light dark;
|
|
14
|
+
--ui-paper: light-dark(#f8f4ee, #130e16);
|
|
15
|
+
--ui-surface: light-dark(#fdfaf6, #1a1320);
|
|
16
|
+
--ui-surface-strong: light-dark(#efe8e1, #241b2d);
|
|
17
|
+
--ui-ink: light-dark(#18111d, #f8f4ee);
|
|
18
|
+
--ui-subtext: light-dark(#3d3045, #d6cbdf);
|
|
19
|
+
--ui-muted: light-dark(#5a4b63, #b5a6c2);
|
|
20
|
+
--ui-line: light-dark(#d9ced6, #2e2339);
|
|
21
|
+
--ui-line-strong: light-dark(#8e7c8c, #6e5c80);
|
|
22
|
+
--ui-accent: light-dark(#7a3667, #e5c068);
|
|
23
|
+
--ui-accent-hover: light-dark(#692857, #edd085);
|
|
24
|
+
--ui-accent-fill: light-dark(#18111d, #e5c068);
|
|
25
|
+
--ui-on-accent: light-dark(#f8f4ee, #130e16);
|
|
26
|
+
--ui-on-primary: light-dark(#e5c068, #130e16);
|
|
27
|
+
--ui-info: light-dark(#2b5c8a, #8fb8ea);
|
|
28
|
+
--ui-success: light-dark(#2c6b3a, #7cc79a);
|
|
29
|
+
--ui-warning: light-dark(#7d5c00, #f2a65a);
|
|
30
|
+
--ui-danger: light-dark(#b42318, #f58a8a);
|
|
31
|
+
--ui-iris: light-dark(#7a3667, #e5c068);
|
|
32
|
+
--ui-pupil: light-dark(#18111d, #130e16);
|
|
33
|
+
--ui-font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
|
|
34
|
+
--ui-font-body: 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Noto Sans', Cantarell, Ubuntu, Arial, sans-serif;
|
|
35
|
+
--ui-font-mono: ui-monospace, 'Cascadia Code', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
|
|
36
|
+
--ui-radius: 2px;
|
|
37
|
+
--ui-radius-inner: 2px;
|
|
38
|
+
--ui-motion: 180ms;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
html {
|
|
42
|
+
background-color: var(--ui-paper);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
body {
|
|
46
|
+
background-color: var(--ui-paper);
|
|
47
|
+
color: var(--ui-ink);
|
|
48
|
+
font-family: var(--ui-font-body);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[data-ui="button"] {
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
gap: 0.45rem;
|
|
56
|
+
min-block-size: 34px;
|
|
57
|
+
padding: 0 14px;
|
|
58
|
+
font: 500 0.8125rem/1 var(--ui-font-body);
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
border: 0;
|
|
61
|
+
border-radius: var(--ui-radius);
|
|
62
|
+
background: var(--ui-surface);
|
|
63
|
+
box-shadow: inset 0 0 0 1px var(--ui-line-strong);
|
|
64
|
+
color: var(--ui-ink);
|
|
65
|
+
text-decoration: none;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
transition: box-shadow var(--ui-motion), background-color var(--ui-motion), color var(--ui-motion);
|
|
68
|
+
|
|
69
|
+
&:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--ui-ink); }
|
|
70
|
+
&:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
71
|
+
&[data-variant="outline"] { background: transparent; }
|
|
72
|
+
&[data-variant="ghost"] {
|
|
73
|
+
background: transparent;
|
|
74
|
+
box-shadow: none;
|
|
75
|
+
padding-inline: 2px;
|
|
76
|
+
text-decoration: underline 1px var(--ui-accent);
|
|
77
|
+
text-underline-offset: 5px;
|
|
78
|
+
&:hover:not(:disabled) { box-shadow: none; text-decoration-thickness: 2px; }
|
|
79
|
+
}
|
|
80
|
+
&[data-tone="accent"] {
|
|
81
|
+
background: var(--ui-accent-fill);
|
|
82
|
+
box-shadow: none;
|
|
83
|
+
color: var(--ui-on-primary);
|
|
84
|
+
text-decoration: none;
|
|
85
|
+
&:hover:not(:disabled) { box-shadow: none; background: color-mix(in srgb, var(--ui-accent-fill) 86%, var(--ui-paper)); }
|
|
86
|
+
}
|
|
87
|
+
&[data-tone="danger"] {
|
|
88
|
+
background: transparent;
|
|
89
|
+
box-shadow: inset 0 0 0 1px var(--ui-danger);
|
|
90
|
+
color: var(--ui-danger);
|
|
91
|
+
&:hover:not(:disabled) { background: var(--ui-danger); box-shadow: none; color: var(--ui-on-accent); }
|
|
92
|
+
}
|
|
93
|
+
&[data-size="sm"] { min-block-size: 28px; padding: 0 10px; font-size: 0.75rem; }
|
|
94
|
+
&[data-size="lg"] { min-block-size: 42px; padding: 0 20px; font-size: 0.9375rem; }
|
|
95
|
+
&[data-variant="ghost"][data-size] { padding-inline: 2px; }
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[data-ui="card"] {
|
|
99
|
+
border: 1px solid var(--ui-line);
|
|
100
|
+
border-radius: var(--ui-radius);
|
|
101
|
+
background: var(--ui-surface);
|
|
102
|
+
color: var(--ui-ink);
|
|
103
|
+
padding: 1.1rem 1.25rem;
|
|
104
|
+
|
|
105
|
+
& [data-part="header"] {
|
|
106
|
+
font: 500 0.9375rem/1.3 var(--ui-font-display);
|
|
107
|
+
padding-block-end: 6px;
|
|
108
|
+
margin-block-end: 14px;
|
|
109
|
+
border-bottom: 1px solid var(--ui-ink);
|
|
110
|
+
}
|
|
111
|
+
& [data-part="footer"] {
|
|
112
|
+
margin-block-start: 14px;
|
|
113
|
+
padding-block-start: 10px;
|
|
114
|
+
border-top: 1px solid var(--ui-line);
|
|
115
|
+
color: var(--ui-muted);
|
|
116
|
+
font-size: 0.75rem;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* A badge is a word in its tone after a dot, as in a book's margin. */
|
|
121
|
+
[data-ui="badge"] {
|
|
122
|
+
display: inline-flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
gap: 6px;
|
|
125
|
+
font: 400 0.8125rem/1.3 var(--ui-font-body);
|
|
126
|
+
white-space: nowrap;
|
|
127
|
+
color: var(--ui-tone, var(--ui-muted));
|
|
128
|
+
&::before {
|
|
129
|
+
content: '';
|
|
130
|
+
inline-size: 6px;
|
|
131
|
+
block-size: 6px;
|
|
132
|
+
border-radius: 50%;
|
|
133
|
+
background: currentColor;
|
|
134
|
+
flex: none;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
:is([data-ui="badge"], [data-ui="notice"], [data-ui="toast"])[data-tone="accent"] { --ui-tone: var(--ui-accent); }
|
|
138
|
+
:is([data-ui="badge"], [data-ui="notice"])[data-tone="success"] { --ui-tone: var(--ui-success); }
|
|
139
|
+
:is([data-ui="badge"], [data-ui="notice"])[data-tone="warning"] { --ui-tone: var(--ui-warning); }
|
|
140
|
+
:is([data-ui="badge"], [data-ui="notice"])[data-tone="danger"] { --ui-tone: var(--ui-danger); }
|
|
141
|
+
|
|
142
|
+
/* A notice is a rule in its tone above the text, its bold words in the tone too. */
|
|
143
|
+
[data-ui="notice"] {
|
|
144
|
+
padding: 10px 0 2px;
|
|
145
|
+
border-top: 2px solid var(--ui-tone, var(--ui-accent));
|
|
146
|
+
color: var(--ui-ink);
|
|
147
|
+
font: 400 0.875rem/1.55 var(--ui-font-body);
|
|
148
|
+
& :is(b, strong) { color: var(--ui-tone, var(--ui-accent)); font-weight: 600; }
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
[data-ui="field"] {
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-direction: column;
|
|
154
|
+
gap: 4px;
|
|
155
|
+
& [data-part="label"] { font: 500 0.8125rem/1.3 var(--ui-font-body); color: var(--ui-ink); }
|
|
156
|
+
& :is(input:not([type="checkbox"], [type="radio"]), textarea, select) {
|
|
157
|
+
min-block-size: 34px;
|
|
158
|
+
padding: 0.4rem 10px;
|
|
159
|
+
font: 400 0.875rem/1.4 var(--ui-font-body);
|
|
160
|
+
color: var(--ui-ink);
|
|
161
|
+
background: var(--ui-surface);
|
|
162
|
+
border: 1px solid var(--ui-line-strong);
|
|
163
|
+
border-radius: var(--ui-radius);
|
|
164
|
+
transition: border-color var(--ui-motion), box-shadow var(--ui-motion);
|
|
165
|
+
}
|
|
166
|
+
& :is(input, textarea, select):focus {
|
|
167
|
+
outline: none;
|
|
168
|
+
border-color: var(--ui-accent);
|
|
169
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 22%, transparent);
|
|
170
|
+
}
|
|
171
|
+
& [aria-invalid="true"] { border-color: var(--ui-danger); }
|
|
172
|
+
& [data-part="hint"] { margin: 0; font-size: 0.75rem; color: var(--ui-muted); }
|
|
173
|
+
& [data-part="error"] { margin: 0; font-size: 0.75rem; color: var(--ui-danger); }
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
[data-ui="accordion"] details {
|
|
177
|
+
border-bottom: 1px solid var(--ui-line);
|
|
178
|
+
}
|
|
179
|
+
[data-ui="accordion"] summary[data-part="trigger"] {
|
|
180
|
+
list-style: none;
|
|
181
|
+
cursor: pointer;
|
|
182
|
+
display: flex;
|
|
183
|
+
align-items: center;
|
|
184
|
+
justify-content: space-between;
|
|
185
|
+
gap: 12px;
|
|
186
|
+
padding: 11px 0;
|
|
187
|
+
font: 500 1rem/1.3 var(--ui-font-display);
|
|
188
|
+
color: var(--ui-ink);
|
|
189
|
+
&::-webkit-details-marker { display: none; }
|
|
190
|
+
&::after {
|
|
191
|
+
content: '';
|
|
192
|
+
inline-size: 7px;
|
|
193
|
+
block-size: 7px;
|
|
194
|
+
flex: none;
|
|
195
|
+
border: solid var(--ui-muted);
|
|
196
|
+
border-width: 0 1.5px 1.5px 0;
|
|
197
|
+
transform: translateY(-2px) rotate(45deg);
|
|
198
|
+
transition: transform var(--ui-motion);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
[data-ui="accordion"] details[open] summary[data-part="trigger"]::after {
|
|
202
|
+
transform: translateY(2px) rotate(-135deg);
|
|
203
|
+
}
|
|
204
|
+
[data-ui="accordion"] [data-part="content"] {
|
|
205
|
+
padding-block-end: 12px;
|
|
206
|
+
color: var(--ui-muted);
|
|
207
|
+
font-size: 0.875rem;
|
|
208
|
+
line-height: 1.55;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
[data-ui="tabs"] [data-part="list"] {
|
|
212
|
+
display: flex;
|
|
213
|
+
gap: 22px;
|
|
214
|
+
border-bottom: 1px solid var(--ui-line-strong);
|
|
215
|
+
}
|
|
216
|
+
[data-ui="tabs"] [data-part="trigger"] {
|
|
217
|
+
background: transparent;
|
|
218
|
+
border: 0;
|
|
219
|
+
padding: 8px 0;
|
|
220
|
+
margin-block-end: -1px;
|
|
221
|
+
font: 400 0.8125rem/1.3 var(--ui-font-body);
|
|
222
|
+
color: var(--ui-muted);
|
|
223
|
+
cursor: pointer;
|
|
224
|
+
transition: color var(--ui-motion), box-shadow var(--ui-motion);
|
|
225
|
+
&:hover { color: var(--ui-ink); }
|
|
226
|
+
&[data-state="active"] {
|
|
227
|
+
color: var(--ui-ink);
|
|
228
|
+
box-shadow: inset 0 -2px 0 var(--ui-accent);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
[data-ui="tabs"] [data-part="panel"] {
|
|
232
|
+
padding-block-start: 14px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
dialog[data-ui="dialog"],
|
|
236
|
+
dialog[data-ui="drawer"],
|
|
237
|
+
dialog[data-ui="command"] {
|
|
238
|
+
border: 1px solid var(--ui-ink);
|
|
239
|
+
border-radius: var(--ui-radius);
|
|
240
|
+
background: var(--ui-paper);
|
|
241
|
+
color: var(--ui-ink);
|
|
242
|
+
font-family: var(--ui-font-body);
|
|
243
|
+
padding: 0;
|
|
244
|
+
& [data-part="title"] {
|
|
245
|
+
margin: 0 0 8px;
|
|
246
|
+
font: 500 1.375rem/1.2 var(--ui-font-display);
|
|
247
|
+
}
|
|
248
|
+
& [data-part="description"] { color: var(--ui-muted); font-size: 0.875rem; }
|
|
249
|
+
}
|
|
250
|
+
dialog[data-ui="dialog"] {
|
|
251
|
+
& > [data-part="panel"] { padding: 20px 22px; }
|
|
252
|
+
}
|
|
253
|
+
dialog[data-ui="drawer"] {
|
|
254
|
+
border-radius: 0;
|
|
255
|
+
border-block: 0;
|
|
256
|
+
& > [data-part="panel"] { padding: 20px 22px; }
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
[data-ui="popover"][popover],
|
|
260
|
+
[data-ui="menu"] [data-part="content"],
|
|
261
|
+
[data-ui="select"] [data-part="listbox"] {
|
|
262
|
+
background: var(--ui-paper);
|
|
263
|
+
color: var(--ui-ink);
|
|
264
|
+
border: 1px solid var(--ui-line-strong);
|
|
265
|
+
border-radius: var(--ui-radius);
|
|
266
|
+
padding: 4px;
|
|
267
|
+
min-inline-size: 11.5rem;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
[data-ui="menu"] [data-part="item"],
|
|
271
|
+
[data-ui="select"] [data-part="option"] {
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
justify-content: space-between;
|
|
275
|
+
width: 100%;
|
|
276
|
+
min-block-size: 32px;
|
|
277
|
+
text-align: start;
|
|
278
|
+
background: transparent;
|
|
279
|
+
border: 0;
|
|
280
|
+
border-radius: var(--ui-radius);
|
|
281
|
+
padding: 0 10px;
|
|
282
|
+
font: 400 0.8125rem/1.35 var(--ui-font-body);
|
|
283
|
+
color: var(--ui-ink);
|
|
284
|
+
cursor: pointer;
|
|
285
|
+
&:hover, &[data-highlighted="true"] { background: var(--ui-surface-strong); }
|
|
286
|
+
&[data-selected="true"] { color: var(--ui-accent); }
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
[data-ui="select"] [data-part="trigger"] {
|
|
290
|
+
display: inline-flex;
|
|
291
|
+
align-items: center;
|
|
292
|
+
justify-content: space-between;
|
|
293
|
+
gap: 0.75rem;
|
|
294
|
+
min-inline-size: 11.5rem;
|
|
295
|
+
min-block-size: 34px;
|
|
296
|
+
background: var(--ui-surface);
|
|
297
|
+
color: var(--ui-ink);
|
|
298
|
+
border: 1px solid var(--ui-line-strong);
|
|
299
|
+
border-radius: var(--ui-radius);
|
|
300
|
+
padding: 0 10px;
|
|
301
|
+
font: 400 0.8125rem/1.3 var(--ui-font-body);
|
|
302
|
+
cursor: pointer;
|
|
303
|
+
&:hover { border-color: var(--ui-ink); }
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/* A toast is the page inverted: ink ground, paper text, its tone a dot in the other theme's colour. */
|
|
307
|
+
[data-ui="toast"] {
|
|
308
|
+
display: flex;
|
|
309
|
+
align-items: start;
|
|
310
|
+
justify-content: space-between;
|
|
311
|
+
gap: 10px;
|
|
312
|
+
padding: 10px 14px;
|
|
313
|
+
border-radius: var(--ui-radius);
|
|
314
|
+
background: var(--ui-ink);
|
|
315
|
+
color: var(--ui-paper);
|
|
316
|
+
font: 400 0.8125rem/1.45 var(--ui-font-body);
|
|
317
|
+
&[data-tone] { box-shadow: inset 3px 0 0 var(--ui-tone); }
|
|
318
|
+
&[data-tone="accent"] { --ui-tone: light-dark(#e5c068, #7a3667); }
|
|
319
|
+
&[data-tone="success"] { --ui-tone: light-dark(#7cc79a, #2c6b3a); }
|
|
320
|
+
&[data-tone="warning"] { --ui-tone: light-dark(#f2a65a, #7d5c00); }
|
|
321
|
+
&[data-tone="danger"] { --ui-tone: light-dark(#f58a8a, #b42318); }
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
[data-ui="checkbox"] {
|
|
325
|
+
gap: 10px;
|
|
326
|
+
font-size: 0.875rem;
|
|
327
|
+
}
|
|
328
|
+
[data-ui="checkbox"] input[type="checkbox"] {
|
|
329
|
+
appearance: none;
|
|
330
|
+
display: inline-grid;
|
|
331
|
+
place-items: center;
|
|
332
|
+
flex: none;
|
|
333
|
+
inline-size: 16px;
|
|
334
|
+
block-size: 16px;
|
|
335
|
+
margin: 0;
|
|
336
|
+
border-radius: var(--ui-radius);
|
|
337
|
+
background: var(--ui-surface);
|
|
338
|
+
box-shadow: inset 0 0 0 1.5px var(--ui-line-strong);
|
|
339
|
+
cursor: pointer;
|
|
340
|
+
&:checked { background: var(--ui-accent); box-shadow: none; }
|
|
341
|
+
&:checked::after {
|
|
342
|
+
content: '';
|
|
343
|
+
inline-size: 4px;
|
|
344
|
+
block-size: 8px;
|
|
345
|
+
border: solid var(--ui-on-accent);
|
|
346
|
+
border-width: 0 2px 2px 0;
|
|
347
|
+
transform: translateY(-1px) rotate(45deg);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/* The eye. A shut eye is its lower lid, a curve painted as the control's background; opening it fades the lid, grows the almond (::before) to full height and shows the pupil (::after), an upright oval. */
|
|
352
|
+
[data-ui="radio-group"] input[type="radio"],
|
|
353
|
+
[data-ui="switch"] [data-part="track"] {
|
|
354
|
+
--ui-lid: 0.2;
|
|
355
|
+
--ui-lid-ink: var(--ui-line-strong);
|
|
356
|
+
--ui-lid-r: calc(var(--ui-eye) * 0.372);
|
|
357
|
+
display: inline-grid;
|
|
358
|
+
place-items: center;
|
|
359
|
+
flex: none;
|
|
360
|
+
inline-size: var(--ui-eye);
|
|
361
|
+
block-size: var(--ui-eye);
|
|
362
|
+
background: radial-gradient(circle var(--ui-lid-r) at 50% calc(var(--ui-eye) * -0.172), transparent calc(var(--ui-lid-r) - var(--ui-lid-w) - 0.5px), var(--ui-lid-ink) calc(var(--ui-lid-r) - var(--ui-lid-w)) calc(var(--ui-lid-r) - 0.5px), transparent var(--ui-lid-r)) calc(var(--ui-eye) * 0.17) calc(var(--ui-eye) * 0.4) / calc(var(--ui-eye) * 0.66) calc(var(--ui-eye) * 0.26) no-repeat;
|
|
363
|
+
transition: --ui-lid-ink 120ms;
|
|
364
|
+
&::before,
|
|
365
|
+
&::after {
|
|
366
|
+
content: '';
|
|
367
|
+
grid-area: 1 / 1;
|
|
368
|
+
opacity: 0;
|
|
369
|
+
transition: transform var(--ui-motion) ease, opacity 120ms;
|
|
370
|
+
}
|
|
371
|
+
&::before {
|
|
372
|
+
inline-size: 70%;
|
|
373
|
+
block-size: 70%;
|
|
374
|
+
border-radius: 100% 0;
|
|
375
|
+
background: var(--ui-iris);
|
|
376
|
+
box-shadow: inset 0 0 0 var(--ui-rim, 0) var(--ui-pupil);
|
|
377
|
+
transform: scaleY(var(--ui-lid)) rotate(45deg);
|
|
378
|
+
}
|
|
379
|
+
&::after {
|
|
380
|
+
inline-size: calc(var(--ui-eye) * 0.12);
|
|
381
|
+
block-size: calc(var(--ui-eye) * 0.34);
|
|
382
|
+
border-radius: 50%;
|
|
383
|
+
background: var(--ui-pupil);
|
|
384
|
+
transform: scaleY(var(--ui-lid));
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
:is([data-ui="radio-group"] input[type="radio"]:checked, [data-ui="switch"] input:checked + [data-part="track"]) {
|
|
388
|
+
--ui-lid: 1;
|
|
389
|
+
--ui-lid-ink: transparent;
|
|
390
|
+
&::before,
|
|
391
|
+
&::after { opacity: 1; }
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
[data-ui="radio-group"] [data-part="legend"] {
|
|
395
|
+
font: 500 0.8125rem/1.3 var(--ui-font-body);
|
|
396
|
+
color: var(--ui-ink);
|
|
397
|
+
margin-block-end: 6px;
|
|
398
|
+
}
|
|
399
|
+
[data-ui="radio-group"] [data-part="option"] {
|
|
400
|
+
gap: 10px;
|
|
401
|
+
font-size: 0.875rem;
|
|
402
|
+
}
|
|
403
|
+
[data-ui="radio-group"] [data-part="hint"] { font-size: 0.75rem; color: var(--ui-muted); }
|
|
404
|
+
[data-ui="radio-group"] input[type="radio"] {
|
|
405
|
+
--ui-eye: 24px;
|
|
406
|
+
--ui-lid-w: 2px;
|
|
407
|
+
appearance: none;
|
|
408
|
+
margin: 0;
|
|
409
|
+
border-radius: 4px;
|
|
410
|
+
cursor: pointer;
|
|
411
|
+
&:disabled { cursor: not-allowed; }
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/* Switch: the input is the track, the track part its knob, an eye on white whatever the theme, rimmed so a gold almond still reads. */
|
|
415
|
+
[data-ui="switch"] {
|
|
416
|
+
position: relative;
|
|
417
|
+
gap: 10px;
|
|
418
|
+
font-size: 0.875rem;
|
|
419
|
+
}
|
|
420
|
+
[data-ui="switch"] input[type="checkbox"] {
|
|
421
|
+
appearance: none;
|
|
422
|
+
position: static;
|
|
423
|
+
opacity: 1;
|
|
424
|
+
pointer-events: auto;
|
|
425
|
+
flex: none;
|
|
426
|
+
inline-size: 36px;
|
|
427
|
+
block-size: 20px;
|
|
428
|
+
margin: 0;
|
|
429
|
+
border-radius: 10px;
|
|
430
|
+
background: var(--ui-line-strong);
|
|
431
|
+
cursor: pointer;
|
|
432
|
+
transition: background-color var(--ui-motion);
|
|
433
|
+
&:checked { background: var(--ui-accent); }
|
|
434
|
+
&:disabled { cursor: not-allowed; }
|
|
435
|
+
}
|
|
436
|
+
[data-ui="switch"] [data-part="track"] {
|
|
437
|
+
--ui-eye: 16px;
|
|
438
|
+
--ui-lid-w: 1.5px;
|
|
439
|
+
--ui-rim: 1.5px;
|
|
440
|
+
--ui-pupil: #18111d;
|
|
441
|
+
position: absolute;
|
|
442
|
+
inset-block-start: 50%;
|
|
443
|
+
inset-inline-start: 2px;
|
|
444
|
+
translate: 0 -50%;
|
|
445
|
+
border: 0;
|
|
446
|
+
border-radius: 50%;
|
|
447
|
+
background-color: #fff;
|
|
448
|
+
pointer-events: none;
|
|
449
|
+
transition: inset-inline-start var(--ui-motion) ease, --ui-lid-ink 120ms;
|
|
450
|
+
&::before { inline-size: 58%; block-size: 58%; }
|
|
451
|
+
&::after {
|
|
452
|
+
position: static;
|
|
453
|
+
inset: auto;
|
|
454
|
+
aspect-ratio: auto;
|
|
455
|
+
inline-size: calc(var(--ui-eye) * 0.12);
|
|
456
|
+
block-size: calc(var(--ui-eye) * 0.34);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
[data-ui="switch"] input:checked + [data-part="track"] {
|
|
460
|
+
inset-inline-start: 18px;
|
|
461
|
+
&::after { inset-inline-start: auto; transform: scaleY(var(--ui-lid)); }
|
|
462
|
+
}
|
|
463
|
+
[data-ui="switch"]:has(input:focus-visible) [data-part="track"],
|
|
464
|
+
[data-ui="switch"] input:focus-visible + [data-part="track"] {
|
|
465
|
+
outline: none;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
/* Progress: the native bar stays for assistive tech and the eye shows it. Without a value the pupil opens to an oval, looks left, then right, narrows back and the eye blinks; with one the pupil widens until it fills the eye, a ring of iris keeping the full eye visible. */
|
|
469
|
+
[data-ui="progress"] {
|
|
470
|
+
--ui-eye: 22px;
|
|
471
|
+
position: relative;
|
|
472
|
+
gap: 10px;
|
|
473
|
+
font-size: 0.8125rem;
|
|
474
|
+
color: var(--ui-muted);
|
|
475
|
+
transition: --ui-progress 300ms ease;
|
|
476
|
+
}
|
|
477
|
+
[data-ui="progress"] progress {
|
|
478
|
+
position: absolute;
|
|
479
|
+
inline-size: 1px;
|
|
480
|
+
block-size: 1px;
|
|
481
|
+
margin: -1px;
|
|
482
|
+
overflow: hidden;
|
|
483
|
+
clip-path: inset(50%);
|
|
484
|
+
white-space: nowrap;
|
|
485
|
+
}
|
|
486
|
+
[data-ui="progress"] [data-part="eye"] {
|
|
487
|
+
display: grid;
|
|
488
|
+
place-items: center;
|
|
489
|
+
flex: none;
|
|
490
|
+
inline-size: calc(var(--ui-eye) * 0.7);
|
|
491
|
+
block-size: calc(var(--ui-eye) * 0.7);
|
|
492
|
+
margin: calc(var(--ui-eye) * 0.15);
|
|
493
|
+
overflow: hidden;
|
|
494
|
+
border-radius: 100% 0;
|
|
495
|
+
background: var(--ui-iris);
|
|
496
|
+
transform: scaleY(var(--ui-lid, 1)) rotate(45deg);
|
|
497
|
+
&::after {
|
|
498
|
+
content: '';
|
|
499
|
+
inline-size: calc(var(--ui-eye) * 0.12);
|
|
500
|
+
block-size: calc(var(--ui-eye) * 0.34);
|
|
501
|
+
border-radius: 50%;
|
|
502
|
+
background: var(--ui-pupil);
|
|
503
|
+
transform: rotate(-45deg) scale(calc(1 + var(--ui-progress) * 10), calc(1 + var(--ui-progress) * 0.8));
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
[data-ui="progress"][data-value] [data-part="eye"] {
|
|
507
|
+
box-shadow: 0 0 0 calc(var(--ui-eye) * 0.05) var(--ui-iris);
|
|
508
|
+
}
|
|
509
|
+
[data-ui="progress"]:not([data-value]) [data-part="eye"] {
|
|
510
|
+
animation: ui-eye-blink 3.2s ease-in-out infinite;
|
|
511
|
+
&::after { animation: ui-eye-look 3.2s ease-in-out infinite; }
|
|
512
|
+
}
|
|
513
|
+
[data-ui="progress"][data-value="0"] { --ui-progress: 0; }
|
|
514
|
+
[data-ui="progress"][data-value="5"] { --ui-progress: 0.05; }
|
|
515
|
+
[data-ui="progress"][data-value="10"] { --ui-progress: 0.1; }
|
|
516
|
+
[data-ui="progress"][data-value="15"] { --ui-progress: 0.15; }
|
|
517
|
+
[data-ui="progress"][data-value="20"] { --ui-progress: 0.2; }
|
|
518
|
+
[data-ui="progress"][data-value="25"] { --ui-progress: 0.25; }
|
|
519
|
+
[data-ui="progress"][data-value="30"] { --ui-progress: 0.3; }
|
|
520
|
+
[data-ui="progress"][data-value="35"] { --ui-progress: 0.35; }
|
|
521
|
+
[data-ui="progress"][data-value="40"] { --ui-progress: 0.4; }
|
|
522
|
+
[data-ui="progress"][data-value="45"] { --ui-progress: 0.45; }
|
|
523
|
+
[data-ui="progress"][data-value="50"] { --ui-progress: 0.5; }
|
|
524
|
+
[data-ui="progress"][data-value="55"] { --ui-progress: 0.55; }
|
|
525
|
+
[data-ui="progress"][data-value="60"] { --ui-progress: 0.6; }
|
|
526
|
+
[data-ui="progress"][data-value="65"] { --ui-progress: 0.65; }
|
|
527
|
+
[data-ui="progress"][data-value="70"] { --ui-progress: 0.7; }
|
|
528
|
+
[data-ui="progress"][data-value="75"] { --ui-progress: 0.75; }
|
|
529
|
+
[data-ui="progress"][data-value="80"] { --ui-progress: 0.8; }
|
|
530
|
+
[data-ui="progress"][data-value="85"] { --ui-progress: 0.85; }
|
|
531
|
+
[data-ui="progress"][data-value="90"] { --ui-progress: 0.9; }
|
|
532
|
+
[data-ui="progress"][data-value="95"] { --ui-progress: 0.95; }
|
|
533
|
+
[data-ui="progress"][data-value="100"] { --ui-progress: 1; }
|
|
534
|
+
|
|
535
|
+
@keyframes ui-eye-blink {
|
|
536
|
+
0%, 83%, 93%, 100% { transform: scaleY(1) rotate(45deg); }
|
|
537
|
+
88% { transform: scaleY(0.08) rotate(45deg); }
|
|
538
|
+
}
|
|
539
|
+
@keyframes ui-eye-look {
|
|
540
|
+
0%, 100% { transform: rotate(-45deg) translateX(0) scale(1, 1); }
|
|
541
|
+
10%, 74% { transform: rotate(-45deg) translateX(0) scale(1.9, 1); }
|
|
542
|
+
22%, 34% { transform: rotate(-45deg) translateX(calc(var(--ui-eye) * -0.18)) scale(1.9, 1); }
|
|
543
|
+
50%, 62% { transform: rotate(-45deg) translateX(calc(var(--ui-eye) * 0.18)) scale(1.9, 1); }
|
|
544
|
+
82% { transform: rotate(-45deg) translateX(0) scale(1, 1); }
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
dialog[data-ui="command"] {
|
|
548
|
+
& [data-part="input"] {
|
|
549
|
+
width: 100%;
|
|
550
|
+
border: 0;
|
|
551
|
+
border-bottom: 1px solid var(--ui-line-strong);
|
|
552
|
+
background: var(--ui-paper);
|
|
553
|
+
color: var(--ui-ink);
|
|
554
|
+
padding: 12px 14px;
|
|
555
|
+
font: 400 0.9375rem/1.35 var(--ui-font-body);
|
|
556
|
+
&:focus-visible {
|
|
557
|
+
outline: 2px solid var(--ui-accent);
|
|
558
|
+
outline-offset: -2px;
|
|
559
|
+
border-bottom-color: var(--ui-accent);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
& [data-part="list"] { padding: 4px; }
|
|
563
|
+
& [data-part="item"] {
|
|
564
|
+
display: flex;
|
|
565
|
+
justify-content: space-between;
|
|
566
|
+
align-items: center;
|
|
567
|
+
width: 100%;
|
|
568
|
+
min-block-size: 32px;
|
|
569
|
+
border: 0;
|
|
570
|
+
border-radius: var(--ui-radius);
|
|
571
|
+
background: transparent;
|
|
572
|
+
color: var(--ui-ink);
|
|
573
|
+
padding: 0 10px;
|
|
574
|
+
font: 400 0.8125rem/1.35 var(--ui-font-body);
|
|
575
|
+
cursor: pointer;
|
|
576
|
+
&[data-highlighted="true"] { background: var(--ui-surface-strong); }
|
|
577
|
+
}
|
|
578
|
+
& [data-part="kbd"] {
|
|
579
|
+
font: 400 0.75rem/1 var(--ui-font-mono);
|
|
580
|
+
color: var(--ui-muted);
|
|
581
|
+
background: var(--ui-surface-strong);
|
|
582
|
+
border-radius: var(--ui-radius);
|
|
583
|
+
padding: 3px 5px;
|
|
584
|
+
}
|
|
585
|
+
& [data-part="empty"] { padding: 12px 14px; margin: 0; color: var(--ui-muted); font-size: 0.8125rem; }
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/* Tables are ruled like a book's: a heavy rule above and below, a thin one under the head, none between rows. */
|
|
589
|
+
table[data-ui="table"],
|
|
590
|
+
[data-ui="datatable"] table {
|
|
591
|
+
border-block: 2px solid var(--ui-ink);
|
|
592
|
+
font-size: 0.8125rem;
|
|
593
|
+
font-variant-numeric: tabular-nums;
|
|
594
|
+
& > caption { font: 500 0.9375rem/1.3 var(--ui-font-display); }
|
|
595
|
+
& th {
|
|
596
|
+
padding: 7px 12px 7px 0;
|
|
597
|
+
border-bottom: 1px solid var(--ui-ink);
|
|
598
|
+
font-weight: 400;
|
|
599
|
+
font-size: 0.75rem;
|
|
600
|
+
color: var(--ui-muted);
|
|
601
|
+
text-align: start;
|
|
602
|
+
}
|
|
603
|
+
& td { padding: 7px 12px 7px 0; }
|
|
604
|
+
& :is(th, td):last-child { padding-inline-end: 0; }
|
|
605
|
+
}
|
|
606
|
+
[data-ui="datatable"] {
|
|
607
|
+
display: flex;
|
|
608
|
+
flex-direction: column;
|
|
609
|
+
gap: 10px;
|
|
610
|
+
& [data-part="search"] {
|
|
611
|
+
min-block-size: 34px;
|
|
612
|
+
border: 1px solid var(--ui-line-strong);
|
|
613
|
+
border-radius: var(--ui-radius);
|
|
614
|
+
background: var(--ui-surface);
|
|
615
|
+
color: var(--ui-ink);
|
|
616
|
+
padding: 0 10px;
|
|
617
|
+
font: 400 0.8125rem/1.35 var(--ui-font-body);
|
|
618
|
+
&:focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 22%, transparent); }
|
|
619
|
+
}
|
|
620
|
+
& [data-part="meta"] { font-size: 0.75rem; color: var(--ui-muted); font-variant-numeric: tabular-nums; }
|
|
621
|
+
& tr[data-selected="true"] { background: color-mix(in srgb, var(--ui-accent) 12%, transparent); }
|
|
622
|
+
& [data-part="sort"] {
|
|
623
|
+
background: transparent;
|
|
624
|
+
border: 0;
|
|
625
|
+
padding: 0;
|
|
626
|
+
font: inherit;
|
|
627
|
+
color: inherit;
|
|
628
|
+
cursor: pointer;
|
|
629
|
+
&[data-active="true"] { color: var(--ui-accent); }
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
/* bare.css keeps 44px targets and 16px fields on phones; the sizes above would undercut it */
|
|
634
|
+
@media (max-width: 600px) {
|
|
635
|
+
[data-ui="button"],
|
|
636
|
+
[data-ui="button"][data-size] {
|
|
637
|
+
min-inline-size: 44px;
|
|
638
|
+
}
|
|
639
|
+
[data-ui="button"],
|
|
640
|
+
[data-ui="button"][data-size],
|
|
641
|
+
[data-ui="field"] :is(input:not([type="checkbox"], [type="radio"]), select),
|
|
642
|
+
[data-ui="select"] [data-part="trigger"],
|
|
643
|
+
[data-ui="datatable"] [data-part="search"] {
|
|
644
|
+
min-block-size: 44px;
|
|
645
|
+
}
|
|
646
|
+
[data-ui="field"] :is(input:not([type="checkbox"], [type="radio"]), select, textarea),
|
|
647
|
+
[data-ui="datatable"] [data-part="search"],
|
|
648
|
+
dialog[data-ui="command"] [data-part="input"] {
|
|
649
|
+
font-size: max(1rem, 16px);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}
|