@wow-two-beta/ui 0.0.3 → 0.0.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/actions/index.d.ts +240 -2
- package/dist/actions/index.js +5 -2
- package/dist/chunk-33IOXQYO.js +47 -0
- package/dist/chunk-33IOXQYO.js.map +1 -0
- package/dist/chunk-4CIRBYYP.js +120 -0
- package/dist/chunk-4CIRBYYP.js.map +1 -0
- package/dist/chunk-6NYTRHP7.js +168 -0
- package/dist/chunk-6NYTRHP7.js.map +1 -0
- package/dist/chunk-77WSI427.js +39 -0
- package/dist/chunk-77WSI427.js.map +1 -0
- package/dist/chunk-BMBIZLO4.js +34 -0
- package/dist/chunk-BMBIZLO4.js.map +1 -0
- package/dist/chunk-D67WGR7Y.js +212 -0
- package/dist/chunk-D67WGR7Y.js.map +1 -0
- package/dist/chunk-DN7WBRIV.js +17 -0
- package/dist/chunk-DN7WBRIV.js.map +1 -0
- package/dist/chunk-JCMV6IT4.js +268 -0
- package/dist/chunk-JCMV6IT4.js.map +1 -0
- package/dist/chunk-JTJEI6MF.js +11 -0
- package/dist/chunk-JTJEI6MF.js.map +1 -0
- package/dist/chunk-KSJE3JAI.js +604 -0
- package/dist/chunk-KSJE3JAI.js.map +1 -0
- package/dist/chunk-KZ4VFY2T.js +11 -0
- package/dist/chunk-KZ4VFY2T.js.map +1 -0
- package/dist/chunk-MP4OTUFA.js +318 -0
- package/dist/chunk-MP4OTUFA.js.map +1 -0
- package/dist/chunk-Q27NAHVB.js +34 -0
- package/dist/chunk-Q27NAHVB.js.map +1 -0
- package/dist/chunk-SYG6ZE42.js +218 -0
- package/dist/chunk-SYG6ZE42.js.map +1 -0
- package/dist/chunk-TDX22OWF.js +33 -0
- package/dist/chunk-TDX22OWF.js.map +1 -0
- package/dist/chunk-YLN7VMYU.js +275 -0
- package/dist/chunk-YLN7VMYU.js.map +1 -0
- package/dist/display/index.d.ts +805 -1
- package/dist/display/index.js +6 -1
- package/dist/feedback/index.d.ts +506 -1
- package/dist/feedback/index.js +5 -1
- package/dist/forms/index.d.ts +217 -1
- package/dist/forms/index.js +8 -1
- package/dist/hooks/index.d.ts +2 -5
- package/dist/hooks/index.js +4 -1
- package/dist/icons/index.d.ts +2 -5
- package/dist/icons/index.js +3 -1
- package/dist/index-Bk6CuDNT.d.ts +247 -0
- package/dist/index-C0IDphm_.d.ts +61 -0
- package/dist/index-CEAM9LLM.d.ts +37 -0
- package/dist/index-PAuwodyY.d.ts +103 -0
- package/dist/index-goThcZ1E.d.ts +416 -0
- package/dist/index.d.ts +13 -5
- package/dist/index.js +16 -9
- package/dist/layout/index.d.ts +605 -1
- package/dist/layout/index.js +5 -1
- package/dist/primitives/index.d.ts +5 -0
- package/dist/primitives/index.js +10 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/tailwind/index.js +8 -2
- package/dist/tailwind/index.js.map +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.js +3 -1
- package/package.json +8 -1
- package/dist/chunk-6YKPUEHU.js +0 -47
- package/dist/chunk-6YKPUEHU.js.map +0 -1
- package/dist/chunk-7CP7KR5F.js +0 -41
- package/dist/chunk-7CP7KR5F.js.map +0 -1
- package/dist/chunk-A2OBJDIK.js +0 -3
- package/dist/chunk-A2OBJDIK.js.map +0 -1
- package/dist/chunk-CTVGU35H.js +0 -6
- package/dist/chunk-CTVGU35H.js.map +0 -1
- package/dist/chunk-ECZ4YFAI.js +0 -16
- package/dist/chunk-ECZ4YFAI.js.map +0 -1
- package/dist/chunk-PSDQXPUE.js +0 -3
- package/dist/chunk-PSDQXPUE.js.map +0 -1
- package/dist/chunk-U4JXXIE2.js +0 -6
- package/dist/chunk-U4JXXIE2.js.map +0 -1
- package/dist/chunk-YP4MAZRQ.js +0 -3
- package/dist/chunk-YP4MAZRQ.js.map +0 -1
- package/dist/chunk-ZDU7SROW.js +0 -3
- package/dist/chunk-ZDU7SROW.js.map +0 -1
- package/dist/index-CdSRWb8y.d.ts +0 -78
- package/dist/index-D-adCzNR.d.ts +0 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/primitives/index.ts","../src/primitives/portal/Portal.tsx","../src/primitives/visuallyHidden/VisuallyHidden.tsx","../src/primitives/presence/Presence.tsx","../src/primitives/directionProvider/DirectionProvider.tsx","../src/primitives/accessibleIcon/AccessibleIcon.tsx","../src/primitives/focusScope/FocusScope.tsx","../src/primitives/dismissableLayer/DismissableLayer.tsx","../src/primitives/anchoredPositioner/AnchoredPositioner.tsx","../src/primitives/rovingFocusGroup/RovingFocusGroup.tsx","../src/primitives/collection/Collection.tsx","../src/primitives/scrollLockProvider/ScrollLockProvider.tsx"],"names":["jsx","isValidElement","cloneElement","RadixFocusScope","forwardRef","useRef","useEffect","offset","offsetMiddleware","createContext","useState","useContext","useCallback","useMemo","Fragment"],"mappings":";;;;;;;;;;;;;AAAA,IAAA,kBAAA,GAAA;AAAA,QAAA,CAAA,kBAAA,EAAA;AAAA,EAAA,cAAA,EAAA,MAAA,cAAA;AAAA,EAAA,kBAAA,EAAA,MAAA,kBAAA;AAAA,EAAA,iBAAA,EAAA,MAAA,iBAAA;AAAA,EAAA,gBAAA,EAAA,MAAA,gBAAA;AAAA,EAAA,UAAA,EAAA,MAAA,UAAA;AAAA,EAAA,mBAAA,EAAA,MAAA,mBAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,gBAAA,EAAA,MAAA,gBAAA;AAAA,EAAA,kBAAA,EAAA,MAAA,kBAAA;AAAA,EAAA,IAAA,EAAA,MAAA,IAAA;AAAA,EAAA,cAAA,EAAA,MAAA,cAAA;AAAA,EAAA,gBAAA,EAAA,MAAA,gBAAA;AAAA,EAAA,YAAA,EAAA,MAAA,YAAA;AAAA,EAAA,cAAA,EAAA,MAAA,cAAA;AAAA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AA,IACnD,CAAA,EAAG,EAAE,CAAA;AACL,IAAA,MAAM,KAAA,GAAQC,OAAAA,CAAQ,OAAO,EAAE,KAAA,EAAO,QAAA,EAAU,UAAA,EAAW,CAAA,EAAI,CAAC,KAAA,EAAO,QAAA,EAAU,UAAU,CAAC,CAAA;AAC5F,IAAA,uBAAOb,GAAAA,CAAC,iBAAA,CAAkB,QAAA,EAAlB,EAA2B,OAAe,QAAA,EAAS,CAAA;AAAA,EAC7D;AAEA,EAAA,SAAS,aAAA,GAA2C;AAClD,IAAA,MAAM,GAAA,GAAMW,WAAW,iBAAiB,CAAA;AACxC,IAAA,IAAI,CAAC,GAAA,EAAK;AACR,MAAA,MAAM,IAAI,MAAM,gDAAgD,CAAA;AAAA,IAClE;AACA,IAAA,OAAO,GAAA;AAAA,EACT;AAEA,EAAA,OAAO,EAAE,QAAA,EAAU,aAAA,EAAe,OAAA,EAAS,iBAAA,EAAkB;AAC/D;ACpCO,SAAS,kBAAA,CAAmB,EAAE,OAAA,GAAU,IAAA,EAAM,UAAS,EAA4B;AACxF,EAAA,aAAA,CAAc,OAAO,CAAA;AACrB,EAAA,uBAAOX,GAAAA,CAAAc,QAAAA,EAAA,EAAG,QAAA,EAAS,CAAA;AACrB","file":"chunk-JCMV6IT4.js","sourcesContent":["// L2 — headless primitives. Behavior + a11y, no visual styling beyond layout.\n// Foundation layer; cannot import upward (enforced by ESLint boundaries).\n\nexport * from './slot';\nexport * from './portal';\nexport * from './visuallyHidden';\nexport * from './presence';\nexport * from './directionProvider';\nexport * from './accessibleIcon';\nexport * from './focusScope';\nexport * from './dismissableLayer';\nexport * from './anchoredPositioner';\nexport * from './rovingFocusGroup';\nexport * from './collection';\nexport * from './formControlContext';\nexport * from './scrollLockProvider';\n","import { type ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\n\nexport interface PortalProps {\n children: ReactNode;\n /** Container to render into. Default: `document.body`. */\n container?: HTMLElement | null;\n /** Optional named layer — sets `data-portal-name` on the wrapper. */\n name?: string;\n}\n\n/**\n * Render children into a different DOM node (default `document.body`).\n * Client-only — package targets pure CSR consumers.\n */\nexport function Portal({ children, container, name }: PortalProps): ReactNode {\n const target = container ?? document.body;\n return createPortal(<div data-portal-name={name}>{children}</div>, target);\n}\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type VisuallyHiddenProps = HTMLAttributes<HTMLSpanElement>;\n\n/**\n * Visually hidden span — content removed from the visual layout but still\n * announced to screen readers. Use for accessible labels on icon-only\n * affordances and live-region announcements.\n */\nexport const VisuallyHidden = forwardRef<HTMLSpanElement, VisuallyHiddenProps>(\n ({ className, ...props }, ref) => (\n <span\n ref={ref}\n className={cn(\n 'absolute h-px w-px overflow-hidden whitespace-nowrap border-0 p-0',\n 'm-[-1px] [clip:rect(0_0_0_0)] [clip-path:inset(50%)]',\n className,\n )}\n {...props}\n />\n ),\n);\nVisuallyHidden.displayName = 'VisuallyHidden';\n","import {\n cloneElement,\n isValidElement,\n useEffect,\n useRef,\n useState,\n type ReactElement,\n type Ref,\n} from 'react';\nimport { composeRefs } from '../../utils/composeRefs';\n\nexport interface PresenceProps {\n /** Whether the content should be present. Toggle false to trigger exit. */\n present: boolean;\n /** Single React element child — receives `ref` and `data-state` (\"open\" | \"closed\"). */\n children: ReactElement;\n}\n\n/**\n * Defer unmount until the child's exit animation/transition finishes.\n * Pass `present={false}` to start the exit; the child stays mounted with\n * `data-state=\"closed\"` until `animationend`/`transitionend` fires.\n */\nexport function Presence({ present, children }: PresenceProps): ReactElement | null {\n const [rendered, setRendered] = useState(present);\n const ref = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (present) {\n setRendered(true);\n return;\n }\n const node = ref.current;\n if (!node) {\n setRendered(false);\n return;\n }\n const cs = getComputedStyle(node);\n const hasAnim = cs.animationName !== 'none' && cs.animationDuration !== '0s';\n const hasTrans = cs.transitionDuration !== '0s';\n if (!hasAnim && !hasTrans) {\n setRendered(false);\n return;\n }\n const onEnd = () => setRendered(false);\n node.addEventListener('animationend', onEnd);\n node.addEventListener('transitionend', onEnd);\n return () => {\n node.removeEventListener('animationend', onEnd);\n node.removeEventListener('transitionend', onEnd);\n };\n }, [present]);\n\n if (!rendered || !isValidElement(children)) return null;\n const child = children as ReactElement<{ ref?: Ref<HTMLElement> }> & { ref?: Ref<HTMLElement> };\n return cloneElement(child, {\n ref: composeRefs(ref, child.ref),\n 'data-state': present ? 'open' : 'closed',\n } as Partial<typeof child.props>);\n}\n","import { createContext, useContext, type ReactNode } from 'react';\n\nexport type Direction = 'ltr' | 'rtl';\n\nconst DirectionContext = createContext<Direction>('ltr');\n\nexport interface DirectionProviderProps {\n dir: Direction;\n children: ReactNode;\n}\n\n/**\n * Provide reading direction to descendants. Components that mirror in RTL\n * (Tabs arrow keys, Slider, Carousel, etc.) read this via `useDirection()`.\n */\nexport function DirectionProvider({ dir, children }: DirectionProviderProps) {\n return <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>;\n}\n\nexport function useDirection(): Direction {\n return useContext(DirectionContext);\n}\n","import { cloneElement, isValidElement, type ReactElement } from 'react';\nimport { VisuallyHidden } from '../visuallyHidden/VisuallyHidden';\n\nexport interface AccessibleIconProps {\n /** Required accessible label for the icon. */\n label: string;\n /** Single icon element — will receive `aria-hidden` so SR reads only the label. */\n children: ReactElement;\n}\n\n/**\n * Wrap an icon-only element with an accessible label. The icon is hidden\n * from assistive tech and a `VisuallyHidden` sibling provides the label.\n */\nexport function AccessibleIcon({ label, children }: AccessibleIconProps) {\n const icon = isValidElement(children)\n ? cloneElement(children as ReactElement<{ 'aria-hidden'?: boolean | string; focusable?: string }>, {\n 'aria-hidden': 'true',\n focusable: 'false',\n })\n : children;\n return (\n <>\n {icon}\n <VisuallyHidden>{label}</VisuallyHidden>\n </>\n );\n}\n","import { FocusScope as RadixFocusScope } from '@radix-ui/react-focus-scope';\n\nexport type FocusScopeProps = React.ComponentProps<typeof RadixFocusScope>;\n\n/**\n * Trap focus within children. On unmount, returns focus to the previously\n * focused element. Pass `loop` to wrap Tab navigation; `trapped` to enable\n * the trap (default true while mounted).\n *\n * Wraps `@radix-ui/react-focus-scope` — battle-tested implementation.\n */\nexport const FocusScope = RadixFocusScope;\n","import {\n forwardRef,\n useEffect,\n useRef,\n type HTMLAttributes,\n} from 'react';\nimport { composeRefs } from '../../utils/composeRefs';\n\ninterface LayerEntry {\n node: HTMLElement;\n onEscape?: (event: KeyboardEvent) => void;\n onOutsidePointerDown?: (event: PointerEvent) => void;\n}\n\nconst layerStack: LayerEntry[] = [];\n\nexport interface DismissableLayerProps extends HTMLAttributes<HTMLDivElement> {\n /** Called when Escape is pressed and this is the topmost layer. */\n onEscape?: (event: KeyboardEvent) => void;\n /** Called when a pointerdown lands outside this layer's DOM and this is topmost. */\n onOutsidePointerDown?: (event: PointerEvent) => void;\n /** Disable the Escape listener for this layer. */\n disableEscape?: boolean;\n /** Disable the outside-pointer-down listener for this layer. */\n disableOutsideClick?: boolean;\n}\n\n/**\n * Stack-aware dismissal layer. Multiple layers may stack (modal > popover);\n * only the topmost reacts to Escape / outside click. Used as the base of\n * Modal, Drawer, Popover, Menu, HoverCard, ContextMenu.\n */\nexport const DismissableLayer = forwardRef<HTMLDivElement, DismissableLayerProps>(\n (\n { onEscape, onOutsidePointerDown, disableEscape, disableOutsideClick, ...props },\n forwardedRef,\n ) => {\n const ref = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n const node = ref.current;\n if (!node) return;\n const entry: LayerEntry = { node, onEscape, onOutsidePointerDown };\n layerStack.push(entry);\n return () => {\n const idx = layerStack.indexOf(entry);\n if (idx >= 0) layerStack.splice(idx, 1);\n };\n }, [onEscape, onOutsidePointerDown]);\n\n useEffect(() => {\n if (disableEscape) return;\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== 'Escape') return;\n const top = layerStack[layerStack.length - 1];\n if (top && top.node === ref.current) top.onEscape?.(e);\n };\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [disableEscape]);\n\n useEffect(() => {\n if (disableOutsideClick) return;\n const onPointer = (e: PointerEvent) => {\n const top = layerStack[layerStack.length - 1];\n if (!top || top.node !== ref.current) return;\n const target = e.target as Node | null;\n if (!target || ref.current?.contains(target)) return;\n top.onOutsidePointerDown?.(e);\n };\n document.addEventListener('pointerdown', onPointer, true);\n return () => document.removeEventListener('pointerdown', onPointer, true);\n }, [disableOutsideClick]);\n\n return <div ref={composeRefs(forwardedRef, ref)} {...props} />;\n },\n);\nDismissableLayer.displayName = 'DismissableLayer';\n","import {\n autoUpdate,\n flip,\n offset as offsetMiddleware,\n shift,\n useFloating,\n type Placement,\n} from '@floating-ui/react';\nimport { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { composeRefs } from '../../utils/composeRefs';\n\nexport interface AnchoredPositionerProps extends HTMLAttributes<HTMLDivElement> {\n /** The element the floating layer should be anchored to. */\n anchor: HTMLElement | null;\n /** Floating UI placement. Default `bottom`. */\n placement?: Placement;\n /** Distance between anchor and floating element in px. Default 8. */\n offset?: number;\n /** Render the floating element only when open. */\n open?: boolean;\n children: ReactNode;\n}\n\n/**\n * Position children relative to an anchor element using Floating UI.\n * Auto-flips and shifts to stay in viewport. Use as the positioning surface\n * for Tooltip, Popover, Menu, HoverCard.\n */\nexport const AnchoredPositioner = forwardRef<HTMLDivElement, AnchoredPositionerProps>(\n (\n { anchor, placement = 'bottom', offset = 8, open = true, children, style, ...props },\n forwardedRef,\n ) => {\n const { refs, floatingStyles } = useFloating({\n open,\n placement,\n middleware: [offsetMiddleware(offset), flip(), shift({ padding: 8 })],\n whileElementsMounted: autoUpdate,\n elements: { reference: anchor },\n });\n\n if (!open) return null;\n\n return (\n <div\n ref={composeRefs(forwardedRef, refs.setFloating)}\n style={{ ...floatingStyles, ...style }}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\nAnchoredPositioner.displayName = 'AnchoredPositioner';\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\n\nexport type Orientation = 'horizontal' | 'vertical' | 'both';\n\ninterface RovingFocusContextValue {\n register: (id: string) => void;\n unregister: (id: string) => void;\n focusedId: string | null;\n setFocusedId: (id: string) => void;\n onItemKeyDown: (event: KeyboardEvent, id: string) => void;\n}\n\nconst RovingFocusContext = createContext<RovingFocusContextValue | null>(null);\n\nexport interface RovingFocusGroupProps extends HTMLAttributes<HTMLDivElement> {\n orientation?: Orientation;\n loop?: boolean;\n children: ReactNode;\n}\n\n/**\n * Provide arrow-key navigation for a group of focusable children. Children\n * call `useRovingFocusItem()` to register and receive `tabIndex` / event\n * handlers. Used by Tabs, ToggleGroup, RadioGroup, Menu.\n */\nexport function RovingFocusGroup({\n orientation = 'horizontal',\n loop = true,\n children,\n ...props\n}: RovingFocusGroupProps) {\n const items = useRef<string[]>([]);\n const [focusedId, setFocusedId] = useState<string | null>(null);\n\n const register = useCallback((id: string) => {\n if (!items.current.includes(id)) items.current.push(id);\n setFocusedId((current) => current ?? id);\n }, []);\n\n const unregister = useCallback((id: string) => {\n items.current = items.current.filter((i) => i !== id);\n }, []);\n\n const onItemKeyDown = useCallback(\n (event: KeyboardEvent, id: string) => {\n const list = items.current;\n const idx = list.indexOf(id);\n if (idx === -1) return;\n const isVert = orientation === 'vertical' || orientation === 'both';\n const isHoriz = orientation === 'horizontal' || orientation === 'both';\n let next = idx;\n if ((event.key === 'ArrowRight' && isHoriz) || (event.key === 'ArrowDown' && isVert)) {\n next = idx + 1;\n if (next >= list.length) next = loop ? 0 : list.length - 1;\n } else if ((event.key === 'ArrowLeft' && isHoriz) || (event.key === 'ArrowUp' && isVert)) {\n next = idx - 1;\n if (next < 0) next = loop ? list.length - 1 : 0;\n } else if (event.key === 'Home') {\n next = 0;\n } else if (event.key === 'End') {\n next = list.length - 1;\n } else {\n return;\n }\n event.preventDefault();\n const id2 = list[next];\n if (id2) setFocusedId(id2);\n },\n [orientation, loop],\n );\n\n const value = useMemo(\n () => ({ register, unregister, focusedId, setFocusedId, onItemKeyDown }),\n [register, unregister, focusedId, onItemKeyDown],\n );\n\n return (\n <RovingFocusContext.Provider value={value}>\n <div role=\"group\" {...props}>\n {children}\n </div>\n </RovingFocusContext.Provider>\n );\n}\n\nexport interface UseRovingFocusItemReturn {\n ref: (node: HTMLElement | null) => void;\n tabIndex: 0 | -1;\n onKeyDown: (event: KeyboardEvent) => void;\n onFocus: () => void;\n 'data-roving-focus-item': boolean;\n}\n\n/**\n * Inside a `RovingFocusGroup`, returns props to spread onto a focusable item.\n * Outside, returns inert props (tabIndex 0).\n */\nexport function useRovingFocusItem(): UseRovingFocusItemReturn {\n const context = useContext(RovingFocusContext);\n const id = useId();\n const ref = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n context?.register(id);\n return () => context?.unregister(id);\n }, [context, id]);\n\n useEffect(() => {\n if (context?.focusedId === id && ref.current && document.activeElement !== ref.current) {\n ref.current.focus();\n }\n }, [context?.focusedId, id]);\n\n return {\n ref: (node) => {\n ref.current = node;\n },\n tabIndex: !context || context.focusedId === id ? 0 : -1,\n onKeyDown: (e) => context?.onItemKeyDown(e, id),\n onFocus: () => context?.setFocusedId(id),\n 'data-roving-focus-item': true,\n };\n}\n","import {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n type Context,\n type ReactNode,\n} from 'react';\n\nexport interface CollectionContextValue<T> {\n items: T[];\n register: (item: T) => void;\n unregister: (item: T) => void;\n}\n\n/**\n * Factory for a typed children-registry context. Compound components\n * (Menu, Tabs, Listbox) use this so the parent can iterate ordered children\n * without prop-drilling.\n */\nexport function createCollection<T>(): {\n Provider: (props: { children: ReactNode }) => ReactNode;\n useCollection: () => CollectionContextValue<T>;\n Context: Context<CollectionContextValue<T> | null>;\n} {\n const CollectionContext = createContext<CollectionContextValue<T> | null>(null);\n\n function Provider({ children }: { children: ReactNode }) {\n const [items, setItems] = useState<T[]>([]);\n const register = useCallback((item: T) => {\n setItems((prev) => (prev.includes(item) ? prev : [...prev, item]));\n }, []);\n const unregister = useCallback((item: T) => {\n setItems((prev) => prev.filter((i) => i !== item));\n }, []);\n const value = useMemo(() => ({ items, register, unregister }), [items, register, unregister]);\n return <CollectionContext.Provider value={value}>{children}</CollectionContext.Provider>;\n }\n\n function useCollection(): CollectionContextValue<T> {\n const ctx = useContext(CollectionContext);\n if (!ctx) {\n throw new Error('useCollection must be used inside its Provider');\n }\n return ctx;\n }\n\n return { Provider, useCollection, Context: CollectionContext };\n}\n","import { type ReactNode } from 'react';\nimport { useScrollLock } from '../../hooks/useScrollLock';\n\nexport interface ScrollLockProviderProps {\n enabled?: boolean;\n children: ReactNode;\n}\n\n/**\n * Component wrapper around `useScrollLock` — handy when scroll lock should\n * follow a child's mount lifecycle (e.g. inside a Modal's portal).\n * Multiple wrappers stack; lock releases when the count reaches zero.\n */\nexport function ScrollLockProvider({ enabled = true, children }: ScrollLockProviderProps) {\n useScrollLock(enabled);\n return <>{children}</>;\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useId as useId$1 } from 'react';
|
|
2
|
+
|
|
3
|
+
// src/hooks/useId.ts
|
|
4
|
+
function useId(prefix) {
|
|
5
|
+
const id = useId$1();
|
|
6
|
+
return prefix ? `${id}-${prefix}` : id;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { useId };
|
|
10
|
+
//# sourceMappingURL=chunk-JTJEI6MF.js.map
|
|
11
|
+
//# sourceMappingURL=chunk-JTJEI6MF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useId.ts"],"names":["useReactId"],"mappings":";;;AAMO,SAAS,MAAM,MAAA,EAAyB;AAC7C,EAAA,MAAM,KAAKA,OAAA,EAAW;AACtB,EAAA,OAAO,MAAA,GAAS,CAAA,EAAG,EAAE,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA,GAAK,EAAA;AACtC","file":"chunk-JTJEI6MF.js","sourcesContent":["import { useId as useReactId } from 'react';\n\n/**\n * Wraps React 19's `useId`. Optionally accepts a stable prefix so generated\n * IDs are easier to spot in DevTools (e.g. `useId('checkbox')` → `:r2:-checkbox`).\n */\nexport function useId(prefix?: string): string {\n const id = useReactId();\n return prefix ? `${id}-${prefix}` : id;\n}\n"]}
|
|
@@ -0,0 +1,604 @@
|
|
|
1
|
+
import { Icon } from './chunk-TDX22OWF.js';
|
|
2
|
+
import { useFormControl } from './chunk-Q27NAHVB.js';
|
|
3
|
+
import { tv } from './chunk-BMBIZLO4.js';
|
|
4
|
+
import { cn } from './chunk-KZ4VFY2T.js';
|
|
5
|
+
import { forwardRef, useRef, useImperativeHandle, useState } from 'react';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
+
import { Minus, Plus, EyeOff, Eye, Search, X, Check } from 'lucide-react';
|
|
8
|
+
|
|
9
|
+
var Label = forwardRef(
|
|
10
|
+
({ className, required, htmlFor, id, children, ...props }, ref) => {
|
|
11
|
+
const ctx = useFormControl();
|
|
12
|
+
const isRequired = required ?? ctx?.isRequired ?? false;
|
|
13
|
+
return /* @__PURE__ */ jsxs(
|
|
14
|
+
"label",
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
htmlFor: htmlFor ?? ctx?.id,
|
|
18
|
+
id: id ?? ctx?.labelId,
|
|
19
|
+
className: cn(
|
|
20
|
+
"text-sm font-medium text-neutral-900",
|
|
21
|
+
ctx?.isDisabled && "opacity-60",
|
|
22
|
+
className
|
|
23
|
+
),
|
|
24
|
+
...props,
|
|
25
|
+
children: [
|
|
26
|
+
children,
|
|
27
|
+
isRequired && /* @__PURE__ */ jsx("span", { className: "ml-0.5 text-danger-500", "aria-hidden": "true", children: "*" })
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
Label.displayName = "Label";
|
|
34
|
+
var FormHelperText = forwardRef(
|
|
35
|
+
({ className, id, ...props }, ref) => {
|
|
36
|
+
const ctx = useFormControl();
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
"p",
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
id: id ?? ctx?.helperId,
|
|
42
|
+
className: cn("text-sm text-neutral-500", className),
|
|
43
|
+
...props
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
FormHelperText.displayName = "FormHelperText";
|
|
49
|
+
var FormErrorMessage = forwardRef(
|
|
50
|
+
({ className, id, ...props }, ref) => {
|
|
51
|
+
const ctx = useFormControl();
|
|
52
|
+
if (ctx && !ctx.isInvalid) return null;
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
54
|
+
"p",
|
|
55
|
+
{
|
|
56
|
+
ref,
|
|
57
|
+
id: id ?? ctx?.errorId,
|
|
58
|
+
role: "alert",
|
|
59
|
+
className: cn("text-sm text-danger-600", className),
|
|
60
|
+
...props
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
FormErrorMessage.displayName = "FormErrorMessage";
|
|
66
|
+
var Fieldset = forwardRef(
|
|
67
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
68
|
+
"fieldset",
|
|
69
|
+
{
|
|
70
|
+
ref,
|
|
71
|
+
className: cn("m-0 min-w-0 border-0 p-0", className),
|
|
72
|
+
...props
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
);
|
|
76
|
+
Fieldset.displayName = "Fieldset";
|
|
77
|
+
var Legend = forwardRef(
|
|
78
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
79
|
+
"legend",
|
|
80
|
+
{
|
|
81
|
+
ref,
|
|
82
|
+
className: cn("mb-2 text-sm font-medium text-neutral-900", className),
|
|
83
|
+
...props
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
);
|
|
87
|
+
Legend.displayName = "Legend";
|
|
88
|
+
|
|
89
|
+
// src/forms/_styles.ts
|
|
90
|
+
var inputBaseVariants = tv({
|
|
91
|
+
base: "flex w-full rounded-md border bg-white text-neutral-900 placeholder:text-neutral-400 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 disabled:cursor-not-allowed disabled:opacity-60 read-only:bg-neutral-50",
|
|
92
|
+
variants: {
|
|
93
|
+
size: {
|
|
94
|
+
sm: "h-8 px-2.5 text-sm",
|
|
95
|
+
md: "h-10 px-3 text-sm",
|
|
96
|
+
lg: "h-12 px-4 text-base"
|
|
97
|
+
},
|
|
98
|
+
state: {
|
|
99
|
+
default: "border-neutral-300 hover:border-neutral-400",
|
|
100
|
+
invalid: "border-danger-500 focus-visible:ring-danger-500"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
defaultVariants: {
|
|
104
|
+
size: "md",
|
|
105
|
+
state: "default"
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
var TextInput = forwardRef(
|
|
109
|
+
({ className, size, state, id, disabled, required, readOnly, ...props }, ref) => {
|
|
110
|
+
const ctx = useFormControl();
|
|
111
|
+
const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
|
|
112
|
+
return /* @__PURE__ */ jsx(
|
|
113
|
+
"input",
|
|
114
|
+
{
|
|
115
|
+
ref,
|
|
116
|
+
type: "text",
|
|
117
|
+
id: id ?? ctx?.id,
|
|
118
|
+
disabled: disabled ?? ctx?.isDisabled,
|
|
119
|
+
required: required ?? ctx?.isRequired,
|
|
120
|
+
readOnly: readOnly ?? ctx?.isReadOnly,
|
|
121
|
+
"aria-invalid": ctx?.isInvalid || void 0,
|
|
122
|
+
"aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
|
|
123
|
+
className: cn(inputBaseVariants({ size, state: finalState }), className),
|
|
124
|
+
...props
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
TextInput.displayName = "TextInput";
|
|
130
|
+
var EmailInput = forwardRef(
|
|
131
|
+
({ className, size, state, id, disabled, required, readOnly, ...props }, ref) => {
|
|
132
|
+
const ctx = useFormControl();
|
|
133
|
+
const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
"input",
|
|
136
|
+
{
|
|
137
|
+
ref,
|
|
138
|
+
type: "email",
|
|
139
|
+
autoComplete: "email",
|
|
140
|
+
inputMode: "email",
|
|
141
|
+
spellCheck: false,
|
|
142
|
+
id: id ?? ctx?.id,
|
|
143
|
+
disabled: disabled ?? ctx?.isDisabled,
|
|
144
|
+
required: required ?? ctx?.isRequired,
|
|
145
|
+
readOnly: readOnly ?? ctx?.isReadOnly,
|
|
146
|
+
"aria-invalid": ctx?.isInvalid || void 0,
|
|
147
|
+
"aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
|
|
148
|
+
className: cn(inputBaseVariants({ size, state: finalState }), className),
|
|
149
|
+
...props
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
EmailInput.displayName = "EmailInput";
|
|
155
|
+
var TelInput = forwardRef(
|
|
156
|
+
({ className, size, state, id, disabled, required, readOnly, ...props }, ref) => {
|
|
157
|
+
const ctx = useFormControl();
|
|
158
|
+
const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
|
|
159
|
+
return /* @__PURE__ */ jsx(
|
|
160
|
+
"input",
|
|
161
|
+
{
|
|
162
|
+
ref,
|
|
163
|
+
type: "tel",
|
|
164
|
+
autoComplete: "tel",
|
|
165
|
+
inputMode: "tel",
|
|
166
|
+
id: id ?? ctx?.id,
|
|
167
|
+
disabled: disabled ?? ctx?.isDisabled,
|
|
168
|
+
required: required ?? ctx?.isRequired,
|
|
169
|
+
readOnly: readOnly ?? ctx?.isReadOnly,
|
|
170
|
+
"aria-invalid": ctx?.isInvalid || void 0,
|
|
171
|
+
"aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
|
|
172
|
+
className: cn(inputBaseVariants({ size, state: finalState }), className),
|
|
173
|
+
...props
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
TelInput.displayName = "TelInput";
|
|
179
|
+
var UrlInput = forwardRef(
|
|
180
|
+
({ className, size, state, id, disabled, required, readOnly, ...props }, ref) => {
|
|
181
|
+
const ctx = useFormControl();
|
|
182
|
+
const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
|
|
183
|
+
return /* @__PURE__ */ jsx(
|
|
184
|
+
"input",
|
|
185
|
+
{
|
|
186
|
+
ref,
|
|
187
|
+
type: "url",
|
|
188
|
+
autoComplete: "url",
|
|
189
|
+
inputMode: "url",
|
|
190
|
+
spellCheck: false,
|
|
191
|
+
id: id ?? ctx?.id,
|
|
192
|
+
disabled: disabled ?? ctx?.isDisabled,
|
|
193
|
+
required: required ?? ctx?.isRequired,
|
|
194
|
+
readOnly: readOnly ?? ctx?.isReadOnly,
|
|
195
|
+
"aria-invalid": ctx?.isInvalid || void 0,
|
|
196
|
+
"aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
|
|
197
|
+
className: cn(inputBaseVariants({ size, state: finalState }), className),
|
|
198
|
+
...props
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
UrlInput.displayName = "UrlInput";
|
|
204
|
+
var NumberInput = forwardRef(
|
|
205
|
+
({ className, size, state, id, disabled, required, readOnly, step = 1, ...props }, forwardedRef) => {
|
|
206
|
+
const ctx = useFormControl();
|
|
207
|
+
const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
|
|
208
|
+
const inputRef = useRef(null);
|
|
209
|
+
useImperativeHandle(forwardedRef, () => inputRef.current);
|
|
210
|
+
const adjust = (direction) => {
|
|
211
|
+
const el = inputRef.current;
|
|
212
|
+
if (!el || typeof el.stepUp !== "function") return;
|
|
213
|
+
if (direction === 1) el.stepUp(step);
|
|
214
|
+
else el.stepDown(step);
|
|
215
|
+
el.dispatchEvent(new Event("input", { bubbles: true }));
|
|
216
|
+
el.dispatchEvent(new Event("change", { bubbles: true }));
|
|
217
|
+
};
|
|
218
|
+
const isDisabled = disabled ?? ctx?.isDisabled ?? false;
|
|
219
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
220
|
+
/* @__PURE__ */ jsx(
|
|
221
|
+
"input",
|
|
222
|
+
{
|
|
223
|
+
ref: inputRef,
|
|
224
|
+
type: "number",
|
|
225
|
+
inputMode: "decimal",
|
|
226
|
+
step,
|
|
227
|
+
id: id ?? ctx?.id,
|
|
228
|
+
disabled: isDisabled,
|
|
229
|
+
required: required ?? ctx?.isRequired,
|
|
230
|
+
readOnly: readOnly ?? ctx?.isReadOnly,
|
|
231
|
+
"aria-invalid": ctx?.isInvalid || void 0,
|
|
232
|
+
"aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
|
|
233
|
+
className: cn(inputBaseVariants({ size, state: finalState }), "pr-12 [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"),
|
|
234
|
+
...props
|
|
235
|
+
}
|
|
236
|
+
),
|
|
237
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute right-1 top-1/2 flex -translate-y-1/2 items-center", children: [
|
|
238
|
+
/* @__PURE__ */ jsx(
|
|
239
|
+
"button",
|
|
240
|
+
{
|
|
241
|
+
type: "button",
|
|
242
|
+
disabled: isDisabled,
|
|
243
|
+
onClick: () => adjust(-1),
|
|
244
|
+
"aria-label": "Decrement",
|
|
245
|
+
className: "grid h-7 w-6 place-items-center rounded text-neutral-500 hover:bg-neutral-100 disabled:opacity-50",
|
|
246
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: Minus, size: 14 })
|
|
247
|
+
}
|
|
248
|
+
),
|
|
249
|
+
/* @__PURE__ */ jsx(
|
|
250
|
+
"button",
|
|
251
|
+
{
|
|
252
|
+
type: "button",
|
|
253
|
+
disabled: isDisabled,
|
|
254
|
+
onClick: () => adjust(1),
|
|
255
|
+
"aria-label": "Increment",
|
|
256
|
+
className: "grid h-7 w-6 place-items-center rounded text-neutral-500 hover:bg-neutral-100 disabled:opacity-50",
|
|
257
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: Plus, size: 14 })
|
|
258
|
+
}
|
|
259
|
+
)
|
|
260
|
+
] })
|
|
261
|
+
] });
|
|
262
|
+
}
|
|
263
|
+
);
|
|
264
|
+
NumberInput.displayName = "NumberInput";
|
|
265
|
+
var PasswordInput = forwardRef(
|
|
266
|
+
({
|
|
267
|
+
className,
|
|
268
|
+
size,
|
|
269
|
+
state,
|
|
270
|
+
id,
|
|
271
|
+
disabled,
|
|
272
|
+
required,
|
|
273
|
+
readOnly,
|
|
274
|
+
toggleable = true,
|
|
275
|
+
autoComplete = "current-password",
|
|
276
|
+
...props
|
|
277
|
+
}, ref) => {
|
|
278
|
+
const [visible, setVisible] = useState(false);
|
|
279
|
+
const ctx = useFormControl();
|
|
280
|
+
const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
|
|
281
|
+
const isDisabled = disabled ?? ctx?.isDisabled ?? false;
|
|
282
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
283
|
+
/* @__PURE__ */ jsx(
|
|
284
|
+
"input",
|
|
285
|
+
{
|
|
286
|
+
ref,
|
|
287
|
+
type: visible ? "text" : "password",
|
|
288
|
+
autoComplete,
|
|
289
|
+
spellCheck: false,
|
|
290
|
+
id: id ?? ctx?.id,
|
|
291
|
+
disabled: isDisabled,
|
|
292
|
+
required: required ?? ctx?.isRequired,
|
|
293
|
+
readOnly: readOnly ?? ctx?.isReadOnly,
|
|
294
|
+
"aria-invalid": ctx?.isInvalid || void 0,
|
|
295
|
+
"aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
|
|
296
|
+
className: cn(inputBaseVariants({ size, state: finalState }), toggleable && "pr-10"),
|
|
297
|
+
...props
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
toggleable && /* @__PURE__ */ jsx(
|
|
301
|
+
"button",
|
|
302
|
+
{
|
|
303
|
+
type: "button",
|
|
304
|
+
disabled: isDisabled,
|
|
305
|
+
onClick: () => setVisible((v) => !v),
|
|
306
|
+
"aria-label": visible ? "Hide password" : "Show password",
|
|
307
|
+
"aria-pressed": visible,
|
|
308
|
+
className: "absolute right-1 top-1/2 grid h-8 w-8 -translate-y-1/2 place-items-center rounded text-neutral-500 hover:bg-neutral-100 disabled:opacity-50",
|
|
309
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: visible ? EyeOff : Eye, size: 16 })
|
|
310
|
+
}
|
|
311
|
+
)
|
|
312
|
+
] });
|
|
313
|
+
}
|
|
314
|
+
);
|
|
315
|
+
PasswordInput.displayName = "PasswordInput";
|
|
316
|
+
var SearchInput = forwardRef(
|
|
317
|
+
({
|
|
318
|
+
className,
|
|
319
|
+
size,
|
|
320
|
+
state,
|
|
321
|
+
id,
|
|
322
|
+
disabled,
|
|
323
|
+
required,
|
|
324
|
+
readOnly,
|
|
325
|
+
clearable = true,
|
|
326
|
+
onClear,
|
|
327
|
+
onChange,
|
|
328
|
+
defaultValue,
|
|
329
|
+
value,
|
|
330
|
+
...props
|
|
331
|
+
}, forwardedRef) => {
|
|
332
|
+
const ctx = useFormControl();
|
|
333
|
+
const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
|
|
334
|
+
const isDisabled = disabled ?? ctx?.isDisabled ?? false;
|
|
335
|
+
const inputRef = useRef(null);
|
|
336
|
+
useImperativeHandle(forwardedRef, () => inputRef.current);
|
|
337
|
+
const isControlled = value !== void 0;
|
|
338
|
+
const [uncontrolled, setUncontrolled] = useState(defaultValue ?? "");
|
|
339
|
+
const currentValue = isControlled ? value : uncontrolled;
|
|
340
|
+
const showClear = clearable && String(currentValue ?? "").length > 0;
|
|
341
|
+
const handleClear = () => {
|
|
342
|
+
const el = inputRef.current;
|
|
343
|
+
if (el) {
|
|
344
|
+
const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
|
|
345
|
+
setter?.call(el, "");
|
|
346
|
+
el.dispatchEvent(new Event("input", { bubbles: true }));
|
|
347
|
+
el.focus();
|
|
348
|
+
}
|
|
349
|
+
if (!isControlled) setUncontrolled("");
|
|
350
|
+
onClear?.();
|
|
351
|
+
};
|
|
352
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
353
|
+
/* @__PURE__ */ jsx(
|
|
354
|
+
Icon,
|
|
355
|
+
{
|
|
356
|
+
icon: Search,
|
|
357
|
+
size: 16,
|
|
358
|
+
className: "absolute left-3 top-1/2 -translate-y-1/2 text-neutral-400"
|
|
359
|
+
}
|
|
360
|
+
),
|
|
361
|
+
/* @__PURE__ */ jsx(
|
|
362
|
+
"input",
|
|
363
|
+
{
|
|
364
|
+
ref: inputRef,
|
|
365
|
+
type: "search",
|
|
366
|
+
id: id ?? ctx?.id,
|
|
367
|
+
value: isControlled ? value : void 0,
|
|
368
|
+
defaultValue: !isControlled ? defaultValue : void 0,
|
|
369
|
+
onChange: (e) => {
|
|
370
|
+
if (!isControlled) setUncontrolled(e.target.value);
|
|
371
|
+
onChange?.(e);
|
|
372
|
+
},
|
|
373
|
+
disabled: isDisabled,
|
|
374
|
+
required: required ?? ctx?.isRequired,
|
|
375
|
+
readOnly: readOnly ?? ctx?.isReadOnly,
|
|
376
|
+
"aria-invalid": ctx?.isInvalid || void 0,
|
|
377
|
+
"aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
|
|
378
|
+
className: cn(
|
|
379
|
+
inputBaseVariants({ size, state: finalState }),
|
|
380
|
+
"pl-9",
|
|
381
|
+
showClear && "pr-9",
|
|
382
|
+
"[&::-webkit-search-cancel-button]:appearance-none"
|
|
383
|
+
),
|
|
384
|
+
...props
|
|
385
|
+
}
|
|
386
|
+
),
|
|
387
|
+
showClear && /* @__PURE__ */ jsx(
|
|
388
|
+
"button",
|
|
389
|
+
{
|
|
390
|
+
type: "button",
|
|
391
|
+
disabled: isDisabled,
|
|
392
|
+
onClick: handleClear,
|
|
393
|
+
"aria-label": "Clear search",
|
|
394
|
+
className: "absolute right-1 top-1/2 grid h-8 w-8 -translate-y-1/2 place-items-center rounded text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600",
|
|
395
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: X, size: 14 })
|
|
396
|
+
}
|
|
397
|
+
)
|
|
398
|
+
] });
|
|
399
|
+
}
|
|
400
|
+
);
|
|
401
|
+
SearchInput.displayName = "SearchInput";
|
|
402
|
+
var Textarea = forwardRef(
|
|
403
|
+
({ className, size, state, id, disabled, required, readOnly, rows = 3, ...props }, ref) => {
|
|
404
|
+
const ctx = useFormControl();
|
|
405
|
+
const finalState = state ?? (ctx?.isInvalid ? "invalid" : "default");
|
|
406
|
+
return /* @__PURE__ */ jsx(
|
|
407
|
+
"textarea",
|
|
408
|
+
{
|
|
409
|
+
ref,
|
|
410
|
+
rows,
|
|
411
|
+
id: id ?? ctx?.id,
|
|
412
|
+
disabled: disabled ?? ctx?.isDisabled,
|
|
413
|
+
required: required ?? ctx?.isRequired,
|
|
414
|
+
readOnly: readOnly ?? ctx?.isReadOnly,
|
|
415
|
+
"aria-invalid": ctx?.isInvalid || void 0,
|
|
416
|
+
"aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
|
|
417
|
+
className: cn(
|
|
418
|
+
inputBaseVariants({ size, state: finalState }),
|
|
419
|
+
"h-auto resize-y py-2",
|
|
420
|
+
className
|
|
421
|
+
),
|
|
422
|
+
...props
|
|
423
|
+
}
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
);
|
|
427
|
+
Textarea.displayName = "Textarea";
|
|
428
|
+
var SIZE_CLASS = {
|
|
429
|
+
sm: "h-4 w-4",
|
|
430
|
+
md: "h-5 w-5",
|
|
431
|
+
lg: "h-6 w-6"
|
|
432
|
+
};
|
|
433
|
+
var Checkbox = forwardRef(
|
|
434
|
+
({ className, size = "md", indeterminate, id, disabled, required, checked, ...props }, ref) => {
|
|
435
|
+
const ctx = useFormControl();
|
|
436
|
+
const isDisabled = disabled ?? ctx?.isDisabled;
|
|
437
|
+
return /* @__PURE__ */ jsxs("span", { className: cn("relative inline-flex shrink-0", SIZE_CLASS[size], className), children: [
|
|
438
|
+
/* @__PURE__ */ jsx(
|
|
439
|
+
"input",
|
|
440
|
+
{
|
|
441
|
+
ref,
|
|
442
|
+
type: "checkbox",
|
|
443
|
+
id: id ?? ctx?.id,
|
|
444
|
+
disabled: isDisabled,
|
|
445
|
+
required: required ?? ctx?.isRequired,
|
|
446
|
+
checked,
|
|
447
|
+
"aria-invalid": ctx?.isInvalid || void 0,
|
|
448
|
+
"aria-describedby": ctx ? `${ctx.helperId} ${ctx.errorId}` : void 0,
|
|
449
|
+
className: "peer absolute inset-0 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
|
|
450
|
+
...props
|
|
451
|
+
}
|
|
452
|
+
),
|
|
453
|
+
/* @__PURE__ */ jsx(
|
|
454
|
+
"span",
|
|
455
|
+
{
|
|
456
|
+
"aria-hidden": "true",
|
|
457
|
+
className: cn(
|
|
458
|
+
"pointer-events-none grid h-full w-full place-items-center rounded-sm border border-neutral-300 bg-white text-white transition-colors",
|
|
459
|
+
"peer-checked:border-brand-600 peer-checked:bg-brand-600",
|
|
460
|
+
"peer-focus-visible:ring-2 peer-focus-visible:ring-brand-500 peer-focus-visible:ring-offset-1",
|
|
461
|
+
"peer-disabled:opacity-50",
|
|
462
|
+
indeterminate && "border-brand-600 bg-brand-600"
|
|
463
|
+
),
|
|
464
|
+
children: indeterminate ? /* @__PURE__ */ jsx(Minus, { size: Math.round(SIZE_CLASS[size].length * 1.4), className: "h-3 w-3" }) : /* @__PURE__ */ jsx(Check, { className: "h-3 w-3 opacity-0 peer-checked:opacity-100" })
|
|
465
|
+
}
|
|
466
|
+
)
|
|
467
|
+
] });
|
|
468
|
+
}
|
|
469
|
+
);
|
|
470
|
+
Checkbox.displayName = "Checkbox";
|
|
471
|
+
var SIZE_CLASS2 = {
|
|
472
|
+
sm: "h-4 w-4",
|
|
473
|
+
md: "h-5 w-5",
|
|
474
|
+
lg: "h-6 w-6"
|
|
475
|
+
};
|
|
476
|
+
var Radio = forwardRef(
|
|
477
|
+
({ className, size = "md", id, disabled, required, ...props }, ref) => {
|
|
478
|
+
const ctx = useFormControl();
|
|
479
|
+
return /* @__PURE__ */ jsxs("span", { className: cn("relative inline-flex shrink-0", SIZE_CLASS2[size], className), children: [
|
|
480
|
+
/* @__PURE__ */ jsx(
|
|
481
|
+
"input",
|
|
482
|
+
{
|
|
483
|
+
ref,
|
|
484
|
+
type: "radio",
|
|
485
|
+
id: id ?? ctx?.id,
|
|
486
|
+
disabled: disabled ?? ctx?.isDisabled,
|
|
487
|
+
required: required ?? ctx?.isRequired,
|
|
488
|
+
"aria-invalid": ctx?.isInvalid || void 0,
|
|
489
|
+
className: "peer absolute inset-0 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
|
|
490
|
+
...props
|
|
491
|
+
}
|
|
492
|
+
),
|
|
493
|
+
/* @__PURE__ */ jsx(
|
|
494
|
+
"span",
|
|
495
|
+
{
|
|
496
|
+
"aria-hidden": "true",
|
|
497
|
+
className: cn(
|
|
498
|
+
"pointer-events-none grid h-full w-full place-items-center rounded-full border border-neutral-300 bg-white transition-colors",
|
|
499
|
+
"peer-checked:border-brand-600",
|
|
500
|
+
"peer-focus-visible:ring-2 peer-focus-visible:ring-brand-500 peer-focus-visible:ring-offset-1",
|
|
501
|
+
"peer-disabled:opacity-50"
|
|
502
|
+
),
|
|
503
|
+
children: /* @__PURE__ */ jsx("span", { className: "h-2 w-2 rounded-full bg-brand-600 opacity-0 peer-checked:opacity-100" })
|
|
504
|
+
}
|
|
505
|
+
)
|
|
506
|
+
] });
|
|
507
|
+
}
|
|
508
|
+
);
|
|
509
|
+
Radio.displayName = "Radio";
|
|
510
|
+
var TRACK_CLASS = {
|
|
511
|
+
sm: "h-4 w-7",
|
|
512
|
+
md: "h-5 w-9",
|
|
513
|
+
lg: "h-6 w-11"
|
|
514
|
+
};
|
|
515
|
+
var THUMB_CLASS = {
|
|
516
|
+
sm: "h-3 w-3 peer-checked:translate-x-3",
|
|
517
|
+
md: "h-4 w-4 peer-checked:translate-x-4",
|
|
518
|
+
lg: "h-5 w-5 peer-checked:translate-x-5"
|
|
519
|
+
};
|
|
520
|
+
var Switch = forwardRef(
|
|
521
|
+
({ className, size = "md", id, disabled, required, ...props }, ref) => {
|
|
522
|
+
const ctx = useFormControl();
|
|
523
|
+
return /* @__PURE__ */ jsxs("span", { className: cn("relative inline-flex shrink-0", TRACK_CLASS[size], className), children: [
|
|
524
|
+
/* @__PURE__ */ jsx(
|
|
525
|
+
"input",
|
|
526
|
+
{
|
|
527
|
+
ref,
|
|
528
|
+
type: "checkbox",
|
|
529
|
+
role: "switch",
|
|
530
|
+
id: id ?? ctx?.id,
|
|
531
|
+
disabled: disabled ?? ctx?.isDisabled,
|
|
532
|
+
required: required ?? ctx?.isRequired,
|
|
533
|
+
"aria-invalid": ctx?.isInvalid || void 0,
|
|
534
|
+
className: "peer absolute inset-0 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
|
|
535
|
+
...props
|
|
536
|
+
}
|
|
537
|
+
),
|
|
538
|
+
/* @__PURE__ */ jsx(
|
|
539
|
+
"span",
|
|
540
|
+
{
|
|
541
|
+
"aria-hidden": "true",
|
|
542
|
+
className: cn(
|
|
543
|
+
"pointer-events-none flex h-full w-full items-center rounded-full bg-neutral-300 px-0.5 transition-colors",
|
|
544
|
+
"peer-checked:bg-brand-600",
|
|
545
|
+
"peer-focus-visible:ring-2 peer-focus-visible:ring-brand-500 peer-focus-visible:ring-offset-1",
|
|
546
|
+
"peer-disabled:opacity-50"
|
|
547
|
+
),
|
|
548
|
+
children: /* @__PURE__ */ jsx(
|
|
549
|
+
"span",
|
|
550
|
+
{
|
|
551
|
+
className: cn(
|
|
552
|
+
"rounded-full bg-white shadow-sm transition-transform duration-150",
|
|
553
|
+
THUMB_CLASS[size]
|
|
554
|
+
)
|
|
555
|
+
}
|
|
556
|
+
)
|
|
557
|
+
}
|
|
558
|
+
)
|
|
559
|
+
] });
|
|
560
|
+
}
|
|
561
|
+
);
|
|
562
|
+
Switch.displayName = "Switch";
|
|
563
|
+
var TRACK_CLASS2 = {
|
|
564
|
+
sm: "h-1",
|
|
565
|
+
md: "h-1.5",
|
|
566
|
+
lg: "h-2"
|
|
567
|
+
};
|
|
568
|
+
var Slider = forwardRef(
|
|
569
|
+
({ className, size = "md", id, disabled, required, min = 0, max = 100, ...props }, ref) => {
|
|
570
|
+
const ctx = useFormControl();
|
|
571
|
+
return /* @__PURE__ */ jsx(
|
|
572
|
+
"input",
|
|
573
|
+
{
|
|
574
|
+
ref,
|
|
575
|
+
type: "range",
|
|
576
|
+
id: id ?? ctx?.id,
|
|
577
|
+
disabled: disabled ?? ctx?.isDisabled,
|
|
578
|
+
required: required ?? ctx?.isRequired,
|
|
579
|
+
min,
|
|
580
|
+
max,
|
|
581
|
+
"aria-invalid": ctx?.isInvalid || void 0,
|
|
582
|
+
className: cn(
|
|
583
|
+
"w-full appearance-none bg-transparent disabled:cursor-not-allowed disabled:opacity-50",
|
|
584
|
+
// WebKit
|
|
585
|
+
"[&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-neutral-200",
|
|
586
|
+
`[&::-webkit-slider-runnable-track]:${TRACK_CLASS2[size]}`,
|
|
587
|
+
"[&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-brand-600 [&::-webkit-slider-thumb]:bg-white",
|
|
588
|
+
// Firefox
|
|
589
|
+
`[&::-moz-range-track]:${TRACK_CLASS2[size]}`,
|
|
590
|
+
"[&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-neutral-200",
|
|
591
|
+
"[&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-brand-600 [&::-moz-range-thumb]:bg-white",
|
|
592
|
+
"focus-visible:outline-none focus-visible:[&::-webkit-slider-thumb]:ring-2 focus-visible:[&::-webkit-slider-thumb]:ring-brand-500",
|
|
593
|
+
className
|
|
594
|
+
),
|
|
595
|
+
...props
|
|
596
|
+
}
|
|
597
|
+
);
|
|
598
|
+
}
|
|
599
|
+
);
|
|
600
|
+
Slider.displayName = "Slider";
|
|
601
|
+
|
|
602
|
+
export { Checkbox, EmailInput, Fieldset, FormErrorMessage, FormHelperText, Label, Legend, NumberInput, PasswordInput, Radio, SearchInput, Slider, Switch, TelInput, TextInput, Textarea, UrlInput };
|
|
603
|
+
//# sourceMappingURL=chunk-KSJE3JAI.js.map
|
|
604
|
+
//# sourceMappingURL=chunk-KSJE3JAI.js.map
|