uniskin 1.2.0 → 1.3.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.
@@ -165,13 +165,139 @@ const fieldStates = {
165
165
  "box-shadow": "0 0 0 3px color-mix(in oklab, var(--ui-c) 25%, transparent)",
166
166
  },
167
167
  };
168
+ /* ---- file input ---- */
169
+ /* The native input owns activation, keyboard operation and filename text;
170
+ only the standard selector-button pseudo-element is skinned. */
171
+ const fileBase = {
172
+ ...fieldBase,
173
+ /* fieldBase points --ui-c at the focus ring for text inputs; the selector
174
+ button is a filled control, so the no-intent file input starts neutral. */
175
+ ...neutralVars,
176
+ "min-height": "var(--ui-file-min-h, 2.625rem)",
177
+ cursor: "pointer",
178
+ "&::file-selector-button": {
179
+ "font-family": "inherit",
180
+ /* slightly smaller than the filename: keeps the native filename readable
181
+ when a large control is only one mobile column wide */
182
+ "font-size": "0.875em",
183
+ "font-weight": "500",
184
+ "line-height": "1.25",
185
+ color: "var(--ui-file-button-fg, var(--ui-on-c))",
186
+ "background-color": "var(--ui-file-button-bg, var(--ui-c))",
187
+ border: "1px solid var(--ui-file-button-border, color-mix(in oklab, var(--ui-c-text) 50%, var(--ui-surface-fg)))",
188
+ "border-radius": "var(--ui-file-button-radius, calc(var(--ui-radius) * 0.75))",
189
+ padding: "var(--ui-file-button-pad-y, 0.375rem) var(--ui-file-button-pad-x, 0.75rem)",
190
+ "margin-inline-end": "var(--ui-file-gap, 0.75rem)",
191
+ cursor: "pointer",
192
+ transition: transition(["background-color", "border-color", "color", "box-shadow"]),
193
+ /* nested here as well as on the control: the pseudo-rule's own override
194
+ must come after its transition in the emitted cascade */
195
+ "@media (prefers-reduced-motion: reduce)": { transition: "none" },
196
+ },
197
+ "&::file-selector-button:hover": {
198
+ "background-color": "var(--ui-file-button-hover-bg, var(--ui-c-hover, color-mix(in oklab, var(--ui-c) 88%, var(--ui-surface-fg))))",
199
+ },
200
+ "@media (prefers-reduced-motion: reduce)": {
201
+ transition: "none",
202
+ "&::file-selector-button": { transition: "none" },
203
+ },
204
+ };
205
+ const fileStates = {
206
+ disabled: {
207
+ ...fieldStates.disabled,
208
+ "&::file-selector-button": { cursor: "not-allowed" },
209
+ },
210
+ /* A file input always contains filename text, so the loading cue cannot be
211
+ the field pulse: even black text at 55% opacity only has a narrow margin
212
+ over a light surface. The fill breathes between two opaque tints instead,
213
+ leaving the native filename at full opacity and its background solid. */
214
+ loading: {
215
+ cursor: "progress",
216
+ animation: "ui-file-loading 1.2s ease-in-out infinite",
217
+ },
218
+ active: fieldStates.active,
219
+ };
220
+ const fileSizes = {
221
+ sm: {
222
+ "font-size": "var(--ui-text-sm)",
223
+ padding: "0.375rem 0.625rem",
224
+ "--ui-file-min-h": "2.25rem",
225
+ "--ui-file-button-pad-x": "0.625rem",
226
+ "--ui-file-button-pad-y": "0.25rem",
227
+ },
228
+ lg: {
229
+ "font-size": "var(--ui-text-lg)",
230
+ padding: "0.75rem 1rem",
231
+ "--ui-file-min-h": "3.25rem",
232
+ "--ui-file-button-pad-x": "1rem",
233
+ "--ui-file-button-pad-y": "0.5rem",
234
+ },
235
+ };
168
236
  const chevron = "linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%)";
237
+ /* ---- joined input groups ---- */
238
+ const inputGroupPart = ":is(.ui-input, .ui-select, .ui-input-addon, .ui-button)";
239
+ const inputGroupControl = ":is(.ui-input, .ui-select)";
240
+ const inputGroupBorder = "color-mix(in oklab, var(--ui-border) 55%, var(--ui-surface-fg))";
241
+ const inputGroupRadius = "var(--ui-input-group-radius, var(--ui-radius))";
242
+ /* The group's size class is the single source for the control, the static
243
+ addon and any joined action button. Selects keep extra physical-right
244
+ padding for the chevron; the group also preserves logical inline-end room
245
+ so a suffix cannot crowd the indicator in either writing direction. */
246
+ const inputGroupSizes = {
247
+ sm: {
248
+ "--ui-input-group-fs": "var(--ui-text-sm)",
249
+ "--ui-input-addon-px": "0.625rem",
250
+ [`& > ${inputGroupControl}`]: {
251
+ "font-size": "var(--ui-input-group-fs)",
252
+ padding: "0.375rem 0.625rem",
253
+ },
254
+ "& > .ui-select": {
255
+ "padding-right": "2rem",
256
+ "padding-inline-end": "2rem",
257
+ },
258
+ "& > .ui-button": {
259
+ "font-size": "var(--ui-input-group-fs)",
260
+ padding: "0.375rem 0.75rem",
261
+ },
262
+ },
263
+ lg: {
264
+ "--ui-input-group-fs": "var(--ui-text-lg)",
265
+ "--ui-input-addon-px": "1rem",
266
+ [`& > ${inputGroupControl}`]: {
267
+ "font-size": "var(--ui-input-group-fs)",
268
+ padding: "0.75rem 1rem",
269
+ },
270
+ "& > .ui-select": {
271
+ "padding-right": "2.5rem",
272
+ "padding-inline-end": "2.5rem",
273
+ },
274
+ "& > .ui-button": {
275
+ "font-size": "var(--ui-input-group-fs)",
276
+ padding: "0.75rem 1.5rem",
277
+ },
278
+ },
279
+ };
169
280
  /* ---- shared status states (badge / alert) ---- */
170
281
  const statusStates = {
171
282
  disabled: { opacity: "0.5", cursor: "not-allowed" },
172
283
  loading: { animation: "ui-pulse 1.2s ease-in-out infinite" },
173
284
  active: { "box-shadow": "0 0 0 3px color-mix(in oklab, var(--ui-c) 30%, transparent)" },
174
285
  };
286
+ /* Shared current/active navbar-link treatment: accent text, stronger weight
287
+ and a short inset line, so the state never depends on colour alone. */
288
+ const navbarLinkCurrent = {
289
+ color: "var(--ui-navbar-link-active-color, var(--ui-c-soft-fg, var(--ui-surface-fg)))",
290
+ "font-weight": "600",
291
+ "&::after": {
292
+ content: '""',
293
+ position: "absolute",
294
+ "inset-inline": "var(--ui-navbar-link-px)",
295
+ "inset-block-end": "0.1875rem",
296
+ height: "2px",
297
+ "border-radius": "9999px",
298
+ "background-color": "var(--ui-navbar-link-active-line, var(--ui-c-soft-fg, var(--ui-surface-fg)))",
299
+ },
300
+ };
175
301
  /**
176
302
  * Built-in default skin. Every Uniskin class has a complete style here;
177
303
  * adapters deep-merge over this object, so anything they omit falls back
@@ -346,6 +472,108 @@ export const defaultAdapter = defineAdapter({
346
472
  },
347
473
  },
348
474
  },
475
+ "button-group": {
476
+ base: {
477
+ display: "inline-flex",
478
+ "align-items": "stretch",
479
+ "vertical-align": "middle",
480
+ "border-radius": "var(--ui-button-group-radius, var(--ui-radius))",
481
+ "box-shadow": "var(--ui-button-group-shadow, none)",
482
+ isolation: "isolate",
483
+ "& > .ui-button": {
484
+ position: "relative",
485
+ "z-index": "0",
486
+ "flex": "0 1 auto",
487
+ "min-width": "0",
488
+ "border-radius": "0",
489
+ },
490
+ "&:not([data-orientation=\"vertical\"]) > .ui-button:first-child": {
491
+ "border-start-start-radius": "var(--ui-button-group-radius, var(--ui-radius))",
492
+ "border-end-start-radius": "var(--ui-button-group-radius, var(--ui-radius))",
493
+ },
494
+ "&:not([data-orientation=\"vertical\"]) > .ui-button:last-child": {
495
+ "border-start-end-radius": "var(--ui-button-group-radius, var(--ui-radius))",
496
+ "border-end-end-radius": "var(--ui-button-group-radius, var(--ui-radius))",
497
+ },
498
+ "& > .ui-button:only-child": {
499
+ "border-radius": "var(--ui-button-group-radius, var(--ui-radius))",
500
+ },
501
+ "&:not([data-orientation=\"vertical\"]) > .ui-button + .ui-button": {
502
+ "margin-inline-start": "-1px",
503
+ "border-inline-start-color": "var(--ui-button-group-separator, color-mix(in oklab, currentColor 42%, transparent))",
504
+ },
505
+ "& > .ui-button:hover, & > .ui-button:active, & > .ui-button.ui-active, & > .ui-button[aria-pressed=\"true\"], & > .ui-button[aria-selected=\"true\"], & > .ui-button:disabled, & > .ui-button.ui-disabled, & > .ui-button[aria-disabled=\"true\"]": {
506
+ "z-index": "1",
507
+ },
508
+ "& > .ui-button:focus-visible": { "z-index": "2" },
509
+ '&[data-orientation="vertical"]': {
510
+ "flex-direction": "column",
511
+ "& > .ui-button:first-child": {
512
+ "border-start-start-radius": "var(--ui-button-group-radius, var(--ui-radius))",
513
+ "border-start-end-radius": "var(--ui-button-group-radius, var(--ui-radius))",
514
+ },
515
+ "& > .ui-button:last-child": {
516
+ "border-end-start-radius": "var(--ui-button-group-radius, var(--ui-radius))",
517
+ "border-end-end-radius": "var(--ui-button-group-radius, var(--ui-radius))",
518
+ },
519
+ "& > .ui-button + .ui-button": {
520
+ "margin-top": "-1px",
521
+ "border-top-color": "var(--ui-button-group-separator, color-mix(in oklab, currentColor 42%, transparent))",
522
+ },
523
+ },
524
+ },
525
+ },
526
+ /* ui-link: inline navigation, not a button substitute. The medium size
527
+ deliberately inherits the surrounding text; ui-sm/ui-lg opt out. The
528
+ resting underline is the affordance, so hover strengthens rather than
529
+ removes it, and current/active state pairs colour with weight and a
530
+ thicker underline. */
531
+ link: {
532
+ base: {
533
+ ...neutralVars,
534
+ display: "inline",
535
+ "border-radius": "calc(var(--ui-radius) * 0.35)",
536
+ color: "var(--ui-link-color, var(--ui-c-text))",
537
+ "text-decoration-line": "underline",
538
+ "text-decoration-color": "var(--ui-link-underline-color, currentColor)",
539
+ "text-decoration-thickness": "var(--ui-link-underline-thickness, 0.0625em)",
540
+ "text-underline-offset": "var(--ui-link-underline-offset, 0.15em)",
541
+ transition: transition(["color", "text-decoration-color", "text-decoration-thickness"]),
542
+ "&:hover": {
543
+ color: "var(--ui-link-hover-color, color-mix(in oklab, var(--ui-link-color, var(--ui-c-text)) 82%, var(--ui-c)))",
544
+ "text-decoration-thickness": "calc(var(--ui-link-underline-thickness, 0.0625em) + 0.03125em)",
545
+ },
546
+ "&:focus-visible": focusRing,
547
+ "&[aria-current]": {
548
+ "font-weight": "650",
549
+ "text-decoration-thickness": "calc(var(--ui-link-underline-thickness, 0.0625em) + 0.03125em)",
550
+ },
551
+ "@media (prefers-reduced-motion: reduce)": { transition: "none" },
552
+ },
553
+ intents,
554
+ sizes: {
555
+ sm: { "font-size": "0.875em" },
556
+ lg: { "font-size": "1.125em" },
557
+ },
558
+ states: {
559
+ disabled: {
560
+ opacity: "0.55",
561
+ cursor: "not-allowed",
562
+ "pointer-events": "none",
563
+ },
564
+ active: {
565
+ "font-weight": "650",
566
+ "text-decoration-thickness": "calc(var(--ui-link-underline-thickness, 0.0625em) + 0.03125em)",
567
+ },
568
+ },
569
+ },
570
+ file: {
571
+ base: fileBase,
572
+ intents: fieldIntents,
573
+ styles: fieldStyles,
574
+ sizes: fileSizes,
575
+ states: fileStates,
576
+ },
349
577
  input: {
350
578
  base: { ...fieldBase },
351
579
  intents: fieldIntents,
@@ -386,6 +614,85 @@ export const defaultAdapter = defineAdapter({
386
614
  },
387
615
  states: fieldStates,
388
616
  },
617
+ /* ui-input-group joins exactly one text control with static addons or an
618
+ action button. DOM order is the visual order (flipped by RTL), so the
619
+ first and last participant keep the logical outer radii and every later
620
+ participant overlaps its neighbour's border by 1px. */
621
+ "input-group": {
622
+ base: {
623
+ display: "flex",
624
+ width: "100%",
625
+ "min-width": "0",
626
+ "box-sizing": "border-box",
627
+ "flex-wrap": "nowrap",
628
+ "align-items": "stretch",
629
+ "border-radius": inputGroupRadius,
630
+ isolation: "isolate",
631
+ [`& > ${inputGroupPart}`]: {
632
+ position: "relative",
633
+ "z-index": "0",
634
+ flex: "0 0 auto",
635
+ "border-radius": "0",
636
+ },
637
+ [`& > ${inputGroupControl}`]: {
638
+ flex: "1 1 auto",
639
+ width: "auto",
640
+ "min-width": "0",
641
+ },
642
+ [`& > ${inputGroupPart}:not(:first-child)`]: {
643
+ "margin-inline-start": "-1px",
644
+ },
645
+ [`& > ${inputGroupPart}:first-child`]: {
646
+ "border-start-start-radius": inputGroupRadius,
647
+ "border-end-start-radius": inputGroupRadius,
648
+ },
649
+ [`& > ${inputGroupPart}:last-child`]: {
650
+ "border-start-end-radius": inputGroupRadius,
651
+ "border-end-end-radius": inputGroupRadius,
652
+ },
653
+ /* Ghost and soft controls intentionally have transparent outer borders,
654
+ but a borderless internal join would lose the addon boundary when the
655
+ control follows it. The outer edges stay transparent; only the seam is
656
+ restored. */
657
+ [`& > ${inputGroupControl}:is(.ui-soft, .ui-ghost):not(:first-child)`]: {
658
+ "border-inline-start-color": `var(--ui-input-addon-border, ${inputGroupBorder})`,
659
+ },
660
+ [`& > ${inputGroupControl}:hover, & > ${inputGroupControl}[aria-invalid="true"]:not([aria-invalid="false"]), & > ${inputGroupControl}.ui-active, & > ${inputGroupControl}[aria-selected="true"], & > ${inputGroupControl}[aria-pressed="true"], & > .ui-button:hover, & > .ui-button.ui-active, & > .ui-button[aria-pressed="true"], & > .ui-button[aria-selected="true"]`]: {
661
+ "z-index": "1",
662
+ },
663
+ [`& > ${inputGroupControl}[aria-invalid="true"]:not([aria-invalid="false"])`]: {
664
+ "border-inline-start-color": "var(--ui-danger-text, var(--ui-danger))",
665
+ },
666
+ [`& > ${inputGroupControl}:focus-visible, & > .ui-button:focus-visible`]: {
667
+ "z-index": "2",
668
+ "border-inline-start-color": "var(--ui-field-c, var(--ui-c))",
669
+ },
670
+ /* Progressive enhancement: where :has() is available the static addon
671
+ echoes the control's invalid boundary. Without it the control itself
672
+ still carries the truthful danger styling. */
673
+ '&:has(> .ui-input[aria-invalid="true"]:not([aria-invalid="false"])) > .ui-input-addon, &:has(> .ui-select[aria-invalid="true"]:not([aria-invalid="false"])) > .ui-input-addon': {
674
+ "border-color": "var(--ui-danger-text, var(--ui-danger))",
675
+ },
676
+ },
677
+ sizes: inputGroupSizes,
678
+ },
679
+ "input-addon": {
680
+ base: {
681
+ display: "inline-flex",
682
+ "align-items": "center",
683
+ "justify-content": "center",
684
+ "box-sizing": "border-box",
685
+ "font-family": "var(--ui-font-sans)",
686
+ "font-size": "var(--ui-input-group-fs, var(--ui-text-md))",
687
+ "line-height": "1.25",
688
+ padding: "0 var(--ui-input-addon-px, 0.75rem)",
689
+ color: "var(--ui-input-addon-fg, color-mix(in oklab, var(--ui-surface-fg) 75%, var(--ui-surface)))",
690
+ "background-color": "var(--ui-input-addon-bg, var(--ui-surface-muted))",
691
+ border: `1px solid var(--ui-input-addon-border, ${inputGroupBorder})`,
692
+ "border-radius": inputGroupRadius,
693
+ "white-space": "nowrap",
694
+ },
695
+ },
389
696
  checkbox: {
390
697
  base: {
391
698
  ...neutralVars,
@@ -1534,6 +1841,481 @@ export const defaultAdapter = defineAdapter({
1534
1841
  "align-self": "stretch",
1535
1842
  },
1536
1843
  },
1844
+ /* ui-list / ui-list-item: static rows or native link/button rows. It is
1845
+ not a menu or listbox: no roving tabindex or selection behaviour. */
1846
+ list: {
1847
+ base: {
1848
+ "--ui-list-bg": "var(--ui-surface)",
1849
+ "--ui-list-border": "var(--ui-border)",
1850
+ "--ui-list-separator": "var(--ui-border)",
1851
+ "--ui-list-radius": "var(--ui-radius)",
1852
+ "--ui-list-item-py": "0.625rem",
1853
+ "--ui-list-item-px": "0.75rem",
1854
+ "--ui-list-item-fs": "0.9375rem",
1855
+ display: "flex",
1856
+ "flex-direction": "column",
1857
+ "box-sizing": "border-box",
1858
+ width: "100%",
1859
+ margin: "0",
1860
+ padding: "0",
1861
+ "list-style": "none",
1862
+ "font-family": "var(--ui-font-sans)",
1863
+ "font-size": "var(--ui-list-item-fs)",
1864
+ color: "var(--ui-surface-fg)",
1865
+ "background-color": "var(--ui-list-bg)",
1866
+ border: "1px solid var(--ui-list-border)",
1867
+ "border-radius": "var(--ui-list-radius)",
1868
+ /* rows keep their own overflow so focus rings are never clipped */
1869
+ "& > li": { margin: "0", "min-width": "0" },
1870
+ "& > li + li": { "border-block-start": "1px solid var(--ui-list-separator)" },
1871
+ "& > li:first-child > .ui-list-item, & > li.ui-list-item:first-child": {
1872
+ "border-start-start-radius": "calc(var(--ui-list-radius) - 1px)",
1873
+ "border-start-end-radius": "calc(var(--ui-list-radius) - 1px)",
1874
+ },
1875
+ "& > li:last-child > .ui-list-item, & > li.ui-list-item:last-child": {
1876
+ "border-end-start-radius": "calc(var(--ui-list-radius) - 1px)",
1877
+ "border-end-end-radius": "calc(var(--ui-list-radius) - 1px)",
1878
+ },
1879
+ },
1880
+ styles: {
1881
+ ghost: { "background-color": "transparent", "border-color": "transparent" },
1882
+ soft: { "--ui-list-bg": "var(--ui-surface-muted)" },
1883
+ },
1884
+ sizes: {
1885
+ sm: { "--ui-list-item-fs": "0.8125rem", "--ui-list-item-py": "0.375rem", "--ui-list-item-px": "0.625rem" },
1886
+ lg: { "--ui-list-item-fs": "1.0625rem", "--ui-list-item-py": "0.75rem", "--ui-list-item-px": "1rem" },
1887
+ },
1888
+ },
1889
+ "list-item": {
1890
+ base: {
1891
+ ...neutralVars,
1892
+ appearance: "none",
1893
+ display: "flex",
1894
+ "align-items": "center",
1895
+ gap: "0.5rem",
1896
+ "box-sizing": "border-box",
1897
+ width: "100%",
1898
+ "min-width": "0",
1899
+ margin: "0",
1900
+ padding: "var(--ui-list-item-py) var(--ui-list-item-px)",
1901
+ "font-family": "inherit",
1902
+ "font-size": "var(--ui-list-item-fs)",
1903
+ "line-height": "1.35",
1904
+ "text-align": "start",
1905
+ "text-decoration": "none",
1906
+ color: "var(--ui-c-text)",
1907
+ "background-color": "transparent",
1908
+ border: "0",
1909
+ transition: transition(["background-color", "color", "box-shadow"]),
1910
+ "&:is(a, button)": { cursor: "pointer" },
1911
+ "&:is(a, button):hover, &:is(a, button):focus-visible": {
1912
+ "background-color": "var(--ui-list-item-hover-bg, color-mix(in oklab, var(--ui-c-text) 8%, var(--ui-list-bg, var(--ui-surface))))",
1913
+ color: "var(--ui-list-item-hover-fg, color-mix(in oklab, var(--ui-c-text) 75%, var(--ui-surface-fg)))",
1914
+ },
1915
+ "&:is(a, button):focus-visible": { outline: "2px solid var(--ui-ring)", "outline-offset": "2px" },
1916
+ /* aria-current always receives the active treatment; weight plus the
1917
+ inset logical marker mean current does not depend on colour alone */
1918
+ "&[aria-current]": {
1919
+ "border-inline-start": "3px solid var(--ui-list-item-active-fg, var(--ui-c-text))",
1920
+ "padding-inline-start": "calc(var(--ui-list-item-px) - 3px)",
1921
+ "background-color": "var(--ui-list-item-active-bg, color-mix(in oklab, var(--ui-c-text) 13%, var(--ui-list-bg, var(--ui-surface))))",
1922
+ color: "var(--ui-list-item-active-fg, color-mix(in oklab, var(--ui-c-text) 70%, var(--ui-surface-fg)))",
1923
+ "font-weight": "600",
1924
+ },
1925
+ "@media (prefers-reduced-motion: reduce)": { transition: "none" },
1926
+ },
1927
+ intents: intentMap((intent) => intent === "secondary"
1928
+ ? { "--ui-c-text": "var(--ui-secondary-text, color-mix(in oklab, var(--ui-secondary) 80%, var(--ui-surface-fg)))" }
1929
+ : {}),
1930
+ states: {
1931
+ disabled: { opacity: "0.5", cursor: "not-allowed", "pointer-events": "none" },
1932
+ active: {
1933
+ "border-inline-start": "3px solid var(--ui-list-item-active-fg, var(--ui-c-text))",
1934
+ "padding-inline-start": "calc(var(--ui-list-item-px) - 3px)",
1935
+ "background-color": "var(--ui-list-item-active-bg, color-mix(in oklab, var(--ui-c-text) 13%, var(--ui-list-bg, var(--ui-surface))))",
1936
+ color: "var(--ui-list-item-active-fg, color-mix(in oklab, var(--ui-c-text) 70%, var(--ui-surface-fg)))",
1937
+ "font-weight": "600",
1938
+ },
1939
+ },
1940
+ },
1941
+ /* ui-stat: one compact numeric fact. It is typography/content
1942
+ structure only — no card chrome, trend colour or live-region behaviour. */
1943
+ stat: {
1944
+ base: {
1945
+ "--ui-stat-gap": "0.375rem",
1946
+ "--ui-stat-label-color": "color-mix(in oklab, var(--ui-surface-fg) 72%, var(--ui-surface))",
1947
+ "--ui-stat-value-color": "var(--ui-surface-fg)",
1948
+ "--ui-stat-value-size": "1.875rem",
1949
+ "--ui-stat-hint-color": "color-mix(in oklab, var(--ui-surface-fg) 72%, var(--ui-surface))",
1950
+ display: "flex",
1951
+ "flex-direction": "column",
1952
+ gap: "var(--ui-stat-gap)",
1953
+ "box-sizing": "border-box",
1954
+ "min-width": "0",
1955
+ "font-family": "var(--ui-font-sans)",
1956
+ color: "var(--ui-surface-fg)",
1957
+ "text-align": "start",
1958
+ },
1959
+ sizes: {
1960
+ sm: { "--ui-stat-gap": "0.25rem", "--ui-stat-value-size": "1.5rem" },
1961
+ lg: { "--ui-stat-gap": "0.5rem", "--ui-stat-value-size": "2.25rem" },
1962
+ },
1963
+ },
1964
+ "stat-label": {
1965
+ base: {
1966
+ display: "block",
1967
+ margin: "0",
1968
+ "font-size": "var(--ui-text-sm)",
1969
+ "font-weight": "500",
1970
+ "line-height": "1.3",
1971
+ color: "var(--ui-stat-label-color)",
1972
+ },
1973
+ },
1974
+ "stat-value": {
1975
+ base: {
1976
+ display: "block",
1977
+ margin: "0",
1978
+ "font-size": "var(--ui-stat-value-size)",
1979
+ "font-weight": "600",
1980
+ "line-height": "1.2",
1981
+ color: "var(--ui-stat-value-color)",
1982
+ "font-variant-numeric": "lining-nums tabular-nums",
1983
+ "overflow-wrap": "anywhere",
1984
+ },
1985
+ },
1986
+ "stat-hint": {
1987
+ base: {
1988
+ display: "block",
1989
+ margin: "0",
1990
+ "font-size": "var(--ui-text-sm)",
1991
+ "line-height": "1.4",
1992
+ color: "var(--ui-stat-hint-color)",
1993
+ },
1994
+ },
1995
+ /* ui-empty: centred explanatory content plus optional native actions.
1996
+ It is neutral content layout, not a card and not an alert. */
1997
+ empty: {
1998
+ base: {
1999
+ "--ui-empty-pad": "3rem 1rem",
2000
+ "--ui-empty-gap": "0.75rem",
2001
+ "--ui-empty-max-w": "28rem",
2002
+ "--ui-empty-title-size": "1.25rem",
2003
+ "--ui-empty-description-color": "color-mix(in oklab, var(--ui-surface-fg) 72%, var(--ui-surface))",
2004
+ display: "flex",
2005
+ "flex-direction": "column",
2006
+ "align-items": "center",
2007
+ "justify-content": "center",
2008
+ gap: "var(--ui-empty-gap)",
2009
+ "box-sizing": "border-box",
2010
+ width: "100%",
2011
+ "max-width": "var(--ui-empty-max-w)",
2012
+ "margin-inline": "auto",
2013
+ padding: "var(--ui-empty-pad)",
2014
+ "font-family": "var(--ui-font-sans)",
2015
+ color: "var(--ui-surface-fg)",
2016
+ "text-align": "center",
2017
+ },
2018
+ sizes: {
2019
+ sm: { "--ui-empty-pad": "1.5rem 1rem", "--ui-empty-gap": "0.5rem", "--ui-empty-title-size": "1.125rem" },
2020
+ lg: { "--ui-empty-pad": "4rem 1.5rem", "--ui-empty-gap": "1rem", "--ui-empty-title-size": "1.5rem" },
2021
+ },
2022
+ },
2023
+ "empty-title": {
2024
+ base: {
2025
+ display: "block",
2026
+ margin: "0",
2027
+ "font-size": "var(--ui-empty-title-size)",
2028
+ "font-weight": "600",
2029
+ "line-height": "1.3",
2030
+ color: "var(--ui-surface-fg)",
2031
+ "overflow-wrap": "anywhere",
2032
+ },
2033
+ },
2034
+ "empty-description": {
2035
+ base: {
2036
+ display: "block",
2037
+ margin: "0",
2038
+ "max-width": "34rem",
2039
+ "font-size": "var(--ui-text-sm)",
2040
+ "line-height": "1.5",
2041
+ color: "var(--ui-empty-description-color)",
2042
+ "overflow-wrap": "anywhere",
2043
+ },
2044
+ },
2045
+ "empty-actions": {
2046
+ base: {
2047
+ display: "flex",
2048
+ "flex-wrap": "wrap",
2049
+ "align-items": "center",
2050
+ "justify-content": "center",
2051
+ gap: "0.5rem",
2052
+ "margin-top": "0.25rem",
2053
+ },
2054
+ },
2055
+ /* ui-steps: an ordered progress indicator. CSS counters generate the
2056
+ numeric markers; completed steps replace the number with a check mark
2057
+ whose generated alternative text is empty. */
2058
+ steps: {
2059
+ base: {
2060
+ ...neutralVars,
2061
+ "--ui-steps-gap": "1rem",
2062
+ "--ui-step-marker-size": "2rem",
2063
+ "--ui-step-marker-bg": "var(--ui-surface)",
2064
+ "--ui-step-marker-border": "color-mix(in oklab, var(--ui-surface-fg) 32%, var(--ui-surface))",
2065
+ "--ui-step-current-bg": "var(--ui-c)",
2066
+ "--ui-step-current-fg": "var(--ui-on-c)",
2067
+ "--ui-step-completed-bg": "var(--ui-c)",
2068
+ "--ui-step-completed-fg": "var(--ui-on-c)",
2069
+ "--ui-step-line": "color-mix(in oklab, var(--ui-surface-fg) 50%, var(--ui-surface))",
2070
+ "--ui-step-completed-line": "color-mix(in oklab, var(--ui-c) 55%, var(--ui-surface-fg))",
2071
+ "--ui-step-label-color": "color-mix(in oklab, var(--ui-surface-fg) 68%, var(--ui-surface))",
2072
+ display: "flex",
2073
+ gap: "var(--ui-steps-gap)",
2074
+ "box-sizing": "border-box",
2075
+ width: "100%",
2076
+ margin: "0",
2077
+ padding: "0",
2078
+ "list-style": "none",
2079
+ "counter-reset": "ui-step",
2080
+ "font-family": "var(--ui-font-sans)",
2081
+ "font-size": "0.9375rem",
2082
+ "line-height": "1.4",
2083
+ color: "var(--ui-surface-fg)",
2084
+ '&[data-orientation="vertical"]': {
2085
+ "flex-direction": "column",
2086
+ "& > .ui-step": {
2087
+ flex: "none",
2088
+ width: "100%",
2089
+ "flex-direction": "row",
2090
+ "align-items": "flex-start",
2091
+ gap: "0.625rem",
2092
+ "text-align": "start",
2093
+ "&::after": {
2094
+ top: "var(--ui-step-marker-size)",
2095
+ "inset-inline-start": "calc((var(--ui-step-marker-size) / 2) - 1px)",
2096
+ width: "2px",
2097
+ height: "calc(100% - var(--ui-step-marker-size) + var(--ui-steps-gap))",
2098
+ transform: "none",
2099
+ },
2100
+ },
2101
+ },
2102
+ },
2103
+ intents,
2104
+ sizes: {
2105
+ sm: { "--ui-steps-gap": "0.75rem", "--ui-step-marker-size": "1.5rem", "font-size": "0.875rem" },
2106
+ lg: { "--ui-steps-gap": "1.25rem", "--ui-step-marker-size": "2.5rem", "font-size": "1.0625rem" },
2107
+ },
2108
+ },
2109
+ step: {
2110
+ base: {
2111
+ position: "relative",
2112
+ display: "flex",
2113
+ "flex-direction": "column",
2114
+ "align-items": "center",
2115
+ "flex": "1 1 0",
2116
+ gap: "0.5rem",
2117
+ "min-width": "0",
2118
+ "counter-increment": "ui-step",
2119
+ color: "var(--ui-step-label-color)",
2120
+ "text-align": "center",
2121
+ "&::before": {
2122
+ content: "counter(ui-step)",
2123
+ position: "relative",
2124
+ "z-index": "1",
2125
+ display: "flex",
2126
+ "align-items": "center",
2127
+ "justify-content": "center",
2128
+ "flex-shrink": "0",
2129
+ "box-sizing": "border-box",
2130
+ width: "var(--ui-step-marker-size)",
2131
+ height: "var(--ui-step-marker-size)",
2132
+ "border-radius": "9999px",
2133
+ border: "2px solid var(--ui-step-marker-border)",
2134
+ "background-color": "var(--ui-step-marker-bg)",
2135
+ color: "color-mix(in oklab, var(--ui-surface-fg) 72%, var(--ui-surface))",
2136
+ "font-size": "calc(var(--ui-step-marker-size) * 0.45)",
2137
+ "font-weight": "600",
2138
+ "line-height": "1",
2139
+ },
2140
+ /* Horizontal connector: starts at this marker's edge and crosses the
2141
+ item gap to the next marker. Logical inset keeps RTL aligned. */
2142
+ "&::after": {
2143
+ content: '""',
2144
+ position: "absolute",
2145
+ top: "calc(var(--ui-step-marker-size) / 2)",
2146
+ "inset-inline-start": "calc(50% + (var(--ui-step-marker-size) / 2))",
2147
+ width: "calc(100% - var(--ui-step-marker-size) + var(--ui-steps-gap))",
2148
+ height: "2px",
2149
+ transform: "translateY(-50%)",
2150
+ "background-color": "var(--ui-step-line)",
2151
+ },
2152
+ "&:last-child::after": { content: "none" },
2153
+ '&[data-state="completed"]': {
2154
+ color: "var(--ui-surface-fg)",
2155
+ },
2156
+ '&[data-state="completed"]::before': {
2157
+ content: '"✓" / ""',
2158
+ "border-color": "var(--ui-step-completed-bg)",
2159
+ "background-color": "var(--ui-step-completed-bg)",
2160
+ color: "var(--ui-step-completed-fg)",
2161
+ },
2162
+ '&[data-state="completed"]::after': {
2163
+ "background-color": "var(--ui-step-completed-line)",
2164
+ },
2165
+ '&[aria-current="step"]': {
2166
+ color: "var(--ui-surface-fg)",
2167
+ "font-weight": "600",
2168
+ },
2169
+ '&[aria-current="step"]::before': {
2170
+ "border-color": "var(--ui-step-current-bg)",
2171
+ "background-color": "var(--ui-step-current-bg)",
2172
+ color: "var(--ui-step-current-fg)",
2173
+ "box-shadow": "0 0 0 2px var(--ui-surface), 0 0 0 4px color-mix(in oklab, var(--ui-step-current-bg) 45%, transparent)",
2174
+ },
2175
+ },
2176
+ },
2177
+ /* ui-navbar: a page navigation header. It owns layout and visual treatment
2178
+ only; responsive disclosure and drawer behaviour stay consumer-owned. */
2179
+ navbar: {
2180
+ base: {
2181
+ ...neutralVars,
2182
+ "--ui-navbar-bg": "var(--ui-surface)",
2183
+ "--ui-navbar-border": "var(--ui-border)",
2184
+ "--ui-navbar-h": "3.5rem",
2185
+ "--ui-navbar-max-w": "72rem",
2186
+ "--ui-navbar-pad-x": "1rem",
2187
+ "--ui-navbar-gap": "0.75rem",
2188
+ "--ui-navbar-brand-fs": "1.0625rem",
2189
+ "--ui-navbar-brand-color": "var(--ui-surface-fg)",
2190
+ "--ui-navbar-link-py": "0.5rem",
2191
+ "--ui-navbar-link-px": "0.75rem",
2192
+ "--ui-navbar-link-radius": "var(--ui-radius)",
2193
+ "--ui-navbar-link-hover-bg": "color-mix(in oklab, var(--ui-c-text) 8%, transparent)",
2194
+ "--ui-navbar-link-active-color": "var(--ui-c-soft-fg)",
2195
+ "--ui-navbar-link-active-line": "var(--ui-c-soft-fg)",
2196
+ width: "100%",
2197
+ "box-sizing": "border-box",
2198
+ color: "var(--ui-surface-fg)",
2199
+ "background-color": "var(--ui-navbar-bg)",
2200
+ "border-bottom": "1px solid var(--ui-navbar-border)",
2201
+ "font-family": "var(--ui-font-sans)",
2202
+ "font-size": "0.9375rem",
2203
+ "line-height": "1.35",
2204
+ },
2205
+ intents,
2206
+ styles: {
2207
+ ghost: { "--ui-navbar-bg": "transparent", "--ui-navbar-border": "transparent" },
2208
+ soft: { "--ui-navbar-bg": "var(--ui-surface-muted)" },
2209
+ },
2210
+ sizes: {
2211
+ sm: {
2212
+ "--ui-navbar-h": "2.75rem",
2213
+ "--ui-navbar-pad-x": "0.75rem",
2214
+ "--ui-navbar-gap": "0.5rem",
2215
+ "--ui-navbar-brand-fs": "1rem",
2216
+ "--ui-navbar-link-py": "0.3125rem",
2217
+ "--ui-navbar-link-px": "0.625rem",
2218
+ "font-size": "0.875rem",
2219
+ },
2220
+ lg: {
2221
+ "--ui-navbar-h": "4rem",
2222
+ "--ui-navbar-pad-x": "1.25rem",
2223
+ "--ui-navbar-gap": "1rem",
2224
+ "--ui-navbar-brand-fs": "1.1875rem",
2225
+ "--ui-navbar-link-py": "0.625rem",
2226
+ "--ui-navbar-link-px": "0.875rem",
2227
+ "font-size": "1rem",
2228
+ },
2229
+ },
2230
+ },
2231
+ "navbar-inner": {
2232
+ base: {
2233
+ display: "flex",
2234
+ "align-items": "center",
2235
+ "flex-wrap": "wrap",
2236
+ "row-gap": "0.375rem",
2237
+ "column-gap": "var(--ui-navbar-gap)",
2238
+ "box-sizing": "border-box",
2239
+ width: "100%",
2240
+ "max-width": "var(--ui-navbar-max-w)",
2241
+ "min-height": "var(--ui-navbar-h)",
2242
+ "margin-block": "0",
2243
+ "margin-inline": "auto",
2244
+ "padding-block": "0.375rem",
2245
+ "padding-inline": "var(--ui-navbar-pad-x)",
2246
+ },
2247
+ },
2248
+ "navbar-brand": {
2249
+ base: {
2250
+ display: "inline-flex",
2251
+ "align-items": "center",
2252
+ "box-sizing": "border-box",
2253
+ "min-height": "2rem",
2254
+ "border-radius": "calc(var(--ui-radius) * 0.5)",
2255
+ color: "var(--ui-navbar-brand-color)",
2256
+ "font-size": "var(--ui-navbar-brand-fs)",
2257
+ "font-weight": "650",
2258
+ "line-height": "1.2",
2259
+ "text-decoration": "none",
2260
+ "white-space": "nowrap",
2261
+ "&:hover": { color: "var(--ui-navbar-link-active-color)" },
2262
+ "&:focus-visible": focusRing,
2263
+ },
2264
+ },
2265
+ "navbar-nav": {
2266
+ base: {
2267
+ display: "flex",
2268
+ "align-items": "center",
2269
+ "flex-wrap": "wrap",
2270
+ gap: "0.125rem",
2271
+ "min-width": "0",
2272
+ margin: "0",
2273
+ padding: "0",
2274
+ "list-style": "none",
2275
+ },
2276
+ },
2277
+ "navbar-link": {
2278
+ base: {
2279
+ position: "relative",
2280
+ display: "inline-flex",
2281
+ "align-items": "center",
2282
+ "justify-content": "center",
2283
+ "box-sizing": "border-box",
2284
+ "min-height": "2rem",
2285
+ padding: "var(--ui-navbar-link-py) var(--ui-navbar-link-px)",
2286
+ "border-radius": "var(--ui-navbar-link-radius)",
2287
+ color: "color-mix(in oklab, var(--ui-surface-fg) 88%, var(--ui-surface))",
2288
+ "font-family": "inherit",
2289
+ "font-size": "inherit",
2290
+ "font-weight": "500",
2291
+ "line-height": "1.25",
2292
+ "text-decoration": "none",
2293
+ "&:hover": {
2294
+ color: "var(--ui-surface-fg)",
2295
+ "background-color": "var(--ui-navbar-link-hover-bg)",
2296
+ },
2297
+ "&:focus-visible": focusRing,
2298
+ "&[aria-current]": { ...navbarLinkCurrent },
2299
+ },
2300
+ states: {
2301
+ disabled: {
2302
+ opacity: "0.55",
2303
+ cursor: "not-allowed",
2304
+ "pointer-events": "none",
2305
+ },
2306
+ active: { ...navbarLinkCurrent },
2307
+ },
2308
+ },
2309
+ "navbar-actions": {
2310
+ base: {
2311
+ display: "flex",
2312
+ "align-items": "center",
2313
+ "flex-wrap": "wrap",
2314
+ gap: "0.5rem",
2315
+ "min-width": "0",
2316
+ "margin-inline-start": "auto",
2317
+ },
2318
+ },
1537
2319
  /* ui-avatar: a circle holding initials, an icon or an <img>. The label
1538
2320
  or alt text is the consumer's. */
1539
2321
  avatar: {
@@ -2092,6 +2874,14 @@ export const defaultAdapter = defineAdapter({
2092
2874
  export const defaultKeyframes = {
2093
2875
  spin: { to: { transform: "rotate(360deg)" } },
2094
2876
  pulse: { "50%": { opacity: "0.55" } },
2877
+ "file-loading": {
2878
+ "0%, 100%": {
2879
+ "background-color": "color-mix(in oklab, var(--ui-c) 4%, var(--ui-surface))",
2880
+ },
2881
+ "50%": {
2882
+ "background-color": "color-mix(in oklab, var(--ui-c) 16%, var(--ui-surface))",
2883
+ },
2884
+ },
2095
2885
  "skeleton-shimmer": {
2096
2886
  from: { "background-position": "200% 0" },
2097
2887
  to: { "background-position": "-200% 0" },