@sigx/zero-daisyui 0.2.0-beta.2 → 0.2.0-beta.4

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 (61) hide show
  1. package/README.md +8 -0
  2. package/dist/components.d.ts +3 -2
  3. package/dist/css/components/button.css +6 -0
  4. package/dist/css/components/progress.css +8 -0
  5. package/dist/css/components/select.css +12 -0
  6. package/dist/css/components/slider.css +10 -0
  7. package/dist/css/components/tabs.css +191 -19
  8. package/dist/css/index.css +227 -19
  9. package/dist/lynx/components/alert.css +1 -1
  10. package/dist/lynx/components/avatar.css +22 -7
  11. package/dist/lynx/components/badge.css +1 -1
  12. package/dist/lynx/components/button.css +6 -1
  13. package/dist/lynx/components/checkbox.css +23 -9
  14. package/dist/lynx/components/combobox.css +2 -2
  15. package/dist/lynx/components/countdown.css +1 -1
  16. package/dist/lynx/components/dialog.css +3 -3
  17. package/dist/lynx/components/divider.css +18 -19
  18. package/dist/lynx/components/drawer.css +2 -2
  19. package/dist/lynx/components/file-upload.css +18 -7
  20. package/dist/lynx/components/indicator.css +1 -1
  21. package/dist/lynx/components/input.css +2 -2
  22. package/dist/lynx/components/join.css +1 -1
  23. package/dist/lynx/components/kbd.css +1 -1
  24. package/dist/lynx/components/menu.css +1 -1
  25. package/dist/lynx/components/native-select.css +1 -1
  26. package/dist/lynx/components/number-input.css +2 -2
  27. package/dist/lynx/components/pagination.css +92 -23
  28. package/dist/lynx/components/popover.css +2 -2
  29. package/dist/lynx/components/progress.css +17 -25
  30. package/dist/lynx/components/radial-progress.css +22 -24
  31. package/dist/lynx/components/radio-group.css +23 -9
  32. package/dist/lynx/components/rating-group.css +19 -23
  33. package/dist/lynx/components/select.css +2 -2
  34. package/dist/lynx/components/slider.css +3 -0
  35. package/dist/lynx/components/spinner.css +22 -19
  36. package/dist/lynx/components/status.css +27 -20
  37. package/dist/lynx/components/steps.css +67 -18
  38. package/dist/lynx/components/switch.css +79 -37
  39. package/dist/lynx/components/table.css +51 -8
  40. package/dist/lynx/components/tabs.css +222 -21
  41. package/dist/lynx/components/textarea.css +1 -1
  42. package/dist/lynx/components/timeline.css +27 -20
  43. package/dist/lynx/components/toggle-group.css +2 -2
  44. package/dist/lynx/components/toggle.css +1 -1
  45. package/dist/lynx/components/tooltip.css +1 -1
  46. package/dist/lynx/index.css +786 -318
  47. package/dist/lynx/manifest.json +63 -13
  48. package/dist/manifest.json +61 -11
  49. package/dist/recipes.d.ts +28 -0
  50. package/dist/recipes.d.ts.map +1 -1
  51. package/dist/recipes.js +490 -75
  52. package/dist/recipes.js.map +1 -1
  53. package/dist/register.d.ts +2 -3
  54. package/dist/report.json +424 -33
  55. package/dist/tokens.d.ts +17 -5
  56. package/dist/tokens.d.ts.map +1 -1
  57. package/dist/tokens.js +22 -8
  58. package/dist/tokens.js.map +1 -1
  59. package/package.json +6 -6
  60. package/src/recipes.ts +493 -76
  61. package/src/tokens.ts +24 -8
package/src/recipes.ts CHANGED
@@ -187,6 +187,34 @@ const withPresence = (presence: PartStyles, styles: PartStyles): PartStyles => (
187
187
  ),
188
188
  });
189
189
 
190
+ /**
191
+ * daisy's three tab flavors (#377): `tabs-border` — daisy's own default look,
192
+ * an underline under the active tab — plus `tabs-lift` (bordered tab lifting
193
+ * out of a baseline) and `tabs-box` (list on a base-200 surface, active tab a
194
+ * raised base-100 pill). All three ported from daisyUI 5.5.19
195
+ * `components/tab.css`.
196
+ *
197
+ * The base holds only flavor-neutral structure. Every flavor's chrome —
198
+ * including the box surface this recipe used to keep in `parts` — lives in
199
+ * its own `variant` entry, because the web emitter twins the DEFAULT value's
200
+ * rules as `:not([data-variant])`: a default that leaned on base styles would
201
+ * leak them into the other two flavors, and the box chrome in base is exactly
202
+ * what `variant="border"` must not inherit.
203
+ *
204
+ * Sizing goes through a `--tab-py`/`--tab-px` pair rather than a literal
205
+ * `padding` per size — daisy's own mechanism (`--tab-p`/`--tab-paddings` in
206
+ * tab.css). It is what lets `lift` move `var(--border)` between border and
207
+ * padding without restating the size ramp per flavor: axis rules all target
208
+ * the same part with equal specificity, so a `lift` padding literal would
209
+ * either lose to or beat the size axis by source order alone.
210
+ *
211
+ * variant × color: `color` paints the active tab's INK (`roleInk`, not the
212
+ * raw role — #210: raw roles are fill colours with no contrast floor as ink).
213
+ * `border`'s underline and `lift`'s label follow it via `currentColor`;
214
+ * `box` is the one flavor where daisy fills the active pill with the role
215
+ * (`checked:bg-primary checked:text-primary-content` in its docs), so a
216
+ * compound per role restores the fill+`-content` pair there.
217
+ */
190
218
  export const tabs: RecipeInput = {
191
219
  component: 'tabs',
192
220
  parts: {
@@ -197,10 +225,6 @@ export const tabs: RecipeInput = {
197
225
  base: {
198
226
  display: 'inline-flex',
199
227
  alignSelf: 'flex-start',
200
- padding: 'var(--space-xs)',
201
- gap: 'var(--space-xs)',
202
- background: 'var(--color-base-200)',
203
- borderRadius: 'var(--radius-field)',
204
228
  },
205
229
  },
206
230
  tab: {
@@ -208,21 +232,31 @@ export const tabs: RecipeInput = {
208
232
  appearance: 'none',
209
233
  border: 'none',
210
234
  background: 'transparent',
211
- padding: 'var(--space-sm) var(--space-xl)',
235
+ '--tab-py': 'var(--space-sm)',
236
+ '--tab-px': 'var(--space-xl)',
237
+ // daisy's per-size underline/corner cap: `--tab-radius-min`
238
+ // in tab.css, `calc(.75rem - var(--border))` at md. Declared
239
+ // here (not in `lift`, its only reader) so the size axis can
240
+ // override it — a definition inside the variant entry would
241
+ // beat the size rules on source order.
242
+ '--tab-radius-min': 'calc(0.75rem - var(--border))',
243
+ padding: 'var(--tab-py) var(--tab-px)',
212
244
  fontSize: 'var(--text-sm)',
213
245
  fontWeight: 'var(--weight-semibold)',
214
246
  color: 'color-mix(in oklab, var(--color-base-content) 60%, transparent)',
215
- borderRadius: 'calc(var(--radius-field) - 0.25rem)',
216
247
  cursor: 'pointer',
248
+ // For the flavors' ::before marks (border's underline, lift's
249
+ // corner shoulders) — daisy's base `.tab` is `position:
250
+ // relative` for the same reason.
251
+ position: 'relative',
217
252
  transition: 'background var(--duration-normal) var(--ease-standard), color var(--duration-normal) var(--ease-standard)',
218
253
  },
219
254
  states: {
220
255
  hover: { color: 'var(--color-base-content)' },
221
- active: {
222
- background: 'var(--color-base-100)',
223
- color: 'var(--color-base-content)',
224
- boxShadow: 'var(--shadow-sm)',
225
- },
256
+ // Full-strength ink is the one active mark all three flavors
257
+ // share; each flavor's own chrome (underline, lift, pill)
258
+ // lives in its `variant` entry.
259
+ active: { color: 'var(--color-base-content)' },
226
260
  inactive: {},
227
261
  disabled: { opacity: 'var(--disabled-opacity)', cursor: 'not-allowed' },
228
262
  ...focusRing,
@@ -235,34 +269,226 @@ export const tabs: RecipeInput = {
235
269
  },
236
270
  variants: {
237
271
  size: {
238
- xs: { tab: { base: { fontSize: 'var(--text-xs)', padding: 'var(--space-2xs) var(--space-md)' } } },
239
- sm: { tab: { base: { fontSize: 'var(--text-xs)', padding: 'var(--space-xs) var(--space-lg)' } } },
272
+ xs: { tab: { base: { fontSize: 'var(--text-xs)', '--tab-py': 'var(--space-2xs)', '--tab-px': 'var(--space-md)', '--tab-radius-min': 'calc(0.5rem - var(--border))' } } },
273
+ sm: { tab: { base: { fontSize: 'var(--text-xs)', '--tab-py': 'var(--space-xs)', '--tab-px': 'var(--space-lg)', '--tab-radius-min': 'calc(0.5rem - var(--border))' } } },
240
274
  // `md` is the un-attributed render: the base already IS the
241
275
  // middle step, so restating it here would be a second copy free
242
276
  // to drift. An empty entry emits no rule and keeps the base.
243
277
  md: {},
244
- lg: { tab: { base: { fontSize: 'var(--text-md)', padding: 'var(--space-md) var(--space-2xl)' } } },
245
- xl: { tab: { base: { fontSize: 'var(--text-lg)', padding: 'var(--space-lg) var(--space-2xl)' } } },
278
+ lg: { tab: { base: { fontSize: 'var(--text-md)', '--tab-py': 'var(--space-md)', '--tab-px': 'var(--space-2xl)', '--tab-radius-min': 'calc(1.5rem - var(--border))' } } },
279
+ xl: { tab: { base: { fontSize: 'var(--text-lg)', '--tab-py': 'var(--space-lg)', '--tab-px': 'var(--space-2xl)', '--tab-radius-min': 'calc(2rem - var(--border))' } } },
246
280
  },
247
281
  // Every role, not just primary. `data-color` passes through whatever a
248
282
  // consumer sets, so a one-role axis made `<Tabs.Root color="success">`
249
283
  // type-check, emit the attribute, and match nothing — the tab just
250
284
  // stayed primary with no diagnostic anywhere.
285
+ //
286
+ // The role lands as the active tab's INK — `border`'s underline and
287
+ // everything drawn `currentColor` follow it for free. `box` refines
288
+ // this per role through `compoundVariants` below (fill + `-content`).
251
289
  color: Object.fromEntries(
252
290
  ROLES.map((c) => [
253
291
  c,
254
292
  {
255
293
  tab: {
256
294
  states: {
257
- active: {
258
- background: `var(--color-${c})`,
259
- color: `var(--color-${c}-content)`,
260
- },
295
+ active: { color: roleInk(c) },
261
296
  },
262
297
  },
263
298
  },
264
299
  ]),
265
300
  ),
301
+ variant: {
302
+ // daisy `.tabs-border`: an always-present ::before bar under each
303
+ // tab — transparent at rest (daisy reaches transparent through an
304
+ // invalid-at-computed-value-time 4-value custom property; the
305
+ // rendered result is the same), currentColor + a 3px top border
306
+ // when active. The border is daisy's forced-colors survival for a
307
+ // background-painted mark, kept verbatim so the bar's geometry
308
+ // matches daisy's exactly.
309
+ border: {
310
+ tab: {
311
+ base: { borderRadius: 'var(--radius-field)' },
312
+ selectors: {
313
+ '&::before': {
314
+ content: '""',
315
+ position: 'absolute',
316
+ bottom: '0',
317
+ insetInlineStart: '10%',
318
+ width: '80%',
319
+ // daisy renders under Tailwind preflight, whose
320
+ // `*,::before,::after { box-sizing: border-box }`
321
+ // makes the active `border-top: 3px` swallow the
322
+ // 3px height rather than stack on it. zero ships
323
+ // no such reset, so the bar carries the one
324
+ // declaration itself — without it the active
325
+ // underline doubles to 6px (review catch).
326
+ boxSizing: 'border-box',
327
+ height: '3px',
328
+ borderRadius: 'var(--radius-field)',
329
+ backgroundColor: 'transparent',
330
+ transition: 'background-color var(--duration-normal) var(--ease-standard)',
331
+ },
332
+ '&[data-state="active"]:not([data-disabled])::before': {
333
+ backgroundColor: 'currentColor',
334
+ borderTop: '3px solid',
335
+ },
336
+ },
337
+ },
338
+ },
339
+ // daisy `.tabs-lift`: every tab sits on a base-300 baseline; the
340
+ // active one swaps that bottom hairline for top/side borders, a
341
+ // base-100 fill, rounded top corners, and the radial-gradient
342
+ // "shoulders" that curve its bottom corners outward into the
343
+ // baseline. Widths and paddings trade `var(--border)` exactly as
344
+ // daisy's `--tab-border`/`--tab-paddings` do, so activating a tab
345
+ // never changes its box size.
346
+ lift: {
347
+ tab: {
348
+ base: {
349
+ '--tab-radius-limit': 'min(var(--radius-field), var(--tab-radius-min))',
350
+ borderStartStartRadius: 'var(--tab-radius-limit)',
351
+ borderStartEndRadius: 'var(--tab-radius-limit)',
352
+ borderWidth: '0 0 var(--border) 0',
353
+ borderStyle: 'solid',
354
+ borderColor: 'var(--color-base-300)',
355
+ padding: 'calc(var(--tab-py) + var(--border)) var(--tab-px) var(--tab-py)',
356
+ },
357
+ states: {
358
+ active: {
359
+ background: 'var(--color-base-100)',
360
+ borderWidth: 'var(--border) var(--border) 0 var(--border)',
361
+ padding: 'var(--tab-py) calc(var(--tab-px) - var(--border)) calc(var(--tab-py) + var(--border))',
362
+ },
363
+ },
364
+ selectors: {
365
+ '&[data-state="active"]::before': {
366
+ // daisy's `--tab-radius-grad` stop list:
367
+ // transparent inside the corner arc, a base-300
368
+ // ring of the border's width, base-100 outside.
369
+ // Declared here rather than on the tab: every
370
+ // shoulder rule below styles this same
371
+ // pseudo-element, so they all read it — and on
372
+ // lynx it drops with the ::before selector
373
+ // instead of surviving as a dead declaration.
374
+ '--tab-grad': '#0000 calc(69% - var(--border)), var(--color-base-300) calc(69% - var(--border) + 0.25px), var(--color-base-300) 69%, var(--color-base-100) calc(69% + 0.25px)',
375
+ content: '""',
376
+ position: 'absolute',
377
+ zIndex: '1',
378
+ bottom: '0',
379
+ // daisy centres the shoulders through the flex
380
+ // static position; an explicit symmetric overhang
381
+ // of one corner radius per side is the same
382
+ // geometry without needing the tab to be a flex
383
+ // container.
384
+ insetInlineStart: 'calc(var(--tab-radius-limit) * -1)',
385
+ width: 'calc(100% + var(--tab-radius-limit) * 2)',
386
+ height: 'var(--tab-radius-limit)',
387
+ backgroundImage: 'radial-gradient(circle at top left, var(--tab-grad)), radial-gradient(circle at top right, var(--tab-grad))',
388
+ backgroundPosition: 'top left, top right',
389
+ backgroundSize: 'var(--tab-radius-limit) var(--tab-radius-limit)',
390
+ backgroundRepeat: 'no-repeat',
391
+ },
392
+ // No shoulder past the row's edges — daisy's
393
+ // `--radius-start: none` / `--radius-end: none` on
394
+ // first/last, both suppressed for an only tab.
395
+ '&[data-state="active"]:first-child::before': {
396
+ backgroundImage: 'none, radial-gradient(circle at top right, var(--tab-grad))',
397
+ },
398
+ '&[data-state="active"]:last-child::before': {
399
+ backgroundImage: 'radial-gradient(circle at top left, var(--tab-grad)), none',
400
+ },
401
+ '&[data-state="active"]:only-child::before': {
402
+ backgroundImage: 'none',
403
+ },
404
+ // The gradients' corners are physical; when one side
405
+ // is suppressed the image is asymmetric, so RTL needs
406
+ // daisy's mirror on exactly the first/last tabs.
407
+ [`&[data-state="active"]:first-child${rtl}::before`]: {
408
+ transform: 'rotateY(180deg)',
409
+ },
410
+ [`&[data-state="active"]:last-child${rtl}::before`]: {
411
+ transform: 'rotateY(180deg)',
412
+ },
413
+ },
414
+ },
415
+ },
416
+ // daisy `.tabs-box`: the styles this recipe shipped as its only
417
+ // look, moved verbatim out of `parts` — list on a padded base-200
418
+ // surface, active tab a raised base-100 pill.
419
+ box: {
420
+ list: {
421
+ base: {
422
+ padding: 'var(--space-xs)',
423
+ gap: 'var(--space-xs)',
424
+ background: 'var(--color-base-200)',
425
+ borderRadius: 'var(--radius-field)',
426
+ },
427
+ },
428
+ tab: {
429
+ base: { borderRadius: 'calc(var(--radius-field) - 0.25rem)' },
430
+ states: {
431
+ active: {
432
+ background: 'var(--color-base-100)',
433
+ boxShadow: 'var(--shadow-sm)',
434
+ },
435
+ },
436
+ },
437
+ },
438
+ },
439
+ },
440
+ // box × color: daisy's box flavor fills the active pill with the role and
441
+ // flips the label to `-content` — the fill+pair form is contrast-safe by
442
+ // construction, so the raw role is right here (unlike the ink the single-
443
+ // axis rule paints). Emitted after the single-axis rules, so it wins the
444
+ // `color` tie on source order.
445
+ compoundVariants: ROLES.map((c) => ({
446
+ match: { variant: 'box', color: c },
447
+ parts: {
448
+ tab: {
449
+ states: {
450
+ active: {
451
+ background: `var(--color-${c})`,
452
+ color: `var(--color-${c}-content)`,
453
+ },
454
+ },
455
+ },
456
+ },
457
+ })),
458
+ // `md: {}` emits nothing — it states the size default for the manifest
459
+ // (signalxjs/lynx#1070). `border` is daisy's own default tab look, and a
460
+ // DELIBERATE web visual change (#377): the un-attributed render used to
461
+ // be the box pill. Deliberately no `color` default: the un-attributed
462
+ // active ink is base-content, outside the color vocabulary.
463
+ defaultVariants: { size: 'md', variant: 'border' },
464
+ targets: {
465
+ lynx: {
466
+ variants: {
467
+ variant: {
468
+ // The underline is a ::before on the web, which lynx
469
+ // drops — redrawn as a real bottom border on the tab
470
+ // itself (transparent at rest so activation never moves
471
+ // the row). `currentColor` keeps it following the color
472
+ // axis ink, the same mechanism switch's shared border
473
+ // already relies on for lynx.
474
+ border: {
475
+ tab: {
476
+ base: { borderBottom: '3px solid transparent' },
477
+ states: { active: { borderBottomColor: 'currentColor' } },
478
+ },
479
+ },
480
+ // `min()` does not exist on lynx (signalxjs/lynx#1066) and
481
+ // the shared `--tab-radius-limit` would drop, leaving its
482
+ // readers dangling — the uncapped field radius is the
483
+ // closest expressible value.
484
+ lift: {
485
+ tab: {
486
+ base: { '--tab-radius-limit': 'var(--radius-field)' },
487
+ },
488
+ },
489
+ },
490
+ },
491
+ },
266
492
  },
267
493
  };
268
494
 
@@ -359,6 +585,10 @@ export const collapsible: RecipeInput = {
359
585
  } } }])),
360
586
  size: disclosureSizes,
361
587
  },
588
+ // Size only: `md: {}` emits nothing, so no CSS changes — manifest fact for
589
+ // signalxjs/lynx#1070. No `color` default: the un-attributed accent is
590
+ // base-content ink, outside the color vocabulary.
591
+ defaultVariants: { size: 'md' },
362
592
  };
363
593
 
364
594
  // daisy "toggle" flavor.
@@ -398,46 +628,21 @@ export const switchRecipe: RecipeInput = {
398
628
  },
399
629
  },
400
630
  control: {
401
- base: {
402
- // The knob slides because the grid's leading column GROWS:
403
- // `0fr 1fr 1fr` → `1fr 1fr 0fr`, with the knob parked in
404
- // column 2. That is daisy's own mechanism, and unlike a
405
- // `translateX` it is RTL-correct for free.
406
- display: 'inline-grid',
407
- gridTemplateColumns: '0fr 1fr 1fr',
408
- placeContent: 'center',
409
- position: 'relative',
410
- verticalAlign: 'middle',
411
- flexShrink: '0',
412
- boxSizing: 'border-box',
413
- width: 'calc((var(--switch-size) * 2) - (var(--border) + var(--switch-p)) * 2)',
414
- height: 'var(--switch-size)',
415
- padding: 'var(--switch-p)',
416
- // daisy's radius formula: the selector radius GROWN by the
417
- // padding and the border so the knob's own corner and the
418
- // track's stay concentric, each clamped at 3× the token so a
419
- // square-cornered theme (cyberpunk, wireframe) stays square.
420
- '--switch-radius-max': 'calc(var(--radius-selector) + var(--radius-selector) + var(--radius-selector))',
421
- borderRadius: 'calc(var(--radius-selector) + min(var(--switch-p), var(--switch-radius-max)) + min(var(--border), var(--switch-radius-max)))',
422
- border: 'var(--border) solid currentColor',
423
- color: 'var(--switch-ink)',
424
- boxShadow: '0 1px color-mix(in oklab, currentColor calc(var(--depth) * 10%), #0000) inset',
425
- userSelect: 'none',
426
- transition: 'color var(--duration-slow) var(--ease-standard), '
427
- + 'background-color var(--duration-normal) var(--ease-standard), '
428
- + 'grid-template-columns var(--duration-normal) var(--ease-standard)',
429
- },
631
+ // The track's whole box lives in `targets`: the web mechanism is
632
+ // an inline-grid whose leading column grows, spelled with grid
633
+ // and `min()` — both measured unresolvable by lynx's engine
634
+ // (signalxjs/lynx#1066), so the lynx section lays the same
635
+ // geometry out with flex + calc() instead. Whole blocks move
636
+ // (not single declarations) so the merged web view keeps its
637
+ // declaration order and the web goldens stay byte-identical.
430
638
  states: {
431
639
  // daisy's checked toggle empties its track to base-100 and paints
432
640
  // the KNOB with the accent — so the checked knob's contrast is
433
641
  // accent-on-base-100, not accent-content-on-accent. Same
434
642
  // trade-off as the checkbox's unchecked outline: 1.11:1 at worst
435
643
  // (sunset/`neutral`), 7.68 at best, daisy's own numbers.
436
- checked: {
437
- gridTemplateColumns: '1fr 1fr 0fr',
438
- color: 'var(--switch-accent)',
439
- backgroundColor: 'var(--color-base-100)',
440
- },
644
+ // Both targets restate the paint in their own spelling below.
645
+ checked: {},
441
646
  unchecked: {},
442
647
  // `invalid` is semantic: it stays error under every colour
443
648
  // variant. Stated as a longhand because the track's border is
@@ -449,24 +654,9 @@ export const switchRecipe: RecipeInput = {
449
654
  },
450
655
  },
451
656
  thumb: {
452
- base: {
453
- // daisy's `.toggle:before`: a square knob that fills its grid
454
- // cell and takes the UNGROWN selector radius, so it is a
455
- // rounded square in daisy's rounded-square themes and a circle
456
- // only where the theme says so.
457
- gridRowStart: '1',
458
- gridColumnStart: '2',
459
- aspectRatio: '1',
460
- width: '100%',
461
- height: '100%',
462
- borderRadius: 'var(--radius-selector)',
463
- backgroundColor: 'currentColor',
464
- backgroundSize: 'auto, calc(var(--noise) * 100%)',
465
- backgroundImage: 'none, var(--fx-noise)',
466
- boxShadow: '0 -1px var(--depth-shade) inset, 0 8px 0 -4px var(--depth-sheen) inset, '
467
- + '0 1px color-mix(in oklab, currentColor calc(var(--depth) * 10%), #0000)',
468
- transition: 'background-color var(--duration-instant) var(--ease-standard)',
469
- },
657
+ // Like `control`, the knob's box is per-target: the web knob fills
658
+ // its grid cell, the lynx knob is an explicit calc() square that
659
+ // `translateX`es — see `targets` below.
470
660
  states: {
471
661
  checked: {},
472
662
  unchecked: {},
@@ -498,6 +688,146 @@ export const switchRecipe: RecipeInput = {
498
688
  // control and its text. Declared rather than left implicit so the
499
689
  // delegation reads as a decision.
500
690
  skipStates: { root: ['focus-visible'] },
691
+ // ONE design decision, two spellings. The web track is daisy's own
692
+ // mechanism — an inline-grid whose leading column grows (`0fr 1fr 1fr` →
693
+ // `1fr 1fr 0fr`) with a min()-clamped radius — and lynx's engine resolves
694
+ // neither grid nor the comparison functions (measured on device,
695
+ // signalxjs/lynx#1066; the emitter refuses min()/max()/clamp() on that
696
+ // evidence). So the whole box moves here per target: the web section is
697
+ // the original spelling verbatim, the lynx section rebuilds the same
698
+ // geometry with flex + calc() and slides the knob with `translateX`.
699
+ targets: {
700
+ web: {
701
+ parts: {
702
+ control: {
703
+ base: {
704
+ // The knob slides because the grid's leading column GROWS:
705
+ // `0fr 1fr 1fr` → `1fr 1fr 0fr`, with the knob parked in
706
+ // column 2. That is daisy's own mechanism, and unlike a
707
+ // `translateX` it is RTL-correct for free.
708
+ display: 'inline-grid',
709
+ gridTemplateColumns: '0fr 1fr 1fr',
710
+ placeContent: 'center',
711
+ position: 'relative',
712
+ verticalAlign: 'middle',
713
+ flexShrink: '0',
714
+ boxSizing: 'border-box',
715
+ width: 'calc((var(--switch-size) * 2) - (var(--border) + var(--switch-p)) * 2)',
716
+ height: 'var(--switch-size)',
717
+ padding: 'var(--switch-p)',
718
+ // daisy's radius formula: the selector radius GROWN by the
719
+ // padding and the border so the knob's own corner and the
720
+ // track's stay concentric, each clamped at 3× the token so a
721
+ // square-cornered theme (cyberpunk, wireframe) stays square.
722
+ '--switch-radius-max': 'calc(var(--radius-selector) + var(--radius-selector) + var(--radius-selector))',
723
+ borderRadius: 'calc(var(--radius-selector) + min(var(--switch-p), var(--switch-radius-max)) + min(var(--border), var(--switch-radius-max)))',
724
+ border: 'var(--border) solid currentColor',
725
+ color: 'var(--switch-ink)',
726
+ boxShadow: '0 1px color-mix(in oklab, currentColor calc(var(--depth) * 10%), #0000) inset',
727
+ userSelect: 'none',
728
+ transition: 'color var(--duration-slow) var(--ease-standard), '
729
+ + 'background-color var(--duration-normal) var(--ease-standard), '
730
+ + 'grid-template-columns var(--duration-normal) var(--ease-standard)',
731
+ },
732
+ states: {
733
+ checked: {
734
+ gridTemplateColumns: '1fr 1fr 0fr',
735
+ color: 'var(--switch-accent)',
736
+ backgroundColor: 'var(--color-base-100)',
737
+ },
738
+ },
739
+ },
740
+ thumb: {
741
+ base: {
742
+ // daisy's `.toggle:before`: a square knob that fills its grid
743
+ // cell and takes the UNGROWN selector radius, so it is a
744
+ // rounded square in daisy's rounded-square themes and a circle
745
+ // only where the theme says so.
746
+ gridRowStart: '1',
747
+ gridColumnStart: '2',
748
+ aspectRatio: '1',
749
+ width: '100%',
750
+ height: '100%',
751
+ borderRadius: 'var(--radius-selector)',
752
+ backgroundColor: 'currentColor',
753
+ backgroundSize: 'auto, calc(var(--noise) * 100%)',
754
+ backgroundImage: 'none, var(--fx-noise)',
755
+ boxShadow: '0 -1px var(--depth-shade) inset, 0 8px 0 -4px var(--depth-sheen) inset, '
756
+ + '0 1px color-mix(in oklab, currentColor calc(var(--depth) * 10%), #0000)',
757
+ transition: 'background-color var(--duration-instant) var(--ease-standard)',
758
+ },
759
+ },
760
+ },
761
+ },
762
+ lynx: {
763
+ parts: {
764
+ root: {
765
+ // `inline-flex` has no lynx projection; restated as plain
766
+ // flex with the direction explicit (lynx does not default
767
+ // it the way a browser does).
768
+ base: { display: 'flex', flexDirection: 'row', alignItems: 'center' },
769
+ },
770
+ control: {
771
+ base: {
772
+ display: 'flex',
773
+ alignItems: 'center',
774
+ flexShrink: '0',
775
+ boxSizing: 'border-box',
776
+ // Same geometry as the web track: daisy's derived
777
+ // width, ONE `--switch-size` driving everything.
778
+ width: 'calc((var(--switch-size) * 2) - (var(--border) + var(--switch-p)) * 2)',
779
+ height: 'var(--switch-size)',
780
+ padding: 'var(--switch-p)',
781
+ // The radius formula minus its min() clamps: exact for
782
+ // every shipped theme (the clamp only bites when the
783
+ // padding or border exceeds 3× the selector radius,
784
+ // i.e. near-square themes this package does not ship).
785
+ borderRadius: 'calc(var(--radius-selector) + var(--switch-p) + var(--border))',
786
+ // No currentColor on this target — the ink is named
787
+ // directly, and `checked` moves border + fill below.
788
+ border: 'var(--border) solid var(--switch-ink)',
789
+ userSelect: 'none',
790
+ transition: 'border-color var(--duration-slow) var(--ease-standard), '
791
+ + 'background-color var(--duration-normal) var(--ease-standard)',
792
+ },
793
+ states: {
794
+ checked: {
795
+ borderColor: 'var(--switch-accent)',
796
+ backgroundColor: 'var(--color-base-100)',
797
+ },
798
+ },
799
+ },
800
+ thumb: {
801
+ base: {
802
+ // The web knob fills its square grid cell; here the
803
+ // same square is explicit: track height minus border
804
+ // and padding on both sides.
805
+ width: 'calc(var(--switch-size) - (var(--border) + var(--switch-p)) * 2)',
806
+ height: 'calc(var(--switch-size) - (var(--border) + var(--switch-p)) * 2)',
807
+ borderRadius: 'var(--radius-selector)',
808
+ backgroundColor: 'var(--switch-ink)',
809
+ transition: 'transform var(--duration-normal) var(--ease-standard), '
810
+ + 'background-color var(--duration-instant) var(--ease-standard)',
811
+ },
812
+ states: {
813
+ // The knob's travel is exactly one knob-width: the
814
+ // content box is two knobs wide, and the knob starts
815
+ // at the near end. `translateX` is measured working
816
+ // on lynx. The axis is PHYSICAL where the web's
817
+ // growing grid column was logical — an RTL layout
818
+ // would need a direction-aware multiplier, but the
819
+ // lynx grammar carries no direction hook yet and the
820
+ // runtime does not stamp one; revisit with the RTL
821
+ // plumbing rather than guessing at it here.
822
+ checked: {
823
+ backgroundColor: 'var(--switch-accent)',
824
+ transform: 'translateX(calc(var(--switch-size) - (var(--border) + var(--switch-p)) * 2))',
825
+ },
826
+ },
827
+ },
828
+ },
829
+ },
830
+ },
501
831
  };
502
832
 
503
833
  // --------------------------------------------------------------------------
@@ -1361,6 +1691,11 @@ export const progress: RecipeInput = {
1361
1691
  xl: { root: { base: { '--progress-track-size': 'calc(var(--size-selector) * 4.5)' } } },
1362
1692
  },
1363
1693
  },
1694
+ // The base already IS this render — `tokens:` binds the primary accent and
1695
+ // the md track size — so the web `:not()` twins only restate it. Declared
1696
+ // so the manifest states the default for runtimes with no `:not()`
1697
+ // fallback (the lynx target; signalxjs/lynx#1070).
1698
+ defaultVariants: { color: 'primary', size: 'md' },
1364
1699
  keyframes: {
1365
1700
  // Logical, so the sweep runs the way the bar fills — `margin-inline-start`
1366
1701
  // is animatable and direction-aware on its own. The determinate `width`,
@@ -1474,7 +1809,56 @@ export const slider: RecipeInput = {
1474
1809
  xl: { control: { base: { height: 'calc(var(--size-selector) * 8)' } }, label: { base: { fontSize: 'var(--text-lg)' } } },
1475
1810
  },
1476
1811
  },
1812
+ // Base equals the default — `tokens:` binds the primary accent, and `md`
1813
+ // only restates the label font-size the base already declares (the
1814
+ // control's base height IS the middle step) — so the twins restate it;
1815
+ // declared for the manifest (signalxjs/lynx#1070).
1816
+ defaultVariants: { color: 'primary', size: 'md' },
1477
1817
  skipStates: { root: ['invalid', 'focus-visible'] },
1818
+ // ONE design decision, two paints. On the web the accent reaches the
1819
+ // screen twice: the native control is UA-drawn behind `accent-color`, and
1820
+ // the composed range/thumb deepen the accent with `color-mix()`. Lynx
1821
+ // renders neither spelling — `accent-color` styles a native
1822
+ // `<input type=range>` lynx does not have, and the emitter drops
1823
+ // `color-mix()` as unresolvable — so the compiled range and thumb shipped
1824
+ // with no paint at all: grey track, invisible fill, invisible knob
1825
+ // (measured on device, signalxjs/lynx#1075). The geometry all survives
1826
+ // (the sizes are direct calc(), proven working); paint is the only gap,
1827
+ // so this section only restates paint, in lynx-expressible spellings.
1828
+ targets: {
1829
+ lynx: {
1830
+ parts: {
1831
+ range: {
1832
+ // The web fill deepens the accent 90/10 toward
1833
+ // base-content (`progressFill`'s recipe); the plain
1834
+ // accent — a var() chain, proven working on device — is
1835
+ // the closest lynx-expressible equivalent.
1836
+ base: { background: 'var(--slider-accent)' },
1837
+ },
1838
+ thumb: {
1839
+ // daisy's real range thumb, ported from daisyUI 5
1840
+ // `range.css` `::-webkit-slider-thumb`. The source reads
1841
+ // `background-color: var(--range-thumb)` +
1842
+ // `border: var(--range-p) solid` in the range's
1843
+ // currentColor; here each resolves to its value —
1844
+ // `--range-thumb` defaults to `var(--color-base-100)`,
1845
+ // `--range-p` is daisy's literal `.25rem` (deliberately
1846
+ // not the theme's size token), and the border ink is the
1847
+ // accent (currentColor on a daisy `.range-*` IS the
1848
+ // accent role) — because on lynx a named value is a
1849
+ // var-chain fewer to resolve. daisy paints the progress
1850
+ // fill itself as a 100cqw box-shadow thrown off this
1851
+ // thumb — a native-input trick with no lynx equivalent;
1852
+ // the composed `.zx-slider__range` box above IS that
1853
+ // fill here, so the knob only needs its own two paints.
1854
+ base: {
1855
+ background: 'var(--color-base-100)',
1856
+ border: '0.25rem solid var(--slider-accent)',
1857
+ },
1858
+ },
1859
+ },
1860
+ },
1861
+ },
1478
1862
  };
1479
1863
 
1480
1864
  export const accordion: RecipeInput = {
@@ -1543,6 +1927,10 @@ export const accordion: RecipeInput = {
1543
1927
  } } }])),
1544
1928
  size: disclosureSizes,
1545
1929
  },
1930
+ // Size only: `md: {}` emits nothing, so no CSS changes — manifest fact for
1931
+ // signalxjs/lynx#1070. No `color` default: the un-attributed accent is
1932
+ // base-content ink, outside the color vocabulary.
1933
+ defaultVariants: { size: 'md' },
1546
1934
  };
1547
1935
 
1548
1936
  /**
@@ -1683,9 +2071,29 @@ export const select: RecipeInput = {
1683
2071
  xl: { trigger: { base: { height: fieldHeight('xl'), paddingInline: 'calc(var(--size-field) * 6)', fontSize: 'var(--text-lg)' } } },
1684
2072
  },
1685
2073
  },
2074
+ // Base equals the default (`tokens:` accent, `fieldControl`'s md height),
2075
+ // so the twins restate it; declared for the manifest (signalxjs/lynx#1070).
2076
+ defaultVariants: { color: 'primary', size: 'md' },
1686
2077
  };
1687
2078
 
1688
2079
 
2080
+ /**
2081
+ * daisy's BUTTON ramp — `.btn`'s fixed height per size step, in `--size-field`
2082
+ * units, exactly as daisyUI 5 ships it (`components/button.css`: `.btn-xs`
2083
+ * `--size: calc(var(--size-field, .25rem) * 6)` through `.btn-xl` `* 14`,
2084
+ * `.btn`/`.btn-md` `* 10` — 1.5 / 2 / 2.5 / 3 / 3.5rem at the default
2085
+ * `--size-field: 0.25rem`).
2086
+ *
2087
+ * Its own table, not `FIELD_STEPS`: this repo's field ramp sits one step
2088
+ * higher than daisy's (md = 12 units, 3rem), and restating the button off it
2089
+ * would bake that offset into a second component. The button states daisy's
2090
+ * own numbers; #376 is exactly what happened while it had no height at all —
2091
+ * padding alone rendered md at ~30px against daisy's 40px.
2092
+ */
2093
+ const BTN_STEPS = { xs: 6, sm: 8, md: 10, lg: 12, xl: 14 } as const;
2094
+ const btnHeight = (step: keyof typeof BTN_STEPS): string =>
2095
+ `calc(var(--size-field) * ${BTN_STEPS[step]})`;
2096
+
1689
2097
  export const button: RecipeInput = {
1690
2098
  component: 'button',
1691
2099
  // The two axes meet here instead of multiplying. `color` sets the accent
@@ -1823,12 +2231,17 @@ export const button: RecipeInput = {
1823
2231
  },
1824
2232
  },
1825
2233
  },
2234
+ // daisy sizes a btn by fixed height (`--size`), not by padding: each
2235
+ // step states its `BTN_STEPS` height and keeps the padding/font ramps
2236
+ // for inline air; the root's flex centering absorbs the block axis.
2237
+ // The `<button>` element is UA `border-box`, so the stated height is
2238
+ // the rendered height, border included — as in daisy.
1826
2239
  size: {
1827
- xs: { root: { base: { padding: 'var(--space-2xs) var(--space-xs)', fontSize: 'var(--text-xs)' } } },
1828
- sm: { root: { base: { padding: 'var(--space-xs) var(--space-sm)', fontSize: 'var(--text-sm)' } } },
1829
- md: { root: { base: { padding: 'var(--space-sm) var(--space-lg)', fontSize: 'var(--text-md)' } } },
1830
- lg: { root: { base: { padding: 'var(--space-md) var(--space-xl)', fontSize: 'var(--text-lg)' } } },
1831
- xl: { root: { base: { padding: 'var(--space-lg) var(--space-2xl)', fontSize: 'var(--text-xl)' } } },
2240
+ xs: { root: { base: { height: btnHeight('xs'), padding: 'var(--space-2xs) var(--space-xs)', fontSize: 'var(--text-xs)' } } },
2241
+ sm: { root: { base: { height: btnHeight('sm'), padding: 'var(--space-xs) var(--space-sm)', fontSize: 'var(--text-sm)' } } },
2242
+ md: { root: { base: { height: btnHeight('md'), padding: 'var(--space-sm) var(--space-lg)', fontSize: 'var(--text-md)' } } },
2243
+ lg: { root: { base: { height: btnHeight('lg'), padding: 'var(--space-md) var(--space-xl)', fontSize: 'var(--text-lg)' } } },
2244
+ xl: { root: { base: { height: btnHeight('xl'), padding: 'var(--space-lg) var(--space-2xl)', fontSize: 'var(--text-xl)' } } },
1832
2245
  },
1833
2246
  },
1834
2247
  /**
@@ -2113,6 +2526,10 @@ export const toast: RecipeInput = {
2113
2526
  },
2114
2527
  },
2115
2528
  },
2529
+ // Size only: `md: {}` emits nothing, so no CSS changes — manifest fact for
2530
+ // signalxjs/lynx#1070. No `color` default: the un-attributed toast is a
2531
+ // neutral base-200 surface, outside the color vocabulary.
2532
+ defaultVariants: { size: 'md' },
2116
2533
  };
2117
2534
 
2118
2535
  export const combobox: RecipeInput = {