@prunellejs/ui 0.0.0-stage → 0.7.2

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 (84) hide show
  1. package/LICENSE +21 -0
  2. package/llms.txt +78 -0
  3. package/package.json +32 -4
  4. package/src/CommandPalette.tsx +262 -0
  5. package/src/DataTable.tsx +244 -0
  6. package/src/Dialog.tsx +181 -0
  7. package/src/Drawer.tsx +4 -0
  8. package/src/Menu.tsx +117 -0
  9. package/src/Select.tsx +125 -0
  10. package/src/Tabs.tsx +64 -0
  11. package/src/Toaster.tsx +105 -0
  12. package/src/behaviors.ts +385 -0
  13. package/src/field-context.ts +21 -0
  14. package/src/fold.ts +7 -0
  15. package/src/index.ts +72 -0
  16. package/src/labels/dialog.ts +3 -0
  17. package/src/labels/fr/dialog.ts +3 -0
  18. package/src/labels/fr/palette.ts +8 -0
  19. package/src/labels/fr/select.ts +1 -0
  20. package/src/labels/fr/table.ts +13 -0
  21. package/src/labels/fr/toaster.ts +1 -0
  22. package/src/labels/palette.ts +8 -0
  23. package/src/labels/select.ts +1 -0
  24. package/src/labels/table.ts +13 -0
  25. package/src/labels/toaster.ts +1 -0
  26. package/src/platform-fallback.ts +36 -0
  27. package/src/plugin.ts +188 -0
  28. package/src/primitives.tsx +238 -0
  29. package/src/static.tsx +324 -0
  30. package/src/styles/bare.css +25 -0
  31. package/src/styles/base.css +61 -0
  32. package/src/styles/components/accordion.css +10 -0
  33. package/src/styles/components/badge.css +6 -0
  34. package/src/styles/components/button.css +11 -0
  35. package/src/styles/components/card.css +5 -0
  36. package/src/styles/components/checkbox.css +11 -0
  37. package/src/styles/components/command.css +25 -0
  38. package/src/styles/components/consent.css +38 -0
  39. package/src/styles/components/datatable.css +9 -0
  40. package/src/styles/components/dialog.css +16 -0
  41. package/src/styles/components/drawer.css +29 -0
  42. package/src/styles/components/field.css +8 -0
  43. package/src/styles/components/layout.css +69 -0
  44. package/src/styles/components/menu.css +21 -0
  45. package/src/styles/components/notice.css +5 -0
  46. package/src/styles/components/popover.css +8 -0
  47. package/src/styles/components/progress.css +14 -0
  48. package/src/styles/components/radio-group.css +11 -0
  49. package/src/styles/components/select.css +25 -0
  50. package/src/styles/components/switch.css +42 -0
  51. package/src/styles/components/tabs.css +4 -0
  52. package/src/styles/components/toast.css +28 -0
  53. package/src/styles/grammars/console.css +179 -0
  54. package/src/styles/grammars/editorial.css +164 -0
  55. package/src/styles/grammars/orbit.css +269 -0
  56. package/src/styles/grammars/prunelle.css +504 -0
  57. package/src/styles/grammars/soft.css +160 -0
  58. package/src/styles/grammars/workshop.css +172 -0
  59. package/src/styles/scan.ts +144 -0
  60. package/src/styles/split.ts +429 -0
  61. package/src/styles/theme.css +22 -0
  62. package/src/styles/themed/accordion.css +20 -0
  63. package/src/styles/themed/badge.css +20 -0
  64. package/src/styles/themed/button.css +24 -0
  65. package/src/styles/themed/card.css +23 -0
  66. package/src/styles/themed/checkbox.css +4 -0
  67. package/src/styles/themed/command.css +33 -0
  68. package/src/styles/themed/consent.css +33 -0
  69. package/src/styles/themed/datatable.css +28 -0
  70. package/src/styles/themed/dialog.css +13 -0
  71. package/src/styles/themed/drawer.css +13 -0
  72. package/src/styles/themed/field.css +22 -0
  73. package/src/styles/themed/menu.css +21 -0
  74. package/src/styles/themed/notice.css +17 -0
  75. package/src/styles/themed/popover.css +11 -0
  76. package/src/styles/themed/radio-group.css +12 -0
  77. package/src/styles/themed/select.css +32 -0
  78. package/src/styles/themed/switch.css +23 -0
  79. package/src/styles/themed/tabs.css +20 -0
  80. package/src/styles/themed/toast.css +18 -0
  81. package/src/table-state.ts +163 -0
  82. package/src/tabs-state.ts +39 -0
  83. package/src/toast.ts +110 -0
  84. package/README.md +0 -3
@@ -0,0 +1,504 @@
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; }
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
+ /* @part: checkbox */
224
+ @media (forced-colors: active) {
225
+ :root [data-ui="checkbox"] input[type="checkbox"] {
226
+ border: 1.5px solid ButtonText;
227
+ background: Canvas;
228
+ &:checked { border-color: Highlight; background: Highlight; }
229
+ &:checked::after { border-color: HighlightText; }
230
+ &:disabled { border-color: GrayText; }
231
+ &:disabled:checked { border-color: GrayText; background: GrayText; }
232
+ }
233
+ }
234
+
235
+ /* 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. */
236
+ [data-ui="radio-group"] input[type="radio"],
237
+ [data-ui="switch"] [data-part="track"] {
238
+ --ui-lid: 0.2;
239
+ --ui-lid-ink: var(--ui-line-strong);
240
+ --ui-lid-r: calc(var(--ui-eye) * 0.372);
241
+ display: inline-grid;
242
+ place-items: center;
243
+ flex: none;
244
+ inline-size: var(--ui-eye);
245
+ block-size: var(--ui-eye);
246
+ 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;
247
+ transition: --ui-lid-ink 120ms;
248
+ &::before,
249
+ &::after {
250
+ content: '';
251
+ grid-area: 1 / 1;
252
+ opacity: 0;
253
+ transition: transform var(--ui-motion) ease, opacity 120ms;
254
+ }
255
+ &::before {
256
+ inline-size: 70%;
257
+ block-size: 70%;
258
+ border-radius: 100% 0;
259
+ background: var(--ui-iris);
260
+ box-shadow: inset 0 0 0 var(--ui-rim, 0) var(--ui-pupil);
261
+ transform: scaleY(var(--ui-lid)) rotate(45deg);
262
+ }
263
+ &::after {
264
+ inline-size: calc(var(--ui-eye) * 0.12);
265
+ block-size: calc(var(--ui-eye) * 0.34);
266
+ border-radius: 50%;
267
+ background: var(--ui-pupil);
268
+ transform: scaleY(var(--ui-lid));
269
+ }
270
+ }
271
+ :is([data-ui="radio-group"] input[type="radio"]:checked, [data-ui="switch"] input:checked + [data-part="track"]) {
272
+ --ui-lid: 1;
273
+ --ui-lid-ink: transparent;
274
+ &::before,
275
+ &::after { opacity: 1; }
276
+ }
277
+
278
+ [data-ui="radio-group"] {
279
+ --ui-radio-gap: 10px;
280
+ --ui-chk-fs: 0.875rem;
281
+ --ui-rg-lf: 500 0.8125rem/1.3 var(--ui-font-body);
282
+ --ui-rg-lfg: var(--ui-ink);
283
+ --ui-rg-lmb: 6px;
284
+ --ui-rg-hs: 0.75rem;
285
+ & input[type="radio"] {
286
+ --ui-eye: 24px;
287
+ --ui-lid-w: 2px;
288
+ appearance: none;
289
+ margin: 0;
290
+ border-radius: 4px;
291
+ cursor: pointer;
292
+ &:disabled { cursor: not-allowed; }
293
+ }
294
+ }
295
+ /* @part: radio-group */
296
+ @media (forced-colors: active) {
297
+ :root [data-ui="radio-group"] input[type="radio"] {
298
+ border: 1.5px solid ButtonText;
299
+ border-radius: 50%;
300
+ background: Canvas;
301
+ &::before { display: none; }
302
+ &::after { inline-size: 50%; block-size: 50%; background: HighlightText; }
303
+ &:checked { border-color: Highlight; background: Highlight; }
304
+ &:checked::after { opacity: 1; transform: none; }
305
+ &:disabled { border-color: GrayText; }
306
+ &:disabled:checked { border-color: GrayText; background: GrayText; }
307
+ }
308
+ }
309
+
310
+ /* Switch: the input is the visible track (and carries base.css's focus-visible ring), the track part its sliding eye knob. */
311
+ [data-ui="switch"] {
312
+ --ui-switch-gap: 10px;
313
+ --ui-chk-fs: 0.875rem;
314
+ --ui-switch-track-focus-w: 0px;
315
+ position: relative;
316
+ }
317
+ [data-ui="switch"] input[type="checkbox"] {
318
+ appearance: none;
319
+ position: static;
320
+ opacity: 1;
321
+ pointer-events: auto;
322
+ flex: none;
323
+ inline-size: 36px;
324
+ block-size: 20px;
325
+ margin: 0;
326
+ border-radius: 10px;
327
+ background: var(--ui-line-strong);
328
+ cursor: pointer;
329
+ transition: background-color var(--ui-motion);
330
+ &:checked { background: var(--ui-accent); }
331
+ &:disabled { cursor: not-allowed; }
332
+ }
333
+ [data-ui="switch"] [data-part="track"] {
334
+ --ui-eye: 16px;
335
+ --ui-lid-w: 1.5px;
336
+ --ui-rim: 1.5px;
337
+ --ui-pupil: #18111d;
338
+ position: absolute;
339
+ inset-block-start: 50%;
340
+ inset-inline-start: 2px;
341
+ translate: 0 -50%;
342
+ border: 0;
343
+ border-radius: 50%;
344
+ background-color: #fff;
345
+ pointer-events: none;
346
+ transition: inset-inline-start var(--ui-motion) ease, --ui-lid-ink 120ms;
347
+ &::before { inline-size: 58%; block-size: 58%; }
348
+ &::after {
349
+ position: static;
350
+ inset: auto;
351
+ aspect-ratio: auto;
352
+ inline-size: calc(var(--ui-eye) * 0.12);
353
+ block-size: calc(var(--ui-eye) * 0.34);
354
+ }
355
+ }
356
+ [data-ui="switch"] input:checked + [data-part="track"] {
357
+ inset-inline-start: 18px;
358
+ &::after { inset-inline-start: auto; transform: scaleY(var(--ui-lid)); }
359
+ }
360
+ /* @part: switch */
361
+ @media (forced-colors: active) {
362
+ :root [data-ui="switch"] input[type="checkbox"] {
363
+ border: 1.5px solid ButtonText;
364
+ background: Canvas;
365
+ &:checked { border-color: Highlight; background: Highlight; }
366
+ &:disabled { border-color: GrayText; }
367
+ &:disabled:checked { border-color: GrayText; background: GrayText; }
368
+ }
369
+ :root [data-ui="switch"] [data-part="track"] {
370
+ border: 1.5px solid ButtonText;
371
+ background: Canvas;
372
+ &::before { display: none; }
373
+ &::after { inline-size: 6px; block-size: 6px; border-radius: 50%; opacity: 1; transform: none; background: ButtonText; }
374
+ }
375
+ :root [data-ui="switch"] input:checked + [data-part="track"] {
376
+ border-color: HighlightText;
377
+ background: Highlight;
378
+ &::after { background: HighlightText; }
379
+ }
380
+ :root [data-ui="switch"] input:disabled + [data-part="track"] {
381
+ border-color: GrayText;
382
+ &::after { background: GrayText; }
383
+ }
384
+ :root [data-ui="switch"] input:disabled:checked + [data-part="track"] {
385
+ border-color: Canvas;
386
+ background: GrayText;
387
+ &::after { background: Canvas; }
388
+ }
389
+ }
390
+
391
+ /* Progress: the native bar stays for assistive tech and the eye shows it. */
392
+ [data-ui="progress"] {
393
+ --ui-eye: 22px;
394
+ position: relative;
395
+ gap: 10px;
396
+ font-size: 0.8125rem;
397
+ color: var(--ui-muted);
398
+ transition: --ui-progress 300ms ease;
399
+ }
400
+ [data-ui="progress"] progress {
401
+ position: absolute;
402
+ inline-size: 1px;
403
+ block-size: 1px;
404
+ margin: -1px;
405
+ overflow: hidden;
406
+ clip-path: inset(50%);
407
+ white-space: nowrap;
408
+ }
409
+ [data-ui="progress"] [data-part="eye"] {
410
+ display: grid;
411
+ place-items: center;
412
+ flex: none;
413
+ inline-size: calc(var(--ui-eye) * 0.7);
414
+ block-size: calc(var(--ui-eye) * 0.7);
415
+ margin: calc(var(--ui-eye) * 0.15);
416
+ overflow: hidden;
417
+ border-radius: 100% 0;
418
+ background: var(--ui-iris);
419
+ transform: scaleY(var(--ui-lid, 1)) rotate(45deg);
420
+ &::after {
421
+ content: '';
422
+ inline-size: calc(var(--ui-eye) * 0.12);
423
+ block-size: calc(var(--ui-eye) * 0.34);
424
+ border-radius: 50%;
425
+ background: var(--ui-pupil);
426
+ transform: rotate(-45deg) scale(calc(1 + var(--ui-progress) * 10), calc(1 + var(--ui-progress) * 0.8));
427
+ }
428
+ }
429
+ [data-ui="progress"][data-value] [data-part="eye"] { box-shadow: 0 0 0 calc(var(--ui-eye) * 0.05) var(--ui-iris); }
430
+ [data-ui="progress"]:not([data-value]) [data-part="eye"] {
431
+ animation: ui-eye-blink 3.2s ease-in-out infinite;
432
+ &::after { animation: ui-eye-look 3.2s ease-in-out infinite; }
433
+ }
434
+ [data-ui="progress"][data-value="0"] { --ui-progress: 0; }
435
+ [data-ui="progress"][data-value="5"] { --ui-progress: 0.05; }
436
+ [data-ui="progress"][data-value="10"] { --ui-progress: 0.1; }
437
+ [data-ui="progress"][data-value="15"] { --ui-progress: 0.15; }
438
+ [data-ui="progress"][data-value="20"] { --ui-progress: 0.2; }
439
+ [data-ui="progress"][data-value="25"] { --ui-progress: 0.25; }
440
+ [data-ui="progress"][data-value="30"] { --ui-progress: 0.3; }
441
+ [data-ui="progress"][data-value="35"] { --ui-progress: 0.35; }
442
+ [data-ui="progress"][data-value="40"] { --ui-progress: 0.4; }
443
+ [data-ui="progress"][data-value="45"] { --ui-progress: 0.45; }
444
+ [data-ui="progress"][data-value="50"] { --ui-progress: 0.5; }
445
+ [data-ui="progress"][data-value="55"] { --ui-progress: 0.55; }
446
+ [data-ui="progress"][data-value="60"] { --ui-progress: 0.6; }
447
+ [data-ui="progress"][data-value="65"] { --ui-progress: 0.65; }
448
+ [data-ui="progress"][data-value="70"] { --ui-progress: 0.7; }
449
+ [data-ui="progress"][data-value="75"] { --ui-progress: 0.75; }
450
+ [data-ui="progress"][data-value="80"] { --ui-progress: 0.8; }
451
+ [data-ui="progress"][data-value="85"] { --ui-progress: 0.85; }
452
+ [data-ui="progress"][data-value="90"] { --ui-progress: 0.9; }
453
+ [data-ui="progress"][data-value="95"] { --ui-progress: 0.95; }
454
+ [data-ui="progress"][data-value="100"] { --ui-progress: 1; }
455
+
456
+ /* @part: progress */
457
+ @keyframes ui-eye-blink {
458
+ 0%, 83%, 93%, 100% { transform: scaleY(1) rotate(45deg); }
459
+ 88% { transform: scaleY(0.08) rotate(45deg); }
460
+ }
461
+ /* @part: progress */
462
+ @keyframes ui-eye-look {
463
+ 0%, 100% { transform: rotate(-45deg) translateX(0) scale(1, 1); }
464
+ 10%, 74% { transform: rotate(-45deg) translateX(0) scale(1.9, 1); }
465
+ 22%, 34% { transform: rotate(-45deg) translateX(calc(var(--ui-eye) * -0.18)) scale(1.9, 1); }
466
+ 50%, 62% { transform: rotate(-45deg) translateX(calc(var(--ui-eye) * 0.18)) scale(1.9, 1); }
467
+ 82% { transform: rotate(-45deg) translateX(0) scale(1, 1); }
468
+ }
469
+
470
+ dialog[data-ui="command"] {
471
+ --ui-cmd-ibb: 1px solid var(--ui-line-strong);
472
+ --ui-cmd-ibg: var(--ui-paper);
473
+ --ui-cmd-ipad: 12px 14px;
474
+ --ui-cmd-if: 400 0.9375rem/1.35 var(--ui-font-body);
475
+ --ui-cmd-ifs: 0.9375rem;
476
+ --ui-cmd-lpad: 4px;
477
+ --ui-cmd-mpad: 0 10px;
478
+ --ui-cmd-mf: 400 0.8125rem/1.35 var(--ui-font-body);
479
+ --ui-cmd-hbg: var(--ui-surface-strong);
480
+ & [data-part="item"] { min-block-size: 32px; }
481
+ & [data-part="kbd"] { background: var(--ui-surface-strong); border: 0; font-family: var(--ui-font-mono); }
482
+ }
483
+
484
+ table[data-ui="table"],
485
+ [data-ui="datatable"] {
486
+ --ui-table-gap: 10px;
487
+ --ui-tbl-fs: 0.8125rem;
488
+ --ui-srch-h: 34px;
489
+ --ui-srch-pad: 0 10px;
490
+ --ui-srch-f: 400 0.8125rem/1.35 var(--ui-font-body);
491
+ --ui-srch-fs: 0.8125rem;
492
+ --ui-th-bb: 1px solid var(--ui-ink);
493
+ --ui-th-pad: 7px 12px 7px 0;
494
+ --ui-td-bb: 0;
495
+ --ui-td-pad: 7px 12px 7px 0;
496
+ --ui-tbl-sel: color-mix(in srgb, var(--ui-accent) 12%, transparent);
497
+ font-variant-numeric: tabular-nums;
498
+ & [data-part="search"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 22%, transparent); }
499
+ & table { border-block: 2px solid var(--ui-ink); }
500
+ & > caption { font: 500 0.9375rem/1.3 var(--ui-font-display); }
501
+ & th { font-weight: 400; color: var(--ui-muted); }
502
+ & :is(th, td):last-child { padding-inline-end: 0; }
503
+ }
504
+ }
@@ -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: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', 'Helvetica Neue', Arial, 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, [aria-disabled="true"]) { background: color-mix(in srgb, var(--ui-ink) 12%, var(--ui-surface-2)); }
33
+ &:active:not(:disabled, [aria-disabled="true"]) { transform: scale(0.98); }
34
+ &[data-tone="accent"]:hover:not(:disabled, [aria-disabled="true"]), &[data-tone="danger"]:hover:not(:disabled, [aria-disabled="true"]) { 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
+ --ui-tab-aind: inset 0 0 0 1.5px var(--ui-line-strong), 0 1px 4px rgb(0 0 0 / 0.08);
85
+ & [data-part="list"] { padding: 0.25rem; border-radius: var(--ui-pill); background: var(--ui-surface-2); }
86
+ & [data-part="trigger"] { border-radius: var(--ui-pill); }
87
+ }
88
+
89
+ dialog[data-ui="dialog"],
90
+ dialog[data-ui="drawer"],
91
+ dialog[data-ui="command"] {
92
+ --ui-dlg-bd: 0;
93
+ --ui-dlg-r: calc(var(--ui-radius) + 4px);
94
+ --ui-dlg-sh: 0 20px 50px rgb(0 0 0 / 0.2);
95
+ --ui-dlg-tf: 700 1.2rem/1.25 var(--ui-font-body);
96
+ }
97
+
98
+ [data-ui="popover"],
99
+ [data-ui="menu"],
100
+ [data-ui="select"] {
101
+ --ui-pop-bd: 0;
102
+ --ui-pop-sh: 0 10px 30px rgb(0 0 0 / 0.14);
103
+ --ui-it-r: 8px;
104
+ --ui-it-pad: 0.5rem 0.75rem;
105
+ --ui-it-hbg: var(--ui-surface-2);
106
+ }
107
+
108
+ [data-ui="select"] {
109
+ --ui-sel-bg: var(--ui-surface-2);
110
+ --ui-sel-bd: 1.5px solid var(--ui-line-strong);
111
+ --ui-sel-r: 10px;
112
+ --ui-sel-pad: 0.55rem 0.9rem;
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: 1.5px solid var(--ui-line-strong);
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: 1.5px solid var(--ui-line-strong);
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: 1.5px solid var(--ui-line-strong);
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
+ }