@prunellejs/ui 0.1.1 → 0.5.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.
Files changed (54) hide show
  1. package/llms.txt +9 -3
  2. package/package.json +2 -2
  3. package/src/CommandPalette.tsx +88 -38
  4. package/src/index.ts +1 -1
  5. package/src/plugin.ts +96 -32
  6. package/src/styles/bare.css +21 -312
  7. package/src/styles/base.css +55 -0
  8. package/src/styles/components/accordion.css +10 -0
  9. package/src/styles/components/badge.css +6 -0
  10. package/src/styles/components/button.css +11 -0
  11. package/src/styles/components/card.css +5 -0
  12. package/src/styles/components/checkbox.css +11 -0
  13. package/src/styles/components/command.css +25 -0
  14. package/src/styles/components/datatable.css +9 -0
  15. package/src/styles/components/dialog.css +16 -0
  16. package/src/styles/components/drawer.css +29 -0
  17. package/src/styles/components/field.css +8 -0
  18. package/src/styles/components/layout.css +69 -0
  19. package/src/styles/components/menu.css +21 -0
  20. package/src/styles/components/notice.css +5 -0
  21. package/src/styles/components/popover.css +8 -0
  22. package/src/styles/components/progress.css +14 -0
  23. package/src/styles/components/radio-group.css +11 -0
  24. package/src/styles/components/select.css +25 -0
  25. package/src/styles/components/switch.css +42 -0
  26. package/src/styles/components/tabs.css +4 -0
  27. package/src/styles/components/toast.css +28 -0
  28. package/src/styles/grammars/console.css +113 -256
  29. package/src/styles/grammars/editorial.css +99 -270
  30. package/src/styles/grammars/orbit.css +118 -388
  31. package/src/styles/grammars/prunelle.css +157 -360
  32. package/src/styles/grammars/soft.css +103 -237
  33. package/src/styles/grammars/workshop.css +104 -246
  34. package/src/styles/scan.ts +137 -0
  35. package/src/styles/split.ts +381 -0
  36. package/src/styles/theme.css +21 -0
  37. package/src/styles/themed/accordion.css +20 -0
  38. package/src/styles/themed/badge.css +20 -0
  39. package/src/styles/themed/button.css +21 -0
  40. package/src/styles/themed/card.css +23 -0
  41. package/src/styles/themed/checkbox.css +4 -0
  42. package/src/styles/themed/command.css +33 -0
  43. package/src/styles/themed/datatable.css +28 -0
  44. package/src/styles/themed/dialog.css +13 -0
  45. package/src/styles/themed/drawer.css +13 -0
  46. package/src/styles/themed/field.css +22 -0
  47. package/src/styles/themed/menu.css +21 -0
  48. package/src/styles/themed/notice.css +17 -0
  49. package/src/styles/themed/popover.css +11 -0
  50. package/src/styles/themed/radio-group.css +12 -0
  51. package/src/styles/themed/select.css +32 -0
  52. package/src/styles/themed/switch.css +18 -0
  53. package/src/styles/themed/tabs.css +17 -0
  54. package/src/styles/themed/toast.css +18 -0
@@ -1,315 +1,24 @@
1
1
  /* @prunellejs/ui bare floor: behavior, layout primitives, accessibility & top-layer positioning only.
2
2
  * Everything sits inside @layer kui so Tailwind utilities and user CSS always win without !important. */
3
3
 
4
- @layer kui {
5
- [data-ui] *,
6
- [data-ui] *::before,
7
- [data-ui] *::after {
8
- box-sizing: border-box;
9
- }
10
-
11
- .kui-sr-only {
12
- position: absolute;
13
- width: 1px;
14
- height: 1px;
15
- padding: 0;
16
- margin: -1px;
17
- overflow: hidden;
18
- clip: rect(0, 0, 0, 0);
19
- white-space: nowrap;
20
- border: 0;
21
- }
22
-
23
- [data-ui] :focus-visible,
24
- [data-ui]:focus-visible {
25
- outline: 2px solid var(--ui-accent, currentColor);
26
- outline-offset: 2px;
27
- }
28
-
29
- @media (prefers-reduced-motion: reduce) {
30
- :root {
31
- --ui-motion: 0.01ms;
32
- }
33
- [data-ui],
34
- [data-ui] *,
35
- [data-ui] *::before,
36
- [data-ui] *::after {
37
- animation-duration: 0.01ms !important;
38
- animation-iteration-count: 1 !important;
39
- transition-duration: 0.01ms !important;
40
- scroll-behavior: auto !important;
41
- }
42
- }
43
-
44
- /* Touch-friendly targets & iOS 16px input floor on small viewports */
45
- @media (max-width: 600px) {
46
- [data-ui="button"],
47
- [data-ui="field"] :is(input, select),
48
- [data-ui="select"] [data-part="trigger"],
49
- [data-ui="tabs"] [data-part="trigger"],
50
- [data-ui="accordion"] summary[data-part="trigger"],
51
- [data-ui="radio-group"] label,
52
- [data-ui="checkbox"],
53
- [data-ui="switch"] {
54
- min-block-size: 44px;
55
- }
56
- [data-ui="radio-group"] label {
57
- display: flex;
58
- align-items: center;
59
- }
60
- [data-ui="field"] :is(input, select, textarea),
61
- dialog[data-ui="command"] [data-part="input"],
62
- [data-ui="datatable"] [data-part="search"] {
63
- font-size: max(1rem, 16px);
64
- }
65
- }
66
-
67
- /* Every Layout primitives (0 KB JS) */
68
- [data-layout="stack"] {
69
- display: flex;
70
- flex-direction: column;
71
- gap: var(--ui-gap, 1rem);
72
- }
73
- [data-layout="cluster"] {
74
- display: flex;
75
- flex-wrap: wrap;
76
- align-items: center;
77
- gap: var(--ui-gap, 0.75rem);
78
- }
79
- [data-layout="grid"] {
80
- display: grid;
81
- grid-template-columns: repeat(auto-fit, minmax(min(var(--ui-min, 16rem), 100%), 1fr));
82
- gap: var(--ui-gap, 1rem);
83
- }
84
- [data-layout="sidebar"] {
85
- display: flex;
86
- flex-wrap: wrap;
87
- gap: var(--ui-gap, 1.5rem);
88
- }
89
- [data-layout="sidebar"] > :first-child {
90
- flex-basis: var(--ui-side, 16rem);
91
- flex-grow: 1;
92
- }
93
- [data-layout="sidebar"] > :last-child {
94
- flex-basis: 0;
95
- flex-grow: 999;
96
- min-inline-size: var(--ui-content-min, 60%);
97
- }
98
- [data-layout="split"] {
99
- display: flex;
100
- flex-wrap: wrap;
101
- align-items: center;
102
- justify-content: space-between;
103
- gap: var(--ui-gap, 1rem);
104
- }
105
-
106
- /* Layout scale tokens (0 KB JS, strict-CSP safe across all browsers) */
107
- [data-layout][data-gap="none"] { --ui-gap: 0; }
108
- [data-layout][data-gap="2xs"] { --ui-gap: var(--ui-space-2xs, 0.25rem); }
109
- [data-layout][data-gap="xs"] { --ui-gap: var(--ui-space-xs, 0.5rem); }
110
- [data-layout][data-gap="sm"] { --ui-gap: var(--ui-space-sm, 0.75rem); }
111
- [data-layout][data-gap="md"] { --ui-gap: var(--ui-space-md, 1rem); }
112
- [data-layout][data-gap="lg"] { --ui-gap: var(--ui-space-lg, 1.5rem); }
113
- [data-layout][data-gap="xl"] { --ui-gap: var(--ui-space-xl, 2rem); }
114
- [data-layout][data-gap="2xl"] { --ui-gap: var(--ui-space-2xl, 3rem); }
115
-
116
- [data-layout="grid"][data-min="xs"] { --ui-min: 10rem; }
117
- [data-layout="grid"][data-min="sm"] { --ui-min: 14rem; }
118
- [data-layout="grid"][data-min="md"] { --ui-min: 16rem; }
119
- [data-layout="grid"][data-min="lg"] { --ui-min: 20rem; }
120
- [data-layout="grid"][data-min="xl"] { --ui-min: 24rem; }
121
-
122
- [data-layout="sidebar"][data-side="xs"] { --ui-side: 10rem; }
123
- [data-layout="sidebar"][data-side="sm"] { --ui-side: 12rem; }
124
- [data-layout="sidebar"][data-side="md"] { --ui-side: 16rem; }
125
- [data-layout="sidebar"][data-side="lg"] { --ui-side: 20rem; }
126
- [data-layout="sidebar"][data-side="xl"] { --ui-side: 24rem; }
127
-
128
- /* Progressive CSS Values 5 attr() support for custom CSS lengths without inline style attributes */
129
- @supports (gap: attr(data-gap-value type(<length-percentage>))) {
130
- [data-layout][data-gap-value] { --ui-gap: attr(data-gap-value type(<length-percentage>)); }
131
- [data-layout="grid"][data-min-value] { --ui-min: attr(data-min-value type(<length-percentage>)); }
132
- [data-layout="sidebar"][data-side-value] { --ui-side: attr(data-side-value type(<length-percentage>)); }
133
- }
134
-
135
- /* Native top-layer & overlay positioning */
136
- dialog[data-ui="dialog"],
137
- dialog[data-ui="drawer"],
138
- dialog[data-ui="command"] {
139
- padding: 0;
140
- }
141
- dialog[data-ui="drawer"] > [data-part="panel"] {
142
- min-block-size: 100%;
143
- }
144
- /* The page behind a modal does not scroll */
145
- html:has(dialog[data-ui]:modal) {
146
- overflow: hidden;
147
- }
148
- dialog[data-ui="dialog"],
149
- dialog[data-ui="command"] {
150
- margin: auto;
151
- max-inline-size: min(32rem, calc(100vw - 2rem));
152
- max-block-size: calc(100dvh - 2rem);
153
- overflow: auto;
154
- }
155
- dialog[data-ui="command"] {
156
- inline-size: min(34rem, calc(100vw - 2rem));
157
- margin-block-start: min(14vh, 6rem);
158
- }
159
- dialog[data-ui="drawer"] {
160
- margin: 0;
161
- max-block-size: 100dvh;
162
- block-size: 100dvh;
163
- inline-size: min(26rem, 90vw);
164
- max-inline-size: 90vw;
165
- overflow: auto;
166
- &[data-side="right"] { margin-inline-start: auto; }
167
- &[data-side="left"] { margin-inline-end: auto; }
168
- &[data-side="bottom"] {
169
- margin-block-start: auto;
170
- inline-size: 100vw;
171
- max-inline-size: 100vw;
172
- block-size: auto;
173
- max-block-size: 80dvh;
174
- }
175
- }
176
- dialog[data-ui="dialog"]::backdrop,
177
- dialog[data-ui="drawer"]::backdrop,
178
- dialog[data-ui="command"]::backdrop {
179
- background: rgb(0 0 0 / 0.45);
180
- }
181
-
182
- /* Native Switch & Check controls */
183
- [data-ui="checkbox"],
184
- [data-ui="switch"] {
185
- display: inline-flex;
186
- align-items: center;
187
- gap: 0.55rem;
188
- cursor: pointer;
189
- user-select: none;
190
- &[data-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
191
- }
192
- [data-ui="switch"] input[type="checkbox"] {
193
- position: absolute;
194
- opacity: 0;
195
- inline-size: 1px;
196
- block-size: 1px;
197
- pointer-events: none;
198
- }
199
- [data-ui="switch"] [data-part="track"] {
200
- position: relative;
201
- display: inline-block;
202
- inline-size: 2.25rem;
203
- block-size: 1.25rem;
204
- flex-shrink: 0;
205
- &::after {
206
- content: '';
207
- position: absolute;
208
- inset-block: 2px;
209
- inset-inline-start: 2px;
210
- aspect-ratio: 1;
211
- transition: inset-inline-start 140ms ease, transform 140ms ease;
212
- }
213
- }
214
- [data-ui="switch"] input:checked + [data-part="track"]::after {
215
- inset-inline-start: calc(100% - 2px);
216
- transform: translateX(-100%);
217
- }
218
- [data-ui="switch"]:has(input:focus-visible) [data-part="track"],
219
- [data-ui="switch"] input:focus-visible + [data-part="track"] {
220
- outline: 2px solid var(--ui-accent, currentColor);
221
- outline-offset: 2px;
222
- }
223
- [data-ui="radio-group"] {
224
- border: 0;
225
- padding: 0;
226
- margin: 0;
227
- }
228
- [data-ui="radio-group"] [data-part="options"] {
229
- display: flex;
230
- flex-direction: column;
231
- gap: 0.45rem;
232
- }
233
- [data-ui="radio-group"] [data-part="option"] {
234
- display: inline-flex;
235
- align-items: center;
236
- gap: 0.5rem;
237
- cursor: pointer;
238
- }
239
-
240
- /* DataTable scroll & pagination */
241
- [data-ui="datatable"] [data-part="scroll"] {
242
- overflow-x: auto;
243
- }
244
- [data-ui="datatable"] [data-part="pagination"] [data-layout="cluster"] {
245
- --ui-gap: 0.4rem;
246
- }
247
- table[data-ui="table"] {
248
- width: 100%;
249
- border-collapse: collapse;
250
- text-align: left;
251
- }
252
- table[data-ui="table"] > caption {
253
- text-align: start;
254
- font-weight: 600;
255
- margin-block-end: 0.5rem;
256
- }
257
-
258
- /* Progress: the native bar; a grammar may draw the eye instead */
259
- [data-ui="progress"] {
260
- display: inline-flex;
261
- align-items: center;
262
- gap: 0.6rem;
263
- }
264
- [data-ui="progress"] [data-part="eye"] {
265
- display: none;
266
- }
267
- [data-ui="progress"] progress {
268
- accent-color: var(--ui-accent-fill, var(--ui-accent, currentColor));
269
- }
270
-
271
- [data-ui="popover"][popover] {
272
- inset: auto;
273
- margin: 0;
274
- position-area: block-end span-inline-end;
275
- position-try-fallbacks: flip-block, flip-inline;
276
- }
277
-
278
- [data-ui="menu"],
279
- [data-ui="select"] {
280
- display: inline-block;
281
- }
282
- [data-ui="menu"] [data-part="content"],
283
- [data-ui="select"] [data-part="listbox"] {
284
- inset: auto;
285
- margin: 4px 0;
286
- position-area: block-end span-inline-end;
287
- position-try-fallbacks: flip-block, flip-inline;
288
- min-inline-size: anchor-size(inline);
289
- }
290
-
291
- [data-ui="toaster"] {
292
- position: fixed;
293
- inset-block-end: 1rem;
294
- inset-inline-end: 1rem;
295
- z-index: 60;
296
- display: flex;
297
- flex-direction: column;
298
- gap: 0.5rem;
299
- max-inline-size: min(24rem, calc(100vw - 2rem));
300
- }
301
- [data-ui="toast"] [data-part="description"] {
302
- margin: 0.2rem 0 0;
303
- }
304
- [data-ui="toast"] [data-part="close"] {
305
- background: transparent;
306
- border: 0;
307
- color: inherit;
308
- cursor: pointer;
309
- padding: 0 0.25rem;
310
- }
311
-
312
- [hidden] {
313
- display: none !important;
314
- }
315
- }
4
+ @import './base.css';
5
+ @import './components/layout.css';
6
+ @import './components/button.css';
7
+ @import './components/card.css';
8
+ @import './components/badge.css';
9
+ @import './components/notice.css';
10
+ @import './components/field.css';
11
+ @import './components/checkbox.css';
12
+ @import './components/switch.css';
13
+ @import './components/radio-group.css';
14
+ @import './components/progress.css';
15
+ @import './components/accordion.css';
16
+ @import './components/tabs.css';
17
+ @import './components/dialog.css';
18
+ @import './components/drawer.css';
19
+ @import './components/command.css';
20
+ @import './components/popover.css';
21
+ @import './components/menu.css';
22
+ @import './components/select.css';
23
+ @import './components/toast.css';
24
+ @import './components/datatable.css';
@@ -0,0 +1,55 @@
1
+ /* @prunellejs/ui base floor: box-sizing, screen-reader utility, single focus indicator, reduced motion & [hidden].
2
+ * Everything sits inside @layer kui so Tailwind utilities and user CSS always win without !important. */
3
+
4
+ @layer kui {
5
+ [data-ui] *,
6
+ [data-ui] *::before,
7
+ [data-ui] *::after {
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ .kui-sr-only {
12
+ position: absolute;
13
+ width: 1px;
14
+ height: 1px;
15
+ padding: 0;
16
+ margin: -1px;
17
+ overflow: hidden;
18
+ clip: rect(0, 0, 0, 0);
19
+ white-space: nowrap;
20
+ border: 0;
21
+ }
22
+
23
+ [data-ui] :focus-visible,
24
+ [data-ui]:focus-visible {
25
+ outline: 2px solid var(--ui-focus-color, var(--ui-accent, currentColor));
26
+ outline-offset: 2px;
27
+ }
28
+
29
+ @media (prefers-reduced-motion: reduce) {
30
+ :root {
31
+ --ui-motion: 0.01ms;
32
+ }
33
+ [data-ui],
34
+ [data-ui] *,
35
+ [data-ui] *::before,
36
+ [data-ui] *::after {
37
+ animation-duration: 0.01ms !important;
38
+ animation-iteration-count: 1 !important;
39
+ transition-duration: 0.01ms !important;
40
+ scroll-behavior: auto !important;
41
+ }
42
+ }
43
+
44
+ /* Touch-friendly 44px targets & iOS 16px input floor on phones */
45
+ @media (max-width: 600px) {
46
+ :root {
47
+ --ui-touch-min: 44px;
48
+ --ui-input-floor: max(1rem, 16px);
49
+ }
50
+ }
51
+
52
+ [hidden] {
53
+ display: none !important;
54
+ }
55
+ }
@@ -0,0 +1,10 @@
1
+ @layer kui {
2
+ [data-ui="accordion"] summary[data-part="trigger"] {
3
+ list-style: none;
4
+ cursor: pointer;
5
+ display: flex;
6
+ align-items: center;
7
+ min-block-size: var(--ui-touch-min, auto);
8
+ &::-webkit-details-marker { display: none; }
9
+ }
10
+ }
@@ -0,0 +1,6 @@
1
+ @layer kui {
2
+ [data-ui="badge"] {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ }
6
+ }
@@ -0,0 +1,11 @@
1
+ @layer kui {
2
+ [data-ui="button"] {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ min-block-size: var(--ui-touch-min, auto);
7
+ text-decoration: none;
8
+ cursor: pointer;
9
+ &:disabled { cursor: not-allowed; }
10
+ }
11
+ }
@@ -0,0 +1,5 @@
1
+ @layer kui {
2
+ [data-ui="card"] {
3
+ display: block;
4
+ }
5
+ }
@@ -0,0 +1,11 @@
1
+ @layer kui {
2
+ [data-ui="checkbox"] {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ gap: var(--ui-check-gap, 0.55rem);
6
+ min-block-size: var(--ui-touch-min, auto);
7
+ cursor: pointer;
8
+ user-select: none;
9
+ &[data-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
10
+ }
11
+ }
@@ -0,0 +1,25 @@
1
+ @layer kui {
2
+ html:has(dialog[data-ui]:modal) { overflow: hidden; }
3
+ dialog[data-ui="command"] {
4
+ padding: 0;
5
+ margin: auto;
6
+ max-inline-size: min(32rem, calc(100vw - 2rem));
7
+ max-block-size: calc(100dvh - 2rem);
8
+ overflow: auto;
9
+ inline-size: min(34rem, calc(100vw - 2rem));
10
+ margin-block-start: min(14vh, 6rem);
11
+ }
12
+ dialog[data-ui="command"]::backdrop { background: rgb(0 0 0 / 0.45); }
13
+ dialog[data-ui="command"] [data-part="input"] {
14
+ width: 100%;
15
+ font-size: var(--ui-input-floor, inherit);
16
+ &:focus-visible { outline-offset: -2px; }
17
+ }
18
+ dialog[data-ui="command"] [data-part="item"] {
19
+ display: flex;
20
+ justify-content: space-between;
21
+ align-items: center;
22
+ width: 100%;
23
+ cursor: pointer;
24
+ }
25
+ }
@@ -0,0 +1,9 @@
1
+ @layer kui {
2
+ [data-ui="datatable"] { display: flex; flex-direction: column; gap: var(--ui-table-gap, 0.75rem); }
3
+ [data-ui="datatable"] [data-part="scroll"] { overflow-x: auto; }
4
+ [data-ui="datatable"] [data-part="search"] { min-block-size: var(--ui-touch-min, auto); font-size: var(--ui-input-floor, inherit); }
5
+ [data-ui="datatable"] [data-part="pagination"] [data-layout="cluster"] { --ui-gap: 0.4rem; }
6
+ table[data-ui="table"] { width: 100%; border-collapse: collapse; text-align: left; }
7
+ table[data-ui="table"] > caption { text-align: start; font-weight: 600; margin-block-end: 0.5rem; }
8
+ [data-ui="datatable"] [data-part="sort"] { background: transparent; border: 0; padding: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; }
9
+ }
@@ -0,0 +1,16 @@
1
+ @layer kui {
2
+ /* The page behind a modal does not scroll */
3
+ html:has(dialog[data-ui]:modal) {
4
+ overflow: hidden;
5
+ }
6
+ dialog[data-ui="dialog"] {
7
+ padding: 0;
8
+ margin: auto;
9
+ max-inline-size: min(32rem, calc(100vw - 2rem));
10
+ max-block-size: calc(100dvh - 2rem);
11
+ overflow: auto;
12
+ }
13
+ dialog[data-ui="dialog"]::backdrop {
14
+ background: rgb(0 0 0 / 0.45);
15
+ }
16
+ }
@@ -0,0 +1,29 @@
1
+ @layer kui {
2
+ html:has(dialog[data-ui]:modal) {
3
+ overflow: hidden;
4
+ }
5
+ dialog[data-ui="drawer"] {
6
+ padding: 0;
7
+ margin: 0;
8
+ max-block-size: 100dvh;
9
+ block-size: 100dvh;
10
+ inline-size: min(26rem, 90vw);
11
+ max-inline-size: 90vw;
12
+ overflow: auto;
13
+ &[data-side="right"] { margin-inline-start: auto; }
14
+ &[data-side="left"] { margin-inline-end: auto; }
15
+ &[data-side="bottom"] {
16
+ margin-block-start: auto;
17
+ inline-size: 100vw;
18
+ max-inline-size: 100vw;
19
+ block-size: auto;
20
+ max-block-size: 80dvh;
21
+ }
22
+ }
23
+ dialog[data-ui="drawer"] > [data-part="panel"] {
24
+ min-block-size: 100%;
25
+ }
26
+ dialog[data-ui="drawer"]::backdrop {
27
+ background: rgb(0 0 0 / 0.45);
28
+ }
29
+ }
@@ -0,0 +1,8 @@
1
+ @layer kui {
2
+ [data-ui="field"] {
3
+ display: flex;
4
+ flex-direction: column;
5
+ & :is(input:not([type="checkbox"], [type="radio"]), select) { min-block-size: var(--ui-touch-min, auto); }
6
+ & :is(input:not([type="checkbox"], [type="radio"]), select, textarea) { font-size: var(--ui-input-floor, inherit); }
7
+ }
8
+ }
@@ -0,0 +1,69 @@
1
+ @layer kui {
2
+ /* Every Layout primitives (0 KB JS) */
3
+ [data-layout="stack"] {
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: var(--ui-gap, 1rem);
7
+ }
8
+ [data-layout="cluster"] {
9
+ display: flex;
10
+ flex-wrap: wrap;
11
+ align-items: center;
12
+ gap: var(--ui-gap, 0.75rem);
13
+ }
14
+ [data-layout="grid"] {
15
+ display: grid;
16
+ grid-template-columns: repeat(auto-fit, minmax(min(var(--ui-min, 16rem), 100%), 1fr));
17
+ gap: var(--ui-gap, 1rem);
18
+ }
19
+ [data-layout="sidebar"] {
20
+ display: flex;
21
+ flex-wrap: wrap;
22
+ gap: var(--ui-gap, 1.5rem);
23
+ }
24
+ [data-layout="sidebar"] > :first-child {
25
+ flex-basis: var(--ui-side, 16rem);
26
+ flex-grow: 1;
27
+ }
28
+ [data-layout="sidebar"] > :last-child {
29
+ flex-basis: 0;
30
+ flex-grow: 999;
31
+ min-inline-size: var(--ui-content-min, 60%);
32
+ }
33
+ [data-layout="split"] {
34
+ display: flex;
35
+ flex-wrap: wrap;
36
+ align-items: center;
37
+ justify-content: space-between;
38
+ gap: var(--ui-gap, 1rem);
39
+ }
40
+
41
+ /* Layout scale tokens (0 KB JS, strict-CSP safe across all browsers) */
42
+ [data-layout][data-gap="none"] { --ui-gap: 0; }
43
+ [data-layout][data-gap="2xs"] { --ui-gap: var(--ui-space-2xs, 0.25rem); }
44
+ [data-layout][data-gap="xs"] { --ui-gap: var(--ui-space-xs, 0.5rem); }
45
+ [data-layout][data-gap="sm"] { --ui-gap: var(--ui-space-sm, 0.75rem); }
46
+ [data-layout][data-gap="md"] { --ui-gap: var(--ui-space-md, 1rem); }
47
+ [data-layout][data-gap="lg"] { --ui-gap: var(--ui-space-lg, 1.5rem); }
48
+ [data-layout][data-gap="xl"] { --ui-gap: var(--ui-space-xl, 2rem); }
49
+ [data-layout][data-gap="2xl"] { --ui-gap: var(--ui-space-2xl, 3rem); }
50
+
51
+ [data-layout="grid"][data-min="xs"] { --ui-min: 10rem; }
52
+ [data-layout="grid"][data-min="sm"] { --ui-min: 14rem; }
53
+ [data-layout="grid"][data-min="md"] { --ui-min: 16rem; }
54
+ [data-layout="grid"][data-min="lg"] { --ui-min: 20rem; }
55
+ [data-layout="grid"][data-min="xl"] { --ui-min: 24rem; }
56
+
57
+ [data-layout="sidebar"][data-side="xs"] { --ui-side: 10rem; }
58
+ [data-layout="sidebar"][data-side="sm"] { --ui-side: 12rem; }
59
+ [data-layout="sidebar"][data-side="md"] { --ui-side: 16rem; }
60
+ [data-layout="sidebar"][data-side="lg"] { --ui-side: 20rem; }
61
+ [data-layout="sidebar"][data-side="xl"] { --ui-side: 24rem; }
62
+
63
+ /* Progressive CSS Values 5 attr() support for custom CSS lengths without inline style attributes */
64
+ @supports (gap: attr(data-gap-value type(<length-percentage>))) {
65
+ [data-layout][data-gap-value] { --ui-gap: attr(data-gap-value type(<length-percentage>)); }
66
+ [data-layout="grid"][data-min-value] { --ui-min: attr(data-min-value type(<length-percentage>)); }
67
+ [data-layout="sidebar"][data-side-value] { --ui-side: attr(data-side-value type(<length-percentage>)); }
68
+ }
69
+ }
@@ -0,0 +1,21 @@
1
+ @layer kui {
2
+ [data-ui="menu"] {
3
+ display: inline-block;
4
+ }
5
+ [data-ui="menu"] [data-part="content"] {
6
+ inset: auto;
7
+ margin: 4px 0;
8
+ position-area: block-end span-inline-end;
9
+ position-try-fallbacks: flip-block, flip-inline;
10
+ min-inline-size: anchor-size(inline);
11
+ }
12
+ [data-ui="menu"] [data-part="item"] {
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: space-between;
16
+ width: 100%;
17
+ text-align: start;
18
+ cursor: pointer;
19
+ text-decoration: none;
20
+ }
21
+ }
@@ -0,0 +1,5 @@
1
+ @layer kui {
2
+ [data-ui="notice"] {
3
+ display: block;
4
+ }
5
+ }
@@ -0,0 +1,8 @@
1
+ @layer kui {
2
+ [data-ui="popover"][popover] {
3
+ inset: auto;
4
+ margin: 0;
5
+ position-area: block-end span-inline-end;
6
+ position-try-fallbacks: flip-block, flip-inline;
7
+ }
8
+ }
@@ -0,0 +1,14 @@
1
+ @layer kui {
2
+ /* Progress: the native bar; a grammar may draw the eye instead */
3
+ [data-ui="progress"] {
4
+ display: inline-flex;
5
+ align-items: center;
6
+ gap: 0.6rem;
7
+ }
8
+ [data-ui="progress"] [data-part="eye"] {
9
+ display: none;
10
+ }
11
+ [data-ui="progress"] progress {
12
+ accent-color: var(--ui-accent-fill, var(--ui-accent, currentColor));
13
+ }
14
+ }
@@ -0,0 +1,11 @@
1
+ @layer kui {
2
+ [data-ui="radio-group"] { border: 0; padding: 0; margin: 0; }
3
+ [data-ui="radio-group"] [data-part="options"] { display: flex; flex-direction: column; gap: 0.45rem; }
4
+ [data-ui="radio-group"] [data-part="option"] {
5
+ display: inline-flex;
6
+ align-items: center;
7
+ gap: var(--ui-radio-gap, 0.5rem);
8
+ min-block-size: var(--ui-touch-min, auto);
9
+ cursor: pointer;
10
+ }
11
+ }