@zazz-ui/core 0.6.3 → 0.8.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 (146) hide show
  1. package/AUTHORING.md +21 -20
  2. package/CHANGELOG.md +158 -0
  3. package/README.md +4 -4
  4. package/dist/sri.json +86 -83
  5. package/dist/zazz.css +1 -1
  6. package/dist/zazz.js +1 -1
  7. package/editor/zazz.css-data.json +4491 -1484
  8. package/editor/zazz.html-data.json +15 -3
  9. package/editor/zazz.language-data.json +108 -106
  10. package/editor/zazz.lint-data.json +2356 -2
  11. package/package.json +1 -1
  12. package/src/base/_defaults.css +413 -0
  13. package/src/base/_layers.css +6 -2
  14. package/src/base/_properties-2xl.css +20 -2
  15. package/src/base/_properties-active.css +32 -0
  16. package/src/base/_properties-checked.css +32 -0
  17. package/src/base/_properties-current.css +32 -0
  18. package/src/base/_properties-disabled.css +32 -0
  19. package/src/base/_properties-focus-visible.css +32 -0
  20. package/src/base/_properties-focus-within.css +32 -0
  21. package/src/base/_properties-hover.css +32 -0
  22. package/src/base/_properties-lg.css +20 -2
  23. package/src/base/_properties-md.css +20 -2
  24. package/src/base/_properties-open.css +32 -0
  25. package/src/base/_properties-sm.css +20 -2
  26. package/src/base/_properties-starting.css +16 -0
  27. package/src/base/_properties-stuck.css +16 -0
  28. package/src/base/_properties-xl.css +20 -2
  29. package/src/base/_properties.css +58 -9
  30. package/src/base/_shadows.css +46 -0
  31. package/src/base/_utilities-box.css +181 -23
  32. package/src/base/_utilities-color.css +1 -3
  33. package/src/base/_utilities-effects.css +39 -152
  34. package/src/base/_utilities-flow.css +80 -68
  35. package/src/base/_utilities-grid.css +21 -32
  36. package/src/base/_utilities-margin.css +1 -0
  37. package/src/base/_utilities-pseudo.css +58 -4
  38. package/src/base/_utilities-sizing.css +1 -3
  39. package/src/base/_utilities-spacing.css +197 -34
  40. package/src/base/_utilities-tier-2xl.css +10 -1
  41. package/src/base/_utilities-tier-active.css +16 -0
  42. package/src/base/_utilities-tier-checked.css +16 -0
  43. package/src/base/_utilities-tier-current.css +16 -0
  44. package/src/base/_utilities-tier-disabled.css +16 -0
  45. package/src/base/_utilities-tier-focus-visible.css +16 -0
  46. package/src/base/_utilities-tier-focus-within.css +16 -0
  47. package/src/base/_utilities-tier-hover.css +16 -0
  48. package/src/base/_utilities-tier-lg.css +10 -1
  49. package/src/base/_utilities-tier-md.css +10 -1
  50. package/src/base/_utilities-tier-open.css +16 -0
  51. package/src/base/_utilities-tier-sm.css +10 -1
  52. package/src/base/_utilities-tier-starting.css +8 -0
  53. package/src/base/_utilities-tier-stuck.css +8 -0
  54. package/src/base/_utilities-tier-xl.css +10 -1
  55. package/src/base/_utilities-typography.css +1 -9
  56. package/src/base/_variables.css +5 -85
  57. package/src/base/kit-styling.d.ts +11 -0
  58. package/src/base/kit-styling.d.ts.map +1 -0
  59. package/src/base/kit-styling.js +504 -0
  60. package/src/base/kit-styling.ts +507 -0
  61. package/src/base/reveal.d.ts +3 -3
  62. package/src/base/reveal.d.ts.map +1 -1
  63. package/src/base/reveal.js +34 -18
  64. package/src/base/reveal.ts +42 -20
  65. package/src/base/utilities.d.ts +28 -10
  66. package/src/base/utilities.d.ts.map +1 -1
  67. package/src/base/utilities.js +172 -44
  68. package/src/base/utilities.ts +188 -54
  69. package/src/index.css +2 -0
  70. package/src/manifest.d.ts.map +1 -1
  71. package/src/manifest.js +3 -1
  72. package/src/manifest.ts +3 -1
  73. package/src/primitives/avatar/avatar.html +2 -2
  74. package/src/primitives/badge/badge.css +14 -10
  75. package/src/primitives/button/button.css +17 -13
  76. package/src/primitives/button-group/button-group.css +13 -6
  77. package/src/primitives/callout/callout.css +6 -2
  78. package/src/primitives/card/card-subgrid.html +3 -3
  79. package/src/primitives/card/card.css +8 -4
  80. package/src/primitives/card/card.html +2 -2
  81. package/src/primitives/carousel/carousel.html +12 -12
  82. package/src/primitives/checkbox/checkbox.css +6 -2
  83. package/src/primitives/combobox/combobox.css +8 -4
  84. package/src/primitives/debug/audit-core.d.ts +8 -0
  85. package/src/primitives/debug/audit-core.d.ts.map +1 -1
  86. package/src/primitives/debug/audit-core.js +30 -6
  87. package/src/primitives/debug/audit-core.ts +49 -5
  88. package/src/primitives/debug/debug.d.ts +0 -15
  89. package/src/primitives/debug/debug.d.ts.map +1 -1
  90. package/src/primitives/debug/debug.js +11 -2
  91. package/src/primitives/debug/debug.ts +12 -1
  92. package/src/primitives/dialog/dialog-with-form.html +1 -1
  93. package/src/primitives/dialog/dialog.css +35 -14
  94. package/src/primitives/fields/fields.css +8 -4
  95. package/src/primitives/input/input.css +6 -2
  96. package/src/primitives/input-group/input-group.css +5 -1
  97. package/src/primitives/kbd/kbd.css +6 -2
  98. package/src/primitives/layout/layout.html +1 -1
  99. package/src/primitives/lightbox/lightbox.css +12 -16
  100. package/src/primitives/lightbox/lightbox.html +1 -1
  101. package/src/primitives/menu/menu.css +3 -3
  102. package/src/primitives/meter/meter.css +6 -2
  103. package/src/primitives/mobile-menu/mobile-menu.css +2 -2
  104. package/src/primitives/mobile-menu/mobile-menu.html +1 -1
  105. package/src/primitives/navigation-menu/navigation-menu-featured.html +1 -1
  106. package/src/primitives/navigation-menu/navigation-menu.css +4 -4
  107. package/src/primitives/navigation-menu/navigation-menu.html +1 -1
  108. package/src/primitives/otp/otp.css +6 -2
  109. package/src/primitives/password-group/password-group.css +5 -1
  110. package/src/primitives/popover/popover.css +8 -4
  111. package/src/primitives/progress/progress.css +6 -2
  112. package/src/primitives/radio/radio.css +6 -2
  113. package/src/primitives/reveal/reveal.css +17 -11
  114. package/src/primitives/select/select.css +15 -7
  115. package/src/primitives/slider/slider.css +7 -7
  116. package/src/primitives/switch/switch.css +6 -2
  117. package/src/primitives/tabs/tabs.css +10 -6
  118. package/src/primitives/tabs/tabs.html +6 -6
  119. package/src/primitives/textarea/textarea.css +6 -2
  120. package/src/primitives/toaster/toaster.css +2 -2
  121. package/src/primitives/toggle/toggle.css +9 -5
  122. package/src/primitives/toggle-group/toggle-group.css +13 -6
  123. package/src/primitives/toolbar/toolbar.html +1 -1
  124. package/src/primitives/tooltip/tooltip.css +6 -2
  125. package/src/primitives/utilities/aspect-ratio.html +3 -3
  126. package/src/primitives/utilities/basis.html +5 -5
  127. package/src/primitives/utilities/col-span.html +5 -5
  128. package/src/primitives/utilities/compose.html +2 -2
  129. package/src/primitives/utilities/flex-align.html +3 -3
  130. package/src/primitives/utilities/flex-direction.html +6 -6
  131. package/src/primitives/utilities/flex-grow.html +3 -3
  132. package/src/primitives/utilities/gap.html +9 -9
  133. package/src/primitives/utilities/grid-cols.html +6 -6
  134. package/src/primitives/utilities/grid-responsive.html +8 -8
  135. package/src/primitives/utilities/margin-auto.html +3 -3
  136. package/src/primitives/utilities/object-fit.html +3 -3
  137. package/src/primitives/utilities/order.html +3 -3
  138. package/src/primitives/utilities/overflow.html +2 -2
  139. package/src/primitives/utilities/padding-compose.html +6 -6
  140. package/src/primitives/utilities/padding.html +8 -8
  141. package/src/primitives/utilities/pile.html +1 -1
  142. package/src/primitives/utilities/position.html +2 -2
  143. package/src/primitives/utilities/responsive-flex.html +3 -3
  144. package/src/primitives/utilities/responsive-grid.html +8 -8
  145. package/src/primitives/utilities/size.html +5 -5
  146. package/src/primitives/utilities/width.html +5 -5
@@ -170,15 +170,16 @@ export interface Utility {
170
170
  */
171
171
  inherits?: true;
172
172
  /**
173
- * No-base allowlist: the CSS initial value as a literal. A utility with
174
- * `noBase` applies a tier on a plain element without a base value.
173
+ * What a dual utility's number multiplies (default `var(--spacing)`):
174
+ * `--radius: 2` is two steps of `--spacing` times `--radius-multiplier`.
175
175
  */
176
- noBase?: string;
176
+ scale?: string;
177
177
  /**
178
- * Extra selectors excluded from the no-base rule: elements whose
179
- * placement chain a primitive owns, e.g. a layout's children for `--band`.
178
+ * No-base allowlist: the CSS initial value as a literal. A utility with
179
+ * `noBase` applies a tier without a base value wherever no kit rule sets its
180
+ * property (the tier-only rule is in `@layer defaults`, which they beat).
180
181
  */
181
- noBaseExclude?: readonly string[];
182
+ noBase?: string;
182
183
  /**
183
184
  * Keywords the typed emission (the dual pair, or an integer's `repeat()`)
184
185
  * cannot carry. A utility written with one of its keywords, at the base or
@@ -194,22 +195,52 @@ export interface Utility {
194
195
  */
195
196
  pseudo?: true;
196
197
  /**
197
- * Keyword shorthands: `--shadow: md` reads as `--shadow: var(--shadow-md)`.
198
+ * Keyword shorthands: `--font-weight: strong` reads as `var(--font-weight-strong)`.
198
199
  * Each is an exact-value rule at the base and at every tier of the family, so
199
- * it works in `--shadow--hover: lg` too; any other value passes through as
200
+ * it works in `--font-weight--md: strong` too; any other value passes through as
200
201
  * usual. A keyword that is a prefix of another must come first.
201
202
  */
202
203
  aliases?: Readonly<Record<string, string>>;
203
204
  }
204
205
 
205
- /** Gradient types: `--bg-<type>` emits `<type>-gradient(<prelude>, <--bg-stops>)`. */
206
- export const GRADIENT_TYPES = ["linear", "radial", "conic"] as const;
206
+ /**
207
+ * The utilities that compose into one `box-shadow` (the rings, shadow, and
208
+ * elevation): the composite's chains all end in a literal, so a tier alone
209
+ * works on them, like a no-base utility.
210
+ */
211
+ export const BOX_SHADOW_COMPOSITE = [
212
+ "shadow",
213
+ "ring",
214
+ "ring-color",
215
+ "ring-offset",
216
+ "ring-offset-color",
217
+ "elevation",
218
+ ] as const;
207
219
 
208
- /** The size scale shared by the token keywords (`--shadow: md`). */
209
- export const SIZE_KEYWORDS = ["2xs", "xs", "sm", "md", "lg", "xl", "2xl"] as const;
220
+ /**
221
+ * The shorthands whose base a longhand's tier overrides, nearest first: `--p: 4;
222
+ * --px--md: 1` pads 4 below md and 1 inline from md. A shorthand's base is a
223
+ * base for its longhands' tiers.
224
+ */
225
+ export const SHORTHAND_OF: Readonly<Record<string, readonly string[]>> = {
226
+ px: ["p"],
227
+ py: ["p"],
228
+ pt: ["py", "p"],
229
+ pb: ["py", "p"],
230
+ pl: ["px", "p"],
231
+ pr: ["px", "p"],
232
+ "gap-x": ["gap"],
233
+ "gap-y": ["gap"],
234
+ basis: ["flex"],
235
+ shrink: ["flex"],
236
+ "radius-t": ["radius"],
237
+ "radius-b": ["radius"],
238
+ "radius-l": ["radius"],
239
+ "radius-r": ["radius"],
240
+ };
210
241
 
211
- /** `--shadow: md` → `var(--shadow-md)`. */
212
- const SHADOWS = Object.fromEntries(SIZE_KEYWORDS.map((size) => [size, `var(--shadow-${size})`]));
242
+ /** Gradient types: `--bg-<type>` emits `<type>-gradient(<prelude>, <--bg-stops>)`. */
243
+ export const GRADIENT_TYPES = ["linear", "radial", "conic"] as const;
213
244
 
214
245
  /**
215
246
  * `--font-weight: strong` → `var(--font-weight-strong)`: the role weights, so a
@@ -284,24 +315,14 @@ export const BORDER_SIDES = [
284
315
  /** The four sizing keywords. Margin takes only `auto`. */
285
316
  export const SIZING_KEYWORDS = ["auto", "fit-content", "min-content", "max-content"] as const;
286
317
  export const MARGIN_KEYWORDS = ["auto"] as const;
287
- /** A layout places its children; a tier-only column utility there keeps the band below the tier. */
288
- const LAYOUT_CHILDREN = ["ui-layout > *", '[data-ui~="layout"] > *'] as const;
318
+
289
319
  /**
290
- * Elements the reset or the prose scope pads (a prose list's indent, a quote's
291
- * inset, inline code, form controls): a tier-only padding utility there would
292
- * zero that padding below the tier, so they keep the base requirement.
320
+ * Keywords the side insets (`--top --right --bottom --left`) take besides a
321
+ * length: `auto` releases a side at a breakpoint (`--bottom: 0; --bottom--lg:
322
+ * auto` sticks to the bottom below lg only). Each keyword costs ~16 [style*=]
323
+ * substrings (SPEC claim 16), so the axis and `--inset` shorthands go without.
293
324
  */
294
- const BASE_PADDED = [
295
- '[data-ui~="prose"] :is(ul, ol, dd, blockquote, cite)',
296
- "code",
297
- "button",
298
- "input",
299
- "select",
300
- "textarea",
301
- "optgroup",
302
- ] as const;
303
- /** Elements the reset paints: a tier-only `--bg` there would clear the paint below the tier. */
304
- const BASE_PAINTED = ["code", "hr"] as const;
325
+ export const INSET_KEYWORDS = ["auto"] as const;
305
326
 
306
327
  /**
307
328
  * Track-list keywords `--grid-cols` / `--grid-rows` take besides a count. `none`
@@ -323,6 +344,37 @@ export const UTILITIES: readonly Utility[] = [
323
344
  family: "flow",
324
345
  noBase: "static",
325
346
  },
347
+ // anchor positioning: states and breakpoints, so the hovered (or open, or
348
+ // current) element can claim the anchor a toolbar or popover is tethered to.
349
+ // `normal` is position-anchor's initial value. Engines on the older draft
350
+ // don't know it, so the declaration is invalid at computed-value time and
351
+ // falls back to their initial value, `auto`.
352
+ {
353
+ name: "anchor-name",
354
+ properties: ["anchor-name"],
355
+ mode: "raw",
356
+ family: "flow",
357
+ tiers: "both",
358
+ noBase: "none",
359
+ },
360
+ {
361
+ name: "position-anchor",
362
+ properties: ["position-anchor"],
363
+ mode: "raw",
364
+ family: "flow",
365
+ tiers: "both",
366
+ noBase: "normal",
367
+ },
368
+ // where the tethered element sits on its anchor's 3×3 grid (`block-start
369
+ // span-inline-end`); a popover keeps its own area under a tier alone
370
+ {
371
+ name: "position-area",
372
+ properties: ["position-area"],
373
+ mode: "raw",
374
+ family: "flow",
375
+ tiers: "both",
376
+ noBase: "none",
377
+ },
326
378
  {
327
379
  name: "flex-wrap",
328
380
  properties: ["flex-wrap"],
@@ -330,7 +382,6 @@ export const UTILITIES: readonly Utility[] = [
330
382
  family: "flow",
331
383
  noBase: "nowrap",
332
384
  },
333
- { name: "shrink", properties: ["flex-shrink"], mode: "raw", family: "flow", noBase: "1" },
334
385
  {
335
386
  name: "grid-flow",
336
387
  properties: ["grid-auto-flow"],
@@ -377,6 +428,8 @@ export const UTILITIES: readonly Utility[] = [
377
428
  },
378
429
  { name: "self", properties: ["align-self"], mode: "keyword", family: "flow", noBase: "auto" },
379
430
  { name: "flex", properties: ["flex"], mode: "raw", family: "flow", noBase: "0 1 auto" },
431
+ // after --flex, so its base beats the shorthand's
432
+ { name: "shrink", properties: ["flex-shrink"], mode: "raw", family: "flow", noBase: "1" },
380
433
  { name: "basis", properties: ["flex-basis"], mode: "raw", family: "flow", noBase: "auto" },
381
434
  { name: "order", properties: ["order"], mode: "raw", family: "flow", noBase: "0" },
382
435
  // a layout child's band (`layout-md`); any grid-column value works
@@ -386,7 +439,6 @@ export const UTILITIES: readonly Utility[] = [
386
439
  mode: "raw",
387
440
  family: "flow",
388
441
  noBase: "auto",
389
- noBaseExclude: LAYOUT_CHILDREN,
390
442
  },
391
443
  // Tailwind's col-span / col-start / col-end (and row-*): span is a count,
392
444
  // start and end are line numbers; start and end follow span so they combine
@@ -397,7 +449,6 @@ export const UTILITIES: readonly Utility[] = [
397
449
  family: "flow",
398
450
  emit: "span",
399
451
  noBase: "1",
400
- noBaseExclude: LAYOUT_CHILDREN,
401
452
  },
402
453
  {
403
454
  name: "col-start",
@@ -405,7 +456,6 @@ export const UTILITIES: readonly Utility[] = [
405
456
  mode: "raw",
406
457
  family: "flow",
407
458
  noBase: "auto",
408
- noBaseExclude: LAYOUT_CHILDREN,
409
459
  },
410
460
  {
411
461
  name: "col-end",
@@ -413,7 +463,6 @@ export const UTILITIES: readonly Utility[] = [
413
463
  mode: "raw",
414
464
  family: "flow",
415
465
  noBase: "auto",
416
- noBaseExclude: LAYOUT_CHILDREN,
417
466
  },
418
467
  {
419
468
  name: "row-span",
@@ -476,7 +525,7 @@ export const UTILITIES: readonly Utility[] = [
476
525
  emit: "grid-fit",
477
526
  },
478
527
  // spacing: dual mode; padding and gap are on the no-base allowlist (the reset
479
- // zeroes padding, so `--px--md: 8` alone pads from md), except where the base pads
528
+ // zeroes padding, so `--px--md: 8` alone pads from md)
480
529
  ...(
481
530
  [
482
531
  ["p", "padding"],
@@ -495,23 +544,48 @@ export const UTILITIES: readonly Utility[] = [
495
544
  mode: "dual",
496
545
  family: "spacing",
497
546
  noBase: "0",
498
- noBaseExclude: BASE_PADDED,
499
547
  }),
500
548
  ),
501
549
  { name: "gap", properties: ["gap"], mode: "dual", family: "spacing", noBase: "0" },
502
550
  { name: "gap-x", properties: ["column-gap"], mode: "dual", family: "spacing", noBase: "0" },
503
551
  { name: "gap-y", properties: ["row-gap"], mode: "dual", family: "spacing", noBase: "0" },
504
- { name: "inset", pseudo: true, properties: ["inset"], mode: "dual", family: "spacing" },
552
+ {
553
+ name: "inset",
554
+ pseudo: true,
555
+ properties: ["inset"],
556
+ mode: "dual",
557
+ family: "spacing",
558
+ },
505
559
  // axis insets: left + right and top + bottom (logical, like the sides)
506
- { name: "inset-x", pseudo: true, properties: ["inset-inline"], mode: "dual", family: "spacing" },
507
- { name: "inset-y", pseudo: true, properties: ["inset-block"], mode: "dual", family: "spacing" },
508
- { name: "top", pseudo: true, properties: ["inset-block-start"], mode: "dual", family: "spacing" },
560
+ {
561
+ name: "inset-x",
562
+ pseudo: true,
563
+ properties: ["inset-inline"],
564
+ mode: "dual",
565
+ family: "spacing",
566
+ },
567
+ {
568
+ name: "inset-y",
569
+ pseudo: true,
570
+ properties: ["inset-block"],
571
+ mode: "dual",
572
+ family: "spacing",
573
+ },
574
+ {
575
+ name: "top",
576
+ pseudo: true,
577
+ properties: ["inset-block-start"],
578
+ mode: "dual",
579
+ family: "spacing",
580
+ keywords: INSET_KEYWORDS,
581
+ },
509
582
  {
510
583
  name: "bottom",
511
584
  pseudo: true,
512
585
  properties: ["inset-block-end"],
513
586
  mode: "dual",
514
587
  family: "spacing",
588
+ keywords: INSET_KEYWORDS,
515
589
  },
516
590
  {
517
591
  name: "left",
@@ -519,6 +593,7 @@ export const UTILITIES: readonly Utility[] = [
519
593
  properties: ["inset-inline-start"],
520
594
  mode: "dual",
521
595
  family: "spacing",
596
+ keywords: INSET_KEYWORDS,
522
597
  },
523
598
  {
524
599
  name: "right",
@@ -526,6 +601,7 @@ export const UTILITIES: readonly Utility[] = [
526
601
  properties: ["inset-inline-end"],
527
602
  mode: "dual",
528
603
  family: "spacing",
604
+ keywords: INSET_KEYWORDS,
529
605
  },
530
606
  // margin: dual mode plus `auto`
531
607
  { name: "m", properties: ["margin"], mode: "dual", family: "margin", keywords: MARGIN_KEYWORDS },
@@ -693,7 +769,6 @@ export const UTILITIES: readonly Utility[] = [
693
769
  emit: "bg",
694
770
  pseudo: true,
695
771
  noBase: "transparent",
696
- noBaseExclude: BASE_PAINTED,
697
772
  },
698
773
  { name: "bg-alpha", properties: [], mode: "raw", family: "color", emit: "none" },
699
774
  // gradients: the type utility carries the prelude (direction, shape, position,
@@ -749,19 +824,54 @@ export const UTILITIES: readonly Utility[] = [
749
824
  family: "effects",
750
825
  noBase: "1",
751
826
  },
827
+ {
828
+ name: "filter",
829
+ pseudo: true,
830
+ properties: ["filter"],
831
+ mode: "raw",
832
+ family: "effects",
833
+ noBase: "none",
834
+ },
835
+ // a height: a four-layer box-shadow with a negative spread, drawn with the elevation
836
+ // formula (generate-utilities.ts) in --shadow-angle's light and --shadow-tint; shares
837
+ // one box-shadow with --ring* and --shadow (an explicit --shadow wins)
838
+ {
839
+ name: "elevation",
840
+ properties: [],
841
+ mode: "raw",
842
+ family: "effects",
843
+ tiers: "both",
844
+ noBase: "0",
845
+ emit: "none",
846
+ },
847
+ {
848
+ name: "backdrop-filter",
849
+ pseudo: true,
850
+ properties: ["backdrop-filter"],
851
+ mode: "raw",
852
+ family: "effects",
853
+ noBase: "none",
854
+ },
855
+ {
856
+ name: "mix-blend",
857
+ pseudo: true,
858
+ properties: ["mix-blend-mode"],
859
+ mode: "keyword",
860
+ family: "effects",
861
+ noBase: "normal",
862
+ },
752
863
  {
753
864
  name: "shadow",
754
865
  properties: [],
755
866
  mode: "raw",
756
867
  family: "effects",
757
868
  emit: "none",
758
- aliases: SHADOWS,
759
869
  },
760
- // the shadow color for an element and its subtree: _variables.css re-declares the
761
- // --shadow-* tokens wherever this is set, so keyword, var(), and primitive shadows follow
762
- { name: "shadow-hue", properties: [], mode: "raw", family: "box", emit: "none" },
870
+ // the shadow color for an element and its subtree: _shadows.css re-declares the
871
+ // --shadow-* tokens wherever this is set, so var() and primitive shadows follow
872
+ { name: "shadow-tint", properties: [], mode: "raw", family: "box", emit: "none" },
763
873
  // the shadow's cast direction: the --shadow-* tokens rotate their offsets by it
764
- // (0deg casts down, clockwise), re-declared where it is set (_variables.css)
874
+ // (0deg casts down, clockwise), re-declared where it is set (_shadows.css)
765
875
  {
766
876
  name: "shadow-angle",
767
877
  properties: [],
@@ -851,28 +961,52 @@ export const UTILITIES: readonly Utility[] = [
851
961
  tiers: "both",
852
962
  },
853
963
  // box: no tiers
964
+ // a number is that many --spacing steps times --radius-multiplier, like the
965
+ // --radius-* tokens (`--radius: 2.5` is --radius-md); `full` is the pill token
854
966
  {
855
- name: "rounded",
967
+ name: "radius",
856
968
  properties: ["border-radius"],
857
- mode: "raw",
969
+ mode: "dual",
858
970
  family: "box",
859
- pseudo: true,
971
+ tiers: "both",
860
972
  noBase: "0",
973
+ pseudo: true,
974
+ scale: "var(--spacing) * var(--radius-multiplier)",
975
+ aliases: { full: "var(--radius-full)" },
861
976
  },
862
- { name: "overflow", properties: ["overflow"], mode: "keyword", family: "box", noBase: "visible" },
977
+ // two logical corners each (Tailwind's rounded-t/-b/-l/-r), after --radius so they
978
+ // win over it; l and r follow the writing direction
979
+ ...(
980
+ [
981
+ ["radius-t", ["border-start-start-radius", "border-start-end-radius"]],
982
+ ["radius-b", ["border-end-start-radius", "border-end-end-radius"]],
983
+ ["radius-l", ["border-start-start-radius", "border-end-start-radius"]],
984
+ ["radius-r", ["border-start-end-radius", "border-end-end-radius"]],
985
+ ] as const
986
+ ).map(
987
+ ([name, properties]): Utility => ({
988
+ name,
989
+ properties,
990
+ mode: "dual",
991
+ family: "box",
992
+ tiers: "breakpoints",
993
+ noBase: "0",
994
+ scale: "var(--spacing) * var(--radius-multiplier)",
995
+ aliases: { full: "var(--radius-full)" },
996
+ }),
997
+ ),
998
+ { name: "overflow", properties: ["overflow"], mode: "keyword", family: "box" },
863
999
  {
864
1000
  name: "overflow-x",
865
1001
  properties: ["overflow-x"],
866
1002
  mode: "keyword",
867
1003
  family: "box",
868
- noBase: "visible",
869
1004
  },
870
1005
  {
871
1006
  name: "overflow-y",
872
1007
  properties: ["overflow-y"],
873
1008
  mode: "keyword",
874
1009
  family: "box",
875
- noBase: "visible",
876
1010
  },
877
1011
  { name: "outline", pseudo: true, properties: ["outline"], mode: "raw", family: "box" },
878
1012
  { name: "cursor", properties: ["cursor"], mode: "keyword", family: "box" },
@@ -884,7 +1018,7 @@ export const UTILITIES: readonly Utility[] = [
884
1018
  family: "box",
885
1019
  },
886
1020
  { name: "visibility", pseudo: true, properties: ["visibility"], mode: "keyword", family: "box" },
887
- { name: "z", pseudo: true, properties: ["z-index"], mode: "raw", family: "box", noBase: "auto" },
1021
+ { name: "z", pseudo: true, properties: ["z-index"], mode: "raw", family: "box" },
888
1022
  { name: "object-fit", properties: ["object-fit"], mode: "keyword", family: "box" },
889
1023
  { name: "object-position", properties: ["object-position"], mode: "raw", family: "box" },
890
1024
  // the divider between children for the divide-x / divide-y switches: the
package/src/index.css CHANGED
@@ -16,6 +16,7 @@
16
16
  /* base */
17
17
  @import "./base/_layers.css";
18
18
  @import "./base/_variables.css";
19
+ @import "./base/_shadows.css";
19
20
  @import "./base/_breakpoints.css";
20
21
  @import "./base/_reset.css";
21
22
  @import "./base/_typography.css";
@@ -116,6 +117,7 @@
116
117
  @import "./base/_utilities-effects.css";
117
118
  @import "./base/_utilities-box.css";
118
119
  @import "./base/_utilities-pseudo.css";
120
+ @import "./base/_defaults.css";
119
121
  @import "./base/_switches.css";
120
122
 
121
123
  /* Migration shims: beat all other legacy sublayers; Zazz still wins. */
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["manifest.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAIH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAIlC,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,6EAA6E;IAC7E,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,qDAAqD;IACrD,EAAE,EAAE,MAAM,EAAE,CAAC;IACb;;;;OAIG;IACH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1E,MAAM,WAAW,eAAe;IAC9B,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;CAC7C;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,eAAe,EAE3C,CAAC;AAEF,yGAAyG;AACzG,MAAM,WAAW,eAAe;IAC9B,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB;;;;OAIG;IACH,IAAI,EAAE,uBAAuB,CAAC;CAC/B;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,eAAe,EAE3C,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,SAAS,EAAE,MAAM,EAErB,CAAC;AAEV,eAAO,MAAM,iBAAiB,EAAE,MAAM,EA0CrC,CAAC;AAIF;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAoBxD;AAID,MAAM,MAAM,aAAa,GACrB,cAAc,GACd,UAAU,GACV,SAAS,GACT,iBAAiB,GACjB,OAAO,GACP,QAAQ,GACR,UAAU,GACV,UAAU,GACV,UAAU,GACV,MAAM,GACN,aAAa,GACb,KAAK,GACL,UAAU,GACV,MAAM,GACN,SAAS,CAAC;AAEd;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,CAmC/E,CAAC"}
package/src/manifest.js CHANGED
@@ -180,7 +180,7 @@ export const PRIMITIVES = {
180
180
  debug: {
181
181
  css: [],
182
182
  js: ["primitives/debug/audit-core.js", "primitives/debug/debug.js"],
183
- base: ["base/utilities.js"],
183
+ base: ["base/kit-styling.js", "base/utilities.js"],
184
184
  primitives: [],
185
185
  bare: [],
186
186
  examples: [],
@@ -551,6 +551,7 @@ export const PRIMITIVES = {
551
551
  export const BASE_CSS_PRE = [
552
552
  "base/_layers.css",
553
553
  "base/_variables.css",
554
+ "base/_shadows.css",
554
555
  "base/_breakpoints.css",
555
556
  "base/_reset.css",
556
557
  "base/_typography.css",
@@ -599,6 +600,7 @@ export const BASE_CSS_POST = [
599
600
  "base/_utilities-effects.css",
600
601
  "base/_utilities-box.css",
601
602
  "base/_utilities-pseudo.css",
603
+ "base/_defaults.css",
602
604
  "base/_switches.css",
603
605
  ];
604
606
  /**
package/src/manifest.ts CHANGED
@@ -216,7 +216,7 @@ export const PRIMITIVES: Record<string, PrimitiveEntry> = {
216
216
  debug: {
217
217
  css: [],
218
218
  js: ["primitives/debug/audit-core.js", "primitives/debug/debug.js"],
219
- base: ["base/utilities.js"],
219
+ base: ["base/kit-styling.js", "base/utilities.js"],
220
220
  primitives: [],
221
221
  bare: [],
222
222
  examples: [],
@@ -589,6 +589,7 @@ export const PRIMITIVES: Record<string, PrimitiveEntry> = {
589
589
  export const BASE_CSS_PRE: string[] = [
590
590
  "base/_layers.css",
591
591
  "base/_variables.css",
592
+ "base/_shadows.css",
592
593
  "base/_breakpoints.css",
593
594
  "base/_reset.css",
594
595
  "base/_typography.css",
@@ -638,6 +639,7 @@ export const BASE_CSS_POST: string[] = [
638
639
  "base/_utilities-effects.css",
639
640
  "base/_utilities-box.css",
640
641
  "base/_utilities-pseudo.css",
642
+ "base/_defaults.css",
641
643
  "base/_switches.css",
642
644
  ];
643
645
 
@@ -14,7 +14,7 @@
14
14
  --bg: var(--color-background);
15
15
  --border-color: var(--color-border);
16
16
  --border-width: 1px;
17
- --rounded: var(--radius-full);
17
+ --radius: full;
18
18
  --overflow: clip;
19
19
  "
20
20
  >
@@ -91,7 +91,7 @@
91
91
  --bg: var(--color-background);
92
92
  --border-color: var(--color-border);
93
93
  --border-width: 1px;
94
- --rounded: var(--radius-full);
94
+ --radius: full;
95
95
  --overflow: clip;
96
96
  "
97
97
  >
@@ -41,7 +41,7 @@
41
41
  --ui-badge-gap: var(--spacing);
42
42
  --ui-badge-px: calc(var(--spacing) * 1.25);
43
43
  --ui-badge-h: calc(var(--spacing) * 5);
44
- --ui-badge-rounded: var(--radius-sm);
44
+ --ui-badge-radius: var(--radius-sm);
45
45
 
46
46
  --ui-badge-icon-size: calc(var(--spacing) * 3);
47
47
 
@@ -146,7 +146,7 @@
146
146
  inherits: false;
147
147
  }
148
148
 
149
- @property --_badge-rounded {
149
+ @property --_badge-radius {
150
150
  syntax: "*";
151
151
  inherits: false;
152
152
  }
@@ -204,7 +204,11 @@
204
204
  --_border-color-resolved,
205
205
  var(--_badge-border-color, var(--ui-badge-border-color))
206
206
  );
207
- border-radius: var(--_rounded-resolved, var(--_badge-rounded, var(--ui-badge-rounded)));
207
+ --_radius-len: var(--_radius-resolved, var(--_badge-radius, var(--ui-badge-radius)));
208
+ --_radius-num: var(--_radius-resolved, var(--_badge-radius, var(--ui-badge-radius)));
209
+ border-radius: calc(
210
+ var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
211
+ );
208
212
 
209
213
  color: var(--_text-resolved, var(--_badge-text, var(--ui-badge-text)));
210
214
  background-color: var(--_bg-resolved, var(--_badge-bg, var(--ui-badge-bg)));
@@ -313,8 +317,8 @@
313
317
 
314
318
  :where([data-ui~="badge"][data-badge-variant="primary"]) {
315
319
  --_badge-bg: var(--color-primary);
316
- --_badge-bg--hover: oklch(from var(--color-primary) l c h / 0.9);
317
- --_badge-bg--active: oklch(from var(--color-primary) l c h / 0.8);
320
+ --_badge-bg--hover: oklch(from var(--color-primary) l c h / 0.8);
321
+ --_badge-bg--active: oklch(from var(--color-primary) l c h / 0.7);
318
322
 
319
323
  --_badge-text: var(--color-primary-foreground);
320
324
  --_badge-text--hover: var(--color-primary-foreground);
@@ -327,8 +331,8 @@
327
331
 
328
332
  :where([data-ui~="badge"][data-badge-variant="secondary"]) {
329
333
  --_badge-bg: var(--color-secondary);
330
- --_badge-bg--hover: oklch(from var(--color-secondary) l c h / 0.9);
331
- --_badge-bg--active: oklch(from var(--color-secondary) l c h / 0.8);
334
+ --_badge-bg--hover: oklch(from var(--color-secondary) l c h / 0.8);
335
+ --_badge-bg--active: oklch(from var(--color-secondary) l c h / 0.7);
332
336
 
333
337
  --_badge-text: var(--color-secondary-foreground);
334
338
  --_badge-text--hover: var(--color-secondary-foreground);
@@ -341,8 +345,8 @@
341
345
 
342
346
  :where([data-ui~="badge"][data-badge-variant="tertiary"]) {
343
347
  --_badge-bg: var(--color-tertiary);
344
- --_badge-bg--hover: oklch(from var(--color-tertiary) l c h / 0.9);
345
- --_badge-bg--active: oklch(from var(--color-tertiary) l c h / 0.8);
348
+ --_badge-bg--hover: oklch(from var(--color-tertiary) l c h / 0.8);
349
+ --_badge-bg--active: oklch(from var(--color-tertiary) l c h / 0.7);
346
350
 
347
351
  --_badge-text: var(--color-tertiary-foreground);
348
352
  --_badge-text--hover: var(--color-tertiary-foreground);
@@ -468,7 +472,7 @@
468
472
  --_badge-border-style: none;
469
473
 
470
474
  --_badge-px: 0;
471
- --_badge-rounded: 0;
475
+ --_badge-radius: 0;
472
476
 
473
477
  --_badge-shadow: 0 0 transparent;
474
478
  }