@bioturing/components 0.31.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.
- package/dist/components/choice-list/component.js.map +1 -1
- package/dist/components/combobox/component.js +163 -159
- package/dist/components/combobox/component.js.map +1 -1
- package/dist/components/dropdown-menu/component.js +26 -24
- package/dist/components/dropdown-menu/component.js.map +1 -1
- package/dist/components/dropdown-menu/item.js +67 -58
- package/dist/components/dropdown-menu/item.js.map +1 -1
- package/dist/components/dropdown-menu/useDropdownMenu.js +58 -55
- package/dist/components/dropdown-menu/useDropdownMenu.js.map +1 -1
- package/dist/components/input/component.js +24 -23
- package/dist/components/input/component.js.map +1 -1
- package/dist/components/scroll-area/component.js +83 -64
- package/dist/components/scroll-area/component.js.map +1 -1
- package/dist/components/select/component.js.map +1 -1
- package/dist/index.d.ts +60 -19
- 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';
|
|
@@ -984,24 +985,28 @@ export declare type ColorTokenValue = {
|
|
|
984
985
|
|
|
985
986
|
export { ColProps }
|
|
986
987
|
|
|
987
|
-
export declare const Combobox: default_2.
|
|
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
|
-
|
|
990
|
-
|
|
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?:
|
|
1005
|
+
value?: M extends true ? T[] : T;
|
|
1001
1006
|
/** Default value when uncontrolled */
|
|
1002
|
-
defaultValue?:
|
|
1007
|
+
defaultValue?: M extends true ? T[] : T;
|
|
1003
1008
|
/** Callback when value changes */
|
|
1004
|
-
onChange?: (value:
|
|
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?:
|
|
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:
|
|
1078
|
+
selectionSummaryRender?: (selectedValues: T[]) => default_2.ReactNode;
|
|
1074
1079
|
/**
|
|
1075
1080
|
* Show select all option when in multiple mode
|
|
1076
1081
|
* @default false
|
|
@@ -1089,9 +1094,11 @@ export declare interface ComboboxProps {
|
|
|
1089
1094
|
* Function to extract keywords from the item for search filtering
|
|
1090
1095
|
* @default (option) => [String(option.key), reactNodeToString(option.label)]
|
|
1091
1096
|
*/
|
|
1092
|
-
getOptionKeywords?: (option:
|
|
1093
|
-
|
|
1094
|
-
|
|
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;
|
|
1095
1102
|
}
|
|
1096
1103
|
|
|
1097
1104
|
declare type CommandFilter = (value: string, search: string, keywords?: string[]) => number;
|
|
@@ -1883,7 +1890,7 @@ export declare const DROPDOWN_COLLISION_AVOIDANCE: {
|
|
|
1883
1890
|
readonly fallbackAxisSide: "none";
|
|
1884
1891
|
};
|
|
1885
1892
|
|
|
1886
|
-
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, }: 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;
|
|
1887
1894
|
|
|
1888
1895
|
export declare interface DropdownMenuGroup {
|
|
1889
1896
|
label: default_2.ReactNode | null;
|
|
@@ -1899,6 +1906,9 @@ export declare interface DropdownMenuItemProps {
|
|
|
1899
1906
|
};
|
|
1900
1907
|
/** Custom render function for the item */
|
|
1901
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;
|
|
1902
1912
|
/** Additional props to pass to the item */
|
|
1903
1913
|
itemProps?: default_2.HTMLAttributes<HTMLElement>;
|
|
1904
1914
|
/** Class names from parent DropdownMenu */
|
|
@@ -3467,9 +3477,9 @@ export { Row }
|
|
|
3467
3477
|
|
|
3468
3478
|
export { RowProps }
|
|
3469
3479
|
|
|
3470
|
-
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;
|
|
3471
3481
|
|
|
3472
|
-
export declare interface ScrollAreaProps {
|
|
3482
|
+
export declare interface ScrollAreaProps extends Omit<ScrollArea_2.Root.Props, "onScroll"> {
|
|
3473
3483
|
children: ReactNode;
|
|
3474
3484
|
/**
|
|
3475
3485
|
* Additional class name for the root component
|
|
@@ -3483,6 +3493,10 @@ export declare interface ScrollAreaProps {
|
|
|
3483
3493
|
* Class name for the viewport element
|
|
3484
3494
|
*/
|
|
3485
3495
|
viewport?: string;
|
|
3496
|
+
/**
|
|
3497
|
+
* Class name for the content element
|
|
3498
|
+
*/
|
|
3499
|
+
content?: string;
|
|
3486
3500
|
/**
|
|
3487
3501
|
* Class name for the scrollbar element
|
|
3488
3502
|
*/
|
|
@@ -3492,6 +3506,27 @@ export declare interface ScrollAreaProps {
|
|
|
3492
3506
|
*/
|
|
3493
3507
|
thumb?: string;
|
|
3494
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
|
+
};
|
|
3495
3530
|
/**
|
|
3496
3531
|
* Orientation of the scrollbar
|
|
3497
3532
|
* @default "vertical"
|
|
@@ -4188,6 +4223,12 @@ declare interface UseDropdownMenuProps {
|
|
|
4188
4223
|
* Custom render function for menu items
|
|
4189
4224
|
*/
|
|
4190
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;
|
|
4191
4232
|
/**
|
|
4192
4233
|
* Whether to keep the dropdown open when an item is selected
|
|
4193
4234
|
* @default false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bioturing/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"rc-util": "^5.44.4",
|
|
32
32
|
"react-use-resizable": "^0.2.0",
|
|
33
33
|
"tailwind-merge": "^3.3.1",
|
|
34
|
-
"@bioturing/assets": "0.
|
|
34
|
+
"@bioturing/assets": "0.22.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"antd": "^5.26.7",
|