@zazz-ui/core 0.8.1 → 0.8.3
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.
- package/CHANGELOG.md +34 -0
- package/README.md +2 -2
- package/dist/sri.json +47 -47
- package/dist/zazz.css +1 -1
- package/dist/zazz.js +1 -1
- package/editor/zazz.css-data.json +1964 -592
- package/editor/zazz.language-data.json +24 -16
- package/editor/zazz.lint-data.json +588 -567
- package/package.json +1 -1
- package/src/base/_defaults.css +5 -0
- package/src/base/_properties-2xl.css +4 -0
- package/src/base/_properties-active.css +12 -0
- package/src/base/_properties-checked.css +12 -0
- package/src/base/_properties-current.css +12 -0
- package/src/base/_properties-disabled.css +12 -0
- package/src/base/_properties-focus-visible.css +12 -0
- package/src/base/_properties-focus-within.css +12 -0
- package/src/base/_properties-hover.css +12 -0
- package/src/base/_properties-lg.css +4 -0
- package/src/base/_properties-md.css +4 -0
- package/src/base/_properties-open.css +12 -0
- package/src/base/_properties-sm.css +4 -0
- package/src/base/_properties-starting.css +6 -0
- package/src/base/_properties-stuck.css +6 -0
- package/src/base/_properties-xl.css +4 -0
- package/src/base/_properties.css +16 -0
- package/src/base/_shadows.css +17 -17
- package/src/base/_utilities-box.css +2 -2
- package/src/base/_utilities-spacing.css +42 -0
- package/src/base/_utilities-tier-2xl.css +2 -0
- package/src/base/_utilities-tier-active.css +6 -0
- package/src/base/_utilities-tier-checked.css +6 -0
- package/src/base/_utilities-tier-current.css +6 -0
- package/src/base/_utilities-tier-disabled.css +6 -0
- package/src/base/_utilities-tier-focus-visible.css +6 -0
- package/src/base/_utilities-tier-focus-within.css +6 -0
- package/src/base/_utilities-tier-hover.css +6 -0
- package/src/base/_utilities-tier-lg.css +2 -0
- package/src/base/_utilities-tier-md.css +2 -0
- package/src/base/_utilities-tier-open.css +6 -0
- package/src/base/_utilities-tier-sm.css +2 -0
- package/src/base/_utilities-tier-starting.css +3 -0
- package/src/base/_utilities-tier-stuck.css +3 -0
- package/src/base/_utilities-tier-xl.css +2 -0
- package/src/base/_variables.css +2 -2
- package/src/base/embla.d.ts.map +1 -1
- package/src/base/embla.js +48 -5
- package/src/base/embla.ts +63 -5
- package/src/base/kit-styling.d.ts.map +1 -1
- package/src/base/kit-styling.js +118 -116
- package/src/base/kit-styling.ts +118 -116
- package/src/base/utilities.d.ts +5 -2
- package/src/base/utilities.d.ts.map +1 -1
- package/src/base/utilities.js +35 -2
- package/src/base/utilities.ts +49 -4
- package/src/manifest.d.ts.map +1 -1
- package/src/manifest.js +1 -0
- package/src/manifest.ts +1 -0
- package/src/primitives/carousel/carousel.css +8 -7
- package/src/primitives/dialog/dialog.css +54 -0
- package/src/primitives/input/input.css +22 -0
- package/src/primitives/popover/popover.css +2 -2
- package/src/primitives/switch/switch.css +2 -2
- package/src/primitives/utilities/space.html +17 -0
|
@@ -5,12 +5,17 @@
|
|
|
5
5
|
* @layer variables, reset, components
|
|
6
6
|
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved)
|
|
7
7
|
* @uses <dialog>, ::backdrop — native modal + backdrop
|
|
8
|
+
* @uses :root:has(dialog:modal) — overflow: hidden + scrollbar-gutter: stable while a modal
|
|
9
|
+
* is open (WebKit ignores overscroll-behavior on boxes that do not overflow)
|
|
8
10
|
* @uses @starting-style + allow-discrete — open/close opacity, transform, overlay
|
|
9
11
|
* @uses anchor-name, container-type — layout hooks for sized variants
|
|
10
12
|
* @tokens --ui-dialog-* (@layer variables; --ui-dialog-h defaults to a keyword, so it is read
|
|
11
13
|
* raw: a --h length, or a tier carrying a length, applies; a scale
|
|
12
14
|
* number applies only as a base utility)
|
|
13
15
|
* @presets data-dialog-size="sm | md | lg | xl | 2xl | full | bleed" (the layout bands; sm when absent)
|
|
16
|
+
* @uses @media (width < 40rem) + @container style(--ui-dialog-mobile-size) — below the sm
|
|
17
|
+
* band every dialog takes the hook's size (layout-bleed by default) over its preset;
|
|
18
|
+
* style queries are Firefox 151+, Chrome 111+, Safari 18+, an older engine keeps the preset
|
|
14
19
|
* @consumedby alert-dialog.css, mobile-menu.css
|
|
15
20
|
*/
|
|
16
21
|
|
|
@@ -26,6 +31,9 @@
|
|
|
26
31
|
--ui-dialog-border: 1px solid var(--color-border);
|
|
27
32
|
/* the sm band, the default size */
|
|
28
33
|
--ui-dialog-w: min(var(--layout-sm), 100% - var(--gutters) * 2);
|
|
34
|
+
/* below the sm band, the size every dialog takes: layout-bleed (edge to edge, no page
|
|
35
|
+
behind it), layout-full (inside the gutters), or none (its own preset) */
|
|
36
|
+
--ui-dialog-mobile-size: layout-bleed;
|
|
29
37
|
|
|
30
38
|
/* Reveal transitions/animations */
|
|
31
39
|
--ui-dialog-opacity--start: 0;
|
|
@@ -114,6 +122,16 @@
|
|
|
114
122
|
opacity: 0;
|
|
115
123
|
}
|
|
116
124
|
}
|
|
125
|
+
|
|
126
|
+
/* Chromium and Firefox contain page scroll through overscroll-behavior above; WebKit
|
|
127
|
+
ignores it on a box that does not overflow (the backdrop, a short dialog), so the root
|
|
128
|
+
locks while a modal is open. The gutter stays the width of the scrollbar it replaces,
|
|
129
|
+
so neither the page nor the centred dialog shifts on open or on close; the scroll
|
|
130
|
+
position survives. At rest no gutter is reserved. */
|
|
131
|
+
:root:has(dialog:modal) {
|
|
132
|
+
overflow: hidden;
|
|
133
|
+
scrollbar-gutter: stable;
|
|
134
|
+
}
|
|
117
135
|
}
|
|
118
136
|
|
|
119
137
|
/* Size privates: written by data-dialog-size, non-inheriting. */
|
|
@@ -164,7 +182,10 @@
|
|
|
164
182
|
isolation: isolate;
|
|
165
183
|
}
|
|
166
184
|
|
|
185
|
+
/* A one-row grid, so the content slot is capped by the dialog's height rather than
|
|
186
|
+
sizing it (display went missing with the --ui-dialog-display token in 0.2). */
|
|
167
187
|
:where([data-ui~="dialog"][open]) {
|
|
188
|
+
display: grid;
|
|
168
189
|
grid-template-rows: minmax(0, 1fr);
|
|
169
190
|
min-block-size: 0;
|
|
170
191
|
}
|
|
@@ -186,16 +207,22 @@
|
|
|
186
207
|
padding: 0;
|
|
187
208
|
}
|
|
188
209
|
|
|
210
|
+
/* Each slot owns a row, whatever the order and whichever are present: a body on its
|
|
211
|
+
own still takes the flexible row, so it is the part that scrolls, never the dialog,
|
|
212
|
+
and the close button keeps its corner. */
|
|
189
213
|
:where([data-ui~="dialog"]) [data-dialog-slot~="content"] {
|
|
190
214
|
display: grid;
|
|
191
215
|
align-self: center;
|
|
192
216
|
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
193
217
|
position: relative;
|
|
194
218
|
min-block-size: 0;
|
|
219
|
+
/* a centred grid item sizes to its content; the cap is what hands the body its scroll */
|
|
220
|
+
max-block-size: 100%;
|
|
195
221
|
overflow: clip;
|
|
196
222
|
}
|
|
197
223
|
|
|
198
224
|
:where([data-ui~="dialog"]) [data-dialog-slot~="header"] {
|
|
225
|
+
grid-row: 1;
|
|
199
226
|
display: flex;
|
|
200
227
|
flex-direction: column;
|
|
201
228
|
padding-inline: var(--space-sm);
|
|
@@ -213,6 +240,7 @@
|
|
|
213
240
|
}
|
|
214
241
|
|
|
215
242
|
:where([data-ui~="dialog"]) [data-dialog-slot~="body"] {
|
|
243
|
+
grid-row: 2;
|
|
216
244
|
display: grid;
|
|
217
245
|
padding-inline: var(--space-sm);
|
|
218
246
|
padding-block: var(--space-md);
|
|
@@ -224,6 +252,7 @@
|
|
|
224
252
|
}
|
|
225
253
|
|
|
226
254
|
:where([data-ui~="dialog"]) [data-dialog-slot~="footer"] {
|
|
255
|
+
grid-row: 3;
|
|
227
256
|
block-size: fit-content;
|
|
228
257
|
position: sticky;
|
|
229
258
|
inset-block-end: 0;
|
|
@@ -271,4 +300,29 @@
|
|
|
271
300
|
max-inline-size: 100vi;
|
|
272
301
|
max-block-size: 100svh;
|
|
273
302
|
}
|
|
303
|
+
|
|
304
|
+
/* Below the sm band the viewport is a phone, and every dialog takes --ui-dialog-mobile-size
|
|
305
|
+
over its preset: layout-bleed by default, so there is no page to see behind it. A style
|
|
306
|
+
query reads the hook on the dialog's parent, never on the dialog itself: set it on :root
|
|
307
|
+
for the site, or on one dialog's parent for that dialog alone. A viewport query, not a
|
|
308
|
+
container one, because a top-layer dialog is sized by the viewport. Style queries are
|
|
309
|
+
Firefox 151+; an older engine keeps the preset. */
|
|
310
|
+
@media (width < 40rem) {
|
|
311
|
+
@container style(--ui-dialog-mobile-size: layout-bleed) {
|
|
312
|
+
:where([data-ui~="dialog"]) {
|
|
313
|
+
--_dialog-w: 100vi;
|
|
314
|
+
--_dialog-h: 100svh;
|
|
315
|
+
--_dialog-radius: 0;
|
|
316
|
+
--_dialog-shadow: none;
|
|
317
|
+
max-inline-size: 100vi;
|
|
318
|
+
max-block-size: 100svh;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
@container style(--ui-dialog-mobile-size: layout-full) {
|
|
323
|
+
:where([data-ui~="dialog"]) {
|
|
324
|
+
--_dialog-w: calc(100% - var(--gutters) * 2);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
274
328
|
}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-shadow), fields.css, _reset.css
|
|
6
6
|
* @uses ::-webkit-calendar-picker-indicator — date/time picker chrome (WebKit)
|
|
7
7
|
* @uses mask — calendar icon (not background-image, for color: currentColor)
|
|
8
|
+
* @uses @supports (-webkit-touch-callout: none) — iOS-only width fix for temporal
|
|
9
|
+
* inputs (webkit.org/b/301648)
|
|
8
10
|
* @tokens --ui-input-* (@layer variables; surface colors and height read the
|
|
9
11
|
* --ui-field-* family directly)
|
|
10
12
|
*/
|
|
@@ -115,6 +117,26 @@
|
|
|
115
117
|
--ui-input-pr: calc(var(--spacing) * 1.5);
|
|
116
118
|
}
|
|
117
119
|
|
|
120
|
+
/* iOS WebKit adds a temporal input's padding and border on top of its inline size,
|
|
121
|
+
whatever box-sizing says (webkit.org/b/301648), so a full-width field overflows;
|
|
122
|
+
-webkit-touch-callout is iOS-only, so the correction lands there alone */
|
|
123
|
+
@supports (-webkit-touch-callout: none) {
|
|
124
|
+
:where([data-ui~="input"]):is(
|
|
125
|
+
[type="date"],
|
|
126
|
+
[type="time"],
|
|
127
|
+
[type="datetime-local"],
|
|
128
|
+
[type="month"],
|
|
129
|
+
[type="week"]
|
|
130
|
+
) {
|
|
131
|
+
inline-size: calc(
|
|
132
|
+
var(--_w-len) + var(--_w-num) * var(--spacing) -
|
|
133
|
+
(var(--_pl-len) + var(--_pl-num) * var(--spacing)) -
|
|
134
|
+
(var(--_pr-len) + var(--_pr-num) * var(--spacing)) - 2 *
|
|
135
|
+
var(--_border-width-resolved, var(--ui-input-border-width))
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
118
140
|
/* Native date/time controls keep their picker indicator tinted to the text */
|
|
119
141
|
:where([data-ui~="input"])::-webkit-calendar-picker-indicator {
|
|
120
142
|
cursor: pointer;
|
|
@@ -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-
|
|
24
|
-
--ui-switch-track-bg--hover: oklch(from var(--color-
|
|
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,17 @@
|
|
|
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
|
+
--space-x: 2;
|
|
10
|
+
--space-x--md: 4;
|
|
11
|
+
"
|
|
12
|
+
>
|
|
13
|
+
<button type="button" data-ui="button">Save</button>
|
|
14
|
+
<button type="button" data-ui="button" data-button-variant="outline">Cancel</button>
|
|
15
|
+
<button type="button" data-ui="button" data-button-variant="ghost">Help</button>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|