@zazz-ui/core 0.2.0 → 0.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.
- package/CHANGELOG.md +36 -0
- package/README.md +2 -2
- package/dist/sri.json +10 -10
- package/dist/zazz.css +1 -1
- package/examples/components.html +1 -6
- 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/index.css +10 -4
- 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/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.html +1 -6
package/src/base/_variables.css
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* _variables.css — Global design tokens (Tier 1).
|
|
3
3
|
*
|
|
4
4
|
* @layer variables
|
|
5
|
-
* @requires layers.css
|
|
6
|
-
* @uses light-dark() — theme roles
|
|
5
|
+
* @requires layers.css
|
|
6
|
+
* @uses light-dark() — theme roles re-resolve per color-scheme (system,
|
|
7
|
+
* .dark/.light, [data-theme]); tokens stay unregistered on purpose
|
|
7
8
|
* @uses oklch(from …) — shade/tint scales and shadow alphas
|
|
8
9
|
* @uses color-mix() — focus ring (--ring)
|
|
9
10
|
* @uses interpolate-size: allow-keywords — discrete block-size animations (details, etc.)
|
|
@@ -13,14 +14,6 @@
|
|
|
13
14
|
* whole system; see CONVENTIONS.md.
|
|
14
15
|
*/
|
|
15
16
|
|
|
16
|
-
/* Inverted menu */
|
|
17
|
-
|
|
18
|
-
@property --use-inverted-popovers {
|
|
19
|
-
syntax: "*";
|
|
20
|
-
inherits: false;
|
|
21
|
-
initial-value: false;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
17
|
/* Animations */
|
|
25
18
|
|
|
26
19
|
@property --default-transition-duration {
|
|
@@ -76,10 +69,11 @@
|
|
|
76
69
|
initial-value: false;
|
|
77
70
|
}
|
|
78
71
|
|
|
79
|
-
/* Token values — @property registrations
|
|
72
|
+
/* Token values — the few typed @property registrations (style() queries) live above. */
|
|
80
73
|
@layer variables {
|
|
81
74
|
:root {
|
|
82
|
-
/* Enable light/dark mode
|
|
75
|
+
/* Enable light/dark mode — theme scopes at the bottom of the file pin
|
|
76
|
+
* color-scheme; light-dark() tokens re-resolve there automatically. */
|
|
83
77
|
color-scheme: light dark;
|
|
84
78
|
|
|
85
79
|
/* Enable discrete value animations, e.g. block-size: auto; */
|
|
@@ -98,11 +92,11 @@
|
|
|
98
92
|
--card-foreground: light-dark(var(--neutral-900), var(--white));
|
|
99
93
|
--popover: light-dark(var(--white), var(--neutral-950));
|
|
100
94
|
--popover-foreground: light-dark(var(--neutral-900), var(--white));
|
|
101
|
-
--input: light-dark(var(--neutral-50), var(--tint-
|
|
95
|
+
--input: light-dark(var(--neutral-50), var(--tint-100));
|
|
102
96
|
--input-foreground: light-dark(var(--neutral-900), var(--white));
|
|
103
97
|
|
|
104
98
|
/* overlay */
|
|
105
|
-
--muted: light-dark(var(--shade-50), var(--tint-
|
|
99
|
+
--muted: light-dark(var(--shade-50), var(--tint-100));
|
|
106
100
|
--muted-foreground: light-dark(var(--shade-600), var(--tint-600));
|
|
107
101
|
--faded: light-dark(var(--tint-400), var(--shade-100));
|
|
108
102
|
--faded-foreground: light-dark(var(--tint-600), var(--shade-600));
|
|
@@ -566,7 +560,7 @@
|
|
|
566
560
|
* resolves it identically, no matter which container it reads from (the
|
|
567
561
|
* .container element is intentionally container-type: normal).
|
|
568
562
|
* Mobile-first: --is-breakpoint-X becomes true once width reaches X.
|
|
569
|
-
* Registered as typed @property (false default)
|
|
563
|
+
* Registered as typed @property (false default) at the top of this file.
|
|
570
564
|
* Literal rem required — var() is invalid in a container-query prelude.
|
|
571
565
|
* ========================================================================== */
|
|
572
566
|
@container (width >=40rem) {
|
|
@@ -607,76 +601,23 @@
|
|
|
607
601
|
}
|
|
608
602
|
|
|
609
603
|
/*
|
|
610
|
-
*
|
|
611
|
-
*
|
|
612
|
-
*
|
|
604
|
+
* Theme scopes — theme role tokens are intentionally unregistered, so their
|
|
605
|
+
* light-dark() expressions stay live in the token stream and re-resolve
|
|
606
|
+
* against each element's inherited color-scheme. Pinning color-scheme is all
|
|
607
|
+
* a scope needs; nesting works (.light inside .dark re-lightens its subtree).
|
|
608
|
+
* Built-in inherited color properties (color, accent-color, …) resolve at
|
|
609
|
+
* the ancestor, so re-assert them at each scope boundary.
|
|
613
610
|
*/
|
|
614
611
|
|
|
615
|
-
|
|
616
|
-
:where([popover]:not([data-use-inverted-menu="false"])) {
|
|
617
|
-
color-scheme: dark;
|
|
618
|
-
|
|
619
|
-
--background: var(--neutral-900);
|
|
620
|
-
--foreground: var(--white);
|
|
621
|
-
--border: var(--tint-200);
|
|
622
|
-
--border-foreground: var(--shade-500);
|
|
623
|
-
--card: var(--neutral-950);
|
|
624
|
-
--card-foreground: var(--white);
|
|
625
|
-
--input: var(--tint-50);
|
|
626
|
-
--input-foreground: var(--white);
|
|
627
|
-
--popover: var(--shade-950);
|
|
628
|
-
--popover-foreground: var(--white);
|
|
629
|
-
--muted: var(--tint-50);
|
|
630
|
-
--muted-foreground: var(--tint-600);
|
|
631
|
-
--faded: var(--shade-100);
|
|
632
|
-
--faded-foreground: var(--shade-600);
|
|
633
|
-
--primary: var(--primary-500);
|
|
634
|
-
--primary-foreground: var(--white);
|
|
635
|
-
--secondary: var(--secondary-500);
|
|
636
|
-
--secondary-foreground: var(--white);
|
|
637
|
-
--tertiary: var(--tertiary-400);
|
|
638
|
-
--tertiary-foreground: var(--white);
|
|
639
|
-
--info: oklch(0.5 0.1193 242.75);
|
|
640
|
-
--info-foreground: var(--white);
|
|
641
|
-
--success: oklch(0.5081 0.1049 165.61);
|
|
642
|
-
--success-foreground: var(--white);
|
|
643
|
-
--warning: oklch(0.5553 0.1455 49);
|
|
644
|
-
--warning-foreground: var(--white);
|
|
645
|
-
--destructive: oklch(0.5054 0.1905 27.52);
|
|
646
|
-
--destructive-foreground: var(--white);
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
|
|
612
|
+
[data-theme="dark"],
|
|
650
613
|
.dark {
|
|
651
614
|
color-scheme: dark;
|
|
615
|
+
color: var(--foreground);
|
|
616
|
+
}
|
|
652
617
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
--card: var(--neutral-950);
|
|
658
|
-
--card-foreground: var(--white);
|
|
659
|
-
--input: var(--tint-50);
|
|
660
|
-
--input-foreground: var(--white);
|
|
661
|
-
--popover: var(--shade-950);
|
|
662
|
-
--popover-foreground: var(--white);
|
|
663
|
-
--muted: var(--tint-50);
|
|
664
|
-
--muted-foreground: var(--tint-600);
|
|
665
|
-
--faded: var(--shade-100);
|
|
666
|
-
--faded-foreground: var(--shade-600);
|
|
667
|
-
--primary: var(--primary-500);
|
|
668
|
-
--primary-foreground: var(--white);
|
|
669
|
-
--secondary: var(--secondary-500);
|
|
670
|
-
--secondary-foreground: var(--white);
|
|
671
|
-
--tertiary: var(--tertiary-400);
|
|
672
|
-
--tertiary-foreground: var(--white);
|
|
673
|
-
--info: oklch(0.5 0.1193 242.75);
|
|
674
|
-
--info-foreground: var(--white);
|
|
675
|
-
--success: oklch(0.5081 0.1049 165.61);
|
|
676
|
-
--success-foreground: var(--white);
|
|
677
|
-
--warning: oklch(0.5553 0.1455 49);
|
|
678
|
-
--warning-foreground: var(--white);
|
|
679
|
-
--destructive: oklch(0.5054 0.1905 27.52);
|
|
680
|
-
--destructive-foreground: var(--white);
|
|
618
|
+
[data-theme="light"],
|
|
619
|
+
.light {
|
|
620
|
+
color-scheme: light;
|
|
621
|
+
color: var(--foreground);
|
|
681
622
|
}
|
|
682
623
|
}
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
|
|
80
80
|
@keyframes global-view-transition--old {
|
|
81
81
|
to {
|
|
82
|
-
opacity: var(--view-transition-opacity--
|
|
82
|
+
opacity: var(--view-transition-opacity--old);
|
|
83
83
|
transform: scale(var(--view-transition-scale--old))
|
|
84
84
|
translate3d(var(--view-transition-translate--old));
|
|
85
85
|
}
|
package/src/index.css
CHANGED
|
@@ -21,8 +21,13 @@
|
|
|
21
21
|
@import "./base/_typography.css";
|
|
22
22
|
@import "./base/_view-transitions.css";
|
|
23
23
|
|
|
24
|
-
/*
|
|
25
|
-
/* @import "./
|
|
24
|
+
/* Vendors layer — third-party CSS that does not build on Zazz */
|
|
25
|
+
/* @import "./some-library.css" layer(vendors); */
|
|
26
|
+
|
|
27
|
+
/* Legacy layer — import whole legacy stylesheets into legacy.imports.
|
|
28
|
+
Never bare layer(legacy): un-sublayered rules would beat the migration
|
|
29
|
+
shims in legacy.migrations. */
|
|
30
|
+
/* @import "./your-legacy.css" layer(legacy.imports); */
|
|
26
31
|
|
|
27
32
|
/* Zazz primitives - UI omponents. */
|
|
28
33
|
@import "./primitives/separator/separator.css";
|
|
@@ -69,5 +74,6 @@
|
|
|
69
74
|
@import "./base/_utilities.css";
|
|
70
75
|
@import "./base/_layout.css";
|
|
71
76
|
|
|
72
|
-
/*
|
|
73
|
-
|
|
77
|
+
/* Migration shims — translate legacy classes while markup is rewritten.
|
|
78
|
+
Beats all other legacy sublayers; Zazz still wins on migrated markup. */
|
|
79
|
+
/* @import "./migrations.css" layer(legacy.migrations); */
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
|
|
75
75
|
color: var(--ui-badge-foreground);
|
|
76
76
|
background-color: var(--ui-badge-background);
|
|
77
|
+
background-clip: padding-box;
|
|
77
78
|
|
|
78
79
|
/* ring renders as box-shadow so it composes with --ui-badge-shadow; the
|
|
79
80
|
ring widths animate from 0 so the ring grows in smoothly on focus */
|
|
@@ -172,9 +173,9 @@
|
|
|
172
173
|
--ui-badge-foreground--hover: var(--primary-foreground);
|
|
173
174
|
--ui-badge-foreground--active: var(--primary-foreground);
|
|
174
175
|
|
|
175
|
-
--ui-badge-border-color:
|
|
176
|
-
--ui-badge-border-color--hover:
|
|
177
|
-
--ui-badge-border-color--active:
|
|
176
|
+
--ui-badge-border-color: var(--ui-badge-background);
|
|
177
|
+
--ui-badge-border-color--hover: var(--ui-badge-background--hover);
|
|
178
|
+
--ui-badge-border-color--active: var(--ui-badge-background--active);
|
|
178
179
|
}
|
|
179
180
|
|
|
180
181
|
.ui-badge[data-variant="muted"] {
|
|
@@ -186,9 +187,9 @@
|
|
|
186
187
|
--ui-badge-foreground--hover: var(--foreground);
|
|
187
188
|
--ui-badge-foreground--active: var(--foreground);
|
|
188
189
|
|
|
189
|
-
--ui-badge-border-color:
|
|
190
|
-
--ui-badge-border-color--hover:
|
|
191
|
-
--ui-badge-border-color--active:
|
|
190
|
+
--ui-badge-border-color: var(--ui-badge-background);
|
|
191
|
+
--ui-badge-border-color--hover: var(--ui-badge-background--hover);
|
|
192
|
+
--ui-badge-border-color--active: var(--ui-badge-background--active);
|
|
192
193
|
}
|
|
193
194
|
|
|
194
195
|
.ui-badge[data-variant="ghost"] {
|
|
@@ -200,9 +201,9 @@
|
|
|
200
201
|
--ui-badge-foreground--hover: var(--foreground);
|
|
201
202
|
--ui-badge-foreground--active: var(--foreground);
|
|
202
203
|
|
|
203
|
-
--ui-badge-border-color:
|
|
204
|
-
--ui-badge-border-color--hover:
|
|
205
|
-
--ui-badge-border-color--active:
|
|
204
|
+
--ui-badge-border-color: var(--ui-badge-background);
|
|
205
|
+
--ui-badge-border-color--hover: var(--ui-badge-background--hover);
|
|
206
|
+
--ui-badge-border-color--active: var(--ui-badge-background--active);
|
|
206
207
|
}
|
|
207
208
|
|
|
208
209
|
.ui-badge[data-variant="link"] {
|
|
@@ -172,9 +172,9 @@
|
|
|
172
172
|
--ui-button-foreground--hover: var(--primary-foreground);
|
|
173
173
|
--ui-button-foreground--active: var(--primary-foreground);
|
|
174
174
|
|
|
175
|
-
--ui-button-border-color:
|
|
176
|
-
--ui-button-border-color--hover:
|
|
177
|
-
--ui-button-border-color--active:
|
|
175
|
+
--ui-button-border-color: var(--ui-button-background);
|
|
176
|
+
--ui-button-border-color--hover: var(--ui-button-background--hover);
|
|
177
|
+
--ui-button-border-color--active: var(--ui-button-background--active);
|
|
178
178
|
|
|
179
179
|
--ui-button-shadow: 0 0 transparent;
|
|
180
180
|
}
|
|
@@ -188,9 +188,9 @@
|
|
|
188
188
|
--ui-button-foreground--hover: var(--foreground);
|
|
189
189
|
--ui-button-foreground--active: var(--foreground);
|
|
190
190
|
|
|
191
|
-
--ui-button-border-color:
|
|
192
|
-
--ui-button-border-color--hover:
|
|
193
|
-
--ui-button-border-color--active:
|
|
191
|
+
--ui-button-border-color: var(--ui-button-background);
|
|
192
|
+
--ui-button-border-color--hover: var(--ui-button-background--hover);
|
|
193
|
+
--ui-button-border-color--active: var(--ui-button-background--active);
|
|
194
194
|
|
|
195
195
|
--ui-button-shadow: 0 0 transparent;
|
|
196
196
|
}
|
|
@@ -204,9 +204,9 @@
|
|
|
204
204
|
--ui-button-foreground--hover: var(--foreground);
|
|
205
205
|
--ui-button-foreground--active: var(--foreground);
|
|
206
206
|
|
|
207
|
-
--ui-button-border-color:
|
|
208
|
-
--ui-button-border-color--hover:
|
|
209
|
-
--ui-button-border-color--active:
|
|
207
|
+
--ui-button-border-color: var(--ui-button-background);
|
|
208
|
+
--ui-button-border-color--hover: var(--ui-button-background--hover);
|
|
209
|
+
--ui-button-border-color--active: var(--ui-button-background--active);
|
|
210
210
|
|
|
211
211
|
--ui-button-shadow: 0 0 transparent;
|
|
212
212
|
}
|
|
@@ -222,9 +222,9 @@
|
|
|
222
222
|
--ui-button-foreground--hover: var(--destructive-foreground);
|
|
223
223
|
--ui-button-foreground--active: var(--destructive-foreground);
|
|
224
224
|
|
|
225
|
-
--ui-button-border-color: var(--
|
|
226
|
-
--ui-button-border-color--hover: var(--
|
|
227
|
-
--ui-button-border-color--active: var(--
|
|
225
|
+
--ui-button-border-color: var(--ui-button-background);
|
|
226
|
+
--ui-button-border-color--hover: var(--ui-button-background--hover);
|
|
227
|
+
--ui-button-border-color--active: var(--ui-button-background--active);
|
|
228
228
|
|
|
229
229
|
--ui-button-shadow: 0 0 transparent;
|
|
230
230
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<ui-carousel data-carousel-plugins="class-names">
|
|
2
2
|
<div class="flex items-end justify-between gap-md flex-wrap pb-lg">
|
|
3
|
-
<h2 class="text-h5
|
|
3
|
+
<h2 class="text-h5">Featured Articles</h2>
|
|
4
4
|
<div class="flex @md:hidden gap-xs">
|
|
5
5
|
<button
|
|
6
6
|
type="button"
|
|
@@ -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>
|
|
@@ -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>
|