@bioturing/components 0.33.1 → 0.35.2

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.
Files changed (102) hide show
  1. package/dist/components/base-menu/component.d.ts +12 -0
  2. package/dist/components/base-menu/component.d.ts.map +1 -0
  3. package/dist/components/base-menu/component.js +69 -0
  4. package/dist/components/base-menu/component.js.map +1 -0
  5. package/dist/components/base-menu/index.d.ts +18 -0
  6. package/dist/components/base-menu/index.d.ts.map +1 -0
  7. package/dist/components/base-menu/index.js +11 -0
  8. package/dist/components/base-menu/index.js.map +1 -0
  9. package/dist/components/base-menu/item.css +1 -0
  10. package/dist/components/base-menu/item.d.ts +47 -0
  11. package/dist/components/base-menu/item.d.ts.map +1 -0
  12. package/dist/components/base-menu/item.js +73 -0
  13. package/dist/components/base-menu/item.js.map +1 -0
  14. package/dist/components/base-menu/style.css +1 -0
  15. package/dist/components/breadcrumb/component.d.ts +3 -2
  16. package/dist/components/breadcrumb/component.d.ts.map +1 -1
  17. package/dist/components/breadcrumb/component.js +138 -38
  18. package/dist/components/breadcrumb/component.js.map +1 -1
  19. package/dist/components/breadcrumb/index.d.ts +1 -0
  20. package/dist/components/breadcrumb/index.d.ts.map +1 -1
  21. package/dist/components/breadcrumb/item.d.ts +3 -0
  22. package/dist/components/breadcrumb/item.d.ts.map +1 -0
  23. package/dist/components/breadcrumb/item.js +19 -0
  24. package/dist/components/breadcrumb/item.js.map +1 -0
  25. package/dist/components/breadcrumb/style.css +1 -1
  26. package/dist/components/breadcrumb/types.d.ts +9 -2
  27. package/dist/components/breadcrumb/types.d.ts.map +1 -1
  28. package/dist/components/code-block/component.d.ts +1 -1
  29. package/dist/components/code-block/component.d.ts.map +1 -1
  30. package/dist/components/code-block/component.js +80 -71
  31. package/dist/components/code-block/component.js.map +1 -1
  32. package/dist/components/code-block/types.d.ts +17 -0
  33. package/dist/components/code-block/types.d.ts.map +1 -1
  34. package/dist/components/combobox/component.d.ts +3 -26
  35. package/dist/components/combobox/component.d.ts.map +1 -1
  36. package/dist/components/combobox/component.js +326 -216
  37. package/dist/components/combobox/component.js.map +1 -1
  38. package/dist/components/combobox/style.css +1 -1
  39. package/dist/components/command-palette/component.js +6 -6
  40. package/dist/components/command-palette/component.js.map +1 -1
  41. package/dist/components/dropdown-menu/component.d.ts.map +1 -1
  42. package/dist/components/dropdown-menu/component.js +90 -87
  43. package/dist/components/dropdown-menu/component.js.map +1 -1
  44. package/dist/components/dropdown-menu/divider.d.ts.map +1 -1
  45. package/dist/components/dropdown-menu/divider.js +17 -10
  46. package/dist/components/dropdown-menu/divider.js.map +1 -1
  47. package/dist/components/dropdown-menu/item.d.ts +19 -9
  48. package/dist/components/dropdown-menu/item.d.ts.map +1 -1
  49. package/dist/components/dropdown-menu/item.js +71 -130
  50. package/dist/components/dropdown-menu/item.js.map +1 -1
  51. package/dist/components/dropdown-menu/style.css +1 -1
  52. package/dist/components/dropdown-menu/useDropdownMenu.d.ts.map +1 -1
  53. package/dist/components/dropdown-menu/useDropdownMenu.js +60 -63
  54. package/dist/components/dropdown-menu/useDropdownMenu.js.map +1 -1
  55. package/dist/components/field/component.d.ts +5 -1
  56. package/dist/components/field/component.d.ts.map +1 -1
  57. package/dist/components/field/component.js +29 -20
  58. package/dist/components/field/component.js.map +1 -1
  59. package/dist/components/popup-panel/component.d.ts.map +1 -1
  60. package/dist/components/popup-panel/component.js +101 -101
  61. package/dist/components/popup-panel/component.js.map +1 -1
  62. package/dist/components/scroll-area/component.d.ts +1 -1
  63. package/dist/components/scroll-area/component.d.ts.map +1 -1
  64. package/dist/components/scroll-area/component.js +74 -58
  65. package/dist/components/scroll-area/component.js.map +1 -1
  66. package/dist/components/select-trigger/component.d.ts +71 -9
  67. package/dist/components/select-trigger/component.d.ts.map +1 -1
  68. package/dist/components/select-trigger/component.js +180 -139
  69. package/dist/components/select-trigger/component.js.map +1 -1
  70. package/dist/components/select-trigger/index.d.ts +1 -2
  71. package/dist/components/select-trigger/index.d.ts.map +1 -1
  72. package/dist/components/select-trigger/style.css +1 -1
  73. package/dist/components/table/component.d.ts.map +1 -1
  74. package/dist/components/table/component.js +53 -52
  75. package/dist/components/table/component.js.map +1 -1
  76. package/dist/components/theme-provider/style.css +1 -1
  77. package/dist/components/truncate/component.d.ts.map +1 -1
  78. package/dist/components/truncate/component.js +84 -80
  79. package/dist/components/truncate/component.js.map +1 -1
  80. package/dist/components/truncate/helpers.d.ts +9 -0
  81. package/dist/components/truncate/helpers.d.ts.map +1 -1
  82. package/dist/components/truncate/helpers.js +70 -40
  83. package/dist/components/truncate/helpers.js.map +1 -1
  84. package/dist/components/truncate/index.d.ts +1 -0
  85. package/dist/components/truncate/index.d.ts.map +1 -1
  86. package/dist/components/truncate/useOverflowDetection.d.ts +19 -0
  87. package/dist/components/truncate/useOverflowDetection.d.ts.map +1 -0
  88. package/dist/components/truncate/useOverflowDetection.js +54 -0
  89. package/dist/components/truncate/useOverflowDetection.js.map +1 -0
  90. package/dist/components/utils/WithRenderProp.d.ts.map +1 -1
  91. package/dist/components/utils/WithRenderProp.js +10 -10
  92. package/dist/components/utils/WithRenderProp.js.map +1 -1
  93. package/dist/components/vertical-collapsible-panel/component.d.ts +14 -0
  94. package/dist/components/vertical-collapsible-panel/component.d.ts.map +1 -1
  95. package/dist/components/vertical-collapsible-panel/component.js +82 -75
  96. package/dist/components/vertical-collapsible-panel/component.js.map +1 -1
  97. package/dist/components/vertical-collapsible-panel/style.css +1 -1
  98. package/dist/index.js +230 -224
  99. package/dist/index.js.map +1 -1
  100. package/dist/stats.html +1 -1
  101. package/package.json +5 -6
  102. package/dist/components/dropdown-menu/item.css +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/combobox/component.tsx"],"sourcesContent":["\"use client\";\nimport DisabledContext from \"antd/es/config-provider/DisabledContext\";\nimport { FormItemInputContext } from \"antd/es/form/context\";\nimport { ValidateStatus } from \"antd/es/form/FormItem\";\nimport type { PopoverProps } from \"antd/es/popover\";\nimport React, {\n ForwardedRef,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n} from \"react\";\nimport {\n DropdownMenu,\n DropdownMenuItem,\n DropdownMenuProps,\n type DropdownMenuItemType,\n} from \"../dropdown-menu\";\nimport { SelectTrigger } from \"../select-trigger\";\nimport { clsx, reactNodeToString, useCls } from \"../utils\";\n\n// Import component-specific styles\nimport { DropdownMenuDivider } from \"../dropdown-menu/divider\";\nimport { useControlledState } from \"../hooks\";\nimport \"./style.css\";\n\nexport type ComboboxOption<\n T extends React.Key,\n O extends Record<string, unknown> = {}\n> = {\n value: T;\n label: React.ReactNode;\n disabled?: boolean;\n icon?: React.ReactNode;\n} & O;\n\nexport interface ComboboxProps<\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {}\n> {\n /** Array of options to be displayed in the combobox */\n options?: ComboboxOption<T, O>[];\n /** Current value of the combobox */\n value?: M extends true ? T[] : T;\n /** Default value when uncontrolled */\n defaultValue?: M extends true ? T[] : T;\n /** Callback when value changes */\n onChange?: (value: M extends true ? T[] : T) => void;\n /** Placeholder text for the input */\n placeholder?: string;\n /** Whether the combobox is disabled */\n disabled?: boolean;\n /** Validation status */\n status?: ValidateStatus;\n /** Whether to allow clearing the selection */\n allowClear?: boolean;\n /** Whether to allow multiple selections */\n multiple?: M;\n /** Maximum number of tags to show */\n maxTagCount?: number;\n /** Whether to show search functionality */\n showSearch?: boolean;\n /** Controlled open state */\n open?: boolean;\n /** Callback when open state changes */\n onOpenChange?: (open: boolean) => void;\n /** Placement of the dropdown */\n placement?: PopoverProps[\"placement\"];\n /** Custom className for the component */\n className?: string;\n /** Custom class names for different parts */\n classNames?: {\n trigger?: string;\n input?: string;\n option?: string;\n optionIcon?: string;\n optionText?: string;\n };\n /** Size of the combobox */\n size?: \"small\" | \"middle\" | \"large\";\n /** Loading state */\n loading?: boolean;\n /** Custom render for options */\n optionRender?: (\n option: ComboboxOption<T, O>,\n props: React.HTMLAttributes<HTMLElement>\n ) => React.ReactElement;\n /** Filter function for search */\n filterOption?:\n | boolean\n | ((input: string, option: ComboboxOption<T, O>) => boolean);\n /** Callback when search input changes */\n onSearch?: (value: string) => void;\n /** Custom dropdown render */\n dropdownRender?: (menu: React.ReactElement) => React.ReactElement;\n /** Custom clear icon */\n clearIcon?: React.ReactNode;\n /** Custom suffix icon */\n suffixIcon?: React.ReactNode;\n /**\n * Props to pass to the dropdown menu\n */\n dropdownMenuProps?: DropdownMenuProps;\n /**\n * Props to pass to the combobox trigger\n */\n triggerProps?: React.ComponentPropsWithoutRef<typeof SelectTrigger>;\n searchProps?: {\n placeholder?: string;\n onValueChange?: (value: string) => void;\n value?: string;\n };\n /**\n * Show selection summary instead of individual tags when multiple\n * @default false\n */\n showSelectionSummary?: boolean;\n /**\n * Render function for the selection summary in multiple case\n * @default (selectedValues) => `${selectedValues.length} items selected`\n */\n selectionSummaryRender?: (selectedValues: T[]) => React.ReactNode;\n /**\n * Show select all option when in multiple mode\n * @default false\n */\n showSelectAll?: boolean;\n /**\n * Render function for the select all option\n */\n selectAllRender?: (props: {\n onSelectAll: () => void;\n onDeselectAll: () => void;\n checked: boolean;\n indeterminate: boolean;\n }) => React.ReactNode;\n /**\n * Function to extract keywords from the item for search filtering\n * @default (option) => [String(option.key), reactNodeToString(option.label)]\n */\n getOptionKeywords?: (option: ComboboxOption<T, O>) => string[];\n /**\n * Render function for the option label\n */\n optionLabelRender?: (\n option: ComboboxOption<T, O>,\n props?: React.HTMLAttributes<HTMLElement>\n ) => React.ReactElement;\n}\n\nconst ComboboxInner = <\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {}\n>(\n {\n options = [],\n value: controlledValue,\n defaultValue,\n onChange,\n placeholder = \"Select...\",\n disabled: disabledProp = false,\n status: statusProp,\n allowClear = false,\n multiple = false as M,\n maxTagCount,\n showSearch = true,\n open: controlledOpen,\n onOpenChange,\n placement = \"bottomLeft\",\n className,\n classNames,\n size = \"middle\",\n loading: _loading = false,\n optionRender,\n onSearch,\n dropdownRender,\n clearIcon,\n suffixIcon,\n dropdownMenuProps,\n triggerProps,\n searchProps,\n showSelectionSummary = false,\n selectionSummaryRender,\n showSelectAll = false,\n selectAllRender,\n optionLabelRender,\n getOptionKeywords = (option: ComboboxOption<T, O>) => [\n String(option.value),\n reactNodeToString(option.label),\n ],\n ...rest\n }: ComboboxProps<T, M, O>,\n ref: React.ForwardedRef<HTMLDivElement>\n) => {\n const [value, setValue] = useControlledState(\n controlledValue,\n onChange,\n defaultValue !== undefined ? defaultValue : multiple ? [] : undefined\n );\n\n const [open, setOpen] = useControlledState(\n controlledOpen,\n onOpenChange,\n false\n );\n const cls = useCls();\n\n // Get form context values\n const {\n status: contextStatus,\n // hasFeedback,\n // feedbackIcon,\n } = useContext(FormItemInputContext);\n const contextDisabled = useContext(DisabledContext);\n\n // Merge context values with props\n const mergedStatus = statusProp || contextStatus;\n const disabled = disabledProp || contextDisabled;\n\n const handleValueChange = useCallback(\n (newValue: M extends true ? T[] : T) => {\n setValue(newValue);\n onChange?.(newValue);\n },\n [setValue, onChange]\n );\n\n const handleOptionSelect = useCallback(\n (optionValue: T) => {\n if (multiple) {\n const currentValues = (Array.isArray(value) ? value : []) as T[];\n const newValues = currentValues.includes(optionValue)\n ? currentValues.filter((v) => v !== optionValue)\n : [...currentValues, optionValue];\n (handleValueChange as (v: T[]) => void)(newValues);\n } else {\n (handleValueChange as (v: T) => void)(optionValue);\n // onOpenChange?.(false);\n }\n },\n [multiple, value, handleValueChange]\n );\n\n const handleSelectAll = useCallback(() => {\n if (multiple) {\n const allValues = options.map((option) => option.value);\n (handleValueChange as (v: T[]) => void)(allValues);\n }\n }, [multiple, options, handleValueChange]);\n\n const handleDeselectAll = useCallback(() => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)([]);\n }\n }, [multiple, handleValueChange]);\n\n // Convert options to DropdownMenu items\n const dropdownItems: DropdownMenuItemType[] = useMemo(() => {\n return options.map((option) => {\n return {\n type: \"item\",\n // todo: make this type better\n key: option.value as React.Key,\n icon: option.icon,\n label: option.label,\n disabled: option.disabled,\n onClick: () => !option.disabled && handleOptionSelect(option.value),\n };\n });\n }, [options, handleOptionSelect]);\n\n // Select all component for beforeList\n const selectAllComponent = useMemo(() => {\n if (!showSelectAll || !multiple || options.length === 0) {\n return null;\n }\n\n const selectedValues = Array.isArray(value) ? value : [];\n const filteredOptionValues = options.map((opt) => opt.value);\n const selectedFromFiltered = selectedValues.filter((val) =>\n filteredOptionValues.includes(val)\n );\n const checked =\n selectedFromFiltered.length === options.length && options.length > 0;\n const indeterminate =\n selectedFromFiltered.length > 0 &&\n selectedFromFiltered.length < options.length;\n\n const selectAllItem: DropdownMenuItemType & { type: \"item\" } = {\n type: \"item\",\n key: \"select_all\",\n label: \"Select All\",\n onClick: () => {\n if (indeterminate || checked) {\n handleDeselectAll();\n } else {\n handleSelectAll();\n }\n },\n };\n\n return (\n <>\n <DropdownMenuItem\n key=\"select_all\"\n item={selectAllItem}\n inCombobox={showSearch}\n selected={checked}\n showCheckbox\n indeterminate={indeterminate}\n renderAsNativeElement\n onSelect={() => {\n if (indeterminate || checked) {\n handleDeselectAll();\n } else {\n handleSelectAll();\n }\n }}\n />\n <DropdownMenuDivider />\n </>\n );\n }, [\n showSelectAll,\n multiple,\n options,\n value,\n showSearch,\n handleDeselectAll,\n handleSelectAll,\n ]);\n\n // Prepare trigger data\n const selectedValues = useMemo(() => {\n return Array.isArray(value) ? value : value ? [value] : [];\n }, [value]);\n const selectedOptions = selectedValues\n .map((val) => options.find((opt) => opt.value === val))\n .filter(Boolean);\n\n // Generate display value and prefix for SelectTrigger\n const { displayValue, displayPrefix } = useMemo(() => {\n if (selectedOptions.length === 0) {\n return { displayValue: undefined, displayPrefix: undefined };\n }\n\n if (multiple) {\n const summaryText = `${selectedOptions.length} ${\n selectedOptions.length === 1 ? \"item\" : \"items\"\n } selected`;\n if (showSelectionSummary) {\n if (selectionSummaryRender) {\n return {\n displayValue: selectionSummaryRender(selectedValues),\n displayPrefix: undefined,\n };\n }\n // Default summary with icons\n return {\n displayValue: summaryText,\n // TODO: Create icon component for multiple selection summary\n displayPrefix: undefined,\n };\n }\n // For non-summary multiple selection\n return selectedOptions.length === 1\n ? {\n displayValue: selectedOptions[0].label,\n displayPrefix: selectedOptions[0].icon,\n }\n : {\n displayValue: summaryText,\n displayPrefix: undefined,\n };\n }\n\n // Single selection\n const selectedOption = selectedOptions[0];\n return {\n displayValue: selectedOption?.label,\n displayPrefix: selectedOption?.icon,\n };\n }, [\n selectedOptions,\n multiple,\n showSelectionSummary,\n selectionSummaryRender,\n selectedValues,\n ]);\n\n return (\n <div ref={ref} className={clsx(cls(\"combobox\"), className)} {...rest}>\n <DropdownMenu\n items={dropdownItems}\n open={open}\n onOpenChange={setOpen}\n placement={placement}\n showSearch={showSearch}\n searchProps={{\n placeholder: \"Search options...\",\n ...searchProps,\n }}\n className={clsx(cls(\"combobox-dropdown\"))}\n classNames={{\n trigger: clsx(cls(\"combobox-trigger-wrapper\")),\n popup: clsx(cls(\"combobox-popup\")),\n item: clsx(cls(\"combobox-option\"), classNames?.option),\n ...classNames,\n }}\n popupMatchTriggerWidth\n keepOpenOnSelect={multiple}\n highlightedItemKey={multiple ? undefined : selectedValues[0]}\n showCheckbox={multiple}\n beforeList={selectAllComponent}\n selectedItemKeys={selectedValues}\n getItemKeywords={\n getOptionKeywords\n ? (item) => {\n const selectedOption = options.find(\n (option) => option.value === item.key\n );\n if (!selectedOption) {\n return [];\n }\n return getOptionKeywords(selectedOption);\n }\n : undefined\n }\n itemLabelRender={\n optionLabelRender\n ? (item, props) => {\n const selectedOption = options.find(\n (option) => option.value === item.key\n );\n if (!selectedOption) {\n return null;\n }\n return optionLabelRender?.(selectedOption, props);\n }\n : undefined\n }\n {...dropdownMenuProps}\n >\n <SelectTrigger\n value={displayValue}\n prefix={displayPrefix}\n placeholder={placeholder}\n disabled={disabled}\n status={mergedStatus}\n open={open}\n size={size}\n allowClear={allowClear}\n suffixIcon={suffixIcon}\n clearIcon={clearIcon}\n classNames={{\n trigger: classNames?.trigger,\n ...triggerProps?.classNames,\n }}\n onClear={() => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)([]);\n } else {\n handleValueChange(undefined);\n }\n }}\n onOpenChange={setOpen}\n role=\"combobox\"\n {...triggerProps}\n />\n </DropdownMenu>\n </div>\n );\n};\n\nconst MainCombobox = forwardRef(ComboboxInner) as <\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {}\n>(\n props: ComboboxProps<T, M, O> & { ref?: ForwardedRef<HTMLDivElement> }\n) => ReturnType<typeof ComboboxInner>;\n\nexport const Combobox = Object.assign(MainCombobox, {\n // Add any sub components here if needed\n});\n\nexport default Combobox;\n"],"names":["ComboboxInner","options","controlledValue","defaultValue","onChange","placeholder","disabledProp","statusProp","allowClear","multiple","maxTagCount","showSearch","controlledOpen","onOpenChange","placement","className","classNames","size","_loading","optionRender","onSearch","dropdownRender","clearIcon","suffixIcon","dropdownMenuProps","triggerProps","searchProps","showSelectionSummary","selectionSummaryRender","showSelectAll","selectAllRender","optionLabelRender","getOptionKeywords","option","reactNodeToString","rest","ref","value","setValue","useControlledState","open","setOpen","cls","useCls","contextStatus","useContext","FormItemInputContext","contextDisabled","DisabledContext","mergedStatus","disabled","handleValueChange","useCallback","newValue","handleOptionSelect","optionValue","currentValues","newValues","v","handleSelectAll","allValues","handleDeselectAll","dropdownItems","useMemo","selectAllComponent","selectedValues","filteredOptionValues","opt","selectedFromFiltered","val","checked","indeterminate","jsxs","Fragment","jsx","DropdownMenuItem","DropdownMenuDivider","selectedOptions","displayValue","displayPrefix","summaryText","selectedOption","clsx","DropdownMenu","item","props","SelectTrigger","MainCombobox","forwardRef","Combobox"],"mappings":";;;;;;;;;;;;;;AAuJA,MAAMA,KAAgB,CAKpB;AAAA,EACE,SAAAC,IAAU,CAAA;AAAA,EACV,OAAOC;AAAA,EACP,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAA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AoBA,IAAW,SAAYwD,EAAe,CAAC;AAAA,MAC3D,cAAcxD;AAAA,MACd,YAAYuD;AAAA,MACZ,kBAAkBC;AAAA,MAClB,iBACEjC,IACI,CAACoD,MAAS;AACR,cAAMH,IAAiBhF,EAAQ;AAAA,UAC7B,CAACgC,MAAWA,EAAO,UAAUmD,EAAK;AAAA,QAAA;AAEpC,eAAKH,IAGEjD,EAAkBiD,CAAc,IAF9B,CAAA;AAAA,MAGX,IACA;AAAA,MAEN,iBACElD,IACI,CAACqD,GAAMC,MAAU;AACf,cAAMJ,IAAiBhF,EAAQ;AAAA,UAC7B,CAACgC,MAAWA,EAAO,UAAUmD,EAAK;AAAA,QAAA;AAEpC,eAAKH,IAGElD,IAAoBkD,GAAgBI,CAAK,IAFvC;AAAA,MAGX,IACA;AAAA,MAEL,GAAG7D;AAAA,MAEJ,UAAA,gBAAAkD;AAAA,QAACY;AAAA,QAAA;AAAA,UACC,OAAOR;AAAA,UACP,QAAQC;AAAA,UACR,aAAA1E;AAAA,UACA,UAAA6C;AAAA,UACA,QAAQD;AAAA,UACR,MAAAT;AAAA,UACA,MAAAvB;AAAA,UACA,YAAAT;AAAA,UACA,YAAAe;AAAA,UACA,WAAAD;AAAA,UACA,YAAY;AAAA,YACV,SAASN,GAAY;AAAA,YACrB,GAAGS,GAAc;AAAA,UAAA;AAAA,UAEnB,SAAS,MAAM;AACb,YACG0B,EADC1C,IACsC,CAAA,IAEtB,MAFwB;AAAA,UAI9C;AAAA,UACA,cAAcgC;AAAA,UACd,MAAK;AAAA,UACJ,GAAGhB;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA,GAEJ;AAEJ,GAEM8D,KAAeC,GAAWxF,EAAa,GAQhCyF,KAAW,OAAO,OAAOF,IAAc;AAAA;AAEpD,CAAC;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/combobox/component.tsx"],"sourcesContent":["\"use client\";\nimport { Combobox as BaseCombobox } from \"@base-ui-components/react/combobox\";\nimport DisabledContext from \"antd/es/config-provider/DisabledContext\";\nimport { FormItemInputContext } from \"antd/es/form/context\";\nimport { ValidateStatus } from \"antd/es/form/FormItem\";\nimport type { PopoverProps } from \"antd/es/popover\";\nimport React, {\n ForwardedRef,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n useRef,\n} from \"react\";\nimport { BaseMenuItem } from \"../base-menu\";\nimport { useControlledState } from \"../hooks\";\nimport { SelectTrigger } from \"../select-trigger\";\nimport { clsx, reactNodeToString, useCls } from \"../utils\";\n\nimport { XIcon } from \"@bioturing/assets\";\nimport { BaseMenu } from \"../base-menu\";\nimport { Empty } from \"../empty\";\nimport \"./style.css\";\n\nexport type ComboboxOption<\n T extends React.Key,\n O extends Record<string, unknown> = {}\n> = {\n value: T;\n label: React.ReactNode;\n disabled?: boolean;\n icon?: React.ReactNode;\n} & O;\n\nexport interface ComboboxProps<\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {}\n> {\n /** Array of options to be displayed in the combobox */\n options?: ComboboxOption<T, O>[];\n /** Current value of the combobox */\n value?: M extends true ? T[] : T;\n /** Default value when uncontrolled */\n defaultValue?: M extends true ? T[] : T;\n /** Callback when value changes */\n onChange?: (value: M extends true ? T[] : T) => void;\n /** Placeholder text for the input */\n placeholder?: string;\n /** Whether the combobox is disabled */\n disabled?: boolean;\n /** Validation status */\n status?: ValidateStatus;\n /** Whether to allow clearing the selection */\n allowClear?: boolean;\n /** Whether to allow multiple selections */\n multiple?: M;\n /** Maximum number of tags to show */\n maxTagCount?: number;\n /** Whether to show search functionality */\n showSearch?: boolean;\n /** Controlled open state */\n open?: boolean;\n /** Callback when open state changes */\n onOpenChange?: (open: boolean) => void;\n /** Placement of the dropdown */\n placement?: PopoverProps[\"placement\"];\n /** Custom className for the component */\n className?: string;\n /** Custom class names for different parts */\n classNames?: {\n trigger?: string;\n input?: string;\n option?: string;\n optionIcon?: string;\n optionText?: string;\n list?: string;\n portal?: string;\n };\n /** Size of the combobox */\n size?: \"small\" | \"middle\" | \"large\";\n /** Loading state */\n loading?: boolean;\n /** Custom render for options */\n optionRender?: (\n option: ComboboxOption<T, O>,\n props: React.HTMLAttributes<HTMLElement>\n ) => React.ReactElement;\n /** Filter function for search */\n filterOption?:\n | boolean\n | ((input: string, option: ComboboxOption<T, O>) => boolean);\n /** Callback when search input changes */\n onSearch?: (value: string) => void;\n /** Custom dropdown render */\n dropdownRender?: (menu: React.ReactElement) => React.ReactElement;\n /** Custom clear icon */\n clearIcon?: React.ReactNode;\n /** Custom suffix icon */\n suffixIcon?: React.ReactNode;\n // /**\n // * Show selection summary instead of individual tags when multiple\n // * @default false\n // */\n // showSelectionSummary?: boolean;\n // /**\n // * Render function for the selection summary in multiple case\n // * @default (selectedValues) => `${selectedValues.length} items selected`\n // */\n // selectionSummaryRender?: (selectedValues: T[]) => React.ReactNode;\n /**\n * Show select all option when in multiple mode\n * @default false\n */\n showSelectAll?: boolean;\n /**\n * Render function for the select all option\n */\n selectAllRender?: (props: {\n onSelectAll: () => void;\n onDeselectAll: () => void;\n checked: boolean;\n indeterminate: boolean;\n }) => React.ReactNode;\n /**\n * Function to extract keywords from the item for search filtering\n * @default (option) => [String(option.key), reactNodeToString(option.label)]\n */\n getOptionKeywords?: (option: ComboboxOption<T, O>) => string[];\n /**\n * Render function for the option label\n */\n optionLabelRender?: (\n option: ComboboxOption<T, O>,\n props?: React.HTMLAttributes<HTMLElement>\n ) => React.ReactElement;\n}\n\nconst ComboboxInner = <\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {}\n>(\n {\n options = [],\n value: controlledValue,\n defaultValue,\n onChange,\n placeholder = \"Select...\",\n disabled: disabledProp = false,\n status: statusProp,\n allowClear = false,\n multiple = false as M,\n showSearch: _showSearch = true,\n open: controlledOpen,\n onOpenChange,\n className,\n classNames,\n size = \"middle\",\n optionRender,\n onSearch,\n clearIcon,\n suffixIcon,\n // showSelectionSummary: _showSelectionSummary = false,\n // selectionSummaryRender,\n showSelectAll = false,\n optionLabelRender,\n getOptionKeywords: _getOptionKeywords = (option: ComboboxOption<T, O>) => [\n String(option.value),\n reactNodeToString(option.label),\n ],\n ...rest\n }: ComboboxProps<T, M, O>,\n ref: React.ForwardedRef<HTMLDivElement>\n) => {\n const [value, setValue] = useControlledState(\n controlledValue,\n onChange,\n defaultValue !== undefined\n ? defaultValue\n : multiple\n ? ([] as T[])\n : undefined\n );\n\n const [open, setOpen] = useControlledState(\n controlledOpen,\n onOpenChange,\n false\n );\n\n const cls = useCls();\n const inputContainerRef = useRef<HTMLDivElement>(null);\n\n // Get form context values\n const { status: contextStatus } = useContext(FormItemInputContext);\n const contextDisabled = useContext(DisabledContext);\n\n // Merge context values with props\n const mergedStatus = statusProp || contextStatus;\n const disabled = disabledProp || contextDisabled;\n\n const handleValueChange = useCallback(\n (newValue: M extends true ? T[] : T) => {\n setValue(newValue);\n onChange?.(newValue);\n },\n [setValue, onChange]\n );\n\n const handleSelectAll = useCallback(() => {\n if (multiple) {\n const allValues = options.map((option) => option.value);\n (handleValueChange as (v: T[]) => void)(allValues);\n }\n }, [multiple, options, handleValueChange]);\n\n const handleDeselectAll = useCallback(() => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)([]);\n }\n }, [multiple, handleValueChange]);\n\n const handleClear = useCallback(() => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)([]);\n } else {\n (handleValueChange as (v: T) => void)(undefined as T);\n }\n }, [multiple, handleValueChange]);\n\n // Prepare selected values\n const selectedValues = useMemo(() => {\n return Array.isArray(value) ? value : value ? [value] : [];\n }, [value]);\n\n // Select all option logic\n const selectAllOption = useMemo(() => {\n if (!showSelectAll || !multiple || options.length === 0) {\n return null;\n }\n\n const selectedFromFiltered = selectedValues.filter((val) =>\n options.some((opt) => opt.value === val)\n );\n const checked =\n selectedFromFiltered.length === options.length && options.length > 0;\n const indeterminate =\n selectedFromFiltered.length > 0 &&\n selectedFromFiltered.length < options.length;\n\n return {\n checked,\n indeterminate,\n onToggle: () => {\n if (indeterminate || checked) {\n handleDeselectAll();\n } else {\n handleSelectAll();\n }\n },\n };\n }, [\n showSelectAll,\n multiple,\n options,\n selectedValues,\n handleDeselectAll,\n handleSelectAll,\n ]);\n\n // Convert options to Base UI format\n const baseUIItems = useMemo(() => options.map((opt) => opt.value), [options]);\n\n // Get display value for SelectTrigger\n const displayValue = useMemo(() => {\n if (multiple) {\n return selectedValues.length > 0\n ? `${selectedValues.length} item${\n selectedValues.length === 1 ? \"\" : \"s\"\n } selected`\n : null;\n } else {\n const selectedOption = options.find(\n (opt) => opt.value === selectedValues[0]\n );\n return selectedOption?.label || null;\n }\n }, [multiple, selectedValues, options]);\n\n const inputClassName = clsx(\n cls(\"combobox-input\"),\n cls(`combobox-input-${size}`),\n mergedStatus && cls(`combobox-input-${mergedStatus}`),\n classNames?.input\n );\n\n return (\n <div ref={ref} className={clsx(cls(\"combobox\"), className)} {...rest}>\n <BaseCombobox.Root<T, T, M>\n value={\n (multiple\n ? selectedValues\n : selectedValues[0] ?? null) as M extends true ? T[] : T | null\n }\n onValueChange={(newValue) => {\n if (multiple) {\n (handleValueChange as (v: T[]) => void)(\n Array.isArray(newValue) ? (newValue as T[]) : []\n );\n } else {\n (handleValueChange as (v: T) => void)(newValue as T);\n }\n }}\n open={open}\n onOpenChange={setOpen}\n multiple={multiple}\n disabled={disabled}\n items={baseUIItems}\n itemToStringLabel={(itemValue) => {\n const option = options.find((opt) => opt.value === itemValue);\n return reactNodeToString(option?.label || String(itemValue));\n }}\n >\n {/* Single Selection Layout using SelectTrigger compound components */}\n {!multiple ? (\n <SelectTrigger.Root\n ref={inputContainerRef}\n as=\"div\"\n size={size}\n disabled={disabled}\n open={open}\n status={mergedStatus}\n placeholder={placeholder}\n displayValue={displayValue}\n allowClear={allowClear}\n suffixIcon={suffixIcon}\n clearIcon={clearIcon}\n onClear={handleClear}\n onOpenChange={setOpen}\n className={clsx(\n classNames?.trigger,\n cls(\"combobox-trigger-single\")\n )}\n >\n <SelectTrigger.Content\n contentRender={({ className, children, ...rest }) => (\n <BaseCombobox.Input\n placeholder={placeholder}\n className={clsx(className, inputClassName)}\n disabled={disabled}\n onChange={(event) => {\n onSearch?.(event.target.value);\n }}\n {...rest}\n />\n )}\n />\n <SelectTrigger.Clear\n render={(props) => (\n <BaseCombobox.Clear {...props}></BaseCombobox.Clear>\n )}\n />\n <SelectTrigger.Arrow\n render={(props, { icon }) => (\n <BaseCombobox.Trigger {...props}>\n <BaseCombobox.Icon>{icon}</BaseCombobox.Icon>\n </BaseCombobox.Trigger>\n )}\n />\n </SelectTrigger.Root>\n ) : (\n /* Multiple Selection Layout using SelectTrigger compound components */\n <SelectTrigger.Root\n ref={inputContainerRef}\n size={size}\n disabled={disabled}\n open={open}\n status={mergedStatus}\n placeholder={placeholder}\n displayValue={displayValue}\n allowClear={allowClear}\n suffixIcon={suffixIcon}\n clearIcon={clearIcon}\n onClear={handleClear}\n onOpenChange={setOpen}\n className={clsx(\n classNames?.trigger,\n cls(\"combobox-trigger-multiple\")\n )}\n as=\"div\"\n >\n <SelectTrigger.Content\n contentRender={({ className, children, ...rest }) => (\n <BaseCombobox.Chips\n className={clsx(cls(\"combobox-chips\"), className)}\n {...rest}\n >\n <BaseCombobox.Value>\n {(selectedItems) => (\n <>\n {selectedItems.map((item: T) => {\n const option = options.find(\n (opt) => opt.value === item\n );\n return (\n <BaseCombobox.Chip\n key={item}\n className={clsx(cls(\"combobox-chip\"))}\n >\n {option?.icon && (\n <span\n className={clsx(cls(\"combobox-chip-icon\"))}\n >\n {option.icon}\n </span>\n )}\n <span className={clsx(cls(\"combobox-chip-text\"))}>\n {option\n ? optionLabelRender\n ? optionLabelRender(option)\n : option.label\n : item}\n </span>\n <BaseCombobox.ChipRemove\n className={clsx(cls(\"combobox-chip-remove\"))}\n >\n <XIcon />\n </BaseCombobox.ChipRemove>\n </BaseCombobox.Chip>\n );\n })}\n\n <BaseCombobox.Input\n placeholder={\n selectedItems.length > 0 ? \"\" : placeholder\n }\n className={inputClassName}\n disabled={disabled}\n onChange={(event) => {\n onSearch?.(event.target.value);\n }}\n />\n </>\n )}\n </BaseCombobox.Value>\n </BaseCombobox.Chips>\n )}\n />\n <SelectTrigger.Clear\n render={(props) => (\n <BaseCombobox.Clear {...props}></BaseCombobox.Clear>\n )}\n />\n <SelectTrigger.Arrow\n render={(props, { icon }) => (\n <BaseCombobox.Trigger {...props}>\n <BaseCombobox.Icon>{icon}</BaseCombobox.Icon>\n </BaseCombobox.Trigger>\n )}\n />\n </SelectTrigger.Root>\n )}\n\n <BaseCombobox.Portal>\n <BaseCombobox.Positioner\n anchor={inputContainerRef.current}\n sideOffset={4}\n render={(props) => <BaseMenu.Root {...props}></BaseMenu.Root>}\n >\n <BaseCombobox.Popup\n className={clsx(cls(\"combobox-popup\"), classNames?.portal)}\n render={(props) => <BaseMenu.Popup {...props}></BaseMenu.Popup>}\n >\n {/* Select All Option */}\n {selectAllOption && (\n <>\n <BaseMenuItem\n as=\"button\"\n type=\"button\"\n className={clsx(cls(\"combobox-select-all\"))}\n selected={selectAllOption.checked}\n onClick={selectAllOption.onToggle}\n indeterminate={selectAllOption.indeterminate}\n showCheckbox\n >\n Select All\n </BaseMenuItem>\n <BaseCombobox.Separator\n render={(props) => <BaseMenu.Divider {...props} />}\n />\n </>\n )}\n <BaseCombobox.List\n className={clsx(cls(\"combobox-list\"), classNames?.list)}\n render={(props) => <BaseMenu.List {...props}></BaseMenu.List>}\n >\n {(item: T) => {\n const option = options.find((opt) => opt.value === item);\n const isSelected = (selectedValues as T[]).includes(item);\n return optionRender ? (\n optionRender(option, {})\n ) : (\n <BaseMenuItem\n key={option.value}\n disabled={option.disabled}\n selected={isSelected}\n showCheckbox={multiple}\n icon={option.icon}\n classNames={{\n root: clsx(classNames?.option),\n icon: classNames?.optionIcon,\n text: classNames?.optionText,\n }}\n labelRender={\n optionLabelRender\n ? (props: React.HTMLAttributes<HTMLElement>) =>\n optionLabelRender(option, props)\n : undefined\n }\n render={(props: React.HTMLAttributes<HTMLElement>) => (\n <BaseCombobox.Item\n value={item as T}\n disabled={option.disabled}\n {...props}\n data-disabled={option.disabled}\n data-selected={isSelected}\n />\n )}\n >\n {option.label}\n </BaseMenuItem>\n );\n }}\n </BaseCombobox.List>\n\n <BaseCombobox.Empty className={clsx(cls(\"combobox-empty\"))}>\n <Empty description=\"No options found\" />\n </BaseCombobox.Empty>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </BaseCombobox.Root>\n </div>\n );\n};\n\nconst MainCombobox = forwardRef(ComboboxInner) as <\n T extends React.Key,\n M extends boolean,\n O extends Record<string, unknown> = {}\n>(\n props: ComboboxProps<T, M, O> & { ref?: ForwardedRef<HTMLDivElement> }\n) => ReturnType<typeof ComboboxInner>;\n\nexport const Combobox = Object.assign(MainCombobox, {\n // Add any sub components here if needed\n});\n\nexport default Combobox;\n"],"names":["ComboboxInner","options","controlledValue","defaultValue","onChange","placeholder","disabledProp","statusProp","allowClear","multiple","_showSearch","controlledOpen","onOpenChange","className","classNames","size","optionRender","onSearch","clearIcon","suffixIcon","showSelectAll","optionLabelRender","_getOptionKeywords","option","reactNodeToString","rest","ref","value","setValue","useControlledState","open","setOpen","cls","useCls","inputContainerRef","useRef","contextStatus","useContext","FormItemInputContext","contextDisabled","DisabledContext","mergedStatus","disabled","handleValueChange","useCallback","newValue","handleSelectAll","allValues","handleDeselectAll","handleClear","selectedValues","useMemo","selectAllOption","selectedFromFiltered","val","opt","checked","indeterminate","baseUIItems","displayValue","inputClassName","clsx","jsx","jsxs","BaseCombobox","itemValue","SelectTrigger","children","selectedItems","Fragment","item","XIcon","event","props","icon","BaseMenu","BaseMenuItem","isSelected","Empty","MainCombobox","forwardRef","Combobox"],"mappings":";;;;;;;;;;;;;;;;AA0IA,MAAMA,KAAgB,CAKpB;AAAA,EACE,SAAAC,IAAU,CAAA;AAAA,EACV,OAAOC;AAAA,EACP,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IA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AAAX;AAAA,8BAACE,EAAa;AAAA,8BAAb;AAAA,gCACC,OAAOM;AAAA,gCACP,UAAU/C,EAAO;AAAA,gCAChB,GAAGkD;AAAA,gCACJ,iBAAelD,EAAO;AAAA,gCACtB,iBAAesD;AAAA,8BAAA;AAAA,4BAAA;AAAA,4BAIlB,UAAAtD,EAAO;AAAA,0BAAA;AAAA,0BA1BHA,EAAO;AAAA,wBAAA;AAAA,sBA6BlB;AAAA,oBAAA;AAAA,kBAAA;AAAA,kBAGF,gBAAAuC,EAACE,EAAa,OAAb,EAAmB,WAAWH,EAAK7B,EAAI,gBAAgB,CAAC,GACvD,UAAA,gBAAA8B,EAACgB,IAAA,EAAM,aAAY,oBAAmB,EAAA,CACxC;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,EACF,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ,GAEMC,KAAeC,GAAWhF,EAAa,GAQhCiF,KAAW,OAAO,OAAOF,IAAc;AAAA;AAEpD,CAAC;"}
@@ -1 +1 @@
1
- @layer components{.ds-combobox{position:relative;display:inline-block;width:100%}}
1
+ @layer components{.ds-combobox{position:relative;display:inline-block;width:100%}.ds-combobox-popup{width:var(--anchor-width)}.ds-combobox-input{flex:1;border:none;outline:none;background:transparent;color:inherit;min-width:0}.ds-combobox-input::placeholder{color:var(--ds-color-text-placeholder)}.ds-combobox-divider{border:none;border-bottom:1px solid var(--ds-color-split);margin:.25rem 0}.ds-combobox-chip{display:inline-flex;align-items:center;gap:.25rem;background:var(--ds-color-fill-secondary);border-radius:var(--ds-border-radius-sm);padding:.25rem .5rem;font-size:var(--ds-font-size);color:var(--ds-color-text);max-width:200px;height:var(--ds-control-line-height)}.ds-combobox-chip-icon{display:flex;align-items:center;flex-shrink:0;font-size:.75rem}.ds-combobox-chip-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ds-combobox-chip-remove{display:flex;align-items:center;justify-content:center;padding:.125rem;border-radius:var(--ds-border-radius-sm);cursor:pointer;color:var(--ds-color-text-secondary);transition:all .2s var(--ds-motion-ease-out);background:none;border:none;font-size:.875rem;line-height:1}.ds-combobox-chip-remove:hover{background:var(--ds-control-item-bg-hover);color:var(--ds-color-text)}.ds-combobox-chips-container .ds-combobox-input{flex:1;min-width:120px;border:none;background:transparent;padding:.25rem 0;margin:0}.ds-combobox-chips{display:flex;flex-wrap:wrap;gap:.375rem}.ds-select-trigger-small .ds-combobox-chips{gap:.25rem}.ds-combobox-trigger-multiple.ds-select-trigger-has-value .ds-select-trigger-content{padding-left:.5rem}.ds-combobox[data-disabled=true] .ds-combobox-chip{background-color:var(--ds-color-bg-disabled);color:var(--ds-color-text-disabled)}.ds-combobox[data-disabled=true] .ds-combobox-chip-remove{cursor:not-allowed;color:var(--ds-color-text-disabled)}.ds-combobox-empty{padding:1rem}.ds-combobox-empty:empty{display:none}}
@@ -18,11 +18,11 @@ function I(t, e) {
18
18
  const J = ({
19
19
  open: t,
20
20
  onOpenChange: e,
21
- defaultOpen: h,
21
+ defaultOpen: h = !1,
22
22
  items: C = [],
23
23
  shortcuts: s = G,
24
- placeholder: c = "Type a command or search...",
25
- emptyText: l = "No results found.",
24
+ placeholder: l = "Type a command or search...",
25
+ emptyText: c = "No results found.",
26
26
  label: k = "Command Palette",
27
27
  className: K,
28
28
  classNames: d
@@ -46,19 +46,19 @@ const J = ({
46
46
  onOpenChange: e
47
47
  }), { className: w } = j(), N = L(
48
48
  () => /* @__PURE__ */ f(S, { children: [
49
- /* @__PURE__ */ n(r.Input, { placeholder: c }),
49
+ /* @__PURE__ */ n(r.Input, { placeholder: l }),
50
50
  /* @__PURE__ */ n(A, { fadeEdges: !0, children: /* @__PURE__ */ f(
51
51
  r.List,
52
52
  {
53
53
  className: o("dropdown-menu-list", "command-palette-list"),
54
54
  children: [
55
- /* @__PURE__ */ n(r.Empty, { className: o("dropdown-menu-empty"), children: l }),
55
+ /* @__PURE__ */ n(r.Empty, { className: o("dropdown-menu-empty"), children: c }),
56
56
  u.map(i)
57
57
  ]
58
58
  }
59
59
  ) })
60
60
  ] }),
61
- [o, l, u, c, i]
61
+ [o, c, u, l, i]
62
62
  );
63
63
  return /* @__PURE__ */ n(
64
64
  r.Dialog,
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/command-palette/component.tsx"],"sourcesContent":["\"use client\";\nimport React, { useCallback, useEffect } from \"react\";\nimport { Command } from \"../cmdk\";\nimport { DropdownMenuItemType } from \"../dropdown-menu/types\";\nimport { useDropdownMenu } from \"../dropdown-menu/useDropdownMenu\";\nimport { useControlledState } from \"../hooks\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { useCls } from \"../utils\";\nimport \"./style.css\";\nimport { useTheme } from \"../theme-provider\";\n\nexport type CommandPaletteShortcut = {\n key: string;\n metaKey?: boolean;\n ctrlKey?: boolean;\n altKey?: boolean;\n shiftKey?: boolean;\n};\n\nexport interface CommandPaletteProps {\n /** Whether the command palette is open */\n open?: boolean;\n /** Callback fired when the open state changes */\n onOpenChange?: (open: boolean) => void;\n /**\n * Default open state\n */\n defaultOpen?: boolean;\n /** Items to display in the command palette */\n items?: DropdownMenuItemType[];\n /** Keyboard shortcuts to open the palette */\n shortcuts?: CommandPaletteShortcut[];\n /** Placeholder text for the search input */\n placeholder?: string;\n /** Text to show when no results are found */\n emptyText?: string;\n /** Accessible label for the command palette */\n label?: string;\n /** Additional CSS class names */\n className?: string;\n classNames?: {\n root?: string;\n mask?: string;\n content?: string;\n group?: string;\n item?: string;\n groupLabel?: string;\n };\n}\n\nconst defaultShortcuts: CommandPaletteShortcut[] = [\n { key: \"k\", metaKey: true },\n { key: \"k\", ctrlKey: true },\n];\n\nfunction matchesShortcut(\n event: KeyboardEvent,\n shortcut: CommandPaletteShortcut\n): boolean {\n return (\n event.key.toLowerCase() === shortcut.key.toLowerCase() &&\n !!event.metaKey === !!shortcut.metaKey &&\n !!event.ctrlKey === !!shortcut.ctrlKey &&\n !!event.altKey === !!shortcut.altKey &&\n !!event.shiftKey === !!shortcut.shiftKey\n );\n}\n\n// Default items for testing/demo purposes\n// const defaultItems: DropdownMenuItemType[] = [\n// {\n// type: \"item\",\n// key: \"search\",\n// label: \"Search files\",\n// onClick: () => console.log(\"Search files\"),\n// },\n// {\n// type: \"item\",\n// key: \"new-file\",\n// label: \"New file\",\n// onClick: () => console.log(\"New file\"),\n// },\n// {\n// type: \"item\",\n// key: \"settings\",\n// label: \"Open settings\",\n// onClick: () => console.log(\"Open settings\"),\n// },\n// ];\n\nexport const CommandPalette: React.FC<CommandPaletteProps> = ({\n open,\n onOpenChange,\n defaultOpen,\n items = [],\n shortcuts = defaultShortcuts,\n placeholder = \"Type a command or search...\",\n emptyText = \"No results found.\",\n label = \"Command Palette\",\n className,\n classNames,\n}) => {\n const cls = useCls();\n const [actualOpen, setActualOpen] = useControlledState(\n open,\n onOpenChange,\n defaultOpen\n );\n\n // Set up keyboard shortcuts\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const matchingShortcut = shortcuts.find((shortcut) =>\n matchesShortcut(event, shortcut)\n );\n\n if (matchingShortcut) {\n event.preventDefault();\n setActualOpen(!actualOpen);\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [shortcuts, actualOpen, setActualOpen]);\n\n const { renderGroup, itemGroups } = useDropdownMenu({\n items,\n inCombobox: true,\n onOpenChange,\n });\n\n const { className: themeClassName } = useTheme();\n const renderMenuInner = useCallback(\n () => (\n <>\n <Command.Input placeholder={placeholder} />\n {/*{beforeList}*/}\n <ScrollArea fadeEdges>\n <Command.List\n className={cls(\"dropdown-menu-list\", \"command-palette-list\")}\n >\n <Command.Empty className={cls(\"dropdown-menu-empty\")}>\n {emptyText}\n </Command.Empty>\n {itemGroups.map(renderGroup)}\n </Command.List>\n </ScrollArea>\n {/*{afterList}*/}\n </>\n ),\n [cls, emptyText, itemGroups, placeholder, renderGroup]\n );\n return (\n <Command.Dialog\n open={actualOpen}\n onOpenChange={setActualOpen}\n label={label}\n overlayClassName={cls(\"command-palette-overlay\", classNames?.mask)}\n contentClassName={cls(\"command-palette-content\", classNames?.content)}\n className={cls(\"command-palette\", themeClassName, className)}\n >\n {renderMenuInner()}\n </Command.Dialog>\n );\n};\n"],"names":["defaultShortcuts","matchesShortcut","event","shortcut","CommandPalette","open","onOpenChange","defaultOpen","items","shortcuts","placeholder","emptyText","label","className","classNames","cls","useCls","actualOpen","setActualOpen","useControlledState","useEffect","handleKeyDown","renderGroup","itemGroups","useDropdownMenu","themeClassName","useTheme","renderMenuInner","useCallback","jsxs","Fragment","jsx","Command","ScrollArea"],"mappings":";;;;;;;;;;AAkDA,MAAMA,IAA6C;AAAA,EACjD,EAAE,KAAK,KAAK,SAAS,GAAA;AAAA,EACrB,EAAE,KAAK,KAAK,SAAS,GAAA;AACvB;AAEA,SAASC,EACPC,GACAC,GACS;AACT,SACED,EAAM,IAAI,YAAA,MAAkBC,EAAS,IAAI,YAAA,KACzC,CAAC,CAACD,EAAM,WAAY,CAAC,CAACC,EAAS,WAC/B,CAAC,CAACD,EAAM,WAAY,CAAC,CAACC,EAAS,WAC/B,CAAC,CAACD,EAAM,UAAW,CAAC,CAACC,EAAS,UAC9B,CAAC,CAACD,EAAM,YAAa,CAAC,CAACC,EAAS;AAEpC;AAwBO,MAAMC,IAAgD,CAAC;AAAA,EAC5D,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC,IAAQ,CAAA;AAAA,EACR,WAAAC,IAAYT;AAAA,EACZ,aAAAU,IAAc;AAAA,EACd,WAAAC,IAAY;AAAA,EACZ,OAAAC,IAAQ;AAAA,EACR,WAAAC;AAAA,EACA,YAAAC;AACF,MAAM;AACJ,QAAMC,IAAMC,EAAA,GACN,CAACC,GAAYC,CAAa,IAAIC;AAAA,IAClCd;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA;A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A2BD,GAAY,OAAO;AAAA,MACpE,WAAWC,EAAI,mBAAmBU,GAAgBZ,CAAS;AAAA,MAE1D,UAAAc,EAAA;AAAA,IAAgB;AAAA,EAAA;AAGvB;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/command-palette/component.tsx"],"sourcesContent":["\"use client\";\nimport React, { useCallback, useEffect } from \"react\";\nimport { Command } from \"../cmdk\";\nimport { DropdownMenuItemType } from \"../dropdown-menu/types\";\nimport { useDropdownMenu } from \"../dropdown-menu/useDropdownMenu\";\nimport { useControlledState } from \"../hooks\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { useCls } from \"../utils\";\nimport \"./style.css\";\nimport { useTheme } from \"../theme-provider\";\n\nexport type CommandPaletteShortcut = {\n key: string;\n metaKey?: boolean;\n ctrlKey?: boolean;\n altKey?: boolean;\n shiftKey?: boolean;\n};\n\nexport interface CommandPaletteProps {\n /** Whether the command palette is open */\n open?: boolean;\n /** Callback fired when the open state changes */\n onOpenChange?: (open: boolean) => void;\n /**\n * Default open state\n */\n defaultOpen?: boolean;\n /** Items to display in the command palette */\n items?: DropdownMenuItemType[];\n /** Keyboard shortcuts to open the palette */\n shortcuts?: CommandPaletteShortcut[];\n /** Placeholder text for the search input */\n placeholder?: string;\n /** Text to show when no results are found */\n emptyText?: string;\n /** Accessible label for the command palette */\n label?: string;\n /** Additional CSS class names */\n className?: string;\n classNames?: {\n root?: string;\n mask?: string;\n content?: string;\n group?: string;\n item?: string;\n groupLabel?: string;\n };\n}\n\nconst defaultShortcuts: CommandPaletteShortcut[] = [\n { key: \"k\", metaKey: true },\n { key: \"k\", ctrlKey: true },\n];\n\nfunction matchesShortcut(\n event: KeyboardEvent,\n shortcut: CommandPaletteShortcut\n): boolean {\n return (\n event.key.toLowerCase() === shortcut.key.toLowerCase() &&\n !!event.metaKey === !!shortcut.metaKey &&\n !!event.ctrlKey === !!shortcut.ctrlKey &&\n !!event.altKey === !!shortcut.altKey &&\n !!event.shiftKey === !!shortcut.shiftKey\n );\n}\n\n// Default items for testing/demo purposes\n// const defaultItems: DropdownMenuItemType[] = [\n// {\n// type: \"item\",\n// key: \"search\",\n// label: \"Search files\",\n// onClick: () => console.log(\"Search files\"),\n// },\n// {\n// type: \"item\",\n// key: \"new-file\",\n// label: \"New file\",\n// onClick: () => console.log(\"New file\"),\n// },\n// {\n// type: \"item\",\n// key: \"settings\",\n// label: \"Open settings\",\n// onClick: () => console.log(\"Open settings\"),\n// },\n// ];\n\nexport const CommandPalette: React.FC<CommandPaletteProps> = ({\n open,\n onOpenChange,\n defaultOpen = false,\n items = [],\n shortcuts = defaultShortcuts,\n placeholder = \"Type a command or search...\",\n emptyText = \"No results found.\",\n label = \"Command Palette\",\n className,\n classNames,\n}) => {\n const cls = useCls();\n const [actualOpen, setActualOpen] = useControlledState(\n open,\n onOpenChange,\n defaultOpen\n );\n\n // Set up keyboard shortcuts\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const matchingShortcut = shortcuts.find((shortcut) =>\n matchesShortcut(event, shortcut)\n );\n\n if (matchingShortcut) {\n event.preventDefault();\n setActualOpen(!actualOpen);\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [shortcuts, actualOpen, setActualOpen]);\n\n const { renderGroup, itemGroups } = useDropdownMenu({\n items,\n inCombobox: true,\n onOpenChange,\n });\n\n const { className: themeClassName } = useTheme();\n const renderMenuInner = useCallback(\n () => (\n <>\n <Command.Input placeholder={placeholder} />\n {/*{beforeList}*/}\n <ScrollArea fadeEdges>\n <Command.List\n className={cls(\"dropdown-menu-list\", \"command-palette-list\")}\n >\n <Command.Empty className={cls(\"dropdown-menu-empty\")}>\n {emptyText}\n </Command.Empty>\n {itemGroups.map(renderGroup)}\n </Command.List>\n </ScrollArea>\n {/*{afterList}*/}\n </>\n ),\n [cls, emptyText, itemGroups, placeholder, renderGroup]\n );\n return (\n <Command.Dialog\n open={actualOpen}\n onOpenChange={setActualOpen}\n label={label}\n overlayClassName={cls(\"command-palette-overlay\", classNames?.mask)}\n contentClassName={cls(\"command-palette-content\", classNames?.content)}\n className={cls(\"command-palette\", themeClassName, className)}\n >\n {renderMenuInner()}\n </Command.Dialog>\n );\n};\n"],"names":["defaultShortcuts","matchesShortcut","event","shortcut","CommandPalette","open","onOpenChange","defaultOpen","items","shortcuts","placeholder","emptyText","label","className","classNames","cls","useCls","actualOpen","setActualOpen","useControlledState","useEffect","handleKeyDown","renderGroup","itemGroups","useDropdownMenu","themeClassName","useTheme","renderMenuInner","useCallback","jsxs","Fragment","jsx","Command","ScrollArea"],"mappings":";;;;;;;;;;AAkDA,MAAMA,IAA6C;AAAA,EACjD,EAAE,KAAK,KAAK,SAAS,GAAA;AAAA,EACrB,EAAE,KAAK,KAAK,SAAS,GAAA;AACvB;AAEA,SAASC,EACPC,GACAC,GACS;AACT,SACED,EAAM,IAAI,YAAA,MAAkBC,EAAS,IAAI,YAAA,KACzC,CAAC,CAACD,EAAM,WAAY,CAAC,CAACC,EAAS,WAC/B,CAAC,CAACD,EAAM,WAAY,CAAC,CAACC,EAAS,WAC/B,CAAC,CAACD,EAAM,UAAW,CAAC,CAACC,EAAS,UAC9B,CAAC,CAACD,EAAM,YAAa,CAAC,CAACC,EAAS;AAEpC;AAwBO,MAAMC,IAAgD,CAAC;AAAA,EAC5D,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,OAAAC,IAAQ,CAAA;AAAA,EACR,WAAAC,IAAYT;AAAA,EACZ,aAAAU,IAAc;AAAA,EACd,WAAAC,IAAY;AAAA,EACZ,OAAAC,IAAQ;AAAA,EACR,WAAAC;AAAA,EACA,YAAAC;AACF,MAAM;AACJ,QAAMC,IAAMC,EAAA,GACN,CAACC,GAAYC,CAAa,IAAIC;AAAA,IAClCd;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA;AAIF,EAAAa,EAAU,MAAM;AACd,UAAMC,IAAgB,CAACnB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62 +1,62 @@
1
1
  "use client";
2
- import { jsxs as m, jsx as r } from "react/jsx-runtime";
3
- import { useRef as B, useCallback as F, createElement as L } from "react";
4
- import { Menu as U } from "@base-ui-components/react/menu";
5
- import { Popover as W } from "@base-ui-components/react/popover";
2
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
3
+ import { useRef as L, useCallback as U, createElement as W } from "react";
4
+ import { Menu as q } from "@base-ui-components/react/menu";
5
+ import { Popover as H } from "@base-ui-components/react/popover";
6
6
  import { Command as i } from "../cmdk/index.js";
7
- import { FormItemInputContext as q } from "antd/es/form/context";
7
+ import { FormItemInputContext as J } from "antd/es/form/context";
8
8
  import { PopupPanelSize as I } from "../popup-panel/constants.js";
9
- import { useDropdownMenu as H } from "./useDropdownMenu.js";
10
- import './style.css';/* empty css */
11
- import { parseAntdPlacement as J } from "../utils/placement.js";
12
- import { Input as Q } from "../input/component.js";
13
- import { ScrollArea as P } from "../scroll-area/component.js";
14
- import { DROPDOWN_COLLISION_AVOIDANCE as X } from "../utils/constants.js";
15
- import { useControlledState as Y } from "../hooks/useControlledState.js";
16
- import { useCls as Z } from "../utils/antdUtils.js";
17
- import { useTheme as $ } from "../theme-provider/context/themeStore.js";
18
- import { clsx as c } from "../utils/cn.js";
19
- const wo = ({
20
- children: x,
21
- items: O,
22
- placement: b,
23
- openOnHover: N,
24
- open: S,
25
- onOpenChange: A,
26
- defaultOpen: D,
27
- className: E,
28
- itemRender: M,
9
+ import { useDropdownMenu as Q } from "./useDropdownMenu.js";
10
+ import { BaseMenu as x } from "../base-menu/index.js";
11
+ import { parseAntdPlacement as X } from "../utils/placement.js";
12
+ import { Input as Y } from "../input/component.js";
13
+ import { ScrollArea as O } from "../scroll-area/component.js";
14
+ import { DROPDOWN_COLLISION_AVOIDANCE as Z } from "../utils/constants.js";
15
+ import { useControlledState as $ } from "../hooks/useControlledState.js";
16
+ import { useCls as K } from "../utils/antdUtils.js";
17
+ import { useTheme as ee } from "../theme-provider/context/themeStore.js";
18
+ import { clsx as s } from "../utils/cn.js";
19
+ const ve = ({
20
+ children: b,
21
+ items: N,
22
+ placement: S,
23
+ openOnHover: A,
24
+ open: D,
25
+ onOpenChange: E,
26
+ defaultOpen: M = !1,
27
+ className: R,
28
+ itemRender: k,
29
29
  classNames: o,
30
- size: s = "auto",
30
+ size: f = "auto",
31
31
  showSearch: n,
32
- inCombobox: f,
33
- searchProps: g = {
32
+ inCombobox: g,
33
+ searchProps: C = {
34
34
  placeholder: "Search..."
35
35
  },
36
- popupMatchTriggerWidth: R,
36
+ popupMatchTriggerWidth: y,
37
37
  beforeList: d,
38
38
  afterList: p,
39
- keepOpenOnSelect: k,
39
+ keepOpenOnSelect: B,
40
40
  highlightedItemKey: l,
41
- selectedItemKeys: y,
42
- getItemKeywords: j,
43
- showCheckbox: C,
44
- itemLabelRender: G
41
+ selectedItemKeys: j,
42
+ getItemKeywords: G,
43
+ showCheckbox: w,
44
+ itemLabelRender: T
45
45
  }) => {
46
- const T = typeof f == "boolean" ? f : n, [V, w] = Y(
47
- S,
48
- A,
49
- D
50
- ), e = Z(), { className: h } = $(), v = J(b), _ = B(null), { itemGroups: u, renderGroup: a } = H({
51
- items: O,
52
- keepOpenOnSelect: k,
53
- selectedItemKeys: y,
54
- showCheckbox: C,
55
- getItemKeywords: j,
56
- itemLabelRender: G,
57
- itemRender: M,
58
- inCombobox: T,
59
- onOpenChange: w,
46
+ const V = typeof g == "boolean" ? g : n, [_, v] = $(
47
+ D,
48
+ E,
49
+ M
50
+ ), r = K(), { className: P } = ee(), h = X(S), z = L(null), { itemGroups: u, renderGroup: a } = Q({
51
+ items: N,
52
+ keepOpenOnSelect: B,
53
+ selectedItemKeys: j,
54
+ showCheckbox: w,
55
+ getItemKeywords: G,
56
+ itemLabelRender: T,
57
+ itemRender: k,
58
+ inCombobox: V,
59
+ onOpenChange: v,
60
60
  classNames: {
61
61
  item: o?.item,
62
62
  itemIcon: o?.itemIcon,
@@ -65,100 +65,103 @@ const wo = ({
65
65
  groupLabel: o?.groupLabel,
66
66
  divider: o?.divider
67
67
  }
68
- }), z = F(
68
+ }), F = U(
69
69
  () => n ? /* @__PURE__ */ m(
70
70
  i,
71
71
  {
72
- className: e("dropdown-menu-container"),
72
+ className: r("dropdown-menu-container"),
73
73
  disablePointerSelection: n,
74
74
  defaultValue: l ? String(l) : void 0,
75
75
  children: [
76
- /* @__PURE__ */ r(q.Provider, { value: {}, children: /* @__PURE__ */ L(
76
+ /* @__PURE__ */ e(J.Provider, { value: {}, children: /* @__PURE__ */ W(
77
77
  i.Input,
78
78
  {
79
- ...g,
79
+ ...C,
80
80
  key: "search",
81
- render: /* @__PURE__ */ r(
82
- Q,
81
+ render: /* @__PURE__ */ e(
82
+ Y,
83
83
  {
84
84
  allowClear: !0,
85
- className: e("dropdown-menu-search"),
85
+ className: r("dropdown-menu-search"),
86
86
  placeholder: "Search"
87
87
  }
88
88
  )
89
89
  }
90
90
  ) }),
91
91
  d,
92
- /* @__PURE__ */ r(P, { fadeEdges: !0, children: /* @__PURE__ */ m(i.List, { className: e("dropdown-menu-list"), children: [
93
- /* @__PURE__ */ r(i.Empty, { className: e("dropdown-menu-empty"), children: "No results found." }),
92
+ /* @__PURE__ */ e(O, { fadeEdges: !0, children: /* @__PURE__ */ m(i.List, { className: r("dropdown-menu-list"), children: [
93
+ /* @__PURE__ */ e(i.Empty, { className: r("dropdown-menu-empty"), children: "No results found." }),
94
94
  u.map(a)
95
95
  ] }) }),
96
96
  p
97
97
  ]
98
98
  }
99
- ) : /* @__PURE__ */ m("div", { className: e("dropdown-menu-container"), children: [
99
+ ) : /* @__PURE__ */ m("div", { className: r("dropdown-menu-container"), children: [
100
100
  d,
101
- /* @__PURE__ */ r(P, { fadeEdges: !0, children: u.map(a) }),
101
+ /* @__PURE__ */ e(O, { fadeEdges: !0, children: u.map(a) }),
102
102
  p
103
103
  ] }),
104
104
  [
105
105
  n,
106
- e,
106
+ r,
107
107
  l,
108
- g,
108
+ C,
109
109
  d,
110
110
  u,
111
111
  p,
112
112
  a
113
113
  ]
114
- ), t = n ? W : U;
114
+ ), t = n ? H : q;
115
115
  return /* @__PURE__ */ m(
116
116
  t.Root,
117
117
  {
118
- openOnHover: N,
119
- open: V,
120
- onOpenChange: w,
118
+ openOnHover: A,
119
+ open: _,
120
+ onOpenChange: v,
121
121
  children: [
122
- /* @__PURE__ */ r(
122
+ /* @__PURE__ */ e(
123
123
  t.Trigger,
124
124
  {
125
- render: x,
126
- ref: _,
127
- className: c(
128
- e("dropdown-menu-trigger"),
125
+ render: b,
126
+ ref: z,
127
+ nativeButton: !1,
128
+ className: s(
129
+ r("dropdown-menu-trigger"),
129
130
  o?.trigger,
130
- h
131
+ P
131
132
  )
132
133
  }
133
134
  ),
134
- /* @__PURE__ */ r(t.Portal, { children: /* @__PURE__ */ r(
135
+ /* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ e(
135
136
  t.Positioner,
136
137
  {
137
- side: v.side,
138
- align: v.align,
138
+ side: h.side,
139
+ align: h.align,
139
140
  sideOffset: 4,
140
- className: c(
141
- e("dropdown-menu-root"),
142
- h,
141
+ className: s(
142
+ r("dropdown-menu-root"),
143
+ P,
143
144
  o?.root
144
145
  ),
145
- collisionAvoidance: X,
146
- children: /* @__PURE__ */ r(
146
+ collisionAvoidance: Z,
147
+ render: (c) => /* @__PURE__ */ e(x.Root, { ...c }),
148
+ children: /* @__PURE__ */ e(
147
149
  t.Popup,
148
150
  {
149
- className: c(
150
- e(
151
+ className: s(
152
+ r(
151
153
  "dropdown-menu",
152
- C && "dropdown-menu-show-checkbox",
153
- R && "dropdown-menu-match-trigger-width"
154
+ w && "dropdown-menu-show-checkbox",
155
+ y && "dropdown-menu-match-trigger-width"
154
156
  ),
155
- E,
157
+ R,
156
158
  o?.popup
157
159
  ),
158
160
  style: {
159
- "--size-width": s in I ? I[s] : void 0
161
+ "--size-width": f in I ? I[f] : void 0
160
162
  },
161
- children: z()
163
+ render: (c) => /* @__PURE__ */ e(x.Popup, { ...c }),
164
+ children: F()
162
165
  }
163
166
  )
164
167
  }
@@ -168,6 +171,6 @@ const wo = ({
168
171
  );
169
172
  };
170
173
  export {
171
- wo as DropdownMenu
174
+ ve as DropdownMenu
172
175
  };
173
176
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/dropdown-menu/component.tsx"],"sourcesContent":["\"use client\";\nimport { Menu } from \"@base-ui-components/react/menu\";\nimport { Popover } from \"@base-ui-components/react/popover\";\nimport { type PopoverProps } from \"antd/es/popover\";\nimport { useCallback, useRef } from \"react\";\nimport {\n clsx,\n DROPDOWN_COLLISION_AVOIDANCE,\n parseAntdPlacement,\n useAntdCssVarClassname,\n useCls,\n} from \"../utils\";\nimport { Command } from \"../cmdk\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { FormItemInputContext } from \"antd/es/form/context\";\n\n// Import component-specific styles\nimport { Input } from \"../input\";\nimport { PopupPanelSize } from \"../popup-panel/constants\";\n\nimport { DropdownMenuItemType } from \"./types\";\nimport { useDropdownMenu, UseDropdownMenuProps } from \"./useDropdownMenu\";\nimport { useControlledState } from \"../hooks\";\n\nimport \"./style.css\";\nimport { useTheme } from \"../theme-provider\";\n\nexport interface DropdownMenuProps\n extends Omit<UseDropdownMenuProps, \"classNames\"> {\n /** Array of menu items to be displayed in the dropdown */\n items: DropdownMenuItemType[];\n /** Custom render function for the trigger element */\n children?: React.ComponentProps<typeof Menu.Trigger>[\"render\"];\n /**\n * Placement of the dropdown relative to the trigger element\n * @default \"bottomLeft\"\n */\n placement?: PopoverProps[\"placement\"];\n /**\n * Whether to open the dropdown on hover instead of click\n * @default false\n */\n openOnHover?: boolean;\n /**\n * Controlled open state of the dropdown\n */\n open?: boolean;\n /**\n * Callback fired when the dropdown open state changes\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Default open state of the dropdown\n */\n defaultOpen?: boolean;\n /**\n * Additional CSS class for the dropdown component\n */\n className?: string;\n /**\n * Custom class names for different parts of the dropdown\n * @default {}\n */\n classNames?: {\n root?: string;\n trigger?: string;\n popup?: string;\n itemIcon?: string;\n itemText?: string;\n positioner?: string;\n } & UseDropdownMenuProps[\"classNames\"];\n\n /**\n * Whether to show search input\n * @default false\n */\n showSearch?: boolean;\n /**\n * Size of the dropdown menu\n * @default \"auto\"\n */\n size?: \"auto\" | keyof typeof PopupPanelSize;\n /**\n * Search placeholder\n */\n searchProps?: Omit<\n React.ComponentProps<typeof Command.Input>,\n \"size\" | \"ref\"\n >;\n /**\n * Whether to match the width of the popup with the trigger\n * @default false\n */\n popupMatchTriggerWidth?: boolean;\n /**\n * Content to display before the list\n */\n beforeList?: React.ReactNode;\n /**\n * Content to display after the list\n */\n afterList?: React.ReactNode;\n}\n\nexport const DropdownMenu = ({\n children,\n items,\n placement,\n openOnHover,\n open: outsideOpen,\n onOpenChange: outsideOnOpenChange,\n defaultOpen,\n className,\n itemRender,\n classNames,\n size = \"auto\",\n showSearch,\n inCombobox: inComboboxProp,\n searchProps = {\n placeholder: \"Search...\",\n },\n popupMatchTriggerWidth,\n beforeList,\n afterList,\n keepOpenOnSelect,\n highlightedItemKey,\n selectedItemKeys,\n getItemKeywords,\n showCheckbox,\n itemLabelRender,\n}: DropdownMenuProps) => {\n const inCombobox =\n typeof inComboboxProp === \"boolean\" ? inComboboxProp : showSearch;\n const [open, onOpenChange] = useControlledState(\n outsideOpen,\n outsideOnOpenChange,\n defaultOpen\n );\n const cls = useCls();\n const { className: themeClassName } = useTheme();\n const baseUIPlacement = parseAntdPlacement(placement);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const { itemGroups, renderGroup } = useDropdownMenu({\n items,\n keepOpenOnSelect,\n highlightedItemKey,\n selectedItemKeys,\n showCheckbox,\n getItemKeywords,\n itemLabelRender,\n itemRender,\n inCombobox,\n onOpenChange,\n classNames: {\n item: classNames?.item,\n itemIcon: classNames?.itemIcon,\n itemSuffix: classNames?.itemSuffix,\n group: classNames?.group,\n groupLabel: classNames?.groupLabel,\n divider: classNames?.divider,\n },\n });\n const renderMenuInner = useCallback(\n () =>\n showSearch ? (\n <Command\n className={cls(\"dropdown-menu-container\")}\n disablePointerSelection={showSearch}\n defaultValue={\n highlightedItemKey ? String(highlightedItemKey) : undefined\n }\n // filter={(value, search, keywords) => {\n // console.log({ value, search, keywords });\n // const extendValue = value + \" \" + keywords.join(\" \");\n // if (extendValue.toLowerCase().includes(search.toLowerCase()))\n // return 1;\n // return 0;\n // }}\n >\n <FormItemInputContext.Provider value={{}}>\n <Command.Input\n {...searchProps}\n key=\"search\"\n render={\n <Input\n allowClear\n className={cls(\"dropdown-menu-search\")}\n placeholder=\"Search\"\n />\n }\n />\n </FormItemInputContext.Provider>\n {beforeList}\n <ScrollArea fadeEdges>\n <Command.List className={cls(\"dropdown-menu-list\")}>\n <Command.Empty className={cls(\"dropdown-menu-empty\")}>\n No results found.\n </Command.Empty>\n {itemGroups.map(renderGroup)}\n </Command.List>\n </ScrollArea>\n {afterList}\n </Command>\n ) : (\n <div className={cls(\"dropdown-menu-container\")}>\n {beforeList}\n <ScrollArea fadeEdges>{itemGroups.map(renderGroup)}</ScrollArea>\n {afterList}\n </div>\n ),\n [\n showSearch,\n cls,\n highlightedItemKey,\n searchProps,\n beforeList,\n itemGroups,\n afterList,\n renderGroup,\n ]\n );\n const BaseComponent = showSearch ? Popover : Menu;\n\n return (\n <BaseComponent.Root\n openOnHover={openOnHover}\n open={open}\n onOpenChange={onOpenChange}\n >\n <BaseComponent.Trigger\n render={children}\n ref={buttonRef}\n className={clsx(\n cls(\"dropdown-menu-trigger\"),\n classNames?.trigger,\n themeClassName\n )}\n />\n <BaseComponent.Portal>\n <BaseComponent.Positioner\n side={baseUIPlacement.side}\n align={baseUIPlacement.align}\n sideOffset={4}\n className={clsx(\n cls(\"dropdown-menu-root\"),\n themeClassName,\n classNames?.root\n )}\n collisionAvoidance={DROPDOWN_COLLISION_AVOIDANCE}\n >\n <BaseComponent.Popup\n className={clsx(\n cls(\n \"dropdown-menu\",\n showCheckbox && \"dropdown-menu-show-checkbox\",\n popupMatchTriggerWidth && \"dropdown-menu-match-trigger-width\"\n ),\n className,\n classNames?.popup\n )}\n style={\n {\n \"--size-width\":\n size in PopupPanelSize ? PopupPanelSize[size] : undefined,\n } as React.CSSProperties\n }\n >\n {renderMenuInner()}\n </BaseComponent.Popup>\n </BaseComponent.Positioner>\n </BaseComponent.Portal>\n </BaseComponent.Root>\n );\n};\n"],"names":["DropdownMenu","children","items","placement","openOnHover","outsideOpen","outsideOnOpenChange","defaultOpen","className","itemRender","classNames","size","showSearch","inComboboxProp","searchProps","popupMatchTriggerWidth","beforeList","afterList","keepOpenOnSelect","highlightedItemKey","selectedItemKeys","getItemKeywords","showCheckbox","itemLabelRender","inCombobox","open","onOpenChange","useControlledState","cls","useCls","themeClassName","useTheme","baseUIPlacement","parseAntdPlacement","buttonRef","useRef","itemGroups","renderGroup","useDropdownMenu","renderMenuInner","useCallback","jsxs","Command","jsx","FormItemInputContext","createElement","Input","ScrollArea","BaseComponent","Popover","Menu","clsx","DROPDOWN_COLLISION_AVOIDANCE","PopupPanelSize"],"mappings":";;;;;;;;;;;;;;;;;;AAwGO,MAAMA,KAAe,CAAC;AAAA,EAC3B,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,MAAMC;AAAA,EACN,cAAcC;AAAA,EACd,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,YAAAC;AAAA,EACA,YAAYC;AAAA,EACZ,aAAAC,IAAc;AAAA,IACZ,aAAa;AAAA,EAAA;AAAA,EAEf,wBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC;AACF,MAAyB;AACvB,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;AAAA,YAAA;AAAA,YAEd,oBAAoB0C;AAAA,YAEpB,UAAA,gBAAAT;AAAA,cAACK,EAAc;AAAA,cAAd;AAAA,gBACC,WAAWG;AAAA,kBACTvB;AAAA,oBACE;AAAA,oBACAN,KAAgB;AAAA,oBAChBP,KAA0B;AAAA,kBAAA;AAAA,kBAE5BP;AAAA,kBACAE,GAAY;AAAA,gBAAA;AAAA,gBAEd,OACE;AAAA,kBACE,gBACEC,KAAQ0C,IAAiBA,EAAe1C,CAAI,IAAI;AAAA,gBAAA;AAAA,gBAIrD,UAAA4B,EAAA;AAAA,cAAgB;AAAA,YAAA;AAAA,UACnB;AAAA,QAAA,EACF,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/dropdown-menu/component.tsx"],"sourcesContent":["\"use client\";\nimport { Menu } from \"@base-ui-components/react/menu\";\nimport { Popover } from \"@base-ui-components/react/popover\";\nimport { type PopoverProps } from \"antd/es/popover\";\nimport { useCallback, useRef } from \"react\";\nimport {\n clsx,\n DROPDOWN_COLLISION_AVOIDANCE,\n parseAntdPlacement,\n useCls,\n} from \"../utils\";\nimport { Command } from \"../cmdk\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { FormItemInputContext } from \"antd/es/form/context\";\n\n// Import component-specific styles\nimport { Input } from \"../input\";\nimport { PopupPanelSize } from \"../popup-panel/constants\";\n\nimport { DropdownMenuItemType } from \"./types\";\nimport { useDropdownMenu, UseDropdownMenuProps } from \"./useDropdownMenu\";\nimport { useControlledState } from \"../hooks\";\n\nimport { useTheme } from \"../theme-provider\";\nimport { BaseMenu } from \"../base-menu\";\n\nexport interface DropdownMenuProps\n extends Omit<UseDropdownMenuProps, \"classNames\"> {\n /** Array of menu items to be displayed in the dropdown */\n items: DropdownMenuItemType[];\n /** Custom render function for the trigger element */\n children?: React.ComponentProps<typeof Menu.Trigger>[\"render\"];\n /**\n * Placement of the dropdown relative to the trigger element\n * @default \"bottomLeft\"\n */\n placement?: PopoverProps[\"placement\"];\n /**\n * Whether to open the dropdown on hover instead of click\n * @default false\n */\n openOnHover?: boolean;\n /**\n * Controlled open state of the dropdown\n */\n open?: boolean;\n /**\n * Callback fired when the dropdown open state changes\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Default open state of the dropdown\n */\n defaultOpen?: boolean;\n /**\n * Additional CSS class for the dropdown component\n */\n className?: string;\n /**\n * Custom class names for different parts of the dropdown\n * @default {}\n */\n classNames?: {\n root?: string;\n trigger?: string;\n popup?: string;\n itemIcon?: string;\n itemText?: string;\n positioner?: string;\n } & UseDropdownMenuProps[\"classNames\"];\n\n /**\n * Whether to show search input\n * @default false\n */\n showSearch?: boolean;\n /**\n * Size of the dropdown menu\n * @default \"auto\"\n */\n size?: \"auto\" | keyof typeof PopupPanelSize;\n /**\n * Search placeholder\n */\n searchProps?: Omit<\n React.ComponentProps<typeof Command.Input>,\n \"size\" | \"ref\"\n >;\n /**\n * Whether to match the width of the popup with the trigger\n * @default false\n */\n popupMatchTriggerWidth?: boolean;\n /**\n * Content to display before the list\n */\n beforeList?: React.ReactNode;\n /**\n * Content to display after the list\n */\n afterList?: React.ReactNode;\n}\n\nexport const DropdownMenu = ({\n children,\n items,\n placement,\n openOnHover,\n open: outsideOpen,\n onOpenChange: outsideOnOpenChange,\n defaultOpen = false,\n className,\n itemRender,\n classNames,\n size = \"auto\",\n showSearch,\n inCombobox: inComboboxProp,\n searchProps = {\n placeholder: \"Search...\",\n },\n popupMatchTriggerWidth,\n beforeList,\n afterList,\n keepOpenOnSelect,\n highlightedItemKey,\n selectedItemKeys,\n getItemKeywords,\n showCheckbox,\n itemLabelRender,\n}: DropdownMenuProps) => {\n const inCombobox =\n typeof inComboboxProp === \"boolean\" ? inComboboxProp : showSearch;\n const [open, onOpenChange] = useControlledState(\n outsideOpen,\n outsideOnOpenChange,\n defaultOpen\n );\n const cls = useCls();\n const { className: themeClassName } = useTheme();\n const baseUIPlacement = parseAntdPlacement(placement);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const { itemGroups, renderGroup } = useDropdownMenu({\n items,\n keepOpenOnSelect,\n highlightedItemKey,\n selectedItemKeys,\n showCheckbox,\n getItemKeywords,\n itemLabelRender,\n itemRender,\n inCombobox,\n onOpenChange,\n classNames: {\n item: classNames?.item,\n itemIcon: classNames?.itemIcon,\n itemSuffix: classNames?.itemSuffix,\n group: classNames?.group,\n groupLabel: classNames?.groupLabel,\n divider: classNames?.divider,\n },\n });\n const renderMenuInner = useCallback(\n () =>\n showSearch ? (\n <Command\n className={cls(\"dropdown-menu-container\")}\n disablePointerSelection={showSearch}\n defaultValue={\n highlightedItemKey ? String(highlightedItemKey) : undefined\n }\n // filter={(value, search, keywords) => {\n // console.log({ value, search, keywords });\n // const extendValue = value + \" \" + keywords.join(\" \");\n // if (extendValue.toLowerCase().includes(search.toLowerCase()))\n // return 1;\n // return 0;\n // }}\n >\n <FormItemInputContext.Provider value={{}}>\n <Command.Input\n {...searchProps}\n key=\"search\"\n render={\n <Input\n allowClear\n className={cls(\"dropdown-menu-search\")}\n placeholder=\"Search\"\n />\n }\n />\n </FormItemInputContext.Provider>\n {beforeList}\n <ScrollArea fadeEdges>\n <Command.List className={cls(\"dropdown-menu-list\")}>\n <Command.Empty className={cls(\"dropdown-menu-empty\")}>\n No results found.\n </Command.Empty>\n {itemGroups.map(renderGroup)}\n </Command.List>\n </ScrollArea>\n {afterList}\n </Command>\n ) : (\n <div className={cls(\"dropdown-menu-container\")}>\n {beforeList}\n <ScrollArea fadeEdges>{itemGroups.map(renderGroup)}</ScrollArea>\n {afterList}\n </div>\n ),\n [\n showSearch,\n cls,\n highlightedItemKey,\n searchProps,\n beforeList,\n itemGroups,\n afterList,\n renderGroup,\n ]\n );\n const BaseComponent = showSearch ? Popover : Menu;\n\n return (\n <BaseComponent.Root\n openOnHover={openOnHover}\n open={open}\n onOpenChange={onOpenChange}\n >\n <BaseComponent.Trigger\n render={children}\n ref={buttonRef}\n nativeButton={false}\n className={clsx(\n cls(\"dropdown-menu-trigger\"),\n classNames?.trigger,\n themeClassName\n )}\n />\n <BaseComponent.Portal>\n <BaseComponent.Positioner\n side={baseUIPlacement.side}\n align={baseUIPlacement.align}\n sideOffset={4}\n className={clsx(\n cls(\"dropdown-menu-root\"),\n themeClassName,\n classNames?.root\n )}\n collisionAvoidance={DROPDOWN_COLLISION_AVOIDANCE}\n render={(props) => <BaseMenu.Root {...props} />}\n >\n <BaseComponent.Popup\n className={clsx(\n cls(\n \"dropdown-menu\",\n showCheckbox && \"dropdown-menu-show-checkbox\",\n popupMatchTriggerWidth && \"dropdown-menu-match-trigger-width\"\n ),\n className,\n classNames?.popup\n )}\n style={\n {\n \"--size-width\":\n size in PopupPanelSize ? PopupPanelSize[size] : undefined,\n } as React.CSSProperties\n }\n render={(props) => <BaseMenu.Popup {...props} />}\n >\n {renderMenuInner()}\n </BaseComponent.Popup>\n </BaseComponent.Positioner>\n </BaseComponent.Portal>\n </BaseComponent.Root>\n );\n};\n"],"names":["DropdownMenu","children","items","placement","openOnHover","outsideOpen","outsideOnOpenChange","defaultOpen","className","itemRender","classNames","size","showSearch","inComboboxProp","searchProps","popupMatchTriggerWidth","beforeList","afterList","keepOpenOnSelect","highlightedItemKey","selectedItemKeys","getItemKeywords","showCheckbox","itemLabelRender","inCombobox","open","onOpenChange","useControlledState","cls","useCls","themeClassName","useTheme","baseUIPlacement","parseAntdPlacement","buttonRef","useRef","itemGroups","renderGroup","useDropdownMenu","renderMenuInner","useCallback","jsxs","Command","jsx","FormItemInputContext","createElement","Input","ScrollArea","BaseComponent","Popover","Menu","clsx","DROPDOWN_COLLISION_AVOIDANCE","props","BaseMenu","PopupPanelSize"],"mappings":";;;;;;;;;;;;;;;;;;AAuGO,MAAMA,KAAe,CAAC;AAAA,EAC3B,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,MAAMC;AAAA,EACN,cAAcC;AAAA,EAC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;AAAA,YACR,KAAKiC;AAAA,YACL,cAAc;AAAA,YACd,WAAWiB;AAAA,cACTvB,EAAI,uBAAuB;AAAA,cAC3BlB,GAAY;AAAA,cACZoB;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,QAEF,gBAAAa,EAACK,EAAc,QAAd,EACC,UAAA,gBAAAL;AAAA,UAACK,EAAc;AAAA,UAAd;AAAA,YACC,MAAMhB,EAAgB;AAAA,YACtB,OAAOA,EAAgB;AAAA,YACvB,YAAY;AAAA,YACZ,WAAWmB;AAAA,cACTvB,EAAI,oBAAoB;AAAA,cACxBE;AAAA,cACApB,GAAY;AAAA,YAAA;AAAA,YAEd,oBAAoB0C;AAAA,YACpB,QAAQ,CAACC,MAAU,gBAAAV,EAACW,EAAS,MAAT,EAAe,GAAGD,GAAO;AAAA,YAE7C,UAAA,gBAAAV;AAAA,cAACK,EAAc;AAAA,cAAd;AAAA,gBACC,WAAWG;AAAA,kBACTvB;AAAA,oBACE;AAAA,oBACAN,KAAgB;AAAA,oBAChBP,KAA0B;AAAA,kBAAA;AAAA,kBAE5BP;AAAA,kBACAE,GAAY;AAAA,gBAAA;AAAA,gBAEd,OACE;AAAA,kBACE,gBACEC,KAAQ4C,IAAiBA,EAAe5C,CAAI,IAAI;AAAA,gBAAA;AAAA,gBAGtD,QAAQ,CAAC0C,MAAU,gBAAAV,EAACW,EAAS,OAAT,EAAgB,GAAGD,GAAO;AAAA,gBAE7C,UAAAd,EAAA;AAAA,cAAgB;AAAA,YAAA;AAAA,UACnB;AAAA,QAAA,EACF,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1 +1 @@
1
- {"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/divider.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,mBAAmB,GAAI,4BAGjC,wBAAwB,4CAO1B,CAAC"}
1
+ {"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/divider.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,mBAAmB,GAAI,4BAGjC,wBAAwB,4CAY1B,CAAC"}
@@ -1,16 +1,23 @@
1
- import { jsx as t } from "react/jsx-runtime";
1
+ import { jsx as r } from "react/jsx-runtime";
2
2
  import { Command as p } from "../cmdk/index.js";
3
- import { Menu as n } from "@base-ui-components/react/menu";
4
- import { useCls as s } from "../utils/antdUtils.js";
5
- import { clsx as a } from "../utils/cn.js";
6
- const l = ({
7
- inCombobox: r,
8
- className: o
3
+ import { Menu as i } from "@base-ui-components/react/menu";
4
+ import { BaseMenu as s } from "../base-menu/index.js";
5
+ import { useCls as a } from "../utils/antdUtils.js";
6
+ import { clsx as d } from "../utils/cn.js";
7
+ const x = ({
8
+ inCombobox: o,
9
+ className: e
9
10
  }) => {
10
- const m = s(), e = r ? p.Separator : n.Separator;
11
- return /* @__PURE__ */ t(e, { className: a(m("dropdown-menu-divider"), o) });
11
+ const m = a(), t = o ? p.Separator : i.Separator;
12
+ return /* @__PURE__ */ r(
13
+ t,
14
+ {
15
+ className: d(m("dropdown-menu-divider"), e),
16
+ render: (n) => /* @__PURE__ */ r(s.Divider, { ...n })
17
+ }
18
+ );
12
19
  };
13
20
  export {
14
- l as DropdownMenuDivider
21
+ x as DropdownMenuDivider
15
22
  };
16
23
  //# sourceMappingURL=divider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"divider.js","sources":["../../../src/components/dropdown-menu/divider.tsx"],"sourcesContent":["import { Command } from \"../cmdk\";\nimport { Menu } from \"@base-ui-components/react/menu\";\nimport { clsx, useCls } from \"../utils\";\n\nexport interface DropdownMenuDividerProps {\n inCombobox?: boolean;\n className?: string;\n}\n\nexport const DropdownMenuDivider = ({\n inCombobox,\n className,\n}: DropdownMenuDividerProps) => {\n const cls = useCls();\n const MenuSeparator = inCombobox ? Command.Separator : Menu.Separator;\n\n return (\n <MenuSeparator className={clsx(cls(\"dropdown-menu-divider\"), className)} />\n );\n};\n"],"names":["DropdownMenuDivider","inCombobox","className","cls","useCls","MenuSeparator","Command","Menu","jsx","clsx"],"mappings":";;;;;AASO,MAAMA,IAAsB,CAAC;AAAA,EAClC,YAAAC;AAAA,EACA,WAAAC;AACF,MAAgC;AAC9B,QAAMC,IAAMC,EAAA,GACNC,IAAgBJ,IAAaK,EAAQ,YAAYC,EAAK;AAE5D,SACE,gBAAAC,EAACH,KAAc,WAAWI,EAAKN,EAAI,uBAAuB,GAAGD,CAAS,GAAG;AAE7E;"}
1
+ {"version":3,"file":"divider.js","sources":["../../../src/components/dropdown-menu/divider.tsx"],"sourcesContent":["import { Command } from \"../cmdk\";\nimport { Menu } from \"@base-ui-components/react/menu\";\nimport { clsx, useCls } from \"../utils\";\nimport { BaseMenu } from \"../base-menu\";\nimport { HTMLAttributes } from \"react\";\n\nexport interface DropdownMenuDividerProps {\n inCombobox?: boolean;\n className?: string;\n}\n\nexport const DropdownMenuDivider = ({\n inCombobox,\n className,\n}: DropdownMenuDividerProps) => {\n const cls = useCls();\n const MenuSeparator = inCombobox ? Command.Separator : Menu.Separator;\n\n return (\n <MenuSeparator\n className={clsx(cls(\"dropdown-menu-divider\"), className)}\n render={(props: HTMLAttributes<HTMLDivElement>) => (\n <BaseMenu.Divider {...props} />\n )}\n />\n );\n};\n"],"names":["DropdownMenuDivider","inCombobox","className","cls","useCls","MenuSeparator","Command","Menu","jsx","clsx","props","BaseMenu"],"mappings":";;;;;;AAWO,MAAMA,IAAsB,CAAC;AAAA,EAClC,YAAAC;AAAA,EACA,WAAAC;AACF,MAAgC;AAC9B,QAAMC,IAAMC,EAAA,GACNC,IAAgBJ,IAAaK,EAAQ,YAAYC,EAAK;AAE5D,SACE,gBAAAC;AAAA,IAACH;AAAA,IAAA;AAAA,MACC,WAAWI,EAAKN,EAAI,uBAAuB,GAAGD,CAAS;AAAA,MACvD,QAAQ,CAACQ,MACP,gBAAAF,EAACG,EAAS,SAAT,EAAkB,GAAGD,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAIrC;"}