@zazz-ui/core 0.2.0 → 0.4.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.
- package/CHANGELOG.md +55 -2
- package/README.md +4 -2
- package/dist/sri.json +25 -25
- package/dist/zazz.css +1 -1
- package/dist/zazz.js +1 -1
- package/examples/about.html +5 -12
- package/examples/components.html +4 -16
- package/examples/forms.html +3 -10
- package/examples/index.html +3 -10
- package/examples/layout.html +3 -10
- package/examples/products.html +3 -10
- package/examples/responsive.html +3 -10
- package/package.json +1 -1
- package/src/base/_layers.css +14 -4
- package/src/base/_layout.css +5 -2
- package/src/base/_typography.css +24 -6
- package/src/base/_utilities.css +509 -391
- package/src/base/_variables.css +22 -81
- package/src/base/_view-transitions.css +1 -1
- package/src/base/typeahead.js +1 -1
- package/src/base/typeahead.ts +1 -1
- package/src/head.d.ts +11 -4
- package/src/head.d.ts.map +1 -1
- package/src/head.js +23 -24
- package/src/head.ts +23 -24
- package/src/index.css +10 -4
- package/src/manifest.d.ts +1 -1
- package/src/manifest.js +6 -6
- package/src/primitives/autocomplete/autocomplete.css +1 -1
- package/src/primitives/badge/badge.css +10 -9
- package/src/primitives/button/button.css +12 -12
- package/src/primitives/carousel/carousel.html +1 -1
- package/src/primitives/combobox/combobox.css +1 -1
- package/src/primitives/command/command.css +1 -1
- package/src/primitives/command/command.js +1 -1
- package/src/primitives/command/command.ts +1 -1
- package/src/primitives/menu/menu.js +1 -1
- package/src/primitives/menu/menu.ts +1 -1
- package/src/primitives/navigation-menu/navigation-menu.css +4 -15
- package/src/primitives/popover/popover.css +5 -3
- package/src/primitives/select/select.css +1 -1
- package/src/primitives/toaster/toaster.css +1 -1
- package/src/primitives/toaster/toaster.js +2 -2
- package/src/primitives/toaster/toaster.ts +2 -2
- package/src/primitives/tooltip/tooltip-disabled.html +1 -6
- package/src/primitives/tooltip/tooltip-sides.html +3 -22
- package/src/primitives/tooltip/tooltip-with-kbd.html +1 -6
- package/src/primitives/tooltip/tooltip.css +1 -1
- package/src/primitives/tooltip/tooltip.html +1 -6
|
@@ -146,7 +146,7 @@ class UiCommand extends TypeaheadElement {
|
|
|
146
146
|
if (!panel) return;
|
|
147
147
|
if (panel instanceof HTMLDialogElement) {
|
|
148
148
|
if (panel.open) panel.close();
|
|
149
|
-
} else if (panel.matches(":popover-open
|
|
149
|
+
} else if (panel.matches(":popover-open")) {
|
|
150
150
|
panel.hidePopover();
|
|
151
151
|
}
|
|
152
152
|
}
|
|
@@ -78,7 +78,7 @@ class UiMenu extends ZazzElement {
|
|
|
78
78
|
return;
|
|
79
79
|
const isTrigger = target.parentElement === this &&
|
|
80
80
|
(target.hasAttribute("popovertarget") || target.hasAttribute("interestfor"));
|
|
81
|
-
const open = panel.matches(":popover-open
|
|
81
|
+
const open = panel.matches(":popover-open");
|
|
82
82
|
if (isTrigger && !open && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
83
83
|
event.preventDefault();
|
|
84
84
|
panel.showPopover();
|
|
@@ -87,7 +87,7 @@ class UiMenu extends ZazzElement {
|
|
|
87
87
|
const isTrigger =
|
|
88
88
|
target.parentElement === this &&
|
|
89
89
|
(target.hasAttribute("popovertarget") || target.hasAttribute("interestfor"));
|
|
90
|
-
const open = panel.matches(":popover-open
|
|
90
|
+
const open = panel.matches(":popover-open");
|
|
91
91
|
|
|
92
92
|
if (isTrigger && !open && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
93
93
|
event.preventDefault();
|
|
@@ -80,9 +80,7 @@
|
|
|
80
80
|
transition: var(--ui-navigation-menu-icon-transition);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
[data-slot~="navigation-menu-item"]:has(
|
|
84
|
-
[data-slot~="navigation-menu-popover"]:where(:popover-open, .\:popover-open)
|
|
85
|
-
)
|
|
83
|
+
[data-slot~="navigation-menu-item"]:has([data-slot~="navigation-menu-popover"]:popover-open)
|
|
86
84
|
[data-slot~="navigation-menu-trigger"]
|
|
87
85
|
> svg {
|
|
88
86
|
transform: var(--ui-navigation-menu-icon-transform);
|
|
@@ -158,10 +156,7 @@
|
|
|
158
156
|
/* Highlight the row on hover and while its submenu is open */
|
|
159
157
|
[data-slot~="navigation-menu-submenu-trigger"]:hover,
|
|
160
158
|
[data-slot~="navigation-menu-submenu"]:has(
|
|
161
|
-
[data-slot~="navigation-menu-popover"][data-variant="submenu"]:
|
|
162
|
-
:popover-open,
|
|
163
|
-
.\:popover-open
|
|
164
|
-
)
|
|
159
|
+
[data-slot~="navigation-menu-popover"][data-variant="submenu"]:popover-open
|
|
165
160
|
)
|
|
166
161
|
[data-slot~="navigation-menu-submenu-trigger"] {
|
|
167
162
|
background-color: var(--muted);
|
|
@@ -237,10 +232,7 @@
|
|
|
237
232
|
padding var(--default-transition-duration) var(--default-transition-timing-function);
|
|
238
233
|
}
|
|
239
234
|
|
|
240
|
-
[data-slot~="navigation-menu-popover"][data-animation="slide-down"]:
|
|
241
|
-
:popover-open,
|
|
242
|
-
.\:popover-open
|
|
243
|
-
) {
|
|
235
|
+
[data-slot~="navigation-menu-popover"][data-animation="slide-down"]:popover-open {
|
|
244
236
|
opacity: var(--ui-popover-opacity--end);
|
|
245
237
|
transform: scale(var(--ui-popover-scale--end)) translate3d(var(--ui-popover-translate--end));
|
|
246
238
|
|
|
@@ -251,10 +243,7 @@
|
|
|
251
243
|
}
|
|
252
244
|
}
|
|
253
245
|
|
|
254
|
-
[data-slot~="navigation-menu-popover"][data-animation="slide-down"]:
|
|
255
|
-
:popover-open,
|
|
256
|
-
.\:popover-open
|
|
257
|
-
)
|
|
246
|
+
[data-slot~="navigation-menu-popover"][data-animation="slide-down"]:popover-open
|
|
258
247
|
[data-slot~="navigation-menu-viewport"] {
|
|
259
248
|
block-size: auto;
|
|
260
249
|
transform: scale(1) translateY(0);
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* @layer variables, reset, components
|
|
5
5
|
* @requires layers.css, _variables.css (--popover, --popover-foreground)
|
|
6
6
|
* @uses [popover], popovertarget, :popover-open: Popover API
|
|
7
|
-
* (
|
|
7
|
+
* (native across the support floor — Chrome 114, Firefox 125,
|
|
8
|
+
* Safari 17, iOS 18.3; no polyfill, see ADR-0011)
|
|
8
9
|
* @uses @starting-style + allow-discrete: enter/exit opacity/transform
|
|
9
10
|
* @uses anchor-name, position-anchor, position-area, position-try-fallbacks:
|
|
10
11
|
* anchor positioning (gated behind @supports; Firefox/Safari fall
|
|
@@ -91,8 +92,9 @@
|
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
/*
|
|
95
|
-
|
|
95
|
+
/* Only display is gated: closed popovers keep the UA's display: none, and
|
|
96
|
+
allow-discrete animates the switch */
|
|
97
|
+
[popover]:popover-open {
|
|
96
98
|
display: grid;
|
|
97
99
|
align-content: start;
|
|
98
100
|
opacity: var(--ui-popover-opacity--end);
|
|
@@ -409,7 +409,7 @@
|
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
/* Only display is gated; see popover.css: closed popovers stay display: none */
|
|
412
|
-
[data-slot~="multiselect-panel"]:
|
|
412
|
+
[data-slot~="multiselect-panel"]:popover-open {
|
|
413
413
|
display: flex;
|
|
414
414
|
}
|
|
415
415
|
|
|
@@ -567,7 +567,7 @@ class UiToaster extends ZazzElement {
|
|
|
567
567
|
*/
|
|
568
568
|
#showRegion() {
|
|
569
569
|
try {
|
|
570
|
-
if (!this.matches(":popover-open
|
|
570
|
+
if (!this.matches(":popover-open"))
|
|
571
571
|
this.showPopover();
|
|
572
572
|
}
|
|
573
573
|
catch {
|
|
@@ -580,7 +580,7 @@ class UiToaster extends ZazzElement {
|
|
|
580
580
|
*/
|
|
581
581
|
#hideRegion() {
|
|
582
582
|
try {
|
|
583
|
-
if (this.matches(":popover-open
|
|
583
|
+
if (this.matches(":popover-open"))
|
|
584
584
|
this.hidePopover();
|
|
585
585
|
}
|
|
586
586
|
catch {
|
|
@@ -642,7 +642,7 @@ class UiToaster extends ZazzElement {
|
|
|
642
642
|
*/
|
|
643
643
|
#showRegion(): void {
|
|
644
644
|
try {
|
|
645
|
-
if (!this.matches(":popover-open
|
|
645
|
+
if (!this.matches(":popover-open")) this.showPopover();
|
|
646
646
|
} catch {
|
|
647
647
|
// Older engines without the Popover API: the region stays a fixed-position
|
|
648
648
|
// element, which still renders (just not on the top layer).
|
|
@@ -654,7 +654,7 @@ class UiToaster extends ZazzElement {
|
|
|
654
654
|
*/
|
|
655
655
|
#hideRegion(): void {
|
|
656
656
|
try {
|
|
657
|
-
if (this.matches(":popover-open
|
|
657
|
+
if (this.matches(":popover-open")) this.hidePopover();
|
|
658
658
|
} catch {
|
|
659
659
|
// See #showRegion.
|
|
660
660
|
}
|
|
@@ -7,12 +7,7 @@
|
|
|
7
7
|
>
|
|
8
8
|
Disabled
|
|
9
9
|
</button>
|
|
10
|
-
<div
|
|
11
|
-
data-slot="tooltip-content"
|
|
12
|
-
id="tooltip-example-disabled-1"
|
|
13
|
-
popover="hint"
|
|
14
|
-
data-use-inverted-menu="false"
|
|
15
|
-
>
|
|
10
|
+
<div data-slot="tooltip-content" id="tooltip-example-disabled-1" popover="hint">
|
|
16
11
|
This action is unavailable
|
|
17
12
|
<span data-slot="tooltip-arrow" aria-hidden="true"></span>
|
|
18
13
|
</div>
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
<div class="flex flex-wrap items-center gap-md">
|
|
2
2
|
<ui-tooltip>
|
|
3
3
|
<button type="button" class="ui-button" interestfor="tooltip-example-left-1">Left</button>
|
|
4
|
-
<div
|
|
5
|
-
data-slot="tooltip-content"
|
|
6
|
-
id="tooltip-example-left-1"
|
|
7
|
-
popover="hint"
|
|
8
|
-
data-side="left"
|
|
9
|
-
data-use-inverted-menu="false"
|
|
10
|
-
>
|
|
4
|
+
<div data-slot="tooltip-content" id="tooltip-example-left-1" popover="hint" data-side="left">
|
|
11
5
|
Tooltip on left
|
|
12
6
|
<span data-slot="tooltip-arrow" aria-hidden="true"></span>
|
|
13
7
|
</div>
|
|
@@ -15,13 +9,7 @@
|
|
|
15
9
|
|
|
16
10
|
<ui-tooltip>
|
|
17
11
|
<button type="button" class="ui-button" interestfor="tooltip-example-top-1">Top</button>
|
|
18
|
-
<div
|
|
19
|
-
data-slot="tooltip-content"
|
|
20
|
-
id="tooltip-example-top-1"
|
|
21
|
-
popover="hint"
|
|
22
|
-
data-side="top"
|
|
23
|
-
data-use-inverted-menu="false"
|
|
24
|
-
>
|
|
12
|
+
<div data-slot="tooltip-content" id="tooltip-example-top-1" popover="hint" data-side="top">
|
|
25
13
|
Tooltip on top
|
|
26
14
|
<span data-slot="tooltip-arrow" aria-hidden="true"></span>
|
|
27
15
|
</div>
|
|
@@ -34,7 +22,6 @@
|
|
|
34
22
|
id="tooltip-example-bottom-1"
|
|
35
23
|
popover="hint"
|
|
36
24
|
data-side="bottom"
|
|
37
|
-
data-use-inverted-menu="false"
|
|
38
25
|
>
|
|
39
26
|
Tooltip on bottom
|
|
40
27
|
<span data-slot="tooltip-arrow" aria-hidden="true"></span>
|
|
@@ -43,13 +30,7 @@
|
|
|
43
30
|
|
|
44
31
|
<ui-tooltip>
|
|
45
32
|
<button type="button" class="ui-button" interestfor="tooltip-example-right-1">Right</button>
|
|
46
|
-
<div
|
|
47
|
-
data-slot="tooltip-content"
|
|
48
|
-
id="tooltip-example-right-1"
|
|
49
|
-
popover="hint"
|
|
50
|
-
data-side="right"
|
|
51
|
-
data-use-inverted-menu="false"
|
|
52
|
-
>
|
|
33
|
+
<div data-slot="tooltip-content" id="tooltip-example-right-1" popover="hint" data-side="right">
|
|
53
34
|
Tooltip on right
|
|
54
35
|
<span data-slot="tooltip-arrow" aria-hidden="true"></span>
|
|
55
36
|
</div>
|
|
@@ -15,12 +15,7 @@
|
|
|
15
15
|
/>
|
|
16
16
|
</svg>
|
|
17
17
|
</button>
|
|
18
|
-
<div
|
|
19
|
-
data-slot="tooltip-content"
|
|
20
|
-
id="tooltip-example-save-1"
|
|
21
|
-
popover="hint"
|
|
22
|
-
data-use-inverted-menu="false"
|
|
23
|
-
>
|
|
18
|
+
<div data-slot="tooltip-content" id="tooltip-example-save-1" popover="hint">
|
|
24
19
|
Save
|
|
25
20
|
<ui-kbd-group>
|
|
26
21
|
<kbd>⌘</kbd>
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
[data-slot~="tooltip-content"]:
|
|
93
|
+
[data-slot~="tooltip-content"]:popover-open {
|
|
94
94
|
display: flex;
|
|
95
95
|
opacity: var(--ui-tooltip-opacity--end);
|
|
96
96
|
transform: scale(var(--ui-tooltip-scale--end)) translate3d(var(--ui-tooltip-translate--end));
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
<ui-tooltip>
|
|
2
2
|
<button type="button" class="ui-button" interestfor="tooltip-example-default-1">Hover</button>
|
|
3
|
-
<div
|
|
4
|
-
data-slot="tooltip-content"
|
|
5
|
-
id="tooltip-example-default-1"
|
|
6
|
-
popover="hint"
|
|
7
|
-
data-use-inverted-menu="false"
|
|
8
|
-
>
|
|
3
|
+
<div data-slot="tooltip-content" id="tooltip-example-default-1" popover="hint">
|
|
9
4
|
Add to library
|
|
10
5
|
<span data-slot="tooltip-arrow" aria-hidden="true"></span>
|
|
11
6
|
</div>
|