@humain/ui 2.2.4 → 2.2.5
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/index11.js +4 -4
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +4 -4
- package/dist/index110.js.map +1 -1
- package/dist/index134.js +4 -4
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +2 -2
- package/dist/index135.js.map +1 -1
- package/dist/index151.js +3 -3
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +1 -1
- package/dist/index152.js.map +1 -1
- package/dist/index155.js +1 -1
- package/dist/index155.js.map +1 -1
- package/dist/index188.js +4 -4
- package/dist/index188.js.map +1 -1
- package/dist/index201.js +1 -1
- package/dist/index201.js.map +1 -1
- package/dist/index228.js +1 -1
- package/dist/index228.js.map +1 -1
- package/dist/index24.js +1 -1
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +4 -4
- package/dist/index25.js.map +1 -1
- package/dist/index39.js +2 -2
- package/dist/index39.js.map +1 -1
- package/dist/index5.js +8 -8
- package/dist/index5.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/wc/AIScrollButton.js +8 -8
- package/dist/wc/AIScrollButton.js.map +1 -1
- package/dist/wc/Badge.js +9 -9
- package/dist/wc/Badge.js.map +1 -1
- package/dist/wc/Checkbox.js +22 -22
- package/dist/wc/Checkbox.js.map +1 -1
- package/dist/wc/Pagination.js +4 -4
- package/dist/wc/Pagination.js.map +1 -1
- package/dist/wc/Switch.js +23 -23
- package/dist/wc/Switch.js.map +1 -1
- package/dist/wc/Tabs.js +110 -110
- package/dist/wc/Tabs.js.map +1 -1
- package/dist/wc/Tooltip.js +28 -28
- package/dist/wc/Tooltip.js.map +1 -1
- package/dist/wc/button.js +33 -33
- package/dist/wc/button.js.map +1 -1
- package/dist/wc/hf-alert.js +10 -10
- package/dist/wc/hf-alert.js.map +1 -1
- package/dist/wc/hf-nav-account-menu.js +8 -8
- package/dist/wc/hf-nav-account-menu.js.map +1 -1
- package/dist/wc/hf-steps.js +8 -8
- package/dist/wc/hf-steps.js.map +1 -1
- package/dist/wc/markdown-renderer.js +4 -4
- package/dist/wc/markdown-renderer.js.map +1 -1
- package/dist/wc/selection-group.js +6 -6
- package/dist/wc/selection-group.js.map +1 -1
- package/dist/wc-react/AIScrollButton.js +18 -18
- package/dist/wc-react/AIScrollButton.js.map +1 -1
- package/dist/wc-react/Badge.js +16 -16
- package/dist/wc-react/Badge.js.map +1 -1
- package/dist/wc-react/Checkbox.js +14 -14
- package/dist/wc-react/Checkbox.js.map +1 -1
- package/dist/wc-react/Pagination.js +130 -130
- package/dist/wc-react/Pagination.js.map +1 -1
- package/dist/wc-react/Switch.js +2 -2
- package/dist/wc-react/Switch.js.map +1 -1
- package/dist/wc-react/Tabs.js +38 -38
- package/dist/wc-react/Tabs.js.map +1 -1
- package/dist/wc-react/Tooltip.js +22 -22
- package/dist/wc-react/Tooltip.js.map +1 -1
- package/dist/wc-react/button.js +8 -8
- package/dist/wc-react/button.js.map +1 -1
- package/dist/wc-react/hf-alert.js +28 -28
- package/dist/wc-react/hf-alert.js.map +1 -1
- package/dist/wc-react/hf-nav-account-menu.js +7 -7
- package/dist/wc-react/hf-nav-account-menu.js.map +1 -1
- package/dist/wc-react/hf-steps.js +16 -16
- package/dist/wc-react/hf-steps.js.map +1 -1
- package/dist/wc-react/markdown-renderer.js +4 -4
- package/dist/wc-react/markdown-renderer.js.map +1 -1
- package/dist/wc-react/selection-group.js +1 -1
- package/dist/wc-react/selection-group.js.map +1 -1
- package/package.json +1 -1
- package/skills/humain-ui/SKILL.md +1 -1
- package/skills/humain-ui-wc/SKILL.md +1 -1
- package/skills/humain-ui-wc.skill +0 -0
- package/skills/humain-ui.skill +0 -0
- package/src/tokens.css +10 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","names":["__iconNode","React","_formatErrorMessage","React","ownerWindow","REASONS.none"],"sources":["../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.27.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/moon.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.27.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/sun.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/@base-ui+react@1.6.0+1c528c44af60ea5b/node_modules/@base-ui/react/switch/root/SwitchRootContext.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/@base-ui+react@1.6.0+1c528c44af60ea5b/node_modules/@base-ui/react/switch/root/SwitchRootDataAttributes.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/@base-ui+react@1.6.0+1c528c44af60ea5b/node_modules/@base-ui/react/switch/stateAttributesMapping.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/@base-ui+react@1.6.0+1c528c44af60ea5b/node_modules/@base-ui/react/switch/root/SwitchRoot.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/@base-ui+react@1.6.0+1c528c44af60ea5b/node_modules/@base-ui/react/switch/thumb/SwitchThumb.mjs","../../src/components/ThemeProvider/theme-provider.tsx","../../src/components/atoms/forms/Switch/Switch.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.27.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\",\n key: \"kfwtm\"\n }\n ]\n];\nconst Moon = createLucideIcon(\"moon\", __iconNode);\n\nexport { __iconNode, Moon as default };\n//# sourceMappingURL=moon.mjs.map\n","/**\n * @license lucide-react v1.27.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"4\", key: \"4exip2\" }],\n [\"path\", { d: \"M12 2v2\", key: \"tus03m\" }],\n [\"path\", { d: \"M12 20v2\", key: \"1lh1kg\" }],\n [\"path\", { d: \"m4.93 4.93 1.41 1.41\", key: \"149t6j\" }],\n [\"path\", { d: \"m17.66 17.66 1.41 1.41\", key: \"ptbguv\" }],\n [\"path\", { d: \"M2 12h2\", key: \"1t8f8n\" }],\n [\"path\", { d: \"M20 12h2\", key: \"1q8mjw\" }],\n [\"path\", { d: \"m6.34 17.66-1.41 1.41\", key: \"1m8zz5\" }],\n [\"path\", { d: \"m19.07 4.93-1.41 1.41\", key: \"1shlcs\" }]\n];\nconst Sun = createLucideIcon(\"sun\", __iconNode);\n\nexport { __iconNode, Sun as default };\n//# sourceMappingURL=sun.mjs.map\n","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SwitchRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SwitchRootContext.displayName = \"SwitchRootContext\";\nexport function useSwitchRootContext() {\n const context = React.useContext(SwitchRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.' : _formatErrorMessage(63));\n }\n return context;\n}","export let SwitchRootDataAttributes = /*#__PURE__*/function (SwitchRootDataAttributes) {\n /**\n * Present when the switch is checked.\n */\n SwitchRootDataAttributes[\"checked\"] = \"data-checked\";\n /**\n * Present when the switch is not checked.\n */\n SwitchRootDataAttributes[\"unchecked\"] = \"data-unchecked\";\n /**\n * Present when the switch is disabled.\n */\n SwitchRootDataAttributes[\"disabled\"] = \"data-disabled\";\n /**\n * Present when the switch is readonly.\n */\n SwitchRootDataAttributes[\"readonly\"] = \"data-readonly\";\n /**\n * Present when the switch is required.\n */\n SwitchRootDataAttributes[\"required\"] = \"data-required\";\n /**\n * Present when the switch is in a valid state (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"valid\"] = \"data-valid\";\n /**\n * Present when the switch is in an invalid state (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"invalid\"] = \"data-invalid\";\n /**\n * Present when the switch has been touched (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"touched\"] = \"data-touched\";\n /**\n * Present when the switch's value has changed (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"dirty\"] = \"data-dirty\";\n /**\n * Present when the switch is active (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"filled\"] = \"data-filled\";\n /**\n * Present when the switch is focused (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"focused\"] = \"data-focused\";\n return SwitchRootDataAttributes;\n}({});","import { fieldValidityMapping } from \"../internals/field-constants/constants.mjs\";\nimport { SwitchRootDataAttributes } from \"./root/SwitchRootDataAttributes.mjs\";\nexport const stateAttributesMapping = {\n ...fieldValidityMapping,\n checked(value) {\n if (value) {\n return {\n [SwitchRootDataAttributes.checked]: ''\n };\n }\n return {\n [SwitchRootDataAttributes.unchecked]: ''\n };\n }\n};","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { ownerWindow } from '@base-ui/utils/owner';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { SwitchRootContext } from \"./SwitchRootContext.mjs\";\nimport { stateAttributesMapping } from \"../stateAttributesMapping.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useRegisterFieldControl } from \"../../internals/field-register-control/useRegisterFieldControl.mjs\";\nimport { useFormContext } from \"../../internals/form-context/FormContext.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { useAriaLabelledBy } from \"../../internals/labelable-provider/useAriaLabelledBy.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useValueChanged } from \"../../internals/useValueChanged.mjs\";\n\n/**\n * Represents the switch itself.\n * Renders a `<span>` element and a hidden `<input>` beside.\n *\n * Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const SwitchRoot = /*#__PURE__*/React.forwardRef(function SwitchRoot(componentProps, forwardedRef) {\n const {\n checked: checkedProp,\n className,\n defaultChecked,\n 'aria-labelledby': ariaLabelledByProp,\n form,\n id: idProp,\n inputRef: externalInputRef,\n name: nameProp,\n nativeButton = false,\n onCheckedChange,\n readOnly = false,\n required = false,\n disabled: disabledProp = false,\n render,\n uncheckedValue,\n value,\n style,\n ...elementProps\n } = componentProps;\n const {\n clearErrors\n } = useFormContext();\n const {\n state: fieldState,\n setTouched,\n setDirty,\n validityData,\n setFilled,\n setFocused,\n validationMode,\n disabled: fieldDisabled,\n name: fieldName,\n validation\n } = useFieldRootContext();\n const {\n labelId\n } = useLabelableContext();\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const inputRef = React.useRef(null);\n const handleInputRef = useMergedRefs(inputRef, externalInputRef, validation.inputRef);\n const switchRef = React.useRef(null);\n const id = useBaseUiId();\n const controlId = useLabelableId({\n id: idProp,\n implicit: false,\n controlRef: switchRef\n });\n const hiddenInputId = nativeButton ? undefined : controlId;\n const [checked, setCheckedState] = useControlled({\n controlled: checkedProp,\n default: Boolean(defaultChecked),\n name: 'Switch',\n state: 'checked'\n });\n useRegisterFieldControl(switchRef, id, checked, undefined, !disabled, nameProp);\n useIsoLayoutEffect(() => {\n if (inputRef.current) {\n setFilled(inputRef.current.checked);\n }\n }, [inputRef, setFilled]);\n useValueChanged(checked, () => {\n clearErrors(name);\n setDirty(checked !== validityData.initialValue);\n setFilled(checked);\n validation.change(checked);\n });\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, hiddenInputId);\n const rootProps = {\n id: nativeButton ? controlId : id,\n role: 'switch',\n 'aria-checked': checked,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n 'aria-labelledby': ariaLabelledBy,\n onFocus() {\n if (!disabled) {\n setFocused(true);\n }\n },\n onBlur() {\n const element = inputRef.current;\n if (!element || disabled) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(element.checked);\n }\n },\n onClick(event) {\n if (readOnly || disabled) {\n return;\n }\n event.preventDefault();\n const input = inputRef.current;\n if (!input) {\n return;\n }\n input.dispatchEvent(new (ownerWindow(input).PointerEvent)('click', {\n bubbles: true,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n altKey: event.altKey,\n metaKey: event.metaKey\n }));\n }\n };\n const inputProps = mergeProps({\n checked,\n disabled,\n form,\n id: hiddenInputId,\n name,\n required,\n style: name ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n type: 'checkbox',\n 'aria-hidden': true,\n ref: handleInputRef,\n onChange(event) {\n // Workaround for https://github.com/facebook/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n if (readOnly) {\n event.preventDefault();\n return;\n }\n const nextChecked = event.currentTarget.checked;\n const eventDetails = createChangeEventDetails(REASONS.none, event.nativeEvent);\n onCheckedChange?.(nextChecked, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setCheckedState(nextChecked);\n },\n onFocus() {\n switchRef.current?.focus();\n }\n }, props => validation.getValidationProps(disabled, props),\n // React <19 sets an empty value if `undefined` is passed explicitly\n // To avoid this, we only set the value if it's defined\n value !== undefined ? {\n value\n } : EMPTY_OBJECT);\n const state = React.useMemo(() => ({\n ...fieldState,\n checked,\n disabled,\n readOnly,\n required\n }), [fieldState, checked, disabled, readOnly, required]);\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, switchRef, buttonRef],\n props: [rootProps, elementProps, getButtonProps, props => validation.getValidationProps(disabled, props)],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsxs(SwitchRootContext.Provider, {\n value: state,\n children: [element, !checked && name && uncheckedValue !== undefined && /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: uncheckedValue,\n disabled: disabled\n }), /*#__PURE__*/_jsx(\"input\", {\n ...inputProps,\n suppressHydrationWarning: true\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SwitchRoot.displayName = \"SwitchRoot\";","'use client';\n\nimport * as React from 'react';\nimport { useSwitchRootContext } from \"../root/SwitchRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { stateAttributesMapping } from \"../stateAttributesMapping.mjs\";\n\n/**\n * The movable part of the switch that indicates whether the switch is on or off.\n * Renders a `<span>`.\n *\n * Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)\n */\nexport const SwitchThumb = /*#__PURE__*/React.forwardRef(function SwitchThumb(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const state = useSwitchRootContext();\n return useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n stateAttributesMapping,\n props: elementProps\n });\n});\nif (process.env.NODE_ENV !== \"production\") SwitchThumb.displayName = \"SwitchThumb\";","'use client';\n\nimport {\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useState,\n} from 'react';\n\n/**\n * Theme type - supports light and dark modes\n */\nexport type Theme = 'light' | 'dark';\n\n/**\n * Context value provided by ThemeProvider\n */\nexport interface ThemeContextValue {\n /** Current theme */\n theme: Theme;\n /** Resolved theme (same as theme since we don't support 'system') */\n resolvedTheme: Theme;\n /** Set the theme explicitly */\n setTheme: (theme: Theme) => void;\n /** Toggle between light and dark themes */\n toggleTheme: () => void;\n}\n\n/**\n * Props for the ThemeProvider component\n */\nexport interface ThemeProviderProps {\n /** Child components */\n children: ReactNode;\n /** Default theme to use when no stored value exists (default: 'light') */\n defaultTheme?: Theme;\n /** localStorage key for persisting theme (default: 'theme') */\n storageKey?: string;\n /** Document to theme when rendering inside an iframe or embedded document */\n targetDocument?: Document;\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\nfunction getBrowserWindow(targetDocument?: Document): Window | undefined {\n return (\n targetDocument?.defaultView ??\n (typeof window === 'undefined' ? undefined : window)\n );\n}\n\nfunction getBrowserDocument(targetDocument?: Document): Document | undefined {\n return (\n targetDocument ?? (typeof document === 'undefined' ? undefined : document)\n );\n}\n\nfunction readStoredTheme(\n storageKey: string,\n targetDocument?: Document,\n): string | null {\n try {\n return (\n getBrowserWindow(targetDocument)?.localStorage.getItem(storageKey) ?? null\n );\n } catch {\n return null;\n }\n}\n\nfunction writeStoredTheme(\n storageKey: string,\n theme: Theme,\n targetDocument?: Document,\n): void {\n try {\n getBrowserWindow(targetDocument)?.localStorage.setItem(storageKey, theme);\n } catch {\n // Storage can be unavailable in private contexts or embedded runtimes.\n }\n}\n\n/**\n * Get the initial theme from localStorage or return default\n * Returns defaultTheme during SSR (no localStorage available)\n */\nfunction getInitialTheme(\n storageKey: string,\n defaultTheme: Theme,\n targetDocument?: Document,\n): Theme {\n const stored = readStoredTheme(storageKey, targetDocument);\n if (stored === 'light' || stored === 'dark') {\n return stored;\n }\n\n return defaultTheme;\n}\n\n/**\n * Update the DOM to reflect the current theme\n */\nfunction updateDOM(theme: Theme, targetDocument?: Document): void {\n const root = getBrowserDocument(targetDocument)?.documentElement;\n if (!root) {\n return;\n }\n\n root.classList.remove('light', 'dark');\n root.classList.add(theme);\n}\n\n/**\n * ThemeProvider component\n *\n * Provides theme context to the application with support for:\n * - Persistent theme storage via localStorage\n * - DOM class management for CSS-based theming\n * - Cross-tab synchronization via storage events\n *\n * @llms Theme context provider with localStorage persistence, cross-tab sync, light/dark modes\n * @example\n * ```tsx\n * <ThemeProvider defaultTheme=\"dark\" storageKey=\"my-app-theme\">\n * <App />\n * </ThemeProvider>\n * ```\n */\nexport function ThemeProvider({\n children,\n defaultTheme = 'light',\n storageKey = 'theme',\n targetDocument,\n}: ThemeProviderProps) {\n const [theme, setThemeState] = useState<Theme>(() =>\n getInitialTheme(storageKey, defaultTheme, targetDocument),\n );\n\n const setTheme = useCallback(\n (newTheme: Theme) => {\n setThemeState(newTheme);\n writeStoredTheme(storageKey, newTheme, targetDocument);\n updateDOM(newTheme, targetDocument);\n },\n [storageKey, targetDocument],\n );\n\n const toggleTheme = useCallback(() => {\n setTheme(theme === 'light' ? 'dark' : 'light');\n }, [theme, setTheme]);\n\n // Sync DOM class on mount (for SSR hydration)\n useEffect(() => {\n updateDOM(theme, targetDocument);\n }, [theme, targetDocument]);\n\n // Listen for storage events (cross-tab sync)\n useEffect(() => {\n const browserWindow = getBrowserWindow(targetDocument);\n if (!browserWindow) {\n return;\n }\n\n const handleStorage = (event: StorageEvent) => {\n if (event.key === storageKey && event.newValue) {\n const newTheme = event.newValue as Theme;\n if (newTheme === 'light' || newTheme === 'dark') {\n setThemeState(newTheme);\n updateDOM(newTheme, targetDocument);\n }\n }\n };\n\n browserWindow.addEventListener('storage', handleStorage);\n return () => browserWindow.removeEventListener('storage', handleStorage);\n }, [storageKey, targetDocument]);\n\n const value: ThemeContextValue = {\n theme,\n resolvedTheme: theme, // Same as theme since we don't support 'system'\n setTheme,\n toggleTheme,\n };\n\n return (\n <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>\n );\n}\n\n/**\n * Hook to access the theme context\n *\n * @throws Error if used outside of ThemeProvider\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { theme, setTheme, toggleTheme } = useTheme();\n *\n * return (\n * <button onClick={toggleTheme}>\n * Current theme: {theme}\n * </button>\n * );\n * }\n * ```\n */\nexport function useTheme(): ThemeContextValue {\n const context = useContext(ThemeContext);\n\n if (context === null) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n\n return context;\n}\n\n/**\n * Hook to optionally access the theme context without throwing\n *\n * Returns null if used outside of ThemeProvider, making it safe for\n * components that support both controlled and uncontrolled modes.\n *\n * @example\n * ```tsx\n * function MyComponent({ value, onValueChange }) {\n * const themeContext = useThemeOptional();\n * const isControlled = value !== undefined;\n *\n * // Use controlled value if provided, otherwise context\n * const theme = isControlled ? value : themeContext?.theme;\n * }\n * ```\n */\nexport function useThemeOptional(): ThemeContextValue | null {\n return useContext(ThemeContext);\n}\n","/** biome-ignore-all lint/a11y/useSemanticElements: Theme toggles use button-based radio controls for animated segmented UI while preserving radiogroup semantics. */\n'use client';\n\nimport { Switch as SwitchPrimitive } from '@base-ui/react/switch';\nimport { Check, Moon, Sun, X } from 'lucide-react';\nimport * as React from 'react';\nimport { useEffect, useState } from 'react';\nimport {\n type FieldProps,\n FieldTooltip,\n} from '@/components/atoms/forms/_shared';\nimport { useThemeOptional } from '@/components/ThemeProvider';\nimport {\n Field,\n FieldBottom,\n FieldDescription,\n FieldError,\n FieldLabel,\n} from '@/components/ui/form-field';\nimport { cn } from '@/lib/utils';\n\n// ============================================\n// Types\n// ============================================\n\n/** Color variants for the standard switch */\ntype ColorVariant =\n | 'primary'\n | 'secondary'\n | 'warning'\n | 'info'\n | 'success'\n | 'destructive';\n\n/** Theme variants that render theme toggle UIs */\ntype ThemeVariant =\n | 'theme-gradient'\n | 'theme-switch'\n | 'theme-pill'\n | 'theme-segmented';\n\n/** All switch variants */\nexport type SwitchVariant = ColorVariant | ThemeVariant;\n\n// ============================================\n// Switch (with controlled/uncontrolled support)\n// ============================================\n\ninterface SwitchControlProps\n extends Omit<SwitchPrimitive.Root.Props, 'onCheckedChange'> {\n // Variants\n size?: 'sm' | 'md' | 'lg';\n variant?: SwitchVariant;\n /** Visual style of the switch (solid = filled track, outline = bordered track). Only applies to color variants. */\n switchStyle?: 'solid' | 'outline';\n\n // Thumb icons (color variants only)\n withIcon?: boolean;\n thumbIconOn?: React.ReactNode;\n thumbIconOff?: React.ReactNode;\n\n // Track labels (ON/OFF inside track, color variants only)\n showOnOff?: boolean;\n onLabel?: string;\n offLabel?: string;\n\n // External label\n label?: React.ReactNode;\n description?: string;\n labelPosition?: 'left' | 'right';\n\n /** Layout orientation for label (theme variants only) */\n orientation?: 'horizontal' | 'vertical';\n\n // Core (keep existing)\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport interface SwitchProps\n extends Omit<SwitchControlProps, 'label' | 'description'>,\n Omit<FieldProps, 'label' | 'description' | 'topRight' | 'bottomRight'> {\n /** Label text or ReactNode (inline with switch, or in FieldLabel when field props are set) */\n label?: React.ReactNode;\n /** Description text (inline below label, or in FieldDescription when field props are set) */\n description?: React.ReactNode;\n}\n\n// ============================================\n// Color Switch Constants\n// ============================================\n\n// Icon size classes for thumb icons\nconst iconSizeClasses = {\n sm: 'size-2', // 8px\n md: 'size-2.5', // 10px\n lg: 'size-3', // 12px\n};\n\n// Size classes for the track\nconst sizeClasses = {\n sm: 'h-[18px] w-[32px]',\n md: 'h-[22px] w-[40px]',\n lg: 'h-[26px] w-[48px]',\n};\n\n// Size classes for the thumb\nconst thumbSizeClasses = {\n sm: 'size-[14px]',\n md: 'size-[18px]',\n lg: 'size-[22px]',\n};\n\n// Thumb translation when checked (track width - thumb size - 2px padding on each side)\nconst thumbTranslateClasses = {\n sm: 'data-checked:ltr:translate-x-[14px] data-checked:rtl:-translate-x-[14px]',\n md: 'data-checked:ltr:translate-x-[18px] data-checked:rtl:-translate-x-[18px]',\n lg: 'data-checked:ltr:translate-x-[22px] data-checked:rtl:-translate-x-[22px]',\n};\n\n// Wider track sizes when ON/OFF labels are shown (extra space for text)\nconst sizeWithLabelClasses = {\n sm: 'h-[18px] w-[40px]',\n md: 'h-[22px] w-[48px]',\n lg: 'h-[26px] w-[56px]',\n};\n\n// Thumb translation for wider tracks with labels\nconst thumbTranslateWithLabelClasses = {\n sm: 'data-checked:ltr:translate-x-[22px] data-checked:rtl:-translate-x-[22px]',\n md: 'data-checked:ltr:translate-x-[26px] data-checked:rtl:-translate-x-[26px]',\n lg: 'data-checked:ltr:translate-x-[30px] data-checked:rtl:-translate-x-[30px]',\n};\n\n// Font sizes for track labels (ON/OFF)\nconst labelFontSizes = {\n sm: 'text-[8px]',\n md: 'text-[10px]',\n lg: 'text-xs', // 12px\n};\n\n// Solid style: colored track when checked\nconst solidVariantClasses: Record<ColorVariant, string> = {\n primary: 'data-checked:bg-primary',\n secondary: 'data-checked:bg-secondary',\n warning: 'data-checked:bg-warning',\n info: 'data-checked:bg-info',\n success: 'data-checked:bg-success',\n destructive: 'data-checked:bg-destructive',\n};\n\n// Outline style: colored border when checked\nconst outlineVariantClasses: Record<ColorVariant, string> = {\n primary: 'data-checked:border-primary',\n secondary: 'data-checked:border-secondary',\n warning: 'data-checked:border-warning',\n info: 'data-checked:border-info',\n success: 'data-checked:border-success',\n destructive: 'data-checked:border-destructive',\n};\n\n// Outline style: colored thumb when checked\nconst outlineThumbVariantClasses: Record<ColorVariant, string> = {\n primary: 'group-data-checked/switch:bg-primary',\n secondary: 'group-data-checked/switch:bg-secondary',\n warning: 'group-data-checked/switch:bg-warning',\n info: 'group-data-checked/switch:bg-info',\n success: 'group-data-checked/switch:bg-success',\n destructive: 'group-data-checked/switch:bg-destructive',\n};\n\n// ============================================\n// Theme Variant Constants & Config\n// ============================================\n\nconst themeSizeConfig = {\n sm: {\n gradient: {\n width: 'w-[64px]',\n height: 'h-6',\n indicator: 'size-5',\n icon: 'size-3',\n text: 'text-xs',\n padding: 'p-0.5',\n skeletonWidth: 'w-[64px]',\n skeletonHeight: 'h-6',\n },\n switch: {\n track: 'w-[30px] h-4',\n indicator: 'size-3.5',\n icon: 'size-3.5',\n gap: 'gap-1.5',\n skeletonWidth: 'w-[50px]',\n skeletonHeight: 'h-4',\n },\n pill: {\n width: 'w-[42px]',\n height: 'h-6',\n indicator: 'size-5',\n icon: 'size-3',\n padding: 'p-0.5',\n skeletonWidth: 'w-[42px]',\n skeletonHeight: 'h-6',\n },\n segmented: {\n height: 'h-6',\n segmentHeight: 'h-4',\n icon: 'size-3',\n text: 'text-xs',\n padding: 'p-1',\n gap: 'gap-0.5',\n skeletonWidth: 'w-[100px]',\n skeletonHeight: 'h-6',\n },\n },\n md: {\n gradient: {\n width: 'w-[76px]',\n height: 'h-7',\n indicator: 'size-6',\n icon: 'size-3.5',\n text: 'text-sm',\n padding: 'p-0.5',\n skeletonWidth: 'w-[76px]',\n skeletonHeight: 'h-7',\n },\n switch: {\n track: 'w-9 h-[18px]',\n indicator: 'size-4',\n icon: 'size-4',\n gap: 'gap-2',\n skeletonWidth: 'w-[58px]',\n skeletonHeight: 'h-[18px]',\n },\n pill: {\n width: 'w-[50px]',\n height: 'h-7',\n indicator: 'size-6',\n icon: 'size-3.5',\n padding: 'p-0.5',\n skeletonWidth: 'w-[50px]',\n skeletonHeight: 'h-7',\n },\n segmented: {\n height: 'h-7',\n segmentHeight: 'h-5',\n icon: 'size-3.5',\n text: 'text-sm',\n padding: 'p-1',\n gap: 'gap-1',\n skeletonWidth: 'w-[120px]',\n skeletonHeight: 'h-7',\n },\n },\n lg: {\n gradient: {\n width: 'w-[88px]',\n height: 'h-8',\n indicator: 'size-7',\n icon: 'size-4',\n text: 'text-sm',\n padding: 'p-0.5',\n skeletonWidth: 'w-[88px]',\n skeletonHeight: 'h-8',\n },\n switch: {\n track: 'w-[42px] h-5',\n indicator: 'size-[18px]',\n icon: 'size-[18px]',\n gap: 'gap-2.5',\n skeletonWidth: 'w-[66px]',\n skeletonHeight: 'h-5',\n },\n pill: {\n width: 'w-[58px]',\n height: 'h-8',\n indicator: 'size-7',\n icon: 'size-4',\n padding: 'p-0.5',\n skeletonWidth: 'w-[58px]',\n skeletonHeight: 'h-8',\n },\n segmented: {\n height: 'h-8',\n segmentHeight: 'h-6',\n icon: 'size-4',\n text: 'text-sm',\n padding: 'p-1',\n gap: 'gap-1',\n skeletonWidth: 'w-[140px]',\n skeletonHeight: 'h-8',\n },\n },\n} as const;\n\n// Gradient directions matching Figma design\nconst GRADIENT_LIGHT =\n 'linear-gradient(247deg, var(--destructive) 10%, var(--orange-500) 50%, var(--warning) 90%)';\nconst GRADIENT_DARK =\n 'linear-gradient(264deg, var(--blue-200) 3%, var(--indigo-400) 60%, var(--blue-800) 98%)';\n\n// Shared theme style constants\nconst themeFocusRingClasses =\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2';\nconst themeTransitionClasses =\n 'duration-300 ease-smooth motion-reduce:duration-0';\n\n// ============================================\n// Theme Variant Renderers\n// ============================================\n\nfunction GradientToggle({\n isLight,\n onThemeChange,\n sizes,\n}: {\n isLight: boolean;\n onThemeChange: (theme: 'light' | 'dark') => void;\n sizes: (typeof themeSizeConfig)['md']['gradient'];\n}) {\n return (\n <div\n data-slot=\"switch\"\n className={cn(\n 'relative flex items-center rounded-full transition-all overflow-hidden',\n sizes.width,\n sizes.height,\n sizes.padding,\n themeTransitionClasses,\n )}\n style={{\n background: isLight ? GRADIENT_LIGHT : GRADIENT_DARK,\n }}\n role=\"radiogroup\"\n aria-label=\"Theme selector\"\n >\n {/* Sliding indicator */}\n <div\n className={cn(\n 'absolute flex items-center justify-center rounded-full bg-card shadow-md hover:shadow-lg active:scale-95 transition-all z-10',\n sizes.indicator,\n themeTransitionClasses,\n isLight ? 'left-0.5' : 'right-0.5',\n )}\n >\n {isLight ? (\n <Sun className={cn(sizes.icon, 'text-warning')} />\n ) : (\n <Moon className={cn(sizes.icon, 'text-info')} />\n )}\n </div>\n\n {/* Clickable areas */}\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={isLight}\n aria-label=\"Light theme\"\n onClick={() => onThemeChange('light')}\n className={cn('flex-1 h-full rounded-full z-20', themeFocusRingClasses)}\n />\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={!isLight}\n aria-label=\"Dark theme\"\n onClick={() => onThemeChange('dark')}\n className={cn('flex-1 h-full rounded-full z-20', themeFocusRingClasses)}\n />\n\n {/* Label text */}\n <span\n className={cn(\n 'absolute pointer-events-none font-medium text-white transition-opacity',\n sizes.text,\n themeTransitionClasses,\n isLight ? 'right-2 opacity-100' : 'right-2 opacity-0',\n )}\n >\n Light\n </span>\n <span\n className={cn(\n 'absolute pointer-events-none font-medium text-white transition-opacity',\n sizes.text,\n themeTransitionClasses,\n !isLight ? 'left-2 opacity-100' : 'left-2 opacity-0',\n )}\n >\n Dark\n </span>\n </div>\n );\n}\n\nfunction ThemeSwitchToggle({\n isLight,\n onThemeChange,\n sizes,\n}: {\n isLight: boolean;\n onThemeChange: (theme: 'light' | 'dark') => void;\n sizes: (typeof themeSizeConfig)['md']['switch'];\n}) {\n return (\n <div\n className={cn('flex items-center', sizes.gap)}\n role=\"radiogroup\"\n aria-label=\"Theme selector\"\n data-slot=\"switch\"\n >\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={isLight}\n aria-label={`Switch to ${isLight ? 'dark' : 'light'} theme`}\n onClick={() => onThemeChange(isLight ? 'dark' : 'light')}\n className={cn(\n 'relative rounded-full transition-[colors,box-shadow] hover:shadow-[0_0_0_3px_var(--ring)/0.1] active:scale-[0.97]',\n sizes.track,\n themeTransitionClasses,\n themeFocusRingClasses,\n isLight ? 'bg-input' : 'bg-primary',\n )}\n >\n <div\n className={cn(\n 'absolute top-1/2 -translate-y-1/2 rounded-full shadow-md group-active:shadow-sm transition-all',\n sizes.indicator,\n themeTransitionClasses,\n isLight ? 'bg-card' : 'bg-primary-foreground',\n isLight ? 'left-0.5' : 'right-0.5',\n )}\n />\n </button>\n <div className={cn(sizes.icon, 'text-[var(--muted-foreground)]')}>\n {isLight ? (\n <Moon className=\"size-full\" />\n ) : (\n <Sun className=\"size-full\" />\n )}\n </div>\n </div>\n );\n}\n\nfunction PillToggle({\n isLight,\n onThemeChange,\n sizes,\n}: {\n isLight: boolean;\n onThemeChange: (theme: 'light' | 'dark') => void;\n sizes: (typeof themeSizeConfig)['md']['pill'];\n}) {\n return (\n <div\n className={cn(\n 'relative flex items-center justify-between rounded-full bg-input',\n sizes.width,\n sizes.height,\n sizes.padding,\n )}\n role=\"radiogroup\"\n aria-label=\"Theme selector\"\n data-slot=\"switch\"\n >\n {/* Moon icon (left) */}\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={!isLight}\n aria-label=\"Dark theme\"\n tabIndex={!isLight ? -1 : 0}\n aria-hidden={!isLight ? true : undefined}\n onClick={() => onThemeChange('dark')}\n className={cn(\n 'z-10 flex items-center justify-center rounded-full transition-opacity',\n sizes.indicator,\n themeTransitionClasses,\n themeFocusRingClasses,\n isLight ? 'opacity-50' : 'opacity-0',\n )}\n >\n <Moon className={cn(sizes.icon, 'text-[var(--foreground)]')} />\n </button>\n\n {/* Sun icon (right) */}\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={isLight}\n aria-label=\"Light theme\"\n tabIndex={isLight ? -1 : 0}\n aria-hidden={isLight ? true : undefined}\n onClick={() => onThemeChange('light')}\n className={cn(\n 'z-10 flex items-center justify-center rounded-full transition-opacity',\n sizes.indicator,\n themeTransitionClasses,\n themeFocusRingClasses,\n !isLight ? 'opacity-50' : 'opacity-0',\n )}\n >\n <Sun className={cn(sizes.icon, 'text-[var(--foreground)]')} />\n </button>\n\n {/* Sliding indicator with icon */}\n <div\n className={cn(\n 'absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-full bg-card shadow-md hover:shadow-lg active:scale-95 transition-all',\n sizes.indicator,\n themeTransitionClasses,\n isLight ? 'right-0.5' : 'left-0.5',\n )}\n >\n {isLight ? (\n <Sun className={cn(sizes.icon, 'text-warning')} />\n ) : (\n <Moon className={cn(sizes.icon, 'text-info')} />\n )}\n </div>\n </div>\n );\n}\n\nfunction SegmentedToggle({\n isLight,\n onThemeChange,\n sizes,\n}: {\n isLight: boolean;\n onThemeChange: (theme: 'light' | 'dark') => void;\n sizes: (typeof themeSizeConfig)['md']['segmented'];\n}) {\n return (\n <div\n className={cn(\n 'inline-flex items-center rounded bg-input',\n sizes.height,\n sizes.padding,\n sizes.gap,\n )}\n role=\"radiogroup\"\n aria-label=\"Theme selector\"\n data-slot=\"switch\"\n >\n {/* Light segment */}\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={isLight}\n aria-label=\"Light theme\"\n onClick={() => onThemeChange('light')}\n className={cn(\n 'flex items-center justify-center gap-1 rounded px-2 whitespace-nowrap transition-all',\n sizes.segmentHeight,\n sizes.text,\n themeTransitionClasses,\n themeFocusRingClasses,\n isLight\n ? 'bg-card text-foreground shadow-sm'\n : 'text-[var(--foreground)] opacity-50 hover:opacity-70 active:scale-[0.97]',\n )}\n >\n <Sun className={sizes.icon} />\n <span>Light</span>\n </button>\n\n {/* Dark segment */}\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={!isLight}\n aria-label=\"Dark theme\"\n onClick={() => onThemeChange('dark')}\n className={cn(\n 'flex items-center justify-center gap-1 rounded px-2 whitespace-nowrap transition-all',\n sizes.segmentHeight,\n sizes.text,\n themeTransitionClasses,\n themeFocusRingClasses,\n !isLight\n ? 'bg-[var(--primary)] text-[var(--primary-foreground)] shadow-sm'\n : 'text-[var(--foreground)] opacity-50 hover:opacity-70 active:scale-[0.97]',\n )}\n >\n <Moon className={sizes.icon} />\n <span>Dark</span>\n </button>\n </div>\n );\n}\n\n// ============================================\n// Theme Variant Renderer (auto-connects to ThemeProvider)\n// ============================================\n\nconst themeVariantKeyMap: Record<\n ThemeVariant,\n 'gradient' | 'switch' | 'pill' | 'segmented'\n> = {\n 'theme-gradient': 'gradient',\n 'theme-switch': 'switch',\n 'theme-pill': 'pill',\n 'theme-segmented': 'segmented',\n};\n\nconst ThemeVariantRenderer = React.forwardRef<\n HTMLDivElement,\n SwitchControlProps\n>(\n (\n {\n variant,\n size = 'md',\n label,\n orientation = 'vertical',\n checked: controlledChecked,\n onCheckedChange,\n className: classNameProp,\n description: _description,\n labelPosition: _labelPosition,\n switchStyle: _switchStyle,\n withIcon: _withIcon,\n thumbIconOn: _thumbIconOn,\n thumbIconOff: _thumbIconOff,\n showOnOff: _showOnOff,\n onLabel: _onLabel,\n offLabel: _offLabel,\n defaultChecked: _defaultChecked,\n ...restProps\n },\n ref,\n ) => {\n // className from base-ui can be string | function; theme variants only use string\n const className =\n typeof classNameProp === 'function' ? undefined : classNameProp;\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n const themeContext = useThemeOptional();\n const contextTheme = themeContext?.theme;\n const contextSetTheme = themeContext?.setTheme;\n\n // Auto-connect to ThemeProvider when no explicit checked/onCheckedChange\n const isControlled = controlledChecked !== undefined;\n const activeTheme: 'light' | 'dark' = isControlled\n ? controlledChecked\n ? 'dark'\n : 'light'\n : ((contextTheme ?? 'light') as 'light' | 'dark');\n\n const handleThemeChange = React.useCallback(\n (newTheme: 'light' | 'dark') => {\n const newChecked = newTheme === 'dark';\n if (isControlled) {\n onCheckedChange?.(newChecked);\n } else if (contextSetTheme) {\n contextSetTheme(newTheme);\n }\n },\n [isControlled, onCheckedChange, contextSetTheme],\n );\n\n const key = themeVariantKeyMap[variant as ThemeVariant];\n\n const sizes = themeSizeConfig[size][key];\n\n // SSR placeholder - show skeleton during hydration\n if (!mounted && !isControlled) {\n return (\n <div className={cn('inline-flex', className)}>\n <div\n className={cn(\n 'rounded-full bg-[var(--surface-1)] animate-pulse',\n sizes.skeletonWidth,\n sizes.skeletonHeight,\n )}\n role=\"radiogroup\"\n aria-label={typeof label === 'string' ? label : 'Theme selector'}\n />\n </div>\n );\n }\n\n const isLight = activeTheme === 'light';\n\n let toggle: React.ReactNode;\n switch (key) {\n case 'gradient':\n toggle = (\n <GradientToggle\n isLight={isLight}\n onThemeChange={handleThemeChange}\n sizes={sizes as (typeof themeSizeConfig)['md']['gradient']}\n />\n );\n break;\n case 'switch':\n toggle = (\n <ThemeSwitchToggle\n isLight={isLight}\n onThemeChange={handleThemeChange}\n sizes={sizes as (typeof themeSizeConfig)['md']['switch']}\n />\n );\n break;\n case 'pill':\n toggle = (\n <PillToggle\n isLight={isLight}\n onThemeChange={handleThemeChange}\n sizes={sizes as (typeof themeSizeConfig)['md']['pill']}\n />\n );\n break;\n case 'segmented':\n toggle = (\n <SegmentedToggle\n isLight={isLight}\n onThemeChange={handleThemeChange}\n sizes={sizes as (typeof themeSizeConfig)['md']['segmented']}\n />\n );\n break;\n }\n\n // Pick standard HTML attributes safe for div (aria-*, data-*, id)\n const divProps = restProps as React.HTMLAttributes<HTMLDivElement>;\n\n if (!label) {\n return (\n <div ref={ref} className={className} {...divProps}>\n {toggle}\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'inline-flex',\n orientation === 'vertical'\n ? 'flex-col items-start gap-2'\n : 'flex-row items-center gap-3',\n className,\n )}\n {...divProps}\n >\n <span className=\"text-xs font-semibold text-[var(--muted-foreground)]\">\n {label}\n </span>\n {toggle}\n </div>\n );\n },\n);\n\nThemeVariantRenderer.displayName = 'ThemeVariantRenderer';\n\n// ============================================\n// Main Switch Component\n// ============================================\n\n/** Type guard: is the variant a color variant? */\nfunction isColorVariant(v: SwitchVariant): v is ColorVariant {\n return !v.startsWith('theme-');\n}\n\nconst SwitchControl = React.forwardRef<HTMLButtonElement, SwitchControlProps>(\n (\n {\n label,\n description,\n labelPosition = 'right',\n orientation,\n className,\n id,\n size = 'md',\n variant = 'primary',\n switchStyle = 'solid',\n withIcon,\n thumbIconOn,\n thumbIconOff,\n showOnOff,\n onLabel,\n offLabel,\n checked: controlledChecked,\n defaultChecked = false,\n onCheckedChange,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const switchId = id || generatedId;\n\n const [internalChecked, setInternalChecked] =\n React.useState(defaultChecked);\n const isControlled = controlledChecked !== undefined;\n const checked = isControlled ? controlledChecked : internalChecked;\n\n const handleCheckedChange = React.useCallback(\n (newChecked: boolean) => {\n if (!isControlled) {\n setInternalChecked(newChecked);\n }\n onCheckedChange?.(newChecked);\n },\n [isControlled, onCheckedChange],\n );\n\n // Dispatch to theme variant renderer if applicable\n if (!isColorVariant(variant)) {\n return (\n <ThemeVariantRenderer\n ref={ref as React.Ref<HTMLDivElement>}\n variant={variant}\n size={size}\n label={label}\n orientation={orientation}\n checked={controlledChecked}\n onCheckedChange={onCheckedChange}\n className={className}\n {...props}\n />\n );\n }\n\n // --- Color variant rendering (unchanged) ---\n const colorVariant: ColorVariant = variant;\n\n // Use wider track when labels are present to prevent text cutoff\n const hasLabels = showOnOff || !!onLabel || !!offLabel;\n const activeSizeClasses = hasLabels ? sizeWithLabelClasses : sizeClasses;\n const activeThumbTranslate = hasLabels\n ? thumbTranslateWithLabelClasses\n : thumbTranslateClasses;\n\n // Build track classes based on style\n const trackClasses =\n switchStyle === 'solid'\n ? cn(\n 'data-unchecked:bg-input dark:data-unchecked:bg-input/80 border-transparent',\n solidVariantClasses[colorVariant],\n )\n : cn(\n 'data-unchecked:bg-transparent data-checked:bg-transparent border-input',\n outlineVariantClasses[colorVariant],\n );\n\n // Build thumb classes based on style\n const thumbClasses =\n switchStyle === 'solid'\n ? 'bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground'\n : cn(\n 'bg-input dark:bg-foreground',\n outlineThumbVariantClasses[colorVariant],\n );\n\n // Thumb icon logic\n const showThumbIcon = withIcon || thumbIconOn || thumbIconOff;\n const checkedIcon = showThumbIcon\n ? thumbIconOn || <Check className={iconSizeClasses[size]} />\n : null;\n const uncheckedIcon = showThumbIcon\n ? thumbIconOff || <X className={iconSizeClasses[size]} />\n : null;\n\n const switchElement = (\n <SwitchPrimitive.Root\n ref={ref}\n id={switchId}\n data-slot=\"switch\"\n data-size={size}\n data-variant={colorVariant}\n data-style={switchStyle}\n className={cn(\n // Base styles\n 'peer group/switch relative inline-flex items-center shrink-0 rounded-full border shadow-xs',\n 'transition-[colors,box-shadow,border-color] duration-200 ease-smooth motion-reduce:transition-none outline-none',\n 'after:absolute after:-inset-x-3 after:-inset-y-[13px]',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n // Hover: subtle track glow\n 'not-data-disabled:hover:shadow-[0_0_0_3px_var(--ring)/0.08] not-data-disabled:active:scale-[0.97]',\n 'motion-reduce:active:scale-100',\n // Focus styles\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',\n // Invalid styles\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 aria-invalid:ring-[3px]',\n // Size classes (wider when labels are shown)\n activeSizeClasses[size],\n // Variant/style classes\n trackClasses,\n className,\n )}\n checked={checked}\n onCheckedChange={handleCheckedChange}\n {...props}\n >\n {hasLabels && (\n <>\n <span\n aria-hidden=\"true\"\n className={cn(\n 'absolute font-semibold transition-opacity duration-200 ease-smooth motion-reduce:transition-none',\n labelFontSizes[size],\n 'start-1.5',\n checked ? 'opacity-100' : 'opacity-0',\n switchStyle === 'solid'\n ? 'text-primary-foreground'\n : 'text-current',\n )}\n >\n {onLabel || 'ON'}\n </span>\n <span\n aria-hidden=\"true\"\n className={cn(\n 'absolute font-semibold transition-opacity duration-200 ease-smooth motion-reduce:transition-none',\n labelFontSizes[size],\n 'end-1.5',\n checked ? 'opacity-0' : 'opacity-100',\n switchStyle === 'solid'\n ? 'text-muted-foreground'\n : 'text-current',\n )}\n >\n {offLabel || 'OFF'}\n </span>\n </>\n )}\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className={cn(\n 'pointer-events-none block rounded-full ring-0',\n 'shadow-sm group-hover/switch:shadow-md group-active/switch:shadow-sm',\n 'transition-[transform,box-shadow,background-color] duration-200 motion-reduce:transition-none',\n 'ease-smooth',\n 'group-active/switch:scale-95',\n 'data-unchecked:translate-x-0',\n // Size classes\n thumbSizeClasses[size],\n // Translation classes (wider when labels are shown)\n activeThumbTranslate[size],\n // Color classes based on style\n thumbClasses,\n // Flex for centering icons\n showThumbIcon && 'flex items-center justify-center',\n )}\n >\n {showThumbIcon && (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'flex items-center justify-center transition-colors duration-200 ease-smooth motion-reduce:transition-none',\n // Icon colors based on style\n switchStyle === 'solid'\n ? 'text-muted-foreground group-data-checked/switch:text-primary'\n : 'text-background group-data-checked/switch:text-primary-foreground',\n )}\n >\n {checked ? checkedIcon : uncheckedIcon}\n </span>\n )}\n </SwitchPrimitive.Thumb>\n </SwitchPrimitive.Root>\n );\n\n if (!label) {\n return switchElement;\n }\n\n return (\n <div\n className={cn(\n 'flex items-center gap-3',\n labelPosition === 'left' && 'flex-row-reverse justify-end',\n )}\n >\n {switchElement}\n <div className=\"flex flex-col gap-0.5\">\n <label\n htmlFor={switchId}\n className=\"text-sm font-medium leading-none cursor-pointer peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n </label>\n {description && (\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n )}\n </div>\n </div>\n );\n },\n);\n\nSwitchControl.displayName = 'SwitchControl';\n\n// =============================================================================\n// Switch — public API with smart field mode (inline layout)\n// =============================================================================\n\nconst Switch = React.forwardRef<HTMLButtonElement, SwitchProps>(\n (props, ref) => {\n // Extract field-specific props (error, tooltip, required, labelIcon, fieldClassName)\n // label and description are shared — we handle them manually\n const {\n label,\n description,\n error,\n tooltip,\n required,\n labelIcon,\n fieldClassName,\n ...controlProps\n } = props;\n\n const isFieldMode = !!(error || tooltip || required || labelIcon);\n\n if (!isFieldMode) {\n // Bare mode: pass label/description to control for inline rendering\n return (\n <SwitchControl\n ref={ref}\n label={label}\n description={description as string}\n {...controlProps}\n />\n );\n }\n\n // Field mode: label goes to FieldLabel, switch renders bare\n return (\n <Field\n layout=\"inline\"\n state={error ? 'destructive' : undefined}\n disabled={controlProps.disabled}\n className={fieldClassName}\n >\n <SwitchControl ref={ref} {...controlProps} />\n {label && (\n <FieldLabel required={required} labelIcon={labelIcon}>\n {label}\n {tooltip && <FieldTooltip content={tooltip} />}\n </FieldLabel>\n )}\n {(error || description) && (\n <FieldBottom>\n {error && <FieldError>{error}</FieldError>}\n {!error && description && (\n <FieldDescription>{description}</FieldDescription>\n )}\n </FieldBottom>\n )}\n </Field>\n );\n },\n);\nSwitch.displayName = 'Switch';\n\nexport { Switch };\n"],"x_google_ignoreList":[0,1,2,3,4,5,6],"mappings":";;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,KAAa,CACjB,CACE,QACA;AAAA,EACE,GAAG;AAAA,EACH,KAAK;AACP,CACF,CACF,GACM,IAAO,GAAiB,QAAQA,EAAU,GCT1C,KAAa;AAAA,EACjB,CAAC,UAAU;AAAA,IAAE,IAAI;AAAA,IAAM,IAAI;AAAA,IAAM,GAAG;AAAA,IAAK,KAAK;AAAA,EAAS,CAAC;AAAA,EACxD,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAW,KAAK;AAAA,EAAS,CAAC;AAAA,EACxC,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAY,KAAK;AAAA,EAAS,CAAC;AAAA,EACzC,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAwB,KAAK;AAAA,EAAS,CAAC;AAAA,EACrD,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAA0B,KAAK;AAAA,EAAS,CAAC;AAAA,EACvD,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAA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I;AAAA,MAAe,CAAA;AAAA,MAC3C,KACC,gBAAA,EAAC,IAAD;AAAA,QAAsB,UAAA;AAAA,QAAqB,WAAA;AAAA,kBAA3C,CACG,GACA,KAAW,gBAAA,EAAC,IAAD,EAAc,SAAS,EAAU,CAAA,CACnC;AAAA;OAEZ,KAAS,MACT,gBAAA,EAAC,IAAD,EAAA,UAAA,CACG,KAAS,gBAAA,EAAC,IAAD,EAAA,UAAa,EAAkB,CAAA,GACxC,CAAC,KAAS,KACT,gBAAA,EAAC,IAAD,EAAA,UAAmB,EAA8B,CAAA,CAExC,EAAA,CAAA;AAAA,IAEV;AAAA,OAhCL,gBAAA,EAAC,GAAD;AAAA,IACO,KAAA;AAAA,IACE,OAAA;AAAA,IACM,aAAA;AAAA,IACb,GAAI;AAAA,EACL,CAAA;AA6BP,CACF;AACA,GAAO,cAAc"}
|
|
1
|
+
{"version":3,"file":"Switch.js","names":["__iconNode","React","_formatErrorMessage","React","ownerWindow","REASONS.none"],"sources":["../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.27.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/moon.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.27.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/sun.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/@base-ui+react@1.6.0+1c528c44af60ea5b/node_modules/@base-ui/react/switch/root/SwitchRootContext.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/@base-ui+react@1.6.0+1c528c44af60ea5b/node_modules/@base-ui/react/switch/root/SwitchRootDataAttributes.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/@base-ui+react@1.6.0+1c528c44af60ea5b/node_modules/@base-ui/react/switch/stateAttributesMapping.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/@base-ui+react@1.6.0+1c528c44af60ea5b/node_modules/@base-ui/react/switch/root/SwitchRoot.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/@base-ui+react@1.6.0+1c528c44af60ea5b/node_modules/@base-ui/react/switch/thumb/SwitchThumb.mjs","../../src/components/ThemeProvider/theme-provider.tsx","../../src/components/atoms/forms/Switch/Switch.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.27.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\",\n key: \"kfwtm\"\n }\n ]\n];\nconst Moon = createLucideIcon(\"moon\", __iconNode);\n\nexport { __iconNode, Moon as default };\n//# sourceMappingURL=moon.mjs.map\n","/**\n * @license lucide-react v1.27.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"4\", key: \"4exip2\" }],\n [\"path\", { d: \"M12 2v2\", key: \"tus03m\" }],\n [\"path\", { d: \"M12 20v2\", key: \"1lh1kg\" }],\n [\"path\", { d: \"m4.93 4.93 1.41 1.41\", key: \"149t6j\" }],\n [\"path\", { d: \"m17.66 17.66 1.41 1.41\", key: \"ptbguv\" }],\n [\"path\", { d: \"M2 12h2\", key: \"1t8f8n\" }],\n [\"path\", { d: \"M20 12h2\", key: \"1q8mjw\" }],\n [\"path\", { d: \"m6.34 17.66-1.41 1.41\", key: \"1m8zz5\" }],\n [\"path\", { d: \"m19.07 4.93-1.41 1.41\", key: \"1shlcs\" }]\n];\nconst Sun = createLucideIcon(\"sun\", __iconNode);\n\nexport { __iconNode, Sun as default };\n//# sourceMappingURL=sun.mjs.map\n","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SwitchRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SwitchRootContext.displayName = \"SwitchRootContext\";\nexport function useSwitchRootContext() {\n const context = React.useContext(SwitchRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.' : _formatErrorMessage(63));\n }\n return context;\n}","export let SwitchRootDataAttributes = /*#__PURE__*/function (SwitchRootDataAttributes) {\n /**\n * Present when the switch is checked.\n */\n SwitchRootDataAttributes[\"checked\"] = \"data-checked\";\n /**\n * Present when the switch is not checked.\n */\n SwitchRootDataAttributes[\"unchecked\"] = \"data-unchecked\";\n /**\n * Present when the switch is disabled.\n */\n SwitchRootDataAttributes[\"disabled\"] = \"data-disabled\";\n /**\n * Present when the switch is readonly.\n */\n SwitchRootDataAttributes[\"readonly\"] = \"data-readonly\";\n /**\n * Present when the switch is required.\n */\n SwitchRootDataAttributes[\"required\"] = \"data-required\";\n /**\n * Present when the switch is in a valid state (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"valid\"] = \"data-valid\";\n /**\n * Present when the switch is in an invalid state (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"invalid\"] = \"data-invalid\";\n /**\n * Present when the switch has been touched (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"touched\"] = \"data-touched\";\n /**\n * Present when the switch's value has changed (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"dirty\"] = \"data-dirty\";\n /**\n * Present when the switch is active (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"filled\"] = \"data-filled\";\n /**\n * Present when the switch is focused (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"focused\"] = \"data-focused\";\n return SwitchRootDataAttributes;\n}({});","import { fieldValidityMapping } from \"../internals/field-constants/constants.mjs\";\nimport { SwitchRootDataAttributes } from \"./root/SwitchRootDataAttributes.mjs\";\nexport const stateAttributesMapping = {\n ...fieldValidityMapping,\n checked(value) {\n if (value) {\n return {\n [SwitchRootDataAttributes.checked]: ''\n };\n }\n return {\n [SwitchRootDataAttributes.unchecked]: ''\n };\n }\n};","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { ownerWindow } from '@base-ui/utils/owner';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { SwitchRootContext } from \"./SwitchRootContext.mjs\";\nimport { stateAttributesMapping } from \"../stateAttributesMapping.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useRegisterFieldControl } from \"../../internals/field-register-control/useRegisterFieldControl.mjs\";\nimport { useFormContext } from \"../../internals/form-context/FormContext.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { useAriaLabelledBy } from \"../../internals/labelable-provider/useAriaLabelledBy.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useValueChanged } from \"../../internals/useValueChanged.mjs\";\n\n/**\n * Represents the switch itself.\n * Renders a `<span>` element and a hidden `<input>` beside.\n *\n * Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const SwitchRoot = /*#__PURE__*/React.forwardRef(function SwitchRoot(componentProps, forwardedRef) {\n const {\n checked: checkedProp,\n className,\n defaultChecked,\n 'aria-labelledby': ariaLabelledByProp,\n form,\n id: idProp,\n inputRef: externalInputRef,\n name: nameProp,\n nativeButton = false,\n onCheckedChange,\n readOnly = false,\n required = false,\n disabled: disabledProp = false,\n render,\n uncheckedValue,\n value,\n style,\n ...elementProps\n } = componentProps;\n const {\n clearErrors\n } = useFormContext();\n const {\n state: fieldState,\n setTouched,\n setDirty,\n validityData,\n setFilled,\n setFocused,\n validationMode,\n disabled: fieldDisabled,\n name: fieldName,\n validation\n } = useFieldRootContext();\n const {\n labelId\n } = useLabelableContext();\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const inputRef = React.useRef(null);\n const handleInputRef = useMergedRefs(inputRef, externalInputRef, validation.inputRef);\n const switchRef = React.useRef(null);\n const id = useBaseUiId();\n const controlId = useLabelableId({\n id: idProp,\n implicit: false,\n controlRef: switchRef\n });\n const hiddenInputId = nativeButton ? undefined : controlId;\n const [checked, setCheckedState] = useControlled({\n controlled: checkedProp,\n default: Boolean(defaultChecked),\n name: 'Switch',\n state: 'checked'\n });\n useRegisterFieldControl(switchRef, id, checked, undefined, !disabled, nameProp);\n useIsoLayoutEffect(() => {\n if (inputRef.current) {\n setFilled(inputRef.current.checked);\n }\n }, [inputRef, setFilled]);\n useValueChanged(checked, () => {\n clearErrors(name);\n setDirty(checked !== validityData.initialValue);\n setFilled(checked);\n validation.change(checked);\n });\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, hiddenInputId);\n const rootProps = {\n id: nativeButton ? controlId : id,\n role: 'switch',\n 'aria-checked': checked,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n 'aria-labelledby': ariaLabelledBy,\n onFocus() {\n if (!disabled) {\n setFocused(true);\n }\n },\n onBlur() {\n const element = inputRef.current;\n if (!element || disabled) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(element.checked);\n }\n },\n onClick(event) {\n if (readOnly || disabled) {\n return;\n }\n event.preventDefault();\n const input = inputRef.current;\n if (!input) {\n return;\n }\n input.dispatchEvent(new (ownerWindow(input).PointerEvent)('click', {\n bubbles: true,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n altKey: event.altKey,\n metaKey: event.metaKey\n }));\n }\n };\n const inputProps = mergeProps({\n checked,\n disabled,\n form,\n id: hiddenInputId,\n name,\n required,\n style: name ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n type: 'checkbox',\n 'aria-hidden': true,\n ref: handleInputRef,\n onChange(event) {\n // Workaround for https://github.com/facebook/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n if (readOnly) {\n event.preventDefault();\n return;\n }\n const nextChecked = event.currentTarget.checked;\n const eventDetails = createChangeEventDetails(REASONS.none, event.nativeEvent);\n onCheckedChange?.(nextChecked, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setCheckedState(nextChecked);\n },\n onFocus() {\n switchRef.current?.focus();\n }\n }, props => validation.getValidationProps(disabled, props),\n // React <19 sets an empty value if `undefined` is passed explicitly\n // To avoid this, we only set the value if it's defined\n value !== undefined ? {\n value\n } : EMPTY_OBJECT);\n const state = React.useMemo(() => ({\n ...fieldState,\n checked,\n disabled,\n readOnly,\n required\n }), [fieldState, checked, disabled, readOnly, required]);\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, switchRef, buttonRef],\n props: [rootProps, elementProps, getButtonProps, props => validation.getValidationProps(disabled, props)],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsxs(SwitchRootContext.Provider, {\n value: state,\n children: [element, !checked && name && uncheckedValue !== undefined && /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: uncheckedValue,\n disabled: disabled\n }), /*#__PURE__*/_jsx(\"input\", {\n ...inputProps,\n suppressHydrationWarning: true\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SwitchRoot.displayName = \"SwitchRoot\";","'use client';\n\nimport * as React from 'react';\nimport { useSwitchRootContext } from \"../root/SwitchRootContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { stateAttributesMapping } from \"../stateAttributesMapping.mjs\";\n\n/**\n * The movable part of the switch that indicates whether the switch is on or off.\n * Renders a `<span>`.\n *\n * Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)\n */\nexport const SwitchThumb = /*#__PURE__*/React.forwardRef(function SwitchThumb(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const state = useSwitchRootContext();\n return useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n stateAttributesMapping,\n props: elementProps\n });\n});\nif (process.env.NODE_ENV !== \"production\") SwitchThumb.displayName = \"SwitchThumb\";","'use client';\n\nimport {\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useState,\n} from 'react';\n\n/**\n * Theme type - supports light and dark modes\n */\nexport type Theme = 'light' | 'dark';\n\n/**\n * Context value provided by ThemeProvider\n */\nexport interface ThemeContextValue {\n /** Current theme */\n theme: Theme;\n /** Resolved theme (same as theme since we don't support 'system') */\n resolvedTheme: Theme;\n /** Set the theme explicitly */\n setTheme: (theme: Theme) => void;\n /** Toggle between light and dark themes */\n toggleTheme: () => void;\n}\n\n/**\n * Props for the ThemeProvider component\n */\nexport interface ThemeProviderProps {\n /** Child components */\n children: ReactNode;\n /** Default theme to use when no stored value exists (default: 'light') */\n defaultTheme?: Theme;\n /** localStorage key for persisting theme (default: 'theme') */\n storageKey?: string;\n /** Document to theme when rendering inside an iframe or embedded document */\n targetDocument?: Document;\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\nfunction getBrowserWindow(targetDocument?: Document): Window | undefined {\n return (\n targetDocument?.defaultView ??\n (typeof window === 'undefined' ? undefined : window)\n );\n}\n\nfunction getBrowserDocument(targetDocument?: Document): Document | undefined {\n return (\n targetDocument ?? (typeof document === 'undefined' ? undefined : document)\n );\n}\n\nfunction readStoredTheme(\n storageKey: string,\n targetDocument?: Document,\n): string | null {\n try {\n return (\n getBrowserWindow(targetDocument)?.localStorage.getItem(storageKey) ?? null\n );\n } catch {\n return null;\n }\n}\n\nfunction writeStoredTheme(\n storageKey: string,\n theme: Theme,\n targetDocument?: Document,\n): void {\n try {\n getBrowserWindow(targetDocument)?.localStorage.setItem(storageKey, theme);\n } catch {\n // Storage can be unavailable in private contexts or embedded runtimes.\n }\n}\n\n/**\n * Get the initial theme from localStorage or return default\n * Returns defaultTheme during SSR (no localStorage available)\n */\nfunction getInitialTheme(\n storageKey: string,\n defaultTheme: Theme,\n targetDocument?: Document,\n): Theme {\n const stored = readStoredTheme(storageKey, targetDocument);\n if (stored === 'light' || stored === 'dark') {\n return stored;\n }\n\n return defaultTheme;\n}\n\n/**\n * Update the DOM to reflect the current theme\n */\nfunction updateDOM(theme: Theme, targetDocument?: Document): void {\n const root = getBrowserDocument(targetDocument)?.documentElement;\n if (!root) {\n return;\n }\n\n root.classList.remove('light', 'dark');\n root.classList.add(theme);\n}\n\n/**\n * ThemeProvider component\n *\n * Provides theme context to the application with support for:\n * - Persistent theme storage via localStorage\n * - DOM class management for CSS-based theming\n * - Cross-tab synchronization via storage events\n *\n * @llms Theme context provider with localStorage persistence, cross-tab sync, light/dark modes\n * @example\n * ```tsx\n * <ThemeProvider defaultTheme=\"dark\" storageKey=\"my-app-theme\">\n * <App />\n * </ThemeProvider>\n * ```\n */\nexport function ThemeProvider({\n children,\n defaultTheme = 'light',\n storageKey = 'theme',\n targetDocument,\n}: ThemeProviderProps) {\n const [theme, setThemeState] = useState<Theme>(() =>\n getInitialTheme(storageKey, defaultTheme, targetDocument),\n );\n\n const setTheme = useCallback(\n (newTheme: Theme) => {\n setThemeState(newTheme);\n writeStoredTheme(storageKey, newTheme, targetDocument);\n updateDOM(newTheme, targetDocument);\n },\n [storageKey, targetDocument],\n );\n\n const toggleTheme = useCallback(() => {\n setTheme(theme === 'light' ? 'dark' : 'light');\n }, [theme, setTheme]);\n\n // Sync DOM class on mount (for SSR hydration)\n useEffect(() => {\n updateDOM(theme, targetDocument);\n }, [theme, targetDocument]);\n\n // Listen for storage events (cross-tab sync)\n useEffect(() => {\n const browserWindow = getBrowserWindow(targetDocument);\n if (!browserWindow) {\n return;\n }\n\n const handleStorage = (event: StorageEvent) => {\n if (event.key === storageKey && event.newValue) {\n const newTheme = event.newValue as Theme;\n if (newTheme === 'light' || newTheme === 'dark') {\n setThemeState(newTheme);\n updateDOM(newTheme, targetDocument);\n }\n }\n };\n\n browserWindow.addEventListener('storage', handleStorage);\n return () => browserWindow.removeEventListener('storage', handleStorage);\n }, [storageKey, targetDocument]);\n\n const value: ThemeContextValue = {\n theme,\n resolvedTheme: theme, // Same as theme since we don't support 'system'\n setTheme,\n toggleTheme,\n };\n\n return (\n <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>\n );\n}\n\n/**\n * Hook to access the theme context\n *\n * @throws Error if used outside of ThemeProvider\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { theme, setTheme, toggleTheme } = useTheme();\n *\n * return (\n * <button onClick={toggleTheme}>\n * Current theme: {theme}\n * </button>\n * );\n * }\n * ```\n */\nexport function useTheme(): ThemeContextValue {\n const context = useContext(ThemeContext);\n\n if (context === null) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n\n return context;\n}\n\n/**\n * Hook to optionally access the theme context without throwing\n *\n * Returns null if used outside of ThemeProvider, making it safe for\n * components that support both controlled and uncontrolled modes.\n *\n * @example\n * ```tsx\n * function MyComponent({ value, onValueChange }) {\n * const themeContext = useThemeOptional();\n * const isControlled = value !== undefined;\n *\n * // Use controlled value if provided, otherwise context\n * const theme = isControlled ? value : themeContext?.theme;\n * }\n * ```\n */\nexport function useThemeOptional(): ThemeContextValue | null {\n return useContext(ThemeContext);\n}\n","/** biome-ignore-all lint/a11y/useSemanticElements: Theme toggles use button-based radio controls for animated segmented UI while preserving radiogroup semantics. */\n'use client';\n\nimport { Switch as SwitchPrimitive } from '@base-ui/react/switch';\nimport { Check, Moon, Sun, X } from 'lucide-react';\nimport * as React from 'react';\nimport { useEffect, useState } from 'react';\nimport {\n type FieldProps,\n FieldTooltip,\n} from '@/components/atoms/forms/_shared';\nimport { useThemeOptional } from '@/components/ThemeProvider';\nimport {\n Field,\n FieldBottom,\n FieldDescription,\n FieldError,\n FieldLabel,\n} from '@/components/ui/form-field';\nimport { cn } from '@/lib/utils';\n\n// ============================================\n// Types\n// ============================================\n\n/** Color variants for the standard switch */\ntype ColorVariant =\n | 'primary'\n | 'secondary'\n | 'warning'\n | 'info'\n | 'success'\n | 'destructive';\n\n/** Theme variants that render theme toggle UIs */\ntype ThemeVariant =\n | 'theme-gradient'\n | 'theme-switch'\n | 'theme-pill'\n | 'theme-segmented';\n\n/** All switch variants */\nexport type SwitchVariant = ColorVariant | ThemeVariant;\n\n// ============================================\n// Switch (with controlled/uncontrolled support)\n// ============================================\n\ninterface SwitchControlProps\n extends Omit<SwitchPrimitive.Root.Props, 'onCheckedChange'> {\n // Variants\n size?: 'sm' | 'md' | 'lg';\n variant?: SwitchVariant;\n /** Visual style of the switch (solid = filled track, outline = bordered track). Only applies to color variants. */\n switchStyle?: 'solid' | 'outline';\n\n // Thumb icons (color variants only)\n withIcon?: boolean;\n thumbIconOn?: React.ReactNode;\n thumbIconOff?: React.ReactNode;\n\n // Track labels (ON/OFF inside track, color variants only)\n showOnOff?: boolean;\n onLabel?: string;\n offLabel?: string;\n\n // External label\n label?: React.ReactNode;\n description?: string;\n labelPosition?: 'left' | 'right';\n\n /** Layout orientation for label (theme variants only) */\n orientation?: 'horizontal' | 'vertical';\n\n // Core (keep existing)\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport interface SwitchProps\n extends Omit<SwitchControlProps, 'label' | 'description'>,\n Omit<FieldProps, 'label' | 'description' | 'topRight' | 'bottomRight'> {\n /** Label text or ReactNode (inline with switch, or in FieldLabel when field props are set) */\n label?: React.ReactNode;\n /** Description text (inline below label, or in FieldDescription when field props are set) */\n description?: React.ReactNode;\n}\n\n// ============================================\n// Color Switch Constants\n// ============================================\n\n// Icon size classes for thumb icons\nconst iconSizeClasses = {\n sm: 'size-2', // 8px\n md: 'size-2.5', // 10px\n lg: 'size-3', // 12px\n};\n\n// Size classes for the track\nconst sizeClasses = {\n sm: 'h-[18px] w-[32px]',\n md: 'h-[22px] w-[40px]',\n lg: 'h-[26px] w-[48px]',\n};\n\n// Size classes for the thumb\nconst thumbSizeClasses = {\n sm: 'size-[14px]',\n md: 'size-[18px]',\n lg: 'size-[22px]',\n};\n\n// Thumb translation when checked (track width - thumb size - 2px padding on each side)\nconst thumbTranslateClasses = {\n sm: 'data-checked:ltr:translate-x-[14px] data-checked:rtl:-translate-x-[14px]',\n md: 'data-checked:ltr:translate-x-[18px] data-checked:rtl:-translate-x-[18px]',\n lg: 'data-checked:ltr:translate-x-[22px] data-checked:rtl:-translate-x-[22px]',\n};\n\n// Wider track sizes when ON/OFF labels are shown (extra space for text)\nconst sizeWithLabelClasses = {\n sm: 'h-[18px] w-[40px]',\n md: 'h-[22px] w-[48px]',\n lg: 'h-[26px] w-[56px]',\n};\n\n// Thumb translation for wider tracks with labels\nconst thumbTranslateWithLabelClasses = {\n sm: 'data-checked:ltr:translate-x-[22px] data-checked:rtl:-translate-x-[22px]',\n md: 'data-checked:ltr:translate-x-[26px] data-checked:rtl:-translate-x-[26px]',\n lg: 'data-checked:ltr:translate-x-[30px] data-checked:rtl:-translate-x-[30px]',\n};\n\n// Font sizes for track labels (ON/OFF)\nconst labelFontSizes = {\n sm: 'text-[8px]',\n md: 'text-[10px]',\n lg: 'text-xs', // 12px\n};\n\n// Solid style: colored track when checked\nconst solidVariantClasses: Record<ColorVariant, string> = {\n primary: 'data-checked:bg-primary',\n secondary: 'data-checked:bg-secondary',\n warning: 'data-checked:bg-warning',\n info: 'data-checked:bg-info',\n success: 'data-checked:bg-success',\n destructive: 'data-checked:bg-destructive',\n};\n\n// Outline style: colored border when checked\nconst outlineVariantClasses: Record<ColorVariant, string> = {\n primary: 'data-checked:border-primary',\n secondary: 'data-checked:border-secondary',\n warning: 'data-checked:border-warning',\n info: 'data-checked:border-info',\n success: 'data-checked:border-success',\n destructive: 'data-checked:border-destructive',\n};\n\n// Outline style: colored thumb when checked\nconst outlineThumbVariantClasses: Record<ColorVariant, string> = {\n primary: 'group-data-checked/switch:bg-primary',\n secondary: 'group-data-checked/switch:bg-secondary',\n warning: 'group-data-checked/switch:bg-warning',\n info: 'group-data-checked/switch:bg-info',\n success: 'group-data-checked/switch:bg-success',\n destructive: 'group-data-checked/switch:bg-destructive',\n};\n\n// ============================================\n// Theme Variant Constants & Config\n// ============================================\n\nconst themeSizeConfig = {\n sm: {\n gradient: {\n width: 'w-[64px]',\n height: 'h-6',\n indicator: 'size-5',\n icon: 'size-3',\n text: 'text-xs',\n padding: 'p-0.5',\n skeletonWidth: 'w-[64px]',\n skeletonHeight: 'h-6',\n },\n switch: {\n track: 'w-[30px] h-4',\n indicator: 'size-3.5',\n icon: 'size-3.5',\n gap: 'gap-1.5',\n skeletonWidth: 'w-[50px]',\n skeletonHeight: 'h-4',\n },\n pill: {\n width: 'w-[42px]',\n height: 'h-6',\n indicator: 'size-5',\n icon: 'size-3',\n padding: 'p-0.5',\n skeletonWidth: 'w-[42px]',\n skeletonHeight: 'h-6',\n },\n segmented: {\n height: 'h-6',\n segmentHeight: 'h-4',\n icon: 'size-3',\n text: 'text-xs',\n padding: 'p-1',\n gap: 'gap-0.5',\n skeletonWidth: 'w-[100px]',\n skeletonHeight: 'h-6',\n },\n },\n md: {\n gradient: {\n width: 'w-[76px]',\n height: 'h-7',\n indicator: 'size-6',\n icon: 'size-3.5',\n text: 'text-sm',\n padding: 'p-0.5',\n skeletonWidth: 'w-[76px]',\n skeletonHeight: 'h-7',\n },\n switch: {\n track: 'w-9 h-[18px]',\n indicator: 'size-4',\n icon: 'size-4',\n gap: 'gap-2',\n skeletonWidth: 'w-[58px]',\n skeletonHeight: 'h-[18px]',\n },\n pill: {\n width: 'w-[50px]',\n height: 'h-7',\n indicator: 'size-6',\n icon: 'size-3.5',\n padding: 'p-0.5',\n skeletonWidth: 'w-[50px]',\n skeletonHeight: 'h-7',\n },\n segmented: {\n height: 'h-7',\n segmentHeight: 'h-5',\n icon: 'size-3.5',\n text: 'text-sm',\n padding: 'p-1',\n gap: 'gap-1',\n skeletonWidth: 'w-[120px]',\n skeletonHeight: 'h-7',\n },\n },\n lg: {\n gradient: {\n width: 'w-[88px]',\n height: 'h-8',\n indicator: 'size-7',\n icon: 'size-4',\n text: 'text-sm',\n padding: 'p-0.5',\n skeletonWidth: 'w-[88px]',\n skeletonHeight: 'h-8',\n },\n switch: {\n track: 'w-[42px] h-5',\n indicator: 'size-[18px]',\n icon: 'size-[18px]',\n gap: 'gap-2.5',\n skeletonWidth: 'w-[66px]',\n skeletonHeight: 'h-5',\n },\n pill: {\n width: 'w-[58px]',\n height: 'h-8',\n indicator: 'size-7',\n icon: 'size-4',\n padding: 'p-0.5',\n skeletonWidth: 'w-[58px]',\n skeletonHeight: 'h-8',\n },\n segmented: {\n height: 'h-8',\n segmentHeight: 'h-6',\n icon: 'size-4',\n text: 'text-sm',\n padding: 'p-1',\n gap: 'gap-1',\n skeletonWidth: 'w-[140px]',\n skeletonHeight: 'h-8',\n },\n },\n} as const;\n\n// Gradient directions matching Figma design\nconst GRADIENT_LIGHT =\n 'linear-gradient(247deg, var(--destructive) 10%, var(--orange-500) 50%, var(--warning) 90%)';\nconst GRADIENT_DARK =\n 'linear-gradient(264deg, var(--blue-200) 3%, var(--indigo-400) 60%, var(--blue-800) 98%)';\n\n// Shared theme style constants\nconst themeFocusRingClasses =\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2';\nconst themeTransitionClasses =\n 'duration-300 ease-smooth motion-reduce:duration-0';\n\n// ============================================\n// Theme Variant Renderers\n// ============================================\n\nfunction GradientToggle({\n isLight,\n onThemeChange,\n sizes,\n}: {\n isLight: boolean;\n onThemeChange: (theme: 'light' | 'dark') => void;\n sizes: (typeof themeSizeConfig)['md']['gradient'];\n}) {\n return (\n <div\n data-slot=\"switch\"\n className={cn(\n 'relative flex items-center rounded-full transition-all overflow-hidden',\n sizes.width,\n sizes.height,\n sizes.padding,\n themeTransitionClasses,\n )}\n style={{\n background: isLight ? GRADIENT_LIGHT : GRADIENT_DARK,\n }}\n role=\"radiogroup\"\n aria-label=\"Theme selector\"\n >\n {/* Sliding indicator */}\n <div\n className={cn(\n 'absolute flex items-center justify-center rounded-full bg-card shadow-md hover:shadow-lg active:scale-95 transition-all z-10',\n sizes.indicator,\n themeTransitionClasses,\n isLight ? 'left-0.5' : 'right-0.5',\n )}\n >\n {isLight ? (\n <Sun className={cn(sizes.icon, 'text-warning')} />\n ) : (\n <Moon className={cn(sizes.icon, 'text-info')} />\n )}\n </div>\n\n {/* Clickable areas */}\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={isLight}\n aria-label=\"Light theme\"\n onClick={() => onThemeChange('light')}\n className={cn('flex-1 h-full rounded-full z-20', themeFocusRingClasses)}\n />\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={!isLight}\n aria-label=\"Dark theme\"\n onClick={() => onThemeChange('dark')}\n className={cn('flex-1 h-full rounded-full z-20', themeFocusRingClasses)}\n />\n\n {/* Label text */}\n <span\n className={cn(\n 'absolute pointer-events-none font-medium text-white transition-opacity',\n sizes.text,\n themeTransitionClasses,\n isLight ? 'right-2 opacity-100' : 'right-2 opacity-0',\n )}\n >\n Light\n </span>\n <span\n className={cn(\n 'absolute pointer-events-none font-medium text-white transition-opacity',\n sizes.text,\n themeTransitionClasses,\n !isLight ? 'left-2 opacity-100' : 'left-2 opacity-0',\n )}\n >\n Dark\n </span>\n </div>\n );\n}\n\nfunction ThemeSwitchToggle({\n isLight,\n onThemeChange,\n sizes,\n}: {\n isLight: boolean;\n onThemeChange: (theme: 'light' | 'dark') => void;\n sizes: (typeof themeSizeConfig)['md']['switch'];\n}) {\n return (\n <div\n className={cn('flex items-center', sizes.gap)}\n role=\"radiogroup\"\n aria-label=\"Theme selector\"\n data-slot=\"switch\"\n >\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={isLight}\n aria-label={`Switch to ${isLight ? 'dark' : 'light'} theme`}\n onClick={() => onThemeChange(isLight ? 'dark' : 'light')}\n className={cn(\n 'relative rounded-full transition-[colors,box-shadow] hover:shadow-[0_0_0_3px_var(--ring)/0.1] active:scale-[0.97]',\n sizes.track,\n themeTransitionClasses,\n themeFocusRingClasses,\n isLight ? 'bg-input' : 'bg-primary',\n )}\n >\n <div\n className={cn(\n 'absolute top-1/2 -translate-y-1/2 rounded-full shadow-md group-active:shadow-sm transition-all',\n sizes.indicator,\n themeTransitionClasses,\n isLight ? 'bg-card' : 'bg-background',\n isLight ? 'left-0.5' : 'right-0.5',\n )}\n />\n </button>\n <div className={cn(sizes.icon, 'text-[var(--muted-foreground)]')}>\n {isLight ? (\n <Moon className=\"size-full\" />\n ) : (\n <Sun className=\"size-full\" />\n )}\n </div>\n </div>\n );\n}\n\nfunction PillToggle({\n isLight,\n onThemeChange,\n sizes,\n}: {\n isLight: boolean;\n onThemeChange: (theme: 'light' | 'dark') => void;\n sizes: (typeof themeSizeConfig)['md']['pill'];\n}) {\n return (\n <div\n className={cn(\n 'relative flex items-center justify-between rounded-full bg-input',\n sizes.width,\n sizes.height,\n sizes.padding,\n )}\n role=\"radiogroup\"\n aria-label=\"Theme selector\"\n data-slot=\"switch\"\n >\n {/* Moon icon (left) */}\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={!isLight}\n aria-label=\"Dark theme\"\n tabIndex={!isLight ? -1 : 0}\n aria-hidden={!isLight ? true : undefined}\n onClick={() => onThemeChange('dark')}\n className={cn(\n 'z-10 flex items-center justify-center rounded-full transition-opacity',\n sizes.indicator,\n themeTransitionClasses,\n themeFocusRingClasses,\n isLight ? 'opacity-50' : 'opacity-0',\n )}\n >\n <Moon className={cn(sizes.icon, 'text-[var(--foreground)]')} />\n </button>\n\n {/* Sun icon (right) */}\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={isLight}\n aria-label=\"Light theme\"\n tabIndex={isLight ? -1 : 0}\n aria-hidden={isLight ? true : undefined}\n onClick={() => onThemeChange('light')}\n className={cn(\n 'z-10 flex items-center justify-center rounded-full transition-opacity',\n sizes.indicator,\n themeTransitionClasses,\n themeFocusRingClasses,\n !isLight ? 'opacity-50' : 'opacity-0',\n )}\n >\n <Sun className={cn(sizes.icon, 'text-[var(--foreground)]')} />\n </button>\n\n {/* Sliding indicator with icon */}\n <div\n className={cn(\n 'absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-full bg-card shadow-md hover:shadow-lg active:scale-95 transition-all',\n sizes.indicator,\n themeTransitionClasses,\n isLight ? 'right-0.5' : 'left-0.5',\n )}\n >\n {isLight ? (\n <Sun className={cn(sizes.icon, 'text-warning')} />\n ) : (\n <Moon className={cn(sizes.icon, 'text-info')} />\n )}\n </div>\n </div>\n );\n}\n\nfunction SegmentedToggle({\n isLight,\n onThemeChange,\n sizes,\n}: {\n isLight: boolean;\n onThemeChange: (theme: 'light' | 'dark') => void;\n sizes: (typeof themeSizeConfig)['md']['segmented'];\n}) {\n return (\n <div\n className={cn(\n 'inline-flex items-center rounded bg-input',\n sizes.height,\n sizes.padding,\n sizes.gap,\n )}\n role=\"radiogroup\"\n aria-label=\"Theme selector\"\n data-slot=\"switch\"\n >\n {/* Light segment */}\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={isLight}\n aria-label=\"Light theme\"\n onClick={() => onThemeChange('light')}\n className={cn(\n 'flex items-center justify-center gap-1 rounded px-2 whitespace-nowrap transition-all',\n sizes.segmentHeight,\n sizes.text,\n themeTransitionClasses,\n themeFocusRingClasses,\n isLight\n ? 'bg-card text-foreground shadow-sm'\n : 'text-[var(--foreground)] opacity-50 hover:opacity-70 active:scale-[0.97]',\n )}\n >\n <Sun className={sizes.icon} />\n <span>Light</span>\n </button>\n\n {/* Dark segment */}\n <button\n type=\"button\"\n role=\"radio\"\n aria-checked={!isLight}\n aria-label=\"Dark theme\"\n onClick={() => onThemeChange('dark')}\n className={cn(\n 'flex items-center justify-center gap-1 rounded px-2 whitespace-nowrap transition-all',\n sizes.segmentHeight,\n sizes.text,\n themeTransitionClasses,\n themeFocusRingClasses,\n !isLight\n ? 'bg-[var(--primary)] text-[var(--primary-foreground)] shadow-sm'\n : 'text-[var(--foreground)] opacity-50 hover:opacity-70 active:scale-[0.97]',\n )}\n >\n <Moon className={sizes.icon} />\n <span>Dark</span>\n </button>\n </div>\n );\n}\n\n// ============================================\n// Theme Variant Renderer (auto-connects to ThemeProvider)\n// ============================================\n\nconst themeVariantKeyMap: Record<\n ThemeVariant,\n 'gradient' | 'switch' | 'pill' | 'segmented'\n> = {\n 'theme-gradient': 'gradient',\n 'theme-switch': 'switch',\n 'theme-pill': 'pill',\n 'theme-segmented': 'segmented',\n};\n\nconst ThemeVariantRenderer = React.forwardRef<\n HTMLDivElement,\n SwitchControlProps\n>(\n (\n {\n variant,\n size = 'md',\n label,\n orientation = 'vertical',\n checked: controlledChecked,\n onCheckedChange,\n className: classNameProp,\n description: _description,\n labelPosition: _labelPosition,\n switchStyle: _switchStyle,\n withIcon: _withIcon,\n thumbIconOn: _thumbIconOn,\n thumbIconOff: _thumbIconOff,\n showOnOff: _showOnOff,\n onLabel: _onLabel,\n offLabel: _offLabel,\n defaultChecked: _defaultChecked,\n ...restProps\n },\n ref,\n ) => {\n // className from base-ui can be string | function; theme variants only use string\n const className =\n typeof classNameProp === 'function' ? undefined : classNameProp;\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n const themeContext = useThemeOptional();\n const contextTheme = themeContext?.theme;\n const contextSetTheme = themeContext?.setTheme;\n\n // Auto-connect to ThemeProvider when no explicit checked/onCheckedChange\n const isControlled = controlledChecked !== undefined;\n const activeTheme: 'light' | 'dark' = isControlled\n ? controlledChecked\n ? 'dark'\n : 'light'\n : ((contextTheme ?? 'light') as 'light' | 'dark');\n\n const handleThemeChange = React.useCallback(\n (newTheme: 'light' | 'dark') => {\n const newChecked = newTheme === 'dark';\n if (isControlled) {\n onCheckedChange?.(newChecked);\n } else if (contextSetTheme) {\n contextSetTheme(newTheme);\n }\n },\n [isControlled, onCheckedChange, contextSetTheme],\n );\n\n const key = themeVariantKeyMap[variant as ThemeVariant];\n\n const sizes = themeSizeConfig[size][key];\n\n // SSR placeholder - show skeleton during hydration\n if (!mounted && !isControlled) {\n return (\n <div className={cn('inline-flex', className)}>\n <div\n className={cn(\n 'rounded-full bg-[var(--surface-1)] animate-pulse',\n sizes.skeletonWidth,\n sizes.skeletonHeight,\n )}\n role=\"radiogroup\"\n aria-label={typeof label === 'string' ? label : 'Theme selector'}\n />\n </div>\n );\n }\n\n const isLight = activeTheme === 'light';\n\n let toggle: React.ReactNode;\n switch (key) {\n case 'gradient':\n toggle = (\n <GradientToggle\n isLight={isLight}\n onThemeChange={handleThemeChange}\n sizes={sizes as (typeof themeSizeConfig)['md']['gradient']}\n />\n );\n break;\n case 'switch':\n toggle = (\n <ThemeSwitchToggle\n isLight={isLight}\n onThemeChange={handleThemeChange}\n sizes={sizes as (typeof themeSizeConfig)['md']['switch']}\n />\n );\n break;\n case 'pill':\n toggle = (\n <PillToggle\n isLight={isLight}\n onThemeChange={handleThemeChange}\n sizes={sizes as (typeof themeSizeConfig)['md']['pill']}\n />\n );\n break;\n case 'segmented':\n toggle = (\n <SegmentedToggle\n isLight={isLight}\n onThemeChange={handleThemeChange}\n sizes={sizes as (typeof themeSizeConfig)['md']['segmented']}\n />\n );\n break;\n }\n\n // Pick standard HTML attributes safe for div (aria-*, data-*, id)\n const divProps = restProps as React.HTMLAttributes<HTMLDivElement>;\n\n if (!label) {\n return (\n <div ref={ref} className={className} {...divProps}>\n {toggle}\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'inline-flex',\n orientation === 'vertical'\n ? 'flex-col items-start gap-2'\n : 'flex-row items-center gap-3',\n className,\n )}\n {...divProps}\n >\n <span className=\"text-xs font-semibold text-[var(--muted-foreground)]\">\n {label}\n </span>\n {toggle}\n </div>\n );\n },\n);\n\nThemeVariantRenderer.displayName = 'ThemeVariantRenderer';\n\n// ============================================\n// Main Switch Component\n// ============================================\n\n/** Type guard: is the variant a color variant? */\nfunction isColorVariant(v: SwitchVariant): v is ColorVariant {\n return !v.startsWith('theme-');\n}\n\nconst SwitchControl = React.forwardRef<HTMLButtonElement, SwitchControlProps>(\n (\n {\n label,\n description,\n labelPosition = 'right',\n orientation,\n className,\n id,\n size = 'md',\n variant = 'primary',\n switchStyle = 'solid',\n withIcon,\n thumbIconOn,\n thumbIconOff,\n showOnOff,\n onLabel,\n offLabel,\n checked: controlledChecked,\n defaultChecked = false,\n onCheckedChange,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const switchId = id || generatedId;\n\n const [internalChecked, setInternalChecked] =\n React.useState(defaultChecked);\n const isControlled = controlledChecked !== undefined;\n const checked = isControlled ? controlledChecked : internalChecked;\n\n const handleCheckedChange = React.useCallback(\n (newChecked: boolean) => {\n if (!isControlled) {\n setInternalChecked(newChecked);\n }\n onCheckedChange?.(newChecked);\n },\n [isControlled, onCheckedChange],\n );\n\n // Dispatch to theme variant renderer if applicable\n if (!isColorVariant(variant)) {\n return (\n <ThemeVariantRenderer\n ref={ref as React.Ref<HTMLDivElement>}\n variant={variant}\n size={size}\n label={label}\n orientation={orientation}\n checked={controlledChecked}\n onCheckedChange={onCheckedChange}\n className={className}\n {...props}\n />\n );\n }\n\n // --- Color variant rendering (unchanged) ---\n const colorVariant: ColorVariant = variant;\n\n // Use wider track when labels are present to prevent text cutoff\n const hasLabels = showOnOff || !!onLabel || !!offLabel;\n const activeSizeClasses = hasLabels ? sizeWithLabelClasses : sizeClasses;\n const activeThumbTranslate = hasLabels\n ? thumbTranslateWithLabelClasses\n : thumbTranslateClasses;\n\n // Build track classes based on style\n const trackClasses =\n switchStyle === 'solid'\n ? cn(\n 'data-unchecked:bg-input dark:data-unchecked:bg-input/80 border-transparent',\n solidVariantClasses[colorVariant],\n )\n : cn(\n 'data-unchecked:bg-transparent data-checked:bg-transparent border-input',\n outlineVariantClasses[colorVariant],\n );\n\n // Build thumb classes based on style\n const thumbClasses =\n switchStyle === 'solid'\n ? 'bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-background'\n : cn(\n 'bg-input dark:bg-foreground',\n outlineThumbVariantClasses[colorVariant],\n );\n\n // Thumb icon logic\n const showThumbIcon = withIcon || thumbIconOn || thumbIconOff;\n const checkedIcon = showThumbIcon\n ? thumbIconOn || <Check className={iconSizeClasses[size]} />\n : null;\n const uncheckedIcon = showThumbIcon\n ? thumbIconOff || <X className={iconSizeClasses[size]} />\n : null;\n\n const switchElement = (\n <SwitchPrimitive.Root\n ref={ref}\n id={switchId}\n data-slot=\"switch\"\n data-size={size}\n data-variant={colorVariant}\n data-style={switchStyle}\n className={cn(\n // Base styles\n 'peer group/switch relative inline-flex items-center shrink-0 rounded-full border shadow-xs',\n 'transition-[colors,box-shadow,border-color] duration-200 ease-smooth motion-reduce:transition-none outline-none',\n 'after:absolute after:-inset-x-3 after:-inset-y-[13px]',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n // Hover: subtle track glow\n 'not-data-disabled:hover:shadow-[0_0_0_3px_var(--ring)/0.08] not-data-disabled:active:scale-[0.97]',\n 'motion-reduce:active:scale-100',\n // Focus styles\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',\n // Invalid styles\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 aria-invalid:ring-[3px]',\n // Size classes (wider when labels are shown)\n activeSizeClasses[size],\n // Variant/style classes\n trackClasses,\n className,\n )}\n checked={checked}\n onCheckedChange={handleCheckedChange}\n {...props}\n >\n {hasLabels && (\n <>\n <span\n aria-hidden=\"true\"\n className={cn(\n 'absolute font-semibold transition-opacity duration-200 ease-smooth motion-reduce:transition-none',\n labelFontSizes[size],\n 'start-1.5',\n checked ? 'opacity-100' : 'opacity-0',\n switchStyle === 'solid'\n ? 'text-primary-foreground'\n : 'text-current',\n )}\n >\n {onLabel || 'ON'}\n </span>\n <span\n aria-hidden=\"true\"\n className={cn(\n 'absolute font-semibold transition-opacity duration-200 ease-smooth motion-reduce:transition-none',\n labelFontSizes[size],\n 'end-1.5',\n checked ? 'opacity-0' : 'opacity-100',\n switchStyle === 'solid'\n ? 'text-muted-foreground'\n : 'text-current',\n )}\n >\n {offLabel || 'OFF'}\n </span>\n </>\n )}\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className={cn(\n 'pointer-events-none block rounded-full ring-0',\n 'shadow-sm group-hover/switch:shadow-md group-active/switch:shadow-sm',\n 'transition-[transform,box-shadow,background-color] duration-200 motion-reduce:transition-none',\n 'ease-smooth',\n 'group-active/switch:scale-95',\n 'data-unchecked:translate-x-0',\n // Size classes\n thumbSizeClasses[size],\n // Translation classes (wider when labels are shown)\n activeThumbTranslate[size],\n // Color classes based on style\n thumbClasses,\n // Flex for centering icons\n showThumbIcon && 'flex items-center justify-center',\n )}\n >\n {showThumbIcon && (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'flex items-center justify-center transition-colors duration-200 ease-smooth motion-reduce:transition-none',\n // Icon colors based on style\n switchStyle === 'solid'\n ? 'text-muted-foreground group-data-checked/switch:text-primary'\n : 'text-background group-data-checked/switch:text-primary-foreground',\n )}\n >\n {checked ? checkedIcon : uncheckedIcon}\n </span>\n )}\n </SwitchPrimitive.Thumb>\n </SwitchPrimitive.Root>\n );\n\n if (!label) {\n return switchElement;\n }\n\n return (\n <div\n className={cn(\n 'flex items-center gap-3',\n labelPosition === 'left' && 'flex-row-reverse justify-end',\n )}\n >\n {switchElement}\n <div className=\"flex flex-col gap-0.5\">\n <label\n htmlFor={switchId}\n className=\"text-sm font-medium leading-none cursor-pointer peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n </label>\n {description && (\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n )}\n </div>\n </div>\n );\n },\n);\n\nSwitchControl.displayName = 'SwitchControl';\n\n// =============================================================================\n// Switch — public API with smart field mode (inline layout)\n// =============================================================================\n\nconst Switch = React.forwardRef<HTMLButtonElement, SwitchProps>(\n (props, ref) => {\n // Extract field-specific props (error, tooltip, required, labelIcon, fieldClassName)\n // label and description are shared — we handle them manually\n const {\n label,\n description,\n error,\n tooltip,\n required,\n labelIcon,\n fieldClassName,\n ...controlProps\n } = props;\n\n const isFieldMode = !!(error || tooltip || required || labelIcon);\n\n if (!isFieldMode) {\n // Bare mode: pass label/description to control for inline rendering\n return (\n <SwitchControl\n ref={ref}\n label={label}\n description={description as string}\n {...controlProps}\n />\n );\n }\n\n // Field mode: label goes to FieldLabel, switch renders bare\n return (\n <Field\n layout=\"inline\"\n state={error ? 'destructive' : undefined}\n disabled={controlProps.disabled}\n className={fieldClassName}\n >\n <SwitchControl ref={ref} {...controlProps} />\n {label && (\n <FieldLabel required={required} labelIcon={labelIcon}>\n {label}\n {tooltip && <FieldTooltip content={tooltip} />}\n </FieldLabel>\n )}\n {(error || description) && (\n <FieldBottom>\n {error && <FieldError>{error}</FieldError>}\n {!error && description && (\n <FieldDescription>{description}</FieldDescription>\n )}\n </FieldBottom>\n )}\n </Field>\n );\n },\n);\nSwitch.displayName = 'Switch';\n\nexport { Switch };\n"],"x_google_ignoreList":[0,1,2,3,4,5,6],"mappings":";;;;;;;;;;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} from "./_shared.js";
|
|
2
|
-
import { s as
|
|
2
|
+
import { s as At, t as Z, u as mt } from "./useRenderElement.js";
|
|
3
3
|
import { r as Y, t as F } from "./useStableCallback.js";
|
|
4
4
|
import { E as dt } from "./composite.js";
|
|
5
|
-
import { f as
|
|
5
|
+
import { f as kt, t as Bt } from "./floating-ui.utils.dom.js";
|
|
6
6
|
import { n as Wt, t as Ot } from "./shadowDom.js";
|
|
7
7
|
import { _ as ut, a as _t, t as et, u as ct, v as bt } from "./createBaseUIEventDetails.js";
|
|
8
8
|
import { t as ft } from "./owner.js";
|
|
@@ -31,7 +31,7 @@ function ea() {
|
|
|
31
31
|
function gt(t) {
|
|
32
32
|
const a = Bt(t);
|
|
33
33
|
let r = parseFloat(a.width) || 0, d = parseFloat(a.height) || 0;
|
|
34
|
-
const i =
|
|
34
|
+
const i = kt(t), u = i ? t.offsetWidth : r, o = i ? t.offsetHeight : d;
|
|
35
35
|
return (dt(r) !== u || dt(d) !== o) && (r = u, d = o), {
|
|
36
36
|
width: r,
|
|
37
37
|
height: d
|
|
@@ -46,7 +46,7 @@ function tt() {
|
|
|
46
46
|
var ia = /* @__PURE__ */ (function(t) {
|
|
47
47
|
return t.activationDirection = "data-activation-direction", t.orientation = "data-orientation", t;
|
|
48
48
|
})({}), G = { tabActivationDirection: (t) => ({ [ia.activationDirection]: t }) }, yt = /* @__PURE__ */ e.forwardRef(function(a, r) {
|
|
49
|
-
const { className: d, defaultValue: i = 0, onValueChange: u, orientation: o = "horizontal", render: f, value: N, style: P, ...T } = a, B = a.defaultValue !== void 0,
|
|
49
|
+
const { className: d, defaultValue: i = 0, onValueChange: u, orientation: o = "horizontal", render: f, value: N, style: P, ...T } = a, B = a.defaultValue !== void 0, H = e.useRef([]), [p, L] = e.useState(() => /* @__PURE__ */ new Map()), [n, y] = Ut({
|
|
50
50
|
controlled: N,
|
|
51
51
|
default: i,
|
|
52
52
|
name: "Tabs",
|
|
@@ -74,7 +74,7 @@ var ia = /* @__PURE__ */ (function(t) {
|
|
|
74
74
|
]);
|
|
75
75
|
const K = F((l, b) => {
|
|
76
76
|
b.activationDirection = vt(n, l, o, s), u?.(l, b), !b.isCanceled && y(l);
|
|
77
|
-
}),
|
|
77
|
+
}), A = F((l, b) => {
|
|
78
78
|
u?.(l, et(b, void 0, void 0, { activationDirection: "none" }));
|
|
79
79
|
}), W = F((l, b) => {
|
|
80
80
|
L((I) => {
|
|
@@ -112,7 +112,7 @@ var ia = /* @__PURE__ */ (function(t) {
|
|
|
112
112
|
$,
|
|
113
113
|
w,
|
|
114
114
|
n
|
|
115
|
-
]),
|
|
115
|
+
]), k = e.useMemo(() => {
|
|
116
116
|
for (const l of s.values()) if (l != null && l.value === n) return l;
|
|
117
117
|
}, [s, n]), J = e.useMemo(() => {
|
|
118
118
|
for (const l of s.values()) if (l != null && !l.disabled) return l.value;
|
|
@@ -123,14 +123,14 @@ var ia = /* @__PURE__ */ (function(t) {
|
|
|
123
123
|
y(j), E((at) => at.previousValue === j && at.tabActivationDirection === "none" ? at : {
|
|
124
124
|
previousValue: j,
|
|
125
125
|
tabActivationDirection: "none"
|
|
126
|
-
}),
|
|
126
|
+
}), A(j, q), Q.current = !1;
|
|
127
127
|
}
|
|
128
128
|
if (s.size === 0) {
|
|
129
129
|
lt.current && n !== null && !M.current?.isConnected && l(null, ut);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
lt.current = !0, M.current = s.keys().next().value;
|
|
133
|
-
const b =
|
|
133
|
+
const b = k?.disabled, I = k == null && n !== null;
|
|
134
134
|
if (!b && n === nt.current && (st.current = !1), st.current && b && n === nt.current) return;
|
|
135
135
|
const _ = Q.current;
|
|
136
136
|
if (b || I) {
|
|
@@ -143,17 +143,17 @@ var ia = /* @__PURE__ */ (function(t) {
|
|
|
143
143
|
_ ? q = ct : b && (q = _t), l(j, q);
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
_ &&
|
|
146
|
+
_ && k != null && (A(n, ct), Q.current = !1);
|
|
147
147
|
}, [
|
|
148
148
|
J,
|
|
149
149
|
S,
|
|
150
|
-
H,
|
|
151
150
|
A,
|
|
151
|
+
k,
|
|
152
152
|
y,
|
|
153
153
|
s,
|
|
154
154
|
n
|
|
155
155
|
]);
|
|
156
|
-
const
|
|
156
|
+
const Ht = Z("div", a, {
|
|
157
157
|
state: {
|
|
158
158
|
orientation: o,
|
|
159
159
|
tabActivationDirection: w
|
|
@@ -165,8 +165,8 @@ var ia = /* @__PURE__ */ (function(t) {
|
|
|
165
165
|
return /* @__PURE__ */ C(Tt.Provider, {
|
|
166
166
|
value: v,
|
|
167
167
|
children: /* @__PURE__ */ C(qt, {
|
|
168
|
-
elementsRef:
|
|
169
|
-
children:
|
|
168
|
+
elementsRef: H,
|
|
169
|
+
children: Ht
|
|
170
170
|
})
|
|
171
171
|
});
|
|
172
172
|
});
|
|
@@ -197,7 +197,7 @@ function wt() {
|
|
|
197
197
|
return t;
|
|
198
198
|
}
|
|
199
199
|
var zt = /* @__PURE__ */ e.forwardRef(function(a, r) {
|
|
200
|
-
const { className: d, disabled: i = !1, render: u, value: o, id: f, nativeButton: N = !0, style: P, ...T } = a, { value: B, getTabPanelIdByValue:
|
|
200
|
+
const { className: d, disabled: i = !1, render: u, value: o, id: f, nativeButton: N = !0, style: P, ...T } = a, { value: B, getTabPanelIdByValue: H, orientation: p, tabActivationDirection: L } = tt(), { activateOnFocus: n, highlightedTabIndex: y, onTabActivation: S, registerTabResizeObserverElement: s, setHighlightedTabIndex: g, tabsListElement: M } = wt(), m = ht(f), { compositeProps: R, compositeRef: E, index: h } = Yt({ metadata: e.useMemo(() => ({
|
|
201
201
|
disabled: i,
|
|
202
202
|
id: m,
|
|
203
203
|
value: o
|
|
@@ -218,8 +218,8 @@ var zt = /* @__PURE__ */ e.forwardRef(function(a, r) {
|
|
|
218
218
|
if (!(x && h > -1 && y !== h)) return;
|
|
219
219
|
const v = M;
|
|
220
220
|
if (v != null) {
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
221
|
+
const k = Ot(ft(v));
|
|
222
|
+
if (k && Wt(v, k)) return;
|
|
223
223
|
}
|
|
224
224
|
i || g(h);
|
|
225
225
|
}, [
|
|
@@ -234,20 +234,20 @@ var zt = /* @__PURE__ */ e.forwardRef(function(a, r) {
|
|
|
234
234
|
disabled: i,
|
|
235
235
|
native: N,
|
|
236
236
|
focusableWhenDisabled: !0
|
|
237
|
-
}), K =
|
|
237
|
+
}), K = H(o), A = e.useRef(!1), W = e.useRef(!1);
|
|
238
238
|
function $(v) {
|
|
239
239
|
x || i || S(o, et(bt, v.nativeEvent, void 0, { activationDirection: "none" }));
|
|
240
240
|
}
|
|
241
241
|
function O(v) {
|
|
242
|
-
x || (h > -1 && !i && g(h), !i && n && (!
|
|
242
|
+
x || (h > -1 && !i && g(h), !i && n && (!A.current || A.current && W.current) && S(o, et(bt, v.nativeEvent, void 0, { activationDirection: "none" })));
|
|
243
243
|
}
|
|
244
244
|
function V(v) {
|
|
245
245
|
if (x || i) return;
|
|
246
|
-
|
|
247
|
-
function
|
|
248
|
-
|
|
246
|
+
A.current = !0;
|
|
247
|
+
function k() {
|
|
248
|
+
A.current = !1, W.current = !1;
|
|
249
249
|
}
|
|
250
|
-
(!v.button || v.button === 0) && (W.current = !0, ft(v.currentTarget).addEventListener("pointerup",
|
|
250
|
+
(!v.button || v.button === 0) && (W.current = !0, ft(v.currentTarget).addEventListener("pointerup", k, { once: !0 }));
|
|
251
251
|
}
|
|
252
252
|
return Z("button", a, {
|
|
253
253
|
state: {
|
|
@@ -290,17 +290,17 @@ var X = /* @__PURE__ */ (function(t) {
|
|
|
290
290
|
activeTabPosition: () => null,
|
|
291
291
|
activeTabSize: () => null
|
|
292
292
|
}, Ct = /* @__PURE__ */ e.forwardRef(function(a, r) {
|
|
293
|
-
const { className: d, render: i, renderBeforeHydration: u = !1, style: o, ...f } = a, { nonce: N } = ta(), { getTabElementBySelectedValue: P, orientation: T, tabActivationDirection: B, value:
|
|
293
|
+
const { className: d, render: i, renderBeforeHydration: u = !1, style: o, ...f } = a, { nonce: N } = ta(), { getTabElementBySelectedValue: P, orientation: T, tabActivationDirection: B, value: H } = tt(), { tabsListElement: p, registerIndicatorUpdateListener: L } = wt(), n = Zt(), y = ea();
|
|
294
294
|
e.useEffect(() => L(y), [L, y]);
|
|
295
295
|
let S = 0, s = 0, g = 0, M = 0, m = 0, R = 0, E = !1;
|
|
296
|
-
if (
|
|
297
|
-
const z = P(
|
|
296
|
+
if (H != null && p != null) {
|
|
297
|
+
const z = P(H);
|
|
298
298
|
if (z != null) {
|
|
299
299
|
E = !0;
|
|
300
|
-
const { width: U, height: K } = gt(z), { width:
|
|
300
|
+
const { width: U, height: K } = gt(z), { width: A, height: W } = gt(p), $ = z.getBoundingClientRect(), O = p.getBoundingClientRect(), V = A > 0 ? O.width / A : 1, v = W > 0 ? O.height / W : 1;
|
|
301
301
|
if (Math.abs(V) > Number.EPSILON && Math.abs(v) > Number.EPSILON) {
|
|
302
|
-
const
|
|
303
|
-
S =
|
|
302
|
+
const k = $.left - O.left, J = $.top - O.top;
|
|
303
|
+
S = k / V + p.scrollLeft - p.clientLeft, g = J / v + p.scrollTop - p.clientTop;
|
|
304
304
|
} else
|
|
305
305
|
S = z.offsetLeft, g = z.offsetTop;
|
|
306
306
|
m = U, R = K, s = p.scrollWidth - S - m, M = p.scrollHeight - g - R;
|
|
@@ -340,7 +340,7 @@ var X = /* @__PURE__ */ (function(t) {
|
|
|
340
340
|
],
|
|
341
341
|
stateAttributesMapping: ra
|
|
342
342
|
});
|
|
343
|
-
return
|
|
343
|
+
return H == null ? null : /* @__PURE__ */ rt(e.Fragment, { children: [c, n && u && /* @__PURE__ */ C("script", {
|
|
344
344
|
nonce: N,
|
|
345
345
|
dangerouslySetInnerHTML: { __html: '!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();' },
|
|
346
346
|
suppressHydrationWarning: !0
|
|
@@ -351,13 +351,13 @@ var X = /* @__PURE__ */ (function(t) {
|
|
|
351
351
|
...G,
|
|
352
352
|
...Vt
|
|
353
353
|
}, Nt = /* @__PURE__ */ e.forwardRef(function(a, r) {
|
|
354
|
-
const { className: d, value: i, render: u, keepMounted: o = !1, style: f, ...N } = a, { value: P, getTabIdByPanelValue: T, orientation: B, tabActivationDirection:
|
|
354
|
+
const { className: d, value: i, render: u, keepMounted: o = !1, style: f, ...N } = a, { value: P, getTabIdByPanelValue: T, orientation: B, tabActivationDirection: H, registerMountedTabPanel: p, unregisterMountedTabPanel: L } = tt(), n = ht(), { ref: y, index: S } = Xt({ metadata: e.useMemo(() => ({
|
|
355
355
|
id: n,
|
|
356
356
|
value: i
|
|
357
357
|
}), [n, i]) }), s = i === P, { mounted: g, transitionStatus: M, setMounted: m } = $t(s), R = !g, E = T(i), h = {
|
|
358
358
|
hidden: R,
|
|
359
359
|
orientation: B,
|
|
360
|
-
tabActivationDirection:
|
|
360
|
+
tabActivationDirection: H,
|
|
361
361
|
transitionStatus: M
|
|
362
362
|
}, x = e.useRef(null), w = Z("div", a, {
|
|
363
363
|
state: h,
|
|
@@ -397,7 +397,7 @@ var X = /* @__PURE__ */ (function(t) {
|
|
|
397
397
|
L
|
|
398
398
|
]), o || g ? w : null;
|
|
399
399
|
}), Mt = /* @__PURE__ */ e.forwardRef(function(a, r) {
|
|
400
|
-
const { activateOnFocus: d = !1, className: i, loopFocus: u = !0, render: o, style: f, ...N } = a, { onValueChange: P, orientation: T, value: B, setTabMap:
|
|
400
|
+
const { activateOnFocus: d = !1, className: i, loopFocus: u = !0, render: o, style: f, ...N } = a, { onValueChange: P, orientation: T, value: B, setTabMap: H, tabActivationDirection: p } = tt(), [L, n] = e.useState(0), [y, S] = e.useState(null), s = e.useRef(/* @__PURE__ */ new Set()), g = e.useRef(/* @__PURE__ */ new Set()), M = e.useRef(null);
|
|
401
401
|
Y(() => {
|
|
402
402
|
if (typeof ResizeObserver > "u") return;
|
|
403
403
|
const c = new ResizeObserver(() => {
|
|
@@ -455,8 +455,8 @@ var X = /* @__PURE__ */ (function(t) {
|
|
|
455
455
|
loopFocus: u,
|
|
456
456
|
orientation: T,
|
|
457
457
|
onHighlightedIndexChange: n,
|
|
458
|
-
onMapChange:
|
|
459
|
-
disabledIndices:
|
|
458
|
+
onMapChange: H,
|
|
459
|
+
disabledIndices: At
|
|
460
460
|
})
|
|
461
461
|
});
|
|
462
462
|
}), St = xt("group/tabs-list inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col", {
|
|
@@ -588,11 +588,11 @@ var X = /* @__PURE__ */ (function(t) {
|
|
|
588
588
|
"group-data-[size=lg]/tabs-list:[&_svg:not([class*='size-'])]:size-5",
|
|
589
589
|
"group-data-[variant=boxed]/tabs-list:rounded-[10px] group-data-[variant=boxed]/tabs-list:flex-1 group-data-[variant=boxed]/tabs-list:h-[calc(100%-1px)]",
|
|
590
590
|
"group-data-[variant=boxed]/tabs-list:data-active:bg-secondary group-data-[variant=boxed]/tabs-list:data-active:shadow-sm group-data-[variant=boxed]/tabs-list:data-active:text-foreground",
|
|
591
|
-
"group-data-[variant=boxed]/tabs-list:hover:bg-
|
|
591
|
+
"group-data-[variant=boxed]/tabs-list:hover:bg-accent",
|
|
592
592
|
"group-data-[orientation=vertical]/tabs:group-data-[variant=boxed]/tabs-list:flex-initial group-data-[orientation=vertical]/tabs:group-data-[variant=boxed]/tabs-list:justify-center",
|
|
593
593
|
"group-data-[variant=pill]/tabs-list:rounded-full group-data-[variant=pill]/tabs-list:flex-1 group-data-[variant=pill]/tabs-list:h-[calc(100%-1px)]",
|
|
594
594
|
"group-data-[variant=pill]/tabs-list:data-active:bg-background group-data-[variant=pill]/tabs-list:data-active:shadow-sm group-data-[variant=pill]/tabs-list:data-active:text-foreground",
|
|
595
|
-
"group-data-[variant=pill]/tabs-list:hover:bg-
|
|
595
|
+
"group-data-[variant=pill]/tabs-list:hover:bg-accent",
|
|
596
596
|
"dark:group-data-[variant=pill]/tabs-list:data-active:bg-accent dark:group-data-[variant=pill]/tabs-list:data-active:text-accent-foreground dark:group-data-[variant=pill]/tabs-list:data-active:border-input",
|
|
597
597
|
"group-data-[orientation=vertical]/tabs:group-data-[variant=pill]/tabs-list:flex-initial group-data-[orientation=vertical]/tabs:group-data-[variant=pill]/tabs-list:justify-center",
|
|
598
598
|
"group-data-[variant=bordered]/tabs-list:bg-transparent group-data-[variant=bordered]/tabs-list:rounded-none",
|
|
@@ -758,7 +758,7 @@ ot.displayName = "TabsTrigger";
|
|
|
758
758
|
It.displayName = "TabsContent";
|
|
759
759
|
Pt.displayName = "TabsIndicator";
|
|
760
760
|
Dt.displayName = "TabsTriggerWithCount";
|
|
761
|
-
var
|
|
761
|
+
var Aa = Object.assign(it, {
|
|
762
762
|
Root: it,
|
|
763
763
|
List: Lt,
|
|
764
764
|
Trigger: ot,
|
|
@@ -771,7 +771,7 @@ export {
|
|
|
771
771
|
Lt as i,
|
|
772
772
|
It as n,
|
|
773
773
|
Pt as r,
|
|
774
|
-
|
|
774
|
+
Aa as t
|
|
775
775
|
};
|
|
776
776
|
|
|
777
777
|
//# sourceMappingURL=Tabs.js.map
|