@zazz-ui/core 0.12.2 → 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.
@@ -133609,6 +133609,30 @@
133609
133609
  "name": "--ui-switch-thumb-bg--checked",
133610
133610
  "description": "Primitive hook: the public override surface."
133611
133611
  },
133612
+ {
133613
+ "name": "--ui-switch-thumb-border-color",
133614
+ "description": "Primitive hook: the public override surface."
133615
+ },
133616
+ {
133617
+ "name": "--ui-switch-thumb-border-color--checked",
133618
+ "description": "Primitive hook: the public override surface."
133619
+ },
133620
+ {
133621
+ "name": "--ui-switch-thumb-border-color--checked-hover",
133622
+ "description": "Primitive hook: the public override surface."
133623
+ },
133624
+ {
133625
+ "name": "--ui-switch-thumb-border-color--hover",
133626
+ "description": "Primitive hook: the public override surface."
133627
+ },
133628
+ {
133629
+ "name": "--ui-switch-thumb-border-style",
133630
+ "description": "Primitive hook: the public override surface."
133631
+ },
133632
+ {
133633
+ "name": "--ui-switch-thumb-border-width",
133634
+ "description": "Primitive hook: the public override surface."
133635
+ },
133612
133636
  {
133613
133637
  "name": "--ui-switch-thumb-corner-shape",
133614
133638
  "description": "Primitive hook: the public override surface."
@@ -3162,6 +3162,30 @@
3162
3162
  "value": "var(--color-primary-foreground)",
3163
3163
  "file": "primitives/switch/switch.css"
3164
3164
  },
3165
+ "--ui-switch-thumb-border-color": {
3166
+ "value": "transparent",
3167
+ "file": "primitives/switch/switch.css"
3168
+ },
3169
+ "--ui-switch-thumb-border-color--checked": {
3170
+ "value": "transparent",
3171
+ "file": "primitives/switch/switch.css"
3172
+ },
3173
+ "--ui-switch-thumb-border-color--checked-hover": {
3174
+ "value": "transparent",
3175
+ "file": "primitives/switch/switch.css"
3176
+ },
3177
+ "--ui-switch-thumb-border-color--hover": {
3178
+ "value": "transparent",
3179
+ "file": "primitives/switch/switch.css"
3180
+ },
3181
+ "--ui-switch-thumb-border-style": {
3182
+ "value": "var(--ui-field-border-style)",
3183
+ "file": "primitives/switch/switch.css"
3184
+ },
3185
+ "--ui-switch-thumb-border-width": {
3186
+ "value": "var(--ui-field-border-width)",
3187
+ "file": "primitives/switch/switch.css"
3188
+ },
3165
3189
  "--ui-switch-thumb-corner-shape": {
3166
3190
  "value": "var(--ui-switch-corner-shape)",
3167
3191
  "file": "primitives/switch/switch.css"
@@ -3175,11 +3199,11 @@
3175
3199
  "file": "primitives/switch/switch.css"
3176
3200
  },
3177
3201
  "--ui-switch-thumb-shadow": {
3178
- "value": "var(--shadow-sm)",
3202
+ "value": "var(--shadow-xs)",
3179
3203
  "file": "primitives/switch/switch.css"
3180
3204
  },
3181
3205
  "--ui-switch-thumb-size": {
3182
- "value": "calc((var(--ui-switch-track-w) / 2) - var(--ui-switch-track-p))",
3206
+ "value": "calc( (var(--ui-switch-track-w) / 2) - var(--ui-switch-track-p) - var(--ui-switch-thumb-border-width) )",
3183
3207
  "file": "primitives/switch/switch.css"
3184
3208
  },
3185
3209
  "--ui-switch-thumb-translate": {
@@ -3231,7 +3255,7 @@
3231
3255
  "file": "primitives/switch/switch.css"
3232
3256
  },
3233
3257
  "--ui-switch-track-h": {
3234
- "value": "calc(var(--ui-switch-track-w) / 2 + var(--ui-switch-track-p))",
3258
+ "value": "calc( var(--ui-switch-track-w) / 2 + var(--ui-switch-track-p) + var(--ui-switch-track-border-width) )",
3235
3259
  "file": "primitives/switch/switch.css"
3236
3260
  },
3237
3261
  "--ui-switch-track-p": {
@@ -112,6 +112,8 @@
112
112
  ],
113
113
  "switch": [
114
114
  "thumb-bg--checked",
115
+ "thumb-border-color--checked",
116
+ "thumb-border-color--hover",
115
117
  "track-bg--checked",
116
118
  "track-bg--hover",
117
119
  "track-border-color--checked",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zazz-ui/core",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "description": "Zazz Design Framework — a zero-build, semantic-token CSS + vanilla JS UI kit built on modern web standards.",
5
5
  "keywords": [
6
6
  "cascade-layers",
@@ -166,9 +166,14 @@
166
166
  view-timeline-inset: var(--_slider-bleed);
167
167
  }
168
168
 
169
- /* On the track, not the input: Safari's timeline doesn't reach the input itself. */
169
+ /* On the track, not the input: Safari's timeline doesn't reach the input itself.
170
+ Longhands only: with the `animation` shorthand, the build's minifier folds the
171
+ timeline into it, which no browser parses, and the fill never moves. */
170
172
  :where(input[type="range"])::-webkit-slider-runnable-track {
171
- animation: ui-slider-progress 1ms linear both;
173
+ animation-name: ui-slider-progress;
174
+ animation-duration: 1ms;
175
+ animation-timing-function: linear;
176
+ animation-fill-mode: both;
172
177
  animation-timeline: --ui-slider-thumb;
173
178
  animation-range: contain;
174
179
  }
@@ -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(var(--ui-switch-track-w) / 2 + var(--ui-switch-track-p));
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-size: calc((var(--ui-switch-track-w) / 2) - var(--ui-switch-track-p));
26
- --ui-switch-thumb-shadow: var(--shadow-sm);
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 {