@zazz-ui/core 0.12.1 → 0.12.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 +38 -0
- package/README.md +2 -2
- package/dist/sri.json +9 -9
- package/dist/zazz.css +1 -1
- package/editor/zazz.css-data.json +32 -0
- package/editor/zazz.language-data.json +51 -17
- package/editor/zazz.lint-data.json +6 -0
- package/package.json +1 -1
- package/src/base/_defaults.css +4 -4
- package/src/base/_variables.css +1 -1
- package/src/base/kit-styling.js +4 -4
- package/src/base/kit-styling.ts +4 -4
- package/src/primitives/fields/fields.css +1 -1
- package/src/primitives/slider/slider.css +147 -8
- package/src/primitives/switch/switch.css +26 -3
- package/src/primitives/tabs/tabs.css +5 -5
- package/src/primitives/tooltip/tooltip.css +12 -1
|
@@ -18,12 +18,25 @@
|
|
|
18
18
|
/* floored so the track stays at least --spacing-control-min tall */
|
|
19
19
|
--ui-switch-track-w: max(calc(var(--spacing) * 7), calc(var(--spacing-control-min) * 1.75));
|
|
20
20
|
--ui-switch-track-p: max(calc(var(--spacing) * 0.5), calc(var(--spacing-control-min) * 0.125));
|
|
21
|
-
--ui-switch-track-h: calc(
|
|
21
|
+
--ui-switch-track-h: calc(
|
|
22
|
+
var(--ui-switch-track-w) / 2 + var(--ui-switch-track-p) + var(--ui-switch-track-border-width)
|
|
23
|
+
);
|
|
22
24
|
|
|
23
25
|
--ui-switch-thumb-bg: var(--color-card);
|
|
24
26
|
--ui-switch-thumb-bg--checked: var(--color-primary-foreground);
|
|
25
|
-
--ui-switch-thumb-
|
|
26
|
-
--ui-switch-thumb-
|
|
27
|
+
--ui-switch-thumb-border-width: var(--ui-field-border-width);
|
|
28
|
+
--ui-switch-thumb-border-style: var(--ui-field-border-style);
|
|
29
|
+
--ui-switch-thumb-border-color: transparent;
|
|
30
|
+
--ui-switch-thumb-border-color--hover: transparent;
|
|
31
|
+
--ui-switch-thumb-border-color--checked: transparent;
|
|
32
|
+
--ui-switch-thumb-border-color--checked-hover: transparent;
|
|
33
|
+
/* the thumb is content-box: its border sits outside this size, so take it back out
|
|
34
|
+
and the gap around the thumb is the same on every side */
|
|
35
|
+
--ui-switch-thumb-size: calc(
|
|
36
|
+
(var(--ui-switch-track-w) / 2) - var(--ui-switch-track-p) -
|
|
37
|
+
var(--ui-switch-thumb-border-width)
|
|
38
|
+
);
|
|
39
|
+
--ui-switch-thumb-shadow: var(--shadow-xs);
|
|
27
40
|
--ui-switch-thumb-translate: var(--ui-switch-track-p), -50%;
|
|
28
41
|
--ui-switch-thumb-scale: 1;
|
|
29
42
|
|
|
@@ -74,6 +87,9 @@
|
|
|
74
87
|
var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
|
|
75
88
|
);
|
|
76
89
|
corner-shape: var(--ui-switch-thumb-corner-shape);
|
|
90
|
+
border-width: var(--ui-switch-thumb-border-width);
|
|
91
|
+
border-style: var(--ui-switch-thumb-border-style);
|
|
92
|
+
border-color: var(--ui-switch-thumb-border-color);
|
|
77
93
|
background-color: var(--ui-switch-thumb-bg);
|
|
78
94
|
box-shadow: var(--ui-switch-thumb-shadow);
|
|
79
95
|
pointer-events: none;
|
|
@@ -84,14 +100,21 @@
|
|
|
84
100
|
|
|
85
101
|
&:has(> input[role="switch"]:checked)::after {
|
|
86
102
|
background-color: var(--ui-switch-thumb-bg--checked);
|
|
103
|
+
border-color: var(--ui-switch-thumb-border-color--checked);
|
|
87
104
|
--ui-switch-thumb-translate:
|
|
88
105
|
calc(var(--ui-switch-track-p) + var(--ui-switch-thumb-size)), -50%;
|
|
89
106
|
}
|
|
90
107
|
|
|
91
108
|
@media (hover: hover) {
|
|
92
109
|
&:has(> input[role="switch"]:hover:not(:disabled))::after {
|
|
110
|
+
border-color: var(--ui-switch-thumb-border-color--hover);
|
|
93
111
|
--ui-switch-thumb-scale: 1.1;
|
|
94
112
|
}
|
|
113
|
+
|
|
114
|
+
/* more specific than the plain hover, so a checked thumb keeps its own color */
|
|
115
|
+
&:has(> input[role="switch"]:hover:checked:not(:disabled))::after {
|
|
116
|
+
border-color: var(--ui-switch-thumb-border-color--checked-hover);
|
|
117
|
+
}
|
|
95
118
|
}
|
|
96
119
|
|
|
97
120
|
&:has(> input[role="switch"]:active:not(:disabled))::after {
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
:root {
|
|
20
20
|
/* metrics default to the shared --ui-field-* family so the track matches
|
|
21
21
|
adjacent fields and buttons; --ui-tabs-label-min-h is deliberately shorter */
|
|
22
|
-
--ui-tabs-gap:
|
|
23
|
-
--ui-tabs-track-p: calc(var(--spacing) * 0.
|
|
22
|
+
--ui-tabs-gap: 0;
|
|
23
|
+
--ui-tabs-track-p: calc(var(--spacing) * 0.35);
|
|
24
24
|
--ui-tabs-track-radius: var(--ui-field-radius);
|
|
25
25
|
--ui-tabs-track-corner-shape: var(--ui-field-corner-shape);
|
|
26
|
-
--ui-tabs-track-gap: calc(var(--spacing) * 0.
|
|
26
|
+
--ui-tabs-track-gap: calc(var(--spacing) * 0.35);
|
|
27
27
|
--ui-tabs-track-bg: var(--ui-field-bg);
|
|
28
28
|
--ui-tabs-track-border-width: 1px;
|
|
29
29
|
--ui-tabs-track-border-style: solid;
|
|
30
30
|
--ui-tabs-track-border-color: var(--color-border);
|
|
31
31
|
|
|
32
|
-
--ui-tabs-indicator-bg: var(--color-
|
|
32
|
+
--ui-tabs-indicator-bg: var(--color-muted);
|
|
33
33
|
--ui-tabs-indicator-radius: var(--ui-field-inset-child-radius);
|
|
34
34
|
--ui-tabs-indicator-corner-shape: var(--ui-field-corner-shape);
|
|
35
|
-
--ui-tabs-indicator-shadow:
|
|
35
|
+
--ui-tabs-indicator-shadow: none;
|
|
36
36
|
--ui-tabs-indicator-inset: var(--ui-tabs-track-p);
|
|
37
37
|
--ui-tabs-indicator-border-width: 1px;
|
|
38
38
|
--ui-tabs-indicator-border-style: solid;
|
|
@@ -6,7 +6,13 @@
|
|
|
6
6
|
* @uses interestfor: Interest Invokers API (Chromium 142+; polyfill via invokers)
|
|
7
7
|
* @uses data-tooltip-slot="content": hint popover (light dismiss, auto-hides sibling hints)
|
|
8
8
|
* @uses anchor-name, position-anchor, position-area, position-try-fallbacks:
|
|
9
|
-
* explicit anchors for polyfill; data-popover-side maps to --ui-popover-position
|
|
9
|
+
* explicit anchors for polyfill; data-popover-side maps to --ui-popover-position-*.
|
|
10
|
+
* Chromium (151) draws one of a newly opened anchored element's first two frames
|
|
11
|
+
* without its scroll compensation, so in a scrolled container or page the
|
|
12
|
+
* tooltip flashes far from its trigger. Opening, the fade starts 34ms (two
|
|
13
|
+
* 60Hz frames) late, so that frame paints transparent; a later one would be
|
|
14
|
+
* nearly so. A custom --ui-tooltip-transition keeps
|
|
15
|
+
* the delay on its first entry.
|
|
10
16
|
* @uses corner-shape — superellipse corners; unsupported browsers keep plain
|
|
11
17
|
* rounded corners
|
|
12
18
|
* @uses :dir(rtl): inline-side origins and slide-in mirror; the arrow uses logical insets
|
|
@@ -110,6 +116,11 @@
|
|
|
110
116
|
display: flex;
|
|
111
117
|
opacity: var(--ui-tooltip-opacity--end);
|
|
112
118
|
transform: scale(var(--ui-tooltip-scale--end)) translate3d(var(--ui-tooltip-translate--end));
|
|
119
|
+
/* opening, the fade waits out the frames Chromium may misplace (see the header);
|
|
120
|
+
one delay per --ui-tooltip-transition entry: opacity, transform, overlay, display */
|
|
121
|
+
transition-delay:
|
|
122
|
+
calc(var(--ui-tooltip-transition-delay) + 34ms), var(--ui-tooltip-transition-delay),
|
|
123
|
+
var(--ui-tooltip-transition-delay), var(--ui-tooltip-transition-delay);
|
|
113
124
|
|
|
114
125
|
@starting-style {
|
|
115
126
|
opacity: var(--ui-tooltip-opacity--start);
|