@kushagradhawan/kookie-ui 0.1.123 → 0.1.125
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/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js.map +2 -2
- package/dist/cjs/components/_internal/shell-handles.js +1 -1
- package/dist/cjs/components/_internal/shell-handles.js.map +2 -2
- package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js.map +2 -2
- package/dist/cjs/components/_internal/shell-prop-helpers.js.map +2 -2
- package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js.map +2 -2
- package/dist/cjs/components/combobox.d.ts.map +1 -1
- package/dist/cjs/components/combobox.js +1 -1
- package/dist/cjs/components/combobox.js.map +3 -3
- package/dist/cjs/components/shell.context.d.ts +2 -0
- package/dist/cjs/components/shell.context.d.ts.map +1 -1
- package/dist/cjs/components/shell.context.js +1 -1
- package/dist/cjs/components/shell.context.js.map +2 -2
- package/dist/cjs/components/shell.d.ts.map +1 -1
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +3 -3
- package/dist/cjs/components/shell.types.d.ts +11 -0
- package/dist/cjs/components/shell.types.d.ts.map +1 -1
- package/dist/cjs/components/shell.types.js +1 -1
- package/dist/cjs/components/shell.types.js.map +1 -1
- package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-bottom.js +1 -1
- package/dist/esm/components/_internal/shell-bottom.js.map +2 -2
- package/dist/esm/components/_internal/shell-handles.js +1 -1
- package/dist/esm/components/_internal/shell-handles.js.map +2 -2
- package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-inspector.js +1 -1
- package/dist/esm/components/_internal/shell-inspector.js.map +2 -2
- package/dist/esm/components/_internal/shell-prop-helpers.js.map +2 -2
- package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-sidebar.js +1 -1
- package/dist/esm/components/_internal/shell-sidebar.js.map +2 -2
- package/dist/esm/components/combobox.d.ts.map +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/combobox.js.map +3 -3
- package/dist/esm/components/shell.context.d.ts +2 -0
- package/dist/esm/components/shell.context.d.ts.map +1 -1
- package/dist/esm/components/shell.context.js.map +2 -2
- package/dist/esm/components/shell.d.ts.map +1 -1
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/shell.js.map +3 -3
- package/dist/esm/components/shell.types.d.ts +11 -0
- package/dist/esm/components/shell.types.d.ts.map +1 -1
- package/dist/esm/components/shell.types.js.map +1 -1
- package/package.json +1 -1
- package/schemas/base-button.json +1 -1
- package/schemas/button.json +1 -1
- package/schemas/icon-button.json +1 -1
- package/schemas/index.json +6 -6
- package/schemas/toggle-button.json +1 -1
- package/schemas/toggle-icon-button.json +1 -1
- package/src/components/_internal/shell-bottom.tsx +5 -5
- package/src/components/_internal/shell-handles.tsx +26 -26
- package/src/components/_internal/shell-inspector.tsx +5 -5
- package/src/components/_internal/shell-prop-helpers.ts +1 -1
- package/src/components/_internal/shell-sidebar.tsx +10 -10
- package/src/components/combobox.tsx +176 -80
- package/src/components/shell.context.tsx +12 -10
- package/src/components/shell.tsx +21 -20
- package/src/components/shell.types.ts +13 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/_internal/shell-sidebar.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport * as Sheet from '../sheet.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { useShell, useInset } from '../shell.context.js';\nimport { useResponsivePresentation, useResponsiveInitialState } from '../shell.hooks.js';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { extractPaneDomProps } from './shell-prop-helpers.js';\nimport { SidebarHandle, PaneHandle } from './shell-handles.js';\nimport type { Breakpoint, PaneMode, PaneSizePersistence, ResponsivePresentation, SidebarMode, Responsive, PaneBaseProps } from '../shell.types.js';\nimport { _BREAKPOINTS } from '../shell.types.js';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\n\ntype SidebarPaneProps = PaneBaseProps & {\n mode?: PaneMode;\n defaultMode?: any;\n onModeChange?: (mode: PaneMode | SidebarMode) => void;\n};\n\ntype SidebarStateChangeMeta = { reason: 'init' | 'toggle' | 'responsive' };\ntype SidebarControlledProps = { state: Responsive<SidebarMode>; onStateChange?: (state: SidebarMode, meta: SidebarStateChangeMeta) => void; defaultState?: never };\ntype SidebarUncontrolledProps = { defaultState?: SidebarMode | Partial<Record<Breakpoint, SidebarMode>>; onStateChange?: (state: SidebarMode, meta: SidebarStateChangeMeta) => void; state?: never };\ntype SidebarPublicProps = Omit<SidebarPaneProps, 'mode' | 'defaultMode' | 'onModeChange'> & {\n // removed legacy mode props\n thinSize?: number;\n toggleModes?: 'both' | 'single';\n // size API (width when expanded)\n size?: number | string;\n defaultSize?: number | string;\n onSizeChange?: (size: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /** When true, adds margin and triggers gray backdrop on Shell. */\n inset?: boolean;\n} & (SidebarControlledProps | SidebarUncontrolledProps);\n\ntype SidebarComponent = React.ForwardRefExoticComponent<SidebarPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof SidebarHandle };\n\nconst SIDEBAR_DOM_PROP_KEYS = [\n 'className',\n 'children',\n 'state',\n 'defaultState',\n 'onStateChange',\n 'thinSize',\n 'toggleModes',\n 'size',\n 'defaultSize',\n 'onSizeChange',\n 'sizeUpdate',\n 'sizeUpdateMs',\n 'style',\n 'inset',\n] as const satisfies readonly (keyof SidebarPublicProps)[];\n\nexport const Sidebar = React.forwardRef<HTMLDivElement, SidebarPublicProps>((initialProps, ref) => {\n const {\n className,\n presentation = { initial: 'overlay', md: 'fixed' },\n expandedSize = 288,\n minSize = 200,\n maxSize = 400,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n thinSize = 64,\n toggleModes,\n state,\n defaultState,\n onStateChange,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n inset,\n } = initialProps;\n const sidebarDomProps = extractPaneDomProps(initialProps, SIDEBAR_DOM_PROP_KEYS);\n const shell = useShell();\n const { registerInset, unregisterInset } = useInset();\n\n // Register/unregister inset\n React.useEffect(() => {\n if (inset) {\n registerInset('sidebar');\n return () => unregisterInset('sidebar');\n }\n }, [inset, registerInset, unregisterInset]);\n const resolvedPresentation = useResponsivePresentation(presentation);\n const isOverlay = resolvedPresentation === 'overlay';\n const isStacked = resolvedPresentation === 'stacked';\n // Phase sequencing is now CSS-driven; no JS-managed phase\n const localRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n localRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n const childArray = React.Children.toArray(children) as React.ReactElement[];\n const handleChildren = childArray.filter((el: React.ReactElement) => React.isValidElement(el) && el.type === SidebarHandle);\n const contentChildren = childArray.filter((el: React.ReactElement) => !(React.isValidElement(el) && el.type === SidebarHandle));\n\n // Ref for debounce cleanup\n const debounceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // Cleanup debounce timeout on unmount or when dependencies change\n React.useEffect(() => {\n return () => {\n if (debounceTimeoutRef.current) {\n clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = null;\n }\n };\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n // Throttled/debounced emitter for onSizeChange\n const emitSizeChange = React.useMemo(() => {\n const cb = onSizeChange as undefined | ((s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => void);\n const strategy = sizeUpdate as undefined | 'throttle' | 'debounce';\n const ms = sizeUpdateMs ?? 50;\n if (!cb) return () => {};\n if (strategy === 'debounce') {\n return (s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => {\n if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = setTimeout(() => {\n cb(s, meta);\n debounceTimeoutRef.current = null;\n }, ms);\n };\n }\n if (strategy === 'throttle') {\n let last = 0;\n return (s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => {\n const now = Date.now();\n if (now - last >= ms) {\n last = now;\n cb(s, meta);\n }\n };\n }\n return (s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => cb(s, meta);\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n\n // Register with shell\n const sidebarId = React.useId();\n React.useEffect(() => {\n shell.setHasSidebar(true);\n return () => {\n shell.setHasSidebar(false);\n };\n }, [shell, sidebarId]);\n\n // Dev guards\n const wasControlledRef = React.useRef<boolean | null>(null);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof state !== 'undefined' && typeof defaultState !== 'undefined') {\n console.error('Shell.Sidebar: Do not pass both `state` and `defaultState`. Choose one.');\n }\n if (typeof size !== 'undefined' && typeof defaultSize !== 'undefined') {\n console.error('Shell.Sidebar: Do not pass both `size` and `defaultSize`. Choose one.');\n }\n }\n\n // Warn on mode switch between controlled/uncontrolled\n React.useEffect(() => {\n const isControlled = typeof state !== 'undefined';\n if (wasControlledRef.current === null) {\n wasControlledRef.current = isControlled;\n return;\n }\n if (wasControlledRef.current !== isControlled) {\n console.warn('Shell.Sidebar: Switching between controlled and uncontrolled `state` is not supported.');\n wasControlledRef.current = isControlled;\n }\n }, [state]);\n\n // Resolve responsive controlled state at top level\n const stateIsResponsive = typeof state === 'object' && state !== null;\n const { resolvedDefault: resolvedSidebarDefault } = useResponsiveInitialState<SidebarMode>({\n controlledValue: state,\n defaultValue: defaultState,\n currentValue: shell.sidebarMode as SidebarMode,\n setValue: shell.setSidebarMode,\n breakpointReady: shell.currentBreakpointReady,\n controlledIsResponsive: stateIsResponsive,\n onResponsiveChange: (next) => onStateChange?.(next, { reason: 'responsive' }),\n onInit: (initial) => onStateChange?.(initial, { reason: 'init' }),\n });\n\n // Emit mode changes\n const lastNotifyModeRef = React.useRef<SidebarMode | null>(null);\n React.useEffect(() => {\n // notify new API when uncontrolled; skip first run to avoid masking init\n if (typeof state === 'undefined') {\n if (lastNotifyModeRef.current === null) {\n lastNotifyModeRef.current = shell.sidebarMode as SidebarMode;\n } else if (lastNotifyModeRef.current !== shell.sidebarMode) {\n lastNotifyModeRef.current = shell.sidebarMode as SidebarMode;\n onStateChange?.(shell.sidebarMode as SidebarMode, { reason: 'toggle' });\n }\n }\n }, [shell.sidebarMode, state, onStateChange]);\n\n // Track previous mode to only fire callbacks on actual user-initiated state transitions.\n // We wait for breakpointReady to ensure the initial state sync from useResponsiveInitialState\n // is complete before enabling callbacks. This avoids spurious callbacks during initialization.\n // Use callback refs to avoid re-running effect when inline callbacks change.\n const onExpandRef = React.useRef(onExpand);\n const onCollapseRef = React.useRef(onCollapse);\n React.useLayoutEffect(() => {\n onExpandRef.current = onExpand;\n onCollapseRef.current = onCollapse;\n });\n\n const prevSidebarModeRef = React.useRef<SidebarMode | null>(null);\n const hasInitializedRef = React.useRef(false);\n React.useEffect(() => {\n const currentMode = shell.sidebarMode as SidebarMode;\n\n // Wait for breakpoint to be ready before enabling callbacks\n if (!shell.currentBreakpointReady) {\n prevSidebarModeRef.current = currentMode;\n return;\n }\n\n // Skip the first run after breakpoint is ready - this captures the post-sync state\n if (!hasInitializedRef.current) {\n hasInitializedRef.current = true;\n prevSidebarModeRef.current = currentMode;\n return;\n }\n\n const prevMode = prevSidebarModeRef.current;\n\n // Only fire on actual state transitions\n if (prevMode !== null && prevMode !== currentMode) {\n // onExpand: when becoming visible (collapsed \u2192 thin/expanded)\n if (prevMode === 'collapsed' && currentMode !== 'collapsed') {\n onExpandRef.current?.();\n }\n // onCollapse: when becoming hidden (any \u2192 collapsed)\n else if (currentMode === 'collapsed') {\n onCollapseRef.current?.();\n }\n prevSidebarModeRef.current = currentMode;\n }\n }, [shell.sidebarMode, shell.currentBreakpointReady]);\n\n // Option A: thin is width-only; content remains visible whenever not collapsed\n const isContentVisible = shell.sidebarMode !== 'collapsed';\n\n // Default persistence if paneId provided and none supplied (fixed only)\n const persistenceAdapter = React.useMemo(() => {\n if (!paneId || persistence) return persistence;\n const key = `kookie-ui:shell:sidebar:${paneId}`;\n const adapter: PaneSizePersistence = {\n load: () => {\n if (typeof window === 'undefined') return undefined;\n try {\n const v = window.localStorage.getItem(key);\n return v ? Number(v) : undefined;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Sidebar: failed to load persisted size', err);\n }\n return undefined;\n }\n },\n save: (size: number) => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, String(size));\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Sidebar: failed to save persisted size', err);\n }\n }\n },\n };\n return adapter;\n }, [paneId, persistence]);\n\n React.useEffect(() => {\n let mounted = true;\n (async () => {\n if (!resizable || !persistenceAdapter?.load || isOverlay) return;\n const loaded = await persistenceAdapter.load();\n if (mounted && typeof loaded === 'number' && localRef.current) {\n localRef.current.style.setProperty('--sidebar-size', `${loaded}px`);\n onResize?.(loaded);\n }\n })();\n return () => {\n mounted = false;\n };\n }, [resizable, persistenceAdapter, onResize, isOverlay]);\n\n // Register custom toggle behavior based on toggleModes (both|single)\n const shellForToggle = useShell();\n const resolveDefaultSidebarMode = React.useCallback((): SidebarMode => {\n const resolved = resolvedSidebarDefault ?? (typeof defaultState === 'string' ? defaultState : undefined) ?? 'expanded';\n return resolved === 'thin' || resolved === 'expanded' ? resolved : 'expanded';\n }, [resolvedSidebarDefault, defaultState]);\n\n React.useEffect(() => {\n if (!shellForToggle.setSidebarToggleComputer) return;\n const strategy: 'both' | 'single' = toggleModes ?? 'both';\n const compute = (current: SidebarMode): SidebarMode => {\n if (strategy === 'both') {\n if (current === 'collapsed') return 'thin';\n if (current === 'thin') return 'expanded';\n return 'collapsed';\n }\n const target = resolveDefaultSidebarMode();\n if (current === 'collapsed') return target;\n if (current === target) return 'collapsed';\n return target;\n };\n shellForToggle.setSidebarToggleComputer(compute);\n return () => {\n shellForToggle.setSidebarToggleComputer?.((cur) => (cur === 'collapsed' ? 'thin' : cur === 'thin' ? 'expanded' : 'collapsed'));\n };\n }, [shellForToggle, toggleModes, resolveDefaultSidebarMode]);\n\n const lastOverlayWidthRef = React.useRef<number>(expandedSize);\n const lastOverlayModeRef = React.useRef<SidebarMode>('expanded');\n React.useEffect(() => {\n if (shell.sidebarMode !== 'collapsed') {\n lastOverlayModeRef.current = shell.sidebarMode as SidebarMode;\n lastOverlayWidthRef.current = shell.sidebarMode === 'thin' ? thinSize : expandedSize;\n }\n }, [shell.sidebarMode, thinSize, expandedSize]);\n\n // Remove responsive default mode behavior entirely\n\n const handleEl =\n resizable && !isOverlay && shell.sidebarMode === 'expanded' ? (\n <PaneResizeContext.Provider\n value={{\n containerRef: localRef,\n cssVarName: '--sidebar-size',\n minSize,\n maxSize,\n defaultSize: expandedSize,\n orientation: 'vertical',\n edge: 'end',\n computeNext: (client, startClient, startSize) => {\n const isRtl = getComputedStyle(localRef.current!).direction === 'rtl';\n const delta = client - startClient;\n return startSize + (isRtl ? -delta : delta);\n },\n onResize,\n onResizeStart,\n onResizeEnd: (size) => {\n onResizeEnd?.(size);\n emitSizeChange(size, { reason: 'resize' });\n persistenceAdapter?.save?.(size);\n },\n target: 'sidebar',\n collapsible,\n snapPoints,\n snapTolerance: snapTolerance ?? 8,\n collapseThreshold,\n requestCollapse: () => shell.setSidebarMode('collapsed'),\n requestToggle: () => shell.togglePane('sidebar'),\n }}\n >\n {handleChildren.length > 0 ? handleChildren.map((el, i) => React.cloneElement(el, { key: el.key ?? i })) : <PaneHandle />}\n </PaneResizeContext.Provider>\n ) : null;\n\n // Normalize CSS lengths to px helper\n const normalizeSizeToPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, 'horizontal'), []);\n\n // Apply defaultSize on mount when uncontrolled\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof size === 'undefined' && typeof defaultSize !== 'undefined') {\n const px = normalizeSizeToPx(defaultSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--sidebar-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'init' });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size sync\n const controlledSize = size;\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof controlledSize === 'undefined') return;\n const px = normalizeSizeToPx(controlledSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--sidebar-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'controlled' });\n }\n }, [controlledSize, minSize, maxSize, normalizeSizeToPx, emitSizeChange]);\n\n if (isOverlay) {\n const open = shell.sidebarMode !== 'collapsed';\n return (\n <Sheet.Root open={open} onOpenChange={(o) => shell.setSidebarMode(o ? 'expanded' : 'collapsed')}>\n <Sheet.Content\n side=\"start\"\n style={{ padding: 0 }}\n width={{\n initial: `${open ? (shell.sidebarMode === 'thin' ? thinSize : expandedSize) : lastOverlayWidthRef.current}px`,\n }}\n >\n <VisuallyHidden>\n <Sheet.Title>Navigation</Sheet.Title>\n </VisuallyHidden>\n {contentChildren}\n </Sheet.Content>\n </Sheet.Root>\n );\n }\n return (\n <div\n {...sidebarDomProps}\n ref={setRef}\n className={classNames('rt-ShellSidebar', className)}\n data-mode={shell.sidebarMode}\n data-peek={shell.peekTarget === 'sidebar' || undefined}\n data-presentation={shell.currentBreakpointReady ? resolvedPresentation : undefined}\n data-open={(shell.currentBreakpointReady && isStacked && isContentVisible) || undefined}\n data-inset={inset || undefined}\n style={{\n ...style,\n ['--sidebar-size' as any]: `${expandedSize}px`,\n ['--sidebar-thin-size' as any]: `${thinSize}px`,\n ['--sidebar-min-size' as any]: `${minSize}px`,\n ['--sidebar-max-size' as any]: `${maxSize}px`,\n ...(shell.peekTarget === 'sidebar' && shell.sidebarMode === 'collapsed' && !isOverlay\n ? (() => {\n const strategy: 'both' | 'single' = toggleModes ?? 'both';\n const current = shell.sidebarMode as SidebarMode;\n let next: SidebarMode;\n if (strategy === 'both') {\n next = current === 'collapsed' ? 'thin' : current === 'thin' ? 'expanded' : 'collapsed';\n } else {\n const target = resolveDefaultSidebarMode();\n next = current === 'collapsed' ? target : 'collapsed';\n }\n if (next === 'thin') {\n return {\n ['--peek-sidebar-width' as any]: `${thinSize}px`,\n } as React.CSSProperties;\n }\n return {\n ['--peek-sidebar-width' as any]: `var(--sidebar-size, ${expandedSize}px)`,\n } as React.CSSProperties;\n })()\n : {}),\n }}\n >\n <div className=\"rt-ShellSidebarContent\" data-visible={isContentVisible || undefined}>\n {contentChildren}\n </div>\n {handleEl}\n </div>\n );\n}) as SidebarComponent;\n\nSidebar.displayName = 'Shell.Sidebar';\nSidebar.Handle = SidebarHandle;\n"],
|
|
5
|
-
"mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,OAAgB,aACvB,UAAYC,MAAW,cACvB,OAAS,kBAAAC,OAAs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ACnDuD,GAASvD,EAAM,YAClBwD,GAAgC,CAC/BF,EAAS,QAAUE,EACf,OAAOxC,GAAQ,WAAYA,EAAIwC,CAAI,EAC9BxC,IAAMA,EAAsD,QAAUwC,EACjF,EACA,CAACxC,CAAG,CACN,EACMyC,EAAazD,EAAM,SAAS,QAAQkC,EAAQ,EAC5CwB,EAAiBD,EAAW,OAAQE,GAA2B3D,EAAM,eAAe2D,CAAE,GAAKA,EAAG,OAASjD,CAAa,EACpHkD,EAAkBH,EAAW,OAAQE,GAA2B,EAAE3D,EAAM,eAAe2D,CAAE,GAAKA,EAAG,OAASjD,EAAc,EAGxHmD,EAAqB7D,EAAM,OAA6C,IAAI,EAElFA,EAAM,UAAU,IACP,IAAM,CACP6D,EAAmB,UACrB,aAAaA,EAAmB,OAAO,EACvCA,EAAmB,QAAU,KAEjC,EACC,CAAClB,EAAcC,EAAYC,CAAY,CAAC,EAE3C,MAAMiB,EAAiB9D,EAAM,QAAQ,IAAM,CACzC,MAAM+D,EAAKpB,EACLqB,EAAWpB,EACXqB,EAAKpB,GAAgB,GAC3B,GAAI,CAACkB,EAAI,MAAO,IAAM,CAAC,EACvB,GAAIC,IAAa,WACf,MAAO,CAACE,EAAWC,IAAuD,CACpEN,EAAmB,SAAS,aAAaA,EAAmB,OAAO,EACvEA,EAAmB,QAAU,WAAW,IAAM,CAC5CE,EAAGG,EAAGC,CAAI,EACVN,EAAmB,QAAU,IAC/B,EAAGI,CAAE,CACP,EAEF,GAAID,IAAa,WAAY,CAC3B,IAAII,EAAO,EACX,MAAO,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport * as Sheet from '../sheet.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { useShell, useInset } from '../shell.context.js';\nimport { useResponsivePresentation, useResponsiveInitialState } from '../shell.hooks.js';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { extractPaneDomProps } from './shell-prop-helpers.js';\nimport { SidebarHandle, PaneHandle } from './shell-handles.js';\nimport type { Breakpoint, PaneMode, PaneSizePersistence, ResponsivePresentation, SidebarMode, Responsive, PaneBaseProps, CSSPropertiesWithVars } from '../shell.types.js';\nimport { _BREAKPOINTS } from '../shell.types.js';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\n\ntype SidebarPaneProps = PaneBaseProps & {\n mode?: PaneMode;\n defaultMode?: any;\n onModeChange?: (mode: PaneMode | SidebarMode) => void;\n};\n\ntype SidebarStateChangeMeta = { reason: 'init' | 'toggle' | 'responsive' };\ntype SidebarControlledProps = { state: Responsive<SidebarMode>; onStateChange?: (state: SidebarMode, meta: SidebarStateChangeMeta) => void; defaultState?: never };\ntype SidebarUncontrolledProps = { defaultState?: SidebarMode | Partial<Record<Breakpoint, SidebarMode>>; onStateChange?: (state: SidebarMode, meta: SidebarStateChangeMeta) => void; state?: never };\ntype SidebarPublicProps = Omit<SidebarPaneProps, 'mode' | 'defaultMode' | 'onModeChange'> & {\n // removed legacy mode props\n thinSize?: number;\n toggleModes?: 'both' | 'single';\n // size API (width when expanded)\n size?: number | string;\n defaultSize?: number | string;\n onSizeChange?: (size: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /** When true, adds margin and triggers gray backdrop on Shell. */\n inset?: boolean;\n} & (SidebarControlledProps | SidebarUncontrolledProps);\n\ntype SidebarComponent = React.ForwardRefExoticComponent<SidebarPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof SidebarHandle };\n\nconst SIDEBAR_DOM_PROP_KEYS = [\n 'className',\n 'children',\n 'state',\n 'defaultState',\n 'onStateChange',\n 'thinSize',\n 'toggleModes',\n 'size',\n 'defaultSize',\n 'onSizeChange',\n 'sizeUpdate',\n 'sizeUpdateMs',\n 'style',\n 'inset',\n] as const satisfies readonly (keyof SidebarPublicProps)[];\n\nexport const Sidebar = React.forwardRef<HTMLDivElement, SidebarPublicProps>((initialProps, ref) => {\n const {\n className,\n presentation = { initial: 'overlay', md: 'fixed' },\n expandedSize = 288,\n minSize = 200,\n maxSize = 400,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n thinSize = 64,\n toggleModes,\n state,\n defaultState,\n onStateChange,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n inset,\n } = initialProps;\n const sidebarDomProps = extractPaneDomProps(initialProps, SIDEBAR_DOM_PROP_KEYS);\n const shell = useShell();\n const { registerInset, unregisterInset } = useInset();\n\n // Register/unregister inset\n React.useEffect(() => {\n if (inset) {\n registerInset('sidebar');\n return () => unregisterInset('sidebar');\n }\n }, [inset, registerInset, unregisterInset]);\n const resolvedPresentation = useResponsivePresentation(presentation);\n const isOverlay = resolvedPresentation === 'overlay';\n const isStacked = resolvedPresentation === 'stacked';\n // Phase sequencing is now CSS-driven; no JS-managed phase\n const localRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n localRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n const childArray = React.Children.toArray(children) as React.ReactElement[];\n const handleChildren = childArray.filter((el: React.ReactElement) => React.isValidElement(el) && el.type === SidebarHandle);\n const contentChildren = childArray.filter((el: React.ReactElement) => !(React.isValidElement(el) && el.type === SidebarHandle));\n\n // Ref for debounce cleanup\n const debounceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // Cleanup debounce timeout on unmount or when dependencies change\n React.useEffect(() => {\n return () => {\n if (debounceTimeoutRef.current) {\n clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = null;\n }\n };\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n // Throttled/debounced emitter for onSizeChange\n const emitSizeChange = React.useMemo(() => {\n const cb = onSizeChange as undefined | ((s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => void);\n const strategy = sizeUpdate as undefined | 'throttle' | 'debounce';\n const ms = sizeUpdateMs ?? 50;\n if (!cb) return () => {};\n if (strategy === 'debounce') {\n return (s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => {\n if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = setTimeout(() => {\n cb(s, meta);\n debounceTimeoutRef.current = null;\n }, ms);\n };\n }\n if (strategy === 'throttle') {\n let last = 0;\n return (s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => {\n const now = Date.now();\n if (now - last >= ms) {\n last = now;\n cb(s, meta);\n }\n };\n }\n return (s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => cb(s, meta);\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n\n // Register with shell\n const sidebarId = React.useId();\n React.useEffect(() => {\n shell.setHasSidebar(true);\n return () => {\n shell.setHasSidebar(false);\n };\n }, [shell, sidebarId]);\n\n // Dev guards\n const wasControlledRef = React.useRef<boolean | null>(null);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof state !== 'undefined' && typeof defaultState !== 'undefined') {\n console.error('Shell.Sidebar: Do not pass both `state` and `defaultState`. Choose one.');\n }\n if (typeof size !== 'undefined' && typeof defaultSize !== 'undefined') {\n console.error('Shell.Sidebar: Do not pass both `size` and `defaultSize`. Choose one.');\n }\n }\n\n // Warn on mode switch between controlled/uncontrolled\n React.useEffect(() => {\n const isControlled = typeof state !== 'undefined';\n if (wasControlledRef.current === null) {\n wasControlledRef.current = isControlled;\n return;\n }\n if (wasControlledRef.current !== isControlled) {\n console.warn('Shell.Sidebar: Switching between controlled and uncontrolled `state` is not supported.');\n wasControlledRef.current = isControlled;\n }\n }, [state]);\n\n // Resolve responsive controlled state at top level\n const stateIsResponsive = typeof state === 'object' && state !== null;\n const { resolvedDefault: resolvedSidebarDefault } = useResponsiveInitialState<SidebarMode>({\n controlledValue: state,\n defaultValue: defaultState,\n currentValue: shell.sidebarMode as SidebarMode,\n setValue: shell.setSidebarMode,\n breakpointReady: shell.currentBreakpointReady,\n controlledIsResponsive: stateIsResponsive,\n onResponsiveChange: (next) => onStateChange?.(next, { reason: 'responsive' }),\n onInit: (initial) => onStateChange?.(initial, { reason: 'init' }),\n });\n\n // Emit mode changes\n const lastNotifyModeRef = React.useRef<SidebarMode | null>(null);\n React.useEffect(() => {\n // notify new API when uncontrolled; skip first run to avoid masking init\n if (typeof state === 'undefined') {\n if (lastNotifyModeRef.current === null) {\n lastNotifyModeRef.current = shell.sidebarMode as SidebarMode;\n } else if (lastNotifyModeRef.current !== shell.sidebarMode) {\n lastNotifyModeRef.current = shell.sidebarMode as SidebarMode;\n onStateChange?.(shell.sidebarMode as SidebarMode, { reason: 'toggle' });\n }\n }\n }, [shell.sidebarMode, state, onStateChange]);\n\n // Track previous mode to only fire callbacks on actual user-initiated state transitions.\n // We wait for breakpointReady to ensure the initial state sync from useResponsiveInitialState\n // is complete before enabling callbacks. This avoids spurious callbacks during initialization.\n // Use callback refs to avoid re-running effect when inline callbacks change.\n const onExpandRef = React.useRef(onExpand);\n const onCollapseRef = React.useRef(onCollapse);\n React.useLayoutEffect(() => {\n onExpandRef.current = onExpand;\n onCollapseRef.current = onCollapse;\n });\n\n const prevSidebarModeRef = React.useRef<SidebarMode | null>(null);\n const hasInitializedRef = React.useRef(false);\n React.useEffect(() => {\n const currentMode = shell.sidebarMode as SidebarMode;\n\n // Wait for breakpoint to be ready before enabling callbacks\n if (!shell.currentBreakpointReady) {\n prevSidebarModeRef.current = currentMode;\n return;\n }\n\n // Skip the first run after breakpoint is ready - this captures the post-sync state\n if (!hasInitializedRef.current) {\n hasInitializedRef.current = true;\n prevSidebarModeRef.current = currentMode;\n return;\n }\n\n const prevMode = prevSidebarModeRef.current;\n\n // Only fire on actual state transitions\n if (prevMode !== null && prevMode !== currentMode) {\n // onExpand: when becoming visible (collapsed \u2192 thin/expanded)\n if (prevMode === 'collapsed' && currentMode !== 'collapsed') {\n onExpandRef.current?.();\n }\n // onCollapse: when becoming hidden (any \u2192 collapsed)\n else if (currentMode === 'collapsed') {\n onCollapseRef.current?.();\n }\n prevSidebarModeRef.current = currentMode;\n }\n }, [shell.sidebarMode, shell.currentBreakpointReady]);\n\n // Option A: thin is width-only; content remains visible whenever not collapsed\n const isContentVisible = shell.sidebarMode !== 'collapsed';\n\n // Default persistence if paneId provided and none supplied (fixed only)\n const persistenceAdapter = React.useMemo(() => {\n if (!paneId || persistence) return persistence;\n const key = `kookie-ui:shell:sidebar:${paneId}`;\n const adapter: PaneSizePersistence = {\n load: () => {\n if (typeof window === 'undefined') return undefined;\n try {\n const v = window.localStorage.getItem(key);\n return v ? Number(v) : undefined;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Sidebar: failed to load persisted size', err);\n }\n return undefined;\n }\n },\n save: (size: number) => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, String(size));\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Sidebar: failed to save persisted size', err);\n }\n }\n },\n };\n return adapter;\n }, [paneId, persistence]);\n\n React.useEffect(() => {\n let mounted = true;\n (async () => {\n if (!resizable || !persistenceAdapter?.load || isOverlay) return;\n const loaded = await persistenceAdapter.load();\n if (mounted && typeof loaded === 'number' && localRef.current) {\n localRef.current.style.setProperty('--sidebar-size', `${loaded}px`);\n onResize?.(loaded);\n }\n })();\n return () => {\n mounted = false;\n };\n }, [resizable, persistenceAdapter, onResize, isOverlay]);\n\n // Register custom toggle behavior based on toggleModes (both|single)\n const shellForToggle = useShell();\n const resolveDefaultSidebarMode = React.useCallback((): SidebarMode => {\n const resolved = resolvedSidebarDefault ?? (typeof defaultState === 'string' ? defaultState : undefined) ?? 'expanded';\n return resolved === 'thin' || resolved === 'expanded' ? resolved : 'expanded';\n }, [resolvedSidebarDefault, defaultState]);\n\n React.useEffect(() => {\n if (!shellForToggle.setSidebarToggleComputer) return;\n const strategy: 'both' | 'single' = toggleModes ?? 'both';\n const compute = (current: SidebarMode): SidebarMode => {\n if (strategy === 'both') {\n if (current === 'collapsed') return 'thin';\n if (current === 'thin') return 'expanded';\n return 'collapsed';\n }\n const target = resolveDefaultSidebarMode();\n if (current === 'collapsed') return target;\n if (current === target) return 'collapsed';\n return target;\n };\n shellForToggle.setSidebarToggleComputer(compute);\n return () => {\n shellForToggle.setSidebarToggleComputer?.((cur) => (cur === 'collapsed' ? 'thin' : cur === 'thin' ? 'expanded' : 'collapsed'));\n };\n }, [shellForToggle, toggleModes, resolveDefaultSidebarMode]);\n\n const lastOverlayWidthRef = React.useRef<number>(expandedSize);\n const lastOverlayModeRef = React.useRef<SidebarMode>('expanded');\n React.useEffect(() => {\n if (shell.sidebarMode !== 'collapsed') {\n lastOverlayModeRef.current = shell.sidebarMode as SidebarMode;\n lastOverlayWidthRef.current = shell.sidebarMode === 'thin' ? thinSize : expandedSize;\n }\n }, [shell.sidebarMode, thinSize, expandedSize]);\n\n // Remove responsive default mode behavior entirely\n\n const handleEl =\n resizable && !isOverlay && shell.sidebarMode === 'expanded' ? (\n <PaneResizeContext.Provider\n value={{\n containerRef: localRef,\n cssVarName: '--sidebar-size',\n minSize,\n maxSize,\n defaultSize: expandedSize,\n orientation: 'vertical',\n edge: 'end',\n computeNext: (client, startClient, startSize) => {\n const isRtl = getComputedStyle(localRef.current!).direction === 'rtl';\n const delta = client - startClient;\n return startSize + (isRtl ? -delta : delta);\n },\n onResize,\n onResizeStart,\n onResizeEnd: (size) => {\n onResizeEnd?.(size);\n emitSizeChange(size, { reason: 'resize' });\n persistenceAdapter?.save?.(size);\n },\n target: 'sidebar',\n collapsible,\n snapPoints,\n snapTolerance: snapTolerance ?? 8,\n collapseThreshold,\n requestCollapse: () => shell.setSidebarMode('collapsed'),\n requestToggle: () => shell.togglePane('sidebar'),\n }}\n >\n {handleChildren.length > 0 ? handleChildren.map((el, i) => React.cloneElement(el, { key: el.key ?? i })) : <PaneHandle />}\n </PaneResizeContext.Provider>\n ) : null;\n\n // Normalize CSS lengths to px helper\n const normalizeSizeToPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, 'horizontal'), []);\n\n // Apply defaultSize on mount when uncontrolled\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof size === 'undefined' && typeof defaultSize !== 'undefined') {\n const px = normalizeSizeToPx(defaultSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--sidebar-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'init' });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size sync\n const controlledSize = size;\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof controlledSize === 'undefined') return;\n const px = normalizeSizeToPx(controlledSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--sidebar-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'controlled' });\n }\n }, [controlledSize, minSize, maxSize, normalizeSizeToPx, emitSizeChange]);\n\n if (isOverlay) {\n const open = shell.sidebarMode !== 'collapsed';\n return (\n <Sheet.Root open={open} onOpenChange={(o) => shell.setSidebarMode(o ? 'expanded' : 'collapsed')}>\n <Sheet.Content\n side=\"start\"\n style={{ padding: 0 }}\n width={{\n initial: `${open ? (shell.sidebarMode === 'thin' ? thinSize : expandedSize) : lastOverlayWidthRef.current}px`,\n }}\n >\n <VisuallyHidden>\n <Sheet.Title>Navigation</Sheet.Title>\n </VisuallyHidden>\n {contentChildren}\n </Sheet.Content>\n </Sheet.Root>\n );\n }\n return (\n <div\n {...sidebarDomProps}\n ref={setRef}\n className={classNames('rt-ShellSidebar', className)}\n data-mode={shell.sidebarMode}\n data-peek={shell.peekTarget === 'sidebar' || undefined}\n data-presentation={shell.currentBreakpointReady ? resolvedPresentation : undefined}\n data-open={(shell.currentBreakpointReady && isStacked && isContentVisible) || undefined}\n data-inset={inset || undefined}\n style={{\n ...style,\n '--sidebar-size': `${expandedSize}px`,\n '--sidebar-thin-size': `${thinSize}px`,\n '--sidebar-min-size': `${minSize}px`,\n '--sidebar-max-size': `${maxSize}px`,\n ...(shell.peekTarget === 'sidebar' && shell.sidebarMode === 'collapsed' && !isOverlay\n ? (() => {\n const strategy: 'both' | 'single' = toggleModes ?? 'both';\n const current = shell.sidebarMode as SidebarMode;\n let next: SidebarMode;\n if (strategy === 'both') {\n next = current === 'collapsed' ? 'thin' : current === 'thin' ? 'expanded' : 'collapsed';\n } else {\n const target = resolveDefaultSidebarMode();\n next = current === 'collapsed' ? target : 'collapsed';\n }\n if (next === 'thin') {\n return {\n '--peek-sidebar-width': `${thinSize}px`,\n } as CSSPropertiesWithVars;\n }\n return {\n '--peek-sidebar-width': `var(--sidebar-size, ${expandedSize}px)`,\n } as CSSPropertiesWithVars;\n })()\n : {}),\n } as CSSPropertiesWithVars}\n >\n <div className=\"rt-ShellSidebarContent\" data-visible={isContentVisible || undefined}>\n {contentChildren}\n </div>\n {handleEl}\n </div>\n );\n}) as SidebarComponent;\n\nSidebar.displayName = 'Shell.Sidebar';\nSidebar.Handle = SidebarHandle;\n"],
|
|
5
|
+
"mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,OAAgB,aACvB,UAAYC,MAAW,cACvB,OAAS,kBAAAC,OAAsB,wBAC/B,OAAS,YAAAC,GAAU,YAAAC,OAAgB,sBACnC,OAAS,6BAAAC,GAA2B,6BAAAC,OAAiC,oBACrE,OAAS,qBAAAC,OAAyB,oBAClC,OAAS,uBAAAC,OAA2B,0BACpC,OAA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E,IAAM,CACL,MAAMY,EAA8B3B,GAAe,OAC7CyD,EAAU9C,EAAM,YACtB,IAAI2B,EACJ,GAAIX,IAAa,OACfW,EAAOmB,IAAY,YAAc,OAASA,IAAY,OAAS,WAAa,gBACvE,CACL,MAAMC,EAASJ,EAA0B,EACzChB,EAAOmB,IAAY,YAAcC,EAAS,WAC5C,CACA,OAAIpB,IAAS,OACJ,CACL,uBAAwB,GAAGvC,CAAQ,IACrC,EAEK,CACL,uBAAwB,uBAAuBjB,CAAY,KAC7D,CACF,GAAG,EACH,CAAC,CACP,GAEAnB,EAAA,cAAC,OAAI,UAAU,yBAAyB,eAAcoF,GAAoB,QACvExB,CACH,EACCuC,EACH,CAEJ,CAAC,EAEDrF,GAAQ,YAAc,gBACtBA,GAAQ,OAASJ",
|
|
6
6
|
"names": ["React", "classNames", "Sheet", "VisuallyHidden", "useShell", "useInset", "useResponsivePresentation", "useResponsiveInitialState", "PaneResizeContext", "extractPaneDomProps", "SidebarHandle", "PaneHandle", "normalizeToPx", "SIDEBAR_DOM_PROP_KEYS", "Sidebar", "initialProps", "ref", "className", "presentation", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "thinSize", "toggleModes", "state", "defaultState", "onStateChange", "size", "defaultSize", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "inset", "sidebarDomProps", "shell", "registerInset", "unregisterInset", "resolvedPresentation", "isOverlay", "isStacked", "localRef", "setRef", "node", "childArray", "handleChildren", "el", "contentChildren", "debounceTimeoutRef", "emitSizeChange", "cb", "strategy", "ms", "s", "meta", "last", "now", "sidebarId", "wasControlledRef", "isControlled", "stateIsResponsive", "resolvedSidebarDefault", "next", "initial", "lastNotifyModeRef", "onExpandRef", "onCollapseRef", "prevSidebarModeRef", "hasInitializedRef", "currentMode", "prevMode", "isContentVisible", "persistenceAdapter", "key", "v", "mounted", "loaded", "shellForToggle", "resolveDefaultSidebarMode", "resolved", "compute", "current", "target", "cur", "lastOverlayWidthRef", "lastOverlayModeRef", "handleEl", "client", "startClient", "startSize", "isRtl", "delta", "i", "normalizeSizeToPx", "value", "px", "clamped", "controlledSize", "open", "o"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../src/components/combobox.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAGnD,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAK7G,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../src/components/combobox.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAGnD,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAK7G,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,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I,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAChH,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAyBD,QAAA,MAAM,YAAY,0FAuEhB,CAAC;AAGH,OAAO,EACL,YAAY,IAAI,IAAI,EACpB,eAAe,IAAI,OAAO,EAC1B,aAAa,IAAI,KAAK,EACtB,eAAe,IAAI,OAAO,EAC1B,aAAa,IAAI,KAAK,EACtB,YAAY,IAAI,IAAI,EACpB,aAAa,IAAI,KAAK,EACtB,aAAa,IAAI,KAAK,EACtB,aAAa,IAAI,KAAK,EACtB,iBAAiB,IAAI,SAAS,EAC9B,YAAY,IAAI,IAAI,GACrB,CAAC;AACF,YAAY,EACV,iBAAiB,IAAI,SAAS,EAC9B,oBAAoB,IAAI,YAAY,EACpC,kBAAkB,IAAI,UAAU,EAChC,oBAAoB,IAAI,YAAY,EACpC,kBAAkB,IAAI,UAAU,EAChC,iBAAiB,IAAI,SAAS,EAC9B,kBAAkB,IAAI,UAAU,EAChC,kBAAkB,IAAI,UAAU,EAChC,kBAAkB,IAAI,UAAU,EAChC,sBAAsB,IAAI,cAAc,EACxC,iBAAiB,IAAI,SAAS,GAC/B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import*as
|
|
1
|
+
"use client";import*as o from"react";import p from"classnames";import{useControllableState as B}from"radix-ui/internal";import{Command as R}from"cmdk";import{extractProps as oo}from"../helpers/extract-props.js";import{comboboxRootPropDefs as D,comboboxTriggerPropDefs as Io,comboboxContentPropDefs as M}from"./combobox.props.js";import{marginPropDefs as So}from"../props/margin.props.js";import{ChevronDownIcon as Vo,ThickCheckIcon as Eo}from"./icons.js";import{Theme as Ro,useThemeContext as No}from"./theme.js";import{requireReactElement as To}from"../helpers/require-react-element.js";import*as W from"./popover.js";import{ScrollArea as Lo}from"./scroll-area.js";import{Slottable as wo}from"./slot.js";import"./text-field.props.js";const Do=/^rt-r-size-\d$/,eo=o.createContext(null),to=o.createContext(null),no=o.createContext(null),ro=o.createContext(null),N=e=>{const t=o.useContext(eo);if(!t)throw new Error(`${e} must be used within Combobox.Root`);return t},O=e=>{const t=o.useContext(to);if(!t)throw new Error(`${e} must be used within Combobox.Root`);return t},ao=e=>{const t=o.useContext(no);if(!t)throw new Error(`${e} must be used within Combobox.Root`);return t},$=e=>{const t=o.useContext(ro);if(!t)throw new Error(`${e} must be used within Combobox.Root`);return t},qo=e=>{const t=N(e),n=O(e),r=ao(e),i=$(e);return{...t,...n,...r,...i}},so=o.createContext(null),io=()=>o.useContext(so),lo=e=>{const{children:t,size:n=D.size.default,highContrast:r=D.highContrast.default,value:i,defaultValue:s=null,onValueChange:l,open:b,defaultOpen:a=!1,onOpenChange:u,placeholder:c="Select an option",searchPlaceholder:m="Search options...",searchValue:x,defaultSearchValue:f="",onSearchValueChange:C,filter:g,shouldFilter:h=!0,loop:d=!0,disabled:y,resetSearchOnSelect:I=!0,color:V,displayValue:P,...T}=e,E=`combobox-listbox-${o.useId()}`,[H,_]=o.useState(void 0),[k,L]=B({prop:b,defaultProp:a,onChange:u}),[v,q]=B({prop:i,defaultProp:s,onChange:l}),[K,w]=B({prop:x,defaultProp:f,onChange:C}),F=o.useRef(new Map),[X,G]=o.useState(void 0),Z=o.useCallback((S,Y)=>{F.current.set(S,Y),S===v&&G(Y)},[v]),J=o.useCallback(S=>{F.current.delete(S)},[]);o.useEffect(()=>{if(v!=null){const S=F.current.get(v);G(S)}else G(void 0)},[v]);const Q=o.useCallback(S=>{q(S),L(!1),I&&w("")},[L,w,q,I]);o.useEffect(()=>{},[v]);const U=o.useMemo(()=>{if(P!=null)return typeof P=="function"?P(v):P},[P,v]),ho=o.useMemo(()=>({size:n,highContrast:r,placeholder:c,searchPlaceholder:m,filter:g,shouldFilter:h,loop:d,disabled:y,resetSearchOnSelect:I,color:V,listboxId:E}),[n,r,c,m,g,h,d,y,I,V,E]),Po=o.useMemo(()=>({open:k,setOpen:L,value:v,selectedLabel:X,resolvedDisplayValue:U,registerItemLabel:Z,unregisterItemLabel:J,handleSelect:Q}),[k,L,v,X,U,Z,J,Q]),vo=o.useMemo(()=>({searchValue:K,setSearchValue:w}),[K,w]),yo=o.useMemo(()=>({activeDescendantId:H,setActiveDescendantId:_}),[H,_]);return o.createElement(eo.Provider,{value:ho},o.createElement(to.Provider,{value:Po},o.createElement(no.Provider,{value:vo},o.createElement(ro.Provider,{value:yo},o.createElement(W.Root,{open:k,onOpenChange:L,...T},t)))))};lo.displayName="Combobox.Root";const mo=o.forwardRef((e,t)=>{const n=N("Combobox.Trigger"),r=O("Combobox.Trigger"),i=$("Combobox.Trigger"),{children:s,className:l,placeholder:b,disabled:a,readOnly:u,error:c,loading:m,color:x,radius:f,...C}=oo({size:n.size,highContrast:n.highContrast,...e},{size:D.size,highContrast:D.highContrast},Io,So),{material:g,panelBackground:h}=e,d=a??n.disabled,y=x??n.color,I=o.useMemo(()=>({role:"combobox","aria-expanded":r.open,"aria-disabled":d||void 0,"aria-haspopup":"listbox","aria-controls":r.open?n.listboxId:void 0,"aria-activedescendant":r.open?i.activeDescendantId:void 0,"aria-autocomplete":"list"}),[r.open,n.listboxId,i.activeDescendantId,d]),V=o.createElement(o.Fragment,null,o.createElement("span",{className:"rt-SelectTriggerInner"},o.createElement(A,{placeholder:b??n.placeholder})),m?o.createElement("div",{className:"rt-SelectIcon rt-SelectLoadingIcon","aria-hidden":"true"},o.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},o.createElement("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeDasharray:"6 34",strokeDashoffset:"0",className:"rt-SelectLoadingSpinner"}))):o.createElement(Vo,{className:"rt-SelectIcon"})),{type:P,...T}=C,E=o.createElement("button",{"data-accent-color":y,"data-radius":f,"data-panel-background":h,"data-material":g,"data-error":c,"data-loading":m,"data-disabled":d||void 0,"data-read-only":u||void 0,...T,...I,type:P??"button",disabled:d,ref:t,className:p("rt-reset","rt-SelectTrigger","rt-ComboboxTrigger",l)},s?To(s):V);return o.createElement(W.Trigger,{disabled:d},E)});mo.displayName="Combobox.Trigger";const A=o.forwardRef(({placeholder:e,children:t,className:n,...r},i)=>{const s=N("Combobox.Value"),l=O("Combobox.Value"),b=l.resolvedDisplayValue??l.selectedLabel??l.value??void 0,a=e??s.placeholder;return o.createElement("span",{...r,ref:i,className:p("rt-ComboboxValue",n)},b??t??a)});A.displayName="Combobox.Value";const bo=o.forwardRef((e,t)=>{const n=N("Combobox.Content"),r=No(),i=r.panelBackground,s=e.size??n.size??M.size.default,l=e.variant??M.variant.default,b=e.highContrast??n.highContrast??M.highContrast.default,{className:a,children:u,color:c,forceMount:m,container:x,...f}=oo({...e,size:s,variant:l,highContrast:b},M),C=c||n.color||r.accentColor,g=o.useMemo(()=>typeof s!="string"?a:a?.split(/\s+/).filter(Boolean).filter(d=>!Do.test(d)).join(" ")||void 0,[a,s]),h=m===!0?!0:void 0;return o.createElement(W.Content,{size:s,"data-accent-color":C,"data-material":i,"data-panel-background":i,align:"start",sideOffset:4,collisionPadding:10,...f,forceMount:h,container:x,ref:t,className:p("rt-PopperContent","rt-BaseMenuContent","rt-ComboboxContent",g)},o.createElement(Ro,{asChild:!0},o.createElement(so.Provider,{value:{variant:l,size:String(s),color:C,material:i,highContrast:b}},o.createElement(R,{loop:n.loop,shouldFilter:n.shouldFilter,filter:n.filter,className:"rt-ComboboxCommand"},u))))});bo.displayName="Combobox.Content";const co=o.forwardRef(({className:e,startAdornment:t,endAdornment:n,placeholder:r,variant:i,value:s,onValueChange:l,...b},a)=>{const u=N("Combobox.Input"),c=ao("Combobox.Input"),m=io(),x=m?.variant??"solid",f=m?.color,C=m?.material,g=i??(x==="solid"?"surface":"soft"),h=s??c.searchValue,d=l??c.setSearchValue,y=o.createElement("div",{className:p("rt-TextFieldRoot","rt-ComboboxInputRoot",`rt-r-size-${u.size}`,`rt-variant-${g}`),"data-accent-color":f,"data-material":C,"data-panel-background":C},t?o.createElement("div",{className:"rt-TextFieldSlot"},t):null,o.createElement(R.Input,{...b,ref:a,value:h,onValueChange:d,placeholder:r??u.searchPlaceholder,className:p("rt-reset","rt-TextFieldInput",e)}),n?o.createElement("div",{className:"rt-TextFieldSlot","data-side":"right"},n):null);return m?o.createElement("div",{className:"rt-ComboboxSearch"},y):y});co.displayName="Combobox.Input";const po=o.forwardRef(({className:e,...t},n)=>{const r=N("Combobox.List"),i=$("Combobox.List"),s=o.useRef(null),l=o.useCallback(a=>{s.current=a,typeof n=="function"?n(a):n&&(n.current=a)},[n]),{setActiveDescendantId:b}=i;return o.useEffect(()=>{const a=s.current;if(!a)return;const u=()=>{const x=a.querySelector('[data-selected="true"], [aria-selected="true"]')?.id;b(x||void 0)};u();const c=new MutationObserver(u);return c.observe(a,{attributes:!0,attributeFilter:["data-selected","aria-selected"],subtree:!0}),()=>c.disconnect()},[b]),o.createElement(Lo,{type:"auto",className:"rt-ComboboxScrollArea",scrollbars:"vertical",size:"1"},o.createElement("div",{className:p("rt-BaseMenuViewport","rt-ComboboxViewport")},o.createElement(R.List,{...t,ref:l,id:r.listboxId,role:"listbox","aria-label":"Options",className:p("rt-ComboboxList",e)})))});po.displayName="Combobox.List";const uo=o.forwardRef(({className:e,...t},n)=>o.createElement(R.Empty,{...t,ref:n,className:p("rt-ComboboxEmpty",e)}));uo.displayName="Combobox.Empty";const Co=o.forwardRef(({className:e,...t},n)=>o.createElement(R.Group,{...t,ref:n,className:p("rt-BaseMenuGroup","rt-ComboboxGroup",e)}));Co.displayName="Combobox.Group";const xo=o.forwardRef(({className:e,...t},n)=>o.createElement("div",{...t,ref:n,className:p("rt-BaseMenuLabel","rt-ComboboxLabel",e)}));xo.displayName="Combobox.Label";const fo=o.forwardRef(({className:e,...t},n)=>o.createElement(R.Separator,{...t,ref:n,className:p("rt-BaseMenuSeparator","rt-ComboboxSeparator",e)}));fo.displayName="Combobox.Separator";function j(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e);if(e==null||typeof e=="boolean")return"";if(Array.isArray(e))return e.map(j).filter(Boolean).join(" ");if(o.isValidElement(e)){const t=e.props;if(t.children)return j(t.children)}return""}const go=o.forwardRef(({className:e,children:t,label:n,value:r,disabled:i,onSelect:s,keywords:l,...b},a)=>{const u=N("Combobox.Item"),c=O("Combobox.Item"),m=io(),x=o.useMemo(()=>j(t),[t]),f=n??(x||String(r)),C=r!=null&&c.value===r,g=m?.size?`rt-r-size-${m.size}`:void 0,h=l??[f],y=`combobox-item-${o.useId()}`,{registerItemLabel:I,unregisterItemLabel:V,handleSelect:P}=c;o.useEffect(()=>{if(r)return I(r,f),()=>V(r)},[I,V,r,f]);const T=o.useCallback(E=>{P(E),s?.(E)},[P,s]),z=i??u.disabled??!1;return o.createElement(R.Item,{...b,id:y,value:r,keywords:h,role:"option","aria-selected":C,...z?{disabled:!0,"aria-disabled":!0}:{},ref:a,onSelect:T,className:p("rt-reset","rt-BaseMenuItem","rt-ComboboxItem",e)},C?o.createElement("span",{className:p("rt-BaseMenuItemIndicator","rt-ComboboxItemIndicator",g)},o.createElement(Eo,{className:p("rt-BaseMenuItemIndicatorIcon","rt-ComboboxItemIndicatorIcon",g)})):null,o.createElement(wo,null,t))});go.displayName="Combobox.Item";export{bo as Content,uo as Empty,Co as Group,co as Input,go as Item,xo as Label,po as List,lo as Root,fo as Separator,mo as Trigger,A as Value};
|
|
2
2
|
//# sourceMappingURL=combobox.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/combobox.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\n/**\n * Combobox is a compound component built on top of Popover and cmdk's Command list.\n * It mirrors the Select API while adding search-first behaviors including filtering,\n * async-friendly state management, and design token support for trigger, content,\n * and input variants.\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { useControllableState } from 'radix-ui/internal';\nimport { Command as CommandPrimitive } from 'cmdk';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { comboboxRootPropDefs, comboboxTriggerPropDefs, comboboxContentPropDefs } from './combobox.props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\nimport { ChevronDownIcon, ThickCheckIcon } from './icons.js';\nimport { Theme, useThemeContext } from './theme.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport * as Popover from './popover.js';\nimport { ScrollArea } from './scroll-area.js';\nimport { Slottable } from './slot.js';\nimport { textFieldRootPropDefs } from './text-field.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype TextFieldVariant = (typeof textFieldRootPropDefs.variant.values)[number];\ntype ComboboxValue = string | null;\n/**\n * Custom filter function for Combobox search.\n * @param value - The item's value being tested\n * @param search - The current search string\n * @param keywords - Optional keywords associated with the item\n * @returns A number between 0 and 1 where 0 means no match and 1 means exact match.\n * Fractional values indicate relevance for sorting.\n */\ntype CommandFilter = (value: string, search: string, keywords?: string[]) => number;\n\n/**\n * Additional props supported by Combobox.Root beyond the Radix Popover surface.\n */\ntype ComboboxRootOwnProps = GetPropDefTypes<typeof comboboxRootPropDefs> & {\n value?: ComboboxValue;\n defaultValue?: ComboboxValue;\n onValueChange?: (value: ComboboxValue) => void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n placeholder?: string;\n searchPlaceholder?: string;\n searchValue?: string;\n defaultSearchValue?: string;\n onSearchValueChange?: (value: string) => void;\n filter?: CommandFilter;\n shouldFilter?: boolean;\n loop?: boolean;\n disabled?: boolean;\n /**\n * Whether to reset the search value when an option is selected.\n * @default true\n */\n resetSearchOnSelect?: boolean;\n /**\n * Accent color for the combobox trigger and content.\n */\n color?: (typeof comboboxTriggerPropDefs.color.values)[number];\n /**\n * Display value shown in the trigger. This is the recommended approach for\n * best performance as it avoids needing to mount items to register labels.\n * \n * Can be either:\n * - A string: Static display value\n * - A function: `(value: string | null) => string | undefined` - Called with current value\n * \n * Use this when:\n * - You have the selected item's label available (e.g., from your data source)\n * - Items haven't mounted yet (e.g., on initial render with a defaultValue)\n * - You want optimal performance with forceMount={false} (default)\n * \n * @example\n * // Static string\n * <Combobox.Root value=\"usa\" displayValue=\"United States\">\n * \n * // Function (recommended for dynamic data)\n * <Combobox.Root \n * value={selectedCountry}\n * displayValue={(value) => countries.find(c => c.code === value)?.name}\n * >\n * \n * If not provided, falls back to the label registered by the selected item\n * (requires forceMount={true}), then to the raw value.\n */\n displayValue?: string | ((value: ComboboxValue) => string | undefined);\n};\n\n/**\n * Internal context shared by all sub-components to avoid prop drilling.\n */\ninterface ComboboxContextValue extends ComboboxRootOwnProps {\n open: boolean;\n setOpen: (open: boolean) => void;\n value: ComboboxValue;\n setValue: (value: ComboboxValue) => void;\n searchValue: string;\n setSearchValue: (value: string) => void;\n /** Label registered by the selected item */\n selectedLabel?: string;\n /** Resolved display value (already computed from string or function) */\n resolvedDisplayValue?: string;\n registerItemLabel: (value: string, label: string) => void;\n unregisterItemLabel: (value: string) => void;\n handleSelect: (value: string) => void;\n listboxId: string;\n activeDescendantId: string | undefined;\n setActiveDescendantId: (id: string | undefined) => void;\n}\n\nconst ComboboxContext = React.createContext<ComboboxContextValue | null>(null);\n\n/**\n * Utility hook that ensures consumers are wrapped in Combobox.Root.\n */\nconst useComboboxContext = (caller: string) => {\n const ctx = React.useContext(ComboboxContext);\n if (!ctx) {\n throw new Error(`${caller} must be used within Combobox.Root`);\n }\n return ctx;\n};\n\n/**\n * Context for values that are only available inside Content (e.g., variant, color)\n * so that Input/Item can style themselves consistently.\n */\nconst ComboboxContentContext = React.createContext<{ variant: 'solid' | 'soft'; size?: string; color?: string; material?: string; highContrast?: boolean } | null>(null);\nconst useComboboxContentContext = () => {\n const ctx = React.useContext(ComboboxContentContext);\n return ctx; // Optional - Input might not always be in Content\n};\n\ntype PopoverRootProps = React.ComponentPropsWithoutRef<typeof Popover.Root>;\ninterface ComboboxRootProps extends PopoverRootProps, ComboboxRootOwnProps {}\n/**\n * Root component that wires up Popover behavior, controllable state,\n * and shared context for trigger/content/input sub-components.\n */\nconst ComboboxRoot: React.FC<ComboboxRootProps> = (props) => {\n const {\n children,\n size = comboboxRootPropDefs.size.default,\n highContrast = comboboxRootPropDefs.highContrast.default,\n value: valueProp,\n defaultValue = null,\n onValueChange,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n placeholder = 'Select an option',\n searchPlaceholder = 'Search options...',\n searchValue: searchValueProp,\n defaultSearchValue = '',\n onSearchValueChange,\n filter,\n shouldFilter = true,\n loop = true,\n disabled,\n resetSearchOnSelect = true,\n color,\n displayValue: displayValueProp,\n ...rootProps\n } = props;\n\n // Generate stable IDs for accessibility\n const generatedId = React.useId();\n const listboxId = `combobox-listbox-${generatedId}`;\n const [activeDescendantId, setActiveDescendantId] = React.useState<string | undefined>(undefined);\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n const [value, setValue] = useControllableState<ComboboxValue>({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const [searchValue, setSearchValue] = useControllableState<string>({\n prop: searchValueProp,\n defaultProp: defaultSearchValue,\n onChange: onSearchValueChange,\n });\n\n const labelMapRef = React.useRef(new Map<string, string>());\n // Track the selected label in state so it triggers re-renders when items register\n const [selectedLabel, setSelectedLabel] = React.useState<string | undefined>(undefined);\n\n const registerItemLabel = React.useCallback((itemValue: string, label: string) => {\n labelMapRef.current.set(itemValue, label);\n // If this item matches the current value, update the selected label\n if (itemValue === value) {\n setSelectedLabel(label);\n }\n }, [value]);\n\n const unregisterItemLabel = React.useCallback((itemValue: string) => {\n labelMapRef.current.delete(itemValue);\n }, []);\n\n // Update selected label when value changes\n React.useEffect(() => {\n if (value != null) {\n const label = labelMapRef.current.get(value);\n setSelectedLabel(label);\n } else {\n setSelectedLabel(undefined);\n }\n }, [value]);\n\n const handleSelect = React.useCallback(\n (nextValue: string) => {\n setValue(nextValue);\n setOpen(false);\n if (resetSearchOnSelect) {\n setSearchValue('');\n }\n },\n [setOpen, setSearchValue, setValue, resetSearchOnSelect],\n );\n\n // Development mode warning for value not matching any registered item\n React.useEffect(() => {\n if (process.env.NODE_ENV !== 'production' && value != null && !labelMapRef.current.has(value)) {\n // Defer the check to allow items to register first\n const timeoutId = setTimeout(() => {\n if (value != null && !labelMapRef.current.has(value)) {\n console.warn(\n `[Combobox] The value \"${value}\" does not match any Combobox.Item. ` +\n `Make sure each Item has a matching value prop.`,\n );\n }\n }, 0);\n return () => clearTimeout(timeoutId);\n }\n }, [value]);\n\n // Resolve displayValue: compute if function, use directly if string\n const resolvedDisplayValue = React.useMemo(() => {\n if (displayValueProp == null) return undefined;\n if (typeof displayValueProp === 'function') {\n return displayValueProp(value);\n }\n return displayValueProp;\n }, [displayValueProp, value]);\n\n const contextValue = React.useMemo<ComboboxContextValue>(\n () => ({\n size,\n highContrast,\n placeholder,\n searchPlaceholder,\n filter,\n shouldFilter,\n loop,\n disabled,\n resetSearchOnSelect,\n color,\n resolvedDisplayValue,\n open,\n setOpen,\n value,\n setValue,\n searchValue,\n setSearchValue,\n selectedLabel,\n registerItemLabel,\n unregisterItemLabel,\n handleSelect,\n listboxId,\n activeDescendantId,\n setActiveDescendantId,\n }),\n [\n size,\n highContrast,\n placeholder,\n searchPlaceholder,\n filter,\n shouldFilter,\n loop,\n disabled,\n resetSearchOnSelect,\n color,\n resolvedDisplayValue,\n open,\n setOpen,\n value,\n setValue,\n searchValue,\n setSearchValue,\n selectedLabel,\n registerItemLabel,\n unregisterItemLabel,\n handleSelect,\n listboxId,\n activeDescendantId,\n setActiveDescendantId,\n ],\n );\n\n return (\n <ComboboxContext.Provider value={contextValue}>\n <Popover.Root open={open} onOpenChange={setOpen} {...rootProps}>\n {children}\n </Popover.Root>\n </ComboboxContext.Provider>\n );\n};\nComboboxRoot.displayName = 'Combobox.Root';\n\ntype ComboboxTriggerElement = HTMLButtonElement;\ntype ComboboxTriggerOwnProps = GetPropDefTypes<typeof comboboxTriggerPropDefs>;\ntype NativeTriggerProps = Omit<React.ComponentPropsWithoutRef<'button'>, 'color'>;\ninterface ComboboxTriggerProps extends NativeTriggerProps, MarginProps, ComboboxTriggerOwnProps {}\n/**\n * Trigger behaves like a styled button that opens the Popover,\n * syncing size/highContrast from Root while exposing select-like states.\n */\nconst ComboboxTrigger = React.forwardRef<ComboboxTriggerElement, ComboboxTriggerProps>((props, forwardedRef) => {\n const context = useComboboxContext('Combobox.Trigger');\n const { children, className, placeholder, disabled, readOnly, error, loading, color, radius, ...triggerProps } = extractProps(\n { size: context.size, highContrast: context.highContrast, ...props },\n { size: comboboxRootPropDefs.size, highContrast: comboboxRootPropDefs.highContrast },\n comboboxTriggerPropDefs,\n marginPropDefs,\n );\n\n // Extract material and panelBackground separately since they need to be passed as data attributes\n const { material, panelBackground } = props;\n\n const isDisabled = disabled ?? context.disabled;\n\n // Use color from props or fall back to context color\n const resolvedColor = color ?? context.color;\n\n // Comprehensive ARIA attributes for combobox pattern (WAI-ARIA 1.2)\n const ariaProps = React.useMemo(\n () => ({\n role: 'combobox' as const,\n 'aria-expanded': context.open,\n 'aria-disabled': isDisabled || undefined,\n 'aria-haspopup': 'listbox' as const,\n 'aria-controls': context.open ? context.listboxId : undefined,\n 'aria-activedescendant': context.open ? context.activeDescendantId : undefined,\n 'aria-autocomplete': 'list' as const,\n }),\n [context.open, context.listboxId, context.activeDescendantId, isDisabled],\n );\n\n const defaultContent = (\n <>\n <span className=\"rt-SelectTriggerInner\">\n <ComboboxValue placeholder={placeholder ?? context.placeholder} />\n </span>\n {loading ? (\n <div className=\"rt-SelectIcon rt-SelectLoadingIcon\" aria-hidden=\"true\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <circle cx=\"8\" cy=\"8\" r=\"6.5\" stroke=\"currentColor\" strokeWidth=\"1\" strokeLinecap=\"round\" strokeDasharray=\"6 34\" strokeDashoffset=\"0\" className=\"rt-SelectLoadingSpinner\" />\n </svg>\n </div>\n ) : (\n <ChevronDownIcon className=\"rt-SelectIcon\" />\n )}\n </>\n );\n\n const { type: buttonType, ...restTriggerProps } = triggerProps;\n const resolvedButtonType = buttonType ?? 'button';\n\n const triggerChild = (\n <button\n data-accent-color={resolvedColor}\n data-radius={radius}\n data-panel-background={panelBackground}\n data-material={material}\n data-error={error}\n data-loading={loading}\n data-disabled={isDisabled || undefined}\n data-read-only={readOnly || undefined}\n {...restTriggerProps}\n {...ariaProps}\n type={resolvedButtonType}\n disabled={isDisabled}\n ref={forwardedRef}\n className={classNames('rt-reset', 'rt-SelectTrigger', 'rt-ComboboxTrigger', className)}\n >\n {children ? requireReactElement(children) : defaultContent}\n </button>\n );\n\n return <Popover.Trigger disabled={isDisabled}>{triggerChild}</Popover.Trigger>;\n});\nComboboxTrigger.displayName = 'Combobox.Trigger';\n\ntype ComboboxValueElement = HTMLSpanElement;\ninterface ComboboxValueProps extends React.ComponentPropsWithoutRef<'span'> {\n placeholder?: string;\n}\n/**\n * Value mirrors Select.Value by showing the selected item's label\n * or falling back to placeholder text supplied by the consumer or context.\n * \n * Priority: resolvedDisplayValue (explicit) > selectedLabel (from items) > raw value > children > placeholder\n */\nconst ComboboxValue = React.forwardRef<ComboboxValueElement, ComboboxValueProps>(({ placeholder, children, className, ...valueProps }, forwardedRef) => {\n const context = useComboboxContext('Combobox.Value');\n // Priority: explicit displayValue (resolved) > registered label > raw value\n const displayValue = context.resolvedDisplayValue ?? context.selectedLabel ?? context.value ?? undefined;\n const fallback = placeholder ?? context.placeholder;\n return (\n <span {...valueProps} ref={forwardedRef} className={classNames('rt-ComboboxValue', className)}>\n {displayValue ?? children ?? fallback}\n </span>\n );\n});\nComboboxValue.displayName = 'Combobox.Value';\n\ntype ComboboxContentElement = React.ElementRef<typeof Popover.Content>;\ntype ComboboxContentOwnProps = GetPropDefTypes<typeof comboboxContentPropDefs> & {\n container?: React.ComponentPropsWithoutRef<typeof Popover.Content>['container'];\n};\ninterface ComboboxContentProps extends Omit<ComponentPropsWithout<typeof Popover.Content, RemovedProps>, 'size'>, ComboboxContentOwnProps {}\n/**\n * Content renders the dropdown surface, syncing tokens from the current Theme\n * and instantiating cmdk's Command list for roving focus + filtering.\n */\nconst ComboboxContent = React.forwardRef<ComboboxContentElement, ComboboxContentProps>((props, forwardedRef) => {\n const context = useComboboxContext('Combobox.Content');\n const themeContext = useThemeContext();\n const effectiveMaterial = themeContext.panelBackground;\n\n const sizeProp = props.size ?? context.size ?? comboboxContentPropDefs.size.default;\n const variantProp = props.variant ?? comboboxContentPropDefs.variant.default;\n const highContrastProp = props.highContrast ?? context.highContrast ?? comboboxContentPropDefs.highContrast.default;\n\n const { className, children, color, forceMount, container, ...contentProps } = extractProps(\n { ...props, size: sizeProp, variant: variantProp, highContrast: highContrastProp },\n comboboxContentPropDefs,\n );\n const resolvedColor = color || context.color || themeContext.accentColor;\n \n // Memoize className sanitization to avoid string operations on every render\n const sanitizedClassName = React.useMemo(() => {\n if (typeof sizeProp !== 'string') return className;\n return className\n ?.split(/\\s+/)\n .filter(Boolean)\n .filter((token) => !/^rt-r-size-\\d$/.test(token))\n .join(' ') || undefined;\n }, [className, sizeProp]);\n\n /**\n * forceMount behavior:\n * - When true: Content stays mounted when closed, allowing items to register labels\n * for display in the trigger. Use this if you need dynamic label resolution.\n * - When false/undefined (default): Content unmounts when closed for better performance.\n * Use the `displayValue` prop on Root to show the selected label instead.\n * \n * For best performance with large lists, keep forceMount=undefined and provide displayValue.\n */\n const shouldForceMount = forceMount === true ? true : undefined;\n\n return (\n <Popover.Content\n size={sizeProp}\n data-accent-color={resolvedColor}\n data-material={effectiveMaterial}\n data-panel-background={effectiveMaterial}\n align=\"start\"\n sideOffset={4}\n collisionPadding={10}\n {...contentProps}\n forceMount={shouldForceMount}\n container={container}\n ref={forwardedRef}\n className={classNames('rt-PopperContent', 'rt-BaseMenuContent', 'rt-ComboboxContent', sanitizedClassName)}\n >\n <Theme asChild>\n <ComboboxContentContext.Provider value={{ variant: variantProp, size: String(sizeProp), color: resolvedColor, material: effectiveMaterial, highContrast: highContrastProp }}>\n <CommandPrimitive\n loop={context.loop}\n shouldFilter={context.shouldFilter}\n filter={context.filter}\n className=\"rt-ComboboxCommand\"\n >\n {children}\n </CommandPrimitive>\n </ComboboxContentContext.Provider>\n </Theme>\n </Popover.Content>\n );\n});\nComboboxContent.displayName = 'Combobox.Content';\n\ntype ComboboxInputElement = React.ElementRef<typeof CommandPrimitive.Input>;\ninterface ComboboxInputProps extends Omit<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>, 'value' | 'onValueChange'> {\n startAdornment?: React.ReactNode;\n endAdornment?: React.ReactNode;\n variant?: TextFieldVariant;\n /** Controlled search value. Falls back to Root's searchValue if not provided. */\n value?: string;\n /** Callback when search value changes. Falls back to Root's onSearchValueChange if not provided. */\n onValueChange?: (value: string) => void;\n}\n/**\n * Input composes TextField tokens with cmdk's Command.Input to provide\n * automatic focus management and optional adornments.\n */\nconst ComboboxInput = React.forwardRef<ComboboxInputElement, ComboboxInputProps>(({ className, startAdornment, endAdornment, placeholder, variant: inputVariant, value, onValueChange, ...inputProps }, forwardedRef) => {\n const context = useComboboxContext('Combobox.Input');\n const contentContext = useComboboxContentContext();\n const contentVariant = contentContext?.variant ?? 'solid';\n const color = contentContext?.color;\n const material = contentContext?.material;\n\n /**\n * Map combobox content variant to TextField variant:\n * - Content 'solid' \u2192 Input 'surface' (elevated input on solid background)\n * - Content 'soft' \u2192 Input 'soft' (subtle input on soft background)\n * This ensures visual harmony between the input and surrounding content.\n */\n const textFieldVariant = inputVariant ?? (contentVariant === 'solid' ? 'surface' : 'soft');\n\n // Use controlled search value from context, allow override via props\n const searchValue = value ?? context.searchValue;\n const handleSearchChange = onValueChange ?? context.setSearchValue;\n\n const inputField = (\n <div\n className={classNames('rt-TextFieldRoot', 'rt-ComboboxInputRoot', `rt-r-size-${context.size}`, `rt-variant-${textFieldVariant}`)}\n data-accent-color={color}\n data-material={material}\n data-panel-background={material}\n >\n {startAdornment ? <div className=\"rt-TextFieldSlot\">{startAdornment}</div> : null}\n <CommandPrimitive.Input\n {...inputProps}\n ref={forwardedRef}\n value={searchValue}\n onValueChange={handleSearchChange}\n placeholder={placeholder ?? context.searchPlaceholder}\n className={classNames('rt-reset', 'rt-TextFieldInput', className)}\n />\n {endAdornment ? (\n <div className=\"rt-TextFieldSlot\" data-side=\"right\">\n {endAdornment}\n </div>\n ) : null}\n </div>\n );\n\n if (contentContext) {\n return <div className=\"rt-ComboboxSearch\">{inputField}</div>;\n }\n\n return inputField;\n});\nComboboxInput.displayName = 'Combobox.Input';\n\ntype ComboboxListElement = React.ElementRef<typeof CommandPrimitive.List>;\ninterface ComboboxListProps extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> {}\n/**\n * List wraps cmdk's Command.List to inherit base menu styles and provides ScrollArea for the items.\n * Also handles aria-activedescendant tracking via a single MutationObserver for all items.\n */\nconst ComboboxList = React.forwardRef<ComboboxListElement, ComboboxListProps>(({ className, ...listProps }, forwardedRef) => {\n const context = useComboboxContext('Combobox.List');\n const listRef = React.useRef<HTMLDivElement | null>(null);\n\n // Combined ref handling\n const combinedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n listRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n (forwardedRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }\n },\n [forwardedRef],\n );\n\n /**\n * Single MutationObserver at List level to track aria-activedescendant.\n * This replaces per-item observers for better performance with large lists.\n */\n React.useEffect(() => {\n const listNode = listRef.current;\n if (!listNode) return;\n\n const updateActiveDescendant = () => {\n const selectedItem = listNode.querySelector('[data-selected=\"true\"], [aria-selected=\"true\"]');\n const itemId = selectedItem?.id;\n context.setActiveDescendantId(itemId || undefined);\n };\n\n // Initial check\n updateActiveDescendant();\n\n // Watch for attribute changes on any descendant\n const observer = new MutationObserver(updateActiveDescendant);\n observer.observe(listNode, {\n attributes: true,\n attributeFilter: ['data-selected', 'aria-selected'],\n subtree: true,\n });\n\n return () => observer.disconnect();\n }, [context.setActiveDescendantId]);\n\n return (\n <ScrollArea type=\"auto\" className=\"rt-ComboboxScrollArea\" scrollbars=\"vertical\" size=\"1\">\n <div className={classNames('rt-BaseMenuViewport', 'rt-ComboboxViewport')}>\n <CommandPrimitive.List\n {...listProps}\n ref={combinedRef}\n id={context.listboxId}\n role=\"listbox\"\n aria-label=\"Options\"\n className={classNames('rt-ComboboxList', className)}\n />\n </div>\n </ScrollArea>\n );\n});\nComboboxList.displayName = 'Combobox.List';\n\ntype ComboboxEmptyElement = React.ElementRef<typeof CommandPrimitive.Empty>;\ninterface ComboboxEmptyProps extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty> {}\n/**\n * Empty renders when no options match the search query.\n */\nconst ComboboxEmpty = React.forwardRef<ComboboxEmptyElement, ComboboxEmptyProps>(({ className, ...emptyProps }, forwardedRef) => (\n <CommandPrimitive.Empty {...emptyProps} ref={forwardedRef} className={classNames('rt-ComboboxEmpty', className)} />\n));\nComboboxEmpty.displayName = 'Combobox.Empty';\n\ntype ComboboxGroupElement = React.ElementRef<typeof CommandPrimitive.Group>;\ninterface ComboboxGroupProps extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group> {}\n/**\n * Group and Label mirror menu semantics for subheadings inside the list.\n */\nconst ComboboxGroup = React.forwardRef<ComboboxGroupElement, ComboboxGroupProps>(({ className, ...groupProps }, forwardedRef) => (\n <CommandPrimitive.Group {...groupProps} ref={forwardedRef} className={classNames('rt-BaseMenuGroup', 'rt-ComboboxGroup', className)} />\n));\nComboboxGroup.displayName = 'Combobox.Group';\n\ntype ComboboxLabelElement = React.ElementRef<'div'>;\ninterface ComboboxLabelProps extends React.ComponentPropsWithoutRef<'div'> {}\nconst ComboboxLabel = React.forwardRef<ComboboxLabelElement, ComboboxLabelProps>(({ className, ...labelProps }, forwardedRef) => (\n <div {...labelProps} ref={forwardedRef} className={classNames('rt-BaseMenuLabel', 'rt-ComboboxLabel', className)} />\n));\nComboboxLabel.displayName = 'Combobox.Label';\n\ntype ComboboxSeparatorElement = React.ElementRef<typeof CommandPrimitive.Separator>;\ninterface ComboboxSeparatorProps extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator> {}\n/**\n * Separator visually divides logical sections of the option list.\n */\nconst ComboboxSeparator = React.forwardRef<ComboboxSeparatorElement, ComboboxSeparatorProps>(({ className, ...separatorProps }, forwardedRef) => (\n <CommandPrimitive.Separator {...separatorProps} ref={forwardedRef} className={classNames('rt-BaseMenuSeparator', 'rt-ComboboxSeparator', className)} />\n));\nComboboxSeparator.displayName = 'Combobox.Separator';\n\ntype ComboboxItemElement = React.ElementRef<typeof CommandPrimitive.Item>;\ninterface ComboboxItemProps extends Omit<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>, 'keywords'> {\n /** Display label for the item. Also used for search unless keywords are provided. */\n label?: string;\n /** Additional keywords for search filtering (overrides automatic label-based search). */\n keywords?: string[];\n}\n/**\n * Item wires cmdk's selection handling with Kookie UI tokens and\n * ensures labels are registered for displaying the current value.\n */\n/**\n * Extracts text content from React children recursively.\n * Used to derive searchable labels from JSX children.\n */\nfunction extractTextFromChildren(children: React.ReactNode): string {\n if (typeof children === 'string') return children;\n if (typeof children === 'number') return String(children);\n if (children == null || typeof children === 'boolean') return '';\n if (Array.isArray(children)) {\n return children.map(extractTextFromChildren).filter(Boolean).join(' ');\n }\n if (React.isValidElement(children)) {\n const props = children.props as { children?: React.ReactNode };\n if (props.children) {\n return extractTextFromChildren(props.children);\n }\n }\n return '';\n}\n\nconst ComboboxItem = React.forwardRef<ComboboxItemElement, ComboboxItemProps>(({ className, children, label, value, disabled, onSelect, keywords, ...itemProps }, forwardedRef) => {\n const context = useComboboxContext('Combobox.Item');\n const contentContext = useComboboxContentContext();\n \n // Memoize label extraction to avoid recursive traversal on every render\n const extractedLabel = React.useMemo(() => extractTextFromChildren(children), [children]);\n const itemLabel = label ?? (extractedLabel || String(value));\n const isSelected = value != null && context.value === value;\n const sizeClass = contentContext?.size ? `rt-r-size-${contentContext.size}` : undefined;\n\n // Use provided keywords, or default to the item label for search\n // This allows searching by display text even when value is different (e.g., \"usa\" vs \"United States\")\n const searchKeywords = keywords ?? [itemLabel];\n\n // Generate stable ID for this item for aria-activedescendant\n const generatedId = React.useId();\n const itemId = `combobox-item-${generatedId}`;\n\n // Destructure stable references to avoid effect re-runs when unrelated context values change\n const { registerItemLabel, unregisterItemLabel, handleSelect: contextHandleSelect } = context;\n\n // Register/unregister label for display in trigger\n React.useEffect(() => {\n if (value) {\n registerItemLabel(value, itemLabel);\n return () => unregisterItemLabel(value);\n }\n }, [registerItemLabel, unregisterItemLabel, value, itemLabel]);\n\n const handleSelect = React.useCallback(\n (selectedValue: string) => {\n contextHandleSelect(selectedValue);\n onSelect?.(selectedValue);\n },\n [contextHandleSelect, onSelect],\n );\n\n const isDisabled = disabled ?? context.disabled ?? false;\n\n /**\n * Performance notes:\n * - data-disabled workaround: Handled via CSS selectors in combobox.css\n * rather than per-item MutationObservers.\n * - aria-activedescendant: Tracked by a single observer in ComboboxList\n * rather than per-item observers.\n */\n\n return (\n <CommandPrimitive.Item\n {...itemProps}\n id={itemId}\n value={value}\n keywords={searchKeywords}\n role=\"option\"\n aria-selected={isSelected}\n {...(isDisabled ? { disabled: true, 'aria-disabled': true } : {})}\n ref={forwardedRef}\n onSelect={handleSelect}\n className={classNames('rt-reset', 'rt-BaseMenuItem', 'rt-ComboboxItem', className)}\n >\n {isSelected ? (\n <span className={classNames('rt-BaseMenuItemIndicator', 'rt-ComboboxItemIndicator', sizeClass)}>\n <ThickCheckIcon className={classNames('rt-BaseMenuItemIndicatorIcon', 'rt-ComboboxItemIndicatorIcon', sizeClass)} />\n </span>\n ) : null}\n <Slottable>{children}</Slottable>\n </CommandPrimitive.Item>\n );\n});\nComboboxItem.displayName = 'Combobox.Item';\n\nexport {\n ComboboxRoot as Root,\n ComboboxTrigger as Trigger,\n ComboboxValue as Value,\n ComboboxContent as Content,\n ComboboxInput as Input,\n ComboboxList as List,\n ComboboxEmpty as Empty,\n ComboboxGroup as Group,\n ComboboxLabel as Label,\n ComboboxSeparator as Separator,\n ComboboxItem as Item,\n};\nexport type {\n ComboboxRootProps as RootProps,\n ComboboxTriggerProps as TriggerProps,\n ComboboxValueProps as ValueProps,\n ComboboxContentProps as ContentProps,\n ComboboxInputProps as InputProps,\n ComboboxListProps as ListProps,\n ComboboxEmptyProps as EmptyProps,\n ComboboxGroupProps as GroupProps,\n ComboboxLabelProps as LabelProps,\n ComboboxSeparatorProps as SeparatorProps,\n ComboboxItemProps as ItemProps,\n};\n"],
|
|
5
|
-
"mappings": "aASA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,wBAAAC,MAA4B,oBACrC,OAAS,WAAWC,MAAwB,OAE5C,OAAS,gBAAAC,MAAoB,8BAC7B,OAAS,wBAAAC,EAAsB,2BAAAC,GAAyB,2BAAAC,MAA+B,sBACvF,OAAS,kBAAAC,OAAsB,2BAC/B,OAAS,mBAAAC,GAAiB,kBAAAC,OAAsB,aAChD,OAAS,SAAAC,GAAO,mBAAAC,OAAuB,aACvC,OAAS,uBAAAC,OAA2B,sCACpC,UAAYC,MAAa,eACzB,OAAS,cAAAC,OAAkB,mBAC3B,OAAS,aAAAC,OAAiB,YAC1B,MAAsC,wBAiGtC,MAAMC,EAAkBjB,EAAM,cAA2C,IAAI,EAKvEkB,EAAsBC,GAAmB,CAC7C,MAAMC,EAAMpB,EAAM,WAAWiB,CAAe,EAC5C,GAAI,CAACG,EACH,MAAM,IAAI,MAAM,GAAGD,CAAM,oCAAoC,EAE/D,OAAOC,CACT,EAMMC,GAAyBrB,EAAM,cAA8H,IA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AAI,GAAK,OAIxE+B,EAAiBN,GAAY,CAACG,CAAS,EAIvChB,EAAS,iBADKtH,EAAM,MAAM,CACW,GAGrC,CAAE,kBAAA2D,EAAmB,oBAAAG,EAAqB,aAAc4E,CAAoB,EAAIrE,EAGtFrE,EAAM,UAAU,IAAM,CACpB,GAAIoD,EACF,OAAAO,EAAkBP,EAAOkF,CAAS,EAC3B,IAAMxE,EAAoBV,CAAK,CAE1C,EAAG,CAACO,EAAmBG,EAAqBV,EAAOkF,CAAS,CAAC,EAE7D,MAAMvE,EAAe/D,EAAM,YACxB2I,GAA0B,CACzBD,EAAoBC,CAAa,EACjCT,IAAWS,CAAa,CAC1B,EACA,CAACD,EAAqBR,CAAQ,CAChC,EAEMpD,EAAapC,GAAY2B,EAAQ,UAAY,GAUnD,OACErE,EAAA,cAACG,EAAiB,KAAjB,CACE,GAAGiI,EACJ,GAAId,EACJ,MAAOlE,EACP,SAAUqF,EACV,KAAK,SACL,gBAAeF,EACd,GAAIzD,EAAa,CAAE,SAAU,GAAM,gBAAiB,EAAK,EAAI,CAAC,EAC/D,IAAKV,EACL,SAAUL,EACV,UAAW9D,EAAW,WAAY,kBAAmB,kBAAmBqE,CAAS,GAEhFiE,EACCvI,EAAA,cAAC,QAAK,UAAWC,EAAW,2BAA4B,2BAA4BuI,CAAS,GAC3FxI,EAAA,cAACU,GAAA,CAAe,UAAWT,EAAW,+BAAgC,+BAAgCuI,CAAS,EAAG,CACpH,EACE,KACJxI,EAAA,cAACgB,GAAA,KAAWS,CAAS,CACvB,CAEJ,CAAC,EACDwG,GAAa,YAAc",
|
|
6
|
-
"names": ["React", "classNames", "useControllableState", "CommandPrimitive", "extractProps", "comboboxRootPropDefs", "comboboxTriggerPropDefs", "comboboxContentPropDefs", "marginPropDefs", "ChevronDownIcon", "ThickCheckIcon", "Theme", "useThemeContext", "requireReactElement", "Popover", "ScrollArea", "Slottable", "
|
|
4
|
+
"sourcesContent": ["'use client';\n\n/**\n * Combobox is a compound component built on top of Popover and cmdk's Command list.\n * It mirrors the Select API while adding search-first behaviors including filtering,\n * async-friendly state management, and design token support for trigger, content,\n * and input variants.\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { useControllableState } from 'radix-ui/internal';\nimport { Command as CommandPrimitive } from 'cmdk';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { comboboxRootPropDefs, comboboxTriggerPropDefs, comboboxContentPropDefs } from './combobox.props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\nimport { ChevronDownIcon, ThickCheckIcon } from './icons.js';\nimport { Theme, useThemeContext } from './theme.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport * as Popover from './popover.js';\nimport { ScrollArea } from './scroll-area.js';\nimport { Slottable } from './slot.js';\nimport { textFieldRootPropDefs } from './text-field.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\n/**\n * Pre-compiled regex for className sanitization.\n * Matches size classes like \"rt-r-size-1\", \"rt-r-size-2\", etc.\n * Pre-compiling avoids regex compilation on every render.\n */\nconst SIZE_CLASS_REGEX = /^rt-r-size-\\d$/;\n\ntype TextFieldVariant = (typeof textFieldRootPropDefs.variant.values)[number];\ntype ComboboxValue = string | null;\n/**\n * Custom filter function for Combobox search.\n * @param value - The item's value being tested\n * @param search - The current search string\n * @param keywords - Optional keywords associated with the item\n * @returns A number between 0 and 1 where 0 means no match and 1 means exact match.\n * Fractional values indicate relevance for sorting.\n */\ntype CommandFilter = (value: string, search: string, keywords?: string[]) => number;\n\n/**\n * Additional props supported by Combobox.Root beyond the Radix Popover surface.\n */\ntype ComboboxRootOwnProps = GetPropDefTypes<typeof comboboxRootPropDefs> & {\n value?: ComboboxValue;\n defaultValue?: ComboboxValue;\n onValueChange?: (value: ComboboxValue) => void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n placeholder?: string;\n searchPlaceholder?: string;\n searchValue?: string;\n defaultSearchValue?: string;\n onSearchValueChange?: (value: string) => void;\n filter?: CommandFilter;\n shouldFilter?: boolean;\n loop?: boolean;\n disabled?: boolean;\n /**\n * Whether to reset the search value when an option is selected.\n * @default true\n */\n resetSearchOnSelect?: boolean;\n /**\n * Accent color for the combobox trigger and content.\n */\n color?: (typeof comboboxTriggerPropDefs.color.values)[number];\n /**\n * Display value shown in the trigger. This is the recommended approach for\n * best performance as it avoids needing to mount items to register labels.\n * \n * Can be either:\n * - A string: Static display value\n * - A function: `(value: string | null) => string | undefined` - Called with current value\n * \n * Use this when:\n * - You have the selected item's label available (e.g., from your data source)\n * - Items haven't mounted yet (e.g., on initial render with a defaultValue)\n * - You want optimal performance with forceMount={false} (default)\n * \n * @example\n * // Static string\n * <Combobox.Root value=\"usa\" displayValue=\"United States\">\n * \n * // Function (recommended for dynamic data)\n * <Combobox.Root \n * value={selectedCountry}\n * displayValue={(value) => countries.find(c => c.code === value)?.name}\n * >\n * \n * If not provided, falls back to the label registered by the selected item\n * (requires forceMount={true}), then to the raw value.\n */\n displayValue?: string | ((value: ComboboxValue) => string | undefined);\n};\n\n/**\n * Split contexts to minimize re-renders. Each context changes independently:\n * - ConfigContext: Static config that rarely changes (size, color, placeholders, etc.)\n * - SelectionContext: Changes when user selects an item\n * - SearchContext: Changes on every keystroke in the search input\n * - NavigationContext: Changes during keyboard navigation\n */\n\n/** Static configuration - rarely changes after mount */\ninterface ComboboxConfigContextValue {\n size?: ComboboxRootOwnProps['size'];\n highContrast?: boolean;\n placeholder?: string;\n searchPlaceholder?: string;\n filter?: CommandFilter;\n shouldFilter?: boolean;\n loop?: boolean;\n disabled?: boolean;\n resetSearchOnSelect?: boolean;\n color?: ComboboxRootOwnProps['color'];\n listboxId: string;\n}\n\n/** Selection state - changes when user picks an option */\ninterface ComboboxSelectionContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n value: ComboboxValue;\n /** Label registered by the selected item */\n selectedLabel?: string;\n /** Resolved display value (already computed from string or function) */\n resolvedDisplayValue?: string;\n registerItemLabel: (value: string, label: string) => void;\n unregisterItemLabel: (value: string) => void;\n handleSelect: (value: string) => void;\n}\n\n/** Search state - changes on every keystroke */\ninterface ComboboxSearchContextValue {\n searchValue: string;\n setSearchValue: (value: string) => void;\n}\n\n/** Navigation state - changes during keyboard navigation */\ninterface ComboboxNavigationContextValue {\n activeDescendantId: string | undefined;\n setActiveDescendantId: (id: string | undefined) => void;\n}\n\nconst ComboboxConfigContext = React.createContext<ComboboxConfigContextValue | null>(null);\nconst ComboboxSelectionContext = React.createContext<ComboboxSelectionContextValue | null>(null);\nconst ComboboxSearchContext = React.createContext<ComboboxSearchContextValue | null>(null);\nconst ComboboxNavigationContext = React.createContext<ComboboxNavigationContextValue | null>(null);\n\n/**\n * Utility hooks that ensure consumers are wrapped in Combobox.Root.\n * Components should use only the contexts they need to minimize re-renders.\n */\nconst useComboboxConfigContext = (caller: string) => {\n const ctx = React.useContext(ComboboxConfigContext);\n if (!ctx) {\n throw new Error(`${caller} must be used within Combobox.Root`);\n }\n return ctx;\n};\n\nconst useComboboxSelectionContext = (caller: string) => {\n const ctx = React.useContext(ComboboxSelectionContext);\n if (!ctx) {\n throw new Error(`${caller} must be used within Combobox.Root`);\n }\n return ctx;\n};\n\nconst useComboboxSearchContext = (caller: string) => {\n const ctx = React.useContext(ComboboxSearchContext);\n if (!ctx) {\n throw new Error(`${caller} must be used within Combobox.Root`);\n }\n return ctx;\n};\n\nconst useComboboxNavigationContext = (caller: string) => {\n const ctx = React.useContext(ComboboxNavigationContext);\n if (!ctx) {\n throw new Error(`${caller} must be used within Combobox.Root`);\n }\n return ctx;\n};\n\n/**\n * Combined context hook for components that need multiple contexts.\n * Use sparingly - prefer individual context hooks when possible.\n */\nconst useComboboxContext = (caller: string) => {\n const config = useComboboxConfigContext(caller);\n const selection = useComboboxSelectionContext(caller);\n const search = useComboboxSearchContext(caller);\n const navigation = useComboboxNavigationContext(caller);\n return { ...config, ...selection, ...search, ...navigation };\n};\n\n/**\n * Context for values that are only available inside Content (e.g., variant, color)\n * so that Input/Item can style themselves consistently.\n */\nconst ComboboxContentContext = React.createContext<{ variant: 'solid' | 'soft'; size?: string; color?: string; material?: string; highContrast?: boolean } | null>(null);\nconst useComboboxContentContext = () => {\n const ctx = React.useContext(ComboboxContentContext);\n return ctx; // Optional - Input might not always be in Content\n};\n\ntype PopoverRootProps = React.ComponentPropsWithoutRef<typeof Popover.Root>;\ninterface ComboboxRootProps extends PopoverRootProps, ComboboxRootOwnProps {}\n/**\n * Root component that wires up Popover behavior, controllable state,\n * and shared context for trigger/content/input sub-components.\n */\nconst ComboboxRoot: React.FC<ComboboxRootProps> = (props) => {\n const {\n children,\n size = comboboxRootPropDefs.size.default,\n highContrast = comboboxRootPropDefs.highContrast.default,\n value: valueProp,\n defaultValue = null,\n onValueChange,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n placeholder = 'Select an option',\n searchPlaceholder = 'Search options...',\n searchValue: searchValueProp,\n defaultSearchValue = '',\n onSearchValueChange,\n filter,\n shouldFilter = true,\n loop = true,\n disabled,\n resetSearchOnSelect = true,\n color,\n displayValue: displayValueProp,\n ...rootProps\n } = props;\n\n // Generate stable IDs for accessibility\n const generatedId = React.useId();\n const listboxId = `combobox-listbox-${generatedId}`;\n const [activeDescendantId, setActiveDescendantId] = React.useState<string | undefined>(undefined);\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n const [value, setValue] = useControllableState<ComboboxValue>({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const [searchValue, setSearchValue] = useControllableState<string>({\n prop: searchValueProp,\n defaultProp: defaultSearchValue,\n onChange: onSearchValueChange,\n });\n\n const labelMapRef = React.useRef(new Map<string, string>());\n // Track the selected label in state so it triggers re-renders when items register\n const [selectedLabel, setSelectedLabel] = React.useState<string | undefined>(undefined);\n\n const registerItemLabel = React.useCallback((itemValue: string, label: string) => {\n labelMapRef.current.set(itemValue, label);\n // If this item matches the current value, update the selected label\n if (itemValue === value) {\n setSelectedLabel(label);\n }\n }, [value]);\n\n const unregisterItemLabel = React.useCallback((itemValue: string) => {\n labelMapRef.current.delete(itemValue);\n }, []);\n\n // Update selected label when value changes\n React.useEffect(() => {\n if (value != null) {\n const label = labelMapRef.current.get(value);\n setSelectedLabel(label);\n } else {\n setSelectedLabel(undefined);\n }\n }, [value]);\n\n const handleSelect = React.useCallback(\n (nextValue: string) => {\n // Batch state updates to minimize re-renders\n // React 18+ automatically batches these, but we use flushSync-free pattern\n // to ensure predictable update order\n setValue(nextValue);\n setOpen(false);\n if (resetSearchOnSelect) {\n setSearchValue('');\n }\n },\n [setOpen, setSearchValue, setValue, resetSearchOnSelect],\n );\n\n // Development mode warning for value not matching any registered item\n React.useEffect(() => {\n if (process.env.NODE_ENV !== 'production' && value != null && !labelMapRef.current.has(value)) {\n // Defer the check to allow items to register first\n const timeoutId = setTimeout(() => {\n if (value != null && !labelMapRef.current.has(value)) {\n console.warn(\n `[Combobox] The value \"${value}\" does not match any Combobox.Item. ` +\n `Make sure each Item has a matching value prop.`,\n );\n }\n }, 0);\n return () => clearTimeout(timeoutId);\n }\n }, [value]);\n\n // Resolve displayValue: compute if function, use directly if string\n const resolvedDisplayValue = React.useMemo(() => {\n if (displayValueProp == null) return undefined;\n if (typeof displayValueProp === 'function') {\n return displayValueProp(value);\n }\n return displayValueProp;\n }, [displayValueProp, value]);\n\n // Split context values for optimal re-render performance\n // Each context only triggers re-renders for components that use it\n\n const configContextValue = React.useMemo<ComboboxConfigContextValue>(\n () => ({\n size,\n highContrast,\n placeholder,\n searchPlaceholder,\n filter,\n shouldFilter,\n loop,\n disabled,\n resetSearchOnSelect,\n color,\n listboxId,\n }),\n [size, highContrast, placeholder, searchPlaceholder, filter, shouldFilter, loop, disabled, resetSearchOnSelect, color, listboxId],\n );\n\n const selectionContextValue = React.useMemo<ComboboxSelectionContextValue>(\n () => ({\n open,\n setOpen,\n value,\n selectedLabel,\n resolvedDisplayValue,\n registerItemLabel,\n unregisterItemLabel,\n handleSelect,\n }),\n [open, setOpen, value, selectedLabel, resolvedDisplayValue, registerItemLabel, unregisterItemLabel, handleSelect],\n );\n\n const searchContextValue = React.useMemo<ComboboxSearchContextValue>(\n () => ({\n searchValue,\n setSearchValue,\n }),\n [searchValue, setSearchValue],\n );\n\n const navigationContextValue = React.useMemo<ComboboxNavigationContextValue>(\n () => ({\n activeDescendantId,\n setActiveDescendantId,\n }),\n [activeDescendantId, setActiveDescendantId],\n );\n\n return (\n <ComboboxConfigContext.Provider value={configContextValue}>\n <ComboboxSelectionContext.Provider value={selectionContextValue}>\n <ComboboxSearchContext.Provider value={searchContextValue}>\n <ComboboxNavigationContext.Provider value={navigationContextValue}>\n <Popover.Root open={open} onOpenChange={setOpen} {...rootProps}>\n {children}\n </Popover.Root>\n </ComboboxNavigationContext.Provider>\n </ComboboxSearchContext.Provider>\n </ComboboxSelectionContext.Provider>\n </ComboboxConfigContext.Provider>\n );\n};\nComboboxRoot.displayName = 'Combobox.Root';\n\ntype ComboboxTriggerElement = HTMLButtonElement;\ntype ComboboxTriggerOwnProps = GetPropDefTypes<typeof comboboxTriggerPropDefs>;\ntype NativeTriggerProps = Omit<React.ComponentPropsWithoutRef<'button'>, 'color'>;\ninterface ComboboxTriggerProps extends NativeTriggerProps, MarginProps, ComboboxTriggerOwnProps {}\n/**\n * Trigger behaves like a styled button that opens the Popover,\n * syncing size/highContrast from Root while exposing select-like states.\n */\nconst ComboboxTrigger = React.forwardRef<ComboboxTriggerElement, ComboboxTriggerProps>((props, forwardedRef) => {\n // Use specific contexts to minimize re-renders\n const configContext = useComboboxConfigContext('Combobox.Trigger');\n const selectionContext = useComboboxSelectionContext('Combobox.Trigger');\n const navigationContext = useComboboxNavigationContext('Combobox.Trigger');\n\n const { children, className, placeholder, disabled, readOnly, error, loading, color, radius, ...triggerProps } = extractProps(\n { size: configContext.size, highContrast: configContext.highContrast, ...props },\n { size: comboboxRootPropDefs.size, highContrast: comboboxRootPropDefs.highContrast },\n comboboxTriggerPropDefs,\n marginPropDefs,\n );\n\n // Extract material and panelBackground separately since they need to be passed as data attributes\n const { material, panelBackground } = props;\n\n const isDisabled = disabled ?? configContext.disabled;\n\n // Use color from props or fall back to context color\n const resolvedColor = color ?? configContext.color;\n\n // Comprehensive ARIA attributes for combobox pattern (WAI-ARIA 1.2)\n const ariaProps = React.useMemo(\n () => ({\n role: 'combobox' as const,\n 'aria-expanded': selectionContext.open,\n 'aria-disabled': isDisabled || undefined,\n 'aria-haspopup': 'listbox' as const,\n 'aria-controls': selectionContext.open ? configContext.listboxId : undefined,\n 'aria-activedescendant': selectionContext.open ? navigationContext.activeDescendantId : undefined,\n 'aria-autocomplete': 'list' as const,\n }),\n [selectionContext.open, configContext.listboxId, navigationContext.activeDescendantId, isDisabled],\n );\n\n const defaultContent = (\n <>\n <span className=\"rt-SelectTriggerInner\">\n <ComboboxValue placeholder={placeholder ?? configContext.placeholder} />\n </span>\n {loading ? (\n <div className=\"rt-SelectIcon rt-SelectLoadingIcon\" aria-hidden=\"true\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <circle cx=\"8\" cy=\"8\" r=\"6.5\" stroke=\"currentColor\" strokeWidth=\"1\" strokeLinecap=\"round\" strokeDasharray=\"6 34\" strokeDashoffset=\"0\" className=\"rt-SelectLoadingSpinner\" />\n </svg>\n </div>\n ) : (\n <ChevronDownIcon className=\"rt-SelectIcon\" />\n )}\n </>\n );\n\n const { type: buttonType, ...restTriggerProps } = triggerProps;\n const resolvedButtonType = buttonType ?? 'button';\n\n const triggerChild = (\n <button\n data-accent-color={resolvedColor}\n data-radius={radius}\n data-panel-background={panelBackground}\n data-material={material}\n data-error={error}\n data-loading={loading}\n data-disabled={isDisabled || undefined}\n data-read-only={readOnly || undefined}\n {...restTriggerProps}\n {...ariaProps}\n type={resolvedButtonType}\n disabled={isDisabled}\n ref={forwardedRef}\n className={classNames('rt-reset', 'rt-SelectTrigger', 'rt-ComboboxTrigger', className)}\n >\n {children ? requireReactElement(children) : defaultContent}\n </button>\n );\n\n return <Popover.Trigger disabled={isDisabled}>{triggerChild}</Popover.Trigger>;\n});\nComboboxTrigger.displayName = 'Combobox.Trigger';\n\ntype ComboboxValueElement = HTMLSpanElement;\ninterface ComboboxValueProps extends React.ComponentPropsWithoutRef<'span'> {\n placeholder?: string;\n}\n/**\n * Value mirrors Select.Value by showing the selected item's label\n * or falling back to placeholder text supplied by the consumer or context.\n *\n * Priority: resolvedDisplayValue (explicit) > selectedLabel (from items) > raw value > children > placeholder\n */\nconst ComboboxValue = React.forwardRef<ComboboxValueElement, ComboboxValueProps>(({ placeholder, children, className, ...valueProps }, forwardedRef) => {\n // Only use the contexts we need - config for placeholder, selection for value display\n const configContext = useComboboxConfigContext('Combobox.Value');\n const selectionContext = useComboboxSelectionContext('Combobox.Value');\n // Priority: explicit displayValue (resolved) > registered label > raw value\n const displayValue = selectionContext.resolvedDisplayValue ?? selectionContext.selectedLabel ?? selectionContext.value ?? undefined;\n const fallback = placeholder ?? configContext.placeholder;\n return (\n <span {...valueProps} ref={forwardedRef} className={classNames('rt-ComboboxValue', className)}>\n {displayValue ?? children ?? fallback}\n </span>\n );\n});\nComboboxValue.displayName = 'Combobox.Value';\n\ntype ComboboxContentElement = React.ElementRef<typeof Popover.Content>;\ntype ComboboxContentOwnProps = GetPropDefTypes<typeof comboboxContentPropDefs> & {\n container?: React.ComponentPropsWithoutRef<typeof Popover.Content>['container'];\n};\ninterface ComboboxContentProps extends Omit<ComponentPropsWithout<typeof Popover.Content, RemovedProps>, 'size'>, ComboboxContentOwnProps {}\n/**\n * Content renders the dropdown surface, syncing tokens from the current Theme\n * and instantiating cmdk's Command list for roving focus + filtering.\n */\nconst ComboboxContent = React.forwardRef<ComboboxContentElement, ComboboxContentProps>((props, forwardedRef) => {\n // Only use config context - Content doesn't need selection/search/navigation state\n const configContext = useComboboxConfigContext('Combobox.Content');\n const themeContext = useThemeContext();\n const effectiveMaterial = themeContext.panelBackground;\n\n const sizeProp = props.size ?? configContext.size ?? comboboxContentPropDefs.size.default;\n const variantProp = props.variant ?? comboboxContentPropDefs.variant.default;\n const highContrastProp = props.highContrast ?? configContext.highContrast ?? comboboxContentPropDefs.highContrast.default;\n\n const { className, children, color, forceMount, container, ...contentProps } = extractProps(\n { ...props, size: sizeProp, variant: variantProp, highContrast: highContrastProp },\n comboboxContentPropDefs,\n );\n const resolvedColor = color || configContext.color || themeContext.accentColor;\n \n // Memoize className sanitization to avoid string operations on every render\n // Uses pre-compiled SIZE_CLASS_REGEX for better performance\n const sanitizedClassName = React.useMemo(() => {\n if (typeof sizeProp !== 'string') return className;\n return className\n ?.split(/\\s+/)\n .filter(Boolean)\n .filter((token) => !SIZE_CLASS_REGEX.test(token))\n .join(' ') || undefined;\n }, [className, sizeProp]);\n\n /**\n * forceMount behavior:\n * - When true: Content stays mounted when closed, allowing items to register labels\n * for display in the trigger. Use this if you need dynamic label resolution.\n * - When false/undefined (default): Content unmounts when closed for better performance.\n * Use the `displayValue` prop on Root to show the selected label instead.\n * \n * For best performance with large lists, keep forceMount=undefined and provide displayValue.\n */\n const shouldForceMount = forceMount === true ? true : undefined;\n\n return (\n <Popover.Content\n size={sizeProp}\n data-accent-color={resolvedColor}\n data-material={effectiveMaterial}\n data-panel-background={effectiveMaterial}\n align=\"start\"\n sideOffset={4}\n collisionPadding={10}\n {...contentProps}\n forceMount={shouldForceMount}\n container={container}\n ref={forwardedRef}\n className={classNames('rt-PopperContent', 'rt-BaseMenuContent', 'rt-ComboboxContent', sanitizedClassName)}\n >\n <Theme asChild>\n <ComboboxContentContext.Provider value={{ variant: variantProp, size: String(sizeProp), color: resolvedColor, material: effectiveMaterial, highContrast: highContrastProp }}>\n <CommandPrimitive\n loop={configContext.loop}\n shouldFilter={configContext.shouldFilter}\n filter={configContext.filter}\n className=\"rt-ComboboxCommand\"\n >\n {children}\n </CommandPrimitive>\n </ComboboxContentContext.Provider>\n </Theme>\n </Popover.Content>\n );\n});\nComboboxContent.displayName = 'Combobox.Content';\n\ntype ComboboxInputElement = React.ElementRef<typeof CommandPrimitive.Input>;\ninterface ComboboxInputProps extends Omit<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>, 'value' | 'onValueChange'> {\n startAdornment?: React.ReactNode;\n endAdornment?: React.ReactNode;\n variant?: TextFieldVariant;\n /** Controlled search value. Falls back to Root's searchValue if not provided. */\n value?: string;\n /** Callback when search value changes. Falls back to Root's onSearchValueChange if not provided. */\n onValueChange?: (value: string) => void;\n}\n/**\n * Input composes TextField tokens with cmdk's Command.Input to provide\n * automatic focus management and optional adornments.\n */\nconst ComboboxInput = React.forwardRef<ComboboxInputElement, ComboboxInputProps>(({ className, startAdornment, endAdornment, placeholder, variant: inputVariant, value, onValueChange, ...inputProps }, forwardedRef) => {\n // Use specific contexts - config for size/placeholder, search for search state\n const configContext = useComboboxConfigContext('Combobox.Input');\n const searchContext = useComboboxSearchContext('Combobox.Input');\n const contentContext = useComboboxContentContext();\n const contentVariant = contentContext?.variant ?? 'solid';\n const color = contentContext?.color;\n const material = contentContext?.material;\n\n /**\n * Map combobox content variant to TextField variant:\n * - Content 'solid' \u2192 Input 'surface' (elevated input on solid background)\n * - Content 'soft' \u2192 Input 'soft' (subtle input on soft background)\n * This ensures visual harmony between the input and surrounding content.\n */\n const textFieldVariant = inputVariant ?? (contentVariant === 'solid' ? 'surface' : 'soft');\n\n // Use controlled search value from context, allow override via props\n const searchValue = value ?? searchContext.searchValue;\n const handleSearchChange = onValueChange ?? searchContext.setSearchValue;\n\n const inputField = (\n <div\n className={classNames('rt-TextFieldRoot', 'rt-ComboboxInputRoot', `rt-r-size-${configContext.size}`, `rt-variant-${textFieldVariant}`)}\n data-accent-color={color}\n data-material={material}\n data-panel-background={material}\n >\n {startAdornment ? <div className=\"rt-TextFieldSlot\">{startAdornment}</div> : null}\n <CommandPrimitive.Input\n {...inputProps}\n ref={forwardedRef}\n value={searchValue}\n onValueChange={handleSearchChange}\n placeholder={placeholder ?? configContext.searchPlaceholder}\n className={classNames('rt-reset', 'rt-TextFieldInput', className)}\n />\n {endAdornment ? (\n <div className=\"rt-TextFieldSlot\" data-side=\"right\">\n {endAdornment}\n </div>\n ) : null}\n </div>\n );\n\n if (contentContext) {\n return <div className=\"rt-ComboboxSearch\">{inputField}</div>;\n }\n\n return inputField;\n});\nComboboxInput.displayName = 'Combobox.Input';\n\ntype ComboboxListElement = React.ElementRef<typeof CommandPrimitive.List>;\ninterface ComboboxListProps extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> {}\n/**\n * List wraps cmdk's Command.List to inherit base menu styles and provides ScrollArea for the items.\n * Also handles aria-activedescendant tracking via a single MutationObserver for all items.\n */\nconst ComboboxList = React.forwardRef<ComboboxListElement, ComboboxListProps>(({ className, ...listProps }, forwardedRef) => {\n // Use specific contexts - config for listboxId, navigation for active descendant\n const configContext = useComboboxConfigContext('Combobox.List');\n const navigationContext = useComboboxNavigationContext('Combobox.List');\n const listRef = React.useRef<HTMLDivElement | null>(null);\n\n // Combined ref handling\n const combinedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n listRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n (forwardedRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }\n },\n [forwardedRef],\n );\n\n // Destructure to get stable reference for effect dependency\n const { setActiveDescendantId } = navigationContext;\n\n /**\n * Single MutationObserver at List level to track aria-activedescendant.\n * This replaces per-item observers for better performance with large lists.\n */\n React.useEffect(() => {\n const listNode = listRef.current;\n if (!listNode) return;\n\n const updateActiveDescendant = () => {\n const selectedItem = listNode.querySelector('[data-selected=\"true\"], [aria-selected=\"true\"]');\n const itemId = selectedItem?.id;\n setActiveDescendantId(itemId || undefined);\n };\n\n // Initial check\n updateActiveDescendant();\n\n // Watch for attribute changes on any descendant\n const observer = new MutationObserver(updateActiveDescendant);\n observer.observe(listNode, {\n attributes: true,\n attributeFilter: ['data-selected', 'aria-selected'],\n subtree: true,\n });\n\n return () => observer.disconnect();\n }, [setActiveDescendantId]);\n\n return (\n <ScrollArea type=\"auto\" className=\"rt-ComboboxScrollArea\" scrollbars=\"vertical\" size=\"1\">\n <div className={classNames('rt-BaseMenuViewport', 'rt-ComboboxViewport')}>\n <CommandPrimitive.List\n {...listProps}\n ref={combinedRef}\n id={configContext.listboxId}\n role=\"listbox\"\n aria-label=\"Options\"\n className={classNames('rt-ComboboxList', className)}\n />\n </div>\n </ScrollArea>\n );\n});\nComboboxList.displayName = 'Combobox.List';\n\ntype ComboboxEmptyElement = React.ElementRef<typeof CommandPrimitive.Empty>;\ninterface ComboboxEmptyProps extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty> {}\n/**\n * Empty renders when no options match the search query.\n */\nconst ComboboxEmpty = React.forwardRef<ComboboxEmptyElement, ComboboxEmptyProps>(({ className, ...emptyProps }, forwardedRef) => (\n <CommandPrimitive.Empty {...emptyProps} ref={forwardedRef} className={classNames('rt-ComboboxEmpty', className)} />\n));\nComboboxEmpty.displayName = 'Combobox.Empty';\n\ntype ComboboxGroupElement = React.ElementRef<typeof CommandPrimitive.Group>;\ninterface ComboboxGroupProps extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group> {}\n/**\n * Group and Label mirror menu semantics for subheadings inside the list.\n */\nconst ComboboxGroup = React.forwardRef<ComboboxGroupElement, ComboboxGroupProps>(({ className, ...groupProps }, forwardedRef) => (\n <CommandPrimitive.Group {...groupProps} ref={forwardedRef} className={classNames('rt-BaseMenuGroup', 'rt-ComboboxGroup', className)} />\n));\nComboboxGroup.displayName = 'Combobox.Group';\n\ntype ComboboxLabelElement = React.ElementRef<'div'>;\ninterface ComboboxLabelProps extends React.ComponentPropsWithoutRef<'div'> {}\nconst ComboboxLabel = React.forwardRef<ComboboxLabelElement, ComboboxLabelProps>(({ className, ...labelProps }, forwardedRef) => (\n <div {...labelProps} ref={forwardedRef} className={classNames('rt-BaseMenuLabel', 'rt-ComboboxLabel', className)} />\n));\nComboboxLabel.displayName = 'Combobox.Label';\n\ntype ComboboxSeparatorElement = React.ElementRef<typeof CommandPrimitive.Separator>;\ninterface ComboboxSeparatorProps extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator> {}\n/**\n * Separator visually divides logical sections of the option list.\n */\nconst ComboboxSeparator = React.forwardRef<ComboboxSeparatorElement, ComboboxSeparatorProps>(({ className, ...separatorProps }, forwardedRef) => (\n <CommandPrimitive.Separator {...separatorProps} ref={forwardedRef} className={classNames('rt-BaseMenuSeparator', 'rt-ComboboxSeparator', className)} />\n));\nComboboxSeparator.displayName = 'Combobox.Separator';\n\ntype ComboboxItemElement = React.ElementRef<typeof CommandPrimitive.Item>;\ninterface ComboboxItemProps extends Omit<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>, 'keywords'> {\n /** Display label for the item. Also used for search unless keywords are provided. */\n label?: string;\n /** Additional keywords for search filtering (overrides automatic label-based search). */\n keywords?: string[];\n}\n/**\n * Item wires cmdk's selection handling with Kookie UI tokens and\n * ensures labels are registered for displaying the current value.\n */\n/**\n * Extracts text content from React children recursively.\n * Used to derive searchable labels from JSX children.\n */\nfunction extractTextFromChildren(children: React.ReactNode): string {\n if (typeof children === 'string') return children;\n if (typeof children === 'number') return String(children);\n if (children == null || typeof children === 'boolean') return '';\n if (Array.isArray(children)) {\n return children.map(extractTextFromChildren).filter(Boolean).join(' ');\n }\n if (React.isValidElement(children)) {\n const props = children.props as { children?: React.ReactNode };\n if (props.children) {\n return extractTextFromChildren(props.children);\n }\n }\n return '';\n}\n\nconst ComboboxItem = React.forwardRef<ComboboxItemElement, ComboboxItemProps>(({ className, children, label, value, disabled, onSelect, keywords, ...itemProps }, forwardedRef) => {\n // Use specific contexts - config for disabled, selection for value/registration\n // This means items only re-render when selection changes, not on search or navigation\n const configContext = useComboboxConfigContext('Combobox.Item');\n const selectionContext = useComboboxSelectionContext('Combobox.Item');\n const contentContext = useComboboxContentContext();\n\n // Memoize label extraction to avoid recursive traversal on every render\n const extractedLabel = React.useMemo(() => extractTextFromChildren(children), [children]);\n const itemLabel = label ?? (extractedLabel || String(value));\n const isSelected = value != null && selectionContext.value === value;\n const sizeClass = contentContext?.size ? `rt-r-size-${contentContext.size}` : undefined;\n\n // Use provided keywords, or default to the item label for search\n // This allows searching by display text even when value is different (e.g., \"usa\" vs \"United States\")\n const searchKeywords = keywords ?? [itemLabel];\n\n // Generate stable ID for this item for aria-activedescendant\n const generatedId = React.useId();\n const itemId = `combobox-item-${generatedId}`;\n\n // Destructure stable references to avoid effect re-runs when unrelated context values change\n const { registerItemLabel, unregisterItemLabel, handleSelect: contextHandleSelect } = selectionContext;\n\n // Register/unregister label for display in trigger\n React.useEffect(() => {\n if (value) {\n registerItemLabel(value, itemLabel);\n return () => unregisterItemLabel(value);\n }\n }, [registerItemLabel, unregisterItemLabel, value, itemLabel]);\n\n const handleSelect = React.useCallback(\n (selectedValue: string) => {\n contextHandleSelect(selectedValue);\n onSelect?.(selectedValue);\n },\n [contextHandleSelect, onSelect],\n );\n\n const isDisabled = disabled ?? configContext.disabled ?? false;\n\n /**\n * Performance notes:\n * - data-disabled workaround: Handled via CSS selectors in combobox.css\n * rather than per-item MutationObservers.\n * - aria-activedescendant: Tracked by a single observer in ComboboxList\n * rather than per-item observers.\n */\n\n return (\n <CommandPrimitive.Item\n {...itemProps}\n id={itemId}\n value={value}\n keywords={searchKeywords}\n role=\"option\"\n aria-selected={isSelected}\n {...(isDisabled ? { disabled: true, 'aria-disabled': true } : {})}\n ref={forwardedRef}\n onSelect={handleSelect}\n className={classNames('rt-reset', 'rt-BaseMenuItem', 'rt-ComboboxItem', className)}\n >\n {isSelected ? (\n <span className={classNames('rt-BaseMenuItemIndicator', 'rt-ComboboxItemIndicator', sizeClass)}>\n <ThickCheckIcon className={classNames('rt-BaseMenuItemIndicatorIcon', 'rt-ComboboxItemIndicatorIcon', sizeClass)} />\n </span>\n ) : null}\n <Slottable>{children}</Slottable>\n </CommandPrimitive.Item>\n );\n});\nComboboxItem.displayName = 'Combobox.Item';\n\nexport {\n ComboboxRoot as Root,\n ComboboxTrigger as Trigger,\n ComboboxValue as Value,\n ComboboxContent as Content,\n ComboboxInput as Input,\n ComboboxList as List,\n ComboboxEmpty as Empty,\n ComboboxGroup as Group,\n ComboboxLabel as Label,\n ComboboxSeparator as Separator,\n ComboboxItem as Item,\n};\nexport type {\n ComboboxRootProps as RootProps,\n ComboboxTriggerProps as TriggerProps,\n ComboboxValueProps as ValueProps,\n ComboboxContentProps as ContentProps,\n ComboboxInputProps as InputProps,\n ComboboxListProps as ListProps,\n ComboboxEmptyProps as EmptyProps,\n ComboboxGroupProps as GroupProps,\n ComboboxLabelProps as LabelProps,\n ComboboxSeparatorProps as SeparatorProps,\n ComboboxItemProps as ItemProps,\n};\n"],
|
|
5
|
+
"mappings": "aASA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,wBAAAC,MAA4B,oBACrC,OAAS,WAAWC,MAAwB,OAE5C,OAAS,gBAAAC,OAAoB,8BAC7B,OAAS,wBAAAC,EAAsB,2BAAAC,GAAyB,2BAAAC,MAA+B,sBACvF,OAAS,kBAAAC,OAAsB,2BAC/B,OAAS,mBAAAC,GAAiB,kBAAAC,OAAsB,aAChD,OAAS,SAAAC,GAAO,mBAAAC,OAAuB,aACvC,OAAS,uBAAAC,OAA2B,sCACpC,UAAYC,MAAa,eACzB,OAAS,cAAAC,OAAkB,mBAC3B,OAAS,aAAAC,OAAiB,YAC1B,MAAsC,wBAWtC,MAAMC,GAAmB,iBAwHnBC,GAAwBlB,EAAM,cAAiD,IAAI,EACnFmB,GAA2BnB,EAAM,cAAoD,IAAI,EACzFoB,GAAwBpB,EAAM,cAAiD,IAAI,EACnFqB,GAA4BrB,EAAM,cAAqD,IAAI,EAM3FsB,EAA4BC,GAAmB,CACnD,MAAMC,EAAMxB,EAAM,W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ACA,CAAQ,CAAC,EAClFmH,EAAY/E,IAAU8E,GAAkB,OAAOvF,CAAK,GACpDyF,EAAazF,GAAS,MAAQqB,EAAiB,QAAUrB,EACzD0F,EAAY9B,GAAgB,KAAO,aAAaA,EAAe,IAAI,GAAK,OAIxE+B,EAAiBN,GAAY,CAACG,CAAS,EAIvChB,EAAS,iBADKxI,EAAM,MAAM,CACW,GAGrC,CAAE,kBAAAuE,EAAmB,oBAAAG,EAAqB,aAAckF,CAAoB,EAAIvE,EAGtFrF,EAAM,UAAU,IAAM,CACpB,GAAIgE,EACF,OAAAO,EAAkBP,EAAOwF,CAAS,EAC3B,IAAM9E,EAAoBV,CAAK,CAE1C,EAAG,CAACO,EAAmBG,EAAqBV,EAAOwF,CAAS,CAAC,EAE7D,MAAM7E,EAAe3E,EAAM,YACxB6J,GAA0B,CACzBD,EAAoBC,CAAa,EACjCT,IAAWS,CAAa,CAC1B,EACA,CAACD,EAAqBR,CAAQ,CAChC,EAEMrD,EAAazC,GAAY8B,EAAc,UAAY,GAUzD,OACEpF,EAAA,cAACG,EAAiB,KAAjB,CACE,GAAGmJ,EACJ,GAAId,EACJ,MAAOxE,EACP,SAAU2F,EACV,KAAK,SACL,gBAAeF,EACd,GAAI1D,EAAa,CAAE,SAAU,GAAM,gBAAiB,EAAK,EAAI,CAAC,EAC/D,IAAKZ,EACL,SAAUR,EACV,UAAW1E,EAAW,WAAY,kBAAmB,kBAAmBsF,CAAS,GAEhFkE,EACCzJ,EAAA,cAAC,QAAK,UAAWC,EAAW,2BAA4B,2BAA4ByJ,CAAS,GAC3F1J,EAAA,cAACU,GAAA,CAAe,UAAWT,EAAW,+BAAgC,+BAAgCyJ,CAAS,EAAG,CACpH,EACE,KACJ1J,EAAA,cAACgB,GAAA,KAAWqB,CAAS,CACvB,CAEJ,CAAC,EACD8G,GAAa,YAAc",
|
|
6
|
+
"names": ["React", "classNames", "useControllableState", "CommandPrimitive", "extractProps", "comboboxRootPropDefs", "comboboxTriggerPropDefs", "comboboxContentPropDefs", "marginPropDefs", "ChevronDownIcon", "ThickCheckIcon", "Theme", "useThemeContext", "requireReactElement", "Popover", "ScrollArea", "Slottable", "SIZE_CLASS_REGEX", "ComboboxConfigContext", "ComboboxSelectionContext", "ComboboxSearchContext", "ComboboxNavigationContext", "useComboboxConfigContext", "caller", "ctx", "useComboboxSelectionContext", "useComboboxSearchContext", "useComboboxNavigationContext", "useComboboxContext", "config", "selection", "search", "navigation", "ComboboxContentContext", "useComboboxContentContext", "ComboboxRoot", "props", "children", "size", "highContrast", "valueProp", "defaultValue", "onValueChange", "openProp", "defaultOpen", "onOpenChange", "placeholder", "searchPlaceholder", "searchValueProp", "defaultSearchValue", "onSearchValueChange", "filter", "shouldFilter", "loop", "disabled", "resetSearchOnSelect", "color", "displayValueProp", "rootProps", "listboxId", "activeDescendantId", "setActiveDescendantId", "open", "setOpen", "value", "setValue", "searchValue", "setSearchValue", "labelMapRef", "selectedLabel", "setSelectedLabel", "registerItemLabel", "itemValue", "label", "unregisterItemLabel", "handleSelect", "nextValue", "resolvedDisplayValue", "configContextValue", "selectionContextValue", "searchContextValue", "navigationContextValue", "ComboboxTrigger", "forwardedRef", "configContext", "selectionContext", "navigationContext", "className", "readOnly", "error", "loading", "radius", "triggerProps", "material", "panelBackground", "isDisabled", "resolvedColor", "ariaProps", "defaultContent", "ComboboxValue", "buttonType", "restTriggerProps", "triggerChild", "valueProps", "displayValue", "fallback", "ComboboxContent", "themeContext", "effectiveMaterial", "sizeProp", "variantProp", "highContrastProp", "forceMount", "container", "contentProps", "sanitizedClassName", "token", "shouldForceMount", "ComboboxInput", "startAdornment", "endAdornment", "inputVariant", "inputProps", "searchContext", "contentContext", "contentVariant", "textFieldVariant", "handleSearchChange", "inputField", "ComboboxList", "listProps", "listRef", "combinedRef", "node", "listNode", "updateActiveDescendant", "itemId", "observer", "ComboboxEmpty", "emptyProps", "ComboboxGroup", "groupProps", "ComboboxLabel", "labelProps", "ComboboxSeparator", "separatorProps", "extractTextFromChildren", "ComboboxItem", "onSelect", "keywords", "itemProps", "extractedLabel", "itemLabel", "isSelected", "sizeClass", "searchKeywords", "contextHandleSelect", "selectedValue"]
|
|
7
7
|
}
|
|
@@ -28,6 +28,8 @@ export interface ShellContextValue {
|
|
|
28
28
|
setSidebarToggleComputer?: (fn: (current: SidebarMode) => SidebarMode) => void;
|
|
29
29
|
onLeftPres?: (p: PresentationValue) => void;
|
|
30
30
|
onLeftDefaults?: (size: number) => void;
|
|
31
|
+
onRailDefaults?: (size: number) => void;
|
|
32
|
+
onPanelDefaults?: (size: number) => void;
|
|
31
33
|
}
|
|
32
34
|
/** @internal Shell root context. Prefer slice hooks (useSidebarMode, useShellActions, etc.). */
|
|
33
35
|
export declare function useShell(): ShellContextValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.context.d.ts","sourceRoot":"","sources":["../../../src/components/shell.context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEzG,MAAM,WAAW,iBAAiB;IAEhC,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACtC,SAAS,EAAE,QAAQ,CAAC;IACpB,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAC5C,aAAa,EAAE,QAAQ,CAAC;IACxB,gBAAgB,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC3C,UAAU,EAAE,QAAQ,CAAC;IACrB,aAAa,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAGxC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