@loworbitstudio/visor 1.53.0 → 1.54.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-14T07:29:15.128Z",
3
+ "generated_at": "2026-11-20T01:32:32.634Z",
4
4
  "components": {
5
5
  "accessibility-specimen": {
6
6
  "changeType": "current",
@@ -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(--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"
923
+ "content": "/* Dialog overlay\n * Default: 4px backdrop blur. Density axis: editorial uses 2px.\n * Prefixed line first: Lightning CSS (in Next) keeps only the last of the pair when\n * the value holds a var(), so unprefixed-first loses backdrop-filter (VI-788). */\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 -webkit-backdrop-filter: blur(var(--dialog-overlay-blur, 4px));\n backdrop-filter: blur(var(--dialog-overlay-blur, 4px));\n}\n\n:global([data-density=\"editorial\"]) .overlay {\n -webkit-backdrop-filter: blur(var(--dialog-overlay-blur, 2px));\n 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 -webkit-backdrop-filter: var(--dialog-backdrop-filter, none);\n 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
  },
@@ -1930,7 +1930,7 @@
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 /** 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"
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 const touch = event.touches[0]\n if (!touch) return\n touchStartX.current = touch.clientX\n touchEndX.current = touch.clientX\n },\n []\n )\n\n const handleTouchMove = React.useCallback(\n (event: React.TouchEvent) => {\n const touch = event.touches[0]\n if (touch) touchEndX.current = touch.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 image = images[idx]\n if (!image) return\n const img = new Image()\n img.src = image.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",
@@ -2214,7 +2214,7 @@
2214
2214
  {
2215
2215
  "path": "components/ui/phone-input/phone-input.tsx",
2216
2216
  "type": "registry:ui",
2217
- "content": "\"use client\"\n\nimport * as React from \"react\"\nimport IntlTelInput from \"@intl-tel-input/react\"\nimport type { IntlTelInputRef } from \"@intl-tel-input/react\"\nimport type { CountrySelectorMode, Iso2, ValidationError } from \"intl-tel-input\"\nimport \"intl-tel-input/styles\"\nimport { cn } from \"../../../lib/utils\"\n\n// Password managers mangle tel fields. Typed through `input` props because the\n// library's `inputProps` surface does not model arbitrary data attributes.\nconst PASSWORD_MANAGER_OPT_OUT = {\n \"data-1p-ignore\": true,\n \"data-lpignore\": \"true\",\n \"data-bwignore\": true,\n \"data-form-type\": \"other\",\n} as React.ComponentPropsWithoutRef<\"input\">\n\nexport interface PhoneInputPortal {\n /** Element the country selector is portaled into. */\n container: HTMLElement\n /**\n * Theme-scoping class applied to the portaled country selector. Required —\n * a selector portaled out of the tree escapes the consumer's theme class,\n * so the scope has to travel with it.\n */\n scopeClassName: string\n}\n\nexport interface PhoneInputProps {\n /** HTML id attribute */\n id?: string\n /** HTML name attribute */\n name?: string\n /** Phone number in E.164 (e.g. \"+14155551234\"). Displayed formatted for the detected country. */\n value?: string | null\n /** Placeholder text */\n placeholder?: string\n /** Whether the field is required */\n required?: boolean\n /** Whether the field is disabled */\n disabled?: boolean\n /** Whether the field is read-only. Pair with `countrySelectorMode=\"OFF\"` to also close off the country dropdown. */\n readOnly?: boolean\n /** Country selector behaviour. `\"OFF\"` renders the selected country as a non-interactive element. */\n countrySelectorMode?: CountrySelectorMode\n /** ISO 3166-1 alpha-2 country selected on mount. */\n initialCountry?: Iso2\n /** Size variant — matches Input component sizes */\n size?: \"sm\" | \"md\" | \"lg\"\n /** Additional CSS classes applied to the wrapper */\n className?: string\n /**\n * Portal the country selector out of the input's DOM position. All-or-nothing:\n * the scoping class is not separable from the container, so the selector can\n * never escape its theme. Omit for the default inline selector.\n */\n portal?: PhoneInputPortal\n /**\n * Called with the E.164 number and its validity. `e164` is `null` for anything\n * that is not a complete, valid number — a partial is never emitted.\n */\n onChange?: (e164: string | null, isValid: boolean) => void\n /** Called on blur with the validation error for a non-empty, invalid number (otherwise `null`). */\n onBlur?: (error: ValidationError | null) => void\n}\n\nconst PhoneInput = React.forwardRef<IntlTelInputRef, PhoneInputProps>(\n (\n {\n id,\n name,\n value,\n placeholder,\n required = false,\n disabled = false,\n readOnly = false,\n countrySelectorMode,\n initialCountry = \"us\",\n size = \"md\",\n className,\n portal,\n onChange,\n onBlur,\n },\n ref\n ) => {\n const itiRef = React.useRef<IntlTelInputRef>(null)\n // `undefined` until the first emission — an initial `{ null, false }` would be\n // indistinguishable from the first partial the user types and would swallow it.\n const lastEmitted = React.useRef<\n { e164: string | null; isValid: boolean } | undefined\n >(undefined)\n\n React.useImperativeHandle(ref, () => ({\n getInstance: () => itiRef.current?.getInstance() ?? null,\n getInput: () => itiRef.current?.getInput() ?? null,\n }))\n\n // `emit` must be identity-stable. The wrapper derives its internal `update`\n // from the onChange* props and keys its value-writeback effect on\n // `[value, update]`; a new `emit` each render re-runs that effect, and while\n // the field is unfocused and holding a partial (so the controlled value is\n // null) it calls setNumber(\"\") and erases what the user typed. Reading the\n // consumer's callback from a ref keeps the effect keyed on `value` alone.\n const onChangeRef = React.useRef(onChange)\n onChangeRef.current = onChange\n\n // The library's own `onChangeNumber` emits `getNumber()` verbatim, which for a\n // partial is a `+<dial code>` prefix glued to the formatted national string\n // (typing \"21337\" yields \"+1213-37\"). Derive the value at emit time instead so\n // a malformed number can never reach the consumer.\n const emit = React.useCallback(() => {\n const iti = itiRef.current?.getInstance()\n const isValid = iti?.isValidNumber() ?? false\n const e164 = isValid ? iti!.getNumber() : null\n const last = lastEmitted.current\n if (last && last.e164 === e164 && last.isValid === isValid) return\n lastEmitted.current = { e164, isValid }\n onChangeRef.current?.(e164, isValid)\n }, [])\n\n const handleBlur = React.useCallback(() => {\n const iti = itiRef.current?.getInstance()\n const input = itiRef.current?.getInput()\n // The error callback never fires while a number is still partial, so read the\n // error directly — a visibly-present partial that saves as nothing is silent\n // data loss. Gate on validity: getValidationError() reports \"IS_POSSIBLE\" for\n // a number that is fine, which is not an error.\n const error =\n iti && input?.value && !iti.isValidNumber()\n ? (iti.getValidationError() ?? null)\n : null\n onBlur?.(error)\n }, [onBlur])\n\n // The library validates every option key it is handed, and a key explicitly\n // set to `undefined` is still an own key — so spreading an unset optional\n // prop makes it warn (\"must be ...; got undefined. Ignoring.\") on every\n // mount. Carry each key only when the consumer actually set one; there is no\n // correct default to invent for either.\n const optional = {\n ...(countrySelectorMode !== undefined && { countrySelectorMode }),\n ...(portal && {\n classNames: { countrySelectorContainer: portal.scopeClassName },\n }),\n }\n\n return (\n <div data-slot=\"phone-input\" data-size={size} className={cn(className)}>\n <IntlTelInput\n ref={itiRef}\n {...optional}\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n onChangeNumber={emit}\n onChangeCountry={emit}\n onChangeValidity={emit}\n initialCountry={initialCountry}\n initialCountryLookup={null}\n separateDialCode\n formatAsYouType\n strictMode\n countrySearch\n loadUtils={() => import(\"intl-tel-input/utils\")}\n dropdownParent={portal?.container ?? null}\n inputProps={{\n id,\n name,\n placeholder,\n required,\n autoComplete: \"tel\",\n onBlur: handleBlur,\n ...PASSWORD_MANAGER_OPT_OUT,\n }}\n />\n </div>\n )\n }\n)\nPhoneInput.displayName = \"PhoneInput\"\n\nexport { PhoneInput }\n"
2217
+ "content": "\"use client\"\n\nimport * as React from \"react\"\nimport IntlTelInput from \"@intl-tel-input/react\"\nimport type { IntlTelInputRef } from \"@intl-tel-input/react\"\nimport type { CountrySelectorMode, Iso2, ValidationError } from \"intl-tel-input\"\nimport \"intl-tel-input/styles\"\nimport { cn } from \"../../../lib/utils\"\n\n// Password managers mangle tel fields. Typed through `input` props because the\n// library's `inputProps` surface does not model arbitrary data attributes.\nconst PASSWORD_MANAGER_OPT_OUT = {\n \"data-1p-ignore\": true,\n \"data-lpignore\": \"true\",\n \"data-bwignore\": true,\n \"data-form-type\": \"other\",\n} as React.ComponentPropsWithoutRef<\"input\">\n\nexport interface PhoneInputPortal {\n /** Element the country selector is portaled into. */\n container: HTMLElement\n /**\n * Theme-scoping class applied to the portaled country selector. Required —\n * a selector portaled out of the tree escapes the consumer's theme class,\n * so the scope has to travel with it.\n */\n scopeClassName: string\n}\n\nexport interface PhoneInputProps {\n /** HTML id attribute */\n id?: string\n /** HTML name attribute */\n name?: string\n /** Phone number in E.164 (e.g. \"+14155551234\"). Displayed formatted for the detected country. */\n value?: string | null\n /** Placeholder text */\n placeholder?: string\n /** Whether the field is required */\n required?: boolean\n /** Whether the field is disabled */\n disabled?: boolean\n /** Whether the field is read-only. Pair with `countrySelectorMode=\"OFF\"` to also close off the country dropdown. */\n readOnly?: boolean\n /** Country selector behaviour. `\"OFF\"` renders the selected country as a non-interactive element. */\n countrySelectorMode?: CountrySelectorMode\n /** ISO 3166-1 alpha-2 country selected on mount. */\n initialCountry?: Iso2\n /** Size variant — matches Input component sizes */\n size?: \"sm\" | \"md\" | \"lg\"\n /** Additional CSS classes applied to the wrapper */\n className?: string\n /**\n * Portal the country selector out of the input's DOM position. All-or-nothing:\n * the scoping class is not separable from the container, so the selector can\n * never escape its theme. Omit for the default inline selector.\n */\n portal?: PhoneInputPortal\n /**\n * Called with the E.164 number and its validity. `e164` is `null` for anything\n * that is not a complete, valid number — a partial is never emitted.\n */\n onChange?: (e164: string | null, isValid: boolean) => void\n /** Called on blur with the validation error for a non-empty, invalid number (otherwise `null`). */\n onBlur?: (error: ValidationError | null) => void\n}\n\nconst PhoneInput = React.forwardRef<IntlTelInputRef, PhoneInputProps>(\n (\n {\n id,\n name,\n value,\n placeholder,\n required = false,\n disabled = false,\n readOnly = false,\n countrySelectorMode,\n initialCountry = \"us\",\n size = \"md\",\n className,\n portal,\n onChange,\n onBlur,\n },\n ref\n ) => {\n const itiRef = React.useRef<IntlTelInputRef>(null)\n // `undefined` until the first emission — an initial `{ null, false }` would be\n // indistinguishable from the first partial the user types and would swallow it.\n const lastEmitted = React.useRef<\n { e164: string | null; isValid: boolean } | undefined\n >(undefined)\n\n React.useImperativeHandle(ref, () => ({\n getInstance: () => itiRef.current?.getInstance() ?? null,\n getInput: () => itiRef.current?.getInput() ?? null,\n }))\n\n // `emit` must be identity-stable. The wrapper derives its internal `update`\n // from the onChange* props and keys its value-writeback effect on\n // `[value, update]`; a new `emit` each render re-runs that effect, and while\n // the field is unfocused and holding a partial (so the controlled value is\n // null) it calls setNumber(\"\") and erases what the user typed. Reading the\n // consumer's callback from a ref keeps the effect keyed on `value` alone.\n const onChangeRef = React.useRef(onChange)\n onChangeRef.current = onChange\n\n // The library's own `onChangeNumber` emits `getNumber()` verbatim, which for a\n // partial is a `+<dial code>` prefix glued to the formatted national string\n // (typing \"21337\" yields \"+1213-37\"). Derive the value at emit time instead so\n // a malformed number can never reach the consumer.\n const emit = React.useCallback(() => {\n const iti = itiRef.current?.getInstance()\n const isValid = iti?.isValidNumber() ?? false\n const e164 = isValid ? iti!.getNumber() : null\n const last = lastEmitted.current\n if (last && last.e164 === e164 && last.isValid === isValid) return\n lastEmitted.current = { e164, isValid }\n onChangeRef.current?.(e164, isValid)\n }, [])\n\n const handleBlur = React.useCallback(() => {\n const iti = itiRef.current?.getInstance()\n const input = itiRef.current?.getInput()\n // The error callback never fires while a number is still partial, so read the\n // error directly — a visibly-present partial that saves as nothing is silent\n // data loss. Gate on validity: getValidationError() reports \"IS_POSSIBLE\" for\n // a number that is fine, which is not an error.\n const error =\n iti && input?.value && !iti.isValidNumber()\n ? (iti.getValidationError() ?? null)\n : null\n onBlur?.(error)\n }, [onBlur])\n\n // The library validates every option key it is handed, and a key explicitly\n // set to `undefined` is still an own key — so spreading an unset optional\n // prop makes it warn (\"must be ...; got undefined. Ignoring.\") on every\n // mount. Carry each key only when the consumer actually set one; there is no\n // correct default to invent for either.\n const optional = {\n ...(countrySelectorMode !== undefined && { countrySelectorMode }),\n ...(portal && {\n classNames: { countrySelectorContainer: portal.scopeClassName },\n // Below 500px the library swaps to its full-screen picker, which ignores\n // dropdownParent and would otherwise land on document.body.\n fullscreenParent: portal.container,\n }),\n }\n\n return (\n <div data-slot=\"phone-input\" data-size={size} className={cn(className)}>\n <IntlTelInput\n ref={itiRef}\n {...optional}\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n onChangeNumber={emit}\n onChangeCountry={emit}\n onChangeValidity={emit}\n initialCountry={initialCountry}\n initialCountryLookup={null}\n separateDialCode\n formatAsYouType\n strictMode\n countrySearch\n loadUtils={() => import(\"intl-tel-input/utils\")}\n dropdownParent={portal?.container ?? null}\n inputProps={{\n id,\n name,\n placeholder,\n required,\n autoComplete: \"tel\",\n onBlur: handleBlur,\n ...PASSWORD_MANAGER_OPT_OUT,\n }}\n />\n </div>\n )\n }\n)\nPhoneInput.displayName = \"PhoneInput\"\n\nexport { PhoneInput }\n"
2218
2218
  },
2219
2219
  {
2220
2220
  "path": "components/ui/phone-input/phone-input.css",
@@ -3292,7 +3292,7 @@
3292
3292
  {
3293
3293
  "path": "components/ui/stat-card/stat-card.module.css",
3294
3294
  "type": "registry:ui",
3295
- "content": "/* Stat Card base: self-contained dashboard metric card\n *\n * Sizing strategy: hug content by default. Place stat cards in a grid\n * (`grid-template-columns: repeat(N, 1fr)`) or a flex row with `flex: 1`\n * per child when uniform widths are needed across a dashboard. A single\n * stat card in a generic flex-row parent renders at its natural content\n * width — the big value token drives the minimum width.\n *\n * No inline-size containment here: inline-size containment prevents the\n * element's intrinsic width from depending on its children, which means\n * it collapses to 0 inside a flex-row parent with `flex: 0 1 auto`. Since\n * the card's responsive variants are already driven by explicit props,\n * the container query buys nothing and costs the natural sizing behavior.\n */\n.base {\n --stat-card-value-font: var(--font-display, var(--font-family-heading, inherit));\n --stat-card-value-size: var(--font-size-3xl, 1.875rem);\n --stat-card-value-size-hero: var(--font-size-6xl, 3.5rem);\n\n display: flex;\n flex-direction: column;\n gap: var(--spacing-2, 0.5rem);\n padding: var(--spacing-5, 1.25rem);\n background-color: var(--surface-card, #ffffff);\n border: 1px solid var(--border-default, #e5e7eb);\n border-radius: var(--radius-lg, 0.75rem);\n color: var(--text-primary, #111827);\n box-shadow: var(--shadow-xs, 0 1px 2px 0 rgb(0 0 0 / 0.05));\n transition:\n box-shadow var(--motion-duration-150, 150ms)\n var(--motion-easing-standard, ease),\n border-color var(--motion-duration-150, 150ms)\n var(--motion-easing-standard, ease);\n}\n\n/* Default variant — just the base styles */\n.variantDefault {\n /* inherits base */\n}\n\n/* Highlight variant — accent-tinted surface with elevation\n *\n * Uses color-mix over the theme's brand accent (--interactive-primary-bg)\n * plus the theme's card surface, so the variant reads as \"featured / primary\"\n * regardless of whether the active theme is light or dark and regardless of\n * which brand color the theme ships. No hardcoded gradient — gradients\n * conflict with dark modes where lighter colors at the top look like flares.\n */\n.variantHighlight {\n background-color: color-mix(\n in srgb,\n var(--interactive-primary-bg, #2563eb) 6%,\n var(--surface-card, #ffffff)\n );\n border-color: color-mix(\n in srgb,\n var(--interactive-primary-bg, #2563eb) 40%,\n var(--border-default, #e5e7eb)\n );\n box-shadow:\n var(--shadow-md, 0 4px 6px -1px rgb(0 0 0 / 0.1)),\n 0 0 24px -8px\n color-mix(\n in srgb,\n var(--interactive-primary-bg, #2563eb) 25%,\n transparent\n );\n}\n\n/* Size md — default — no overrides; uses the base padding/gap/font-size */\n.sizeMd {\n /* inherits base */\n}\n\n/* Size sm — denser padding, smaller value */\n.sizeSm {\n padding: var(--spacing-4, 1rem);\n gap: var(--spacing-1, 0.25rem);\n}\n\n/* Header row: label on the left, trend slot on the right */\n.header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--spacing-3, 0.75rem);\n min-width: 0;\n}\n\n/* Label — small uppercase muted text */\n.label {\n margin: 0;\n font-size: var(--font-size-xs, 0.75rem);\n font-weight: var(--font-weight-semibold, 600);\n letter-spacing: var(--letter-spacing-wide, 0.05em);\n text-transform: uppercase;\n color: var(--text-tertiary, #6b7280);\n line-height: var(--line-height-tight, 1.25);\n min-width: 0;\n}\n\n/* Trend slot — header position (legacy): right-aligned sparkline / icon container */\n.trend {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n color: var(--text-tertiary, #6b7280);\n flex: 0 0 auto;\n}\n\n/* Trend slot — footer position (default): full-width, padded above the value row.\n *\n * Rendered as a direct child of the card root after the value/delta and before the\n * footer slot. Full card width, no fixed flex sizing — so Progress bars, full-width\n * sparklines, and anything that competes with the label for header space have room\n * to breathe. The `--stat-card-trend-padding-top` hook lets consumers tune the gap\n * to the value row without touching internal CSS.\n */\n.trendFooter {\n display: flex;\n align-items: center;\n width: 100%;\n padding-top: var(--stat-card-trend-padding-top, var(--spacing-3, 0.75rem));\n color: var(--text-tertiary, #6b7280);\n}\n\n/* Value — big numeric display */\n.value {\n margin: 0;\n font-family: var(--font-family-heading, inherit);\n font-size: var(--font-size-3xl, 1.875rem);\n font-weight: var(--font-weight-semibold, 600);\n line-height: var(--line-height-tight, 1.1);\n letter-spacing: var(--letter-spacing-tight, -0.02em);\n color: var(--text-primary, #111827);\n font-variant-numeric: tabular-nums;\n}\n\n/* valueAs=\"hero\" — marquee display treatment */\n.value[data-value-as=\"hero\"] {\n font-family: var(--stat-card-value-font);\n font-size: var(--stat-card-value-size-hero, var(--stat-card-value-size, 3.5rem));\n font-weight: var(--font-weight-normal, 400);\n letter-spacing: 0;\n line-height: 1;\n}\n\n/* valueAs=\"compact\" — tighter than default (2xl) */\n.value[data-value-as=\"compact\"] {\n font-size: var(--font-size-2xl, 1.5rem);\n}\n\n.sizeSm .value {\n font-size: var(--font-size-2xl, 1.5rem);\n}\n\n.sizeSm .label {\n font-size: var(--font-size-xs, 0.75rem);\n}\n\n.variantHighlight .value {\n font-size: var(--font-size-4xl, 2.25rem);\n}\n\n/* Delta row — change indicator */\n.delta {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-1, 0.25rem);\n font-size: var(--font-size-sm, 0.875rem);\n font-weight: var(--font-weight-medium, 500);\n line-height: var(--line-height-tight, 1.25);\n color: var(--text-secondary, #6b7280);\n flex-wrap: wrap;\n}\n\n.delta[data-direction=\"up\"] {\n color: var(--text-success, #16a34a);\n}\n\n.delta[data-direction=\"down\"] {\n color: var(--text-danger, #dc2626);\n}\n\n.delta[data-direction=\"flat\"] {\n color: var(--text-tertiary, #6b7280);\n}\n\n.deltaGlyph {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 1em;\n line-height: 1;\n}\n\n.deltaValue {\n font-variant-numeric: tabular-nums;\n}\n\n.deltaLabel {\n color: var(--text-tertiary, #6b7280);\n font-weight: var(--font-weight-regular, 400);\n margin-left: var(--spacing-1, 0.25rem);\n}\n\n/* Visually hidden but announced to screen readers */\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: 0;\n}\n\n/* Footer slot */\n.footer {\n margin-top: var(--spacing-1, 0.25rem);\n padding-top: var(--spacing-3, 0.75rem);\n border-top: 1px solid var(--border-default, #e5e7eb);\n font-size: var(--font-size-sm, 0.875rem);\n color: var(--text-secondary, #6b7280);\n line-height: var(--line-height-normal, 1.5);\n}\n\n.sizeSm .footer {\n padding-top: var(--spacing-2, 0.5rem);\n font-size: var(--font-size-xs, 0.75rem);\n}\n\n/* Respect reduced motion */\n@media (prefers-reduced-motion: reduce) {\n .base {\n transition: none;\n }\n}\n"
3295
+ "content": "/* Stat Card base: self-contained dashboard metric card\n *\n * Sizing strategy: hug content by default. Place stat cards in a grid\n * (`grid-template-columns: repeat(N, 1fr)`) or a flex row with `flex: 1`\n * per child when uniform widths are needed across a dashboard. A single\n * stat card in a generic flex-row parent renders at its natural content\n * width — the big value token drives the minimum width.\n *\n * No inline-size containment here: inline-size containment prevents the\n * element's intrinsic width from depending on its children, which means\n * it collapses to 0 inside a flex-row parent with `flex: 0 1 auto`. Since\n * the card's responsive variants are already driven by explicit props,\n * the container query buys nothing and costs the natural sizing behavior.\n */\n.base {\n --stat-card-value-font: var(--font-display, var(--font-family-heading, inherit));\n --stat-card-value-size: var(--font-size-3xl, 1.875rem);\n --stat-card-value-size-hero: var(--font-size-6xl, 3.5rem);\n\n display: flex;\n flex-direction: column;\n gap: var(--spacing-2, 0.5rem);\n padding: var(--stat-card-padding, var(--spacing-5, 1.25rem));\n background-color: var(--surface-card, #ffffff);\n border: var(--stat-card-border, 1px solid var(--border-default, #e5e7eb));\n border-radius: var(--stat-card-radius, var(--radius-lg, 0.75rem));\n color: var(--text-primary, #111827);\n box-shadow: var(--stat-card-shadow, var(--shadow-xs, 0 1px 2px 0 rgb(0 0 0 / 0.05)));\n transition:\n box-shadow var(--motion-duration-150, 150ms)\n var(--motion-easing-standard, ease),\n border-color var(--motion-duration-150, 150ms)\n var(--motion-easing-standard, ease);\n}\n\n/* Default variant — just the base styles */\n.variantDefault {\n /* inherits base */\n}\n\n/* Highlight variant — accent-tinted surface with elevation\n *\n * Uses color-mix over the theme's brand accent (--interactive-primary-bg)\n * plus the theme's card surface, so the variant reads as \"featured / primary\"\n * regardless of whether the active theme is light or dark and regardless of\n * which brand color the theme ships. No hardcoded gradient — gradients\n * conflict with dark modes where lighter colors at the top look like flares.\n */\n.variantHighlight {\n background-color: color-mix(\n in srgb,\n var(--interactive-primary-bg, #2563eb) 6%,\n var(--surface-card, #ffffff)\n );\n border-color: color-mix(\n in srgb,\n var(--interactive-primary-bg, #2563eb) 40%,\n var(--border-default, #e5e7eb)\n );\n box-shadow:\n var(--shadow-md, 0 4px 6px -1px rgb(0 0 0 / 0.1)),\n 0 0 24px -8px\n color-mix(\n in srgb,\n var(--interactive-primary-bg, #2563eb) 25%,\n transparent\n );\n}\n\n/* Size md — default — no overrides; uses the base padding/gap/font-size */\n.sizeMd {\n /* inherits base */\n}\n\n/* Size sm — denser padding, smaller value */\n.sizeSm {\n padding: var(--spacing-4, 1rem);\n gap: var(--spacing-1, 0.25rem);\n}\n\n/* Header row: label on the left, trend slot on the right */\n.header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--spacing-3, 0.75rem);\n min-width: 0;\n}\n\n/* Label — small uppercase muted text */\n.label {\n margin: 0;\n font-size: var(--stat-card-label-font-size, var(--font-size-xs, 0.75rem));\n font-weight: var(--stat-card-label-font-weight, var(--font-weight-semibold, 600));\n letter-spacing: var(--stat-card-label-letter-spacing, var(--letter-spacing-wide, 0.05em));\n text-transform: uppercase;\n color: var(--stat-card-label-color, var(--text-tertiary, #6b7280));\n line-height: var(--stat-card-label-line-height, var(--line-height-tight, 1.25));\n min-width: 0;\n}\n\n/* Trend slot — header position (legacy): right-aligned sparkline / icon container */\n.trend {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n color: var(--text-tertiary, #6b7280);\n flex: 0 0 auto;\n}\n\n/* Trend slot — footer position (default): full-width, padded above the value row.\n *\n * Rendered as a direct child of the card root after the value/delta and before the\n * footer slot. Full card width, no fixed flex sizing — so Progress bars, full-width\n * sparklines, and anything that competes with the label for header space have room\n * to breathe. The `--stat-card-trend-padding-top` hook lets consumers tune the gap\n * to the value row without touching internal CSS.\n */\n.trendFooter {\n display: flex;\n align-items: center;\n width: 100%;\n padding-top: var(--stat-card-trend-padding-top, var(--spacing-3, 0.75rem));\n color: var(--text-tertiary, #6b7280);\n}\n\n/* Value — big numeric display */\n.value {\n margin: 0;\n font-family: var(--stat-card-value-font-family, var(--font-family-heading, inherit));\n font-size: var(--stat-card-value-font-size, var(--font-size-3xl, 1.875rem));\n font-weight: var(--stat-card-value-font-weight, var(--font-weight-semibold, 600));\n line-height: var(--stat-card-value-line-height, var(--line-height-tight, 1.1));\n letter-spacing: var(--stat-card-value-letter-spacing, var(--letter-spacing-tight, -0.02em));\n color: var(--text-primary, #111827);\n font-variant-numeric: tabular-nums;\n}\n\n/* valueAs=\"hero\" — marquee display treatment */\n.value[data-value-as=\"hero\"] {\n font-family: var(--stat-card-value-font);\n font-size: var(--stat-card-value-size-hero, var(--stat-card-value-size, 3.5rem));\n font-weight: var(--font-weight-normal, 400);\n letter-spacing: 0;\n line-height: 1;\n}\n\n/* valueAs=\"compact\" — tighter than default (2xl) */\n.value[data-value-as=\"compact\"] {\n font-size: var(--font-size-2xl, 1.5rem);\n}\n\n.sizeSm .value {\n font-size: var(--font-size-2xl, 1.5rem);\n}\n\n.sizeSm .label {\n font-size: var(--font-size-xs, 0.75rem);\n}\n\n.variantHighlight .value {\n font-size: var(--font-size-4xl, 2.25rem);\n}\n\n/* Delta row — change indicator */\n.delta {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-1, 0.25rem);\n font-size: var(--font-size-sm, 0.875rem);\n font-weight: var(--font-weight-medium, 500);\n line-height: var(--line-height-tight, 1.25);\n color: var(--text-secondary, #6b7280);\n flex-wrap: wrap;\n}\n\n.delta[data-direction=\"up\"] {\n color: var(--text-success, #16a34a);\n}\n\n.delta[data-direction=\"down\"] {\n color: var(--text-danger, #dc2626);\n}\n\n.delta[data-direction=\"flat\"] {\n color: var(--text-tertiary, #6b7280);\n}\n\n.deltaGlyph {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 1em;\n line-height: 1;\n}\n\n.deltaValue {\n font-variant-numeric: tabular-nums;\n}\n\n.deltaLabel {\n color: var(--text-tertiary, #6b7280);\n font-weight: var(--font-weight-regular, 400);\n margin-left: var(--spacing-1, 0.25rem);\n}\n\n/* Visually hidden but announced to screen readers */\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: 0;\n}\n\n/* Footer slot */\n.footer {\n margin-top: var(--spacing-1, 0.25rem);\n padding-top: var(--spacing-3, 0.75rem);\n border-top: var(--stat-card-footer-border, 1px solid var(--border-default, #e5e7eb));\n font-size: var(--stat-card-footer-font-size, var(--font-size-sm, 0.875rem));\n font-weight: var(--stat-card-footer-font-weight, inherit);\n color: var(--stat-card-footer-color, var(--text-secondary, #6b7280));\n line-height: var(--stat-card-footer-line-height, var(--line-height-normal, 1.5));\n}\n\n.sizeSm .footer {\n padding-top: var(--spacing-2, 0.5rem);\n font-size: var(--font-size-xs, 0.75rem);\n}\n\n/* Respect reduced motion */\n@media (prefers-reduced-motion: reduce) {\n .base {\n transition: none;\n }\n}\n"
3296
3296
  }
3297
3297
  ]
3298
3298
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "0.4.0",
3
- "generated_at": "2026-11-14T07:29:15.123Z",
3
+ "generated_at": "2026-11-20T01:32:32.625Z",
4
4
  "components": {
5
5
  "accessibility-specimen": {
6
6
  "category": "specimen",
@@ -10318,8 +10318,27 @@
10318
10318
  "--spacing-3",
10319
10319
  "--spacing-4",
10320
10320
  "--spacing-5",
10321
+ "--stat-card-border",
10322
+ "--stat-card-footer-border",
10323
+ "--stat-card-footer-color",
10324
+ "--stat-card-footer-font-size",
10325
+ "--stat-card-footer-font-weight",
10326
+ "--stat-card-footer-line-height",
10327
+ "--stat-card-label-color",
10328
+ "--stat-card-label-font-size",
10329
+ "--stat-card-label-font-weight",
10330
+ "--stat-card-label-letter-spacing",
10331
+ "--stat-card-label-line-height",
10332
+ "--stat-card-padding",
10333
+ "--stat-card-radius",
10334
+ "--stat-card-shadow",
10321
10335
  "--stat-card-trend-padding-top",
10322
10336
  "--stat-card-value-font",
10337
+ "--stat-card-value-font-family",
10338
+ "--stat-card-value-font-size",
10339
+ "--stat-card-value-font-weight",
10340
+ "--stat-card-value-letter-spacing",
10341
+ "--stat-card-value-line-height",
10323
10342
  "--stat-card-value-size",
10324
10343
  "--stat-card-value-size-hero",
10325
10344
  "--surface-card",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loworbitstudio/visor",
3
- "version": "1.53.0",
3
+ "version": "1.54.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.40.0",
49
+ "@loworbitstudio/visor-theme-engine": "^0.41.0",
50
50
  "commander": "^13.1.0",
51
51
  "diff": "^8.0.4",
52
52
  "picocolors": "^1.1.1",