@zazz-ui/core 0.11.0 → 0.12.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 (79) hide show
  1. package/AUTHORING.md +3 -3
  2. package/CHANGELOG.md +120 -0
  3. package/README.md +2 -2
  4. package/dist/{csp-DR-s45Kg.js → csp-LRx1fynI.js} +1 -1
  5. package/dist/sri.json +46 -46
  6. package/dist/zazz.css +1 -1
  7. package/dist/zazz.js +1 -1
  8. package/editor/zazz.css-data.json +175 -3
  9. package/editor/zazz.html-data.json +32 -0
  10. package/editor/zazz.language-data.json +165 -32
  11. package/editor/zazz.lint-data.json +1691 -1612
  12. package/package.json +5 -4
  13. package/src/base/_defaults.css +6 -0
  14. package/src/base/_properties-2xl.css +2 -0
  15. package/src/base/_properties-lg.css +2 -0
  16. package/src/base/_properties-md.css +2 -0
  17. package/src/base/_properties-sm.css +2 -0
  18. package/src/base/_properties-xl.css +2 -0
  19. package/src/base/_properties.css +6 -0
  20. package/src/base/_shadows.css +28 -28
  21. package/src/base/_utilities-box.css +3 -2
  22. package/src/base/_utilities-effects.css +25 -4
  23. package/src/base/_utilities-tier-2xl.css +1 -0
  24. package/src/base/_utilities-tier-lg.css +1 -0
  25. package/src/base/_utilities-tier-md.css +1 -0
  26. package/src/base/_utilities-tier-sm.css +1 -0
  27. package/src/base/_utilities-tier-xl.css +1 -0
  28. package/src/base/_variables.css +16 -11
  29. package/src/base/csp.d.ts.map +1 -1
  30. package/src/base/csp.js +7 -3
  31. package/src/base/csp.ts +9 -3
  32. package/src/base/kit-styling.d.ts.map +1 -1
  33. package/src/base/kit-styling.js +170 -158
  34. package/src/base/kit-styling.ts +170 -158
  35. package/src/base/utilities.d.ts +4 -1
  36. package/src/base/utilities.d.ts.map +1 -1
  37. package/src/base/utilities.js +28 -1
  38. package/src/base/utilities.ts +33 -2
  39. package/src/base/zazz-element.d.ts +1 -1
  40. package/src/base/zazz-element.js +1 -1
  41. package/src/base/zazz-element.ts +1 -1
  42. package/src/manifest.d.ts +1 -1
  43. package/src/manifest.d.ts.map +1 -1
  44. package/src/manifest.js +10 -2
  45. package/src/manifest.ts +10 -2
  46. package/src/primitives/accordion/accordion.css +60 -14
  47. package/src/primitives/badge/badge.css +19 -9
  48. package/src/primitives/button/button.css +27 -14
  49. package/src/primitives/callout/callout.css +2 -0
  50. package/src/primitives/card/card-article.html +115 -0
  51. package/src/primitives/card/card-horizontal.html +83 -0
  52. package/src/primitives/card/card-login.html +56 -0
  53. package/src/primitives/card/card-product.html +78 -0
  54. package/src/primitives/card/card-subgrid.html +96 -295
  55. package/src/primitives/card/card.css +189 -9
  56. package/src/primitives/card/card.html +110 -147
  57. package/src/primitives/carousel/carousel.html +4 -4
  58. package/src/primitives/checkbox/checkbox.css +2 -0
  59. package/src/primitives/combobox/combobox.css +32 -6
  60. package/src/primitives/debug/audit-core.d.ts.map +1 -1
  61. package/src/primitives/debug/audit-core.js +17 -0
  62. package/src/primitives/debug/audit-core.ts +16 -0
  63. package/src/primitives/dialog/dialog.css +2 -0
  64. package/src/primitives/fields/fields.css +2 -0
  65. package/src/primitives/input/input.css +27 -4
  66. package/src/primitives/input-group/input-group.css +9 -3
  67. package/src/primitives/layout/layout.css +2 -0
  68. package/src/primitives/layout/layout.html +8 -11
  69. package/src/primitives/otp/otp.css +14 -2
  70. package/src/primitives/password-group/password-group.css +12 -3
  71. package/src/primitives/radio/radio.css +2 -0
  72. package/src/primitives/reveal/reveal.html +3 -3
  73. package/src/primitives/scroll-fade/scroll-fade.html +8 -12
  74. package/src/primitives/select/select.css +30 -6
  75. package/src/primitives/slider/slider.css +94 -44
  76. package/src/primitives/switch/switch.css +3 -2
  77. package/src/primitives/tabs/tabs.css +10 -2
  78. package/src/primitives/textarea/textarea.css +8 -4
  79. package/src/primitives/toggle/toggle.css +24 -2
@@ -1,19 +1,39 @@
1
1
  /**
2
- * card.css — Card ([data-ui~="card"])
2
+ * card.css: Card (ui-card | [data-ui~="card"])
3
3
  *
4
4
  * @layer variables, components
5
5
  * @requires _layers.css, _variables.css, _properties.css (--_*-resolved)
6
6
  * @uses corner-shape — superellipse corners; unsupported browsers keep plain
7
7
  * rounded corners
8
+ * @uses :has() — a header that holds only media bleeds to the card's edge;
9
+ * a horizontal card needs a header slot
10
+ * @uses @container (width >= 40rem) — a horizontal card lays out in two columns
11
+ * once its nearest container reaches sm, and stacks below that
8
12
  * @tokens --ui-card-* (@layer variables; named after the utilities they back)
9
13
  * @presets data-card-variant="outline" | "muted" | "floating"
14
+ * @presets data-card-orientation="vertical" | "horizontal"
10
15
  *
11
16
  * The card is a surface: a grid with a gap, the card colors, a radius, and
12
17
  * clipped overflow. The default card is bare (no padding, radius, or shadow), so
13
18
  * media can run edge to edge; each variant adds padding, the radius, and one
14
19
  * treatment. Every card keeps a 1px border, transparent unless a variant colors
15
20
  * it, so cards line up whatever their variant.
16
- * Its parts are plain elements laid out with utilities.
21
+ *
22
+ * Its parts are plain elements laid out with utilities, or the slots
23
+ * data-card-slot="header" | "body" | "footer" on direct children. A header that
24
+ * is an img/picture/video, a figure without a figcaption, or an element holding
25
+ * only an img/picture/video bleeds: negative margins pull it over the card's
26
+ * padding to the clipped, rounded edge. The bleed follows --p and --ui-card-p,
27
+ * not the per-side padding utilities.
28
+ *
29
+ * data-card-orientation="horizontal" puts the header in a start column
30
+ * (--ui-card-header-w, default 40%) spanning the rows, with the body above the footer in the
31
+ * end column. It applies when the nearest container is at least sm (40rem) wide,
32
+ * like the --*--sm utilities, and the card stacks below that; give the card's
33
+ * parent --container-type: inline-size to follow the parent's width. Don't make
34
+ * a horizontal card a container itself: its slots would query it, not the parent.
35
+ * Vertical is the default; the attribute only names it.
36
+ *
17
37
  * Every utility-backed declaration reads one chain, highest first:
18
38
  * var(--_<utility>-resolved, var(--_card-<utility>, var(--ui-card-<utility>)))
19
39
  */
@@ -21,6 +41,8 @@
21
41
  @layer variables {
22
42
  :root {
23
43
  /* a bare card has no surface; the outline and floating variants paint --color-card */
44
+ --ui-card-display: grid;
45
+ --ui-card-place-content: start stretch;
24
46
  --ui-card-bg: transparent;
25
47
  --ui-card-text: var(--color-card-foreground);
26
48
  --ui-card-radius: var(--radius-lg);
@@ -34,6 +56,9 @@
34
56
  /* dual-mode: a scale number or a length */
35
57
  --ui-card-gap: var(--space-sm);
36
58
  --ui-card-p: 0;
59
+
60
+ /* horizontal: the header column's width */
61
+ --ui-card-header-w: 40%;
37
62
  }
38
63
  }
39
64
 
@@ -73,15 +98,25 @@
73
98
  inherits: false;
74
99
  }
75
100
 
101
+ /* The resolved padding, inherited so a media header can bleed over it. Every card
102
+ sets its own, so it never carries into a nested card. */
103
+ @property --_card-inset {
104
+ syntax: "*";
105
+ inherits: true;
106
+ }
107
+
76
108
  @layer ui.components {
77
- :where([data-ui~="card"]) {
78
- display: grid;
109
+ :where(ui-card, [data-ui~="card"]) {
110
+ display: var(--ui-card-display);
111
+ place-content: var(--ui-card-place-content);
112
+ grid-template-columns: minmax(0, 1fr);
79
113
  --_gap-len: var(--_gap-resolved, var(--ui-card-gap));
80
114
  --_gap-num: var(--_gap-resolved, var(--ui-card-gap));
81
115
  gap: calc(var(--_gap-len) + var(--_gap-num) * var(--spacing));
82
116
  --_p-len: var(--_p-resolved, var(--_card-p, var(--ui-card-p)));
83
117
  --_p-num: var(--_p-resolved, var(--_card-p, var(--ui-card-p)));
84
- padding: calc(var(--_p-len) + var(--_p-num) * var(--spacing));
118
+ --_card-inset: calc(var(--_p-len) + var(--_p-num) * var(--spacing));
119
+ padding: var(--_card-inset);
85
120
  color: var(--_text-resolved, var(--_card-text, var(--ui-card-text)));
86
121
  background-color: var(--_bg-resolved, var(--_card-bg, var(--ui-card-bg)));
87
122
  border-width: var(
@@ -108,26 +143,171 @@
108
143
  CARD VARIANTS — data-card-variant writes the privates
109
144
  =========================================================================== */
110
145
 
111
- :where([data-ui~="card"]:not([data-card-variant])) {
146
+ :where(ui-card:not([data-card-variant]), [data-ui~="card"]:not([data-card-variant])) {
112
147
  --_card-radius: 0;
113
148
  }
114
149
 
115
- :where([data-ui~="card"][data-card-variant="outline"]) {
150
+ :where(ui-card[data-card-variant="outline"], [data-ui~="card"][data-card-variant="outline"]) {
116
151
  --_card-p: var(--space-md);
117
152
  --_card-border-color: var(--color-border);
118
153
  }
119
154
 
120
- :where([data-ui~="card"][data-card-variant="muted"]) {
155
+ :where(ui-card[data-card-variant="muted"], [data-ui~="card"][data-card-variant="muted"]) {
121
156
  --_card-p: var(--space-md);
122
157
  --_card-bg: var(--color-muted);
123
158
  --_card-text: var(--color-foreground);
124
159
  }
125
160
 
126
- :where([data-ui~="card"][data-card-variant="floating"]) {
161
+ :where(ui-card[data-card-variant="floating"], [data-ui~="card"][data-card-variant="floating"]) {
127
162
  --_card-p: var(--space-md);
128
163
  --_card-bg: var(--color-card);
129
164
  --_card-border-color: var(--color-border);
130
165
  --_card-text: var(--color-card-foreground);
131
166
  --_card-shadow: var(--shadow-sm);
132
167
  }
168
+
169
+ /* ===========================================================================
170
+ CARD SLOTS — header, body, footer on direct children
171
+ =========================================================================== */
172
+
173
+ /* a media header bleeds over the card's padding to its clipped edge */
174
+ :where(
175
+ :is(ui-card, [data-ui~="card"])
176
+ > [data-card-slot~="header"]:is(
177
+ img,
178
+ picture,
179
+ video,
180
+ figure:not(:has(> figcaption)),
181
+ :has(> :is(img, picture, video):only-child)
182
+ )
183
+ ) {
184
+ margin-inline: calc(var(--_card-inset) * -1);
185
+ margin-block-start: calc(var(--_card-inset) * -1);
186
+ }
187
+
188
+ /* ===========================================================================
189
+ CARD ORIENTATION — data-card-orientation; vertical is the default
190
+ =========================================================================== */
191
+
192
+ :where(
193
+ ui-card[data-card-orientation="vertical"],
194
+ [data-ui~="card"][data-card-orientation="vertical"]
195
+ ) {
196
+ grid-template-columns: minmax(0, 1fr);
197
+ }
198
+
199
+ @container (width >= 40rem) {
200
+ :where(
201
+ :is(
202
+ ui-card[data-card-orientation="horizontal"],
203
+ [data-ui~="card"][data-card-orientation="horizontal"]
204
+ ):has(> [data-card-slot~="header"])
205
+ ) {
206
+ grid-template-columns: var(--ui-card-header-w) minmax(0, 1fr);
207
+ grid-template-rows: 1fr auto;
208
+ }
209
+
210
+ :where(
211
+ :is(
212
+ ui-card[data-card-orientation="horizontal"],
213
+ [data-ui~="card"][data-card-orientation="horizontal"]
214
+ ):has(> [data-card-slot~="header"]):not(:has(> [data-card-slot~="footer"]))
215
+ ) {
216
+ grid-template-rows: 1fr;
217
+ }
218
+
219
+ :where(
220
+ :is(
221
+ ui-card[data-card-orientation="horizontal"],
222
+ [data-ui~="card"][data-card-orientation="horizontal"]
223
+ ):has(> [data-card-slot~="header"])
224
+ > [data-card-slot~="header"]
225
+ ) {
226
+ grid-column: 1;
227
+ grid-row: 1 / -1;
228
+ }
229
+
230
+ :where(
231
+ :is(
232
+ ui-card[data-card-orientation="horizontal"],
233
+ [data-ui~="card"][data-card-orientation="horizontal"]
234
+ ):has(> [data-card-slot~="header"])
235
+ > [data-card-slot~="body"]
236
+ ) {
237
+ grid-column: 2;
238
+ grid-row: 1;
239
+ /* the row stretches to the header; keep the body's own rows at the top */
240
+ align-content: start;
241
+ }
242
+
243
+ :where(
244
+ :is(
245
+ ui-card[data-card-orientation="horizontal"],
246
+ [data-ui~="card"][data-card-orientation="horizontal"]
247
+ ):has(> [data-card-slot~="header"])
248
+ > [data-card-slot~="footer"]
249
+ ) {
250
+ grid-column: 2;
251
+ grid-row: 2;
252
+ }
253
+
254
+ /* the media header bleeds on its three outer sides */
255
+ :where(
256
+ :is(
257
+ ui-card[data-card-orientation="horizontal"],
258
+ [data-ui~="card"][data-card-orientation="horizontal"]
259
+ )
260
+ > [data-card-slot~="header"]:is(
261
+ img,
262
+ picture,
263
+ video,
264
+ figure:not(:has(> figcaption)),
265
+ :has(> :is(img, picture, video):only-child)
266
+ )
267
+ ) {
268
+ margin-block: calc(var(--_card-inset) * -1);
269
+ margin-inline-end: 0;
270
+ }
271
+
272
+ /* the media fills the column's height and crops to it. A bare img or video
273
+ is sized to its grid area plus the bleed (WebKit won't stretch a replaced
274
+ grid item), and the media inside a wrapper takes the wrapper's full box */
275
+ :where(
276
+ :is(
277
+ ui-card[data-card-orientation="horizontal"],
278
+ [data-ui~="card"][data-card-orientation="horizontal"]
279
+ )
280
+ > [data-card-slot~="header"]:is(img, video)
281
+ ) {
282
+ inline-size: calc(100% + var(--_card-inset));
283
+ max-inline-size: none;
284
+ block-size: calc(100% + 2 * var(--_card-inset));
285
+ object-fit: cover;
286
+ }
287
+
288
+ :where(
289
+ :is(
290
+ ui-card[data-card-orientation="horizontal"],
291
+ [data-ui~="card"][data-card-orientation="horizontal"]
292
+ )
293
+ > [data-card-slot~="header"]:is(
294
+ picture,
295
+ figure:not(:has(> figcaption)),
296
+ :has(> :is(img, picture, video):only-child)
297
+ )
298
+ > :is(img, video, picture),
299
+ :is(
300
+ ui-card[data-card-orientation="horizontal"],
301
+ [data-ui~="card"][data-card-orientation="horizontal"]
302
+ )
303
+ > [data-card-slot~="header"]
304
+ > picture
305
+ > img
306
+ ) {
307
+ display: block;
308
+ inline-size: 100%;
309
+ block-size: 100%;
310
+ object-fit: cover;
311
+ }
312
+ }
133
313
  }
@@ -1,173 +1,136 @@
1
- <a
2
- href="#"
1
+ <div
3
2
  style="
4
3
  --display: grid;
5
- --cursor: pointer;
4
+ --template-cols: repeat(auto-fit, minmax(min(100%, max(14rem, 40%)), 1fr));
5
+ --gap: 6;
6
+ --w: 100%;
6
7
  "
7
8
  >
8
- <div data-ui="card">
9
+ <ui-card>
9
10
  <figure
11
+ data-card-slot="header"
10
12
  style="
11
- --display: grid;
12
13
  --aspect: 3 / 2;
13
- --radius-t: 2.5;
14
- --overflow: clip;
14
+ --radius: var(--ui-card-radius);
15
+ --overflow: hidden;
16
+ "
17
+ >
18
+ <img
19
+ width="600"
20
+ height="400"
21
+ loading="lazy"
22
+ src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?auto=format&fit=crop&w=600&h=400&q=60"
23
+ alt="Elephants crossing a dusty riverbed"
24
+ style="
25
+ --size: 100%;
26
+ --object-fit: cover;
27
+ "
28
+ />
29
+ </figure>
30
+ <hgroup
31
+ data-card-slot="body"
32
+ style="
33
+ --display: grid;
34
+ --gap: 1;
15
35
  "
16
36
  >
37
+ <h3 data-ui="text-lg">Default</h3>
38
+ <p data-ui="text-sm" style="--text: var(--color-muted-foreground)">
39
+ Bare: no padding, radius, or surface, so media runs edge to edge.
40
+ </p>
41
+ </hgroup>
42
+ <footer data-card-slot="footer">
43
+ <a href="#" data-ui="button" data-button-variant="outline">Read field notes</a>
44
+ </footer>
45
+ </ui-card>
46
+ <ui-card data-card-variant="outline">
47
+ <figure data-card-slot="header" style="--aspect: 3 / 2">
17
48
  <img
18
- width="300"
19
- height="200"
49
+ width="600"
50
+ height="400"
20
51
  loading="lazy"
21
- src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?auto=format&fit=crop&w=300&h=200&q=60"
52
+ src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?auto=format&fit=crop&w=600&h=400&q=60"
22
53
  alt="Elephants crossing a dusty riverbed"
23
54
  style="
24
55
  --size: 100%;
25
- --opacity: 1;
26
- --opacity--hover: 0.75;
27
- --scale: 1;
28
- --scale--hover: 1.02;
29
- --transition: var(--default-transition);
30
56
  --object-fit: cover;
31
57
  "
32
58
  />
33
59
  </figure>
34
- <div
60
+ <hgroup
61
+ data-card-slot="body"
35
62
  style="
36
63
  --display: grid;
37
- --px: 4;
38
- --pb: 4;
39
- --gap: 4;
64
+ --gap: 1;
40
65
  "
41
66
  >
42
- <header
67
+ <h3 data-ui="text-lg">Outline</h3>
68
+ <p data-ui="text-sm" style="--text: var(--color-muted-foreground)">
69
+ Padding, the radius, and a border. The header image bleeds to the card's edges.
70
+ </p>
71
+ </hgroup>
72
+ <footer data-card-slot="footer">
73
+ <a href="#" data-ui="button" data-button-variant="outline">Read field notes</a>
74
+ </footer>
75
+ </ui-card>
76
+ <ui-card data-card-variant="muted">
77
+ <figure data-card-slot="header" style="--aspect: 3 / 2">
78
+ <img
79
+ width="600"
80
+ height="400"
81
+ loading="lazy"
82
+ src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?auto=format&fit=crop&w=600&h=400&q=60"
83
+ alt="Elephants crossing a dusty riverbed"
43
84
  style="
44
- --display: grid;
45
- --gap: 2;
85
+ --size: 100%;
86
+ --object-fit: cover;
46
87
  "
47
- >
48
- <div
49
- style="
50
- --display: flex;
51
- --items: center;
52
- --gap: 2;
53
- "
54
- >
55
- <span data-ui="badge" data-badge-variant="muted">Research</span>
56
- </div>
57
- <hgroup
58
- style="
59
- --display: grid;
60
- --gap: 2;
61
- "
62
- >
63
- <h3
64
- style="
65
- --font-size: var(--font-size-lg);
66
- --font-family: var(--font-family-heading);
67
- --leading: var(--leading-lg);
68
- --tracking: var(--tracking-lg);
69
- "
70
- >
71
- Migration patterns
72
- </h3>
73
- <p
74
- style="
75
- --font-size: var(--font-size-sm);
76
- --leading: var(--leading-sm);
77
- --tracking: var(--tracking-sm);
78
- --line-clamp: 2;
79
- --text: var(--color-muted-foreground);
80
- "
81
- >
82
- Satellite collars reveal ancient routes herds still follow each dry season across the
83
- floodplain.
84
- </p>
85
- </hgroup>
86
- </header>
87
- <footer
88
+ />
89
+ </figure>
90
+ <hgroup
91
+ data-card-slot="body"
92
+ style="
93
+ --display: grid;
94
+ --gap: 1;
95
+ "
96
+ >
97
+ <h3 data-ui="text-lg">Muted</h3>
98
+ <p data-ui="text-sm" style="--text: var(--color-muted-foreground)">
99
+ Padding, the radius, and the muted surface, for quieter groupings.
100
+ </p>
101
+ </hgroup>
102
+ <footer data-card-slot="footer">
103
+ <a href="#" data-ui="button" data-button-variant="primary">Read field notes</a>
104
+ </footer>
105
+ </ui-card>
106
+ <ui-card data-card-variant="floating">
107
+ <figure data-card-slot="header" style="--aspect: 3 / 2">
108
+ <img
109
+ width="600"
110
+ height="400"
111
+ loading="lazy"
112
+ src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?auto=format&fit=crop&w=600&h=400&q=60"
113
+ alt="Elephants crossing a dusty riverbed"
88
114
  style="
89
- --display: grid;
90
- --justify: start;
91
- --pt: 4;
92
- --gap: 4;
93
- --border-t: 1;
115
+ --size: 100%;
116
+ --object-fit: cover;
94
117
  "
95
- >
96
- <div
97
- style="
98
- --display: flex;
99
- --items: center;
100
- --gap: 2;
101
- "
102
- >
103
- <figure
104
- role="img"
105
- style="
106
- --display: grid-pile;
107
- --size: 11;
108
- --border-color: var(--color-border);
109
- --border-width: 1px;
110
- --radius: full;
111
- --overflow: clip;
112
- "
113
- >
114
- <img
115
- width="64"
116
- height="64"
117
- loading="lazy"
118
- src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?auto=format&fit=facearea&facepad=2&w=64&h=64&q=90"
119
- alt="John Doe"
120
- aria-hidden="true"
121
- style="
122
- --order: 9999;
123
- --size: 100%;
124
- --bg: transparent;
125
- --object-fit: cover;
126
- "
127
- />
128
- <figcaption
129
- style="
130
- --display: flex;
131
- --items: center;
132
- --justify: center;
133
- --order: -9999;
134
- --size: 100%;
135
- --font-size: var(--font-size-md);
136
- --font-weight: strong;
137
- --leading: var(--leading-md);
138
- --tracking: var(--tracking-md);
139
- --text-align: center;
140
- --text: var(--color-primary-foreground);
141
- --bg: var(--color-primary);
142
- "
143
- >
144
- <span style="--sr: only">John Doe</span>
145
- <span aria-hidden="true">JD</span>
146
- </figcaption>
147
- </figure>
148
- <div style="--display: flex-col">
149
- <span
150
- style="
151
- --font-size: var(--font-size-sm);
152
- --font-weight: strong;
153
- --leading: var(--leading-sm);
154
- --leading: 1;
155
- --tracking: var(--tracking-sm);
156
- "
157
- >John Doe</span
158
- >
159
- <span
160
- style="
161
- --font-size: var(--font-size-xs);
162
- --leading: var(--leading-xs);
163
- --tracking: var(--tracking-xs);
164
- --text: var(--color-muted-foreground);
165
- "
166
- >Founder, ACME Inc.</span
167
- >
168
- </div>
169
- </div>
170
- </footer>
171
- </div>
172
- </div>
173
- </a>
118
+ />
119
+ </figure>
120
+ <hgroup
121
+ data-card-slot="body"
122
+ style="
123
+ --display: grid;
124
+ --gap: 1;
125
+ "
126
+ >
127
+ <h3 data-ui="text-lg">Floating</h3>
128
+ <p data-ui="text-sm" style="--text: var(--color-muted-foreground)">
129
+ Padding, the radius, the card surface, a border, and a small shadow.
130
+ </p>
131
+ </hgroup>
132
+ <footer data-card-slot="footer">
133
+ <a href="#" data-ui="button" data-button-variant="primary">Read field notes</a>
134
+ </footer>
135
+ </ui-card>
136
+ </div>
@@ -97,7 +97,7 @@
97
97
  --gap: 4;
98
98
  --text: var(--color-card-foreground);
99
99
  --bg: var(--color-card);
100
- --shadow: var(--shadow-sm);
100
+ --border: 1;
101
101
  --radius: 2.5;
102
102
  --overflow: clip;
103
103
  "
@@ -239,7 +239,7 @@
239
239
  --gap: 4;
240
240
  --text: var(--color-card-foreground);
241
241
  --bg: var(--color-card);
242
- --shadow: var(--shadow-sm);
242
+ --border: 1;
243
243
  --radius: 2.5;
244
244
  --overflow: clip;
245
245
  "
@@ -381,7 +381,7 @@
381
381
  --gap: 4;
382
382
  --text: var(--color-card-foreground);
383
383
  --bg: var(--color-card);
384
- --shadow: var(--shadow-sm);
384
+ --border: 1;
385
385
  --radius: 2.5;
386
386
  --overflow: clip;
387
387
  "
@@ -523,7 +523,7 @@
523
523
  --gap: 4;
524
524
  --text: var(--color-card-foreground);
525
525
  --bg: var(--color-card);
526
- --shadow: var(--shadow-sm);
526
+ --border: 1;
527
527
  --radius: 2.5;
528
528
  --overflow: clip;
529
529
  "
@@ -48,6 +48,8 @@
48
48
  --_size-num: var(--_size-resolved, var(--ui-checkbox-size));
49
49
  inline-size: calc(var(--_size-len) + var(--_size-num) * var(--spacing));
50
50
  block-size: calc(var(--_size-len) + var(--_size-num) * var(--spacing));
51
+ min-inline-size: var(--spacing-control-min);
52
+ min-block-size: var(--spacing-control-min);
51
53
 
52
54
  background-color: var(--_bg-resolved, var(--ui-checkbox-bg));
53
55
 
@@ -7,7 +7,8 @@
7
7
  * select.css (--ui-option-*, --ui-select-picker-icon-*),
8
8
  * menu.css (--ui-menu-shadow)
9
9
  * @uses [popover="manual"]: panel opened/closed by combobox.ts
10
- * @uses --_touch-min (touch screens): the control grows to the touch floor; tag-remove
10
+ * @uses --_touch-min (touch screens): the control grows to the touch floor (each inline
11
+ * side gains half of what its height grew); tag-remove
11
12
  * keeps its box and extends an invisible ::after hit area (the trigger needs none:
12
13
  * the whole control is one hit target)
13
14
  * @uses anchor-name, anchor-scope, position-anchor: tether panel to the control
@@ -107,19 +108,39 @@
107
108
  block-size: calc(var(--_h-len) + var(--_h-num) * var(--spacing));
108
109
  --_min-h-len: var(--_min-h-resolved, var(--ui-combobox-control-min-h));
109
110
  --_min-h-num: var(--_min-h-resolved, var(--ui-combobox-control-min-h));
111
+ /* the last term keeps one line plus --ui-field-py and the border above and below at a small
112
+ --spacing (see input.css) */
110
113
  min-block-size: max(
111
114
  calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing)),
112
- var(--_touch-min)
115
+ var(--_touch-min),
116
+ calc(
117
+ 1lh + 2 *
118
+ (var(--ui-field-py) + var(--_border-width-resolved, var(--ui-combobox-border-width)))
119
+ )
120
+ );
121
+ /* half of what the touch floor added to the height, on each inline side. The height
122
+ is the larger of --h and --min-h: the single control sets one and the multiselect
123
+ the other, and the unset one (auto) reads as 0 */
124
+ --_touch-px: max(
125
+ 0px,
126
+ (
127
+ var(--_touch-min) -
128
+ max(
129
+ calc(var(--_h-len) + var(--_h-num) * var(--spacing)),
130
+ calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing))
131
+ )
132
+ ) /
133
+ 2
113
134
  );
114
135
  --_py-len: var(--_py-resolved, var(--ui-combobox-control-py));
115
136
  --_py-num: var(--_py-resolved, var(--ui-combobox-control-py));
116
137
  padding-block: calc(var(--_py-len) + var(--_py-num) * var(--spacing));
117
138
  --_pl-len: var(--_pl-resolved, var(--ui-combobox-pl));
118
139
  --_pl-num: var(--_pl-resolved, var(--ui-combobox-pl));
119
- padding-inline-start: calc(var(--_pl-len) + var(--_pl-num) * var(--spacing));
140
+ padding-inline-start: calc(var(--_pl-len) + var(--_pl-num) * var(--spacing) + var(--_touch-px));
120
141
  --_pr-len: var(--_pr-resolved, var(--ui-combobox-pr));
121
142
  --_pr-num: var(--_pr-resolved, var(--ui-combobox-pr));
122
- padding-inline-end: calc(var(--_pr-len) + var(--_pr-num) * var(--spacing));
143
+ padding-inline-end: calc(var(--_pr-len) + var(--_pr-num) * var(--spacing) + var(--_touch-px));
123
144
 
124
145
  font-size: var(--_font-size-resolved, var(--ui-field-font-size));
125
146
  line-height: var(--_leading-resolved, var(--ui-field-leading));
@@ -332,6 +353,10 @@
332
353
  flex-shrink: 0;
333
354
  inline-size: var(--ui-combobox-tag-remove-size);
334
355
  block-size: var(--ui-combobox-tag-remove-size);
356
+ min-inline-size: var(--spacing-control-min);
357
+ min-block-size: var(--spacing-control-min);
358
+ /* the floor never makes the tag taller: what it adds hangs into the tag's padding */
359
+ margin-block: min(0px, (var(--ui-combobox-tag-remove-size) - var(--spacing-control-min)) / 2);
335
360
  border-radius: var(--ui-combobox-tag-remove-radius);
336
361
  corner-shape: var(--ui-combobox-tag-remove-corner-shape);
337
362
  opacity: var(--ui-combobox-tag-remove-opacity);
@@ -350,8 +375,9 @@
350
375
 
351
376
  :where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="tag-remove"]::before {
352
377
  content: "";
353
- inline-size: 100%;
354
- block-size: 100%;
378
+ /* the glyph keeps its own size inside the floored button */
379
+ inline-size: var(--ui-combobox-tag-remove-size);
380
+ block-size: var(--ui-combobox-tag-remove-size);
355
381
  background-color: var(--ui-combobox-tag-remove-color);
356
382
  mask: var(--ui-combobox-tag-remove-mask) center / contain no-repeat;
357
383
  }