@kushagradhawan/kookie-ui 0.1.124 → 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/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/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/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/combobox.tsx +176 -80
|
@@ -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 ComboboxS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,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 Combobox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B,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
|
}
|
package/package.json
CHANGED
package/schemas/base-button.json
CHANGED
|
@@ -279,6 +279,6 @@
|
|
|
279
279
|
"title": "Base-button Component Props",
|
|
280
280
|
"description": "Props schema for the base-button component in Kookie UI",
|
|
281
281
|
"version": "1.0.0",
|
|
282
|
-
"generatedAt": "2026-01-
|
|
282
|
+
"generatedAt": "2026-01-12T06:28:27.808Z",
|
|
283
283
|
"source": "Zod schema"
|
|
284
284
|
}
|
package/schemas/button.json
CHANGED
|
@@ -530,6 +530,6 @@
|
|
|
530
530
|
"title": "Button Component Props",
|
|
531
531
|
"description": "Props schema for the button component in Kookie UI",
|
|
532
532
|
"version": "1.0.0",
|
|
533
|
-
"generatedAt": "2026-01-
|
|
533
|
+
"generatedAt": "2026-01-12T06:28:27.813Z",
|
|
534
534
|
"source": "Zod schema"
|
|
535
535
|
}
|
package/schemas/icon-button.json
CHANGED
|
@@ -313,6 +313,6 @@
|
|
|
313
313
|
"title": "Icon-button Component Props",
|
|
314
314
|
"description": "Props schema for the icon-button component in Kookie UI",
|
|
315
315
|
"version": "1.0.0",
|
|
316
|
-
"generatedAt": "2026-01-
|
|
316
|
+
"generatedAt": "2026-01-12T06:28:27.814Z",
|
|
317
317
|
"source": "Zod schema"
|
|
318
318
|
}
|
package/schemas/index.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"title": "Kookie UI Button Components",
|
|
4
4
|
"description": "Complete JSON Schema collection for all button components in Kookie UI",
|
|
5
5
|
"version": "1.0.0",
|
|
6
|
-
"generatedAt": "2026-01-
|
|
6
|
+
"generatedAt": "2026-01-12T06:28:27.817Z",
|
|
7
7
|
"source": "Zod schemas",
|
|
8
8
|
"components": {
|
|
9
9
|
"base-button": {
|
|
@@ -287,7 +287,7 @@
|
|
|
287
287
|
"title": "Base-button Component Props",
|
|
288
288
|
"description": "Props schema for the base-button component in Kookie UI",
|
|
289
289
|
"version": "1.0.0",
|
|
290
|
-
"generatedAt": "2026-01-
|
|
290
|
+
"generatedAt": "2026-01-12T06:28:27.808Z",
|
|
291
291
|
"source": "Zod schema"
|
|
292
292
|
},
|
|
293
293
|
"button": {
|
|
@@ -822,7 +822,7 @@
|
|
|
822
822
|
"title": "Button Component Props",
|
|
823
823
|
"description": "Props schema for the button component in Kookie UI",
|
|
824
824
|
"version": "1.0.0",
|
|
825
|
-
"generatedAt": "2026-01-
|
|
825
|
+
"generatedAt": "2026-01-12T06:28:27.813Z",
|
|
826
826
|
"source": "Zod schema"
|
|
827
827
|
},
|
|
828
828
|
"icon-button": {
|
|
@@ -1140,7 +1140,7 @@
|
|
|
1140
1140
|
"title": "Icon-button Component Props",
|
|
1141
1141
|
"description": "Props schema for the icon-button component in Kookie UI",
|
|
1142
1142
|
"version": "1.0.0",
|
|
1143
|
-
"generatedAt": "2026-01-
|
|
1143
|
+
"generatedAt": "2026-01-12T06:28:27.814Z",
|
|
1144
1144
|
"source": "Zod schema"
|
|
1145
1145
|
},
|
|
1146
1146
|
"toggle-button": {
|
|
@@ -1683,7 +1683,7 @@
|
|
|
1683
1683
|
"title": "Toggle-button Component Props",
|
|
1684
1684
|
"description": "Props schema for the toggle-button component in Kookie UI",
|
|
1685
1685
|
"version": "1.0.0",
|
|
1686
|
-
"generatedAt": "2026-01-
|
|
1686
|
+
"generatedAt": "2026-01-12T06:28:27.816Z",
|
|
1687
1687
|
"source": "Zod schema"
|
|
1688
1688
|
},
|
|
1689
1689
|
"toggle-icon-button": {
|
|
@@ -2009,7 +2009,7 @@
|
|
|
2009
2009
|
"title": "Toggle-icon-button Component Props",
|
|
2010
2010
|
"description": "Props schema for the toggle-icon-button component in Kookie UI",
|
|
2011
2011
|
"version": "1.0.0",
|
|
2012
|
-
"generatedAt": "2026-01-
|
|
2012
|
+
"generatedAt": "2026-01-12T06:28:27.817Z",
|
|
2013
2013
|
"source": "Zod schema"
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
@@ -538,6 +538,6 @@
|
|
|
538
538
|
"title": "Toggle-button Component Props",
|
|
539
539
|
"description": "Props schema for the toggle-button component in Kookie UI",
|
|
540
540
|
"version": "1.0.0",
|
|
541
|
-
"generatedAt": "2026-01-
|
|
541
|
+
"generatedAt": "2026-01-12T06:28:27.816Z",
|
|
542
542
|
"source": "Zod schema"
|
|
543
543
|
}
|
|
@@ -321,6 +321,6 @@
|
|
|
321
321
|
"title": "Toggle-icon-button Component Props",
|
|
322
322
|
"description": "Props schema for the toggle-icon-button component in Kookie UI",
|
|
323
323
|
"version": "1.0.0",
|
|
324
|
-
"generatedAt": "2026-01-
|
|
324
|
+
"generatedAt": "2026-01-12T06:28:27.817Z",
|
|
325
325
|
"source": "Zod schema"
|
|
326
326
|
}
|