@mindlogic-ai/logician-ui 3.0.0-alpha.34 → 3.0.0-alpha.35
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/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.js +7 -20
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Pagination/Pagination.mjs +7 -20
- package/dist/components/Pagination/Pagination.mjs.map +1 -1
- package/dist/components/Select/Combobox.d.ts +28 -0
- package/dist/components/Select/Combobox.d.ts.map +1 -0
- package/dist/components/Select/Combobox.js +47 -0
- package/dist/components/Select/Combobox.js.map +1 -0
- package/dist/components/Select/Combobox.mjs +45 -0
- package/dist/components/Select/Combobox.mjs.map +1 -0
- package/dist/components/Select/ComboboxField.d.ts +12 -0
- package/dist/components/Select/ComboboxField.d.ts.map +1 -0
- package/dist/components/Select/ComboboxField.js +34 -0
- package/dist/components/Select/ComboboxField.js.map +1 -0
- package/dist/components/Select/ComboboxField.mjs +32 -0
- package/dist/components/Select/ComboboxField.mjs.map +1 -0
- package/dist/components/Select/Select.d.ts +29 -3
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +41 -156
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/Select.mjs +43 -158
- package/dist/components/Select/Select.mjs.map +1 -1
- package/dist/components/Select/Select.styles.d.ts +91 -62
- package/dist/components/Select/Select.styles.d.ts.map +1 -1
- package/dist/components/Select/Select.styles.js +67 -69
- package/dist/components/Select/Select.styles.js.map +1 -1
- package/dist/components/Select/Select.styles.mjs +63 -66
- package/dist/components/Select/Select.styles.mjs.map +1 -1
- package/dist/components/Select/Select.types.d.ts +31 -8
- package/dist/components/Select/Select.types.d.ts.map +1 -1
- package/dist/components/Select/SelectField.d.ts +11 -0
- package/dist/components/Select/SelectField.d.ts.map +1 -0
- package/dist/components/Select/SelectField.js +32 -0
- package/dist/components/Select/SelectField.js.map +1 -0
- package/dist/components/Select/SelectField.mjs +30 -0
- package/dist/components/Select/SelectField.mjs.map +1 -0
- package/dist/components/Select/index.d.ts +4 -0
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/index.js +27 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -3
- package/src/components/FormIntegration/FormIntegration.stories.tsx +7 -13
- package/src/components/FormIntegration/README.md +1 -1
- package/src/components/Pagination/Pagination.tsx +7 -26
- package/src/components/Select/Combobox.stories.tsx +172 -0
- package/src/components/Select/Combobox.tsx +69 -0
- package/src/components/Select/ComboboxField.tsx +86 -0
- package/src/components/Select/Comparison.stories.tsx +38 -321
- package/src/components/Select/Select.stories.tsx +691 -404
- package/src/components/Select/Select.styles.ts +64 -76
- package/src/components/Select/Select.tsx +76 -202
- package/src/components/Select/Select.types.ts +33 -13
- package/src/components/Select/SelectField.tsx +87 -0
- package/src/components/Select/index.ts +8 -0
- package/dist/components/Select/MenuList/MenuList.d.ts +0 -4
- package/dist/components/Select/MenuList/MenuList.d.ts.map +0 -1
- package/dist/components/Select/MenuList/MenuList.types.d.ts +0 -9
- package/dist/components/Select/MenuList/MenuList.types.d.ts.map +0 -1
- package/dist/components/Select/MenuList/VirtualizedMenuList.d.ts +0 -4
- package/dist/components/Select/MenuList/VirtualizedMenuList.d.ts.map +0 -1
- package/dist/components/Select/MenuList/VirtualizedMenuListContext.d.ts +0 -9
- package/dist/components/Select/MenuList/VirtualizedMenuListContext.d.ts.map +0 -1
- package/dist/components/Select/MenuList/index.d.ts +0 -4
- package/dist/components/Select/MenuList/index.d.ts.map +0 -1
- package/dist/components/Select/_utils/resolveStyle.d.ts +0 -5
- package/dist/components/Select/_utils/resolveStyle.d.ts.map +0 -1
- package/src/components/Select/MenuList/MenuList.tsx +0 -87
- package/src/components/Select/MenuList/MenuList.types.ts +0 -21
- package/src/components/Select/MenuList/VirtualizedMenuList.tsx +0 -136
- package/src/components/Select/MenuList/VirtualizedMenuListContext.tsx +0 -35
- package/src/components/Select/MenuList/index.ts +0 -3
- package/src/components/Select/_utils/resolveStyle.ts +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/Pagination.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/Pagination.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,GAAI,oKAUxB,eAAe,4CA4FjB,CAAC"}
|
|
@@ -17,7 +17,9 @@ var Subtext = require('../Typography/Subtext.js');
|
|
|
17
17
|
var Subtitle = require('../Typography/Subtitle.js');
|
|
18
18
|
require('../Typography/Text.js');
|
|
19
19
|
var useTranslate = require('../../hooks/useTranslate.js');
|
|
20
|
-
|
|
20
|
+
require('../Select/Combobox.js');
|
|
21
|
+
require('../Select/Select.js');
|
|
22
|
+
var SelectField = require('../Select/SelectField.js');
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
25
|
* A pagination component that allows users to navigate through pages.
|
|
@@ -52,9 +54,8 @@ const Pagination = ({ currentPage: controlledCurrentPage, onCurrentPageChange, n
|
|
|
52
54
|
onNext();
|
|
53
55
|
}
|
|
54
56
|
};
|
|
55
|
-
const handleItemsPerPageOptionChange = (
|
|
56
|
-
if (
|
|
57
|
-
const newItemsPerPage = newValue.value;
|
|
57
|
+
const handleItemsPerPageOptionChange = (newItemsPerPage) => {
|
|
58
|
+
if (newItemsPerPage != null) {
|
|
58
59
|
onItemsPerPageOptionChange?.(newItemsPerPage);
|
|
59
60
|
const newMaxPage = Math.ceil(numTotalItems / newItemsPerPage);
|
|
60
61
|
// If this makes the current page out of range, set the current page to the last page
|
|
@@ -64,24 +65,10 @@ const Pagination = ({ currentPage: controlledCurrentPage, onCurrentPageChange, n
|
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
|
-
return (jsxRuntime.jsxs(react.Flex, { align: "center", justify: "space-between", w: "100%", ...rest, children: [jsxRuntime.jsx(react.Flex, { align: "center", gap: 2, children: itemsPerPageOptions && (jsxRuntime.jsxs(react.Flex, { align: "center", gap: 2, children: [jsxRuntime.jsx(
|
|
68
|
-
control: (base, _state) => ({
|
|
69
|
-
...base,
|
|
70
|
-
fontSize: '0.875rem',
|
|
71
|
-
padding: 0,
|
|
72
|
-
minHeight: '28px',
|
|
73
|
-
}),
|
|
74
|
-
dropdownIndicator: (base, _props) => ({
|
|
75
|
-
...base,
|
|
76
|
-
padding: '0 4px',
|
|
77
|
-
}),
|
|
78
|
-
}, options: itemsPerPageOptions.map((option) => ({
|
|
68
|
+
return (jsxRuntime.jsxs(react.Flex, { align: "center", justify: "space-between", w: "100%", ...rest, children: [jsxRuntime.jsx(react.Flex, { align: "center", gap: 2, children: itemsPerPageOptions && (jsxRuntime.jsxs(react.Flex, { align: "center", gap: 2, children: [jsxRuntime.jsx(SelectField.SelectField, { size: "sm", width: "5.5rem", options: itemsPerPageOptions.map((option) => ({
|
|
79
69
|
label: option.toString(),
|
|
80
70
|
value: option,
|
|
81
|
-
})), value: {
|
|
82
|
-
label: itemsPerPage.toString(),
|
|
83
|
-
value: itemsPerPage,
|
|
84
|
-
}, onChange: handleItemsPerPageOptionChange }), jsxRuntime.jsx(Subtext.Subtext, { whiteSpace: "nowrap", children: translate('pagination_items_per_page') })] })) }), jsxRuntime.jsxs(react.Flex, { align: "center", gap: 2, children: [jsxRuntime.jsxs(Subtitle.Subtitle, { children: [currentPage, " / ", maxPage] }), maxPage > 1 && (jsxRuntime.jsxs(react.Flex, { align: "center", children: [jsxRuntime.jsx(IconButton.IconButton, { colorPalette: "neutral", variant: "ghost", "aria-label": translate('previous'), onClick: handleBack, disabled: currentPage <= 1, color: currentPage === 1 ? 'gray.400' : 'gray.1000', children: jsxRuntime.jsx(index.IoIosArrowBack, { boxSize: "sm" }) }), jsxRuntime.jsx(IconButton.IconButton, { colorPalette: "neutral", variant: "ghost", "aria-label": translate('go_next_page_button'), onClick: handleNext, disabled: currentPage >= maxPage, color: currentPage === maxPage ? 'gray.400' : 'gray.1000', children: jsxRuntime.jsx(index.IoChevronForward, { boxSize: "sm" }) })] }))] })] }));
|
|
71
|
+
})), value: itemsPerPage, onChange: handleItemsPerPageOptionChange }), jsxRuntime.jsx(Subtext.Subtext, { whiteSpace: "nowrap", children: translate('pagination_items_per_page') })] })) }), jsxRuntime.jsxs(react.Flex, { align: "center", gap: 2, children: [jsxRuntime.jsxs(Subtitle.Subtitle, { children: [currentPage, " / ", maxPage] }), maxPage > 1 && (jsxRuntime.jsxs(react.Flex, { align: "center", children: [jsxRuntime.jsx(IconButton.IconButton, { colorPalette: "neutral", variant: "ghost", "aria-label": translate('previous'), onClick: handleBack, disabled: currentPage <= 1, color: currentPage === 1 ? 'gray.400' : 'gray.1000', children: jsxRuntime.jsx(index.IoIosArrowBack, { boxSize: "sm" }) }), jsxRuntime.jsx(IconButton.IconButton, { colorPalette: "neutral", variant: "ghost", "aria-label": translate('go_next_page_button'), onClick: handleNext, disabled: currentPage >= maxPage, color: currentPage === maxPage ? 'gray.400' : 'gray.1000', children: jsxRuntime.jsx(index.IoChevronForward, { boxSize: "sm" }) })] }))] })] }));
|
|
85
72
|
};
|
|
86
73
|
|
|
87
74
|
exports.Pagination = Pagination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":[null],"names":["useTranslate","useState","useMemo","_jsxs","Flex","_jsx","
|
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":[null],"names":["useTranslate","useState","useMemo","_jsxs","Flex","_jsx","SelectField","Subtext","Subtitle","IconButton","IoIosArrowBack","IoChevronForward"],"mappings":";;;;;;;;;;;;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EAAA,CAClBC,cAAA,CAACI,qBAAU,EAAA,EACT,YAAY,EAAC,SAAS,EACtB,OAAO,EAAC,OAAO,EAAA,YAAA,EACH,SAAS,CAAC,UAAU,CAAW,EAC3C,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,WAAW,IAAI,CAAC,EAC1B,KAAK,EAAE,WAAW,KAAK,CAAC,GAAG,UAAU,GAAG,WAAW,YAEnDJ,cAAA,CAACK,oBAAc,EAAA,EAAC,OAAO,EAAC,IAAI,EAAA,CAAG,EAAA,CACpB,EACbL,eAACI,qBAAU,EAAA,EACT,YAAY,EAAC,SAAS,EACtB,OAAO,EAAC,OAAO,EAAA,YAAA,EACH,SAAS,CAAC,qBAAqB,CAAW,EACtD,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,WAAW,IAAI,OAAO,EAChC,KAAK,EAAE,WAAW,KAAK,OAAO,GAAG,UAAU,GAAG,WAAW,EAAA,QAAA,EAEzDJ,cAAA,CAACM,sBAAgB,EAAA,EAAC,OAAO,EAAC,IAAI,GAAG,EAAA,CACtB,CAAA,EAAA,CACR,CACR,CAAA,EAAA,CACI,CAAA,EAAA,CACF;AAEX;;;;"}
|
|
@@ -15,7 +15,9 @@ import { Subtext } from '../Typography/Subtext.mjs';
|
|
|
15
15
|
import { Subtitle } from '../Typography/Subtitle.mjs';
|
|
16
16
|
import '../Typography/Text.mjs';
|
|
17
17
|
import { useTranslate } from '../../hooks/useTranslate.mjs';
|
|
18
|
-
import
|
|
18
|
+
import '../Select/Combobox.mjs';
|
|
19
|
+
import '../Select/Select.mjs';
|
|
20
|
+
import { SelectField } from '../Select/SelectField.mjs';
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
23
|
* A pagination component that allows users to navigate through pages.
|
|
@@ -50,9 +52,8 @@ const Pagination = ({ currentPage: controlledCurrentPage, onCurrentPageChange, n
|
|
|
50
52
|
onNext();
|
|
51
53
|
}
|
|
52
54
|
};
|
|
53
|
-
const handleItemsPerPageOptionChange = (
|
|
54
|
-
if (
|
|
55
|
-
const newItemsPerPage = newValue.value;
|
|
55
|
+
const handleItemsPerPageOptionChange = (newItemsPerPage) => {
|
|
56
|
+
if (newItemsPerPage != null) {
|
|
56
57
|
onItemsPerPageOptionChange?.(newItemsPerPage);
|
|
57
58
|
const newMaxPage = Math.ceil(numTotalItems / newItemsPerPage);
|
|
58
59
|
// If this makes the current page out of range, set the current page to the last page
|
|
@@ -62,24 +63,10 @@ const Pagination = ({ currentPage: controlledCurrentPage, onCurrentPageChange, n
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
};
|
|
65
|
-
return (jsxs(Flex, { align: "center", justify: "space-between", w: "100%", ...rest, children: [jsx(Flex, { align: "center", gap: 2, children: itemsPerPageOptions && (jsxs(Flex, { align: "center", gap: 2, children: [jsx(
|
|
66
|
-
control: (base, _state) => ({
|
|
67
|
-
...base,
|
|
68
|
-
fontSize: '0.875rem',
|
|
69
|
-
padding: 0,
|
|
70
|
-
minHeight: '28px',
|
|
71
|
-
}),
|
|
72
|
-
dropdownIndicator: (base, _props) => ({
|
|
73
|
-
...base,
|
|
74
|
-
padding: '0 4px',
|
|
75
|
-
}),
|
|
76
|
-
}, options: itemsPerPageOptions.map((option) => ({
|
|
66
|
+
return (jsxs(Flex, { align: "center", justify: "space-between", w: "100%", ...rest, children: [jsx(Flex, { align: "center", gap: 2, children: itemsPerPageOptions && (jsxs(Flex, { align: "center", gap: 2, children: [jsx(SelectField, { size: "sm", width: "5.5rem", options: itemsPerPageOptions.map((option) => ({
|
|
77
67
|
label: option.toString(),
|
|
78
68
|
value: option,
|
|
79
|
-
})), value: {
|
|
80
|
-
label: itemsPerPage.toString(),
|
|
81
|
-
value: itemsPerPage,
|
|
82
|
-
}, onChange: handleItemsPerPageOptionChange }), jsx(Subtext, { whiteSpace: "nowrap", children: translate('pagination_items_per_page') })] })) }), jsxs(Flex, { align: "center", gap: 2, children: [jsxs(Subtitle, { children: [currentPage, " / ", maxPage] }), maxPage > 1 && (jsxs(Flex, { align: "center", children: [jsx(IconButton, { colorPalette: "neutral", variant: "ghost", "aria-label": translate('previous'), onClick: handleBack, disabled: currentPage <= 1, color: currentPage === 1 ? 'gray.400' : 'gray.1000', children: jsx(IoIosArrowBack, { boxSize: "sm" }) }), jsx(IconButton, { colorPalette: "neutral", variant: "ghost", "aria-label": translate('go_next_page_button'), onClick: handleNext, disabled: currentPage >= maxPage, color: currentPage === maxPage ? 'gray.400' : 'gray.1000', children: jsx(IoChevronForward, { boxSize: "sm" }) })] }))] })] }));
|
|
69
|
+
})), value: itemsPerPage, onChange: handleItemsPerPageOptionChange }), jsx(Subtext, { whiteSpace: "nowrap", children: translate('pagination_items_per_page') })] })) }), jsxs(Flex, { align: "center", gap: 2, children: [jsxs(Subtitle, { children: [currentPage, " / ", maxPage] }), maxPage > 1 && (jsxs(Flex, { align: "center", children: [jsx(IconButton, { colorPalette: "neutral", variant: "ghost", "aria-label": translate('previous'), onClick: handleBack, disabled: currentPage <= 1, color: currentPage === 1 ? 'gray.400' : 'gray.1000', children: jsx(IoIosArrowBack, { boxSize: "sm" }) }), jsx(IconButton, { colorPalette: "neutral", variant: "ghost", "aria-label": translate('go_next_page_button'), onClick: handleNext, disabled: currentPage >= maxPage, color: currentPage === maxPage ? 'gray.400' : 'gray.1000', children: jsx(IoChevronForward, { boxSize: "sm" }) })] }))] })] }));
|
|
83
70
|
};
|
|
84
71
|
|
|
85
72
|
export { Pagination };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.mjs","sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pagination.mjs","sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAWA;;;;;;;;;;;;;AAaG;AACI,MAAM,UAAU,GAAG,CAAC,EACzB,WAAW,EAAE,qBAA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SAAS,CAAC,UAAU,CAAW,EAC3C,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,WAAW,IAAI,CAAC,EAC1B,KAAK,EAAE,WAAW,KAAK,CAAC,GAAG,UAAU,GAAG,WAAW,YAEnDA,GAAA,CAAC,cAAc,EAAA,EAAC,OAAO,EAAC,IAAI,EAAA,CAAG,EAAA,CACpB,EACbA,IAAC,UAAU,EAAA,EACT,YAAY,EAAC,SAAS,EACtB,OAAO,EAAC,OAAO,EAAA,YAAA,EACH,SAAS,CAAC,qBAAqB,CAAW,EACtD,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,WAAW,IAAI,OAAO,EAChC,KAAK,EAAE,WAAW,KAAK,OAAO,GAAG,UAAU,GAAG,WAAW,EAAA,QAAA,EAEzDA,GAAA,CAAC,gBAAgB,EAAA,EAAC,OAAO,EAAC,IAAI,GAAG,EAAA,CACtB,CAAA,EAAA,CACR,CACR,CAAA,EAAA,CACI,CAAA,EAAA,CACF;AAEX;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Combobox as ChakraCombobox } from '@chakra-ui/react';
|
|
2
|
+
/**
|
|
3
|
+
* Compound Combobox primitives — Chakra's `Combobox` namespace with the
|
|
4
|
+
* Logician design-system styling baked into the visual parts (`Input`,
|
|
5
|
+
* `Content`, `Item`). Use these directly for full compositional control;
|
|
6
|
+
* use `ComboboxField` for the common single-select case.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Combobox: {
|
|
9
|
+
Root: ChakraCombobox.RootComponent;
|
|
10
|
+
PropsProvider: import("react").Provider<import("node_modules/@chakra-ui/react/dist/types/components/combobox/combobox").ComboboxRootBaseProps<any>>;
|
|
11
|
+
Context: <T extends unknown>(props: import("@ark-ui/react").ComboboxContextProps<T>) => import("react").ReactNode;
|
|
12
|
+
Label: import("react").ForwardRefExoticComponent<ChakraCombobox.LabelProps & import("react").RefAttributes<HTMLLabelElement>>;
|
|
13
|
+
Control: import("react").ForwardRefExoticComponent<ChakraCombobox.ControlProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Input: import("react").ForwardRefExoticComponent<ChakraCombobox.InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
15
|
+
Trigger: import("react").ForwardRefExoticComponent<ChakraCombobox.TriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
IndicatorGroup: import("react").ForwardRefExoticComponent<ChakraCombobox.IndicatorGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
+
ClearTrigger: import("react").ForwardRefExoticComponent<ChakraCombobox.ClearTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
Positioner: import("react").ForwardRefExoticComponent<import("@chakra-ui/react").ComboboxPositionerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
Content: import("react").ForwardRefExoticComponent<ChakraCombobox.ContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
+
Empty: import("react").ForwardRefExoticComponent<ChakraCombobox.EmptyProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
|
+
ItemGroup: import("react").ForwardRefExoticComponent<ChakraCombobox.ItemGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
ItemGroupLabel: import("react").ForwardRefExoticComponent<import("@chakra-ui/react").ComboboxItemGroupLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
|
+
Item: import("react").ForwardRefExoticComponent<ChakraCombobox.ItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
|
+
ItemText: import("react").ForwardRefExoticComponent<import("@chakra-ui/react").ComboboxItemTextProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
|
+
ItemIndicator: import("react").ForwardRefExoticComponent<ChakraCombobox.IndicatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
|
+
ItemContext: (props: import("@ark-ui/react").ComboboxItemContextProps) => import("react").ReactNode;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=Combobox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Combobox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA0C9D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;CAmBpB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var react = require('@chakra-ui/react');
|
|
7
|
+
var mergeCss = require('../../utils/mergeCss.js');
|
|
8
|
+
var Select_styles = require('./Select.styles.js');
|
|
9
|
+
|
|
10
|
+
const Input = React.forwardRef(function ComboboxInput({ css, ...props }, ref) {
|
|
11
|
+
return (jsxRuntime.jsx(react.Combobox.Input, { ref: ref, ...props, css: mergeCss.mergeCss(Select_styles.inputStyles, css) }));
|
|
12
|
+
});
|
|
13
|
+
const Content = React.forwardRef(function ComboboxContent({ css, ...props }, ref) {
|
|
14
|
+
return (jsxRuntime.jsx(react.Combobox.Content, { ref: ref, ...props, css: mergeCss.mergeCss(Select_styles.contentStyles, css) }));
|
|
15
|
+
});
|
|
16
|
+
const Item = React.forwardRef(function ComboboxItem({ css, ...props }, ref) {
|
|
17
|
+
return (jsxRuntime.jsx(react.Combobox.Item, { ref: ref, ...props, css: mergeCss.mergeCss(Select_styles.itemStyles, css) }));
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Compound Combobox primitives — Chakra's `Combobox` namespace with the
|
|
21
|
+
* Logician design-system styling baked into the visual parts (`Input`,
|
|
22
|
+
* `Content`, `Item`). Use these directly for full compositional control;
|
|
23
|
+
* use `ComboboxField` for the common single-select case.
|
|
24
|
+
*/
|
|
25
|
+
const Combobox = {
|
|
26
|
+
Root: react.Combobox.Root,
|
|
27
|
+
PropsProvider: react.Combobox.PropsProvider,
|
|
28
|
+
Context: react.Combobox.Context,
|
|
29
|
+
Label: react.Combobox.Label,
|
|
30
|
+
Control: react.Combobox.Control,
|
|
31
|
+
Input,
|
|
32
|
+
Trigger: react.Combobox.Trigger,
|
|
33
|
+
IndicatorGroup: react.Combobox.IndicatorGroup,
|
|
34
|
+
ClearTrigger: react.Combobox.ClearTrigger,
|
|
35
|
+
Positioner: react.Combobox.Positioner,
|
|
36
|
+
Content,
|
|
37
|
+
Empty: react.Combobox.Empty,
|
|
38
|
+
ItemGroup: react.Combobox.ItemGroup,
|
|
39
|
+
ItemGroupLabel: react.Combobox.ItemGroupLabel,
|
|
40
|
+
Item,
|
|
41
|
+
ItemText: react.Combobox.ItemText,
|
|
42
|
+
ItemIndicator: react.Combobox.ItemIndicator,
|
|
43
|
+
ItemContext: react.Combobox.ItemContext,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.Combobox = Combobox;
|
|
47
|
+
//# sourceMappingURL=Combobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Combobox.js","sources":["../../../src/components/Select/Combobox.tsx"],"sourcesContent":[null],"names":["forwardRef","_jsx","ChakraCombobox","mergeCss","inputStyles","contentStyles","itemStyles"],"mappings":";;;;;;;;;AAOA,MAAM,KAAK,GAAGA,gBAAU,CACtB,SAAS,aAAa,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAA;IAC3C,QACEC,eAACC,cAAc,CAAC,KAAK,EAAA,EACnB,GAAG,EAAE,GAAG,EAAA,GACJ,KAAK,EACT,GAAG,EAAEC,iBAAQ,CAACC,yBAAW,EAAE,GAAG,CAAC,EAAA,CAC/B;AAEN,CAAC,CACF;AAED,MAAM,OAAO,GAAGJ,gBAAU,CACxB,SAAS,eAAe,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAA;IAC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combobox as Combobox$1 } from '@chakra-ui/react';
|
|
5
|
+
import { mergeCss } from '../../utils/mergeCss.mjs';
|
|
6
|
+
import { inputStyles, contentStyles, itemStyles } from './Select.styles.mjs';
|
|
7
|
+
|
|
8
|
+
const Input = forwardRef(function ComboboxInput({ css, ...props }, ref) {
|
|
9
|
+
return (jsx(Combobox$1.Input, { ref: ref, ...props, css: mergeCss(inputStyles, css) }));
|
|
10
|
+
});
|
|
11
|
+
const Content = forwardRef(function ComboboxContent({ css, ...props }, ref) {
|
|
12
|
+
return (jsx(Combobox$1.Content, { ref: ref, ...props, css: mergeCss(contentStyles, css) }));
|
|
13
|
+
});
|
|
14
|
+
const Item = forwardRef(function ComboboxItem({ css, ...props }, ref) {
|
|
15
|
+
return (jsx(Combobox$1.Item, { ref: ref, ...props, css: mergeCss(itemStyles, css) }));
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Compound Combobox primitives — Chakra's `Combobox` namespace with the
|
|
19
|
+
* Logician design-system styling baked into the visual parts (`Input`,
|
|
20
|
+
* `Content`, `Item`). Use these directly for full compositional control;
|
|
21
|
+
* use `ComboboxField` for the common single-select case.
|
|
22
|
+
*/
|
|
23
|
+
const Combobox = {
|
|
24
|
+
Root: Combobox$1.Root,
|
|
25
|
+
PropsProvider: Combobox$1.PropsProvider,
|
|
26
|
+
Context: Combobox$1.Context,
|
|
27
|
+
Label: Combobox$1.Label,
|
|
28
|
+
Control: Combobox$1.Control,
|
|
29
|
+
Input,
|
|
30
|
+
Trigger: Combobox$1.Trigger,
|
|
31
|
+
IndicatorGroup: Combobox$1.IndicatorGroup,
|
|
32
|
+
ClearTrigger: Combobox$1.ClearTrigger,
|
|
33
|
+
Positioner: Combobox$1.Positioner,
|
|
34
|
+
Content,
|
|
35
|
+
Empty: Combobox$1.Empty,
|
|
36
|
+
ItemGroup: Combobox$1.ItemGroup,
|
|
37
|
+
ItemGroupLabel: Combobox$1.ItemGroupLabel,
|
|
38
|
+
Item,
|
|
39
|
+
ItemText: Combobox$1.ItemText,
|
|
40
|
+
ItemIndicator: Combobox$1.ItemIndicator,
|
|
41
|
+
ItemContext: Combobox$1.ItemContext,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export { Combobox };
|
|
45
|
+
//# sourceMappingURL=Combobox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Combobox.mjs","sources":["../../../src/components/Select/Combobox.tsx"],"sourcesContent":[null],"names":["_jsx","ChakraCombobox"],"mappings":";;;;;;;AAOA,MAAM,KAAK,GAAG,UAAU,CACtB,SAAS,aAAa,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAA;IAC3C,QACEA,IAACC,UAAc,CAAC,KAAK,EAAA,EACnB,GAAG,EAAE,GAAG,EAAA,GACJ,KAAK,EACT,GAAG,EAAE,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,EAAA,CAC/B;AAEN,CAAC,CACF;AAED,MAAM,OAAO,GAAG,UAAU,CACxB,SAAS,eAAe,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAA;IAC7C,QACED,IAACC,UAAc,CAAC,OAAO,EAAA,EACrB,GAAG,EAAE,GAAG,EAAA,GACJ,KAAK,EACT,GAAG,EAAE,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAC,EAAA,CACjC;AAEN,CAAC,CACF;AAED,MAAM,IAAI,GAAG,UAAU,CACrB,SAAS,YAAY,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAA;IAC1C,QACED,IAACC,UAAc,CAAC,IAAI,EAAA,EAClB,GAAG,EAAE,GAAG,EAAA,GACJ,KAAK,EACT,GAAG,EAAE,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,EAAA,CAC9B;AAEN,CAAC,CACF;AAED;;;;;AAKG;AACI,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAEA,UAAc,CAAC,IAAI;IACzB,aAAa,EAAEA,UAAc,CAAC,aAAa;IAC3C,OAAO,EAAEA,UAAc,CAAC,OAAO;IAC/B,KAAK,EAAEA,UAAc,CAAC,KAAK;IAC3B,OAAO,EAAEA,UAAc,CAAC,OAAO;IAC/B,KAAK;IACL,OAAO,EAAEA,UAAc,CAAC,OAAO;IAC/B,cAAc,EAAEA,UAAc,CAAC,cAAc;IAC7C,YAAY,EAAEA,UAAc,CAAC,YAAY;IACzC,UAAU,EAAEA,UAAc,CAAC,UAAU;IACrC,OAAO;IACP,KAAK,EAAEA,UAAc,CAAC,KAAK;IAC3B,SAAS,EAAEA,UAAc,CAAC,SAAS;IACnC,cAAc,EAAEA,UAAc,CAAC,cAAc;IAC7C,IAAI;IACJ,QAAQ,EAAEA,UAAc,CAAC,QAAQ;IACjC,aAAa,EAAEA,UAAc,CAAC,aAAa;IAC3C,WAAW,EAAEA,UAAc,CAAC,WAAW;;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComboboxFieldProps } from './Select.types';
|
|
2
|
+
/**
|
|
3
|
+
* Single-select combobox — a Select with a typeable, filterable input.
|
|
4
|
+
* The ergonomic counterpart to `Input` for searchable option lists; pass
|
|
5
|
+
* `options`, `value` and `onChange` and it renders the full composition
|
|
6
|
+
* internally.
|
|
7
|
+
*
|
|
8
|
+
* For grouped options or custom layouts, compose the `Combobox` primitives
|
|
9
|
+
* directly.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ComboboxField<T = string>({ options, value, defaultValue, onChange, placeholder, label, size, invalid, disabled, readOnly, required, name, width, emptyText, }: ComboboxFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=ComboboxField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxField.d.ts","sourceRoot":"","sources":["../../../src/components/Select/ComboboxField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAgB,MAAM,gBAAgB,CAAC;AAElE;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,CAAC,GAAG,MAAM,EAAE,EACxC,OAAO,EACP,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,IAAW,EACX,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,KAAc,EACd,SAA8B,GAC/B,EAAE,kBAAkB,CAAC,CAAC,CAAC,2CAwDvB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var react = require('@chakra-ui/react');
|
|
6
|
+
var Combobox = require('./Combobox.js');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Single-select combobox — a Select with a typeable, filterable input.
|
|
10
|
+
* The ergonomic counterpart to `Input` for searchable option lists; pass
|
|
11
|
+
* `options`, `value` and `onChange` and it renders the full composition
|
|
12
|
+
* internally.
|
|
13
|
+
*
|
|
14
|
+
* For grouped options or custom layouts, compose the `Combobox` primitives
|
|
15
|
+
* directly.
|
|
16
|
+
*/
|
|
17
|
+
function ComboboxField({ options, value, defaultValue, onChange, placeholder, label, size = 'md', invalid, disabled, readOnly, required, name, width = 'full', emptyText = 'No results found', }) {
|
|
18
|
+
const { contains } = react.useFilter({ sensitivity: 'base' });
|
|
19
|
+
const { collection, filter } = react.useListCollection({
|
|
20
|
+
initialItems: options,
|
|
21
|
+
filter: contains,
|
|
22
|
+
itemToValue: (item) => String(item.value),
|
|
23
|
+
itemToString: (item) => item.label,
|
|
24
|
+
isItemDisabled: (item) => Boolean(item.disabled),
|
|
25
|
+
});
|
|
26
|
+
const toKeys = (val) => val === null || val === undefined ? [] : [String(val)];
|
|
27
|
+
return (jsxRuntime.jsxs(Combobox.Combobox.Root, { collection: collection, size: size, width: width, invalid: invalid, disabled: disabled, readOnly: readOnly, required: required, name: name, value: value === undefined ? undefined : toKeys(value), defaultValue: defaultValue === undefined ? undefined : toKeys(defaultValue), onValueChange: (details) => {
|
|
28
|
+
const selected = details.items[0];
|
|
29
|
+
onChange?.(selected ? selected.value : null);
|
|
30
|
+
}, onInputValueChange: (details) => filter(details.inputValue), children: [label != null && jsxRuntime.jsx(Combobox.Combobox.Label, { children: label }), jsxRuntime.jsxs(Combobox.Combobox.Control, { children: [jsxRuntime.jsx(Combobox.Combobox.Input, { placeholder: placeholder }), jsxRuntime.jsxs(Combobox.Combobox.IndicatorGroup, { children: [jsxRuntime.jsx(Combobox.Combobox.ClearTrigger, {}), jsxRuntime.jsx(Combobox.Combobox.Trigger, {})] })] }), jsxRuntime.jsx(react.Portal, { children: jsxRuntime.jsx(Combobox.Combobox.Positioner, { children: jsxRuntime.jsxs(Combobox.Combobox.Content, { children: [jsxRuntime.jsx(Combobox.Combobox.Empty, { children: emptyText }), collection.items.map((item) => (jsxRuntime.jsxs(Combobox.Combobox.Item, { item: item, children: [jsxRuntime.jsx(Combobox.Combobox.ItemText, { children: item.label }), jsxRuntime.jsx(Combobox.Combobox.ItemIndicator, {})] }, String(item.value))))] }) }) })] }));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
exports.ComboboxField = ComboboxField;
|
|
34
|
+
//# sourceMappingURL=ComboboxField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxField.js","sources":["../../../src/components/Select/ComboboxField.tsx"],"sourcesContent":[null],"names":["useFilter","useListCollection","_jsxs","Combobox","_jsx","Portal"],"mappings":";;;;;;;AAKA;;;;;;;;AAQG;SACa,aAAa,CAAa,EACxC,OAAO,EACP,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,IAAI,GAAG,IAAI,EACX,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,KAAK,GAAG,MAAM,EACd,SAAS,GAAG,kBAAkB,GACR,EAAA;AACtB,IAAA,M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useFilter, useListCollection, Portal } from '@chakra-ui/react';
|
|
4
|
+
import { Combobox } from './Combobox.mjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Single-select combobox — a Select with a typeable, filterable input.
|
|
8
|
+
* The ergonomic counterpart to `Input` for searchable option lists; pass
|
|
9
|
+
* `options`, `value` and `onChange` and it renders the full composition
|
|
10
|
+
* internally.
|
|
11
|
+
*
|
|
12
|
+
* For grouped options or custom layouts, compose the `Combobox` primitives
|
|
13
|
+
* directly.
|
|
14
|
+
*/
|
|
15
|
+
function ComboboxField({ options, value, defaultValue, onChange, placeholder, label, size = 'md', invalid, disabled, readOnly, required, name, width = 'full', emptyText = 'No results found', }) {
|
|
16
|
+
const { contains } = useFilter({ sensitivity: 'base' });
|
|
17
|
+
const { collection, filter } = useListCollection({
|
|
18
|
+
initialItems: options,
|
|
19
|
+
filter: contains,
|
|
20
|
+
itemToValue: (item) => String(item.value),
|
|
21
|
+
itemToString: (item) => item.label,
|
|
22
|
+
isItemDisabled: (item) => Boolean(item.disabled),
|
|
23
|
+
});
|
|
24
|
+
const toKeys = (val) => val === null || val === undefined ? [] : [String(val)];
|
|
25
|
+
return (jsxs(Combobox.Root, { collection: collection, size: size, width: width, invalid: invalid, disabled: disabled, readOnly: readOnly, required: required, name: name, value: value === undefined ? undefined : toKeys(value), defaultValue: defaultValue === undefined ? undefined : toKeys(defaultValue), onValueChange: (details) => {
|
|
26
|
+
const selected = details.items[0];
|
|
27
|
+
onChange?.(selected ? selected.value : null);
|
|
28
|
+
}, onInputValueChange: (details) => filter(details.inputValue), children: [label != null && jsx(Combobox.Label, { children: label }), jsxs(Combobox.Control, { children: [jsx(Combobox.Input, { placeholder: placeholder }), jsxs(Combobox.IndicatorGroup, { children: [jsx(Combobox.ClearTrigger, {}), jsx(Combobox.Trigger, {})] })] }), jsx(Portal, { children: jsx(Combobox.Positioner, { children: jsxs(Combobox.Content, { children: [jsx(Combobox.Empty, { children: emptyText }), collection.items.map((item) => (jsxs(Combobox.Item, { item: item, children: [jsx(Combobox.ItemText, { children: item.label }), jsx(Combobox.ItemIndicator, {})] }, String(item.value))))] }) }) })] }));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { ComboboxField };
|
|
32
|
+
//# sourceMappingURL=ComboboxField.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboboxField.mjs","sources":["../../../src/components/Select/ComboboxField.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;AAKA;;;;;;;;AAQG;SACa,aAAa,CAAa,EACxC,OAAO,EACP,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,IAAI,GAAG,IAAI,EACX,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,KAAK,GAAG,MAAM,EACd,SAAS,GAAG,kBAAkB,GACR,EAAA;AACtB,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AACvD,IAAA,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,iBAAiB,CAAkB;AAChE,QAAA,YAAY,EAAE,OAAO;AACrB,QAAA,MAAM,EAAE,QAAQ;QAChB,WAAW,EAAE,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;QACzC,YAAY,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK;QAClC,cAAc,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;AACjD,KAAA,CAAC;IAEF,MAAM,MAAM,GAAG,CAAC,GAAyB,KACvC,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAExD,IAAA,QACEA,IAAA,CAAC,QAAQ,CAAC,IAAI,IACZ,UAAU,EAAE,UAAU,EACtB,IA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A,QAAA,EAAE,SAAS,GAAkB,EAC3C,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,MACzBD,IAAA,CAAC,QAAQ,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,IAAI,EAAA,QAAA,EAAA,CACvBC,GAAA,CAAC,QAAQ,CAAC,QAAQ,EAAA,EAAA,QAAA,EAAE,IAAI,CAAC,KAAK,EAAA,CAAqB,EACnDA,GAAA,CAAC,QAAQ,CAAC,aAAa,EAAA,EAAA,CAAG,CAAA,EAAA,EAFI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAGlC,CACjB,CAAC,CAAA,EAAA,CACe,EAAA,CACC,EAAA,CACf,CAAA,EAAA,CACK;AAEpB;;;;"}
|
|
@@ -1,4 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Select as ChakraSelect } from '@chakra-ui/react';
|
|
2
|
+
/**
|
|
3
|
+
* Compound Select primitives — Chakra's `Select` namespace with the Logician
|
|
4
|
+
* design-system styling baked into the visual parts (`Trigger`, `Content`,
|
|
5
|
+
* `Item`, `Indicator`). Use these directly for full compositional control
|
|
6
|
+
* (multi-select, grouped options, custom layouts); use `SelectField` for the
|
|
7
|
+
* common single-select case.
|
|
8
|
+
*/
|
|
9
|
+
export declare const Select: {
|
|
10
|
+
Root: ChakraSelect.RootComponent;
|
|
11
|
+
PropsProvider: import("react").Provider<import("node_modules/@chakra-ui/react/dist/types/components/select/select").SelectRootBaseProps<any>>;
|
|
12
|
+
Context: <T extends unknown>(props: import("@ark-ui/react").SelectContextProps<T>) => import("react").ReactNode;
|
|
13
|
+
Label: import("react").ForwardRefExoticComponent<ChakraSelect.LabelProps & import("react").RefAttributes<HTMLLabelElement>>;
|
|
14
|
+
Control: import("react").ForwardRefExoticComponent<ChakraSelect.ControlProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
+
Trigger: import("react").ForwardRefExoticComponent<ChakraSelect.TriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
ValueText: import("react").ForwardRefExoticComponent<ChakraSelect.ValueTextProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
17
|
+
IndicatorGroup: import("react").ForwardRefExoticComponent<ChakraSelect.IndicatorGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
Indicator: import("react").ForwardRefExoticComponent<ChakraSelect.IndicatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
ClearTrigger: import("react").ForwardRefExoticComponent<ChakraSelect.ClearTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
HiddenSelect: import("react").ForwardRefExoticComponent<import("@ark-ui/react").SelectHiddenSelectProps & import("react").RefAttributes<HTMLSelectElement>>;
|
|
21
|
+
Positioner: import("react").ForwardRefExoticComponent<ChakraSelect.PositionerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
Content: import("react").ForwardRefExoticComponent<ChakraSelect.ContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
|
+
ItemGroup: import("react").ForwardRefExoticComponent<ChakraSelect.ItemGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
|
+
ItemGroupLabel: import("react").ForwardRefExoticComponent<ChakraSelect.ItemGroupLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
|
+
Item: import("react").ForwardRefExoticComponent<ChakraSelect.ItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
|
+
ItemText: import("react").ForwardRefExoticComponent<ChakraSelect.ItemTextProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
|
+
ItemIndicator: import("react").ForwardRefExoticComponent<ChakraSelect.ItemIndicatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
+
ItemContext: (props: import("@ark-ui/react").SelectItemContextProps) => import("react").ReactNode;
|
|
29
|
+
};
|
|
4
30
|
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAuD1D;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;CAoBlB,CAAC"}
|