@loworbitstudio/visor 1.51.0 → 1.53.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "0.4.0",
3
- "generated_at": "2026-11-14T03:24:58.774Z",
3
+ "generated_at": "2026-11-14T07:29:15.128Z",
4
4
  "components": {
5
5
  "accessibility-specimen": {
6
6
  "changeType": "current",
package/dist/index.js CHANGED
@@ -9534,6 +9534,19 @@ var FIXTURES = {
9534
9534
  h(__mod.ToggleGroupItem, { key: "t", value: "trip" }, "Whole Trip"),
9535
9535
  ] };
9536
9536
  })()`
9537
+ },
9538
+ // VI-787: the option variant's tap-to-pick rows, multiple so the check shows.
9539
+ option: {
9540
+ export: "ToggleGroup",
9541
+ interactiveTarget: "[data-slot=toggle-group-item]",
9542
+ props: `(function () {
9543
+ var h = React.createElement;
9544
+ return { type: "multiple", variant: "option", "aria-label": "Dietary needs", defaultValue: ["vegan"], style: { width: "22rem" }, children: [
9545
+ h(__mod.ToggleGroupItem, { key: "v", value: "vegetarian" }, "Vegetarian"),
9546
+ h(__mod.ToggleGroupItem, { key: "g", value: "vegan" }, "Vegan"),
9547
+ h(__mod.ToggleGroupItem, { key: "f", value: "gluten-free" }, "Gluten Free"),
9548
+ ] };
9549
+ })()`
9537
9550
  }
9538
9551
  },
9539
9552
  "tag-input": {
@@ -920,7 +920,7 @@
920
920
  {
921
921
  "path": "components/ui/dialog/dialog.module.css",
922
922
  "type": "registry:ui",
923
- "content": "/* Dialog overlay\n * Default: 4px backdrop blur. Density axis: editorial uses 2px. */\n.overlay {\n position: fixed;\n inset: 0;\n z-index: 50;\n background-color: var(--overlay-bg, rgba(0, 0, 0, 0.8));\n backdrop-filter: blur(4px);\n -webkit-backdrop-filter: blur(4px);\n}\n\n:global([data-density=\"editorial\"]) .overlay {\n backdrop-filter: blur(2px);\n -webkit-backdrop-filter: blur(2px);\n}\n\n.overlay[data-state=\"open\"] {\n animation: fadeIn var(--motion-duration-150, 150ms) var(--motion-easing-enter, ease-out);\n}\n\n.overlay[data-state=\"closed\"] {\n animation: fadeOut var(--motion-duration-150, 150ms) var(--motion-easing-exit, ease-in);\n}\n\n/* Dialog content\n * Default: 32rem max-width, radius-lg, surface-page, spacing-6, shadow-xl.\n * Density axis: editorial uses 480px, radius-xl, surface-card, spacing-8, shadow-lg. */\n.content {\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 50;\n width: 100%;\n max-width: 32rem;\n transform: translate(-50%, -50%);\n border-radius: var(--radius-lg, 0.5rem);\n background-color: var(--surface-page, #ffffff);\n padding: var(--spacing-6, 1.5rem);\n box-shadow: var(--shadow-xl);\n transition: opacity var(--motion-duration-normal, 200ms) var(--motion-easing-default, ease-in-out), transform var(--motion-duration-normal, 200ms) var(--motion-easing-default, ease-in-out);\n}\n\n:global([data-density=\"editorial\"]) .content {\n /* Floating modal — opaque. --surface-card may be translucent glass per theme\n * (blackout: rgba(255,255,255,0.04)); over the backdrop it reads see-through.\n * --surface-popover is the opaque floating token (== --surface-card on solid\n * themes, so no visual change there). VI-623. */\n background-color: var(--surface-popover, var(--surface-page, #ffffff));\n max-width: 480px;\n border-radius: var(--radius-xl);\n padding: var(--spacing-8);\n box-shadow: var(--shadow-lg);\n}\n\n.content[data-state=\"open\"] {\n animation: contentShow var(--motion-duration-normal, 200ms) var(--motion-easing-enter, ease-out);\n}\n\n.content[data-state=\"closed\"] {\n animation: contentHide var(--motion-duration-150, 150ms) var(--motion-easing-exit, ease-in);\n}\n\n/* Bottom-sheet presentation (VI-667): same content, anchored to the bottom edge.\n * Sized by dvh and the visual viewport so the on-screen keyboard never covers it;\n * the --dialog-* vars are written by DialogContent from the browser's visual viewport API.\n * No border — the sheet reads against the scrim by surface and shadow alone. */\n.presentationSheet {\n top: auto;\n right: 0;\n bottom: var(--dialog-keyboard-inset, 0px);\n left: 0;\n max-width: none;\n max-height: min(85dvh, calc(var(--dialog-viewport-height, 100dvh) - var(--spacing-4, 1rem)));\n overflow-y: auto;\n overscroll-behavior: contain;\n transform: none;\n border-radius: var(--radius-lg, 0.5rem) var(--radius-lg, 0.5rem) 0 0;\n padding-bottom: calc(var(--spacing-6, 1.5rem) + env(safe-area-inset-bottom, 0px));\n}\n\n:global([data-density=\"editorial\"]) .presentationSheet {\n max-width: none;\n border-radius: var(--radius-xl) var(--radius-xl) 0 0;\n padding-bottom: calc(var(--spacing-8) + env(safe-area-inset-bottom, 0px));\n}\n\n.presentationSheet[data-state=\"open\"] {\n animation: sheetShow var(--motion-duration-normal, 200ms) var(--motion-easing-enter, ease-out);\n}\n\n.presentationSheet[data-state=\"closed\"] {\n animation: sheetHide var(--motion-duration-150, 150ms) var(--motion-easing-exit, ease-in);\n}\n\n/* Scoped (container) presentation: covers only the container, not the window. */\n.scrim,\n.scoped {\n position: absolute;\n}\n\n.scoped {\n max-height: calc(100% - var(--spacing-8, 2rem));\n overflow-y: auto;\n}\n\n.scoped.presentationSheet {\n bottom: 0;\n max-height: 85%;\n}\n\n/* Drag handle */\n.handle {\n width: 2.5rem;\n height: var(--spacing-1, 0.25rem);\n margin: calc(var(--spacing-3, 0.75rem) * -1) auto var(--spacing-4, 1rem);\n border-radius: var(--radius-full, 9999px);\n background-color: var(--text-tertiary, #9ca3af);\n opacity: var(--opacity-40, 0.4);\n cursor: grab;\n touch-action: none;\n}\n\n/* Close button */\n.closeButton {\n position: absolute;\n top: 1rem;\n right: 1rem;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--radius-sm, 0.25rem);\n border: none;\n background: transparent;\n cursor: pointer;\n opacity: 0.7;\n transition: opacity var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n padding: var(--spacing-1, 0.25rem);\n color: var(--text-primary, #111827);\n}\n\n.closeButton:hover {\n opacity: 1;\n}\n\n.closeButton:focus-visible {\n outline: var(--focus-ring-width, 2px) solid var(--border-focus, currentColor);\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n.closeIcon {\n width: 1rem;\n height: 1rem;\n}\n\n/* Back action: leading counterpart of the close button */\n.backButton {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--radius-sm, 0.25rem);\n border: none;\n background: transparent;\n cursor: pointer;\n opacity: 0.7;\n transition: opacity var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n padding: var(--spacing-1, 0.25rem);\n color: var(--text-primary, #111827);\n}\n\n.backButton:hover {\n opacity: 1;\n}\n\n.backButton:focus-visible {\n outline: var(--focus-ring-width, 2px) solid var(--border-focus, currentColor);\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n/* Header */\n.header {\n display: flex;\n flex-direction: column;\n gap: calc(var(--spacing-1, 0.25rem) * 1.5);\n margin-bottom: var(--spacing-4, 1rem);\n}\n\n.headerWithBack {\n flex-direction: row;\n align-items: flex-start;\n gap: var(--spacing-2, 0.5rem);\n}\n\n.backSlot {\n flex: none;\n /* Align the 24px control with the first title line (line-height lg ~1.75rem). */\n margin-block: calc(var(--spacing-1, 0.25rem) * 0.5);\n}\n\n.headerBody {\n display: flex;\n flex-direction: column;\n gap: calc(var(--spacing-1, 0.25rem) * 1.5);\n min-width: 0;\n}\n\n/* Title\n * Default: font-size-lg / semibold. Density axis: editorial uses font-size-2xl / 700. */\n.title {\n font-size: var(--font-size-lg, 1.125rem);\n font-weight: var(--font-weight-semibold, 600);\n color: var(--text-primary, #111827);\n margin: 0;\n}\n\n:global([data-density=\"editorial\"]) .title {\n font-size: var(--font-size-2xl);\n font-weight: var(--font-weight-bold, 700);\n}\n\n/* Description\n * Default: text-secondary. Density axis: editorial uses text-tertiary. */\n.description {\n font-size: var(--font-size-sm, 0.875rem);\n color: var(--text-secondary, #6b7280);\n margin: 0;\n}\n\n:global([data-density=\"editorial\"]) .description {\n color: var(--text-tertiary);\n}\n\n/* Footer */\n.footer {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: var(--spacing-3, 0.75rem);\n padding-top: var(--spacing-3, 0.75rem);\n margin-top: var(--spacing-2, 0.5rem);\n border-top: 1px solid transparent;\n border-image: linear-gradient(var(--hairline, var(--border-subtle, rgba(0, 0, 0, 0.06))), var(--hairline, var(--border-subtle, rgba(0, 0, 0, 0.06)))) 1 / var(--hairline-width, 1px) 0 0 0;\n}\n\n/* Screen reader only */\n.srOnly {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n\n@keyframes contentShow {\n from {\n opacity: 0;\n transform: translate(-50%, calc(-50% + 8px));\n }\n to {\n opacity: 1;\n transform: translate(-50%, -50%);\n }\n}\n\n@keyframes contentHide {\n from {\n opacity: 1;\n transform: translate(-50%, -50%);\n }\n to {\n opacity: 0;\n transform: translate(-50%, calc(-50% + 8px));\n }\n}\n\n@keyframes sheetShow {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n}\n\n@keyframes sheetHide {\n from { transform: translateY(0); }\n to { transform: translateY(100%); }\n}\n\n/* Reduced motion: the dialog and the sheet appear without moving. */\n@media (prefers-reduced-motion: reduce) {\n .content,\n .presentationSheet,\n .backButton,\n .closeButton {\n transition: none;\n }\n\n .content[data-state=\"open\"],\n .presentationSheet[data-state=\"open\"] {\n animation: fadeIn var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n }\n\n .content[data-state=\"closed\"],\n .presentationSheet[data-state=\"closed\"] {\n animation: fadeOut var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n }\n}\n"
923
+ "content": "/* Dialog overlay\n * Default: 4px backdrop blur. Density axis: editorial uses 2px. */\n.overlay {\n position: fixed;\n inset: 0;\n z-index: 50;\n background-color: var(--dialog-overlay-bg, var(--overlay-bg, rgba(0, 0, 0, 0.8)));\n backdrop-filter: blur(var(--dialog-overlay-blur, 4px));\n -webkit-backdrop-filter: blur(var(--dialog-overlay-blur, 4px));\n}\n\n:global([data-density=\"editorial\"]) .overlay {\n backdrop-filter: blur(var(--dialog-overlay-blur, 2px));\n -webkit-backdrop-filter: blur(var(--dialog-overlay-blur, 2px));\n}\n\n.overlay[data-state=\"open\"] {\n animation: fadeIn var(--motion-duration-150, 150ms) var(--motion-easing-enter, ease-out);\n}\n\n.overlay[data-state=\"closed\"] {\n animation: fadeOut var(--motion-duration-150, 150ms) var(--motion-easing-exit, ease-in);\n}\n\n/* Dialog content\n * Default: 32rem max-width, radius-lg, surface-page, spacing-6, shadow-xl.\n * Density axis: editorial uses 480px, radius-xl, surface-card, spacing-8, shadow-lg.\n * VI-784: a theme skins it through the --dialog-* hooks; unbound, each falls back to the value above. */\n.content {\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 50;\n width: 100%;\n max-width: var(--dialog-max-width, 32rem);\n transform: translate(-50%, -50%);\n border-radius: var(--dialog-radius, var(--radius-lg, 0.5rem));\n background-color: var(--dialog-bg, var(--surface-page, #ffffff));\n padding: var(--dialog-padding, var(--spacing-6, 1.5rem));\n box-shadow: var(--dialog-shadow, var(--shadow-xl));\n backdrop-filter: var(--dialog-backdrop-filter, none);\n -webkit-backdrop-filter: var(--dialog-backdrop-filter, none);\n transition: opacity var(--motion-duration-normal, 200ms) var(--motion-easing-default, ease-in-out), transform var(--motion-duration-normal, 200ms) var(--motion-easing-default, ease-in-out);\n}\n\n:global([data-density=\"editorial\"]) .content {\n /* Floating modal — opaque. --surface-card may be translucent glass per theme\n * (blackout: rgba(255,255,255,0.04)); over the backdrop it reads see-through.\n * --surface-popover is the opaque floating token (== --surface-card on solid\n * themes, so no visual change there). VI-623. */\n background-color: var(--dialog-bg, var(--surface-popover, var(--surface-page, #ffffff)));\n max-width: var(--dialog-max-width, 480px);\n border-radius: var(--dialog-radius, var(--radius-xl));\n padding: var(--dialog-padding, var(--spacing-8));\n box-shadow: var(--dialog-shadow, var(--shadow-lg));\n}\n\n.content[data-state=\"open\"] {\n animation: contentShow var(--motion-duration-normal, 200ms) var(--motion-easing-enter, ease-out);\n}\n\n.content[data-state=\"closed\"] {\n animation: contentHide var(--motion-duration-150, 150ms) var(--motion-easing-exit, ease-in);\n}\n\n/* Bottom-sheet presentation (VI-667): same content, anchored to the bottom edge.\n * Sized by dvh and the visual viewport so the on-screen keyboard never covers it;\n * the --dialog-* vars are written by DialogContent from the browser's visual viewport API.\n * No border — the sheet reads against the scrim by surface and shadow alone. */\n.presentationSheet {\n top: auto;\n right: 0;\n bottom: var(--dialog-keyboard-inset, 0px);\n left: 0;\n max-width: none;\n max-height: min(85dvh, calc(var(--dialog-viewport-height, 100dvh) - var(--spacing-4, 1rem)));\n overflow-y: auto;\n overscroll-behavior: contain;\n transform: none;\n border-radius: var(--dialog-radius, var(--radius-lg, 0.5rem)) var(--dialog-radius, var(--radius-lg, 0.5rem)) 0 0;\n padding-bottom: calc(var(--spacing-6, 1.5rem) + env(safe-area-inset-bottom, 0px));\n}\n\n:global([data-density=\"editorial\"]) .presentationSheet {\n max-width: none;\n border-radius: var(--dialog-radius, var(--radius-xl)) var(--dialog-radius, var(--radius-xl)) 0 0;\n padding-bottom: calc(var(--spacing-8) + env(safe-area-inset-bottom, 0px));\n}\n\n.presentationSheet[data-state=\"open\"] {\n animation: sheetShow var(--motion-duration-normal, 200ms) var(--motion-easing-enter, ease-out);\n}\n\n.presentationSheet[data-state=\"closed\"] {\n animation: sheetHide var(--motion-duration-150, 150ms) var(--motion-easing-exit, ease-in);\n}\n\n/* Scoped (container) presentation: covers only the container, not the window. */\n.scrim,\n.scoped {\n position: absolute;\n}\n\n.scoped {\n max-height: calc(100% - var(--spacing-8, 2rem));\n overflow-y: auto;\n}\n\n.scoped.presentationSheet {\n bottom: 0;\n max-height: 85%;\n}\n\n/* Drag handle */\n.handle {\n width: 2.5rem;\n height: var(--spacing-1, 0.25rem);\n margin: calc(var(--spacing-3, 0.75rem) * -1) auto var(--spacing-4, 1rem);\n border-radius: var(--radius-full, 9999px);\n background-color: var(--text-tertiary, #9ca3af);\n opacity: var(--opacity-40, 0.4);\n cursor: grab;\n touch-action: none;\n}\n\n/* Close button */\n.closeButton {\n position: absolute;\n top: 1rem;\n right: 1rem;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--radius-sm, 0.25rem);\n border: none;\n background: transparent;\n cursor: pointer;\n opacity: 0.7;\n transition: opacity var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n padding: var(--spacing-1, 0.25rem);\n color: var(--text-primary, #111827);\n}\n\n.closeButton:hover {\n opacity: 1;\n}\n\n.closeButton:focus-visible {\n outline: var(--focus-ring-width, 2px) solid var(--border-focus, currentColor);\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n.closeIcon {\n width: 1rem;\n height: 1rem;\n}\n\n/* Back action: leading counterpart of the close button */\n.backButton {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--radius-sm, 0.25rem);\n border: none;\n background: transparent;\n cursor: pointer;\n opacity: 0.7;\n transition: opacity var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n padding: var(--spacing-1, 0.25rem);\n color: var(--text-primary, #111827);\n}\n\n.backButton:hover {\n opacity: 1;\n}\n\n.backButton:focus-visible {\n outline: var(--focus-ring-width, 2px) solid var(--border-focus, currentColor);\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n/* Header */\n.header {\n display: flex;\n flex-direction: column;\n gap: calc(var(--spacing-1, 0.25rem) * 1.5);\n margin-bottom: var(--spacing-4, 1rem);\n}\n\n.headerWithBack {\n flex-direction: row;\n align-items: flex-start;\n gap: var(--spacing-2, 0.5rem);\n}\n\n.backSlot {\n flex: none;\n /* Align the 24px control with the first title line (line-height lg ~1.75rem). */\n margin-block: calc(var(--spacing-1, 0.25rem) * 0.5);\n}\n\n.headerBody {\n display: flex;\n flex-direction: column;\n gap: calc(var(--spacing-1, 0.25rem) * 1.5);\n min-width: 0;\n}\n\n/* Title\n * Default: font-size-lg / semibold. Density axis: editorial uses font-size-2xl / 700. */\n.title {\n font-size: var(--font-size-lg, 1.125rem);\n font-weight: var(--font-weight-semibold, 600);\n color: var(--text-primary, #111827);\n margin: 0;\n}\n\n:global([data-density=\"editorial\"]) .title {\n font-size: var(--font-size-2xl);\n font-weight: var(--font-weight-bold, 700);\n}\n\n/* Description\n * Default: text-secondary. Density axis: editorial uses text-tertiary. */\n.description {\n font-size: var(--font-size-sm, 0.875rem);\n color: var(--text-secondary, #6b7280);\n margin: 0;\n}\n\n:global([data-density=\"editorial\"]) .description {\n color: var(--text-tertiary);\n}\n\n/* Footer */\n.footer {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: var(--spacing-3, 0.75rem);\n padding-top: var(--spacing-3, 0.75rem);\n margin-top: var(--spacing-2, 0.5rem);\n border-top: 1px solid transparent;\n border-image: linear-gradient(var(--hairline, var(--border-subtle, rgba(0, 0, 0, 0.06))), var(--hairline, var(--border-subtle, rgba(0, 0, 0, 0.06)))) 1 / var(--hairline-width, 1px) 0 0 0;\n}\n\n/* Screen reader only */\n.srOnly {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n\n@keyframes contentShow {\n from {\n opacity: 0;\n transform: translate(-50%, calc(-50% + 8px));\n }\n to {\n opacity: 1;\n transform: translate(-50%, -50%);\n }\n}\n\n@keyframes contentHide {\n from {\n opacity: 1;\n transform: translate(-50%, -50%);\n }\n to {\n opacity: 0;\n transform: translate(-50%, calc(-50% + 8px));\n }\n}\n\n@keyframes sheetShow {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n}\n\n@keyframes sheetHide {\n from { transform: translateY(0); }\n to { transform: translateY(100%); }\n}\n\n/* Reduced motion: the dialog and the sheet appear without moving. */\n@media (prefers-reduced-motion: reduce) {\n .content,\n .presentationSheet,\n .backButton,\n .closeButton {\n transition: none;\n }\n\n .content[data-state=\"open\"],\n .presentationSheet[data-state=\"open\"] {\n animation: fadeIn var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n }\n\n .content[data-state=\"closed\"],\n .presentationSheet[data-state=\"closed\"] {\n animation: fadeOut var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n }\n}\n"
924
924
  }
925
925
  ]
926
926
  },
@@ -1512,12 +1512,12 @@
1512
1512
  {
1513
1513
  "path": "components/ui/toggle-group/toggle-group.tsx",
1514
1514
  "type": "registry:ui",
1515
- "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../../lib/utils\"\nimport styles from \"./toggle-group.module.css\"\n\n/* ─── Context ───────────────────────────────────────────────────────── */\n\ntype ToggleGroupContextValue = {\n variant?: \"default\" | \"outline\" | null\n size?: \"xs\" | \"sm\" | \"md\" | \"lg\" | null\n}\n\nconst ToggleGroupContext = React.createContext<ToggleGroupContextValue>({})\n\n/* ─── Sliding indicator hook ────────────────────────────────────────── */\n\nfunction useSlidingIndicator(\n rootRef: React.RefObject<HTMLElement | null>,\n variant: string | null | undefined,\n) {\n const indicatorRef = React.useRef<HTMLSpanElement>(null)\n\n const updateIndicator = React.useCallback(() => {\n const root = rootRef.current\n const indicator = indicatorRef.current\n if (!root || !indicator || variant !== \"outline\") return\n\n const activeItem = root.querySelector(\n '[data-state=\"on\"]',\n ) as HTMLElement | null\n\n if (!activeItem) {\n indicator.style.opacity = \"0\"\n return\n }\n\n indicator.style.opacity = \"1\"\n indicator.style.width = `${activeItem.offsetWidth}px`\n indicator.style.height = `${activeItem.offsetHeight}px`\n indicator.style.transform = `translate(${activeItem.offsetLeft}px, ${activeItem.offsetTop}px)`\n }, [rootRef, variant])\n\n // Update on mount and whenever children change state\n React.useEffect(() => {\n const root = rootRef.current\n if (!root || variant !== \"outline\") return\n\n // Initial position\n updateIndicator()\n\n // Observe data-state changes on children\n const observer = new MutationObserver(updateIndicator)\n observer.observe(root, {\n attributes: true,\n attributeFilter: [\"data-state\"],\n subtree: true,\n })\n\n return () => observer.disconnect()\n }, [rootRef, variant, updateIndicator])\n\n return indicatorRef\n}\n\n/* ─── ToggleGroup ───────────────────────────────────────────────────── */\n\nconst toggleGroupVariants = cva(styles.root, {\n variants: {\n variant: {\n default: styles.variantDefault,\n outline: styles.variantOutline,\n },\n size: {\n xs: styles.sizeXs,\n sm: styles.sizeSm,\n md: styles.sizeMd,\n lg: styles.sizeLg,\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n})\n\nexport type ToggleGroupProps = React.ComponentPropsWithoutRef<\n typeof ToggleGroupPrimitive.Root\n> &\n VariantProps<typeof toggleGroupVariants>\n\nconst ToggleGroup = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Root>,\n ToggleGroupProps\n>(({ className, variant, size, ...props }, ref) => {\n const contextValue = React.useMemo(\n () => ({ variant, size }),\n [variant, size]\n )\n const internalRef = React.useRef<HTMLDivElement>(null)\n // Sliding indicator only works for single-select toggle groups\n const useIndicator = variant === \"outline\" && props.type !== \"multiple\"\n const indicatorRef = useSlidingIndicator(internalRef, useIndicator ? variant : undefined)\n\n // Merge internal ref with forwarded ref\n const mergedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n (internalRef as React.MutableRefObject<HTMLDivElement | null>).current = node\n if (typeof ref === \"function\") ref(node)\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node\n },\n [ref],\n )\n\n return (\n <ToggleGroupContext.Provider value={contextValue}>\n <ToggleGroupPrimitive.Root\n data-slot=\"toggle-group\"\n data-variant={variant ?? \"default\"}\n data-size={size ?? \"md\"}\n data-type={props.type ?? \"single\"}\n // Radix renders role=\"group\" with radio items for single-select; a radio\n // item needs a radiogroup parent (VI-690). Multi-select stays a group of\n // pressed buttons. Spread after, so a caller's own role still wins.\n {...(props.type === \"multiple\" ? {} : { role: \"radiogroup\" })}\n className={cn(toggleGroupVariants({ variant, size }), className)}\n ref={mergedRef}\n {...props}\n >\n {useIndicator && (\n <span\n ref={indicatorRef}\n className={styles.indicator}\n aria-hidden=\"true\"\n />\n )}\n {props.children}\n </ToggleGroupPrimitive.Root>\n </ToggleGroupContext.Provider>\n )\n})\nToggleGroup.displayName = \"ToggleGroup\"\n\n/* ─── ToggleGroupItem ───────────────────────────────────────────────── */\n\nconst toggleGroupItemVariants = cva(styles.item, {\n variants: {\n variant: {\n default: styles.itemVariantDefault,\n outline: styles.itemVariantOutline,\n },\n size: {\n xs: styles.itemSizeXs,\n sm: styles.itemSizeSm,\n md: styles.itemSizeMd,\n lg: styles.itemSizeLg,\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n})\n\nexport interface ToggleGroupItemProps\n extends React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item>,\n VariantProps<typeof toggleGroupItemVariants> {}\n\n/**\n * Wrap bare text in a block label so the stylesheet can trim its line box to the\n * capital-to-baseline band (see `.label`), centring the capitals in the item\n * whatever the font (VI-684). Elements (icons) pass through.\n */\nfunction wrapLabel(children: React.ReactNode): React.ReactNode {\n return React.Children.map(children, (child) =>\n typeof child === \"string\" || typeof child === \"number\" ? (\n <span className={styles.label} data-slot=\"toggle-group-text\">\n {child}\n </span>\n ) : (\n child\n )\n )\n}\n\nconst ToggleGroupItem = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Item>,\n ToggleGroupItemProps\n>(({ className, variant, size, children, ...props }, ref) => {\n const ctx = React.useContext(ToggleGroupContext)\n const resolvedVariant = variant ?? ctx.variant\n const resolvedSize = size ?? ctx.size\n return (\n <ToggleGroupPrimitive.Item\n data-slot=\"toggle-group-item\"\n className={cn(toggleGroupItemVariants({ variant: resolvedVariant, size: resolvedSize }), className)}\n ref={ref}\n {...props}\n >\n {wrapLabel(children)}\n </ToggleGroupPrimitive.Item>\n )\n})\nToggleGroupItem.displayName = \"ToggleGroupItem\"\n\nexport { ToggleGroup, ToggleGroupItem, toggleGroupVariants, toggleGroupItemVariants }\n"
1515
+ "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../../lib/utils\"\nimport styles from \"./toggle-group.module.css\"\n\n/* ─── Context ───────────────────────────────────────────────────────── */\n\ntype ToggleGroupContextValue = {\n variant?: \"default\" | \"outline\" | \"option\" | null\n size?: \"xs\" | \"sm\" | \"md\" | \"lg\" | null\n type?: \"single\" | \"multiple\"\n}\n\nconst ToggleGroupContext = React.createContext<ToggleGroupContextValue>({})\n\n/* ─── Sliding indicator hook ────────────────────────────────────────── */\n\nfunction useSlidingIndicator(\n rootRef: React.RefObject<HTMLElement | null>,\n variant: string | null | undefined,\n) {\n const indicatorRef = React.useRef<HTMLSpanElement>(null)\n\n const updateIndicator = React.useCallback(() => {\n const root = rootRef.current\n const indicator = indicatorRef.current\n if (!root || !indicator || variant !== \"outline\") return\n\n const activeItem = root.querySelector(\n '[data-state=\"on\"]',\n ) as HTMLElement | null\n\n if (!activeItem) {\n indicator.style.opacity = \"0\"\n return\n }\n\n indicator.style.opacity = \"1\"\n indicator.style.width = `${activeItem.offsetWidth}px`\n indicator.style.height = `${activeItem.offsetHeight}px`\n indicator.style.transform = `translate(${activeItem.offsetLeft}px, ${activeItem.offsetTop}px)`\n }, [rootRef, variant])\n\n // Update on mount and whenever children change state\n React.useEffect(() => {\n const root = rootRef.current\n if (!root || variant !== \"outline\") return\n\n // Initial position\n updateIndicator()\n\n // Observe data-state changes on children\n const observer = new MutationObserver(updateIndicator)\n observer.observe(root, {\n attributes: true,\n attributeFilter: [\"data-state\"],\n subtree: true,\n })\n\n return () => observer.disconnect()\n }, [rootRef, variant, updateIndicator])\n\n return indicatorRef\n}\n\n/* ─── ToggleGroup ───────────────────────────────────────────────────── */\n\nconst toggleGroupVariants = cva(styles.root, {\n variants: {\n variant: {\n default: styles.variantDefault,\n outline: styles.variantOutline,\n option: styles.variantOption,\n },\n size: {\n xs: styles.sizeXs,\n sm: styles.sizeSm,\n md: styles.sizeMd,\n lg: styles.sizeLg,\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n})\n\nexport type ToggleGroupProps = React.ComponentPropsWithoutRef<\n typeof ToggleGroupPrimitive.Root\n> &\n VariantProps<typeof toggleGroupVariants> & {\n /** Option variant: lay the rows out in two columns instead of one. */\n columns?: 1 | 2\n /** Pressing A, B, C… while focus is in the group picks the item at that position. */\n shortcuts?: boolean\n }\n\nconst ToggleGroup = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Root>,\n ToggleGroupProps\n>(({ className, variant, size, columns, shortcuts, onKeyDown, ...props }, ref) => {\n const contextValue = React.useMemo(\n () => ({ variant, size, type: props.type }),\n [variant, size, props.type]\n )\n const isOption = variant === \"option\"\n const internalRef = React.useRef<HTMLDivElement>(null)\n // Sliding indicator only works for single-select toggle groups\n const useIndicator = variant === \"outline\" && props.type !== \"multiple\"\n const indicatorRef = useSlidingIndicator(internalRef, useIndicator ? variant : undefined)\n\n // Merge internal ref with forwarded ref\n const mergedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n (internalRef as React.MutableRefObject<HTMLDivElement | null>).current = node\n if (typeof ref === \"function\") ref(node)\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node\n },\n [ref],\n )\n\n // Letter shortcuts: the Nth item answers to the Nth letter, matching its key badge.\n const handleShortcut = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event)\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return\n const index = /^[a-z]$/i.test(event.key) ? event.key.toLowerCase().charCodeAt(0) - 97 : -1\n const item = internalRef.current?.querySelectorAll<HTMLButtonElement>(\n '[data-slot=\"toggle-group-item\"]',\n )[index]\n if (!item || item.disabled) return\n event.preventDefault()\n item.focus()\n item.click()\n }\n\n return (\n <ToggleGroupContext.Provider value={contextValue}>\n <ToggleGroupPrimitive.Root\n data-slot=\"toggle-group\"\n data-variant={variant ?? \"default\"}\n data-size={size ?? \"md\"}\n data-type={props.type ?? \"single\"}\n // Radix renders role=\"group\" with radio items for single-select; a radio\n // item needs a radiogroup parent (VI-690). Multi-select stays a group of\n // pressed buttons. Spread after, so a caller's own role still wins.\n {...(props.type === \"multiple\" ? {} : { role: \"radiogroup\" })}\n data-columns={isOption && columns === 2 ? \"2\" : undefined}\n className={cn(toggleGroupVariants({ variant, size: isOption ? null : size }), className)}\n ref={mergedRef}\n onKeyDown={shortcuts ? handleShortcut : onKeyDown}\n {...props}\n >\n {useIndicator && (\n <span\n ref={indicatorRef}\n className={styles.indicator}\n aria-hidden=\"true\"\n />\n )}\n {props.children}\n </ToggleGroupPrimitive.Root>\n </ToggleGroupContext.Provider>\n )\n})\nToggleGroup.displayName = \"ToggleGroup\"\n\n/* ─── ToggleGroupItem ───────────────────────────────────────────────── */\n\nconst toggleGroupItemVariants = cva(styles.item, {\n variants: {\n variant: {\n default: styles.itemVariantDefault,\n outline: styles.itemVariantOutline,\n option: styles.itemVariantOption,\n },\n size: {\n xs: styles.itemSizeXs,\n sm: styles.itemSizeSm,\n md: styles.itemSizeMd,\n lg: styles.itemSizeLg,\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n})\n\nexport interface ToggleGroupItemProps\n extends React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item>,\n VariantProps<typeof toggleGroupItemVariants> {}\n\n/**\n * Wrap bare text in a block label so the stylesheet can trim its line box to the\n * capital-to-baseline band (see `.label`), centring the capitals in the item\n * whatever the font (VI-684). Elements (icons) pass through.\n */\nfunction wrapLabel(children: React.ReactNode): React.ReactNode {\n return React.Children.map(children, (child) =>\n typeof child === \"string\" || typeof child === \"number\" ? (\n <span className={styles.label} data-slot=\"toggle-group-text\">\n {child}\n </span>\n ) : (\n child\n )\n )\n}\n\nconst ToggleGroupItem = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Item>,\n ToggleGroupItemProps\n>(({ className, variant, size, children, ...props }, ref) => {\n const ctx = React.useContext(ToggleGroupContext)\n const resolvedVariant = variant ?? ctx.variant\n const resolvedSize = size ?? ctx.size\n const isOption = resolvedVariant === \"option\"\n return (\n <ToggleGroupPrimitive.Item\n data-slot=\"toggle-group-item\"\n className={cn(\n toggleGroupItemVariants({ variant: resolvedVariant, size: isOption ? null : resolvedSize }),\n className\n )}\n ref={ref}\n {...props}\n >\n {isOption ? (\n <>\n {/* The letter comes from a CSS counter, so it follows the item's position. */}\n <span className={styles.optionKey} data-slot=\"toggle-group-key\" aria-hidden=\"true\" />\n <span className={styles.optionLabel} data-slot=\"toggle-group-label\">\n {children}\n </span>\n {ctx.type === \"multiple\" && (\n <span className={styles.optionCheck} data-slot=\"toggle-group-check\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M3.5 8.5 6.5 11.5 12.5 4.5\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </span>\n )}\n </>\n ) : (\n wrapLabel(children)\n )}\n </ToggleGroupPrimitive.Item>\n )\n})\nToggleGroupItem.displayName = \"ToggleGroupItem\"\n\nexport { ToggleGroup, ToggleGroupItem, toggleGroupVariants, toggleGroupItemVariants }\n"
1516
1516
  },
1517
1517
  {
1518
1518
  "path": "components/ui/toggle-group/toggle-group.module.css",
1519
1519
  "type": "registry:ui",
1520
- "content": "/* ToggleGroup root */\n.root {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-1, 0.25rem);\n}\n\n.variantDefault {\n /* items have no outer border, rely on item bg */\n}\n\n.variantOutline {\n position: relative;\n border: 1px solid var(--border-default, #e5e7eb);\n gap: 0;\n}\n\n/* The track fill (VI-709). Zero specificity, so a consumer's own class still sets\n the group's background whichever sheet loads last. */\n:where(.variantOutline) {\n background-color: var(--toggle-group-track-bg, transparent);\n}\n\n/* Sliding indicator pill */\n.indicator {\n position: absolute;\n top: 0;\n left: 0;\n background-color: var(--toggle-group-selected-bg, var(--interactive-primary-bg, var(--primary, #111827)));\n border-radius: var(--radius-md, 0.375rem);\n opacity: 0;\n pointer-events: none;\n z-index: 0;\n transition:\n transform var(--motion-duration-200, 200ms) var(--motion-easing-default, ease-in-out),\n width var(--motion-duration-200, 200ms) var(--motion-easing-default, ease-in-out),\n opacity var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n}\n\n/* Match indicator radius to item radius per size */\n.sizeXs .indicator { border-radius: var(--toggle-group-xs-item-radius, var(--radius-sm, 0.25rem)); }\n.sizeSm .indicator { border-radius: var(--radius-md, 0.375rem); }\n.sizeMd .indicator { border-radius: var(--radius-md, 0.375rem); }\n.sizeLg .indicator { border-radius: var(--radius-lg, 0.5rem); }\n\n.sizeXs {\n /* inherited by items */\n}\n\n.variantOutline.sizeXs {\n padding: calc(var(--spacing-1, 0.25rem) / 2);\n border-radius: var(--toggle-group-xs-track-radius, var(--radius-md, 0.375rem));\n}\n\n.sizeSm {\n /* inherited by items */\n}\n\n.variantOutline.sizeSm {\n padding: var(--spacing-1, 0.25rem);\n border-radius: var(--radius-lg, 0.5rem);\n}\n\n.sizeMd {\n /* inherited by items */\n}\n\n.variantOutline.sizeMd {\n padding: var(--spacing-1, 0.25rem);\n border-radius: var(--radius-lg, 0.5rem);\n}\n\n.sizeLg {\n /* inherited by items */\n}\n\n.variantOutline.sizeLg {\n padding: var(--spacing-1, 0.25rem);\n border-radius: var(--radius-xl, 0.75rem);\n}\n\n/* ToggleGroup item */\n.item {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: var(--font-size-sm, 0.875rem);\n font-weight: var(--font-weight-medium, 500);\n color: var(--toggle-group-unselected-text, var(--text-primary, #111827));\n background-color: transparent;\n border: none;\n cursor: pointer;\n transition: background-color var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out),\n color var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out),\n box-shadow var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n user-select: none;\n white-space: nowrap;\n}\n\n.item:active:not(:disabled) {\n transform: translateY(1px);\n transition: none;\n}\n\n/* A solid ring at the focus ring width, cleared of the item by the focus ring offset\n (VI-690). The translucent halo alone measured 1.4:1 on dark planes (WCAG 2.4.7). */\n.item:focus-visible {\n outline: var(--focus-ring-width, 2px) solid var(--border-focus, #111827);\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n.item:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n/* Default variant items */\n@media (hover: hover) {\n .itemVariantDefault:hover:not(:disabled) {\n background-color: var(--surface-interactive-hover, #f3f4f6);\n }\n}\n\n.itemVariantDefault[data-state=\"on\"] {\n background-color: var(--toggle-group-selected-bg, var(--interactive-primary-bg, var(--primary, #111827)));\n color: var(--toggle-group-selected-text, var(--interactive-primary-text, #f9fafb));\n}\n\n/* Outline variant items — indicator provides the active background */\n.itemVariantOutline {\n position: relative;\n z-index: 1;\n}\n\n@media (hover: hover) {\n .itemVariantOutline:hover:not(:disabled):not([data-state=\"on\"]) {\n background-color: color-mix(in srgb, var(--surface-interactive-hover, #f3f4f6) 40%, transparent);\n }\n}\n\n.itemVariantOutline[data-state=\"on\"] {\n background-color: transparent;\n color: var(--toggle-group-selected-text, var(--interactive-primary-text, #f9fafb));\n}\n\n/* Multiple-select outline — items need their own active bg (no sliding indicator) */\n:global([data-type=\"multiple\"]) .itemVariantOutline[data-state=\"on\"] {\n background-color: var(--toggle-group-selected-bg, var(--interactive-primary-bg, var(--primary, #111827)));\n}\n\n/* Sizes */\n.itemSizeXs {\n --label-box-height: 1.5rem;\n height: var(--label-box-height);\n padding: 0 var(--toggle-group-xs-padding-x, var(--spacing-2, 0.5rem));\n border-radius: var(--toggle-group-xs-item-radius, var(--radius-sm, 0.25rem));\n font-size: var(--toggle-group-xs-font-size, var(--font-size-xs, 0.75rem));\n gap: var(--spacing-1, 0.25rem);\n}\n\n.itemSizeSm {\n --label-box-height: 1.75rem;\n height: var(--label-box-height);\n padding: 0 var(--spacing-2, 0.5rem);\n border-radius: var(--radius-md, 0.375rem);\n font-size: var(--font-size-xs, 0.75rem);\n gap: var(--spacing-1, 0.25rem);\n}\n\n.itemSizeMd {\n --label-box-height: 2.25rem;\n height: var(--label-box-height);\n padding: 0 var(--spacing-3, 0.75rem);\n border-radius: var(--radius-md, 0.375rem);\n font-size: var(--font-size-sm, 0.875rem);\n gap: var(--spacing-2, 0.5rem);\n}\n\n.itemSizeLg {\n --label-box-height: 2.75rem;\n height: var(--label-box-height);\n padding: 0 var(--spacing-4, 1rem);\n border-radius: var(--radius-lg, 0.5rem);\n font-size: var(--font-size-base, 1rem);\n gap: var(--spacing-2, 0.5rem);\n}\n\n/* Label centring (VI-684, shared spec: the label-centering doc under docs/). The label is a\n block span whose line box is trimmed to the capital-to-baseline band, so the\n flex container centres the ink and not the font's ascent/descent. Without\n text-box (Firefox) it is a plain block and rendering is unchanged. */\n.label {\n display: block;\n}\n\n@supports (text-box: trim-both cap alphabetic) {\n .label {\n text-box: trim-both cap alphabetic;\n }\n}\n\n/* Blink only: it snaps the baseline to a whole CSS px; this hands back what the\n snap took. WebKit places the baseline exactly, so it is excluded. */\n@supports (text-box: trim-both cap alphabetic) and (not (-apple-pay-button-style: black)) {\n .label {\n transform: translateY(calc((var(--label-box-height) + 1cap) / 2 - round((var(--label-box-height) + 1cap) / 2, 1px)));\n }\n}\n"
1520
+ "content": "/* ToggleGroup root */\n.root {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-1, 0.25rem);\n}\n\n.variantDefault {\n /* items have no outer border, rely on item bg */\n}\n\n.variantOutline {\n position: relative;\n border: 1px solid var(--border-default, #e5e7eb);\n gap: 0;\n}\n\n/* The track fill (VI-709). Zero specificity, so a consumer's own class still sets\n the group's background whichever sheet loads last. */\n:where(.variantOutline) {\n background-color: var(--toggle-group-track-bg, transparent);\n}\n\n/* Sliding indicator pill */\n.indicator {\n position: absolute;\n top: 0;\n left: 0;\n background-color: var(--toggle-group-selected-bg, var(--interactive-primary-bg, var(--primary, #111827)));\n border-radius: var(--radius-md, 0.375rem);\n opacity: 0;\n pointer-events: none;\n z-index: 0;\n transition:\n transform var(--motion-duration-200, 200ms) var(--motion-easing-default, ease-in-out),\n width var(--motion-duration-200, 200ms) var(--motion-easing-default, ease-in-out),\n opacity var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n}\n\n/* Match indicator radius to item radius per size */\n.sizeXs .indicator { border-radius: var(--toggle-group-xs-item-radius, var(--radius-sm, 0.25rem)); }\n.sizeSm .indicator { border-radius: var(--radius-md, 0.375rem); }\n.sizeMd .indicator { border-radius: var(--radius-md, 0.375rem); }\n.sizeLg .indicator { border-radius: var(--radius-lg, 0.5rem); }\n\n.sizeXs {\n /* inherited by items */\n}\n\n.variantOutline.sizeXs {\n padding: calc(var(--spacing-1, 0.25rem) / 2);\n border-radius: var(--toggle-group-xs-track-radius, var(--radius-md, 0.375rem));\n}\n\n.sizeSm {\n /* inherited by items */\n}\n\n.variantOutline.sizeSm {\n padding: var(--spacing-1, 0.25rem);\n border-radius: var(--radius-lg, 0.5rem);\n}\n\n.sizeMd {\n /* inherited by items */\n}\n\n.variantOutline.sizeMd {\n padding: var(--spacing-1, 0.25rem);\n border-radius: var(--radius-lg, 0.5rem);\n}\n\n.sizeLg {\n /* inherited by items */\n}\n\n.variantOutline.sizeLg {\n padding: var(--spacing-1, 0.25rem);\n border-radius: var(--radius-xl, 0.75rem);\n}\n\n/* ToggleGroup item */\n.item {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: var(--font-size-sm, 0.875rem);\n font-weight: var(--font-weight-medium, 500);\n color: var(--toggle-group-unselected-text, var(--text-primary, #111827));\n background-color: transparent;\n border: none;\n cursor: pointer;\n transition: background-color var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out),\n color var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out),\n box-shadow var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n user-select: none;\n white-space: nowrap;\n}\n\n.item:active:not(:disabled) {\n transform: translateY(1px);\n transition: none;\n}\n\n/* A solid ring at the focus ring width, cleared of the item by the focus ring offset\n (VI-690). The translucent halo alone measured 1.4:1 on dark planes (WCAG 2.4.7). */\n.item:focus-visible {\n outline: var(--focus-ring-width, 2px) solid var(--border-focus, #111827);\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n.item:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n/* Default variant items */\n@media (hover: hover) {\n .itemVariantDefault:hover:not(:disabled) {\n background-color: var(--surface-interactive-hover, #f3f4f6);\n }\n}\n\n.itemVariantDefault[data-state=\"on\"] {\n background-color: var(--toggle-group-selected-bg, var(--interactive-primary-bg, var(--primary, #111827)));\n color: var(--toggle-group-selected-text, var(--interactive-primary-text, #f9fafb));\n}\n\n/* Outline variant items — indicator provides the active background */\n.itemVariantOutline {\n position: relative;\n z-index: 1;\n}\n\n@media (hover: hover) {\n .itemVariantOutline:hover:not(:disabled):not([data-state=\"on\"]) {\n background-color: color-mix(in srgb, var(--surface-interactive-hover, #f3f4f6) 40%, transparent);\n }\n}\n\n.itemVariantOutline[data-state=\"on\"] {\n background-color: transparent;\n color: var(--toggle-group-selected-text, var(--interactive-primary-text, #f9fafb));\n}\n\n/* Multiple-select outline — items need their own active bg (no sliding indicator) */\n:global([data-type=\"multiple\"]) .itemVariantOutline[data-state=\"on\"] {\n background-color: var(--toggle-group-selected-bg, var(--interactive-primary-bg, var(--primary, #111827)));\n}\n\n/* Sizes */\n.itemSizeXs {\n --label-box-height: 1.5rem;\n height: var(--label-box-height);\n padding: 0 var(--toggle-group-xs-padding-x, var(--spacing-2, 0.5rem));\n border-radius: var(--toggle-group-xs-item-radius, var(--radius-sm, 0.25rem));\n font-size: var(--toggle-group-xs-font-size, var(--font-size-xs, 0.75rem));\n gap: var(--spacing-1, 0.25rem);\n}\n\n.itemSizeSm {\n --label-box-height: 1.75rem;\n height: var(--label-box-height);\n padding: 0 var(--spacing-2, 0.5rem);\n border-radius: var(--radius-md, 0.375rem);\n font-size: var(--font-size-xs, 0.75rem);\n gap: var(--spacing-1, 0.25rem);\n}\n\n.itemSizeMd {\n --label-box-height: 2.25rem;\n height: var(--label-box-height);\n padding: 0 var(--spacing-3, 0.75rem);\n border-radius: var(--radius-md, 0.375rem);\n font-size: var(--font-size-sm, 0.875rem);\n gap: var(--spacing-2, 0.5rem);\n}\n\n.itemSizeLg {\n --label-box-height: 2.75rem;\n height: var(--label-box-height);\n padding: 0 var(--spacing-4, 1rem);\n border-radius: var(--radius-lg, 0.5rem);\n font-size: var(--font-size-base, 1rem);\n gap: var(--spacing-2, 0.5rem);\n}\n\n/* Label centring (VI-684, shared spec: the label-centering doc under docs/). The label is a\n block span whose line box is trimmed to the capital-to-baseline band, so the\n flex container centres the ink and not the font's ascent/descent. Without\n text-box (Firefox) it is a plain block and rendering is unchanged. */\n.label {\n display: block;\n}\n\n@supports (text-box: trim-both cap alphabetic) {\n .label {\n text-box: trim-both cap alphabetic;\n }\n}\n\n/* Blink only: it snaps the baseline to a whole CSS px; this hands back what the\n snap took. WebKit places the baseline exactly, so it is excluded. */\n@supports (text-box: trim-both cap alphabetic) and (not (-apple-pay-button-style: black)) {\n .label {\n transform: translateY(calc((var(--label-box-height) + 1cap) / 2 - round((var(--label-box-height) + 1cap) / 2, 1px)));\n }\n}\n\n/* Option variant (VI-787): tap-to-pick rows, each a lettered key, the label and,\n in a multiple group, a check box on the right. Every value is a\n --toggle-group-option-* hook; the fallbacks are Visor's tokens, with the row\n height, key and check sizes and the glass blur taken from Honcho's FormDeck rows. */\n.variantOption {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: var(--toggle-group-option-gap, var(--spacing-2, 0.5rem));\n counter-reset: toggle-group-option;\n}\n\n.variantOption[data-columns=\"2\"] {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n\n.itemVariantOption {\n counter-increment: toggle-group-option;\n justify-content: flex-start;\n gap: var(--toggle-group-option-inner-gap, var(--spacing-3_5, 0.875rem));\n width: 100%;\n min-height: var(--toggle-group-option-min-height, 3.375rem);\n padding: var(--toggle-group-option-padding, var(--spacing-2, 0.5rem) var(--spacing-4_5, 1.125rem) var(--spacing-2, 0.5rem) var(--spacing-3, 0.75rem));\n border-radius: var(--toggle-group-option-radius, var(--radius-lg, 0.5rem));\n background-color: var(--toggle-group-option-bg, color-mix(in srgb, var(--text-primary, #111827) 9%, transparent));\n -webkit-backdrop-filter: blur(var(--toggle-group-option-blur, 24px));\n backdrop-filter: blur(var(--toggle-group-option-blur, 24px));\n color: var(--toggle-group-option-text, var(--text-primary, #111827));\n font-size: var(--toggle-group-option-font-size, var(--font-size-base, 1rem));\n font-weight: var(--toggle-group-option-font-weight, var(--font-weight-medium, 500));\n text-align: start;\n white-space: normal;\n}\n\n@media (hover: hover) {\n .itemVariantOption:hover:not(:disabled):not([data-state=\"on\"]) {\n background-color: var(--toggle-group-option-hover-bg, color-mix(in srgb, var(--text-primary, #111827) 13%, transparent));\n }\n}\n\n.itemVariantOption[data-state=\"on\"] {\n background-color: var(--toggle-group-option-selected-bg, color-mix(in srgb, var(--text-primary, #111827) 20%, transparent));\n box-shadow: inset 0 0 0 var(--stroke-width-thin, 1px) var(--toggle-group-option-selected-ring, color-mix(in srgb, var(--text-primary, #111827) 40%, transparent));\n}\n\n.optionKey {\n flex: none;\n display: grid;\n place-items: center;\n width: var(--toggle-group-option-key-size, 1.75rem);\n height: var(--toggle-group-option-key-size, 1.75rem);\n border-radius: var(--toggle-group-option-key-radius, var(--radius-md, 0.375rem));\n box-shadow: inset 0 0 0 var(--stroke-width-thin, 1px) var(--toggle-group-option-key-border, var(--border-default, #e5e7eb));\n color: var(--toggle-group-option-key-text, var(--text-secondary, #4b5563));\n font-size: var(--toggle-group-option-key-font-size, var(--font-size-xs, 0.75rem));\n font-weight: var(--font-weight-semibold, 600);\n line-height: 1;\n transition: background-color var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out),\n color var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out),\n box-shadow var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n}\n\n.optionKey::before {\n content: counter(toggle-group-option, upper-alpha);\n}\n\n.optionLabel {\n flex: 1;\n min-width: 0;\n}\n\n.optionCheck {\n flex: none;\n display: grid;\n place-items: center;\n width: var(--toggle-group-option-check-size, 1.25rem);\n height: var(--toggle-group-option-check-size, 1.25rem);\n border-radius: var(--toggle-group-option-check-radius, var(--radius-sm, 0.25rem));\n box-shadow: inset 0 0 0 var(--stroke-width-regular, 1.5px) var(--toggle-group-option-check-border, var(--border-strong, #d1d5db));\n transition: background-color var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out),\n box-shadow var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n}\n\n.optionCheck svg {\n width: 60%;\n height: 60%;\n opacity: 0;\n}\n\n/* Picked: the key and the check fill with the mark colour. */\n.itemVariantOption[data-state=\"on\"] .optionKey,\n.itemVariantOption[data-state=\"on\"] .optionCheck {\n background-color: var(--toggle-group-option-mark-bg, var(--interactive-primary-bg, var(--primary, #111827)));\n color: var(--toggle-group-option-mark-text, var(--interactive-primary-text, #f9fafb));\n box-shadow: none;\n}\n\n.itemVariantOption[data-state=\"on\"] .optionCheck svg {\n opacity: 1;\n}\n"
1521
1521
  }
1522
1522
  ]
1523
1523
  },
@@ -1543,7 +1543,7 @@
1543
1543
  {
1544
1544
  "path": "components/ui/segmented-control/segmented-control.module.css",
1545
1545
  "type": "registry:ui",
1546
- "content": "/* SegmentedControl layers on ToggleGroup (outline, single). ToggleGroup owns the\n mechanics, sizes, sliding indicator and label centring; this sheet only\n re-skins the track and indicator and adds the fullWidth layout. ToggleGroup's\n own classes are hashed, so they are reached through the data attributes it\n renders. Specificity here is two classes or a class plus an attribute so the\n re-skin wins whatever order the sheets load in. */\n\n.root[data-variant=\"outline\"] {\n /* VI-655: the border only holds box geometry. The visible resting edge is an\n outline pulled inside the box from the shared --control-edge-* tokens, so\n --control-edge-width: 0 on any ancestor removes it with no layout shift. */\n border: 1px solid transparent;\n outline: var(--control-edge-width, 1px) var(--control-edge-style, solid) var(--control-edge-color, var(--border-default, #e5e7eb));\n outline-offset: calc(-1 * var(--control-edge-width, 1px));\n /* The well the active pill sits in: the page nudged 12% toward the ink, so it reads as a well\n in light and dark alike (page-relative, unlike --surface-subtle, which is the page in dark). */\n background-color: var(--segmented-control-track-bg, color-mix(in srgb, var(--text-primary, #111827) 12%, var(--surface-page, #ffffff)));\n}\n\n/* Labels are medium weight, never light. */\n.root [data-slot=\"toggle-group-item\"] {\n font-weight: var(--font-weight-medium, 500);\n}\n\n/* Track corner radius: ToggleGroup's per-size radius unless a theme binds\n --segmented-control-radius (a theme that wants 8px, say). Each size carries\n its own fallback, so an unbound theme renders exactly as before. */\n.root[data-variant=\"outline\"][data-size=\"xs\"] {\n border-radius: var(--segmented-control-radius, var(--radius-md, 0.375rem));\n}\n\n.root[data-variant=\"outline\"][data-size=\"sm\"],\n.root[data-variant=\"outline\"][data-size=\"md\"] {\n border-radius: var(--segmented-control-radius, var(--radius-lg, 0.5rem));\n}\n\n.root[data-variant=\"outline\"][data-size=\"lg\"] {\n border-radius: var(--segmented-control-radius, var(--radius-xl, 0.75rem));\n}\n\n/* The sliding pill. A theme can set a lifted dark fill (and the ink on it).\n Its edge is a state edge: an inset ring at --control-state-edge-width, the\n width focus and invalid use, so `edges: off` leaves it and nothing shifts\n (WCAG 1.4.11: the selected state carries a 3:1 boundary of its own). A theme\n whose fill already clears 3:1 against the well binds the edge to transparent. */\n.root > [aria-hidden=\"true\"] {\n background-color: var(--segmented-control-indicator-bg, var(--interactive-primary-bg, var(--primary, #111827)));\n box-shadow: inset 0 0 0 var(--control-state-edge-width, 1px) var(--segmented-control-indicator-edge, var(--text-primary, #111827));\n}\n\n.root [data-slot=\"toggle-group-item\"]:not([data-state=\"on\"]) {\n color: var(--segmented-control-inactive-text, var(--text-primary, #111827));\n}\n\n.root [data-slot=\"toggle-group-item\"][data-state=\"on\"] {\n color: var(--segmented-control-indicator-text, var(--interactive-primary-text, #f9fafb));\n font-weight: var(--segmented-control-active-weight, var(--font-weight-medium, 500));\n}\n\n/* Focus stays visible with edges off: it draws at the focus ring width, which\n the edge switch does not touch. It sits outside the pill, in the track. */\n.root [data-slot=\"toggle-group-item\"]:focus-visible {\n outline: var(--focus-ring-width, 2px) solid var(--border-focus, #111827);\n outline-offset: var(--focus-ring-offset, 2px);\n box-shadow: none;\n}\n\n/* Equal-width segments spanning the container (list-filter treatment). */\n.root.fullWidth {\n display: flex;\n width: 100%;\n}\n\n.root.fullWidth > [data-slot=\"toggle-group-item\"] {\n flex: 1 1 0;\n min-width: 0;\n}\n\n/* The indicator snaps instead of sliding. */\n@media (prefers-reduced-motion: reduce) {\n .root > [aria-hidden=\"true\"] {\n transition: none;\n }\n}\n\n/* Label box (see renderLabel in the component file). The label, trimmed to the capital band\n exactly as ToggleGroup trims its own (the label-centering doc under docs/), and two hidden\n copies of the text share one grid cell, so the cell is as wide as the widest of\n the active-weight and inactive-weight text and the visible label stays centred\n in it. The copies have no height. */\n.labelBox {\n display: inline-grid;\n justify-items: center;\n}\n\n.labelBox > * {\n grid-area: 1 / 1;\n}\n\n.label {\n display: block;\n white-space: nowrap;\n}\n\n@supports (text-box: trim-both cap alphabetic) {\n .label {\n text-box: trim-both cap alphabetic;\n }\n}\n\n/* Blink only: it snaps the baseline to a whole CSS px; this hands back what the\n snap took. WebKit places the baseline exactly, so it is excluded. */\n@supports (text-box: trim-both cap alphabetic) and (not (-apple-pay-button-style: black)) {\n .label {\n transform: translateY(calc((var(--label-box-height) + 1cap) / 2 - round((var(--label-box-height) + 1cap) / 2, 1px)));\n }\n}\n\n.reserve {\n height: 0;\n overflow: hidden;\n visibility: hidden;\n white-space: nowrap;\n pointer-events: none;\n}\n\n.reserveActive {\n font-weight: var(--segmented-control-active-weight, var(--font-weight-medium, 500));\n}\n\n.reserveInactive {\n font-weight: var(--font-weight-medium, 500);\n}\n"
1546
+ "content": "/* SegmentedControl layers on ToggleGroup (outline, single). ToggleGroup owns the\n mechanics, sizes, sliding indicator and label centring; this sheet only\n re-skins the track and indicator and adds the fullWidth layout. ToggleGroup's\n own classes are hashed, so they are reached through the data attributes it\n renders. Specificity here is two classes or a class plus an attribute so the\n re-skin wins whatever order the sheets load in. */\n\n.root[data-variant=\"outline\"] {\n /* VI-655: the border only holds box geometry. The visible resting edge is an\n outline pulled inside the box from the shared --control-edge-* tokens, so\n --control-edge-width: 0 on any ancestor removes it with no layout shift. */\n border: 1px solid transparent;\n outline: var(--control-edge-width, 1px) var(--control-edge-style, solid) var(--control-edge-color, var(--border-default, #e5e7eb));\n outline-offset: calc(-1 * var(--control-edge-width, 1px));\n /* The well the active pill sits in: the page nudged 12% toward the ink, so it reads as a well\n in light and dark alike (page-relative, unlike --surface-subtle, which is the page in dark). */\n background-color: var(--segmented-control-track-bg, color-mix(in srgb, var(--text-primary, #111827) 12%, var(--surface-page, #ffffff)));\n}\n\n/* Labels are medium weight, never light. */\n.root [data-slot=\"toggle-group-item\"] {\n font-weight: var(--font-weight-medium, 500);\n}\n\n/* Track corner radius and padding: ToggleGroup's per-size values unless a theme\n binds --segmented-control-radius (a theme that wants 8px, say) or\n --segmented-control-track-padding. Each size carries its own fallback, so an\n unbound theme renders exactly as before. */\n.root[data-variant=\"outline\"][data-size=\"xs\"] {\n border-radius: var(--segmented-control-radius, var(--radius-md, 0.375rem));\n padding: var(--segmented-control-track-padding, calc(var(--spacing-1, 0.25rem) / 2));\n}\n\n.root[data-variant=\"outline\"][data-size=\"sm\"],\n.root[data-variant=\"outline\"][data-size=\"md\"] {\n border-radius: var(--segmented-control-radius, var(--radius-lg, 0.5rem));\n padding: var(--segmented-control-track-padding, var(--spacing-1, 0.25rem));\n}\n\n.root[data-variant=\"outline\"][data-size=\"lg\"] {\n border-radius: var(--segmented-control-radius, var(--radius-xl, 0.75rem));\n padding: var(--segmented-control-track-padding, var(--spacing-1, 0.25rem));\n}\n\n/* Segment size (VI-785): item height, horizontal padding and label size, each\n falling back to ToggleGroup's value for the size, so an unbound theme renders\n exactly as before. Height goes through --label-box-height, which also feeds\n the label's baseline correction. The item radius shapes the hover fill and\n focus ring; the indicator radius shapes the sliding pill. */\n.root[data-size=\"xs\"] [data-slot=\"toggle-group-item\"] {\n --label-box-height: var(--segmented-control-item-height, 1.5rem);\n padding-inline: var(--segmented-control-item-padding-x, var(--toggle-group-xs-padding-x, var(--spacing-2, 0.5rem)));\n font-size: var(--segmented-control-font-size, var(--toggle-group-xs-font-size, var(--font-size-xs, 0.75rem)));\n border-radius: var(--segmented-control-item-radius, var(--toggle-group-xs-item-radius, var(--radius-sm, 0.25rem)));\n}\n\n.root[data-size=\"sm\"] [data-slot=\"toggle-group-item\"] {\n --label-box-height: var(--segmented-control-item-height, 1.75rem);\n padding-inline: var(--segmented-control-item-padding-x, var(--spacing-2, 0.5rem));\n font-size: var(--segmented-control-font-size, var(--font-size-xs, 0.75rem));\n border-radius: var(--segmented-control-item-radius, var(--radius-md, 0.375rem));\n}\n\n.root[data-size=\"md\"] [data-slot=\"toggle-group-item\"] {\n --label-box-height: var(--segmented-control-item-height, 2.25rem);\n padding-inline: var(--segmented-control-item-padding-x, var(--spacing-3, 0.75rem));\n font-size: var(--segmented-control-font-size, var(--font-size-sm, 0.875rem));\n border-radius: var(--segmented-control-item-radius, var(--radius-md, 0.375rem));\n}\n\n.root[data-size=\"lg\"] [data-slot=\"toggle-group-item\"] {\n --label-box-height: var(--segmented-control-item-height, 2.75rem);\n padding-inline: var(--segmented-control-item-padding-x, var(--spacing-4, 1rem));\n font-size: var(--segmented-control-font-size, var(--font-size-base, 1rem));\n border-radius: var(--segmented-control-item-radius, var(--radius-lg, 0.5rem));\n}\n\n.root[data-size=\"xs\"] > [aria-hidden=\"true\"] {\n border-radius: var(--segmented-control-indicator-radius, var(--toggle-group-xs-item-radius, var(--radius-sm, 0.25rem)));\n}\n\n.root[data-size=\"sm\"] > [aria-hidden=\"true\"] {\n border-radius: var(--segmented-control-indicator-radius, var(--radius-md, 0.375rem));\n}\n\n.root[data-size=\"md\"] > [aria-hidden=\"true\"] {\n border-radius: var(--segmented-control-indicator-radius, var(--radius-md, 0.375rem));\n}\n\n.root[data-size=\"lg\"] > [aria-hidden=\"true\"] {\n border-radius: var(--segmented-control-indicator-radius, var(--radius-lg, 0.5rem));\n}\n\n/* The sliding pill. A theme can set a lifted dark fill (and the ink on it).\n Its edge is a state edge: an inset ring at --control-state-edge-width, the\n width focus and invalid use, so `edges: off` leaves it and nothing shifts\n (WCAG 1.4.11: the selected state carries a 3:1 boundary of its own). A theme\n whose fill already clears 3:1 against the well binds the edge to transparent. */\n.root > [aria-hidden=\"true\"] {\n background-color: var(--segmented-control-indicator-bg, var(--interactive-primary-bg, var(--primary, #111827)));\n box-shadow: inset 0 0 0 var(--control-state-edge-width, 1px) var(--segmented-control-indicator-edge, var(--text-primary, #111827));\n}\n\n.root [data-slot=\"toggle-group-item\"]:not([data-state=\"on\"]) {\n color: var(--segmented-control-inactive-text, var(--text-primary, #111827));\n}\n\n.root [data-slot=\"toggle-group-item\"][data-state=\"on\"] {\n color: var(--segmented-control-indicator-text, var(--interactive-primary-text, #f9fafb));\n font-weight: var(--segmented-control-active-weight, var(--font-weight-medium, 500));\n}\n\n/* Focus stays visible with edges off: it draws at the focus ring width, which\n the edge switch does not touch. It sits outside the pill, in the track. */\n.root [data-slot=\"toggle-group-item\"]:focus-visible {\n outline: var(--focus-ring-width, 2px) solid var(--border-focus, #111827);\n outline-offset: var(--focus-ring-offset, 2px);\n box-shadow: none;\n}\n\n/* Equal-width segments spanning the container (list-filter treatment). */\n.root.fullWidth {\n display: flex;\n width: 100%;\n}\n\n.root.fullWidth > [data-slot=\"toggle-group-item\"] {\n flex: 1 1 0;\n min-width: 0;\n}\n\n/* The indicator snaps instead of sliding. */\n@media (prefers-reduced-motion: reduce) {\n .root > [aria-hidden=\"true\"] {\n transition: none;\n }\n}\n\n/* Label box (see renderLabel in the component file). The label, trimmed to the capital band\n exactly as ToggleGroup trims its own (the label-centering doc under docs/), and two hidden\n copies of the text share one grid cell, so the cell is as wide as the widest of\n the active-weight and inactive-weight text and the visible label stays centred\n in it. The copies have no height. */\n.labelBox {\n display: inline-grid;\n justify-items: center;\n}\n\n.labelBox > * {\n grid-area: 1 / 1;\n}\n\n.label {\n display: block;\n white-space: nowrap;\n}\n\n@supports (text-box: trim-both cap alphabetic) {\n .label {\n text-box: trim-both cap alphabetic;\n }\n}\n\n/* Blink only: it snaps the baseline to a whole CSS px; this hands back what the\n snap took. WebKit places the baseline exactly, so it is excluded. */\n@supports (text-box: trim-both cap alphabetic) and (not (-apple-pay-button-style: black)) {\n .label {\n transform: translateY(calc((var(--label-box-height) + 1cap) / 2 - round((var(--label-box-height) + 1cap) / 2, 1px)));\n }\n}\n\n.reserve {\n height: 0;\n overflow: hidden;\n visibility: hidden;\n white-space: nowrap;\n pointer-events: none;\n}\n\n.reserveActive {\n font-weight: var(--segmented-control-active-weight, var(--font-weight-medium, 500));\n}\n\n.reserveInactive {\n font-weight: var(--font-weight-medium, 500);\n}\n"
1547
1547
  }
1548
1548
  ]
1549
1549
  },
@@ -1930,12 +1930,12 @@
1930
1930
  {
1931
1931
  "path": "components/ui/lightbox/lightbox.tsx",
1932
1932
  "type": "registry:ui",
1933
- "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { CaretLeft, CaretRight, X } from \"@phosphor-icons/react\"\nimport { cn } from \"../../../lib/utils\"\nimport styles from \"./lightbox.module.css\"\n\nexport interface LightboxImage {\n src: string\n alt: string\n}\n\nexport interface LightboxProps {\n /** Array of images to display */\n images: LightboxImage[]\n /** Initially selected image index */\n initialIndex?: number\n /** Controlled open state */\n open?: boolean\n /** Called when open state changes */\n onOpenChange?: (open: boolean) => void\n children?: React.ReactNode\n}\n\ninterface LightboxContextValue {\n images: LightboxImage[]\n currentIndex: number\n setCurrentIndex: React.Dispatch<React.SetStateAction<number>>\n goToPrevious: () => void\n goToNext: () => void\n}\n\nconst LightboxContext = React.createContext<LightboxContextValue | null>(null)\n\nfunction useLightbox() {\n const ctx = React.useContext(LightboxContext)\n if (!ctx) throw new Error(\"useLightbox must be used within <Lightbox />\")\n return ctx\n}\n\nfunction Lightbox({\n images,\n initialIndex = 0,\n open,\n onOpenChange,\n children,\n}: LightboxProps) {\n const [currentIndex, setCurrentIndex] = React.useState(initialIndex)\n\n // Reset currentIndex when opened\n React.useEffect(() => {\n if (open) {\n setCurrentIndex(initialIndex)\n }\n }, [open, initialIndex])\n\n const goToPrevious = React.useCallback(() => {\n setCurrentIndex((prev) =>\n prev <= 0 ? images.length - 1 : prev - 1\n )\n }, [images.length])\n\n const goToNext = React.useCallback(() => {\n setCurrentIndex((prev) =>\n prev >= images.length - 1 ? 0 : prev + 1\n )\n }, [images.length])\n\n return (\n <LightboxContext.Provider\n value={{ images, currentIndex, setCurrentIndex, goToPrevious, goToNext }}\n >\n <DialogPrimitive.Root\n data-slot=\"lightbox-root\"\n open={open}\n onOpenChange={onOpenChange}\n >\n {children}\n </DialogPrimitive.Root>\n </LightboxContext.Provider>\n )\n}\nLightbox.displayName = \"Lightbox\"\n\nfunction LightboxTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"lightbox-trigger\" {...props} />\n}\nLightboxTrigger.displayName = \"LightboxTrigger\"\n\nconst LightboxContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n Omit<React.ComponentProps<typeof DialogPrimitive.Content>, \"children\"> & {\n className?: string\n }\n>(({ className, ...props }, ref) => {\n const { images, currentIndex, goToPrevious, goToNext } = useLightbox()\n\n const touchStartX = React.useRef<number>(0)\n const touchEndX = React.useRef<number>(0)\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault()\n goToPrevious()\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault()\n goToNext()\n }\n },\n [goToPrevious, goToNext]\n )\n\n const handleTouchStart = React.useCallback(\n (event: React.TouchEvent) => {\n touchStartX.current = event.touches[0].clientX\n touchEndX.current = event.touches[0].clientX\n },\n []\n )\n\n const handleTouchMove = React.useCallback(\n (event: React.TouchEvent) => {\n touchEndX.current = event.touches[0].clientX\n },\n []\n )\n\n const handleTouchEnd = React.useCallback(() => {\n const diff = touchStartX.current - touchEndX.current\n const threshold = 50\n\n if (Math.abs(diff) >= threshold) {\n if (diff > 0) {\n goToNext()\n } else {\n goToPrevious()\n }\n }\n }, [goToNext, goToPrevious])\n\n // Preload adjacent images\n React.useEffect(() => {\n if (images.length <= 1) return\n\n const preloadIndexes = [\n (currentIndex - 1 + images.length) % images.length,\n (currentIndex + 1) % images.length,\n ]\n\n preloadIndexes.forEach((idx) => {\n const img = new Image()\n img.src = images[idx].src\n })\n }, [currentIndex, images])\n\n const currentImage = images[currentIndex]\n\n return (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className={styles.overlay} />\n <DialogPrimitive.Content\n ref={ref}\n data-slot=\"lightbox\"\n className={cn(styles.content, className)}\n onKeyDown={handleKeyDown}\n onTouchStart={handleTouchStart}\n onTouchMove={handleTouchMove}\n onTouchEnd={handleTouchEnd}\n aria-label={`Image viewer: ${currentImage?.alt ?? \"\"}`}\n {...props}\n >\n {/* Visually hidden title for accessibility */}\n <DialogPrimitive.Title className={styles.srOnly}>\n Image viewer\n </DialogPrimitive.Title>\n <DialogPrimitive.Description className={styles.srOnly}>\n Viewing image {currentIndex + 1} of {images.length}\n </DialogPrimitive.Description>\n\n {/* Counter */}\n {images.length > 1 && (\n <span data-slot=\"lightbox-counter\" className={styles.counter}>\n {currentIndex + 1} / {images.length}\n </span>\n )}\n\n {/* Close button */}\n <DialogPrimitive.Close\n data-slot=\"lightbox-close\"\n className={styles.close}\n >\n <X weight=\"bold\" />\n <span className={styles.srOnly}>Close</span>\n </DialogPrimitive.Close>\n\n {/* Navigation buttons */}\n {images.length > 1 && (\n <>\n <button\n data-slot=\"lightbox-previous\"\n className={cn(styles.navButton, styles.navPrevious)}\n onClick={goToPrevious}\n type=\"button\"\n >\n <CaretLeft weight=\"bold\" />\n <span className={styles.srOnly}>Previous image</span>\n </button>\n <button\n data-slot=\"lightbox-next\"\n className={cn(styles.navButton, styles.navNext)}\n onClick={goToNext}\n type=\"button\"\n >\n <CaretRight weight=\"bold\" />\n <span className={styles.srOnly}>Next image</span>\n </button>\n </>\n )}\n\n {/* Main image */}\n {currentImage && (\n <div className={styles.imageContainer}>\n <img\n key={currentIndex}\n src={currentImage.src}\n alt={currentImage.alt}\n className={styles.image}\n draggable={false}\n />\n </div>\n )}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n )\n})\nLightboxContent.displayName = \"LightboxContent\"\n\nexport {\n Lightbox,\n LightboxTrigger,\n LightboxContent,\n}\n"
1933
+ "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { CaretLeft, CaretRight, X } from \"@phosphor-icons/react\"\nimport { cn } from \"../../../lib/utils\"\nimport styles from \"./lightbox.module.css\"\n\nexport interface LightboxImage {\n src: string\n alt: string\n}\n\nexport interface LightboxProps {\n /** Array of images to display */\n images: LightboxImage[]\n /** Initially selected image index */\n initialIndex?: number\n /** Controlled open state */\n open?: boolean\n /** Called when open state changes */\n onOpenChange?: (open: boolean) => void\n children?: React.ReactNode\n}\n\ninterface LightboxContextValue {\n images: LightboxImage[]\n currentIndex: number\n setCurrentIndex: React.Dispatch<React.SetStateAction<number>>\n goToPrevious: () => void\n goToNext: () => void\n /** Side the current photo came from; unset for the photo shown on open */\n direction?: \"previous\" | \"next\"\n}\n\nconst LightboxContext = React.createContext<LightboxContextValue | null>(null)\n\nfunction useLightbox() {\n const ctx = React.useContext(LightboxContext)\n if (!ctx) throw new Error(\"useLightbox must be used within <Lightbox />\")\n return ctx\n}\n\nfunction Lightbox({\n images,\n initialIndex = 0,\n open,\n onOpenChange,\n children,\n}: LightboxProps) {\n const [currentIndex, setCurrentIndex] = React.useState(initialIndex)\n const [direction, setDirection] =\n React.useState<LightboxContextValue[\"direction\"]>()\n\n // Reset currentIndex when opened\n React.useEffect(() => {\n if (open) {\n setCurrentIndex(initialIndex)\n setDirection(undefined)\n }\n }, [open, initialIndex])\n\n const handleOpenChange = React.useCallback(\n (next: boolean) => {\n if (next) setDirection(undefined)\n onOpenChange?.(next)\n },\n [onOpenChange]\n )\n\n const goToPrevious = React.useCallback(() => {\n setDirection(\"previous\")\n setCurrentIndex((prev) =>\n prev <= 0 ? images.length - 1 : prev - 1\n )\n }, [images.length])\n\n const goToNext = React.useCallback(() => {\n setDirection(\"next\")\n setCurrentIndex((prev) =>\n prev >= images.length - 1 ? 0 : prev + 1\n )\n }, [images.length])\n\n return (\n <LightboxContext.Provider\n value={{\n images,\n currentIndex,\n setCurrentIndex,\n goToPrevious,\n goToNext,\n direction,\n }}\n >\n <DialogPrimitive.Root\n data-slot=\"lightbox-root\"\n open={open}\n onOpenChange={handleOpenChange}\n >\n {children}\n </DialogPrimitive.Root>\n </LightboxContext.Provider>\n )\n}\nLightbox.displayName = \"Lightbox\"\n\nfunction LightboxTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"lightbox-trigger\" {...props} />\n}\nLightboxTrigger.displayName = \"LightboxTrigger\"\n\nfunction markLoaded(event: React.SyntheticEvent<HTMLImageElement>) {\n event.currentTarget.dataset.loaded = \"\"\n}\n\nconst LightboxContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n Omit<React.ComponentProps<typeof DialogPrimitive.Content>, \"children\"> & {\n className?: string\n }\n>(({ className, ...props }, ref) => {\n const { images, currentIndex, goToPrevious, goToNext, direction } =\n useLightbox()\n\n const touchStartX = React.useRef<number>(0)\n const touchEndX = React.useRef<number>(0)\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault()\n goToPrevious()\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault()\n goToNext()\n }\n },\n [goToPrevious, goToNext]\n )\n\n const handleTouchStart = React.useCallback(\n (event: React.TouchEvent) => {\n touchStartX.current = event.touches[0].clientX\n touchEndX.current = event.touches[0].clientX\n },\n []\n )\n\n const handleTouchMove = React.useCallback(\n (event: React.TouchEvent) => {\n touchEndX.current = event.touches[0].clientX\n },\n []\n )\n\n const handleTouchEnd = React.useCallback(() => {\n const diff = touchStartX.current - touchEndX.current\n const threshold = 50\n\n if (Math.abs(diff) >= threshold) {\n if (diff > 0) {\n goToNext()\n } else {\n goToPrevious()\n }\n }\n }, [goToNext, goToPrevious])\n\n // Preload adjacent images\n React.useEffect(() => {\n if (images.length <= 1) return\n\n const preloadIndexes = [\n (currentIndex - 1 + images.length) % images.length,\n (currentIndex + 1) % images.length,\n ]\n\n preloadIndexes.forEach((idx) => {\n const img = new Image()\n img.src = images[idx].src\n })\n }, [currentIndex, images])\n\n const currentImage = images[currentIndex]\n\n return (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className={styles.overlay} />\n <DialogPrimitive.Content\n ref={ref}\n data-slot=\"lightbox\"\n className={cn(styles.content, className)}\n onKeyDown={handleKeyDown}\n onTouchStart={handleTouchStart}\n onTouchMove={handleTouchMove}\n onTouchEnd={handleTouchEnd}\n aria-label={`Image viewer: ${currentImage?.alt ?? \"\"}`}\n {...props}\n >\n {/* Visually hidden title for accessibility */}\n <DialogPrimitive.Title className={styles.srOnly}>\n Image viewer\n </DialogPrimitive.Title>\n <DialogPrimitive.Description className={styles.srOnly}>\n Viewing image {currentIndex + 1} of {images.length}\n </DialogPrimitive.Description>\n\n {/* Counter */}\n {images.length > 1 && (\n <span data-slot=\"lightbox-counter\" className={styles.counter}>\n {currentIndex + 1} / {images.length}\n </span>\n )}\n\n {/* Close button */}\n <DialogPrimitive.Close\n data-slot=\"lightbox-close\"\n className={styles.close}\n >\n <X weight=\"bold\" />\n <span className={styles.srOnly}>Close</span>\n </DialogPrimitive.Close>\n\n {/* Navigation buttons */}\n {images.length > 1 && (\n <>\n <button\n data-slot=\"lightbox-previous\"\n className={cn(styles.navButton, styles.navPrevious)}\n onClick={goToPrevious}\n type=\"button\"\n >\n <CaretLeft weight=\"bold\" />\n <span className={styles.srOnly}>Previous image</span>\n </button>\n <button\n data-slot=\"lightbox-next\"\n className={cn(styles.navButton, styles.navNext)}\n onClick={goToNext}\n type=\"button\"\n >\n <CaretRight weight=\"bold\" />\n <span className={styles.srOnly}>Next image</span>\n </button>\n </>\n )}\n\n {/* Main image */}\n {currentImage && (\n <div className={styles.imageContainer}>\n <img\n key={currentIndex}\n src={currentImage.src}\n alt={currentImage.alt}\n className={styles.image}\n draggable={false}\n data-direction={direction}\n // The photo eases in once it has loaded (see lightbox.module.css)\n onLoad={markLoaded}\n onError={markLoaded}\n />\n </div>\n )}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n )\n})\nLightboxContent.displayName = \"LightboxContent\"\n\nexport {\n Lightbox,\n LightboxTrigger,\n LightboxContent,\n}\n"
1934
1934
  },
1935
1935
  {
1936
1936
  "path": "components/ui/lightbox/lightbox.module.css",
1937
1937
  "type": "registry:ui",
1938
- "content": "/* Lightbox Overlay */\n.overlay {\n position: fixed;\n inset: 0;\n z-index: 50;\n background-color: var(--overlay-bg, rgba(0, 0, 0, 0.9));\n backdrop-filter: blur(4px);\n -webkit-backdrop-filter: blur(4px);\n}\n\n.overlay[data-state=\"open\"] {\n animation: fadeIn var(--motion-duration-normal, 200ms) var(--motion-easing-enter, ease-out);\n}\n\n.overlay[data-state=\"closed\"] {\n animation: fadeOut var(--motion-duration-150, 150ms) var(--motion-easing-exit, ease-in);\n}\n\n/* Lightbox Content */\n.content {\n position: fixed;\n inset: 0;\n z-index: 50;\n display: flex;\n align-items: center;\n justify-content: center;\n outline: none;\n}\n\n/* Counter */\n.counter {\n position: absolute;\n top: var(--spacing-4, 1rem);\n left: var(--spacing-4, 1rem);\n font-size: var(--font-size-sm, 0.875rem);\n color: var(--text-inverse-secondary, rgba(255, 255, 255, 0.7));\n user-select: none;\n}\n\n/* Close button */\n.close {\n position: absolute;\n top: var(--spacing-4, 1rem);\n right: var(--spacing-4, 1rem);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2.5rem;\n height: 2.5rem;\n border-radius: var(--radius-full, 9999px);\n border: none;\n background-color: var(--surface-interactive-default, rgba(255, 255, 255, 0.1));\n color: var(--text-inverse-secondary, rgba(255, 255, 255, 0.7));\n cursor: pointer;\n transition: background-color var(--motion-duration-fast, 150ms) var(--motion-easing-default, ease),\n color var(--motion-duration-fast, 150ms) var(--motion-easing-default, ease);\n}\n\n@media (hover: hover) {\n .close:hover {\n background-color: var(--surface-interactive-hover, rgba(255, 255, 255, 0.2));\n color: var(--text-inverse, #ffffff);\n }\n}\n\n.close:focus-visible {\n outline: var(--focus-ring-width, 2px) solid var(--border-focus, #3b82f6);\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n/* Navigation buttons */\n.navButton {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2.5rem;\n height: 2.5rem;\n border-radius: var(--radius-full, 9999px);\n border: none;\n background-color: var(--surface-interactive-default, rgba(255, 255, 255, 0.1));\n color: var(--text-inverse-secondary, rgba(255, 255, 255, 0.7));\n cursor: pointer;\n transition: background-color var(--motion-duration-fast, 150ms) var(--motion-easing-default, ease),\n color var(--motion-duration-fast, 150ms) var(--motion-easing-default, ease);\n}\n\n@media (hover: hover) {\n .navButton:hover {\n background-color: var(--surface-interactive-hover, rgba(255, 255, 255, 0.2));\n color: var(--text-inverse, #ffffff);\n }\n}\n\n.navButton:focus-visible {\n outline: var(--focus-ring-width, 2px) solid var(--border-focus, #3b82f6);\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n.navPrevious {\n left: var(--spacing-4, 1rem);\n}\n\n.navNext {\n right: var(--spacing-4, 1rem);\n}\n\n/* Image container */\n.imageContainer {\n max-width: 90vw;\n max-height: calc(100vh - 8rem);\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.image {\n max-width: 90vw;\n max-height: calc(100vh - 8rem);\n object-fit: contain;\n user-select: none;\n}\n\n/* Screen reader only */\n.srOnly {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n"
1938
+ "content": "/* Lightbox Overlay */\n.overlay {\n position: fixed;\n inset: 0;\n z-index: 50;\n background-color: var(--overlay-bg, rgba(0, 0, 0, 0.9));\n backdrop-filter: blur(4px);\n -webkit-backdrop-filter: blur(4px);\n}\n\n.overlay[data-state=\"open\"] {\n animation: fadeIn var(--motion-duration-normal, 200ms) var(--motion-easing-enter, ease-out);\n}\n\n.overlay[data-state=\"closed\"] {\n animation: fadeOut var(--motion-duration-150, 150ms) var(--motion-easing-exit, ease-in);\n}\n\n/* Lightbox Content */\n.content {\n position: fixed;\n inset: 0;\n z-index: 50;\n display: flex;\n align-items: center;\n justify-content: center;\n outline: none;\n}\n\n/* Counter */\n.counter {\n position: absolute;\n top: var(--spacing-4, 1rem);\n left: var(--spacing-4, 1rem);\n font-size: var(--font-size-sm, 0.875rem);\n color: var(--text-inverse-secondary, rgba(255, 255, 255, 0.7));\n user-select: none;\n}\n\n/* Close button */\n.close {\n position: absolute;\n top: var(--spacing-4, 1rem);\n right: var(--spacing-4, 1rem);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2.5rem;\n height: 2.5rem;\n border-radius: var(--radius-full, 9999px);\n border: none;\n background-color: var(--surface-interactive-default, rgba(255, 255, 255, 0.1));\n color: var(--text-inverse-secondary, rgba(255, 255, 255, 0.7));\n cursor: pointer;\n transition: background-color var(--motion-duration-fast, 150ms) var(--motion-easing-default, ease),\n color var(--motion-duration-fast, 150ms) var(--motion-easing-default, ease);\n}\n\n@media (hover: hover) {\n .close:hover {\n background-color: var(--surface-interactive-hover, rgba(255, 255, 255, 0.2));\n color: var(--text-inverse, #ffffff);\n }\n}\n\n.close:focus-visible {\n outline: var(--focus-ring-width, 2px) solid var(--border-focus, #3b82f6);\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n/* Navigation buttons */\n.navButton {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2.5rem;\n height: 2.5rem;\n border-radius: var(--radius-full, 9999px);\n border: none;\n background-color: var(--surface-interactive-default, rgba(255, 255, 255, 0.1));\n color: var(--text-inverse-secondary, rgba(255, 255, 255, 0.7));\n cursor: pointer;\n transition: background-color var(--motion-duration-fast, 150ms) var(--motion-easing-default, ease),\n color var(--motion-duration-fast, 150ms) var(--motion-easing-default, ease);\n}\n\n@media (hover: hover) {\n .navButton:hover {\n background-color: var(--surface-interactive-hover, rgba(255, 255, 255, 0.2));\n color: var(--text-inverse, #ffffff);\n }\n}\n\n.navButton:focus-visible {\n outline: var(--focus-ring-width, 2px) solid var(--border-focus, #3b82f6);\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n.navPrevious {\n left: var(--spacing-4, 1rem);\n}\n\n.navNext {\n right: var(--spacing-4, 1rem);\n}\n\n/* Image container */\n.imageContainer {\n max-width: 90vw;\n max-height: calc(100vh - 8rem);\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.image {\n max-width: 90vw;\n max-height: calc(100vh - 8rem);\n object-fit: contain;\n user-select: none;\n}\n\n/*\n * Motion. Every animation is entrance-only with backwards fill, so the settled\n * frame is the plain styles above. Tunables:\n * --lightbox-slide-distance how far a photo starts beside its place (40px)\n * --lightbox-image-duration photo ease-in (350ms)\n * --lightbox-controls-duration counter, close and arrows ease-in (400ms)\n * --lightbox-image-easing photo ease-in curve (expo out)\n * Easings match Blacklight Web's lightbox.\n */\n\n/* A photo stays hidden until it has loaded, then eases in: scaling up on open,\n sliding in from the side it comes from on next / previous. */\n.image:not([data-loaded]) {\n opacity: 0;\n}\n\n.image[data-loaded] {\n animation: lightboxImageOpen var(--lightbox-image-duration, 350ms) var(--lightbox-image-easing, cubic-bezier(0.16, 1, 0.3, 1)) backwards;\n}\n\n.image[data-loaded][data-direction=\"next\"] {\n animation-name: lightboxImageFromNext;\n}\n\n.image[data-loaded][data-direction=\"previous\"] {\n animation-name: lightboxImageFromPrevious;\n}\n\n/* Controls ease in just after the photo: counter and close drop down, arrows come in from their sides. */\n.counter,\n.close {\n animation: lightboxControlDown var(--lightbox-controls-duration, 400ms) var(--motion-easing-ease-in-out, cubic-bezier(0.4, 0, 0.2, 1)) var(--motion-duration-100, 100ms) backwards;\n}\n\n.navPrevious {\n animation: lightboxControlFromPrevious var(--lightbox-controls-duration, 400ms) var(--motion-easing-ease-in-out, cubic-bezier(0.4, 0, 0.2, 1)) var(--motion-duration-150, 150ms) backwards;\n}\n\n.navNext {\n animation: lightboxControlFromNext var(--lightbox-controls-duration, 400ms) var(--motion-easing-ease-in-out, cubic-bezier(0.4, 0, 0.2, 1)) var(--motion-duration-150, 150ms) backwards;\n}\n\n/* Reduced motion: fade only, no slide or scale. */\n@media (prefers-reduced-motion: reduce) {\n .image[data-loaded],\n .image[data-loaded][data-direction],\n .counter,\n .close,\n .navPrevious,\n .navNext {\n animation-name: fadeIn;\n }\n}\n\n/* Screen reader only */\n.srOnly {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n\n@keyframes lightboxImageOpen {\n from { opacity: 0; transform: scale(0.95); }\n}\n\n@keyframes lightboxImageFromNext {\n from { opacity: 0; transform: translateX(var(--lightbox-slide-distance, 40px)) scale(0.98); }\n}\n\n@keyframes lightboxImageFromPrevious {\n from { opacity: 0; transform: translateX(calc(-1 * var(--lightbox-slide-distance, 40px))) scale(0.98); }\n}\n\n@keyframes lightboxControlDown {\n from { opacity: 0; transform: translateY(-10px); }\n}\n\n/* The arrows keep their vertical centring (translateY(-50%)) while they slide. */\n@keyframes lightboxControlFromPrevious {\n from { opacity: 0; transform: translateY(-50%) translateX(-20px); }\n}\n\n@keyframes lightboxControlFromNext {\n from { opacity: 0; transform: translateY(-50%) translateX(20px); }\n}\n"
1939
1939
  }
1940
1940
  ]
1941
1941
  },
@@ -2248,7 +2248,7 @@
2248
2248
  {
2249
2249
  "path": "components/ui/otp-input/otp-input.module.css",
2250
2250
  "type": "registry:ui",
2251
- "content": "/* OTP input wrapper */\n.wrapper {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--spacing-2, 0.5rem);\n}\n\n/* Trailing: a working indicator or a resend action beside the cells. */\n.trailing {\n display: inline-flex;\n align-items: center;\n margin-inline-start: var(--spacing-2, 0.5rem);\n color: var(--text-secondary, #6b7280);\n font-size: var(--font-size-sm, 0.875rem);\n}\n\n/* Cells and trailing content share one row; the error sits under it. */\n.row {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-2, 0.5rem);\n}\n\n/* Visible code error, a live region (4.1.3). Not colour alone (1.4.1). */\n.error {\n font-size: var(--font-size-sm, 0.875rem);\n font-weight: var(--font-weight-normal, 400);\n color: var(--text-error, #dc2626);\n}\n\n/* Individual digit cell */\n.cell {\n width: 2.5rem;\n height: 2.75rem;\n /* VI-655: the border only holds box geometry. The resting edge is an inset\n outline on the shared --control-edge-* tokens, so --control-edge-width: 0\n turns it off; focus and invalid draw at --control-state-edge-width. */\n border: 1px solid transparent;\n outline: var(--control-edge-width, 1px) var(--control-edge-style, solid) var(--otp-border, var(--control-edge-color, var(--border-default, #e5e7eb)));\n outline-offset: calc(-1 * var(--control-edge-width, 1px));\n border-radius: var(--radius-md, 0.375rem);\n background-color: var(--otp-bg, var(--surface-interactive-default, #f9fafb));\n text-align: center;\n font-size: var(--font-size-lg, 1.125rem);\n font-weight: var(--font-weight-medium, 500);\n color: var(--text-primary, #111827);\n transition: outline-color var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out),\n box-shadow var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n}\n\n.cell::placeholder {\n color: var(--text-secondary, #9ca3af);\n}\n\n@media (hover: hover) {\n .cell:hover:not(:focus-visible):not(:disabled):not([aria-invalid=\"true\"]) {\n outline-color: var(--border-strong, #d1d5db);\n }\n}\n\n.cell:focus-visible {\n outline: var(--control-state-edge-width, 1px) solid var(--border-focus, #111827);\n outline-offset: calc(-1 * var(--control-state-edge-width, 1px));\n box-shadow: 0 0 0 var(--focus-ring-width, 2px) color-mix(in srgb, var(--border-focus, #111827) 15%, transparent);\n}\n\n.cell:disabled {\n pointer-events: none;\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n.cellFilled {\n outline-color: var(--border-focus, #111827);\n}\n\n/* Invalid keeps the digits and draws the error ring. The ring is a width, not\n only a colour, and errorMessage is announced, so state is not colour alone. */\n.cell[aria-invalid=\"true\"] {\n outline-color: transparent;\n background-color: var(--otp-bg-invalid, var(--surface-error-subtle, color-mix(in srgb, var(--border-error, #ef4444) 6%, var(--otp-bg, var(--surface-interactive-default, #f9fafb)))));\n box-shadow: inset 0 0 0 var(--control-invalid-ring-width, 1.5px) var(--border-error, #ef4444),\n 0 0 0 var(--control-invalid-halo-width, 0px) color-mix(in srgb, var(--border-error, #ef4444) 15%, transparent);\n}\n\n.cell[aria-invalid=\"true\"]:focus-visible {\n outline-color: transparent;\n outline-offset: var(--focus-ring-offset, 2px);\n box-shadow: inset 0 0 0 var(--control-invalid-ring-width, 1.5px) var(--border-error, #ef4444),\n 0 0 0 var(--focus-ring-width, 2px) color-mix(in srgb, var(--border-error, #ef4444) 30%, transparent);\n}\n"
2251
+ "content": "/* OTP input wrapper */\n.wrapper {\n position: relative;\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--spacing-2, 0.5rem);\n}\n\n/* Trailing: a working indicator or a resend action beside the cells. */\n.trailing {\n display: inline-flex;\n align-items: center;\n margin-inline-start: var(--spacing-2, 0.5rem);\n color: var(--text-secondary, #6b7280);\n font-size: var(--font-size-sm, 0.875rem);\n}\n\n/* Cells and trailing content share one row; the error sits under it.\n VI-783: min-width lets the row fill a widened wrapper, so cells set to\n --otp-cell-width: 100% stretch. Unset, the cells keep their width and the\n row's extra room stays empty. */\n.row {\n display: inline-flex;\n align-items: center;\n gap: var(--otp-gap, var(--spacing-2, 0.5rem));\n min-width: 100%;\n}\n\n/* Visible code error, a live region (4.1.3). Not colour alone (1.4.1). */\n.error {\n font-size: var(--font-size-sm, 0.875rem);\n font-weight: var(--font-weight-normal, 400);\n color: var(--text-error, #dc2626);\n}\n\n/* Individual digit cell. VI-783: the size hooks fall back to the values that\n shipped before; min-width: 0 lets --otp-cell-width: 100% cells share the row. */\n.cell {\n width: var(--otp-cell-width, 2.5rem);\n min-width: 0;\n height: var(--otp-cell-height, 2.75rem);\n /* VI-655: the border only holds box geometry. The resting edge is an inset\n outline on the shared --control-edge-* tokens, so --control-edge-width: 0\n turns it off; focus and invalid draw at --control-state-edge-width. */\n border: 1px solid transparent;\n outline: var(--control-edge-width, 1px) var(--control-edge-style, solid) var(--otp-border, var(--control-edge-color, var(--border-default, #e5e7eb)));\n outline-offset: calc(-1 * var(--control-edge-width, 1px));\n border-radius: var(--otp-cell-radius, var(--radius-md, 0.375rem));\n background-color: var(--otp-bg, var(--surface-interactive-default, #f9fafb));\n text-align: center;\n font-size: var(--otp-cell-font-size, var(--font-size-lg, 1.125rem));\n font-weight: var(--font-weight-medium, 500);\n color: var(--text-primary, #111827);\n transition: outline-color var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out),\n box-shadow var(--motion-duration-150, 150ms) var(--motion-easing-default, ease-in-out);\n}\n\n.cell::placeholder {\n color: var(--text-secondary, #9ca3af);\n}\n\n@media (hover: hover) {\n .cell:hover:not(:focus-visible):not(:disabled):not([aria-invalid=\"true\"]) {\n outline-color: var(--border-strong, #d1d5db);\n }\n}\n\n.cell:focus-visible {\n outline: var(--control-state-edge-width, 1px) solid var(--border-focus, #111827);\n outline-offset: calc(-1 * var(--control-state-edge-width, 1px));\n box-shadow: 0 0 0 var(--focus-ring-width, 2px) color-mix(in srgb, var(--border-focus, #111827) 15%, transparent);\n}\n\n.cell:disabled {\n pointer-events: none;\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n.cellFilled {\n outline-color: var(--border-focus, #111827);\n}\n\n/* Invalid keeps the digits and draws the error ring. The ring is a width, not\n only a colour, and errorMessage is announced, so state is not colour alone. */\n.cell[aria-invalid=\"true\"] {\n outline-color: transparent;\n background-color: var(--otp-bg-invalid, var(--surface-error-subtle, color-mix(in srgb, var(--border-error, #ef4444) 6%, var(--otp-bg, var(--surface-interactive-default, #f9fafb)))));\n box-shadow: inset 0 0 0 var(--control-invalid-ring-width, 1.5px) var(--border-error, #ef4444),\n 0 0 0 var(--control-invalid-halo-width, 0px) color-mix(in srgb, var(--border-error, #ef4444) 15%, transparent);\n}\n\n.cell[aria-invalid=\"true\"]:focus-visible {\n outline-color: transparent;\n outline-offset: var(--focus-ring-offset, 2px);\n box-shadow: inset 0 0 0 var(--control-invalid-ring-width, 1.5px) var(--border-error, #ef4444),\n 0 0 0 var(--focus-ring-width, 2px) color-mix(in srgb, var(--border-error, #ef4444) 30%, transparent);\n}\n"
2252
2252
  }
2253
2253
  ]
2254
2254
  },
@@ -4325,12 +4325,12 @@
4325
4325
  {
4326
4326
  "path": "blocks/admin-shell/admin-shell.tsx",
4327
4327
  "type": "registry:block",
4328
- "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"../../lib/utils\"\nimport styles from \"./admin-shell.module.css\"\n\nexport interface AdminShellProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Branding slot at the top of the sidebar (logo, wordmark, product switcher). */\n logo?: React.ReactNode\n /** Navigation content rendered in the sidebar body. Consumer provides their own link list. */\n sidebarNav: React.ReactNode\n /** Bottom-of-sidebar slot (user menu, logout, theme toggle, etc.). */\n sidebarFooter?: React.ReactNode\n /** Sidebar width. Number is treated as pixels; strings pass through. Default 256. */\n sidebarWidth?: number | string\n\n /**\n * When true, the sidebar folds to an icon rail and back, from a button beside\n * the logo or the `collapseShortcut` key. The shell and its sidebar carry\n * `data-collapsed`, so a slot can hide its labels. Desk only: below 48rem the\n * sidebar stays open and the button is not drawn. Default false.\n */\n collapsible?: boolean\n /** Uncontrolled initial state, used when nothing is remembered. Default false. */\n defaultCollapsed?: boolean\n /** Controlled state. Pair with `onCollapsedChange`. */\n collapsed?: boolean\n /** Called with the next state when the button or the key folds or opens the sidebar. */\n onCollapsedChange?: (collapsed: boolean) => void\n /** Key pressed with ⌘ (Ctrl off a Mac) that folds and opens the sidebar. `false` turns it off. Default \"\\\\\". */\n collapseShortcut?: string | false\n /** localStorage key that remembers the state per browser. Omit to remember nothing. */\n storageKey?: string\n\n /** Breadcrumb component instance rendered at the start of the topbar. */\n breadcrumb?: React.ReactNode\n /** Left side of the topbar, after the breadcrumb. */\n topbarStart?: React.ReactNode\n /** Center slot (status indicators, search, realtime signals). */\n topbarCenter?: React.ReactNode\n /** Right side of the topbar (user menu, theme toggle, quick actions). */\n topbarEnd?: React.ReactNode\n /** When true, the topbar is not rendered. Default false. */\n hideTopbar?: boolean\n\n /** Main content. */\n children: React.ReactNode\n /** Optional max-width for the main content area. Number is treated as pixels. */\n mainMaxWidth?: number | string\n /** Padding scale applied to the main content area. Default \"lg\". */\n mainPadding?: \"none\" | \"sm\" | \"md\" | \"lg\"\n}\n\n// The rail is desk-only; this matches the shell's narrow container query.\nconst NARROW_QUERY = \"(max-width: 48rem)\"\n\nfunction subscribeNarrow(callback: () => void) {\n const mql = window.matchMedia(NARROW_QUERY)\n mql.addEventListener(\"change\", callback)\n return () => mql.removeEventListener(\"change\", callback)\n}\n\nconst getNarrow = () => window.matchMedia(NARROW_QUERY).matches\nconst getFalse = () => false\n\nfunction subscribeStorage(callback: () => void) {\n window.addEventListener(\"storage\", callback)\n return () => window.removeEventListener(\"storage\", callback)\n}\n\n// A private window or blocked storage throws; the shell then just opens expanded.\nfunction readStored(key: string | undefined): boolean | null {\n if (!key) return null\n try {\n const value = window.localStorage.getItem(key)\n return value === \"rail\" ? true : value === \"open\" ? false : null\n } catch {\n return null\n }\n}\n\nfunction writeStored(key: string | undefined, collapsed: boolean) {\n if (!key) return\n try {\n window.localStorage.setItem(key, collapsed ? \"rail\" : \"open\")\n } catch {\n // Not remembered in a private window.\n }\n}\n\nfunction resolveSize(value: number | string | undefined, fallback: string): string {\n if (value == null) return fallback\n return typeof value === \"number\" ? `${value}px` : value\n}\n\nexport function AdminShell({\n logo,\n sidebarNav,\n sidebarFooter,\n sidebarWidth = 256,\n collapsible = false,\n defaultCollapsed = false,\n collapsed: collapsedProp,\n onCollapsedChange,\n collapseShortcut = \"\\\\\",\n storageKey,\n breadcrumb,\n topbarStart,\n topbarCenter,\n topbarEnd,\n hideTopbar = false,\n children,\n mainMaxWidth,\n mainPadding = \"lg\",\n className,\n style,\n ...props\n}: AdminShellProps) {\n const narrow = React.useSyncExternalStore(subscribeNarrow, getNarrow, getFalse)\n const stored = React.useSyncExternalStore(\n subscribeStorage,\n () => readStored(storageKey),\n () => null\n )\n const [localCollapsed, setLocalCollapsed] = React.useState<boolean | null>(null)\n // Only a toggle animates; restoring the remembered state on load does not.\n const [animate, setAnimate] = React.useState(false)\n const sidebarId = React.useId()\n\n const isCollapsed = collapsedProp ?? localCollapsed ?? stored ?? defaultCollapsed\n const canFold = collapsible && !narrow\n const railed = canFold && isCollapsed\n\n const toggle = React.useCallback(() => {\n const next = !isCollapsed\n setAnimate(true)\n if (collapsedProp === undefined) setLocalCollapsed(next)\n writeStored(storageKey, next)\n onCollapsedChange?.(next)\n }, [isCollapsed, collapsedProp, storageKey, onCollapsedChange])\n\n React.useEffect(() => {\n if (!canFold || collapseShortcut === false) return\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === collapseShortcut && (event.metaKey || event.ctrlKey) && !event.altKey) {\n event.preventDefault()\n toggle()\n }\n }\n window.addEventListener(\"keydown\", onKeyDown)\n return () => window.removeEventListener(\"keydown\", onKeyDown)\n }, [canFold, collapseShortcut, toggle])\n\n const collapsedAttr = collapsible ? String(railed) : undefined\n const toggleLabel = railed ? \"Expand the sidebar\" : \"Collapse the sidebar\"\n\n const resolvedSidebarWidth = resolveSize(sidebarWidth, \"16rem\")\n const resolvedMaxWidth = resolveSize(mainMaxWidth, \"none\")\n\n const shellStyle = {\n ...style,\n [\"--admin-shell-sidebar-width\" as string]: resolvedSidebarWidth,\n [\"--admin-shell-main-max-width\" as string]: resolvedMaxWidth,\n } as React.CSSProperties\n\n return (\n <div\n className={cn(styles.root, className)}\n style={shellStyle}\n data-slot=\"admin-shell\"\n data-collapsed={collapsedAttr}\n data-animate={animate ? \"\" : undefined}\n {...props}\n >\n <a href=\"#admin-main-content\" className={styles.skipLink}>\n Skip to main content\n </a>\n\n <aside\n id={sidebarId}\n className={styles.sidebar}\n data-slot=\"admin-shell-sidebar\"\n data-collapsed={collapsedAttr}\n aria-label=\"Primary navigation\"\n >\n {logo || canFold ? (\n <div className={styles.sidebarHeader} data-slot=\"admin-shell-sidebar-header\">\n {logo}\n {canFold ? (\n <button\n type=\"button\"\n className={styles.collapseButton}\n data-slot=\"admin-shell-collapse\"\n aria-expanded={!railed}\n aria-controls={sidebarId}\n aria-label={toggleLabel}\n aria-keyshortcuts={\n collapseShortcut === false\n ? undefined\n : `Meta+${collapseShortcut} Control+${collapseShortcut}`\n }\n title={toggleLabel}\n onClick={toggle}\n >\n <svg\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <rect x=\"2\" y=\"2.5\" width=\"12\" height=\"11\" rx=\"2.5\" />\n <path d=\"M6.5 2.5v11M11 6.5 9.5 8l1.5 1.5\" />\n </svg>\n </button>\n ) : null}\n </div>\n ) : null}\n <nav\n className={styles.sidebarNav}\n data-slot=\"admin-shell-sidebar-nav\"\n aria-label=\"Sidebar\"\n >\n {sidebarNav}\n </nav>\n {sidebarFooter ? (\n <div className={styles.sidebarFooter} data-slot=\"admin-shell-sidebar-footer\">\n {sidebarFooter}\n </div>\n ) : null}\n </aside>\n\n <div className={styles.body} data-slot=\"admin-shell-body\">\n {!hideTopbar ? (\n <header\n role=\"banner\"\n className={styles.topbar}\n data-slot=\"admin-shell-topbar\"\n >\n <div className={styles.topbarStart}>\n {breadcrumb}\n {topbarStart}\n </div>\n <div className={styles.topbarCenter}>{topbarCenter}</div>\n <div className={styles.topbarEnd}>{topbarEnd}</div>\n </header>\n ) : null}\n\n <main\n id=\"admin-main-content\"\n role=\"main\"\n className={styles.main}\n data-slot=\"admin-shell-main\"\n data-padding={mainPadding}\n tabIndex={-1}\n >\n <div className={styles.mainInner}>{children}</div>\n </main>\n </div>\n </div>\n )\n}\n"
4328
+ "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"../../lib/utils\"\nimport styles from \"./admin-shell.module.css\"\n\nexport interface AdminShellProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Branding slot at the top of the sidebar (logo, wordmark, product switcher). */\n logo?: React.ReactNode\n /** Navigation content rendered in the sidebar body. Consumer provides their own link list. */\n sidebarNav: React.ReactNode\n /** Bottom-of-sidebar slot (user menu, logout, theme toggle, etc.). */\n sidebarFooter?: React.ReactNode\n /** Sidebar width. Number is treated as pixels; strings pass through. Default 256. */\n sidebarWidth?: number | string\n\n /**\n * When true, the sidebar folds to an icon rail and back, from a button beside\n * the logo or the `collapseShortcut` key. The shell and its sidebar carry\n * `data-collapsed`, so a slot can hide its labels. Desk only: below 48rem the\n * sidebar stays open and the button is not drawn. Default false.\n */\n collapsible?: boolean\n /** Uncontrolled initial state, used when nothing is remembered. Default false. */\n defaultCollapsed?: boolean\n /** Controlled state. Pair with `onCollapsedChange`. */\n collapsed?: boolean\n /** Called with the next state when the button or the key folds or opens the sidebar. */\n onCollapsedChange?: (collapsed: boolean) => void\n /** Key pressed with ⌘ (Ctrl off a Mac) that folds and opens the sidebar. `false` turns it off. Default \"\\\\\". */\n collapseShortcut?: string | false\n /** localStorage key that remembers the state per browser. Omit to remember nothing. */\n storageKey?: string\n\n /** Breadcrumb component instance rendered at the start of the topbar. */\n breadcrumb?: React.ReactNode\n /** Left side of the topbar, after the breadcrumb. */\n topbarStart?: React.ReactNode\n /** Center slot (status indicators, search, realtime signals). */\n topbarCenter?: React.ReactNode\n /** Right side of the topbar (user menu, theme toggle, quick actions). */\n topbarEnd?: React.ReactNode\n /** When true, the topbar is not rendered. Below 48rem a bar holding just the menu button still is. Default false. */\n hideTopbar?: boolean\n\n /** Main content. */\n children: React.ReactNode\n /** Optional max-width for the main content area. Number is treated as pixels. */\n mainMaxWidth?: number | string\n /** Padding scale applied to the main content area. Default \"lg\". */\n mainPadding?: \"none\" | \"sm\" | \"md\" | \"lg\"\n}\n\n// The rail is desk-only; this matches the shell's narrow container query.\nconst NARROW_QUERY = \"(max-width: 48rem)\"\n\nfunction subscribeNarrow(callback: () => void) {\n const mql = window.matchMedia(NARROW_QUERY)\n mql.addEventListener(\"change\", callback)\n return () => mql.removeEventListener(\"change\", callback)\n}\n\nconst getNarrow = () => window.matchMedia(NARROW_QUERY).matches\nconst getFalse = () => false\n\nfunction subscribeStorage(callback: () => void) {\n window.addEventListener(\"storage\", callback)\n return () => window.removeEventListener(\"storage\", callback)\n}\n\n// A private window or blocked storage throws; the shell then just opens expanded.\nfunction readStored(key: string | undefined): boolean | null {\n if (!key) return null\n try {\n const value = window.localStorage.getItem(key)\n return value === \"rail\" ? true : value === \"open\" ? false : null\n } catch {\n return null\n }\n}\n\nfunction writeStored(key: string | undefined, collapsed: boolean) {\n if (!key) return\n try {\n window.localStorage.setItem(key, collapsed ? \"rail\" : \"open\")\n } catch {\n // Not remembered in a private window.\n }\n}\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), details > summary'\n\nfunction focusables(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE)).filter((el) => {\n const css = getComputedStyle(el)\n return css.display !== \"none\" && css.visibility !== \"hidden\"\n })\n}\n\nfunction resolveSize(value: number | string | undefined, fallback: string): string {\n if (value == null) return fallback\n return typeof value === \"number\" ? `${value}px` : value\n}\n\nexport function AdminShell({\n logo,\n sidebarNav,\n sidebarFooter,\n sidebarWidth = 256,\n collapsible = false,\n defaultCollapsed = false,\n collapsed: collapsedProp,\n onCollapsedChange,\n collapseShortcut = \"\\\\\",\n storageKey,\n breadcrumb,\n topbarStart,\n topbarCenter,\n topbarEnd,\n hideTopbar = false,\n children,\n mainMaxWidth,\n mainPadding = \"lg\",\n className,\n style,\n ...props\n}: AdminShellProps) {\n const narrow = React.useSyncExternalStore(subscribeNarrow, getNarrow, getFalse)\n const stored = React.useSyncExternalStore(\n subscribeStorage,\n () => readStored(storageKey),\n () => null\n )\n const [localCollapsed, setLocalCollapsed] = React.useState<boolean | null>(null)\n // Only a toggle animates; restoring the remembered state on load does not.\n const [animate, setAnimate] = React.useState(false)\n const sidebarId = React.useId()\n // Below 48rem the sidebar is a sheet behind the topbar's menu button (VI-781).\n const [sheetOpen, setSheetOpen] = React.useState(false)\n const sidebarRef = React.useRef<HTMLElement>(null)\n const menuRef = React.useRef<HTMLButtonElement>(null)\n // Widening past the phone breakpoint closes the sheet.\n if (sheetOpen && !narrow) setSheetOpen(false)\n\n const isCollapsed = collapsedProp ?? localCollapsed ?? stored ?? defaultCollapsed\n const canFold = collapsible && !narrow\n const railed = canFold && isCollapsed\n\n const toggle = React.useCallback(() => {\n const next = !isCollapsed\n setAnimate(true)\n if (collapsedProp === undefined) setLocalCollapsed(next)\n writeStored(storageKey, next)\n onCollapsedChange?.(next)\n }, [isCollapsed, collapsedProp, storageKey, onCollapsedChange])\n\n React.useEffect(() => {\n if (!canFold || collapseShortcut === false) return\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === collapseShortcut && (event.metaKey || event.ctrlKey) && !event.altKey) {\n event.preventDefault()\n toggle()\n }\n }\n window.addEventListener(\"keydown\", onKeyDown)\n return () => window.removeEventListener(\"keydown\", onKeyDown)\n }, [canFold, collapseShortcut, toggle])\n\n React.useEffect(() => {\n const sheet = sidebarRef.current\n if (!sheetOpen || !sheet) return\n const menu = menuRef.current\n const html = document.documentElement\n const overflow = html.style.overflow\n html.style.overflow = \"hidden\"\n focusables(sheet)[0]?.focus()\n\n const onKeyDown = (event: KeyboardEvent) => {\n // A menu open inside the sheet (Radix marks its Esc handled) closes first.\n if (event.key === \"Escape\" && !event.defaultPrevented) {\n event.preventDefault()\n setSheetOpen(false)\n return\n }\n if (event.key !== \"Tab\") return\n const items = focusables(sheet)\n if (items.length === 0) return\n const active = document.activeElement\n const edge = event.shiftKey ? items[0] : items[items.length - 1]\n if (active === edge || !sheet.contains(active)) {\n event.preventDefault()\n ;(event.shiftKey ? items[items.length - 1] : items[0]).focus()\n }\n }\n document.addEventListener(\"keydown\", onKeyDown)\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown)\n html.style.overflow = overflow\n menu?.focus()\n }\n }, [sheetOpen])\n\n const closeOnLink = (event: React.MouseEvent) => {\n if ((event.target as Element).closest(\"a[href]\")) setSheetOpen(false)\n }\n\n const menuButton = (\n <button\n ref={menuRef}\n type=\"button\"\n className={styles.menuButton}\n data-slot=\"admin-shell-menu\"\n aria-label=\"Menu\"\n aria-expanded={sheetOpen}\n aria-controls={sidebarId}\n onClick={() => setSheetOpen(true)}\n >\n <svg\n viewBox=\"0 0 16 16\"\n width=\"20\"\n height=\"20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M2.5 4h11M2.5 8h11M2.5 12h11\" />\n </svg>\n </button>\n )\n\n const collapsedAttr = collapsible ? String(railed) : undefined\n const toggleLabel = railed ? \"Expand the sidebar\" : \"Collapse the sidebar\"\n\n const resolvedSidebarWidth = resolveSize(sidebarWidth, \"16rem\")\n const resolvedMaxWidth = resolveSize(mainMaxWidth, \"none\")\n\n const shellStyle = {\n ...style,\n [\"--admin-shell-sidebar-width\" as string]: resolvedSidebarWidth,\n [\"--admin-shell-main-max-width\" as string]: resolvedMaxWidth,\n } as React.CSSProperties\n\n return (\n <div\n className={cn(styles.root, className)}\n style={shellStyle}\n data-slot=\"admin-shell\"\n data-collapsed={collapsedAttr}\n data-animate={animate ? \"\" : undefined}\n {...props}\n >\n <a href=\"#admin-main-content\" className={styles.skipLink} inert={sheetOpen}>\n Skip to main content\n </a>\n\n {sheetOpen ? (\n <div\n className={styles.scrim}\n data-slot=\"admin-shell-scrim\"\n aria-hidden=\"true\"\n onClick={() => setSheetOpen(false)}\n />\n ) : null}\n\n <aside\n ref={sidebarRef}\n id={sidebarId}\n className={styles.sidebar}\n data-slot=\"admin-shell-sidebar\"\n data-collapsed={collapsedAttr}\n data-sheet={sheetOpen ? \"open\" : undefined}\n aria-label=\"Primary navigation\"\n onClick={sheetOpen ? closeOnLink : undefined}\n >\n {logo || canFold ? (\n <div className={styles.sidebarHeader} data-slot=\"admin-shell-sidebar-header\">\n {logo}\n {canFold ? (\n <button\n type=\"button\"\n className={styles.collapseButton}\n data-slot=\"admin-shell-collapse\"\n aria-expanded={!railed}\n aria-controls={sidebarId}\n aria-label={toggleLabel}\n aria-keyshortcuts={\n collapseShortcut === false\n ? undefined\n : `Meta+${collapseShortcut} Control+${collapseShortcut}`\n }\n title={toggleLabel}\n onClick={toggle}\n >\n <svg\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <rect x=\"2\" y=\"2.5\" width=\"12\" height=\"11\" rx=\"2.5\" />\n <path d=\"M6.5 2.5v11M11 6.5 9.5 8l1.5 1.5\" />\n </svg>\n </button>\n ) : null}\n </div>\n ) : null}\n <nav\n className={styles.sidebarNav}\n data-slot=\"admin-shell-sidebar-nav\"\n aria-label=\"Sidebar\"\n >\n {sidebarNav}\n </nav>\n {sidebarFooter ? (\n <div className={styles.sidebarFooter} data-slot=\"admin-shell-sidebar-footer\">\n {sidebarFooter}\n </div>\n ) : null}\n </aside>\n\n <div className={styles.body} data-slot=\"admin-shell-body\" inert={sheetOpen}>\n {hideTopbar ? (\n <header\n role=\"banner\"\n className={cn(styles.topbar, styles.menuBar)}\n data-slot=\"admin-shell-menu-bar\"\n >\n {menuButton}\n </header>\n ) : (\n <header\n role=\"banner\"\n className={styles.topbar}\n data-slot=\"admin-shell-topbar\"\n >\n <div className={styles.topbarStart}>\n {menuButton}\n {breadcrumb}\n {topbarStart}\n </div>\n <div className={styles.topbarCenter}>{topbarCenter}</div>\n <div className={styles.topbarEnd}>{topbarEnd}</div>\n </header>\n )}\n\n <main\n id=\"admin-main-content\"\n role=\"main\"\n className={styles.main}\n data-slot=\"admin-shell-main\"\n data-padding={mainPadding}\n tabIndex={-1}\n >\n <div className={styles.mainInner}>{children}</div>\n </main>\n </div>\n </div>\n )\n}\n"
4329
4329
  },
4330
4330
  {
4331
4331
  "path": "blocks/admin-shell/admin-shell.module.css",
4332
4332
  "type": "registry:block",
4333
- "content": ".root {\n display: flex;\n min-height: 100vh;\n width: 100%;\n background: var(--surface-page, #f9fafb);\n color: var(--text-primary, #111827);\n container-type: inline-size;\n}\n\n/* Accessibility: skip link — visible only on keyboard focus */\n.skipLink {\n position: absolute;\n top: var(--spacing-2, 0.5rem);\n left: var(--spacing-2, 0.5rem);\n z-index: 100;\n padding: var(--spacing-2, 0.5rem) var(--spacing-3, 0.75rem);\n background: var(--surface-card, #ffffff);\n color: var(--text-primary, #111827);\n border: 1px solid var(--border-default, #e5e7eb);\n border-radius: var(--radius-md, 0.5rem);\n box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n font-size: var(--font-size-sm, 0.875rem);\n font-weight: 500;\n text-decoration: none;\n transform: translateY(-150%);\n transition:\n transform var(--motion-duration-fast, 150ms)\n var(--motion-easing-standard, ease);\n}\n\n.skipLink:focus-visible {\n transform: translateY(0);\n outline: var(--focus-ring-width, 2px) solid\n var(--focus-ring-color, var(--primary, #3b82f6));\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n/* Sidebar */\n.sidebar {\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n width: var(--admin-shell-sidebar-width, 16rem);\n min-height: 100vh;\n background: var(--surface-card, #ffffff);\n border-right: var(--admin-shell-sidebar-border, 1px solid var(--border-default, #e5e7eb));\n position: sticky;\n top: 0;\n max-height: 100vh;\n}\n\n.sidebarHeader {\n display: flex;\n align-items: center;\n padding: var(--spacing-4, 1rem) var(--spacing-5, 1.25rem);\n border-bottom: var(--admin-shell-sidebar-header-border, 1px solid var(--border-muted, #e5e7eb));\n min-height: 3.5rem;\n flex-shrink: 0;\n}\n\n.sidebarNav {\n flex: 1 1 auto;\n overflow-y: auto;\n padding: var(--spacing-4, 1rem) var(--spacing-3, 0.75rem);\n display: flex;\n flex-direction: column;\n gap: var(--spacing-1, 0.25rem);\n}\n\n.sidebarFooter {\n flex-shrink: 0;\n padding: var(--spacing-3, 0.75rem) var(--spacing-4, 1rem);\n border-top: var(--admin-shell-sidebar-footer-border, 1px solid var(--border-muted, #e5e7eb));\n}\n\n/* Collapsible: the sidebar folds to an icon rail (VI-770) */\n.sidebar[data-collapsed] {\n overflow-x: clip;\n}\n\n.root[data-animate] .sidebar {\n transition: width var(--admin-shell-rail-duration, var(--motion-duration-slow, 500ms))\n var(--admin-shell-rail-easing, var(--motion-easing-default, ease));\n}\n\n.sidebar[data-collapsed=\"true\"] {\n width: var(--admin-shell-rail-width, 4.25rem);\n}\n\n.collapseButton {\n display: inline-grid;\n place-items: center;\n flex: none;\n width: var(--spacing-8, 2rem);\n height: var(--spacing-8, 2rem);\n margin-left: auto;\n padding: 0;\n border: 0;\n border-radius: var(--radius-sm, 0.375rem);\n background: transparent;\n color: var(--text-secondary, #4b5563);\n cursor: pointer;\n}\n\n.collapseButton:hover {\n background: var(--interactive-ghost-bg-hover, var(--surface-muted, #f3f4f6));\n color: var(--text-primary, #111827);\n}\n\n.collapseButton:focus-visible {\n outline: var(--focus-ring-width, 2px) solid\n var(--focus-ring-color, var(--primary, #3b82f6));\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n.collapseButton svg {\n transition: transform var(--admin-shell-rail-duration, var(--motion-duration-slow, 500ms))\n var(--admin-shell-rail-easing, var(--motion-easing-default, ease));\n}\n\n.sidebar[data-collapsed=\"true\"] .collapseButton {\n margin-left: 0;\n}\n\n.sidebar[data-collapsed=\"true\"] .collapseButton svg {\n transform: scaleX(-1);\n}\n\n.sidebar[data-collapsed=\"true\"] .sidebarHeader {\n flex-direction: column;\n gap: var(--spacing-2, 0.5rem);\n padding-left: var(--spacing-2, 0.5rem);\n padding-right: var(--spacing-2, 0.5rem);\n}\n\n.sidebar[data-collapsed=\"true\"] .sidebarNav {\n align-items: center;\n padding-left: var(--spacing-2, 0.5rem);\n padding-right: var(--spacing-2, 0.5rem);\n}\n\n.sidebar[data-collapsed=\"true\"] .sidebarFooter {\n display: flex;\n justify-content: center;\n padding-left: var(--spacing-2, 0.5rem);\n padding-right: var(--spacing-2, 0.5rem);\n}\n\n/* A slot marks its labels; the rail hides them visually and keeps them as accessible names. */\n.sidebar[data-collapsed=\"true\"] [data-admin-shell-label] {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .root[data-animate] .sidebar,\n .collapseButton svg {\n transition: none;\n }\n}\n\n/* Body = topbar + main */\n.body {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-width: 0;\n min-height: 100vh;\n}\n\n/* Topbar */\n.topbar {\n display: flex;\n align-items: center;\n gap: var(--spacing-4, 1rem);\n padding: var(--spacing-3, 0.75rem) var(--spacing-6, 1.5rem);\n min-height: 3.5rem;\n background: var(--admin-shell-topbar-bg, var(--surface-card, #ffffff));\n border-bottom: var(--admin-shell-topbar-border, 1px solid var(--border-default, #e5e7eb));\n position: sticky;\n top: 0;\n z-index: 10;\n}\n\n.topbarStart {\n display: flex;\n align-items: center;\n gap: var(--spacing-3, 0.75rem);\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.topbarCenter {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--spacing-3, 0.75rem);\n flex: 0 1 auto;\n}\n\n.topbarEnd {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--spacing-2, 0.5rem);\n flex: 1 1 auto;\n min-width: 0;\n}\n\n/* Main */\n.main {\n flex: 1 1 auto;\n overflow-y: auto;\n min-width: 0;\n outline: none;\n}\n\n.main:focus-visible {\n outline: var(--focus-ring-width, 2px) solid\n var(--focus-ring-color, var(--primary, #3b82f6));\n outline-offset: calc(var(--focus-ring-offset, 2px) * -1);\n}\n\n.main[data-padding=\"none\"] .mainInner {\n padding: 0;\n}\n\n.main[data-padding=\"sm\"] .mainInner {\n padding: var(--spacing-4, 1rem);\n}\n\n.main[data-padding=\"md\"] .mainInner {\n padding: var(--spacing-6, 1.5rem);\n}\n\n.main[data-padding=\"lg\"] .mainInner {\n padding: var(--spacing-8, 2rem);\n}\n\n.mainInner {\n width: 100%;\n max-width: var(--admin-shell-main-max-width, none);\n margin: 0 auto;\n}\n\n/* Responsive: collapse sidebar on narrow containers */\n@container (max-width: 48rem) {\n .topbar {\n padding-left: var(--spacing-4, 1rem);\n padding-right: var(--spacing-4, 1rem);\n }\n\n .main[data-padding=\"lg\"] .mainInner {\n padding: var(--spacing-5, 1.25rem);\n }\n\n .main[data-padding=\"md\"] .mainInner {\n padding: var(--spacing-4, 1rem);\n }\n}\n"
4333
+ "content": ".root {\n display: flex;\n min-height: 100vh;\n width: 100%;\n background: var(--surface-page, #f9fafb);\n color: var(--text-primary, #111827);\n container-type: inline-size;\n}\n\n/* Accessibility: skip link — visible only on keyboard focus */\n.skipLink {\n position: absolute;\n top: var(--spacing-2, 0.5rem);\n left: var(--spacing-2, 0.5rem);\n z-index: 100;\n padding: var(--spacing-2, 0.5rem) var(--spacing-3, 0.75rem);\n background: var(--surface-card, #ffffff);\n color: var(--text-primary, #111827);\n border: 1px solid var(--border-default, #e5e7eb);\n border-radius: var(--radius-md, 0.5rem);\n box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n font-size: var(--font-size-sm, 0.875rem);\n font-weight: 500;\n text-decoration: none;\n transform: translateY(-150%);\n transition:\n transform var(--motion-duration-fast, 150ms)\n var(--motion-easing-standard, ease);\n}\n\n.skipLink:focus-visible {\n transform: translateY(0);\n outline: var(--focus-ring-width, 2px) solid\n var(--focus-ring-color, var(--primary, #3b82f6));\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n/* Sidebar */\n.sidebar {\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n width: var(--admin-shell-sidebar-width, 16rem);\n min-height: 100vh;\n background: var(--surface-card, #ffffff);\n border-right: var(--admin-shell-sidebar-border, 1px solid var(--border-default, #e5e7eb));\n position: sticky;\n top: 0;\n max-height: 100vh;\n}\n\n.sidebarHeader {\n display: flex;\n align-items: center;\n padding: var(--spacing-4, 1rem) var(--spacing-5, 1.25rem);\n border-bottom: var(--admin-shell-sidebar-header-border, 1px solid var(--border-muted, #e5e7eb));\n min-height: 3.5rem;\n flex-shrink: 0;\n}\n\n.sidebarNav {\n flex: 1 1 auto;\n overflow-y: auto;\n padding: var(--spacing-4, 1rem) var(--spacing-3, 0.75rem);\n display: flex;\n flex-direction: column;\n gap: var(--spacing-1, 0.25rem);\n}\n\n.sidebarFooter {\n flex-shrink: 0;\n padding: var(--spacing-3, 0.75rem) var(--spacing-4, 1rem);\n border-top: var(--admin-shell-sidebar-footer-border, 1px solid var(--border-muted, #e5e7eb));\n}\n\n/* Collapsible: the sidebar folds to an icon rail (VI-770) */\n.sidebar[data-collapsed] {\n overflow-x: clip;\n}\n\n.root[data-animate] .sidebar {\n transition: width var(--admin-shell-rail-duration, var(--motion-duration-slow, 500ms))\n var(--admin-shell-rail-easing, var(--motion-easing-default, ease));\n}\n\n.sidebar[data-collapsed=\"true\"] {\n width: var(--admin-shell-rail-width, 4.25rem);\n}\n\n.collapseButton {\n display: inline-grid;\n place-items: center;\n flex: none;\n width: var(--spacing-8, 2rem);\n height: var(--spacing-8, 2rem);\n margin-left: auto;\n padding: 0;\n border: 0;\n border-radius: var(--radius-sm, 0.375rem);\n background: transparent;\n color: var(--text-secondary, #4b5563);\n cursor: pointer;\n}\n\n.collapseButton:hover {\n background: var(--interactive-ghost-bg-hover, var(--surface-muted, #f3f4f6));\n color: var(--text-primary, #111827);\n}\n\n.collapseButton:focus-visible {\n outline: var(--focus-ring-width, 2px) solid\n var(--focus-ring-color, var(--primary, #3b82f6));\n outline-offset: var(--focus-ring-offset, 2px);\n}\n\n.collapseButton svg {\n transition: transform var(--admin-shell-rail-duration, var(--motion-duration-slow, 500ms))\n var(--admin-shell-rail-easing, var(--motion-easing-default, ease));\n}\n\n.sidebar[data-collapsed=\"true\"] .collapseButton {\n margin-left: 0;\n}\n\n.sidebar[data-collapsed=\"true\"] .collapseButton svg {\n transform: scaleX(-1);\n}\n\n.sidebar[data-collapsed=\"true\"] .sidebarHeader {\n flex-direction: column;\n gap: var(--spacing-2, 0.5rem);\n padding-left: var(--spacing-2, 0.5rem);\n padding-right: var(--spacing-2, 0.5rem);\n}\n\n.sidebar[data-collapsed=\"true\"] .sidebarNav {\n align-items: center;\n padding-left: var(--spacing-2, 0.5rem);\n padding-right: var(--spacing-2, 0.5rem);\n}\n\n.sidebar[data-collapsed=\"true\"] .sidebarFooter {\n display: flex;\n justify-content: center;\n padding-left: var(--spacing-2, 0.5rem);\n padding-right: var(--spacing-2, 0.5rem);\n}\n\n/* A slot marks its labels; the rail hides them visually and keeps them as accessible names. */\n.sidebar[data-collapsed=\"true\"] [data-admin-shell-label] {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .root[data-animate] .sidebar,\n .collapseButton svg {\n transition: none;\n }\n}\n\n/* Body = topbar + main */\n.body {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-width: 0;\n min-height: 100vh;\n}\n\n/* Topbar */\n.topbar {\n display: flex;\n align-items: center;\n gap: var(--spacing-4, 1rem);\n padding: var(--spacing-3, 0.75rem) var(--spacing-6, 1.5rem);\n min-height: 3.5rem;\n background: var(--admin-shell-topbar-bg, var(--surface-card, #ffffff));\n border-bottom: var(--admin-shell-topbar-border, 1px solid var(--border-default, #e5e7eb));\n position: sticky;\n top: 0;\n z-index: 10;\n}\n\n.topbarStart {\n display: flex;\n align-items: center;\n gap: var(--spacing-3, 0.75rem);\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.topbarCenter {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--spacing-3, 0.75rem);\n flex: 0 1 auto;\n}\n\n.topbarEnd {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--spacing-2, 0.5rem);\n flex: 1 1 auto;\n min-width: 0;\n}\n\n/* Phone: the sidebar is a sheet behind the topbar's menu button (VI-781). */\n.menuButton {\n display: none;\n}\n\n/* With hideTopbar, the bar holding only the menu button exists on a phone alone. */\n.menuBar {\n display: none;\n}\n\n.scrim {\n display: none;\n}\n\n@media (max-width: 48rem) {\n .menuBar {\n display: flex;\n }\n\n .menuButton {\n display: inline-grid;\n place-items: center;\n flex: none;\n /* 44px touch target (WCAG 2.5.5). */\n width: 2.75rem;\n height: 2.75rem;\n /* The icon lines up with the page gutter; the 44px target overhangs it. */\n margin-left: calc(var(--spacing-3, 0.75rem) * -1);\n padding: 0;\n border: 0;\n border-radius: var(--radius-md, 0.5rem);\n background: transparent;\n color: var(--text-primary, #111827);\n cursor: pointer;\n }\n\n .menuButton:hover {\n background: var(--interactive-ghost-bg-hover, var(--surface-muted, #f3f4f6));\n }\n\n .menuButton:focus-visible {\n outline: var(--focus-ring-width, 2px) solid\n var(--focus-ring-color, var(--primary, #3b82f6));\n outline-offset: calc(var(--focus-ring-offset, 2px) * -1);\n }\n\n .root .sidebar,\n .root[data-animate] .sidebar {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n z-index: var(--z-modal, 1300);\n width: min(var(--admin-shell-sidebar-width, 16rem), calc(100% - var(--spacing-12, 3rem)));\n min-height: 0;\n max-height: none;\n box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n transform: translateX(-100%);\n visibility: hidden;\n transition:\n transform var(--motion-duration-normal, 200ms) var(--motion-easing-exit, ease-in),\n visibility 0s linear var(--motion-duration-normal, 200ms);\n }\n\n .root .sidebar[data-sheet=\"open\"] {\n transform: none;\n visibility: visible;\n transition: transform var(--motion-duration-normal, 200ms) var(--motion-easing-enter, ease-out);\n }\n\n .scrim {\n display: block;\n position: fixed;\n inset: 0;\n z-index: var(--z-modal, 1300);\n background: var(--overlay-bg, rgba(0, 0, 0, 0.5));\n backdrop-filter: blur(4px);\n -webkit-backdrop-filter: blur(4px);\n animation: admin-shell-scrim-in var(--motion-duration-normal, 200ms)\n var(--motion-easing-enter, ease-out);\n }\n}\n\n@keyframes admin-shell-scrim-in {\n from {\n opacity: 0;\n }\n}\n\n@media (max-width: 48rem) and (prefers-reduced-motion: reduce) {\n .root .sidebar,\n .root[data-animate] .sidebar,\n .root .sidebar[data-sheet=\"open\"] {\n transition: none;\n }\n\n .scrim {\n animation: none;\n }\n}\n\n/* Main */\n.main {\n flex: 1 1 auto;\n overflow-y: auto;\n min-width: 0;\n outline: none;\n}\n\n.main:focus-visible {\n outline: var(--focus-ring-width, 2px) solid\n var(--focus-ring-color, var(--primary, #3b82f6));\n outline-offset: calc(var(--focus-ring-offset, 2px) * -1);\n}\n\n.main[data-padding=\"none\"] .mainInner {\n padding: 0;\n}\n\n.main[data-padding=\"sm\"] .mainInner {\n padding: var(--spacing-4, 1rem);\n}\n\n.main[data-padding=\"md\"] .mainInner {\n padding: var(--spacing-6, 1.5rem);\n}\n\n.main[data-padding=\"lg\"] .mainInner {\n padding: var(--spacing-8, 2rem);\n}\n\n.mainInner {\n width: 100%;\n max-width: var(--admin-shell-main-max-width, none);\n margin: 0 auto;\n}\n\n/* Responsive: collapse sidebar on narrow containers */\n@container (max-width: 48rem) {\n .topbar {\n padding-left: var(--spacing-4, 1rem);\n padding-right: var(--spacing-4, 1rem);\n }\n\n .main[data-padding=\"lg\"] .mainInner {\n padding: var(--spacing-5, 1.25rem);\n }\n\n .main[data-padding=\"md\"] .mainInner {\n padding: var(--spacing-4, 1rem);\n }\n}\n"
4334
4334
  }
4335
4335
  ]
4336
4336
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "0.4.0",
3
- "generated_at": "2026-11-14T03:24:58.767Z",
3
+ "generated_at": "2026-11-14T07:29:15.123Z",
4
4
  "components": {
5
5
  "accessibility-specimen": {
6
6
  "category": "specimen",
@@ -4022,7 +4022,15 @@
4022
4022
  "tokens_used": [
4023
4023
  "--border-focus",
4024
4024
  "--border-subtle",
4025
+ "--dialog-backdrop-filter",
4026
+ "--dialog-bg",
4025
4027
  "--dialog-keyboard-inset",
4028
+ "--dialog-max-width",
4029
+ "--dialog-overlay-bg",
4030
+ "--dialog-overlay-blur",
4031
+ "--dialog-padding",
4032
+ "--dialog-radius",
4033
+ "--dialog-shadow",
4026
4034
  "--dialog-viewport-height",
4027
4035
  "--focus-ring-offset",
4028
4036
  "--focus-ring-width",
@@ -6444,10 +6452,16 @@
6444
6452
  "--focus-ring-offset",
6445
6453
  "--focus-ring-width",
6446
6454
  "--font-size-sm",
6455
+ "--lightbox-controls-duration",
6456
+ "--lightbox-image-duration",
6457
+ "--lightbox-image-easing",
6458
+ "--lightbox-slide-distance",
6459
+ "--motion-duration-100",
6447
6460
  "--motion-duration-150",
6448
6461
  "--motion-duration-fast",
6449
6462
  "--motion-duration-normal",
6450
6463
  "--motion-easing-default",
6464
+ "--motion-easing-ease-in-out",
6451
6465
  "--motion-easing-enter",
6452
6466
  "--motion-easing-exit",
6453
6467
  "--overlay-bg",
@@ -7373,6 +7387,11 @@
7373
7387
  "--otp-bg",
7374
7388
  "--otp-bg-invalid",
7375
7389
  "--otp-border",
7390
+ "--otp-cell-font-size",
7391
+ "--otp-cell-height",
7392
+ "--otp-cell-radius",
7393
+ "--otp-cell-width",
7394
+ "--otp-gap",
7376
7395
  "--radius-md",
7377
7396
  "--spacing-2",
7378
7397
  "--surface-error-subtle",
@@ -8922,6 +8941,9 @@
8922
8941
  "--control-state-edge-width",
8923
8942
  "--focus-ring-offset",
8924
8943
  "--focus-ring-width",
8944
+ "--font-size-base",
8945
+ "--font-size-sm",
8946
+ "--font-size-xs",
8925
8947
  "--font-weight-medium",
8926
8948
  "--interactive-primary-bg",
8927
8949
  "--interactive-primary-text",
@@ -8929,16 +8951,30 @@
8929
8951
  "--primary",
8930
8952
  "--radius-lg",
8931
8953
  "--radius-md",
8954
+ "--radius-sm",
8932
8955
  "--radius-xl",
8933
8956
  "--segmented-control-active-weight",
8957
+ "--segmented-control-font-size",
8934
8958
  "--segmented-control-inactive-text",
8935
8959
  "--segmented-control-indicator-bg",
8936
8960
  "--segmented-control-indicator-edge",
8961
+ "--segmented-control-indicator-radius",
8937
8962
  "--segmented-control-indicator-text",
8963
+ "--segmented-control-item-height",
8964
+ "--segmented-control-item-padding-x",
8965
+ "--segmented-control-item-radius",
8938
8966
  "--segmented-control-radius",
8939
8967
  "--segmented-control-track-bg",
8968
+ "--segmented-control-track-padding",
8969
+ "--spacing-1",
8970
+ "--spacing-2",
8971
+ "--spacing-3",
8972
+ "--spacing-4",
8940
8973
  "--surface-page",
8941
- "--text-primary"
8974
+ "--text-primary",
8975
+ "--toggle-group-xs-font-size",
8976
+ "--toggle-group-xs-item-radius",
8977
+ "--toggle-group-xs-padding-x"
8942
8978
  ],
8943
8979
  "example": "<SegmentedControl\n aria-label=\"Payment status\"\n defaultValue=\"unpaid\"\n options={[\n { value: \"unpaid\", label: \"Unpaid\" },\n { value: \"paid\", label: \"Paid\" },\n { value: \"any\", label: \"Any\" },\n ]}\n/>\n"
8944
8980
  },
@@ -12130,7 +12166,8 @@
12130
12166
  "when_to_use": [
12131
12167
  "Switching between mutually exclusive views or modes (grid/list, day/week/month)",
12132
12168
  "Selecting one or multiple options from a small set of 2-5 choices",
12133
- "Toolbar-style option groups with icon or text items"
12169
+ "Toolbar-style option groups with icon or text items",
12170
+ "Tap-to-pick answer rows in a form, one or several (variant option)"
12134
12171
  ],
12135
12172
  "when_not_to_use": [
12136
12173
  "Navigation between pages or routes (use Tabs)",
@@ -12141,7 +12178,8 @@
12141
12178
  "variants": {
12142
12179
  "variant": [
12143
12180
  "default",
12144
- "outline"
12181
+ "outline",
12182
+ "option"
12145
12183
  ],
12146
12184
  "size": [
12147
12185
  "xs",
@@ -12158,8 +12196,21 @@
12158
12196
  },
12159
12197
  {
12160
12198
  "name": "variant",
12161
- "type": "'default' | 'outline'",
12162
- "default": "default"
12199
+ "type": "'default' | 'outline' | 'option'",
12200
+ "default": "default",
12201
+ "description": "option draws full-width tap-to-pick rows with a lettered key and, in a multiple group, a check box.\n"
12202
+ },
12203
+ {
12204
+ "name": "columns",
12205
+ "type": "1 | 2",
12206
+ "default": "1",
12207
+ "description": "Option variant only. Two lays the rows out in a two-column grid."
12208
+ },
12209
+ {
12210
+ "name": "shortcuts",
12211
+ "type": "boolean",
12212
+ "default": false,
12213
+ "description": "Pressing A, B, C… while focus is in the group picks the item at that position."
12163
12214
  },
12164
12215
  {
12165
12216
  "name": "size",
@@ -12198,12 +12249,14 @@
12198
12249
  "tokens_used": [
12199
12250
  "--border-default",
12200
12251
  "--border-focus",
12252
+ "--border-strong",
12201
12253
  "--focus-ring-offset",
12202
12254
  "--focus-ring-width",
12203
12255
  "--font-size-base",
12204
12256
  "--font-size-sm",
12205
12257
  "--font-size-xs",
12206
12258
  "--font-weight-medium",
12259
+ "--font-weight-semibold",
12207
12260
  "--interactive-primary-bg",
12208
12261
  "--interactive-primary-text",
12209
12262
  "--label-box-height",
@@ -12218,9 +12271,37 @@
12218
12271
  "--spacing-1",
12219
12272
  "--spacing-2",
12220
12273
  "--spacing-3",
12274
+ "--spacing-3_5",
12221
12275
  "--spacing-4",
12276
+ "--spacing-4_5",
12277
+ "--stroke-width-regular",
12278
+ "--stroke-width-thin",
12222
12279
  "--surface-interactive-hover",
12223
12280
  "--text-primary",
12281
+ "--text-secondary",
12282
+ "--toggle-group-option-bg",
12283
+ "--toggle-group-option-blur",
12284
+ "--toggle-group-option-check-border",
12285
+ "--toggle-group-option-check-radius",
12286
+ "--toggle-group-option-check-size",
12287
+ "--toggle-group-option-font-size",
12288
+ "--toggle-group-option-font-weight",
12289
+ "--toggle-group-option-gap",
12290
+ "--toggle-group-option-hover-bg",
12291
+ "--toggle-group-option-inner-gap",
12292
+ "--toggle-group-option-key-border",
12293
+ "--toggle-group-option-key-font-size",
12294
+ "--toggle-group-option-key-radius",
12295
+ "--toggle-group-option-key-size",
12296
+ "--toggle-group-option-key-text",
12297
+ "--toggle-group-option-mark-bg",
12298
+ "--toggle-group-option-mark-text",
12299
+ "--toggle-group-option-min-height",
12300
+ "--toggle-group-option-padding",
12301
+ "--toggle-group-option-radius",
12302
+ "--toggle-group-option-selected-bg",
12303
+ "--toggle-group-option-selected-ring",
12304
+ "--toggle-group-option-text",
12224
12305
  "--toggle-group-selected-bg",
12225
12306
  "--toggle-group-selected-text",
12226
12307
  "--toggle-group-track-bg",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loworbitstudio/visor",
3
- "version": "1.51.0",
3
+ "version": "1.53.0",
4
4
  "description": "CLI for the Visor design system — add components, hooks, and utilities to your project.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -46,7 +46,7 @@
46
46
  "dependencies": {
47
47
  "@aws-sdk/client-s3": "^3.1021.0",
48
48
  "@babel/parser": "^7.26.0",
49
- "@loworbitstudio/visor-theme-engine": "^0.39.0",
49
+ "@loworbitstudio/visor-theme-engine": "^0.40.0",
50
50
  "commander": "^13.1.0",
51
51
  "diff": "^8.0.4",
52
52
  "picocolors": "^1.1.1",