@bioturing/components 0.30.0 → 0.32.0

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 (36) hide show
  1. package/dist/components/choice-list/component.js +26 -28
  2. package/dist/components/choice-list/component.js.map +1 -1
  3. package/dist/components/code-block/component.js +10 -10
  4. package/dist/components/combobox/component.js +148 -143
  5. package/dist/components/combobox/component.js.map +1 -1
  6. package/dist/components/command-palette/component.js +79 -0
  7. package/dist/components/command-palette/component.js.map +1 -0
  8. package/dist/components/command-palette/style.css +1 -0
  9. package/dist/components/dropdown-menu/component.js +119 -189
  10. package/dist/components/dropdown-menu/component.js.map +1 -1
  11. package/dist/components/dropdown-menu/item.css +1 -1
  12. package/dist/components/dropdown-menu/item.js +82 -60
  13. package/dist/components/dropdown-menu/item.js.map +1 -1
  14. package/dist/components/dropdown-menu/style.css +1 -1
  15. package/dist/components/dropdown-menu/useDropdownMenu.js +127 -0
  16. package/dist/components/dropdown-menu/useDropdownMenu.js.map +1 -0
  17. package/dist/components/input/component.js +24 -23
  18. package/dist/components/input/component.js.map +1 -1
  19. package/dist/components/keyboard-shortcut/component.js +72 -0
  20. package/dist/components/keyboard-shortcut/component.js.map +1 -0
  21. package/dist/components/keyboard-shortcut/style.css +1 -0
  22. package/dist/components/loader/component.js +15 -0
  23. package/dist/components/loader/component.js.map +1 -0
  24. package/dist/components/loader/style.css +1 -0
  25. package/dist/components/popup-panel/style.css +1 -1
  26. package/dist/components/scroll-area/component.js +83 -64
  27. package/dist/components/scroll-area/component.js.map +1 -1
  28. package/dist/components/select/component.js.map +1 -1
  29. package/dist/components/theme-provider/style.css +1 -1
  30. package/dist/components/toast/style.css +1 -1
  31. package/dist/index.d.ts +236 -66
  32. package/dist/index.js +203 -197
  33. package/dist/index.js.map +1 -1
  34. package/dist/metadata.js +47 -2
  35. package/dist/metadata.js.map +1 -1
  36. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -177,6 +177,7 @@ import { ResultProps } from 'antd';
177
177
  import { RibbonProps } from 'antd/es/badge/Ribbon';
178
178
  import { Row } from 'antd';
179
179
  import { RowProps } from 'antd';
180
+ import { ScrollArea as ScrollArea_2 } from '@base-ui-components/react';
180
181
  import { SearchProps as SearchProps_2 } from 'antd/es/input';
181
182
  import { SeedToken } from 'antd/es/theme/internal';
182
183
  import { SegmentedProps as SegmentedProps_2 } from 'antd/es/segmented';
@@ -465,15 +466,15 @@ declare type Children = {
465
466
  children?: default_2.ReactNode;
466
467
  };
467
468
 
468
- export declare const ChoiceList: <M extends boolean = false>({ items, multiple, value, defaultValue, onChange, searchProps, showSelectAll, className, placeholder, disabled: disabledProp, status: statusProp, getItemKeywords, ...rest }: ChoiceListProps<M>) => JSX.Element;
469
+ export declare const ChoiceList: <M extends boolean = false>({ options, multiple, value, defaultValue, onChange, searchProps, showSelectAll, className, placeholder, disabled: disabledProp, status: statusProp, getItemKeywords, ...rest }: ChoiceListProps<M>) => JSX.Element;
469
470
 
470
- export declare type ChoiceListItem = {
471
+ export declare type ChoiceListOption = {
471
472
  label: React.ReactNode;
472
473
  value?: string;
473
474
  };
474
475
 
475
476
  export declare interface ChoiceListProps<M extends boolean = false> extends Omit<CommandProps, "value" | "onChange" | "defaultValue"> {
476
- items: ChoiceListItem[];
477
+ options: ChoiceListOption[];
477
478
  multiple?: M;
478
479
  value?: M extends true ? string[] : string;
479
480
  defaultValue?: M extends true ? string[] : string;
@@ -498,7 +499,7 @@ export declare interface ChoiceListProps<M extends boolean = false> extends Omit
498
499
  * Function to extract keywords from the item for search filtering
499
500
  * @default (item) => [item.value, reactNodeToString(item.label)]
500
501
  */
501
- getItemKeywords?: (item: ChoiceListItem) => string[];
502
+ getItemKeywords?: (item: ChoiceListOption) => string[];
502
503
  }
503
504
 
504
505
  export declare interface ClassArray extends Array<ClassValue> {
@@ -984,24 +985,28 @@ export declare type ColorTokenValue = {
984
985
 
985
986
  export { ColProps }
986
987
 
987
- export declare const Combobox: default_2.ForwardRefExoticComponent<ComboboxProps & default_2.RefAttributes<HTMLDivElement>>;
988
+ export declare const Combobox: <T extends default_2.Key, M extends boolean, O extends Record<string, unknown> = {}>(props: ComboboxProps<T, M, O> & {
989
+ ref?: ForwardedRef<HTMLDivElement>;
990
+ }) => ReturnType<typeof ComboboxInner>;
988
991
 
989
- export declare interface ComboboxOption {
990
- value: string | number;
992
+ declare const ComboboxInner: <T extends default_2.Key, M extends boolean, O extends Record<string, unknown> = {}>({ options, value: controlledValue, defaultValue, onChange, placeholder, disabled: disabledProp, status: statusProp, allowClear, multiple, maxTagCount, showSearch, open: controlledOpen, onOpenChange, placement, className, classNames, size, loading: _loading, optionRender, onSearch, dropdownRender, clearIcon, suffixIcon, dropdownMenuProps, triggerProps, searchProps, showSelectionSummary, selectionSummaryRender, showSelectAll, selectAllRender, optionLabelRender, getOptionKeywords, ...rest }: ComboboxProps<T, M, O>, ref: default_2.ForwardedRef<HTMLDivElement>) => JSX.Element;
993
+
994
+ export declare type ComboboxOption<T extends default_2.Key, O extends Record<string, unknown> = {}> = {
995
+ value: T;
991
996
  label: default_2.ReactNode;
992
997
  disabled?: boolean;
993
998
  icon?: default_2.ReactNode;
994
- }
999
+ } & O;
995
1000
 
996
- export declare interface ComboboxProps {
1001
+ export declare interface ComboboxProps<T extends default_2.Key, M extends boolean, O extends Record<string, unknown> = {}> {
997
1002
  /** Array of options to be displayed in the combobox */
998
- options?: ComboboxOption[];
1003
+ options?: ComboboxOption<T, O>[];
999
1004
  /** Current value of the combobox */
1000
- value?: string | number | Array<string | number>;
1005
+ value?: M extends true ? T[] : T;
1001
1006
  /** Default value when uncontrolled */
1002
- defaultValue?: string | number | Array<string | number>;
1007
+ defaultValue?: M extends true ? T[] : T;
1003
1008
  /** Callback when value changes */
1004
- onChange?: (value: string | number | Array<string | number>) => void;
1009
+ onChange?: (value: M extends true ? T[] : T) => void;
1005
1010
  /** Placeholder text for the input */
1006
1011
  placeholder?: string;
1007
1012
  /** Whether the combobox is disabled */
@@ -1011,7 +1016,7 @@ export declare interface ComboboxProps {
1011
1016
  /** Whether to allow clearing the selection */
1012
1017
  allowClear?: boolean;
1013
1018
  /** Whether to allow multiple selections */
1014
- multiple?: boolean;
1019
+ multiple?: M;
1015
1020
  /** Maximum number of tags to show */
1016
1021
  maxTagCount?: number;
1017
1022
  /** Whether to show search functionality */
@@ -1037,9 +1042,9 @@ export declare interface ComboboxProps {
1037
1042
  /** Loading state */
1038
1043
  loading?: boolean;
1039
1044
  /** Custom render for options */
1040
- optionRender?: (option: ComboboxOption, props: default_2.HTMLAttributes<HTMLElement>) => default_2.ReactElement;
1045
+ optionRender?: (option: ComboboxOption<T, O>, props: default_2.HTMLAttributes<HTMLElement>) => default_2.ReactElement;
1041
1046
  /** Filter function for search */
1042
- filterOption?: boolean | ((input: string, option: ComboboxOption) => boolean);
1047
+ filterOption?: boolean | ((input: string, option: ComboboxOption<T, O>) => boolean);
1043
1048
  /** Callback when search input changes */
1044
1049
  onSearch?: (value: string) => void;
1045
1050
  /** Custom dropdown render */
@@ -1070,7 +1075,7 @@ export declare interface ComboboxProps {
1070
1075
  * Render function for the selection summary in multiple case
1071
1076
  * @default (selectedValues) => `${selectedValues.length} items selected`
1072
1077
  */
1073
- selectionSummaryRender?: (selectedValues: Array<string | number>) => default_2.ReactNode;
1078
+ selectionSummaryRender?: (selectedValues: T[]) => default_2.ReactNode;
1074
1079
  /**
1075
1080
  * Show select all option when in multiple mode
1076
1081
  * @default false
@@ -1085,10 +1090,60 @@ export declare interface ComboboxProps {
1085
1090
  checked: boolean;
1086
1091
  indeterminate: boolean;
1087
1092
  }) => default_2.ReactNode;
1093
+ /**
1094
+ * Function to extract keywords from the item for search filtering
1095
+ * @default (option) => [String(option.key), reactNodeToString(option.label)]
1096
+ */
1097
+ getOptionKeywords?: (option: ComboboxOption<T, O>) => string[];
1098
+ /**
1099
+ * Render function for the option label
1100
+ */
1101
+ optionLabelRender?: (option: ComboboxOption<T, O>, props?: default_2.HTMLAttributes<HTMLElement>) => default_2.ReactElement;
1088
1102
  }
1089
1103
 
1090
1104
  declare type CommandFilter = (value: string, search: string, keywords?: string[]) => number;
1091
1105
 
1106
+ export declare const CommandPalette: default_2.FC<CommandPaletteProps>;
1107
+
1108
+ export declare interface CommandPaletteProps {
1109
+ /** Whether the command palette is open */
1110
+ open?: boolean;
1111
+ /** Callback fired when the open state changes */
1112
+ onOpenChange?: (open: boolean) => void;
1113
+ /**
1114
+ * Default open state
1115
+ */
1116
+ defaultOpen?: boolean;
1117
+ /** Items to display in the command palette */
1118
+ items?: DropdownMenuItemType[];
1119
+ /** Keyboard shortcuts to open the palette */
1120
+ shortcuts?: CommandPaletteShortcut[];
1121
+ /** Placeholder text for the search input */
1122
+ placeholder?: string;
1123
+ /** Text to show when no results are found */
1124
+ emptyText?: string;
1125
+ /** Accessible label for the command palette */
1126
+ label?: string;
1127
+ /** Additional CSS class names */
1128
+ className?: string;
1129
+ classNames?: {
1130
+ root?: string;
1131
+ mask?: string;
1132
+ content?: string;
1133
+ group?: string;
1134
+ item?: string;
1135
+ groupLabel?: string;
1136
+ };
1137
+ }
1138
+
1139
+ export declare type CommandPaletteShortcut = {
1140
+ key: string;
1141
+ metaKey?: boolean;
1142
+ ctrlKey?: boolean;
1143
+ altKey?: boolean;
1144
+ shiftKey?: boolean;
1145
+ };
1146
+
1092
1147
  declare type CommandProps = Children & DivProps & {
1093
1148
  /**
1094
1149
  * Accessible label for this command menu. Not shown visibly.
@@ -1379,6 +1434,14 @@ export declare const componentMetadata: {
1379
1434
  originalDocUrl: string;
1380
1435
  description: string;
1381
1436
  };
1437
+ Loader: {
1438
+ name: string;
1439
+ link: string;
1440
+ base: "custom";
1441
+ refinements: string[];
1442
+ category: "Feedback";
1443
+ description: string;
1444
+ };
1382
1445
  Spin: {
1383
1446
  name: string;
1384
1447
  link: string;
@@ -1538,6 +1601,23 @@ export declare const componentMetadata: {
1538
1601
  category: "Feedback";
1539
1602
  description: string;
1540
1603
  };
1604
+ CommandPalette: {
1605
+ name: string;
1606
+ link: string;
1607
+ base: "custom";
1608
+ refinements: string[];
1609
+ category: "Navigation";
1610
+ packages: string[];
1611
+ description: string;
1612
+ };
1613
+ KeyboardShortcut: {
1614
+ name: string;
1615
+ link: string;
1616
+ base: "custom";
1617
+ refinements: string[];
1618
+ category: "Data Display";
1619
+ description: string;
1620
+ };
1541
1621
  VerticalCollapsiblePanel: {
1542
1622
  name: string;
1543
1623
  link: string;
@@ -1810,7 +1890,12 @@ export declare const DROPDOWN_COLLISION_AVOIDANCE: {
1810
1890
  readonly fallbackAxisSide: "none";
1811
1891
  };
1812
1892
 
1813
- export declare const DropdownMenu: ({ children, items, placement, openOnHover, open: outsideOpen, onOpenChange: outsideOnOpenChange, className, itemRender, classNames, size, showSearch, searchProps, popupMatchTriggerWidth, beforeList, afterList, keepOpenOnSelect, highlightedItemKey, selectedItemKeys, showCheckbox, getItemKeywords, }: DropdownMenuProps) => JSX.Element;
1893
+ export declare const DropdownMenu: ({ children, items, placement, openOnHover, open: outsideOpen, onOpenChange: outsideOnOpenChange, defaultOpen, className, itemRender, classNames, size, showSearch, inCombobox: inComboboxProp, searchProps, popupMatchTriggerWidth, beforeList, afterList, keepOpenOnSelect, highlightedItemKey, selectedItemKeys, getItemKeywords, showCheckbox, itemLabelRender, }: DropdownMenuProps) => JSX.Element;
1894
+
1895
+ export declare interface DropdownMenuGroup {
1896
+ label: default_2.ReactNode | null;
1897
+ items: DropdownMenuItemType[];
1898
+ }
1814
1899
 
1815
1900
  export declare const DropdownMenuItem: default_2.FC<DropdownMenuItemProps>;
1816
1901
 
@@ -1821,6 +1906,9 @@ export declare interface DropdownMenuItemProps {
1821
1906
  };
1822
1907
  /** Custom render function for the item */
1823
1908
  itemRender?: (item: DropdownMenuItemType, props: default_2.HTMLAttributes<HTMLElement>) => default_2.ReactElement;
1909
+ itemLabelRender?: (item: DropdownMenuItemType & {
1910
+ type: "item";
1911
+ }, props: default_2.HTMLAttributes<HTMLElement>) => default_2.ReactElement;
1824
1912
  /** Additional props to pass to the item */
1825
1913
  itemProps?: default_2.HTMLAttributes<HTMLElement>;
1826
1914
  /** Class names from parent DropdownMenu */
@@ -1828,8 +1916,11 @@ export declare interface DropdownMenuItemProps {
1828
1916
  item?: string;
1829
1917
  itemIcon?: string;
1830
1918
  itemText?: string;
1919
+ itemSuffix?: string;
1831
1920
  };
1832
- onSelect?: () => void;
1921
+ onSelect?: (item: DropdownMenuItemType & {
1922
+ type: "item";
1923
+ }) => void;
1833
1924
  /**
1834
1925
  * Whether the menu item is in a combobox
1835
1926
  */
@@ -1869,7 +1960,7 @@ export declare type DropdownMenuItemType = {
1869
1960
  /**
1870
1961
  * The label of the menu item
1871
1962
  */
1872
- label?: React.ReactNode;
1963
+ label?: default_2.ReactNode;
1873
1964
  /**
1874
1965
  * Whether the menu item is disabled
1875
1966
  */
@@ -1877,31 +1968,41 @@ export declare type DropdownMenuItemType = {
1877
1968
  /**
1878
1969
  * The icon of the menu item
1879
1970
  */
1880
- icon?: React.ReactNode;
1971
+ icon?: default_2.ReactNode;
1972
+ /**
1973
+ * The suffix of the menu item
1974
+ */
1975
+ suffix?: default_2.ReactNode;
1881
1976
  /**
1882
1977
  * The key of the menu item
1883
1978
  */
1884
- key: React.Key;
1979
+ key: default_2.Key;
1980
+ /**
1981
+ * The onSelect event handler of the menu item
1982
+ */
1983
+ onSelect?: (item: DropdownMenuItemType & {
1984
+ type: "item";
1985
+ }) => void;
1885
1986
  /**
1886
1987
  * The onClick event handler of the menu item
1887
1988
  */
1888
- onClick?: React.HTMLAttributes<HTMLElement>["onClick"];
1989
+ onClick?: default_2.HTMLAttributes<HTMLElement>["onClick"];
1889
1990
  /**
1890
1991
  * The onMouseEnter event handler of the menu item
1891
1992
  */
1892
- onMouseEnter?: React.HTMLAttributes<HTMLElement>["onMouseEnter"];
1993
+ onMouseEnter?: default_2.HTMLAttributes<HTMLElement>["onMouseEnter"];
1893
1994
  /**
1894
1995
  * The onMouseLeave event handler of the menu item
1895
1996
  */
1896
- onMouseLeave?: React.HTMLAttributes<HTMLElement>["onMouseLeave"];
1997
+ onMouseLeave?: default_2.HTMLAttributes<HTMLElement>["onMouseLeave"];
1897
1998
  /**
1898
1999
  * The onMouseOver event handler of the menu item
1899
2000
  */
1900
- onMouseOver?: React.HTMLAttributes<HTMLElement>["onMouseOver"];
2001
+ onMouseOver?: default_2.HTMLAttributes<HTMLElement>["onMouseOver"];
1901
2002
  /**
1902
2003
  * The onMouseOut event handler of the menu item
1903
2004
  */
1904
- onMouseOut?: React.HTMLAttributes<HTMLElement>["onMouseOut"];
2005
+ onMouseOut?: default_2.HTMLAttributes<HTMLElement>["onMouseOut"];
1905
2006
  /**
1906
2007
  * The className of the menu item
1907
2008
  */
@@ -1913,7 +2014,7 @@ export declare type DropdownMenuItemType = {
1913
2014
  /**
1914
2015
  * The ref of the menu item
1915
2016
  */
1916
- ref?: React.Ref<HTMLElement>;
2017
+ ref?: default_2.Ref<HTMLElement>;
1917
2018
  } | {
1918
2019
  /**
1919
2020
  * The type of the menu item
@@ -1927,14 +2028,14 @@ export declare type DropdownMenuItemType = {
1927
2028
  /**
1928
2029
  * The title of the menu item
1929
2030
  */
1930
- title?: React.ReactNode;
2031
+ title?: default_2.ReactNode;
1931
2032
  /**
1932
2033
  * The className of the menu item
1933
2034
  */
1934
2035
  className?: string;
1935
2036
  };
1936
2037
 
1937
- export declare interface DropdownMenuProps {
2038
+ export declare interface DropdownMenuProps extends Omit<UseDropdownMenuProps, "classNames"> {
1938
2039
  /** Array of menu items to be displayed in the dropdown */
1939
2040
  items: DropdownMenuItemType[];
1940
2041
  /** Custom render function for the trigger element */
@@ -1957,6 +2058,10 @@ export declare interface DropdownMenuProps {
1957
2058
  * Callback fired when the dropdown open state changes
1958
2059
  */
1959
2060
  onOpenChange?: (open: boolean) => void;
2061
+ /**
2062
+ * Default open state of the dropdown
2063
+ */
2064
+ defaultOpen?: boolean;
1960
2065
  /**
1961
2066
  * Additional CSS class for the dropdown component
1962
2067
  */
@@ -1969,18 +2074,10 @@ export declare interface DropdownMenuProps {
1969
2074
  root?: string;
1970
2075
  trigger?: string;
1971
2076
  popup?: string;
1972
- group?: string;
1973
- groupLabel?: string;
1974
- item?: string;
1975
2077
  itemIcon?: string;
1976
2078
  itemText?: string;
1977
- separator?: string;
1978
2079
  positioner?: string;
1979
- };
1980
- /**
1981
- * Custom render function for menu items
1982
- */
1983
- itemRender?: (item: DropdownMenuItemType, props: React.HTMLAttributes<HTMLElement>) => React.ReactElement;
2080
+ } & UseDropdownMenuProps["classNames"];
1984
2081
  /**
1985
2082
  * Whether to show search input
1986
2083
  * @default false
@@ -2008,31 +2105,6 @@ export declare interface DropdownMenuProps {
2008
2105
  * Content to display after the list
2009
2106
  */
2010
2107
  afterList?: React.ReactNode;
2011
- /**
2012
- * Whether to keep the dropdown open when an item is selected
2013
- * @default false
2014
- */
2015
- keepOpenOnSelect?: boolean;
2016
- /**
2017
- * Control the highlighted state of the menu item
2018
- */
2019
- highlightedItemKey?: React.Key;
2020
- /**
2021
- * Control the selected state of the menu item
2022
- */
2023
- selectedItemKeys?: React.Key[];
2024
- /**
2025
- * Whether to show checkbox
2026
- * @default false
2027
- */
2028
- showCheckbox?: boolean;
2029
- /**
2030
- * Function to extract keywords from the item for search filtering
2031
- * @default (item) => [String(item.key), reactNodeToString(item.label)]
2032
- */
2033
- getItemKeywords?: (item: DropdownMenuItemType & {
2034
- type: "item";
2035
- }) => string[];
2036
2108
  }
2037
2109
 
2038
2110
  export { DropDownProps }
@@ -2276,6 +2348,21 @@ export declare function isTracebackError(error: unknown): boolean;
2276
2348
 
2277
2349
  export declare const isValidHexColor: (hex: string, acceptWithoutPrefix?: boolean) => boolean;
2278
2350
 
2351
+ export declare const KeyboardShortcut: default_2.FC<KeyboardShortcutProps>;
2352
+
2353
+ export declare interface KeyboardShortcutProps {
2354
+ /** The keyboard shortcut keys to display (optional if using children) */
2355
+ keys?: string[];
2356
+ /** Custom className */
2357
+ className?: string;
2358
+ /** Custom style */
2359
+ style?: default_2.CSSProperties;
2360
+ /** Size variant */
2361
+ size?: "small" | "medium" | "large";
2362
+ /** Children to display as keyboard shortcuts */
2363
+ children?: default_2.ReactNode;
2364
+ }
2365
+
2279
2366
  export { Layout }
2280
2367
 
2281
2368
  export { LayoutProps }
@@ -2286,6 +2373,12 @@ export { List }
2286
2373
 
2287
2374
  export { ListProps }
2288
2375
 
2376
+ export declare const Loader: ForwardRefExoticComponent<LoaderProps & RefAttributes<HTMLSpanElement>>;
2377
+
2378
+ export declare interface LoaderProps extends React.ComponentPropsWithoutRef<"span"> {
2379
+ text?: string;
2380
+ }
2381
+
2289
2382
  declare const MainCheckboxInner: ({ variant, className, ...props }: CheckboxProps, ref: React.Ref<React.ComponentRef<typeof Checkbox_2>>) => JSX.Element;
2290
2383
 
2291
2384
  declare const MainInputInner: (props: InputProps, ref: React.Ref<InputRef>) => JSX.Element;
@@ -3384,9 +3477,9 @@ export { Row }
3384
3477
 
3385
3478
  export { RowProps }
3386
3479
 
3387
- export declare const ScrollArea: ({ children, className, classNames, orientation, fadeEdges, onScroll, }: ScrollAreaProps) => JSX.Element;
3480
+ export declare const ScrollArea: ({ children, className, classNames, orientation, fadeEdges, onScroll, styles, ...rest }: ScrollAreaProps) => JSX.Element;
3388
3481
 
3389
- export declare interface ScrollAreaProps {
3482
+ export declare interface ScrollAreaProps extends Omit<ScrollArea_2.Root.Props, "onScroll"> {
3390
3483
  children: ReactNode;
3391
3484
  /**
3392
3485
  * Additional class name for the root component
@@ -3400,6 +3493,10 @@ export declare interface ScrollAreaProps {
3400
3493
  * Class name for the viewport element
3401
3494
  */
3402
3495
  viewport?: string;
3496
+ /**
3497
+ * Class name for the content element
3498
+ */
3499
+ content?: string;
3403
3500
  /**
3404
3501
  * Class name for the scrollbar element
3405
3502
  */
@@ -3409,6 +3506,27 @@ export declare interface ScrollAreaProps {
3409
3506
  */
3410
3507
  thumb?: string;
3411
3508
  };
3509
+ /**
3510
+ * Custom styles for each part of the scroll area
3511
+ */
3512
+ styles?: {
3513
+ /**
3514
+ * Styles for the viewport element
3515
+ */
3516
+ viewport?: React.CSSProperties;
3517
+ /**
3518
+ * Styles for the content element
3519
+ */
3520
+ content?: React.CSSProperties;
3521
+ /**
3522
+ * Styles for the scrollbar element
3523
+ */
3524
+ scrollbar?: React.CSSProperties;
3525
+ /**
3526
+ * Styles for the thumb element
3527
+ */
3528
+ thumb?: React.CSSProperties;
3529
+ };
3412
3530
  /**
3413
3531
  * Orientation of the scrollbar
3414
3532
  * @default "vertical"
@@ -4086,6 +4204,58 @@ export declare function useDraggable(enabled?: boolean): {
4086
4204
  ref: (element: HTMLElement | null) => () => void;
4087
4205
  };
4088
4206
 
4207
+ declare interface UseDropdownMenuProps {
4208
+ /**
4209
+ * Callback function to handle the open state change of the dropdown menu.
4210
+ */
4211
+ onOpenChange?: (open: boolean) => void;
4212
+ items: DropdownMenuItemType[];
4213
+ inCombobox?: boolean;
4214
+ classNames?: {
4215
+ item?: string;
4216
+ itemIcon?: string;
4217
+ itemSuffix?: string;
4218
+ group?: string;
4219
+ groupLabel?: string;
4220
+ divider?: string;
4221
+ };
4222
+ /**
4223
+ * Custom render function for menu items
4224
+ */
4225
+ itemRender?: (item: DropdownMenuItemType, props: React.HTMLAttributes<HTMLElement>) => React.ReactElement;
4226
+ /**
4227
+ * Custom render function for menu item labels
4228
+ */
4229
+ itemLabelRender?: (item: DropdownMenuItemType & {
4230
+ type: "item";
4231
+ }, props: React.HTMLAttributes<HTMLElement>) => React.ReactElement;
4232
+ /**
4233
+ * Whether to keep the dropdown open when an item is selected
4234
+ * @default false
4235
+ */
4236
+ keepOpenOnSelect?: boolean;
4237
+ /**
4238
+ * Control the highlighted state of the menu item
4239
+ */
4240
+ highlightedItemKey?: React.Key;
4241
+ /**
4242
+ * Control the selected state of the menu item
4243
+ */
4244
+ selectedItemKeys?: React.Key[];
4245
+ /**
4246
+ * Whether to show checkbox
4247
+ * @default false
4248
+ */
4249
+ showCheckbox?: boolean;
4250
+ /**
4251
+ * Function to extract keywords from the item for search filtering
4252
+ * @default (item) => [String(item.key), reactNodeToString(item.label)]
4253
+ */
4254
+ getItemKeywords?: (item: DropdownMenuItemType & {
4255
+ type: "item";
4256
+ }) => string[];
4257
+ }
4258
+
4089
4259
  export declare const useDS: () => {
4090
4260
  theme: "light" | "dark";
4091
4261
  };