@prunellejs/ui 0.0.0-stage → 0.6.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.
Files changed (70) hide show
  1. package/llms.txt +76 -0
  2. package/package.json +32 -4
  3. package/src/CommandPalette.tsx +260 -0
  4. package/src/DataTable.tsx +175 -0
  5. package/src/Dialog.tsx +181 -0
  6. package/src/Drawer.tsx +4 -0
  7. package/src/Menu.tsx +117 -0
  8. package/src/Select.tsx +124 -0
  9. package/src/Tabs.tsx +63 -0
  10. package/src/Toaster.tsx +141 -0
  11. package/src/behaviors.ts +389 -0
  12. package/src/field-context.ts +21 -0
  13. package/src/index.ts +72 -0
  14. package/src/platform-fallback.ts +36 -0
  15. package/src/plugin.ts +169 -0
  16. package/src/primitives.tsx +237 -0
  17. package/src/static.tsx +319 -0
  18. package/src/styles/bare.css +24 -0
  19. package/src/styles/base.css +55 -0
  20. package/src/styles/components/accordion.css +10 -0
  21. package/src/styles/components/badge.css +6 -0
  22. package/src/styles/components/button.css +11 -0
  23. package/src/styles/components/card.css +5 -0
  24. package/src/styles/components/checkbox.css +11 -0
  25. package/src/styles/components/command.css +25 -0
  26. package/src/styles/components/datatable.css +9 -0
  27. package/src/styles/components/dialog.css +16 -0
  28. package/src/styles/components/drawer.css +29 -0
  29. package/src/styles/components/field.css +8 -0
  30. package/src/styles/components/layout.css +69 -0
  31. package/src/styles/components/menu.css +21 -0
  32. package/src/styles/components/notice.css +5 -0
  33. package/src/styles/components/popover.css +8 -0
  34. package/src/styles/components/progress.css +14 -0
  35. package/src/styles/components/radio-group.css +11 -0
  36. package/src/styles/components/select.css +25 -0
  37. package/src/styles/components/switch.css +42 -0
  38. package/src/styles/components/tabs.css +4 -0
  39. package/src/styles/components/toast.css +28 -0
  40. package/src/styles/grammars/console.css +178 -0
  41. package/src/styles/grammars/editorial.css +163 -0
  42. package/src/styles/grammars/orbit.css +268 -0
  43. package/src/styles/grammars/prunelle.css +449 -0
  44. package/src/styles/grammars/soft.css +160 -0
  45. package/src/styles/grammars/workshop.css +171 -0
  46. package/src/styles/scan.ts +137 -0
  47. package/src/styles/split.ts +381 -0
  48. package/src/styles/theme.css +21 -0
  49. package/src/styles/themed/accordion.css +20 -0
  50. package/src/styles/themed/badge.css +20 -0
  51. package/src/styles/themed/button.css +21 -0
  52. package/src/styles/themed/card.css +23 -0
  53. package/src/styles/themed/checkbox.css +4 -0
  54. package/src/styles/themed/command.css +33 -0
  55. package/src/styles/themed/datatable.css +28 -0
  56. package/src/styles/themed/dialog.css +13 -0
  57. package/src/styles/themed/drawer.css +13 -0
  58. package/src/styles/themed/field.css +22 -0
  59. package/src/styles/themed/menu.css +21 -0
  60. package/src/styles/themed/notice.css +17 -0
  61. package/src/styles/themed/popover.css +11 -0
  62. package/src/styles/themed/radio-group.css +12 -0
  63. package/src/styles/themed/select.css +32 -0
  64. package/src/styles/themed/switch.css +18 -0
  65. package/src/styles/themed/tabs.css +17 -0
  66. package/src/styles/themed/toast.css +18 -0
  67. package/src/table-state.ts +126 -0
  68. package/src/tabs-state.ts +39 -0
  69. package/src/toast.ts +68 -0
  70. package/README.md +0 -3
@@ -0,0 +1,449 @@
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 '../theme.css';
7
+
8
+ /* @part: progress */
9
+ @property --ui-progress { syntax: '<number>'; inherits: true; initial-value: 0; }
10
+ /* @part: radio-group, switch */
11
+ @property --ui-lid-ink { syntax: '<color>'; inherits: true; initial-value: transparent; }
12
+
13
+ @layer kui {
14
+ :root {
15
+ color-scheme: light dark;
16
+ --ui-paper: light-dark(#f8f4ee, #130e16);
17
+ --ui-surface: light-dark(#fdfaf6, #1a1320);
18
+ --ui-surface-strong: light-dark(#efe8e1, #241b2d);
19
+ --ui-ink: light-dark(#18111d, #f8f4ee);
20
+ --ui-subtext: light-dark(#3d3045, #d6cbdf);
21
+ --ui-muted: light-dark(#5a4b63, #b5a6c2);
22
+ --ui-line: light-dark(#d9ced6, #2e2339);
23
+ --ui-line-strong: light-dark(#8e7c8c, #6e5c80);
24
+ --ui-accent: light-dark(#7a3667, #e5c068);
25
+ --ui-accent-hover: light-dark(#692857, #edd085);
26
+ --ui-accent-fill: light-dark(#18111d, #e5c068);
27
+ --ui-on-accent: light-dark(#f8f4ee, #130e16);
28
+ --ui-on-primary: light-dark(#e5c068, #130e16);
29
+ --ui-info: light-dark(#2b5c8a, #8fb8ea);
30
+ --ui-success: light-dark(#2c6b3a, #7cc79a);
31
+ --ui-warning: light-dark(#7d5c00, #f2a65a);
32
+ --ui-danger: light-dark(#b42318, #f58a8a);
33
+ --ui-iris: light-dark(#7a3667, #e5c068);
34
+ --ui-pupil: light-dark(#18111d, #130e16);
35
+ --ui-font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
36
+ --ui-font-body: 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Noto Sans', Cantarell, Ubuntu, Arial, sans-serif;
37
+ --ui-font-mono: ui-monospace, 'Cascadia Code', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
38
+ --ui-radius: 2px;
39
+ --ui-radius-inner: 2px;
40
+ --ui-motion: 180ms;
41
+ }
42
+
43
+ html { background-color: var(--ui-paper); }
44
+ body { background-color: var(--ui-paper); color: var(--ui-ink); font-family: var(--ui-font-body); }
45
+
46
+ [data-ui="button"] {
47
+ --ui-btn-gap: 0.45rem;
48
+ --ui-btn-h: 34px;
49
+ --ui-btn-pad: 0 14px;
50
+ --ui-btn-f: 500 0.8125rem/1 var(--ui-font-body);
51
+ --ui-btn-bd: 0;
52
+ --ui-btn-sm-h: 28px;
53
+ --ui-btn-sm-pad: 0 10px;
54
+ --ui-btn-sm-fs: 0.75rem;
55
+ --ui-btn-lg-h: 42px;
56
+ --ui-btn-lg-pad: 0 20px;
57
+ --ui-btn-lg-fs: 0.9375rem;
58
+ min-inline-size: var(--ui-touch-min, auto);
59
+ white-space: nowrap;
60
+ box-shadow: inset 0 0 0 1px var(--ui-line-strong);
61
+ &:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--ui-ink); }
62
+ &[data-variant="ghost"] {
63
+ padding-inline: 2px;
64
+ text-decoration: underline 1px var(--ui-accent);
65
+ text-underline-offset: 5px;
66
+ &:hover:not(:disabled) { box-shadow: none; text-decoration-thickness: 2px; }
67
+ }
68
+ &[data-tone="accent"] {
69
+ box-shadow: none;
70
+ color: var(--ui-on-primary);
71
+ &:hover:not(:disabled) { box-shadow: none; background: color-mix(in srgb, var(--ui-accent-fill) 86%, var(--ui-paper)); }
72
+ }
73
+ &[data-tone="danger"] {
74
+ background: transparent;
75
+ box-shadow: inset 0 0 0 1px var(--ui-danger);
76
+ color: var(--ui-danger);
77
+ &:hover:not(:disabled) { background: var(--ui-danger); box-shadow: none; color: var(--ui-on-accent); }
78
+ }
79
+ }
80
+
81
+ [data-ui="card"] {
82
+ --ui-card-pad: 1.1rem 1.25rem;
83
+ --ui-card-hf: 500 0.9375rem/1.3 var(--ui-font-display);
84
+ --ui-card-hpb: 6px;
85
+ --ui-card-hmb: 14px;
86
+ --ui-card-hbd: 1px solid var(--ui-ink);
87
+ --ui-card-fmt: 14px;
88
+ --ui-card-fpt: 10px;
89
+ --ui-card-fbd: 1px solid var(--ui-line);
90
+ & [data-part="footer"] { font-size: 0.75rem; }
91
+ }
92
+
93
+ /* A badge is a word in its tone after a dot, as in a book's margin. */
94
+ [data-ui="badge"] {
95
+ --ui-badge-f: 400 0.8125rem/1.3 var(--ui-font-body);
96
+ --ui-badge-pad: 0;
97
+ gap: 6px;
98
+ white-space: nowrap;
99
+ &::before { content: ''; inline-size: 6px; block-size: 6px; border-radius: 50%; background: currentColor; flex: none; }
100
+ }
101
+
102
+ /* A notice is a rule in its tone above the text, its bold words in the tone too. */
103
+ [data-ui="notice"] {
104
+ --ui-notice-bw: 2px 0 0 0;
105
+ --ui-notice-bg: transparent;
106
+ --ui-notice-pad: 10px 0 2px;
107
+ font: 400 0.875rem/1.55 var(--ui-font-body);
108
+ border-top-color: var(--ui-tone);
109
+ & :is(b, strong) { color: var(--ui-tone); font-weight: 600; }
110
+ }
111
+
112
+ [data-ui="field"] {
113
+ --ui-fld-gap: 4px;
114
+ --ui-fld-lf: 500 0.8125rem/1.3 var(--ui-font-body);
115
+ --ui-in-h: 34px;
116
+ --ui-in-pad: 0.4rem 10px;
117
+ --ui-in-f: 400 0.875rem/1.4 var(--ui-font-body);
118
+ --ui-in-fs: 0.875rem;
119
+ --ui-fld-ms: 0.75rem;
120
+ & :is(input:not([type="checkbox"], [type="radio"]), textarea, select):focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 22%, transparent); }
121
+ }
122
+
123
+ [data-ui="accordion"] {
124
+ --ui-acc-bb: 1px solid var(--ui-line);
125
+ --ui-acc-tpad: 11px 0;
126
+ --ui-acc-tf: 500 1rem/1.3 var(--ui-font-display);
127
+ --ui-acc-cpad: 0 0 12px;
128
+ & summary[data-part="trigger"]::after {
129
+ content: '';
130
+ inline-size: 7px;
131
+ block-size: 7px;
132
+ flex: none;
133
+ border: solid var(--ui-muted);
134
+ border-width: 0 1.5px 1.5px 0;
135
+ transform: translateY(-2px) rotate(45deg);
136
+ transition: transform var(--ui-motion);
137
+ }
138
+ & details[open] summary[data-part="trigger"]::after { transform: translateY(2px) rotate(-135deg); }
139
+ & [data-part="content"] { font-size: 0.875rem; line-height: 1.55; }
140
+ }
141
+
142
+ [data-ui="tabs"] {
143
+ --ui-tab-gap: 22px;
144
+ --ui-tab-lbb: 1px solid var(--ui-line-strong);
145
+ --ui-tab-pad: 8px 0;
146
+ --ui-tab-f: 400 0.8125rem/1.3 var(--ui-font-body);
147
+ --ui-tab-ppad: 14px 0 0;
148
+ & [data-part="trigger"] { margin-block-end: -1px; &[data-state="active"] { box-shadow: inset 0 -2px 0 var(--ui-accent); } }
149
+ }
150
+
151
+ dialog[data-ui="dialog"],
152
+ dialog[data-ui="drawer"],
153
+ dialog[data-ui="command"] {
154
+ --ui-dlg-bd: 1px solid var(--ui-ink);
155
+ --ui-dlg-bg: var(--ui-paper);
156
+ --ui-dlg-pad: 20px 22px;
157
+ --ui-dlg-tf: 500 1.375rem/1.2 var(--ui-font-display);
158
+ }
159
+ dialog[data-ui="drawer"] { border-block: 0; }
160
+
161
+ [data-ui="popover"],
162
+ [data-ui="menu"],
163
+ [data-ui="select"] {
164
+ --ui-pop-bg: var(--ui-paper);
165
+ --ui-pop-bd: 1px solid var(--ui-line-strong);
166
+ --ui-pop-pad: 4px;
167
+ --ui-pop-w: 11.5rem;
168
+ --ui-it-pad: 0 10px;
169
+ --ui-it-f: 400 0.8125rem/1.35 var(--ui-font-body);
170
+ --ui-it-hbg: var(--ui-surface-strong);
171
+ }
172
+ [data-ui="menu"] [data-part="item"],
173
+ [data-ui="select"] [data-part="option"] { min-block-size: 32px; }
174
+
175
+ [data-ui="select"] {
176
+ --ui-sel-h: 34px;
177
+ --ui-sel-pad: 0 10px;
178
+ --ui-sel-f: 400 0.8125rem/1.3 var(--ui-font-body);
179
+ & [data-part="trigger"]:hover { border-color: var(--ui-ink); }
180
+ }
181
+
182
+ /* A toast is the page inverted: ink ground, paper text, its tone a rule in the other theme's colour. */
183
+ [data-ui="toast"] {
184
+ --ui-toast-gap: 10px;
185
+ --ui-tst-bw: 0;
186
+ --ui-tst-bg: var(--ui-ink);
187
+ --ui-tst-fg: var(--ui-paper);
188
+ --ui-tst-pad: 10px 14px;
189
+ font: 400 0.8125rem/1.45 var(--ui-font-body);
190
+ &[data-tone] { box-shadow: inset 3px 0 0 var(--ui-tone); }
191
+ &[data-tone="accent"] { --ui-tone: light-dark(#e5c068, #7a3667); }
192
+ &[data-tone="success"] { --ui-tone: light-dark(#7cc79a, #2c6b3a); }
193
+ &[data-tone="warning"] { --ui-tone: light-dark(#f2a65a, #7d5c00); }
194
+ &[data-tone="danger"] { --ui-tone: light-dark(#f58a8a, #b42318); }
195
+ }
196
+
197
+ [data-ui="checkbox"] {
198
+ --ui-check-gap: 10px;
199
+ --ui-chk-fs: 0.875rem;
200
+ & input[type="checkbox"] {
201
+ appearance: none;
202
+ display: inline-grid;
203
+ place-items: center;
204
+ flex: none;
205
+ inline-size: 16px;
206
+ block-size: 16px;
207
+ margin: 0;
208
+ border-radius: var(--ui-radius);
209
+ background: var(--ui-surface);
210
+ box-shadow: inset 0 0 0 1.5px var(--ui-line-strong);
211
+ cursor: pointer;
212
+ &:checked { background: var(--ui-accent); box-shadow: none; }
213
+ &:checked::after {
214
+ content: '';
215
+ inline-size: 4px;
216
+ block-size: 8px;
217
+ border: solid var(--ui-on-accent);
218
+ border-width: 0 2px 2px 0;
219
+ transform: translateY(-1px) rotate(45deg);
220
+ }
221
+ }
222
+ }
223
+
224
+ /* 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. */
225
+ [data-ui="radio-group"] input[type="radio"],
226
+ [data-ui="switch"] [data-part="track"] {
227
+ --ui-lid: 0.2;
228
+ --ui-lid-ink: var(--ui-line-strong);
229
+ --ui-lid-r: calc(var(--ui-eye) * 0.372);
230
+ display: inline-grid;
231
+ place-items: center;
232
+ flex: none;
233
+ inline-size: var(--ui-eye);
234
+ block-size: var(--ui-eye);
235
+ 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;
236
+ transition: --ui-lid-ink 120ms;
237
+ &::before,
238
+ &::after {
239
+ content: '';
240
+ grid-area: 1 / 1;
241
+ opacity: 0;
242
+ transition: transform var(--ui-motion) ease, opacity 120ms;
243
+ }
244
+ &::before {
245
+ inline-size: 70%;
246
+ block-size: 70%;
247
+ border-radius: 100% 0;
248
+ background: var(--ui-iris);
249
+ box-shadow: inset 0 0 0 var(--ui-rim, 0) var(--ui-pupil);
250
+ transform: scaleY(var(--ui-lid)) rotate(45deg);
251
+ }
252
+ &::after {
253
+ inline-size: calc(var(--ui-eye) * 0.12);
254
+ block-size: calc(var(--ui-eye) * 0.34);
255
+ border-radius: 50%;
256
+ background: var(--ui-pupil);
257
+ transform: scaleY(var(--ui-lid));
258
+ }
259
+ }
260
+ :is([data-ui="radio-group"] input[type="radio"]:checked, [data-ui="switch"] input:checked + [data-part="track"]) {
261
+ --ui-lid: 1;
262
+ --ui-lid-ink: transparent;
263
+ &::before,
264
+ &::after { opacity: 1; }
265
+ }
266
+
267
+ [data-ui="radio-group"] {
268
+ --ui-radio-gap: 10px;
269
+ --ui-chk-fs: 0.875rem;
270
+ --ui-rg-lf: 500 0.8125rem/1.3 var(--ui-font-body);
271
+ --ui-rg-lfg: var(--ui-ink);
272
+ --ui-rg-lmb: 6px;
273
+ --ui-rg-hs: 0.75rem;
274
+ & input[type="radio"] {
275
+ --ui-eye: 24px;
276
+ --ui-lid-w: 2px;
277
+ appearance: none;
278
+ margin: 0;
279
+ border-radius: 4px;
280
+ cursor: pointer;
281
+ &:disabled { cursor: not-allowed; }
282
+ }
283
+ }
284
+
285
+ /* Switch: the input is the visible track (and carries base.css's focus-visible ring), the track part its sliding eye knob. */
286
+ [data-ui="switch"] {
287
+ --ui-switch-gap: 10px;
288
+ --ui-chk-fs: 0.875rem;
289
+ --ui-switch-track-focus-w: 0px;
290
+ position: relative;
291
+ }
292
+ [data-ui="switch"] input[type="checkbox"] {
293
+ appearance: none;
294
+ position: static;
295
+ opacity: 1;
296
+ pointer-events: auto;
297
+ flex: none;
298
+ inline-size: 36px;
299
+ block-size: 20px;
300
+ margin: 0;
301
+ border-radius: 10px;
302
+ background: var(--ui-line-strong);
303
+ cursor: pointer;
304
+ transition: background-color var(--ui-motion);
305
+ &:checked { background: var(--ui-accent); }
306
+ &:disabled { cursor: not-allowed; }
307
+ }
308
+ [data-ui="switch"] [data-part="track"] {
309
+ --ui-eye: 16px;
310
+ --ui-lid-w: 1.5px;
311
+ --ui-rim: 1.5px;
312
+ --ui-pupil: #18111d;
313
+ position: absolute;
314
+ inset-block-start: 50%;
315
+ inset-inline-start: 2px;
316
+ translate: 0 -50%;
317
+ border: 0;
318
+ border-radius: 50%;
319
+ background-color: #fff;
320
+ pointer-events: none;
321
+ transition: inset-inline-start var(--ui-motion) ease, --ui-lid-ink 120ms;
322
+ &::before { inline-size: 58%; block-size: 58%; }
323
+ &::after {
324
+ position: static;
325
+ inset: auto;
326
+ aspect-ratio: auto;
327
+ inline-size: calc(var(--ui-eye) * 0.12);
328
+ block-size: calc(var(--ui-eye) * 0.34);
329
+ }
330
+ }
331
+ [data-ui="switch"] input:checked + [data-part="track"] {
332
+ inset-inline-start: 18px;
333
+ &::after { inset-inline-start: auto; transform: scaleY(var(--ui-lid)); }
334
+ }
335
+
336
+ /* Progress: the native bar stays for assistive tech and the eye shows it. */
337
+ [data-ui="progress"] {
338
+ --ui-eye: 22px;
339
+ position: relative;
340
+ gap: 10px;
341
+ font-size: 0.8125rem;
342
+ color: var(--ui-muted);
343
+ transition: --ui-progress 300ms ease;
344
+ }
345
+ [data-ui="progress"] progress {
346
+ position: absolute;
347
+ inline-size: 1px;
348
+ block-size: 1px;
349
+ margin: -1px;
350
+ overflow: hidden;
351
+ clip-path: inset(50%);
352
+ white-space: nowrap;
353
+ }
354
+ [data-ui="progress"] [data-part="eye"] {
355
+ display: grid;
356
+ place-items: center;
357
+ flex: none;
358
+ inline-size: calc(var(--ui-eye) * 0.7);
359
+ block-size: calc(var(--ui-eye) * 0.7);
360
+ margin: calc(var(--ui-eye) * 0.15);
361
+ overflow: hidden;
362
+ border-radius: 100% 0;
363
+ background: var(--ui-iris);
364
+ transform: scaleY(var(--ui-lid, 1)) rotate(45deg);
365
+ &::after {
366
+ content: '';
367
+ inline-size: calc(var(--ui-eye) * 0.12);
368
+ block-size: calc(var(--ui-eye) * 0.34);
369
+ border-radius: 50%;
370
+ background: var(--ui-pupil);
371
+ transform: rotate(-45deg) scale(calc(1 + var(--ui-progress) * 10), calc(1 + var(--ui-progress) * 0.8));
372
+ }
373
+ }
374
+ [data-ui="progress"][data-value] [data-part="eye"] { box-shadow: 0 0 0 calc(var(--ui-eye) * 0.05) var(--ui-iris); }
375
+ [data-ui="progress"]:not([data-value]) [data-part="eye"] {
376
+ animation: ui-eye-blink 3.2s ease-in-out infinite;
377
+ &::after { animation: ui-eye-look 3.2s ease-in-out infinite; }
378
+ }
379
+ [data-ui="progress"][data-value="0"] { --ui-progress: 0; }
380
+ [data-ui="progress"][data-value="5"] { --ui-progress: 0.05; }
381
+ [data-ui="progress"][data-value="10"] { --ui-progress: 0.1; }
382
+ [data-ui="progress"][data-value="15"] { --ui-progress: 0.15; }
383
+ [data-ui="progress"][data-value="20"] { --ui-progress: 0.2; }
384
+ [data-ui="progress"][data-value="25"] { --ui-progress: 0.25; }
385
+ [data-ui="progress"][data-value="30"] { --ui-progress: 0.3; }
386
+ [data-ui="progress"][data-value="35"] { --ui-progress: 0.35; }
387
+ [data-ui="progress"][data-value="40"] { --ui-progress: 0.4; }
388
+ [data-ui="progress"][data-value="45"] { --ui-progress: 0.45; }
389
+ [data-ui="progress"][data-value="50"] { --ui-progress: 0.5; }
390
+ [data-ui="progress"][data-value="55"] { --ui-progress: 0.55; }
391
+ [data-ui="progress"][data-value="60"] { --ui-progress: 0.6; }
392
+ [data-ui="progress"][data-value="65"] { --ui-progress: 0.65; }
393
+ [data-ui="progress"][data-value="70"] { --ui-progress: 0.7; }
394
+ [data-ui="progress"][data-value="75"] { --ui-progress: 0.75; }
395
+ [data-ui="progress"][data-value="80"] { --ui-progress: 0.8; }
396
+ [data-ui="progress"][data-value="85"] { --ui-progress: 0.85; }
397
+ [data-ui="progress"][data-value="90"] { --ui-progress: 0.9; }
398
+ [data-ui="progress"][data-value="95"] { --ui-progress: 0.95; }
399
+ [data-ui="progress"][data-value="100"] { --ui-progress: 1; }
400
+
401
+ /* @part: progress */
402
+ @keyframes ui-eye-blink {
403
+ 0%, 83%, 93%, 100% { transform: scaleY(1) rotate(45deg); }
404
+ 88% { transform: scaleY(0.08) rotate(45deg); }
405
+ }
406
+ /* @part: progress */
407
+ @keyframes ui-eye-look {
408
+ 0%, 100% { transform: rotate(-45deg) translateX(0) scale(1, 1); }
409
+ 10%, 74% { transform: rotate(-45deg) translateX(0) scale(1.9, 1); }
410
+ 22%, 34% { transform: rotate(-45deg) translateX(calc(var(--ui-eye) * -0.18)) scale(1.9, 1); }
411
+ 50%, 62% { transform: rotate(-45deg) translateX(calc(var(--ui-eye) * 0.18)) scale(1.9, 1); }
412
+ 82% { transform: rotate(-45deg) translateX(0) scale(1, 1); }
413
+ }
414
+
415
+ dialog[data-ui="command"] {
416
+ --ui-cmd-ibb: 1px solid var(--ui-line-strong);
417
+ --ui-cmd-ibg: var(--ui-paper);
418
+ --ui-cmd-ipad: 12px 14px;
419
+ --ui-cmd-if: 400 0.9375rem/1.35 var(--ui-font-body);
420
+ --ui-cmd-ifs: 0.9375rem;
421
+ --ui-cmd-lpad: 4px;
422
+ --ui-cmd-mpad: 0 10px;
423
+ --ui-cmd-mf: 400 0.8125rem/1.35 var(--ui-font-body);
424
+ --ui-cmd-hbg: var(--ui-surface-strong);
425
+ & [data-part="item"] { min-block-size: 32px; }
426
+ & [data-part="kbd"] { background: var(--ui-surface-strong); border: 0; font-family: var(--ui-font-mono); }
427
+ }
428
+
429
+ table[data-ui="table"],
430
+ [data-ui="datatable"] {
431
+ --ui-table-gap: 10px;
432
+ --ui-tbl-fs: 0.8125rem;
433
+ --ui-srch-h: 34px;
434
+ --ui-srch-pad: 0 10px;
435
+ --ui-srch-f: 400 0.8125rem/1.35 var(--ui-font-body);
436
+ --ui-srch-fs: 0.8125rem;
437
+ --ui-th-bb: 1px solid var(--ui-ink);
438
+ --ui-th-pad: 7px 12px 7px 0;
439
+ --ui-td-bb: 0;
440
+ --ui-td-pad: 7px 12px 7px 0;
441
+ --ui-tbl-sel: color-mix(in srgb, var(--ui-accent) 12%, transparent);
442
+ font-variant-numeric: tabular-nums;
443
+ & [data-part="search"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 22%, transparent); }
444
+ & table { border-block: 2px solid var(--ui-ink); }
445
+ & > caption { font: 500 0.9375rem/1.3 var(--ui-font-display); }
446
+ & th { font-weight: 400; color: var(--ui-muted); }
447
+ & :is(th, td):last-child { padding-inline-end: 0; }
448
+ }
449
+ }
@@ -0,0 +1,160 @@
1
+ /* Grammar: Soft — borderless tinted surface elevation, generous radii, gentle transitions.
2
+ * Eject via `prunelle ui-eject soft`. */
3
+
4
+ @import '../theme.css';
5
+
6
+ @layer kui {
7
+ :root {
8
+ color-scheme: light dark;
9
+ --ui-paper: light-dark(#f8f9fb, #101216);
10
+ --ui-surface: light-dark(#ffffff, #191c22);
11
+ --ui-surface-2: light-dark(#eef1f6, #232831);
12
+ --ui-ink: light-dark(#181c24, #eef1f6);
13
+ --ui-muted: light-dark(#5d6573, #949dad);
14
+ --ui-line-strong: light-dark(#7c8494, #6d7585);
15
+ --ui-accent: light-dark(#4f46e5, #919bfa);
16
+ --ui-on-accent: light-dark(#ffffff, #101216);
17
+ --ui-success: light-dark(#116630, #4ade80);
18
+ --ui-warning: light-dark(#8f420a, #fbbf24);
19
+ --ui-danger: light-dark(#b91c1c, #f87171);
20
+ --ui-font-body: ui-sans-serif, system-ui, -apple-system, sans-serif;
21
+ --ui-radius: 12px;
22
+ --ui-pill: 999px;
23
+ --ui-motion: 180ms;
24
+ }
25
+
26
+ [data-ui="button"] {
27
+ --ui-btn-f: 600 0.9rem/1 var(--ui-font-body);
28
+ --ui-btn-pad: 0.65rem 1.2rem;
29
+ --ui-btn-r: var(--ui-pill);
30
+ --ui-btn-bd: 0;
31
+ --ui-btn-bg: var(--ui-surface-2);
32
+ &:hover:not(:disabled) { background: color-mix(in srgb, var(--ui-ink) 12%, var(--ui-surface-2)); }
33
+ &:active:not(:disabled) { transform: scale(0.98); }
34
+ &[data-tone="accent"]:hover:not(:disabled), &[data-tone="danger"]:hover:not(:disabled) { filter: brightness(1.06); }
35
+ &[data-variant="outline"] { box-shadow: inset 0 0 0 1.5px var(--ui-line-strong); }
36
+ }
37
+
38
+ [data-ui="card"] {
39
+ --ui-card-bd: 0;
40
+ --ui-card-pad: 1.35rem;
41
+ --ui-card-hf: 700 1.08rem/1.3 var(--ui-font-body);
42
+ box-shadow: 0 2px 12px rgb(0 0 0 / 0.06);
43
+ }
44
+
45
+ [data-ui="badge"] {
46
+ --ui-badge-f: 600 0.76rem/1 var(--ui-font-body);
47
+ --ui-badge-pad: 0.3rem 0.7rem;
48
+ --ui-badge-r: var(--ui-pill);
49
+ --ui-badge-bg: var(--ui-surface-2);
50
+ --ui-badge-fg: var(--ui-ink);
51
+ --ui-badge-tbg: 16%;
52
+ }
53
+
54
+ [data-ui="notice"] {
55
+ --ui-notice-bg: var(--ui-surface-2);
56
+ --ui-notice-pad: 0.9rem 1.1rem;
57
+ &[data-tone] { background: color-mix(in srgb, var(--ui-tone) 12%, var(--ui-surface)); }
58
+ }
59
+
60
+ [data-ui="field"] {
61
+ --ui-fld-lf: 600 0.86rem/1.2 var(--ui-font-body);
62
+ --ui-in-bg: var(--ui-surface-2);
63
+ --ui-in-bd: 1.5px solid var(--ui-line-strong);
64
+ --ui-in-r: 10px;
65
+ --ui-in-pad: 0.6rem 0.9rem;
66
+ & :is(input:not([type="checkbox"], [type="radio"]), textarea, select):focus { background: var(--ui-surface); }
67
+ }
68
+
69
+ [data-ui="accordion"] {
70
+ --ui-acc-r: var(--ui-radius);
71
+ --ui-acc-bg: var(--ui-surface);
72
+ --ui-acc-ipad: 0 1rem;
73
+ --ui-acc-gap: 0.5rem;
74
+ --ui-acc-tpad: 0.9rem 0;
75
+ --ui-acc-m: '+';
76
+ --ui-acc-mo: '−';
77
+ }
78
+
79
+ [data-ui="tabs"] {
80
+ --ui-tab-disp: inline-flex;
81
+ --ui-tab-pad: 0.45rem 1rem;
82
+ --ui-tab-f: 600 0.86rem/1 var(--ui-font-body);
83
+ --ui-tab-abg: var(--ui-surface);
84
+ & [data-part="list"] { padding: 0.25rem; border-radius: var(--ui-pill); background: var(--ui-surface-2); }
85
+ & [data-part="trigger"] { border-radius: var(--ui-pill); &[data-state="active"] { box-shadow: 0 1px 4px rgb(0 0 0 / 0.08); } }
86
+ }
87
+
88
+ dialog[data-ui="dialog"],
89
+ dialog[data-ui="drawer"],
90
+ dialog[data-ui="command"] {
91
+ --ui-dlg-bd: 0;
92
+ --ui-dlg-r: calc(var(--ui-radius) + 4px);
93
+ --ui-dlg-sh: 0 20px 50px rgb(0 0 0 / 0.2);
94
+ --ui-dlg-tf: 700 1.2rem/1.25 var(--ui-font-body);
95
+ }
96
+
97
+ [data-ui="popover"],
98
+ [data-ui="menu"],
99
+ [data-ui="select"] {
100
+ --ui-pop-bd: 0;
101
+ --ui-pop-sh: 0 10px 30px rgb(0 0 0 / 0.14);
102
+ --ui-it-r: 8px;
103
+ --ui-it-pad: 0.5rem 0.75rem;
104
+ --ui-it-hbg: var(--ui-surface-2);
105
+ }
106
+
107
+ [data-ui="select"] {
108
+ --ui-sel-bg: var(--ui-surface-2);
109
+ --ui-sel-bd: 0;
110
+ --ui-sel-r: 10px;
111
+ --ui-sel-pad: 0.55rem 0.9rem;
112
+ & [data-part="option"][data-selected="true"] { font-weight: 600; }
113
+ }
114
+
115
+ [data-ui="toast"] {
116
+ --ui-tst-bw: 0;
117
+ --ui-tst-sh: 0 10px 28px rgb(0 0 0 / 0.16);
118
+ --ui-tst-pad: 0.85rem 1.05rem;
119
+ }
120
+
121
+ [data-ui="switch"] {
122
+ --ui-sw-bd: 0;
123
+ --ui-sw-r: var(--ui-pill);
124
+ --ui-sw-bg: var(--ui-surface-2);
125
+ --ui-sw-th: var(--ui-surface);
126
+ --ui-sw-thr: var(--ui-pill);
127
+ --ui-sw-thsh: 0 1px 3px rgb(0 0 0 / 0.2);
128
+ --ui-sw-onth: var(--ui-surface);
129
+ }
130
+
131
+ [data-ui="radio-group"] {
132
+ --ui-rg-lf: 600 0.88rem/1.2 var(--ui-font-body);
133
+ --ui-rg-lfg: var(--ui-ink);
134
+ }
135
+
136
+ dialog[data-ui="command"] {
137
+ --ui-cmd-ibb: 0;
138
+ --ui-cmd-ibg: var(--ui-surface-2);
139
+ --ui-cmd-ipad: 0.9rem 1.1rem;
140
+ --ui-cmd-hbg: var(--ui-surface-2);
141
+ & [data-part="item"] { border-radius: 10px; }
142
+ & [data-part="kbd"] { background: var(--ui-surface-2); border: 0; border-radius: 6px; }
143
+ }
144
+
145
+ [data-ui="datatable"] {
146
+ --ui-table-gap: 0.85rem;
147
+ --ui-srch-bd: 0;
148
+ --ui-srch-r: var(--ui-pill);
149
+ --ui-srch-bg: var(--ui-surface-2);
150
+ --ui-srch-pad: 0.5rem 0.95rem;
151
+ --ui-th-bb: 0;
152
+ --ui-th-pad: 0.7rem 0.75rem;
153
+ --ui-td-bb: 0;
154
+ --ui-td-pad: 0.7rem 0.75rem;
155
+ --ui-tbl-sel: color-mix(in srgb, var(--ui-accent) 10%, transparent);
156
+ & [data-part="scroll"] { background: var(--ui-surface); border-radius: var(--ui-radius); box-shadow: 0 2px 12px rgb(0 0 0 / 0.06); padding: 0.25rem 0.5rem; }
157
+ & th { color: var(--ui-muted); }
158
+ & td { border-top: 1px solid color-mix(in srgb, var(--ui-ink) 6%, transparent); }
159
+ }
160
+ }