@loworbitstudio/visor 1.52.0 → 1.53.1
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.
- package/dist/CHANGELOG.json +1 -1
- package/dist/index.js +13 -0
- package/dist/registry.json +8 -8
- package/dist/visor-manifest.json +87 -6
- package/package.json +2 -2
package/dist/CHANGELOG.json
CHANGED
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": {
|
package/dist/registry.json
CHANGED
|
@@ -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
|
|
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
|
},
|
|
@@ -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
|
|
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
|
|
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={{
|
|
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",
|
|
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
|
},
|
|
@@ -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",
|
|
@@ -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
|
},
|
package/dist/visor-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "0.4.0",
|
|
3
|
-
"generated_at": "2026-11-
|
|
3
|
+
"generated_at": "2026-11-14T16:02:30.153Z",
|
|
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.
|
|
3
|
+
"version": "1.53.1",
|
|
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.
|
|
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",
|