@zazz-ui/core 0.1.0 → 0.2.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 +131 -0
- package/README.md +53 -7
- package/dist/sri.json +36 -36
- package/dist/zazz.css +1 -1
- package/package.json +1 -1
- package/src/base/_layers.css +2 -2
- package/src/base/_utilities.css +16 -4
- package/src/base/embla.d.ts +1 -0
- package/src/base/embla.d.ts.map +1 -1
- package/src/base/embla.ts +3 -3
- package/src/base/utils.d.ts +1 -1
- package/src/base/utils.js +1 -1
- package/src/base/utils.ts +1 -1
- package/src/globals.d.ts +3 -3
- package/src/index.css +3 -1
- package/src/manifest.ts +6 -6
- package/src/primitives/accordion/accordion.css +2 -2
- package/src/primitives/alert-dialog/alert-dialog.css +2 -2
- package/src/primitives/badge/badge.css +29 -26
- package/src/primitives/button/button.css +44 -38
- package/src/primitives/carousel/carousel.css +2 -2
- package/src/primitives/carousel/carousel.d.ts +32 -0
- package/src/primitives/carousel/carousel.d.ts.map +1 -1
- package/src/primitives/carousel/carousel.js +0 -31
- package/src/primitives/carousel/carousel.ts +1 -0
- package/src/primitives/checkbox/checkbox.css +21 -12
- package/src/primitives/combobox/combobox.css +17 -15
- package/src/primitives/command/command.css +1 -1
- package/src/primitives/dialog/dialog.css +18 -20
- package/src/primitives/fields/fields.css +14 -10
- package/src/primitives/input/input.css +10 -8
- package/src/primitives/input-group/input-group.css +18 -18
- package/src/primitives/kbd/kbd.css +2 -2
- package/src/primitives/lightbox/lightbox.css +7 -13
- package/src/primitives/meter/meter.css +2 -2
- package/src/primitives/mobile-menu/mobile-menu.css +6 -6
- package/src/primitives/otp/otp.css +9 -6
- package/src/primitives/password-group/password-group.css +18 -18
- package/src/primitives/popover/popover.css +2 -2
- package/src/primitives/progress/progress.css +2 -2
- package/src/primitives/radio/radio.css +12 -8
- package/src/primitives/select/select.css +27 -20
- package/src/primitives/slider/slider.css +4 -4
- package/src/primitives/switch/switch.css +8 -8
- package/src/primitives/table/table.css +3 -3
- package/src/primitives/tabs/tabs.css +13 -9
- package/src/primitives/textarea/textarea.css +10 -7
- package/src/primitives/toaster/toaster.css +7 -7
- package/src/primitives/toggle/toggle.css +35 -32
- package/src/primitives/tooltip/tooltip.css +6 -4
package/package.json
CHANGED
package/src/base/_layers.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* layers.css — Cascade layer order (must load first).
|
|
3
3
|
*
|
|
4
|
-
* @layer
|
|
5
|
-
* @sublayers zazz.
|
|
4
|
+
* @layer variables, reset, legacy, zazz, migrations
|
|
5
|
+
* @sublayers zazz.components, zazz.utilities
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
@layer variables, reset, legacy, zazz, migrations;
|
package/src/base/_utilities.css
CHANGED
|
@@ -5796,6 +5796,10 @@
|
|
|
5796
5796
|
transform: scale(0);
|
|
5797
5797
|
}
|
|
5798
5798
|
|
|
5799
|
+
:where(.group:hover .group-hover\:scale-25) {
|
|
5800
|
+
transform: scale(0.25);
|
|
5801
|
+
}
|
|
5802
|
+
|
|
5799
5803
|
:where(.group:hover .group-hover\:scale-50) {
|
|
5800
5804
|
transform: scale(0.5);
|
|
5801
5805
|
}
|
|
@@ -5808,16 +5812,24 @@
|
|
|
5808
5812
|
transform: scale(0.9);
|
|
5809
5813
|
}
|
|
5810
5814
|
|
|
5811
|
-
:where(.group:hover .group-hover\:scale-
|
|
5812
|
-
transform: scale(0.
|
|
5815
|
+
:where(.group:hover .group-hover\:scale-98) {
|
|
5816
|
+
transform: scale(0.98);
|
|
5817
|
+
}
|
|
5818
|
+
|
|
5819
|
+
:where(.group:hover .group-hover\:scale-99) {
|
|
5820
|
+
transform: scale(0.99);
|
|
5813
5821
|
}
|
|
5814
5822
|
|
|
5815
5823
|
:where(.group:hover .group-hover\:scale-100) {
|
|
5816
5824
|
transform: scale(1);
|
|
5817
5825
|
}
|
|
5818
5826
|
|
|
5819
|
-
:where(.group:hover .group-hover\:scale-
|
|
5820
|
-
transform: scale(1.
|
|
5827
|
+
:where(.group:hover .group-hover\:scale-101) {
|
|
5828
|
+
transform: scale(1.01);
|
|
5829
|
+
}
|
|
5830
|
+
|
|
5831
|
+
:where(.group:hover .group-hover\:scale-102) {
|
|
5832
|
+
transform: scale(1.02);
|
|
5821
5833
|
}
|
|
5822
5834
|
|
|
5823
5835
|
:where(.group:hover .group-hover\:scale-110) {
|
package/src/base/embla.d.ts
CHANGED
package/src/base/embla.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embla.d.ts","sourceRoot":"","sources":["embla.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"embla.d.ts","sourceRoot":"","sources":["embla.ts"],"names":[],"mappings":"AA8EA,OAAO,KAAK,EAAE,iBAAiB,EAAqC,MAAM,gBAAgB,CAAC;AAa3F;;;;;;GAMG;AACH,iBAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,EAAE,CAG5D;AAyCD;;;;;;;;;;;GAWG;AACH,iBAAS,cAAc,CACrB,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GACtC,IAAI,CAWN;AAID;;;;;;;GAOG;AACH,QAAA,MAAM,0BAA0B,aACpB,iBAAiB,YACjB,OAAO,WACR,WAAW,KACnB,CAAC,MAAM,IAAI,CAAC,GAAG,SAqDjB,CAAC;AAIF;;;;;;GAMG;AACH,QAAA,MAAM,qBAAqB,iBACX,iBAAiB,iBAChB,iBAAiB,WACvB,WAAW,SAOrB,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,qBAAqB,iBACX,iBAAiB,iBAChB,iBAAiB,SAiBjC,CAAC;AAmJF;;;;;;;;;;;;GAYG;AACH,iBAAS,aAAa,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CA8H/C;AAED;;;;;;;;GAQG;AACH,iBAAS,kBAAkB,CAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,IAAI,CAW5D;AAuGD;;;;;;;;;GASG;AACH,QAAA,MAAM,SAAS;;;;;;CAMd,CAAC;AA6EF,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC"}
|
package/src/base/embla.ts
CHANGED
|
@@ -76,7 +76,7 @@ import { registerRefresh } from "./zazz-element.ts";
|
|
|
76
76
|
// import map in browsers (pinned jsDelivr URLs; see `head.ts`) and through
|
|
77
77
|
// node_modules in tests/bundlers. No more UMD globals, no tag-order contract.
|
|
78
78
|
import EmblaCarousel from "embla-carousel";
|
|
79
|
-
import type { EmblaOptionsType } from "embla-carousel";
|
|
79
|
+
import type { EmblaCarouselType, EmblaOptionsType, EmblaPluginType } from "embla-carousel";
|
|
80
80
|
import EmblaCarouselAutoplay from "embla-carousel-autoplay";
|
|
81
81
|
import type { AutoplayOptionsType } from "embla-carousel-autoplay";
|
|
82
82
|
import EmblaCarouselAutoScroll from "embla-carousel-auto-scroll";
|
|
@@ -105,7 +105,7 @@ function parseCarouselPlugins(value: string | null): string[] {
|
|
|
105
105
|
* Map of plugin slug → Embla factory. Slugs match Embla package names
|
|
106
106
|
* (`embla-carousel-auto-scroll`, etc.).
|
|
107
107
|
*/
|
|
108
|
-
const PLUGIN_BY_SLUG: Record<CarouselPluginSlug, (node: Element) =>
|
|
108
|
+
const PLUGIN_BY_SLUG: Record<CarouselPluginSlug, (node: Element) => EmblaPluginType> = {
|
|
109
109
|
autoplay: (node) =>
|
|
110
110
|
EmblaCarouselAutoplay(
|
|
111
111
|
readCarouselOptions<AutoplayOptionsType>(node, "data-carousel-autoplay-"),
|
|
@@ -495,7 +495,7 @@ function initEmblaRoot(emblaNode: Element): void {
|
|
|
495
495
|
|
|
496
496
|
// Plugins load only when listed in data-carousel-plugins; option attrs alone
|
|
497
497
|
// do not enable them. Unknown slugs are ignored.
|
|
498
|
-
const plugins:
|
|
498
|
+
const plugins: EmblaPluginType[] = [];
|
|
499
499
|
for (const slug of parseCarouselPlugins(emblaNode.getAttribute("data-carousel-plugins"))) {
|
|
500
500
|
const create = PLUGIN_BY_SLUG[slug as CarouselPluginSlug];
|
|
501
501
|
if (!create) continue;
|
package/src/base/utils.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* typed JavaScript values.
|
|
5
5
|
*
|
|
6
6
|
* This is a **public, consumer-facing** surface (`window.Utils`, documented at
|
|
7
|
-
* /docs/
|
|
7
|
+
* /docs/scripts/utils), not just kit plumbing: data-attribute configuration
|
|
8
8
|
* is the kit's documented pattern for authoring a component
|
|
9
9
|
* (CONVENTIONS.scripts.md), so anyone writing a component in the Zazz idiom
|
|
10
10
|
* needs this exact parser to match kit behaviour. Keep it here rather than
|
package/src/base/utils.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* typed JavaScript values.
|
|
6
6
|
*
|
|
7
7
|
* This is a **public, consumer-facing** surface (`window.Utils`, documented at
|
|
8
|
-
* /docs/
|
|
8
|
+
* /docs/scripts/utils), not just kit plumbing: data-attribute configuration
|
|
9
9
|
* is the kit's documented pattern for authoring a component
|
|
10
10
|
* (CONVENTIONS.scripts.md), so anyone writing a component in the Zazz idiom
|
|
11
11
|
* needs this exact parser to match kit behaviour. Keep it here rather than
|
package/src/base/utils.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* typed JavaScript values.
|
|
7
7
|
*
|
|
8
8
|
* This is a **public, consumer-facing** surface (`window.Utils`, documented at
|
|
9
|
-
* /docs/
|
|
9
|
+
* /docs/scripts/utils), not just kit plumbing: data-attribute configuration
|
|
10
10
|
* is the kit's documented pattern for authoring a component
|
|
11
11
|
* (CONVENTIONS.scripts.md), so anyone writing a component in the Zazz idiom
|
|
12
12
|
* needs this exact parser to match kit behaviour. Keep it here rather than
|
package/src/globals.d.ts
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* checkJs can validate files that reference them across module boundaries.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
// Embla
|
|
8
|
-
//
|
|
7
|
+
// Scripts import Embla types directly from "embla-carousel" (so emitted .d.ts
|
|
8
|
+
// files stay self-contained for consumers); this alias exists only for the
|
|
9
|
+
// ambient interface merges below, which cannot use top-level imports.
|
|
9
10
|
type EmblaCarouselType = import("embla-carousel").EmblaCarouselType;
|
|
10
|
-
type EmblaPlugin = import("embla-carousel").EmblaPluginType;
|
|
11
11
|
|
|
12
12
|
interface UtilsNamespace {
|
|
13
13
|
parseValue(value: string): boolean | number | unknown[] | string;
|
package/src/index.css
CHANGED
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
|
|
27
27
|
/* Zazz primitives - UI omponents. */
|
|
28
28
|
@import "./primitives/separator/separator.css";
|
|
29
|
+
/* fields.css owns the shared --ui-field-* family; it registers before its
|
|
30
|
+
consumers (badge, button, toggle, tabs, checkbox, radio, inputs, …) */
|
|
31
|
+
@import "./primitives/fields/fields.css";
|
|
29
32
|
@import "./primitives/badge/badge.css";
|
|
30
33
|
@import "./primitives/kbd/kbd.css";
|
|
31
34
|
@import "./primitives/button/button.css";
|
|
@@ -43,7 +46,6 @@
|
|
|
43
46
|
@import "./primitives/menu/menu.css";
|
|
44
47
|
@import "./primitives/navigation-menu/navigation-menu.css";
|
|
45
48
|
@import "./primitives/mobile-menu/mobile-menu.css";
|
|
46
|
-
@import "./primitives/fields/fields.css";
|
|
47
49
|
@import "./primitives/input/input.css";
|
|
48
50
|
@import "./primitives/textarea/textarea.css";
|
|
49
51
|
@import "./primitives/select/select.css";
|
package/src/manifest.ts
CHANGED
|
@@ -116,7 +116,7 @@ export const PRIMITIVES: Record<string, PrimitiveEntry> = {
|
|
|
116
116
|
css: ["primitives/badge/badge.css"],
|
|
117
117
|
js: [],
|
|
118
118
|
base: [],
|
|
119
|
-
primitives: [],
|
|
119
|
+
primitives: ["fields"],
|
|
120
120
|
bare: [],
|
|
121
121
|
examples: ["primitives/badge/badge.html", "primitives/badge/badge-icon.html"],
|
|
122
122
|
},
|
|
@@ -132,7 +132,7 @@ export const PRIMITIVES: Record<string, PrimitiveEntry> = {
|
|
|
132
132
|
css: ["primitives/button/button.css"],
|
|
133
133
|
js: [],
|
|
134
134
|
base: [],
|
|
135
|
-
primitives: ["kbd"],
|
|
135
|
+
primitives: ["kbd", "fields"],
|
|
136
136
|
bare: [],
|
|
137
137
|
examples: [
|
|
138
138
|
"primitives/button/button.html",
|
|
@@ -171,7 +171,7 @@ export const PRIMITIVES: Record<string, PrimitiveEntry> = {
|
|
|
171
171
|
css: ["primitives/checkbox/checkbox.css"],
|
|
172
172
|
js: ["primitives/checkbox/checkbox.js"],
|
|
173
173
|
base: [],
|
|
174
|
-
primitives: [],
|
|
174
|
+
primitives: ["fields"],
|
|
175
175
|
bare: SIGNALS_BARE,
|
|
176
176
|
examples: ["primitives/checkbox/checkbox.html", "primitives/checkbox/checkbox-tasklist.html"],
|
|
177
177
|
},
|
|
@@ -413,7 +413,7 @@ export const PRIMITIVES: Record<string, PrimitiveEntry> = {
|
|
|
413
413
|
css: ["primitives/tabs/tabs.css"],
|
|
414
414
|
js: ["primitives/tabs/tabs.js"],
|
|
415
415
|
base: [],
|
|
416
|
-
primitives: [],
|
|
416
|
+
primitives: ["fields"],
|
|
417
417
|
bare: [],
|
|
418
418
|
examples: ["primitives/tabs/tabs.html"],
|
|
419
419
|
},
|
|
@@ -526,6 +526,7 @@ export const PRIMITIVES: Record<string, PrimitiveEntry> = {
|
|
|
526
526
|
*/
|
|
527
527
|
export const CSS_CASCADE_ORDER: string[] = [
|
|
528
528
|
"separator",
|
|
529
|
+
"fields",
|
|
529
530
|
"badge",
|
|
530
531
|
"kbd",
|
|
531
532
|
"button",
|
|
@@ -543,7 +544,6 @@ export const CSS_CASCADE_ORDER: string[] = [
|
|
|
543
544
|
"menu",
|
|
544
545
|
"navigation-menu",
|
|
545
546
|
"mobile-menu",
|
|
546
|
-
"fields",
|
|
547
547
|
"input",
|
|
548
548
|
"textarea",
|
|
549
549
|
"select",
|
|
@@ -577,7 +577,7 @@ export const CSS_CASCADE_ORDER: string[] = [
|
|
|
577
577
|
* @throws {Error} On an unknown primitive name.
|
|
578
578
|
* @example
|
|
579
579
|
* resolveClosure(["combobox"]);
|
|
580
|
-
* // ["
|
|
580
|
+
* // ["fields", "badge", "kbd", "button", "popover", "select", "combobox"]
|
|
581
581
|
*/
|
|
582
582
|
export function resolveClosure(names: string[]): string[] {
|
|
583
583
|
const closure = new Set<string>();
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
@layer variables {
|
|
13
13
|
:root {
|
|
14
14
|
--ui-accordion-icon-size: var(--step-4);
|
|
15
|
-
--ui-accordion-icon-transform
|
|
15
|
+
--ui-accordion-icon-transform--open: rotate(-180deg);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -99,6 +99,6 @@
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
:where(ui-accordion, .ui-accordion) > details[open] > summary > svg {
|
|
102
|
-
transform: var(--ui-accordion-icon-transform
|
|
102
|
+
transform: var(--ui-accordion-icon-transform--open);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
@layer variables {
|
|
13
13
|
:root {
|
|
14
14
|
/* Narrower than the base dialog: an alert is a single question, not a form */
|
|
15
|
-
--ui-alert-dialog-
|
|
15
|
+
--ui-alert-dialog-inline-size: min(45ch, 100% - var(--gap-md) * 2);
|
|
16
16
|
--ui-alert-dialog-accent: var(--destructive);
|
|
17
17
|
--ui-alert-dialog-shadow: var(--ui-dialog-shadow);
|
|
18
18
|
}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
=========================================================================== */
|
|
29
29
|
|
|
30
30
|
.ui-alert-dialog {
|
|
31
|
-
--ui-dialog-
|
|
31
|
+
--ui-dialog-inline-size: var(--ui-alert-dialog-inline-size);
|
|
32
32
|
--ui-dialog-shadow: var(--ui-alert-dialog-shadow);
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* badge.css: Badge (.ui-badge)
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, components
|
|
5
|
-
* @requires layers.css, _variables.css, _reset.css
|
|
5
|
+
* @requires layers.css, _variables.css, _reset.css, fields.css (--ui-field-* border/ring)
|
|
6
6
|
* @uses color-mix(), oklch(from …): variant hover/active tints
|
|
7
7
|
* @uses text-box: vertical trim (patchy browser support)
|
|
8
8
|
* @tokens --ui-badge-* (@layer variables)
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
|
|
12
12
|
@layer variables {
|
|
13
13
|
:root {
|
|
14
|
-
--ui-
|
|
14
|
+
/* Border + ring default to the shared --ui-field-* family (owned in fields.css)
|
|
15
|
+
so a badge sitting beside fields and buttons reads as one family; metrics stay
|
|
16
|
+
independent — a badge is deliberately a smaller scale. */
|
|
17
|
+
--ui-badge-ring-color: var(--ui-field-ring-color);
|
|
15
18
|
|
|
16
19
|
--ui-badge-font-family: var(--font-family-body);
|
|
17
20
|
--ui-badge-font-size: var(--font-size-xs);
|
|
@@ -26,13 +29,15 @@
|
|
|
26
29
|
--ui-badge-foreground--hover: var(--foreground);
|
|
27
30
|
--ui-badge-foreground--active: var(--foreground);
|
|
28
31
|
|
|
29
|
-
--ui-badge-border:
|
|
30
|
-
--ui-badge-border
|
|
31
|
-
--ui-badge-border
|
|
32
|
+
--ui-badge-border-width: var(--ui-field-border-width);
|
|
33
|
+
--ui-badge-border-style: var(--ui-field-border-style);
|
|
34
|
+
--ui-badge-border-color: var(--ui-field-border-color);
|
|
35
|
+
--ui-badge-border-color--hover: var(--ui-field-border-color);
|
|
36
|
+
--ui-badge-border-color--active: var(--ui-field-border-color);
|
|
32
37
|
|
|
33
38
|
--ui-badge-gap: var(--step-1);
|
|
34
39
|
--ui-badge-padding: var(--step-1_5);
|
|
35
|
-
--ui-badge-
|
|
40
|
+
--ui-badge-block-size: var(--step-5_5);
|
|
36
41
|
--ui-badge-radius: var(--radius-sm);
|
|
37
42
|
|
|
38
43
|
--ui-badge-icon-size: var(--step-3);
|
|
@@ -60,11 +65,11 @@
|
|
|
60
65
|
gap: var(--ui-badge-gap);
|
|
61
66
|
flex-shrink: 0;
|
|
62
67
|
|
|
63
|
-
block-size: var(--ui-badge-
|
|
64
|
-
min-
|
|
68
|
+
block-size: var(--ui-badge-block-size);
|
|
69
|
+
min-inline-size: max-content;
|
|
65
70
|
padding-inline: var(--ui-badge-padding);
|
|
66
71
|
|
|
67
|
-
border: var(--ui-badge-border);
|
|
72
|
+
border: var(--ui-badge-border-width) var(--ui-badge-border-style) var(--ui-badge-border-color);
|
|
68
73
|
border-radius: var(--ui-badge-radius);
|
|
69
74
|
|
|
70
75
|
color: var(--ui-badge-foreground);
|
|
@@ -106,14 +111,14 @@
|
|
|
106
111
|
a[href].ui-badge:hover:not(:disabled, [aria-disabled="true"]) {
|
|
107
112
|
color: var(--ui-badge-foreground--hover);
|
|
108
113
|
background-color: var(--ui-badge-background--hover);
|
|
109
|
-
border: var(--ui-badge-border--hover);
|
|
114
|
+
border-color: var(--ui-badge-border-color--hover);
|
|
110
115
|
}
|
|
111
116
|
|
|
112
117
|
button.ui-badge:active:not(:disabled, [aria-disabled="true"]),
|
|
113
118
|
a[href].ui-badge:active:not(:disabled, [aria-disabled="true"]) {
|
|
114
119
|
color: var(--ui-badge-foreground--active);
|
|
115
120
|
background-color: var(--ui-badge-background--active);
|
|
116
|
-
border: var(--ui-badge-border--active);
|
|
121
|
+
border-color: var(--ui-badge-border-color--active);
|
|
117
122
|
}
|
|
118
123
|
|
|
119
124
|
button.ui-badge:focus-visible:hover:not(:disabled, [aria-disabled="true"]),
|
|
@@ -167,9 +172,9 @@
|
|
|
167
172
|
--ui-badge-foreground--hover: var(--primary-foreground);
|
|
168
173
|
--ui-badge-foreground--active: var(--primary-foreground);
|
|
169
174
|
|
|
170
|
-
--ui-badge-border:
|
|
171
|
-
--ui-badge-border--hover:
|
|
172
|
-
--ui-badge-border--active:
|
|
175
|
+
--ui-badge-border-color: transparent;
|
|
176
|
+
--ui-badge-border-color--hover: transparent;
|
|
177
|
+
--ui-badge-border-color--active: transparent;
|
|
173
178
|
}
|
|
174
179
|
|
|
175
180
|
.ui-badge[data-variant="muted"] {
|
|
@@ -181,9 +186,9 @@
|
|
|
181
186
|
--ui-badge-foreground--hover: var(--foreground);
|
|
182
187
|
--ui-badge-foreground--active: var(--foreground);
|
|
183
188
|
|
|
184
|
-
--ui-badge-border:
|
|
185
|
-
--ui-badge-border--hover:
|
|
186
|
-
--ui-badge-border--active:
|
|
189
|
+
--ui-badge-border-color: transparent;
|
|
190
|
+
--ui-badge-border-color--hover: transparent;
|
|
191
|
+
--ui-badge-border-color--active: transparent;
|
|
187
192
|
}
|
|
188
193
|
|
|
189
194
|
.ui-badge[data-variant="ghost"] {
|
|
@@ -195,9 +200,9 @@
|
|
|
195
200
|
--ui-badge-foreground--hover: var(--foreground);
|
|
196
201
|
--ui-badge-foreground--active: var(--foreground);
|
|
197
202
|
|
|
198
|
-
--ui-badge-border:
|
|
199
|
-
--ui-badge-border--hover:
|
|
200
|
-
--ui-badge-border--active:
|
|
203
|
+
--ui-badge-border-color: transparent;
|
|
204
|
+
--ui-badge-border-color--hover: transparent;
|
|
205
|
+
--ui-badge-border-color--active: transparent;
|
|
201
206
|
}
|
|
202
207
|
|
|
203
208
|
.ui-badge[data-variant="link"] {
|
|
@@ -209,11 +214,9 @@
|
|
|
209
214
|
--ui-badge-foreground--hover: var(--primary);
|
|
210
215
|
--ui-badge-foreground--active: oklch(from var(--primary) l c h / 0.8);
|
|
211
216
|
|
|
212
|
-
--ui-badge-border: none;
|
|
213
|
-
--ui-badge-border--hover: none;
|
|
214
|
-
--ui-badge-border--active: none;
|
|
217
|
+
--ui-badge-border-style: none;
|
|
215
218
|
|
|
216
|
-
--ui-badge-
|
|
219
|
+
--ui-badge-block-size: fit-content;
|
|
217
220
|
--ui-badge-padding: 0;
|
|
218
221
|
--ui-badge-radius: 0;
|
|
219
222
|
|
|
@@ -243,8 +246,8 @@
|
|
|
243
246
|
=========================================================================== */
|
|
244
247
|
|
|
245
248
|
.ui-badge[data-size="icon"] {
|
|
246
|
-
block-size: var(--ui-badge-
|
|
247
|
-
inline-size: var(--ui-badge-
|
|
249
|
+
block-size: var(--ui-badge-block-size);
|
|
250
|
+
inline-size: var(--ui-badge-block-size);
|
|
248
251
|
padding: 0;
|
|
249
252
|
aspect-ratio: 1 / 1;
|
|
250
253
|
}
|
|
@@ -2,21 +2,26 @@
|
|
|
2
2
|
* button.css — Button (.ui-button)
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, components
|
|
5
|
-
* @requires layers.css, _variables.css, _reset.css, kbd.css (--ui-kbd-*)
|
|
5
|
+
* @requires layers.css, _variables.css, _reset.css, fields.css (--ui-field-* metrics), kbd.css (--ui-kbd-*)
|
|
6
6
|
* @uses color-mix(), oklch(from …) — variant hover/active tints
|
|
7
7
|
* @uses text-box — vertical trim (patchy browser support)
|
|
8
|
-
* @tokens --ui-button-* (@layer variables)
|
|
8
|
+
* @tokens --ui-button-* (@layer variables; metrics default to the --ui-field-* family)
|
|
9
9
|
* @consumedby toggle.css (reads the --ui-button-* token family)
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
@layer variables {
|
|
13
13
|
:root {
|
|
14
|
-
--ui-
|
|
14
|
+
/* Metrics default to the shared --ui-field-* family (owned in fields.css) so a
|
|
15
|
+
button sitting beside an input, select, or textarea reads as one family:
|
|
16
|
+
retune a --ui-field-* token and buttons follow; remap a --ui-button-* token
|
|
17
|
+
to diverge just the buttons. Colors stay independent — a button surface is
|
|
18
|
+
not a field surface, and button borders don't go primary on hover. */
|
|
19
|
+
--ui-button-ring-color: var(--ui-field-ring-color);
|
|
15
20
|
|
|
16
21
|
--ui-button-font-family: var(--font-family-body);
|
|
17
|
-
--ui-button-font-size: var(--font-size
|
|
22
|
+
--ui-button-font-size: var(--ui-field-font-size);
|
|
18
23
|
--ui-button-font-weight: var(--font-weight-strong);
|
|
19
|
-
--ui-button-line-height:
|
|
24
|
+
--ui-button-line-height: var(--ui-field-line-height);
|
|
20
25
|
|
|
21
26
|
--ui-button-background: var(--card);
|
|
22
27
|
--ui-button-background--hover: var(--muted);
|
|
@@ -26,16 +31,18 @@
|
|
|
26
31
|
--ui-button-foreground--hover: var(--foreground);
|
|
27
32
|
--ui-button-foreground--active: var(--foreground);
|
|
28
33
|
|
|
29
|
-
--ui-button-border:
|
|
30
|
-
--ui-button-border
|
|
31
|
-
--ui-button-border
|
|
34
|
+
--ui-button-border-width: var(--ui-field-border-width);
|
|
35
|
+
--ui-button-border-style: var(--ui-field-border-style);
|
|
36
|
+
--ui-button-border-color: var(--border);
|
|
37
|
+
--ui-button-border-color--hover: var(--border);
|
|
38
|
+
--ui-button-border-color--active: var(--border);
|
|
32
39
|
|
|
33
40
|
--ui-button-gap: var(--step-1);
|
|
34
|
-
--ui-button-padding: var(--
|
|
35
|
-
--ui-button-
|
|
36
|
-
--ui-button-radius: var(--radius
|
|
41
|
+
--ui-button-padding: var(--ui-field-padding);
|
|
42
|
+
--ui-button-block-size: var(--ui-field-block-size);
|
|
43
|
+
--ui-button-radius: var(--ui-field-radius);
|
|
37
44
|
|
|
38
|
-
--ui-button-icon-size: var(--
|
|
45
|
+
--ui-button-icon-size: var(--ui-field-icon-size);
|
|
39
46
|
|
|
40
47
|
/* composes into the button's box-shadow list — use a transparent shadow,
|
|
41
48
|
never `none`, so the focus ring layers stay valid */
|
|
@@ -60,11 +67,12 @@
|
|
|
60
67
|
column-gap: var(--ui-button-gap);
|
|
61
68
|
flex-shrink: 0;
|
|
62
69
|
|
|
63
|
-
min-block-size: var(--ui-button-
|
|
70
|
+
min-block-size: var(--ui-button-block-size);
|
|
64
71
|
min-inline-size: max-content;
|
|
65
72
|
padding-inline: var(--ui-button-padding);
|
|
66
73
|
|
|
67
|
-
border: var(--ui-button-border)
|
|
74
|
+
border: var(--ui-button-border-width) var(--ui-button-border-style)
|
|
75
|
+
var(--ui-button-border-color);
|
|
68
76
|
border-radius: var(--ui-button-radius);
|
|
69
77
|
|
|
70
78
|
color: var(--ui-button-foreground);
|
|
@@ -106,13 +114,13 @@
|
|
|
106
114
|
.ui-button:hover:not(:disabled, [aria-disabled="true"]) {
|
|
107
115
|
color: var(--ui-button-foreground--hover);
|
|
108
116
|
background-color: var(--ui-button-background--hover);
|
|
109
|
-
border: var(--ui-button-border--hover);
|
|
117
|
+
border-color: var(--ui-button-border-color--hover);
|
|
110
118
|
}
|
|
111
119
|
|
|
112
120
|
.ui-button:active:not(:disabled, [aria-disabled="true"]) {
|
|
113
121
|
color: var(--ui-button-foreground--active);
|
|
114
122
|
background-color: var(--ui-button-background--active);
|
|
115
|
-
border: var(--ui-button-border--active);
|
|
123
|
+
border-color: var(--ui-button-border-color--active);
|
|
116
124
|
}
|
|
117
125
|
|
|
118
126
|
.ui-button:focus-visible:not(:disabled, [aria-disabled="true"]) {
|
|
@@ -164,9 +172,9 @@
|
|
|
164
172
|
--ui-button-foreground--hover: var(--primary-foreground);
|
|
165
173
|
--ui-button-foreground--active: var(--primary-foreground);
|
|
166
174
|
|
|
167
|
-
--ui-button-border:
|
|
168
|
-
--ui-button-border--hover:
|
|
169
|
-
--ui-button-border--active:
|
|
175
|
+
--ui-button-border-color: transparent;
|
|
176
|
+
--ui-button-border-color--hover: transparent;
|
|
177
|
+
--ui-button-border-color--active: transparent;
|
|
170
178
|
|
|
171
179
|
--ui-button-shadow: 0 0 transparent;
|
|
172
180
|
}
|
|
@@ -180,9 +188,9 @@
|
|
|
180
188
|
--ui-button-foreground--hover: var(--foreground);
|
|
181
189
|
--ui-button-foreground--active: var(--foreground);
|
|
182
190
|
|
|
183
|
-
--ui-button-border:
|
|
184
|
-
--ui-button-border--hover:
|
|
185
|
-
--ui-button-border--active:
|
|
191
|
+
--ui-button-border-color: transparent;
|
|
192
|
+
--ui-button-border-color--hover: transparent;
|
|
193
|
+
--ui-button-border-color--active: transparent;
|
|
186
194
|
|
|
187
195
|
--ui-button-shadow: 0 0 transparent;
|
|
188
196
|
}
|
|
@@ -196,9 +204,9 @@
|
|
|
196
204
|
--ui-button-foreground--hover: var(--foreground);
|
|
197
205
|
--ui-button-foreground--active: var(--foreground);
|
|
198
206
|
|
|
199
|
-
--ui-button-border:
|
|
200
|
-
--ui-button-border--hover:
|
|
201
|
-
--ui-button-border--active:
|
|
207
|
+
--ui-button-border-color: transparent;
|
|
208
|
+
--ui-button-border-color--hover: transparent;
|
|
209
|
+
--ui-button-border-color--active: transparent;
|
|
202
210
|
|
|
203
211
|
--ui-button-shadow: 0 0 transparent;
|
|
204
212
|
}
|
|
@@ -214,9 +222,9 @@
|
|
|
214
222
|
--ui-button-foreground--hover: var(--destructive-foreground);
|
|
215
223
|
--ui-button-foreground--active: var(--destructive-foreground);
|
|
216
224
|
|
|
217
|
-
--ui-button-border:
|
|
218
|
-
--ui-button-border--hover:
|
|
219
|
-
--ui-button-border--active:
|
|
225
|
+
--ui-button-border-color: var(--destructive);
|
|
226
|
+
--ui-button-border-color--hover: var(--destructive);
|
|
227
|
+
--ui-button-border-color--active: var(--destructive);
|
|
220
228
|
|
|
221
229
|
--ui-button-shadow: 0 0 transparent;
|
|
222
230
|
}
|
|
@@ -230,11 +238,9 @@
|
|
|
230
238
|
--ui-button-foreground--hover: var(--primary);
|
|
231
239
|
--ui-button-foreground--active: oklch(from var(--primary) l c h / 0.8);
|
|
232
240
|
|
|
233
|
-
--ui-button-border: none;
|
|
234
|
-
--ui-button-border--hover: none;
|
|
235
|
-
--ui-button-border--active: none;
|
|
241
|
+
--ui-button-border-style: none;
|
|
236
242
|
|
|
237
|
-
--ui-button-
|
|
243
|
+
--ui-button-block-size: fit-content;
|
|
238
244
|
--ui-button-padding: 0;
|
|
239
245
|
--ui-button-radius: 0;
|
|
240
246
|
|
|
@@ -262,26 +268,26 @@
|
|
|
262
268
|
=========================================================================== */
|
|
263
269
|
|
|
264
270
|
.ui-button[data-size="sm"] {
|
|
265
|
-
--ui-button-
|
|
271
|
+
--ui-button-block-size: var(--step-6);
|
|
266
272
|
--ui-button-padding: var(--step-2);
|
|
267
273
|
--ui-button-radius: var(--radius-sm);
|
|
268
274
|
}
|
|
269
275
|
|
|
270
276
|
.ui-button[data-size="icon"] {
|
|
271
|
-
block-size: var(--ui-button-
|
|
272
|
-
inline-size: var(--ui-button-
|
|
277
|
+
block-size: var(--ui-button-block-size);
|
|
278
|
+
inline-size: var(--ui-button-block-size);
|
|
273
279
|
padding: 0;
|
|
274
280
|
aspect-ratio: 1 / 1;
|
|
275
281
|
}
|
|
276
282
|
|
|
277
283
|
.ui-button[data-size="icon-sm"] {
|
|
278
|
-
--ui-button-
|
|
284
|
+
--ui-button-block-size: var(--step-6);
|
|
279
285
|
--ui-button-padding: var(--step-2);
|
|
280
286
|
--ui-button-radius: var(--radius-sm);
|
|
281
287
|
--ui-button-icon-size: var(--step-3_5);
|
|
282
288
|
|
|
283
|
-
block-size: var(--ui-button-
|
|
284
|
-
inline-size: var(--ui-button-
|
|
289
|
+
block-size: var(--ui-button-block-size);
|
|
290
|
+
inline-size: var(--ui-button-block-size);
|
|
285
291
|
padding: 0;
|
|
286
292
|
aspect-ratio: 1 / 1;
|
|
287
293
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
@layer variables {
|
|
13
13
|
:root {
|
|
14
14
|
--ui-carousel-slide-basis: calc(100% - var(--_gap, 0px));
|
|
15
|
-
--ui-carousel-slide-min-
|
|
15
|
+
--ui-carousel-slide-min-inline-size: 0;
|
|
16
16
|
--ui-carousel-touch-action: pan-y pinch-zoom;
|
|
17
17
|
--ui-carousel-cursor--grabbing: grabbing;
|
|
18
18
|
}
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
[data-slot~="carousel-slide"] {
|
|
54
54
|
flex: 0 0 var(--ui-carousel-slide-basis);
|
|
55
|
-
min-
|
|
55
|
+
min-inline-size: var(--ui-carousel-slide-min-inline-size);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
[data-slot~="carousel-thumbs"] [data-slot~="carousel-slide"] {
|
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `<ui-carousel>` — HTML web component for carousels.
|
|
3
|
+
* @description Light-DOM custom element that wraps standard carousel markup
|
|
4
|
+
* and owns the Embla lifecycle: it initializes on connect (via
|
|
5
|
+
* `EmblaInit.initRoot`) and destroys its instances on disconnect, so
|
|
6
|
+
* dynamically inserted or SPA-swapped carousels need no manual wiring.
|
|
7
|
+
*
|
|
8
|
+
* The element *is* the carousel root — CSS and `embla.js` target
|
|
9
|
+
* `:is(ui-carousel, .ui-carousel)` directly, and `data-carousel-*`
|
|
10
|
+
* configuration attributes are read off the element (see embla.js for the
|
|
11
|
+
* full attribute reference). No shadow DOM; children are regular markup.
|
|
12
|
+
*
|
|
13
|
+
* Carousels inside a closed `<dialog>` defer initialization until the dialog
|
|
14
|
+
* first opens (a closed dialog is `display: none`, so Embla cannot measure
|
|
15
|
+
* the viewport).
|
|
16
|
+
*
|
|
17
|
+
* Load order: the module graph resolves it — `index.js` imports embla.js
|
|
18
|
+
* (which imports the Embla packages via the page's import map) before this file.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* <ui-carousel data-carousel-loop="true">
|
|
22
|
+
* <div data-slot="carousel-viewport">
|
|
23
|
+
* <div data-slot="carousel-container">
|
|
24
|
+
* <div data-slot="carousel-slide">Slide 1</div>
|
|
25
|
+
* <div data-slot="carousel-slide">Slide 2</div>
|
|
26
|
+
* </div>
|
|
27
|
+
* </div>
|
|
28
|
+
* <button type="button" data-slot="carousel-prev">Prev</button>
|
|
29
|
+
* <button type="button" data-slot="carousel-next">Next</button>
|
|
30
|
+
* </ui-carousel>
|
|
31
|
+
*/
|
|
32
|
+
import type { EmblaCarouselType } from "embla-carousel";
|
|
1
33
|
import { ZazzElement } from "../../base/zazz-element.ts";
|
|
2
34
|
declare class UiCarouselElement extends ZazzElement {
|
|
3
35
|
protected setup(signal: AbortSignal): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["carousel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["carousel.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAqB,MAAM,4BAA4B,CAAC;AAE5E,cAAM,iBAAkB,SAAQ,WAAW;IACzC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAUzC;IAED,SAAS,CAAC,QAAQ,IAAI,IAAI,CAazB;IAED;;;OAGG;IACH,IAAI,IAAI,IAAI,CAEX;IAED;;OAEG;IACH,IAAI,GAAG,IAAI,iBAAiB,GAAG,IAAI,CAElC;CACF;AAID,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|