@zazz-ui/core 0.8.2 → 0.8.4

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 (65) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +2 -2
  3. package/dist/sri.json +48 -48
  4. package/dist/zazz.css +1 -1
  5. package/dist/zazz.js +1 -1
  6. package/editor/zazz.css-data.json +1968 -592
  7. package/editor/zazz.language-data.json +26 -17
  8. package/editor/zazz.lint-data.json +10 -0
  9. package/package.json +1 -1
  10. package/src/base/_defaults.css +5 -0
  11. package/src/base/_properties-2xl.css +4 -0
  12. package/src/base/_properties-active.css +12 -0
  13. package/src/base/_properties-checked.css +12 -0
  14. package/src/base/_properties-current.css +12 -0
  15. package/src/base/_properties-disabled.css +12 -0
  16. package/src/base/_properties-focus-visible.css +12 -0
  17. package/src/base/_properties-focus-within.css +12 -0
  18. package/src/base/_properties-hover.css +12 -0
  19. package/src/base/_properties-lg.css +4 -0
  20. package/src/base/_properties-md.css +4 -0
  21. package/src/base/_properties-open.css +12 -0
  22. package/src/base/_properties-sm.css +4 -0
  23. package/src/base/_properties-starting.css +6 -0
  24. package/src/base/_properties-stuck.css +6 -0
  25. package/src/base/_properties-xl.css +4 -0
  26. package/src/base/_properties.css +16 -0
  27. package/src/base/_shadows.css +17 -17
  28. package/src/base/_utilities-box.css +2 -2
  29. package/src/base/_utilities-spacing.css +42 -0
  30. package/src/base/_utilities-tier-2xl.css +2 -0
  31. package/src/base/_utilities-tier-active.css +6 -0
  32. package/src/base/_utilities-tier-checked.css +6 -0
  33. package/src/base/_utilities-tier-current.css +6 -0
  34. package/src/base/_utilities-tier-disabled.css +6 -0
  35. package/src/base/_utilities-tier-focus-visible.css +6 -0
  36. package/src/base/_utilities-tier-focus-within.css +6 -0
  37. package/src/base/_utilities-tier-hover.css +6 -0
  38. package/src/base/_utilities-tier-lg.css +2 -0
  39. package/src/base/_utilities-tier-md.css +2 -0
  40. package/src/base/_utilities-tier-open.css +6 -0
  41. package/src/base/_utilities-tier-sm.css +2 -0
  42. package/src/base/_utilities-tier-starting.css +3 -0
  43. package/src/base/_utilities-tier-stuck.css +3 -0
  44. package/src/base/_utilities-tier-xl.css +2 -0
  45. package/src/base/_variables.css +2 -2
  46. package/src/base/embla.d.ts.map +1 -1
  47. package/src/base/embla.js +48 -5
  48. package/src/base/embla.ts +63 -5
  49. package/src/base/kit-styling.d.ts.map +1 -1
  50. package/src/base/kit-styling.js +1 -0
  51. package/src/base/kit-styling.ts +1 -0
  52. package/src/base/utilities.d.ts +5 -2
  53. package/src/base/utilities.d.ts.map +1 -1
  54. package/src/base/utilities.js +35 -2
  55. package/src/base/utilities.ts +49 -4
  56. package/src/manifest.d.ts.map +1 -1
  57. package/src/manifest.js +1 -0
  58. package/src/manifest.ts +1 -0
  59. package/src/primitives/badge/badge.css +69 -27
  60. package/src/primitives/button/button.css +67 -25
  61. package/src/primitives/callout/callout.css +9 -9
  62. package/src/primitives/carousel/carousel.css +8 -7
  63. package/src/primitives/popover/popover.css +2 -2
  64. package/src/primitives/switch/switch.css +2 -2
  65. package/src/primitives/utilities/space.html +18 -0
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @layer variables, components
5
5
  * @requires _layers.css, _variables.css, _properties.css (--_*-resolved)
6
- * @uses oklch(from …): status tints
6
+ * @uses color-mix(), oklch(from …): status tints
7
7
  * @tokens --ui-callout-* (@layer variables; named after the utilities they back)
8
8
  * @see badge.css (status tint and border formulas; the test keeps them in sync)
9
9
  * @presets data-callout-variant="muted" | "info" | "success" | "warning" | "destructive"
@@ -95,8 +95,8 @@
95
95
 
96
96
  :where([data-ui~="callout"][data-callout-variant="info"]) {
97
97
  --_callout-bg: light-dark(
98
- oklch(from var(--color-info) l c h / 0.1),
99
- oklch(from var(--color-info) l c h / 0.2)
98
+ color-mix(in srgb, var(--color-info) 10%, var(--color-background)),
99
+ color-mix(in srgb, var(--color-info) 20%, var(--color-background))
100
100
  );
101
101
  --_callout-text: light-dark(
102
102
  oklch(from var(--color-info) min(l, 0.45) c h),
@@ -107,8 +107,8 @@
107
107
 
108
108
  :where([data-ui~="callout"][data-callout-variant="success"]) {
109
109
  --_callout-bg: light-dark(
110
- oklch(from var(--color-success) l c h / 0.1),
111
- oklch(from var(--color-success) l c h / 0.2)
110
+ color-mix(in srgb, var(--color-success) 10%, var(--color-background)),
111
+ color-mix(in srgb, var(--color-success) 20%, var(--color-background))
112
112
  );
113
113
  --_callout-text: light-dark(
114
114
  oklch(from var(--color-success) min(l, 0.45) c h),
@@ -119,8 +119,8 @@
119
119
 
120
120
  :where([data-ui~="callout"][data-callout-variant="warning"]) {
121
121
  --_callout-bg: light-dark(
122
- oklch(from var(--color-warning) l c h / 0.1),
123
- oklch(from var(--color-warning) l c h / 0.2)
122
+ color-mix(in srgb, var(--color-warning) 10%, var(--color-background)),
123
+ color-mix(in srgb, var(--color-warning) 20%, var(--color-background))
124
124
  );
125
125
  --_callout-text: light-dark(
126
126
  oklch(from var(--color-warning) min(l, 0.45) c h),
@@ -131,8 +131,8 @@
131
131
 
132
132
  :where([data-ui~="callout"][data-callout-variant="destructive"]) {
133
133
  --_callout-bg: light-dark(
134
- oklch(from var(--color-destructive) l c h / 0.1),
135
- oklch(from var(--color-destructive) l c h / 0.2)
134
+ color-mix(in srgb, var(--color-destructive) 10%, var(--color-background)),
135
+ color-mix(in srgb, var(--color-destructive) 20%, var(--color-background))
136
136
  );
137
137
  --_callout-text: light-dark(
138
138
  oklch(from var(--color-destructive) min(l, 0.45) c h),
@@ -4,6 +4,7 @@
4
4
  * @layer variables, components
5
5
  * @requires _layers.css, _variables.css
6
6
  * @uses data-carousel attributes — layout hooks only; behaviour from zazz/scripts/embla.js
7
+ * @uses data-ui-dragging on :root — written by embla.js while a slide drags; the grabbing cursor page-wide
7
8
  * @uses container-type on viewport — basis-* / @sm:basis-* utils query [data-carousel-slot~="viewport"] width
8
9
  * @tokens --ui-carousel-* (@layer variables)
9
10
  * @consumedby lightbox.css
@@ -26,13 +27,13 @@
26
27
  display: block;
27
28
  }
28
29
 
29
- :is(
30
- body:has(
31
- :where(ui-carousel, [data-ui~="carousel"])
32
- [data-carousel-slot~="viewport"][data-carousel-state~="dragging"]
33
- )
34
- *
35
- ) {
30
+ /* The grabbing cursor holds page-wide while a slide drags, since the pointer
31
+ leaves the viewport mid-drag. embla.js flags the root; a `body:has(…) *`
32
+ rule here made every DOM insertion restyle the whole page. */
33
+ :where(ui-carousel, [data-ui~="carousel"])
34
+ [data-carousel-slot~="viewport"][data-carousel-state~="dragging"],
35
+ :root[data-ui-dragging],
36
+ :root[data-ui-dragging] * {
36
37
  cursor: var(--ui-carousel-cursor--grabbing);
37
38
  }
38
39
 
@@ -115,7 +115,7 @@
115
115
  POPOVER SURFACE — shared chrome for every [popover] consumer
116
116
  =========================================================================== */
117
117
 
118
- [popover] {
118
+ :where([popover]) {
119
119
  border: 1px solid var(--_border-color-resolved, var(--ui-popover-border-color));
120
120
  --_p-len: var(--_p-resolved, var(--ui-popover-p));
121
121
  --_p-num: var(--_p-resolved, var(--ui-popover-p));
@@ -128,7 +128,7 @@
128
128
  max-inline-size: calc(var(--_max-w-len) + var(--_max-w-num) * var(--spacing));
129
129
  }
130
130
 
131
- [popover] [data-ui~="button"] {
131
+ :where([popover] [data-ui~="button"]) {
132
132
  --ui-button-radius: var(--ui-popover-button-radius);
133
133
  }
134
134
 
@@ -20,8 +20,8 @@
20
20
  --ui-switch-thumb-shadow: var(--shadow-xs);
21
21
  --ui-switch-thumb-translate: var(--ui-switch-track-padding), -50%;
22
22
  --ui-switch-thumb-scale: 1;
23
- --ui-switch-track-bg: var(--color-muted);
24
- --ui-switch-track-bg--hover: oklch(from var(--color-muted) l c h / calc(alpha + 0.04));
23
+ --ui-switch-track-bg: var(--color-input);
24
+ --ui-switch-track-bg--hover: oklch(from var(--color-input) l c h / calc(alpha + 0.04));
25
25
  --ui-switch-track-bg--checked: var(--color-primary);
26
26
  --ui-switch-track-bg--checked-hover: var(--color-primary);
27
27
  --ui-switch-radius: var(--radius-full);
@@ -0,0 +1,18 @@
1
+ <div style="--space-y: 6">
2
+ <div style="--space-y: 2">
3
+ <p>--space-y: 2 puts a margin after each paragraph.</p>
4
+ <p>The last one gets none.</p>
5
+ <p>A child's own margin utility wins.</p>
6
+ </div>
7
+ <div
8
+ style="
9
+ --display: flex;
10
+ --space-x: 2;
11
+ --space-x--md: 4;
12
+ "
13
+ >
14
+ <button type="button" data-ui="button">Save</button>
15
+ <button type="button" data-ui="button" data-button-variant="outline">Cancel</button>
16
+ <button type="button" data-ui="button" data-button-variant="ghost">Help</button>
17
+ </div>
18
+ </div>