@zazz-ui/core 0.10.0 → 0.11.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +2 -2
  3. package/dist/sri.json +27 -27
  4. package/dist/zazz.css +1 -1
  5. package/editor/zazz.css-data.json +9 -1
  6. package/editor/zazz.language-data.json +53 -19
  7. package/editor/zazz.lint-data.json +915 -896
  8. package/package.json +1 -1
  9. package/src/base/_defaults.css +2 -2
  10. package/src/base/_variables.css +28 -3
  11. package/src/base/kit-styling.d.ts.map +1 -1
  12. package/src/base/kit-styling.js +145 -143
  13. package/src/base/kit-styling.ts +145 -143
  14. package/src/primitives/accordion/accordion.css +3 -0
  15. package/src/primitives/alert-dialog/alert-dialog.html +14 -14
  16. package/src/primitives/badge/badge.css +14 -0
  17. package/src/primitives/button/button.css +31 -3
  18. package/src/primitives/checkbox/checkbox.css +9 -0
  19. package/src/primitives/combobox/combobox.css +17 -1
  20. package/src/primitives/command/command-dialog.html +109 -107
  21. package/src/primitives/command/command.css +16 -8
  22. package/src/primitives/dialog/dialog.css +92 -40
  23. package/src/primitives/input/input.css +2 -1
  24. package/src/primitives/input-group/input-group.css +7 -3
  25. package/src/primitives/lightbox/lightbox.css +4 -4
  26. package/src/primitives/mobile-menu/mobile-menu.css +17 -16
  27. package/src/primitives/mobile-menu/mobile-menu.html +4 -4
  28. package/src/primitives/navigation-menu/navigation-menu.css +3 -3
  29. package/src/primitives/otp/otp.css +3 -2
  30. package/src/primitives/password-group/password-group.css +7 -3
  31. package/src/primitives/popover/popover.css +23 -10
  32. package/src/primitives/radio/radio.css +12 -2
  33. package/src/primitives/scroll-fade/scroll-fade.css +1 -1
  34. package/src/primitives/select/select.css +26 -13
  35. package/src/primitives/slider/slider.css +3 -0
  36. package/src/primitives/switch/switch.css +11 -0
  37. package/src/primitives/tabs/tabs.css +2 -1
  38. package/src/primitives/toggle/toggle.css +27 -3
  39. package/src/primitives/tooltip/tooltip.css +40 -25
@@ -4,11 +4,14 @@
4
4
  *
5
5
  * @layer variables, components
6
6
  * @requires _layers.css, _variables.css, dialog.css, accordion.css
7
- * @uses Composes [data-ui~="dialog"][data-dialog-size="bleed"] — fullscreen native <dialog>
7
+ * @uses Composes [data-ui~="dialog"][data-dialog-size="bleed"] — fullscreen native <dialog>;
8
+ * the slots carry data-dialog-slot="content | header | body | footer" beside their own,
9
+ * so dialog.css owns the grid, the body scroller, and the safe-area padding
8
10
  * @uses Invoker Commands (command="show-modal") — open without JS (markup)
9
11
  * @uses view-transition-name — stable menu across navigations
10
12
  * @uses @starting-style — viewport enter animation
11
13
  * @uses Overrides --ui-dialog-* motion tokens for slide-right variant
14
+ * @uses :dir(rtl): slide-right mirrors to enter from the inline-start (right) edge
12
15
  * @tokens --ui-mobile-menu-* (@layer variables)
13
16
  * @presets data-mobile-menu-animation="slide-right"
14
17
  */
@@ -45,7 +48,6 @@
45
48
  :where([data-ui~="mobile-menu"]) {
46
49
  /* View transitions - keeps the menu stable when navigating between pages */
47
50
  view-transition-name: global-mobile-menu;
48
- inline-size: 100%;
49
51
 
50
52
  --ui-dialog-bg: var(--ui-mobile-menu-bg);
51
53
  --ui-dialog-text: var(--ui-mobile-menu-text);
@@ -57,15 +59,12 @@
57
59
  background-color: var(--ui-mobile-menu-backdrop-color);
58
60
  }
59
61
 
62
+ /* The dialog's content slot supplies the grid; a menu is full-screen at every width,
63
+ so it fills the dialog here too (the dialog does that only below the sm band) */
60
64
  :where([data-ui~="mobile-menu"]) [data-mobile-menu-slot~="viewport"] {
61
- display: grid;
62
- position: relative;
63
- grid-template-rows: auto 1fr auto;
65
+ block-size: 100%;
64
66
  overflow: clip;
65
67
  align-items: start;
66
- inline-size: 100%;
67
- block-size: 100%;
68
- max-block-size: 100svh;
69
68
  transition: var(--default-transition);
70
69
  transition-duration: var(--ui-dialog-transition-duration);
71
70
  transition-delay: calc(var(--ui-dialog-transition-duration) / 1.5);
@@ -91,31 +90,26 @@
91
90
  padding-inline: var(--ui-mobile-menu-header-px);
92
91
  padding-block: var(--ui-mobile-menu-header-py);
93
92
  border-block-end: 1px solid var(--color-border);
94
- position: sticky;
95
- inset-block-start: 0;
96
93
  background-color: var(--ui-mobile-menu-bg);
97
94
  z-index: 1;
98
95
  }
99
96
 
97
+ /* The dialog's body slot scrolls; this shapes the interior */
100
98
  :where([data-ui~="mobile-menu"]) [data-mobile-menu-slot~="body"] {
101
99
  display: flex;
102
100
  flex-direction: column;
103
- overflow-y: auto;
104
- overflow-x: clip;
105
101
  padding-inline: var(--ui-mobile-menu-body-px);
106
102
  padding-block: var(--ui-mobile-menu-body-py);
107
- max-block-size: 100%;
108
103
  scrollbar-gutter: stable both-edges;
109
104
  }
110
105
 
111
106
  :where([data-ui~="mobile-menu"]) [data-mobile-menu-slot~="footer"] {
112
107
  display: flex;
113
108
  flex-wrap: wrap;
109
+ justify-content: flex-start;
114
110
  gap: var(--ui-mobile-menu-footer-gap);
115
111
  padding: var(--ui-mobile-menu-footer-p);
116
112
  border-block-start: 1px solid var(--color-border);
117
- position: sticky;
118
- inset-block-end: 0;
119
113
  background-color: var(--ui-mobile-menu-bg);
120
114
  }
121
115
 
@@ -146,7 +140,14 @@
146
140
  --ui-dialog-translate--start: -100%, 0, 0;
147
141
  --ui-dialog-translate--end: 0, 0, 0;
148
142
 
149
- overflow: clip;
150
143
  transform-origin: left center;
151
144
  }
145
+
146
+ /* Translate and transform-origin are physical: in RTL the menu enters from
147
+ the inline-start (right) edge instead. */
148
+ :where([data-ui~="mobile-menu"][data-mobile-menu-animation="slide-right"]:dir(rtl)) {
149
+ --ui-dialog-translate--start: 100%, 0, 0;
150
+ --ui-mobile-menu-viewport-translate--start: 2rem, 1rem, 0;
151
+ transform-origin: right center;
152
+ }
152
153
  }
@@ -52,8 +52,8 @@
52
52
  closedby="any"
53
53
  style="--border-width: 0"
54
54
  >
55
- <div data-mobile-menu-slot="viewport">
56
- <div data-mobile-menu-slot="header">
55
+ <div data-mobile-menu-slot="viewport" data-dialog-slot="content">
56
+ <div data-mobile-menu-slot="header" data-dialog-slot="header">
57
57
  <span
58
58
  style="
59
59
  --font-size: var(--font-size-md);
@@ -98,7 +98,7 @@
98
98
  </button>
99
99
  </div>
100
100
 
101
- <div data-mobile-menu-slot="body">
101
+ <div data-mobile-menu-slot="body" data-dialog-slot="body">
102
102
  <ui-accordion>
103
103
  <!-- Platform -->
104
104
  <details>
@@ -1895,7 +1895,7 @@
1895
1895
  </ui-accordion>
1896
1896
  </div>
1897
1897
 
1898
- <div data-mobile-menu-slot="footer">
1898
+ <div data-mobile-menu-slot="footer" data-dialog-slot="footer">
1899
1899
  <button data-ui="button" type="button" style="--flex: 1">
1900
1900
  Sign in
1901
1901
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
@@ -93,7 +93,7 @@
93
93
  --ui-popover-min-w: 0;
94
94
 
95
95
  --ui-popover-position-area: block-end span-inline-end;
96
- --ui-popover-origin: top center;
96
+ --ui-popover-origin: top var(--_origin-inline-start);
97
97
  --ui-popover-my: calc(var(--spacing) * 1.5);
98
98
  }
99
99
 
@@ -115,7 +115,7 @@
115
115
  :where([data-ui~="navigation-menu"])
116
116
  [data-navigation-menu-slot~="popover"][data-popover-align="end"] {
117
117
  --ui-popover-position-area: block-end span-inline-start;
118
- --ui-popover-origin: top right;
118
+ --ui-popover-origin: top var(--_origin-inline-end);
119
119
  }
120
120
 
121
121
  /* ===========================================================================
@@ -174,7 +174,7 @@
174
174
  position-anchor: --ui-navigation-menu-menu-subtrigger;
175
175
 
176
176
  --ui-popover-position-area: inline-end span-block-start;
177
- --ui-popover-origin: left top;
177
+ --ui-popover-origin: bottom var(--_origin-inline-start);
178
178
  --ui-popover-my: 0;
179
179
  --ui-popover-mx: calc(var(--spacing) * 1.5);
180
180
  --ui-popover-position-try-fallbacks: flip-inline, flip-block, flip-inline flip-block;
@@ -7,6 +7,7 @@
7
7
  * stamped cell rail with transparent text/caret so autofill,
8
8
  * paste, and focus stay native; never display:none
9
9
  * @uses :focus-within: active-cell ring only while the input has focus
10
+ * @uses --_touch-min (touch screens): each cell grows to the touch floor
10
11
  * @uses corner-shape — superellipse corners; unsupported browsers keep plain
11
12
  * rounded corners
12
13
  * @tokens --ui-otp-* (@layer variables; aliases --ui-field-*)
@@ -78,8 +79,8 @@
78
79
  :where(ui-otp, [data-ui~="otp"]) [data-otp-slot~="cell"] {
79
80
  display: grid;
80
81
  place-items: center;
81
- inline-size: var(--ui-otp-cell-w);
82
- block-size: var(--ui-otp-cell-h);
82
+ inline-size: max(var(--ui-otp-cell-w), var(--_touch-min));
83
+ block-size: max(var(--ui-otp-cell-h), var(--_touch-min));
83
84
 
84
85
  font-family: var(--font-family-mono);
85
86
  font-size: var(--ui-otp-cell-font-size);
@@ -5,6 +5,7 @@
5
5
  * @requires _layers.css, _variables.css, fields.css, input.css,
6
6
  * button.css
7
7
  * @uses :focus-within, :has: shell focus ring and padding (as input-group.css)
8
+ * @uses --_touch-min (touch screens): the shell and its addons grow to the touch floor
8
9
  * @uses aria-pressed on toggle — show/hide icon swap via CSS (JS sets type +
9
10
  * aria in password-group.ts)
10
11
  * @uses Native reveal suppressed in _reset.css (::-ms-reveal, etc.)
@@ -58,7 +59,10 @@
58
59
  inline-size: calc(var(--_w-len) + var(--_w-num) * var(--spacing));
59
60
  --_min-h-len: var(--_min-h-resolved, var(--ui-password-group-min-h));
60
61
  --_min-h-num: var(--_min-h-resolved, var(--ui-password-group-min-h));
61
- min-block-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
62
+ min-block-size: max(
63
+ calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing)),
64
+ var(--_touch-min)
65
+ );
62
66
  --_p-len: var(--_p-resolved, var(--ui-password-group-p));
63
67
  --_p-num: var(--_p-resolved, var(--ui-password-group-p));
64
68
  padding: calc(var(--_p-len) + var(--_p-num) * var(--spacing));
@@ -172,8 +176,8 @@
172
176
  gap: var(--spacing);
173
177
  color: var(--color-muted-foreground);
174
178
  white-space: nowrap;
175
- block-size: var(--ui-field-h);
176
- min-inline-size: var(--ui-field-h);
179
+ block-size: max(var(--ui-field-h), var(--_touch-min));
180
+ min-inline-size: max(var(--ui-field-h), var(--_touch-min));
177
181
  padding-inline: var(--ui-field-addon-p);
178
182
  }
179
183
 
@@ -10,6 +10,9 @@
10
10
  * back to the UA-centered popover)
11
11
  * @uses corner-shape — superellipse corners; unsupported browsers keep plain
12
12
  * rounded corners
13
+ * @uses :dir(rtl): inline-side transform origins mirror in RTL (transform-origin
14
+ * has no logical keywords); origins follow the declared side, not an
15
+ * active position-try fallback
13
16
  * @tokens --ui-popover-* (Tier 3 owner; @layer variables)
14
17
  * @presets data-popover-side="top | bottom | left | right", data-popover-align="start | center | end"
15
18
  * on the [popover] element (the identity is the native attribute)
@@ -59,6 +62,11 @@
59
62
  background-color: var(--color-popover);
60
63
 
61
64
  align-content: start;
65
+ /* transform-origin has no logical keywords: the placement matrix names the
66
+ inline edge through these, resolved per element so RTL mirrors them.
67
+ Origins track the declared side, not the active position-try fallback. */
68
+ --_origin-inline-start: left;
69
+ --_origin-inline-end: right;
62
70
  transform-origin: var(--ui-popover-origin);
63
71
  --_radius-len: var(--_radius-resolved, var(--ui-popover-radius));
64
72
  --_radius-num: var(--_radius-resolved, var(--ui-popover-radius));
@@ -81,6 +89,11 @@
81
89
  allow-discrete;
82
90
  }
83
91
 
92
+ :where([popover]:dir(rtl)) {
93
+ --_origin-inline-start: right;
94
+ --_origin-inline-end: left;
95
+ }
96
+
84
97
  /* Anchor positioning tethers the popover to its trigger and flips it away
85
98
  from viewport edges. The gate keeps Safari 26.x on the UA-centered popover
86
99
  (inset: 0 + margin: auto) instead of a mispositioned top-left box.
@@ -152,7 +165,7 @@
152
165
  :where([popover])[data-popover-side="bottom"]:not([data-popover-align]),
153
166
  :where([popover])[data-popover-side="bottom"][data-popover-align="start"] {
154
167
  --ui-popover-position-area: block-end span-inline-end;
155
- --ui-popover-origin: top center;
168
+ --ui-popover-origin: top var(--_origin-inline-start);
156
169
  --ui-popover-my: calc(var(--spacing) * 1.5);
157
170
  --ui-popover-mx: 0;
158
171
  }
@@ -166,7 +179,7 @@
166
179
 
167
180
  :where([popover])[data-popover-side="bottom"][data-popover-align="end"] {
168
181
  --ui-popover-position-area: block-end span-inline-start;
169
- --ui-popover-origin: top center;
182
+ --ui-popover-origin: top var(--_origin-inline-end);
170
183
  --ui-popover-my: calc(var(--spacing) * 1.5);
171
184
  --ui-popover-mx: 0;
172
185
  }
@@ -174,7 +187,7 @@
174
187
  :where([popover])[data-popover-side="top"]:not([data-popover-align]),
175
188
  :where([popover])[data-popover-side="top"][data-popover-align="start"] {
176
189
  --ui-popover-position-area: block-start span-inline-end;
177
- --ui-popover-origin: bottom center;
190
+ --ui-popover-origin: bottom var(--_origin-inline-start);
178
191
  --ui-popover-my: calc(var(--spacing) * 1.5);
179
192
  --ui-popover-mx: 0;
180
193
  }
@@ -188,7 +201,7 @@
188
201
 
189
202
  :where([popover])[data-popover-side="top"][data-popover-align="end"] {
190
203
  --ui-popover-position-area: block-start span-inline-start;
191
- --ui-popover-origin: bottom center;
204
+ --ui-popover-origin: bottom var(--_origin-inline-end);
192
205
  --ui-popover-my: calc(var(--spacing) * 1.5);
193
206
  --ui-popover-mx: 0;
194
207
  }
@@ -196,21 +209,21 @@
196
209
  :where([popover])[data-popover-side="right"]:not([data-popover-align]),
197
210
  :where([popover])[data-popover-side="right"][data-popover-align="start"] {
198
211
  --ui-popover-position-area: inline-end span-block-end;
199
- --ui-popover-origin: bottom left;
212
+ --ui-popover-origin: top var(--_origin-inline-start);
200
213
  --ui-popover-my: 0;
201
214
  --ui-popover-mx: calc(var(--spacing) * 1.5);
202
215
  }
203
216
 
204
217
  :where([popover])[data-popover-side="right"][data-popover-align="center"] {
205
218
  --ui-popover-position-area: inline-end span-all;
206
- --ui-popover-origin: center left;
219
+ --ui-popover-origin: center var(--_origin-inline-start);
207
220
  --ui-popover-my: 0;
208
221
  --ui-popover-mx: calc(var(--spacing) * 1.5);
209
222
  }
210
223
 
211
224
  :where([popover])[data-popover-side="right"][data-popover-align="end"] {
212
225
  --ui-popover-position-area: inline-end span-block-start;
213
- --ui-popover-origin: top left;
226
+ --ui-popover-origin: bottom var(--_origin-inline-start);
214
227
  --ui-popover-my: 0;
215
228
  --ui-popover-mx: calc(var(--spacing) * 1.5);
216
229
  }
@@ -218,21 +231,21 @@
218
231
  :where([popover])[data-popover-side="left"]:not([data-popover-align]),
219
232
  :where([popover])[data-popover-side="left"][data-popover-align="start"] {
220
233
  --ui-popover-position-area: inline-start span-block-end;
221
- --ui-popover-origin: bottom right;
234
+ --ui-popover-origin: top var(--_origin-inline-end);
222
235
  --ui-popover-my: 0;
223
236
  --ui-popover-mx: calc(var(--spacing) * 1.5);
224
237
  }
225
238
 
226
239
  :where([popover])[data-popover-side="left"][data-popover-align="center"] {
227
240
  --ui-popover-position-area: inline-start span-all;
228
- --ui-popover-origin: center right;
241
+ --ui-popover-origin: center var(--_origin-inline-end);
229
242
  --ui-popover-my: 0;
230
243
  --ui-popover-mx: calc(var(--spacing) * 1.5);
231
244
  }
232
245
 
233
246
  :where([popover])[data-popover-side="left"][data-popover-align="end"] {
234
247
  --ui-popover-position-area: inline-start span-block-start;
235
- --ui-popover-origin: top right;
248
+ --ui-popover-origin: bottom var(--_origin-inline-end);
236
249
  --ui-popover-my: 0;
237
250
  --ui-popover-mx: calc(var(--spacing) * 1.5);
238
251
  }
@@ -4,6 +4,8 @@
4
4
  * @layer variables, components
5
5
  * @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-shadow), fields.css (field-group layout, --ui-field-* surface/border)
6
6
  * @uses appearance: none — custom circle + masked ::before dot when :checked
7
+ * @uses --_touch-min (touch screens) — the circle keeps its size; an invisible ::after
8
+ * centred on it is at least the touch floor square
7
9
  * @uses corner-shape — round by default, so circles stay circles; a hook takes any shape
8
10
  * @tokens --ui-radio-* (@layer variables)
9
11
  */
@@ -21,7 +23,7 @@
21
23
  --ui-radio-border-color--checked: var(--color-primary);
22
24
  --ui-radio-radius: var(--radius-full);
23
25
  --ui-radio-corner-shape: round;
24
- --ui-radio-dot-size: 1em;
26
+ --ui-radio-dot-size: 1.125em;
25
27
  --ui-radio-dot-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' fill='currentColor' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3C/svg%3E")
26
28
  center / contain no-repeat;
27
29
  }
@@ -45,6 +47,14 @@
45
47
  block-size: calc(var(--_size-len) + var(--_size-num) * var(--spacing));
46
48
 
47
49
  background-color: var(--_bg-resolved, var(--ui-radio-bg));
50
+
51
+ /* touch: the hit area, --_touch-min square at least; collapses to the box on a mouse */
52
+ &::after {
53
+ content: "";
54
+ position: absolute;
55
+ inset: min(0px, calc((100% - var(--_touch-min)) / 2));
56
+ }
57
+
48
58
  border-width: var(--_border-width-resolved, var(--ui-radio-border-width));
49
59
  border-style: var(--_border-style-resolved, var(--ui-radio-border-style));
50
60
  border-color: var(--_border-color-resolved, var(--ui-radio-border-color));
@@ -58,7 +68,7 @@
58
68
  /* centres the ::before dot */
59
69
  display: inline-grid;
60
70
  place-items: center;
61
- background-clip: padding-box;
71
+ background-clip: border-box;
62
72
 
63
73
  cursor: pointer;
64
74
 
@@ -109,7 +109,7 @@
109
109
  transparent 100%
110
110
  );
111
111
 
112
- &:where([dir="rtl"], [dir="rtl"] *) {
112
+ &:where(:dir(rtl)) {
113
113
  --_scroll-fade-gradient: linear-gradient(
114
114
  to left,
115
115
  transparent 0,
@@ -13,6 +13,7 @@
13
13
  * @uses ui-multiselect (multiselect.ts): JS-projected dropdown for
14
14
  * <select multiple> (base-select has no stable multi-select);
15
15
  * degrades to the native multi listbox without JS
16
+ * @uses --_touch-min (touch screens) — the trigger and every option row grow to the touch floor
16
17
  * @uses corner-shape — superellipse corners; unsupported browsers keep plain
17
18
  * rounded corners
18
19
  * @tokens --ui-select-* (@layer variables); picker panel reuses --ui-popover-* (owned in popover.css)
@@ -89,6 +90,18 @@
89
90
  appearance: base-select;
90
91
  }
91
92
 
93
+ /* Inline-edge names for the placement matrix's origins, resolved on the
94
+ select (where the matrix sets them) so RTL mirrors them; see popover.css. */
95
+ :where([data-ui~="select"]) {
96
+ --_origin-inline-start: left;
97
+ --_origin-inline-end: right;
98
+ }
99
+
100
+ :where([data-ui~="select"]:dir(rtl)) {
101
+ --_origin-inline-start: right;
102
+ --_origin-inline-end: left;
103
+ }
104
+
92
105
  :where([data-ui~="select"])::picker(select) {
93
106
  transform-origin: var(--ui-popover-origin);
94
107
  opacity: var(--ui-popover-opacity--start);
@@ -158,7 +171,7 @@
158
171
  min-inline-size: calc(var(--_min-w-len) + var(--_min-w-num) * var(--spacing));
159
172
  --_h-len: var(--_h-resolved, var(--ui-field-h));
160
173
  --_h-num: var(--_h-resolved, var(--ui-field-h));
161
- block-size: calc(var(--_h-len) + var(--_h-num) * var(--spacing));
174
+ block-size: max(calc(var(--_h-len) + var(--_h-num) * var(--spacing)), var(--_touch-min));
162
175
  --_pl-len: var(--_pl-resolved, var(--ui-select-pl));
163
176
  --_pl-num: var(--_pl-resolved, var(--ui-select-pl));
164
177
  padding-inline-start: calc(var(--_pl-len) + var(--_pl-num) * var(--spacing));
@@ -304,7 +317,7 @@
304
317
  display: flex;
305
318
  align-items: center;
306
319
  gap: var(--ui-option-gap);
307
- min-block-size: var(--ui-option-min-h);
320
+ min-block-size: max(var(--ui-option-min-h), var(--_touch-min));
308
321
  padding-inline: var(--ui-option-px);
309
322
 
310
323
  font-family: var(--ui-option-font-family);
@@ -434,7 +447,7 @@
434
447
  display: flex;
435
448
  align-items: center;
436
449
  gap: var(--ui-option-gap);
437
- min-block-size: var(--ui-option-min-h);
450
+ min-block-size: max(var(--ui-option-min-h), var(--_touch-min));
438
451
  padding-inline: var(--ui-option-px);
439
452
 
440
453
  font-family: var(--ui-option-font-family);
@@ -530,7 +543,7 @@
530
543
  :where([data-ui~="select"]:not([data-select-side]):not([data-select-align])),
531
544
  :where([data-ui~="select"]:not([data-select-side])[data-select-align="start"]) {
532
545
  --ui-popover-position-area: block-end span-inline-end;
533
- --ui-popover-origin: top center;
546
+ --ui-popover-origin: top var(--_origin-inline-start);
534
547
  --ui-popover-my: calc(var(--spacing) * 1.5);
535
548
  --ui-popover-mx: 0;
536
549
  }
@@ -546,7 +559,7 @@
546
559
  :where([data-ui~="select"])[data-select-side="bottom"][data-select-align="end"],
547
560
  :where([data-ui~="select"]:not([data-select-side])[data-select-align="end"]) {
548
561
  --ui-popover-position-area: block-end span-inline-start;
549
- --ui-popover-origin: top center;
562
+ --ui-popover-origin: top var(--_origin-inline-end);
550
563
  --ui-popover-my: calc(var(--spacing) * 1.5);
551
564
  --ui-popover-mx: 0;
552
565
  }
@@ -554,7 +567,7 @@
554
567
  :where([data-ui~="select"])[data-select-side="top"]:not([data-select-align]),
555
568
  :where([data-ui~="select"])[data-select-side="top"][data-select-align="start"] {
556
569
  --ui-popover-position-area: block-start span-inline-end;
557
- --ui-popover-origin: bottom center;
570
+ --ui-popover-origin: bottom var(--_origin-inline-start);
558
571
  --ui-popover-my: calc(var(--spacing) * 1.5);
559
572
  --ui-popover-mx: 0;
560
573
  }
@@ -568,7 +581,7 @@
568
581
 
569
582
  :where([data-ui~="select"])[data-select-side="top"][data-select-align="end"] {
570
583
  --ui-popover-position-area: block-start span-inline-start;
571
- --ui-popover-origin: bottom center;
584
+ --ui-popover-origin: bottom var(--_origin-inline-end);
572
585
  --ui-popover-my: calc(var(--spacing) * 1.5);
573
586
  --ui-popover-mx: 0;
574
587
  }
@@ -576,21 +589,21 @@
576
589
  :where([data-ui~="select"])[data-select-side="right"]:not([data-select-align]),
577
590
  :where([data-ui~="select"])[data-select-side="right"][data-select-align="start"] {
578
591
  --ui-popover-position-area: inline-end span-block-end;
579
- --ui-popover-origin: bottom left;
592
+ --ui-popover-origin: top var(--_origin-inline-start);
580
593
  --ui-popover-my: 0;
581
594
  --ui-popover-mx: calc(var(--spacing) * 1.5);
582
595
  }
583
596
 
584
597
  :where([data-ui~="select"])[data-select-side="right"][data-select-align="center"] {
585
598
  --ui-popover-position-area: inline-end span-all;
586
- --ui-popover-origin: center left;
599
+ --ui-popover-origin: center var(--_origin-inline-start);
587
600
  --ui-popover-my: 0;
588
601
  --ui-popover-mx: calc(var(--spacing) * 1.5);
589
602
  }
590
603
 
591
604
  :where([data-ui~="select"])[data-select-side="right"][data-select-align="end"] {
592
605
  --ui-popover-position-area: inline-end span-block-start;
593
- --ui-popover-origin: top left;
606
+ --ui-popover-origin: bottom var(--_origin-inline-start);
594
607
  --ui-popover-my: 0;
595
608
  --ui-popover-mx: calc(var(--spacing) * 1.5);
596
609
  }
@@ -598,21 +611,21 @@
598
611
  :where([data-ui~="select"])[data-select-side="left"]:not([data-select-align]),
599
612
  :where([data-ui~="select"])[data-select-side="left"][data-select-align="start"] {
600
613
  --ui-popover-position-area: inline-start span-block-end;
601
- --ui-popover-origin: bottom right;
614
+ --ui-popover-origin: top var(--_origin-inline-end);
602
615
  --ui-popover-my: 0;
603
616
  --ui-popover-mx: calc(var(--spacing) * 1.5);
604
617
  }
605
618
 
606
619
  :where([data-ui~="select"])[data-select-side="left"][data-select-align="center"] {
607
620
  --ui-popover-position-area: inline-start span-all;
608
- --ui-popover-origin: center right;
621
+ --ui-popover-origin: center var(--_origin-inline-end);
609
622
  --ui-popover-my: 0;
610
623
  --ui-popover-mx: calc(var(--spacing) * 1.5);
611
624
  }
612
625
 
613
626
  :where([data-ui~="select"])[data-select-side="left"][data-select-align="end"] {
614
627
  --ui-popover-position-area: inline-start span-block-start;
615
- --ui-popover-origin: top right;
628
+ --ui-popover-origin: bottom var(--_origin-inline-end);
616
629
  --ui-popover-my: 0;
617
630
  --ui-popover-mx: calc(var(--spacing) * 1.5);
618
631
  }
@@ -4,6 +4,8 @@
4
4
  * @layer variables, reset
5
5
  * @requires _layers.css, _variables.css
6
6
  * @uses appearance: none — redraws track + thumb from theme tokens
7
+ * @uses --_touch-min (touch screens) — the transparent input grows to the touch
8
+ * floor; the track stays --ui-slider-track-h and the thumb centred on it
7
9
  * @uses corner-shape — round by default, so circles stay circles; a hook takes any shape
8
10
  * @tokens --ui-slider-* (@layer variables, on :root so subtree hooks work)
9
11
  *
@@ -39,6 +41,7 @@
39
41
  -webkit-appearance: none;
40
42
  appearance: none;
41
43
  inline-size: 100%;
44
+ min-block-size: var(--_touch-min);
42
45
  background: transparent;
43
46
  cursor: grab;
44
47
  border-radius: var(--ui-slider-track-radius);
@@ -4,6 +4,8 @@
4
4
  * @layer variables, reset
5
5
  * @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-shadow), fields.css (--ui-field-* border/ring)
6
6
  * @uses appearance: none on input[role="switch"]
7
+ * @uses --_touch-min (touch screens) — the track keeps its size; an invisible ::after
8
+ * on the input, centred on it, is at least the touch floor square
7
9
  * @uses label:has(> input[role="switch"])::after — thumb drawn on label (no JS)
8
10
  * @uses oklch(from …) — checked/hover track tints
9
11
  * @uses corner-shape — round by default, so circles stay circles; a hook takes any shape
@@ -107,8 +109,17 @@
107
109
  }
108
110
 
109
111
  :where(input[role="switch"]) {
112
+ position: relative;
110
113
  appearance: none;
111
114
  flex-shrink: 0;
115
+
116
+ /* touch: the hit area, --_touch-min square at least; collapses to the track on a mouse
117
+ (the thumb is the label's ::after, so the input's own is free) */
118
+ &::after {
119
+ content: "";
120
+ position: absolute;
121
+ inset: min(0px, calc((100% - var(--_touch-min)) / 2));
122
+ }
112
123
  --_w-len: var(--_w-resolved, var(--ui-switch-track-w));
113
124
  --_w-num: var(--_w-resolved, var(--ui-switch-track-w));
114
125
  inline-size: calc(var(--_w-len) + var(--_w-num) * var(--spacing));
@@ -8,6 +8,7 @@
8
8
  * (@supports gated; checked-label fallback paints card fill without pill)
9
9
  * @uses anchor-scope — isolates --active-tab inside nested menus
10
10
  * @uses text-box, color-mix() — label trim and focus ring
11
+ * @uses --_touch-min (touch screens) — labels grow to the touch floor
11
12
  * @uses corner-shape — superellipse corners; unsupported browsers keep plain
12
13
  * rounded corners
13
14
  * @tokens --ui-tabs-* (@layer variables)
@@ -122,7 +123,7 @@
122
123
  font-weight: var(--ui-tabs-label-font-weight);
123
124
  line-height: var(--ui-tabs-label-leading);
124
125
 
125
- min-block-size: var(--ui-tabs-label-min-h);
126
+ min-block-size: max(var(--ui-tabs-label-min-h), var(--_touch-min));
126
127
  padding-inline: var(--ui-tabs-label-px);
127
128
 
128
129
  color: var(--ui-tabs-label-text);
@@ -15,6 +15,8 @@
15
15
  * @uses text-box: vertical trim (patchy browser support)
16
16
  * @uses corner-shape — superellipse corners; unsupported browsers keep plain
17
17
  * rounded corners
18
+ * @uses --_touch-min (touch screens) — the default and icon sizes grow to the touch
19
+ * floor; sm and icon-sm keep their box and extend an invisible ::after hit area
18
20
  * @tokens --ui-toggle-* (@layer variables;
19
21
  * default to the --ui-button-* family)
20
22
  * @consumedby toggle-group.css
@@ -220,7 +222,12 @@
220
222
 
221
223
  --_min-h-len: var(--_min-h-resolved, var(--_toggle-min-h, var(--ui-toggle-min-h)));
222
224
  --_min-h-num: var(--_min-h-resolved, var(--_toggle-min-h, var(--ui-toggle-min-h)));
223
- min-block-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
225
+ /* the touch floor: 0 on a mouse; a size that must stay small sets it to 0px */
226
+ --_touch-floor: var(--_touch-min);
227
+ min-block-size: max(
228
+ calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing)),
229
+ var(--_touch-floor)
230
+ );
224
231
  min-inline-size: max-content;
225
232
 
226
233
  --_px-len: var(--_px-resolved, var(--_toggle-px, var(--ui-toggle-px)));
@@ -504,11 +511,19 @@
504
511
  --_toggle-min-h: calc(var(--spacing) * 6);
505
512
  --_toggle-px: calc(var(--spacing) * 2);
506
513
  --_toggle-radius: var(--radius-sm);
514
+ /* dense by choice: the box stays small and ::after takes the touch floor */
515
+ --_touch-floor: 0px;
507
516
  }
508
517
 
509
518
  :where([data-ui~="toggle"][data-toggle-size="icon"]) {
510
- block-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
511
- inline-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
519
+ block-size: max(
520
+ calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing)),
521
+ var(--_touch-floor)
522
+ );
523
+ inline-size: max(
524
+ calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing)),
525
+ var(--_touch-floor)
526
+ );
512
527
  padding: 0;
513
528
  aspect-ratio: 1 / 1;
514
529
  }
@@ -519,10 +534,19 @@
519
534
  --_toggle-radius: var(--radius-sm);
520
535
  /* the hook, not a private: it must inherit to reach the icon */
521
536
  --ui-toggle-icon-size: calc(var(--spacing) * 3.5);
537
+ --_touch-floor: 0px;
522
538
 
523
539
  block-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
524
540
  inline-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
525
541
  padding: 0;
526
542
  aspect-ratio: 1 / 1;
527
543
  }
544
+
545
+ /* touch: sm and icon-sm keep their box; a transparent ::after centred on the toggle
546
+ (already position: relative) is at least --_touch-min square */
547
+ :where([data-ui~="toggle"]:is([data-toggle-size="sm"], [data-toggle-size="icon-sm"]))::after {
548
+ content: "";
549
+ position: absolute;
550
+ inset: min(0px, calc((100% - var(--_touch-min)) / 2));
551
+ }
528
552
  }