@stokelp/ui 2.103.0 → 2.104.1
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/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/_virtual/_rolldown/runtime.js +21 -0
- package/dist/components/accordion/Accordion.cjs +2 -2
- package/dist/components/accordion/Accordion.cjs.map +1 -1
- package/dist/components/accordion/Accordion.js +22 -27
- package/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/action-card/ActionCard.cjs +2 -2
- package/dist/components/action-card/ActionCard.cjs.map +1 -1
- package/dist/components/action-card/ActionCard.js +23 -26
- package/dist/components/action-card/ActionCard.js.map +1 -1
- package/dist/components/alert/Alert.cjs +2 -2
- package/dist/components/alert/Alert.cjs.map +1 -1
- package/dist/components/alert/Alert.js +117 -84
- package/dist/components/alert/Alert.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardEntityRow.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardEntityRow.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardEntityRow.js +44 -25
- package/dist/components/app/mobile-card/MobileCardEntityRow.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardHeader.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardHeader.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardHeader.js +18 -20
- package/dist/components/app/mobile-card/MobileCardHeader.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.js +31 -13
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardShell.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardShell.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardShell.js +17 -19
- package/dist/components/app/mobile-card/MobileCardShell.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardSkeleton.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardSkeleton.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardSkeleton.js +45 -22
- package/dist/components/app/mobile-card/MobileCardSkeleton.js.map +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.cjs +2 -2
- package/dist/components/app/mobile-navigation/MobileNavigation.cjs.map +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.d.ts +4 -5
- package/dist/components/app/mobile-navigation/MobileNavigation.js +16 -18
- package/dist/components/app/mobile-navigation/MobileNavigation.js.map +1 -1
- package/dist/components/app/navigation/AppNavigation.cjs +2 -2
- package/dist/components/app/navigation/AppNavigation.cjs.map +1 -1
- package/dist/components/app/navigation/AppNavigation.d.ts +11 -11
- package/dist/components/app/navigation/AppNavigation.js +35 -47
- package/dist/components/app/navigation/AppNavigation.js.map +1 -1
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs +2 -2
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs.map +1 -1
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js +188 -119
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js.map +1 -1
- package/dist/components/app/price-tag/PriceTag.cjs +2 -2
- package/dist/components/app/price-tag/PriceTag.cjs.map +1 -1
- package/dist/components/app/price-tag/PriceTag.js +25 -19
- package/dist/components/app/price-tag/PriceTag.js.map +1 -1
- package/dist/components/app/product-card-catalog/styled.cjs +2 -2
- package/dist/components/app/product-card-catalog/styled.cjs.map +1 -1
- package/dist/components/app/product-card-catalog/styled.js +23 -21
- package/dist/components/app/product-card-catalog/styled.js.map +1 -1
- package/dist/components/avatar/styled.cjs +2 -2
- package/dist/components/avatar/styled.cjs.map +1 -1
- package/dist/components/avatar/styled.d.ts +11 -7
- package/dist/components/avatar/styled.js +28 -27
- package/dist/components/avatar/styled.js.map +1 -1
- package/dist/components/box/Box.cjs +2 -2
- package/dist/components/box/Box.cjs.map +1 -1
- package/dist/components/box/Box.js +11 -10
- package/dist/components/box/Box.js.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.cjs +2 -2
- package/dist/components/breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.d.ts +6 -8
- package/dist/components/breadcrumb/Breadcrumb.js +39 -35
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/button/Button.cjs +2 -2
- package/dist/components/button/Button.cjs.map +1 -1
- package/dist/components/button/Button.d.ts +8 -4
- package/dist/components/button/Button.js +9 -8
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button-filter/ButtonFilter.cjs +2 -2
- package/dist/components/button-filter/ButtonFilter.cjs.map +1 -1
- package/dist/components/button-filter/ButtonFilter.d.ts +5 -4
- package/dist/components/button-filter/ButtonFilter.js +9 -8
- package/dist/components/button-filter/ButtonFilter.js.map +1 -1
- package/dist/components/chat/Chat.cjs +2 -2
- package/dist/components/chat/Chat.cjs.map +1 -1
- package/dist/components/chat/Chat.d.ts +15 -8
- package/dist/components/chat/Chat.js +27 -26
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/ChatDocumentMessage.cjs +2 -2
- package/dist/components/chat/ChatDocumentMessage.cjs.map +1 -1
- package/dist/components/chat/ChatDocumentMessage.js +32 -31
- package/dist/components/chat/ChatDocumentMessage.js.map +1 -1
- package/dist/components/chat/ChatMessage.cjs +2 -2
- package/dist/components/chat/ChatMessage.cjs.map +1 -1
- package/dist/components/chat/ChatMessage.d.ts +7 -4
- package/dist/components/chat/ChatMessage.js +8 -7
- package/dist/components/chat/ChatMessage.js.map +1 -1
- package/dist/components/chat/ChatProfileAvatar.cjs +2 -2
- package/dist/components/chat/ChatProfileAvatar.cjs.map +1 -1
- package/dist/components/chat/ChatProfileAvatar.js +24 -16
- package/dist/components/chat/ChatProfileAvatar.js.map +1 -1
- package/dist/components/chat/ChatTextInput.cjs +2 -2
- package/dist/components/chat/ChatTextInput.cjs.map +1 -1
- package/dist/components/chat/ChatTextInput.d.ts +2 -2
- package/dist/components/chat/ChatTextInput.js +44 -52
- package/dist/components/chat/ChatTextInput.js.map +1 -1
- package/dist/components/checkbox/Checkbox.cjs +2 -2
- package/dist/components/checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/checkbox/Checkbox.js +36 -34
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/checkbox-card/CheckboxCard.cjs +2 -2
- package/dist/components/checkbox-card/CheckboxCard.cjs.map +1 -1
- package/dist/components/checkbox-card/CheckboxCard.d.ts +2 -2
- package/dist/components/checkbox-card/CheckboxCard.js +33 -38
- package/dist/components/checkbox-card/CheckboxCard.js.map +1 -1
- package/dist/components/checkbox-card/namespace.cjs +2 -2
- package/dist/components/checkbox-card/namespace.cjs.map +1 -1
- package/dist/components/checkbox-card/namespace.js +14 -9
- package/dist/components/checkbox-card/namespace.js.map +1 -1
- package/dist/components/chip/Chip.cjs +2 -2
- package/dist/components/chip/Chip.cjs.map +1 -1
- package/dist/components/chip/Chip.d.ts +1 -1
- package/dist/components/chip/Chip.js +23 -23
- package/dist/components/chip/Chip.js.map +1 -1
- package/dist/components/collapsible/styled.cjs +2 -2
- package/dist/components/collapsible/styled.cjs.map +1 -1
- package/dist/components/collapsible/styled.js +15 -11
- package/dist/components/collapsible/styled.js.map +1 -1
- package/dist/components/combobox/Combobox.cjs +2 -2
- package/dist/components/combobox/Combobox.cjs.map +1 -1
- package/dist/components/combobox/Combobox.js +206 -173
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/date-picker/DatePicker.cjs +2 -2
- package/dist/components/date-picker/DatePicker.cjs.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +2 -2
- package/dist/components/date-picker/DatePicker.js +151 -127
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/dialog/styled.cjs +2 -2
- package/dist/components/dialog/styled.cjs.map +1 -1
- package/dist/components/dialog/styled.js +75 -65
- package/dist/components/dialog/styled.js.map +1 -1
- package/dist/components/drawer/Drawer.cjs +2 -2
- package/dist/components/drawer/Drawer.cjs.map +1 -1
- package/dist/components/drawer/Drawer.js +69 -63
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/flag/styled.cjs +2 -2
- package/dist/components/flag/styled.cjs.map +1 -1
- package/dist/components/flag/styled.d.ts +9 -7
- package/dist/components/flag/styled.js +8437 -3751
- package/dist/components/flag/styled.js.map +1 -1
- package/dist/components/form/FormControl.cjs +2 -2
- package/dist/components/form/FormControl.cjs.map +1 -1
- package/dist/components/form/FormControl.d.ts +3 -3
- package/dist/components/form/FormControl.js +13 -18
- package/dist/components/form/FormControl.js.map +1 -1
- package/dist/components/form/FormHelperText.cjs +2 -2
- package/dist/components/form/FormHelperText.cjs.map +1 -1
- package/dist/components/form/FormHelperText.d.ts +1 -1
- package/dist/components/form/FormHelperText.js +8 -9
- package/dist/components/form/FormHelperText.js.map +1 -1
- package/dist/components/form/FormLabel.cjs +2 -2
- package/dist/components/form/FormLabel.cjs.map +1 -1
- package/dist/components/form/FormLabel.d.ts +3 -3
- package/dist/components/form/FormLabel.js +38 -33
- package/dist/components/form/FormLabel.js.map +1 -1
- package/dist/components/heading/Heading.cjs +2 -2
- package/dist/components/heading/Heading.cjs.map +1 -1
- package/dist/components/heading/Heading.js +14 -10
- package/dist/components/heading/Heading.js.map +1 -1
- package/dist/components/icon/Icon.cjs +2 -2
- package/dist/components/icon/Icon.cjs.map +1 -1
- package/dist/components/icon/Icon.d.ts +2 -2
- package/dist/components/icon/Icon.js +15 -10
- package/dist/components/icon/Icon.js.map +1 -1
- package/dist/components/icon-button/IconButton.cjs +2 -2
- package/dist/components/icon-button/IconButton.cjs.map +1 -1
- package/dist/components/icon-button/IconButton.d.ts +2 -3
- package/dist/components/icon-button/IconButton.js +8 -7
- package/dist/components/icon-button/IconButton.js.map +1 -1
- package/dist/components/illustration/Illustration.cjs +2 -2
- package/dist/components/illustration/Illustration.cjs.map +1 -1
- package/dist/components/illustration/Illustration.js +35 -39
- package/dist/components/illustration/Illustration.js.map +1 -1
- package/dist/components/illustration/patterns.cjs +2 -2
- package/dist/components/illustration/patterns.cjs.map +1 -1
- package/dist/components/illustration/patterns.js +5563 -8897
- package/dist/components/illustration/patterns.js.map +1 -1
- package/dist/components/input/HighlightedInput.cjs +2 -2
- package/dist/components/input/HighlightedInput.cjs.map +1 -1
- package/dist/components/input/HighlightedInput.d.ts +13 -16
- package/dist/components/input/HighlightedInput.js +43 -58
- package/dist/components/input/HighlightedInput.js.map +1 -1
- package/dist/components/input/Input.cjs +2 -2
- package/dist/components/input/Input.cjs.map +1 -1
- package/dist/components/input/Input.d.ts +2 -3
- package/dist/components/input/Input.js +12 -13
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input/InputAddon.cjs +2 -2
- package/dist/components/input/InputAddon.cjs.map +1 -1
- package/dist/components/input/InputAddon.d.ts +5 -4
- package/dist/components/input/InputAddon.js +8 -9
- package/dist/components/input/InputAddon.js.map +1 -1
- package/dist/components/input/InputGroup.cjs +2 -2
- package/dist/components/input/InputGroup.cjs.map +1 -1
- package/dist/components/input/InputGroup.d.ts +1 -1
- package/dist/components/input/InputGroup.js +8 -9
- package/dist/components/input/InputGroup.js.map +1 -1
- package/dist/components/input/PhoneNumberInput.cjs +2 -2
- package/dist/components/input/PhoneNumberInput.cjs.map +1 -1
- package/dist/components/input/PhoneNumberInput.js +21 -23
- package/dist/components/input/PhoneNumberInput.js.map +1 -1
- package/dist/components/menu/Menu.cjs +2 -2
- package/dist/components/menu/Menu.cjs.map +1 -1
- package/dist/components/menu/Menu.js +32 -28
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/pagination/Pagination.cjs +2 -2
- package/dist/components/pagination/Pagination.cjs.map +1 -1
- package/dist/components/pagination/Pagination.d.ts +1 -1
- package/dist/components/pagination/Pagination.js +76 -84
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/pagination/use-pagination.cjs +2 -2
- package/dist/components/pagination/use-pagination.cjs.map +1 -1
- package/dist/components/pagination/use-pagination.js +56 -54
- package/dist/components/pagination/use-pagination.js.map +1 -1
- package/dist/components/popover/Popover.cjs +2 -2
- package/dist/components/popover/Popover.cjs.map +1 -1
- package/dist/components/popover/Popover.js +21 -25
- package/dist/components/popover/Popover.js.map +1 -1
- package/dist/components/radio-button-group/RadioButtonGroup.cjs +2 -2
- package/dist/components/radio-button-group/RadioButtonGroup.cjs.map +1 -1
- package/dist/components/radio-button-group/RadioButtonGroup.js +20 -20
- package/dist/components/radio-button-group/RadioButtonGroup.js.map +1 -1
- package/dist/components/radio-card-group/RadioCardGroup.cjs +2 -2
- package/dist/components/radio-card-group/RadioCardGroup.cjs.map +1 -1
- package/dist/components/radio-card-group/RadioCardGroup.d.ts +2 -2
- package/dist/components/radio-card-group/RadioCardGroup.js +21 -22
- package/dist/components/radio-card-group/RadioCardGroup.js.map +1 -1
- package/dist/components/radio-card-group/namespace.cjs +2 -2
- package/dist/components/radio-card-group/namespace.cjs.map +1 -1
- package/dist/components/radio-card-group/namespace.js +15 -10
- package/dist/components/radio-card-group/namespace.js.map +1 -1
- package/dist/components/radio-group/RadioGroup.cjs +2 -2
- package/dist/components/radio-group/RadioGroup.cjs.map +1 -1
- package/dist/components/radio-group/RadioGroup.js +21 -21
- package/dist/components/radio-group/RadioGroup.js.map +1 -1
- package/dist/components/select/Select.cjs +2 -2
- package/dist/components/select/Select.cjs.map +1 -1
- package/dist/components/select/Select.js +194 -141
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select-language/SelectLanguage.cjs +2 -2
- package/dist/components/select-language/SelectLanguage.cjs.map +1 -1
- package/dist/components/select-language/SelectLanguage.js +114 -88
- package/dist/components/select-language/SelectLanguage.js.map +1 -1
- package/dist/components/status-tag-select/StatusTagSelect.cjs +2 -2
- package/dist/components/status-tag-select/StatusTagSelect.cjs.map +1 -1
- package/dist/components/status-tag-select/StatusTagSelect.js +93 -115
- package/dist/components/status-tag-select/StatusTagSelect.js.map +1 -1
- package/dist/components/switch/Switch.cjs +2 -2
- package/dist/components/switch/Switch.cjs.map +1 -1
- package/dist/components/switch/Switch.js +30 -18
- package/dist/components/switch/Switch.js.map +1 -1
- package/dist/components/switch-card/SwitchCard.cjs +2 -2
- package/dist/components/switch-card/SwitchCard.cjs.map +1 -1
- package/dist/components/switch-card/SwitchCard.d.ts +2 -2
- package/dist/components/switch-card/SwitchCard.js +28 -25
- package/dist/components/switch-card/SwitchCard.js.map +1 -1
- package/dist/components/switch-card/namespace.cjs +2 -2
- package/dist/components/switch-card/namespace.cjs.map +1 -1
- package/dist/components/switch-card/namespace.js +14 -9
- package/dist/components/switch-card/namespace.js.map +1 -1
- package/dist/components/table/Table.cjs +2 -2
- package/dist/components/table/Table.cjs.map +1 -1
- package/dist/components/table/Table.d.ts +12 -13
- package/dist/components/table/Table.js +133 -109
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/TableProvider.cjs +2 -2
- package/dist/components/table/TableProvider.cjs.map +1 -1
- package/dist/components/table/TableProvider.js +36 -39
- package/dist/components/table/TableProvider.js.map +1 -1
- package/dist/components/tabs/Tabs.cjs +2 -2
- package/dist/components/tabs/Tabs.cjs.map +1 -1
- package/dist/components/tabs/Tabs.d.ts +8 -4
- package/dist/components/tabs/Tabs.js +18 -26
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tag/Tag.cjs +2 -2
- package/dist/components/tag/Tag.cjs.map +1 -1
- package/dist/components/tag/Tag.js +22 -16
- package/dist/components/tag/Tag.js.map +1 -1
- package/dist/components/text/Text.cjs +2 -2
- package/dist/components/text/Text.cjs.map +1 -1
- package/dist/components/text/Text.js +12 -11
- package/dist/components/text/Text.js.map +1 -1
- package/dist/components/textarea/Textarea.cjs +2 -2
- package/dist/components/textarea/Textarea.cjs.map +1 -1
- package/dist/components/textarea/Textarea.d.ts +6 -6
- package/dist/components/textarea/Textarea.js +9 -8
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/tooltip/Tooltip.cjs +2 -2
- package/dist/components/tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/tooltip/Tooltip.js +38 -42
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/icons/index.cjs +2 -2
- package/dist/icons/index.cjs.map +1 -1
- package/dist/icons/index.js +65 -58
- package/dist/icons/index.js.map +1 -1
- package/dist/index.cjs +1 -2
- package/dist/index.js +66 -191
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +2 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js +25 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +1 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +2 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js +25 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +1 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +2 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js +25 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +1 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +2 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js +25 -0
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +1 -0
- package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs +2 -0
- package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs.map +1 -0
- package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js +77 -0
- package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js.map +1 -0
- package/dist/preset.cjs +2 -2
- package/dist/preset.cjs.map +1 -1
- package/dist/preset.d.ts +1 -1
- package/dist/preset.js +30 -31
- package/dist/preset.js.map +1 -1
- package/dist/shared/ConditionalWrapper.cjs +2 -2
- package/dist/shared/ConditionalWrapper.cjs.map +1 -1
- package/dist/shared/ConditionalWrapper.js +6 -5
- package/dist/shared/ConditionalWrapper.js.map +1 -1
- package/dist/shared/assets/icons.cjs +2 -2
- package/dist/shared/assets/icons.cjs.map +1 -1
- package/dist/shared/assets/icons.js +30 -22
- package/dist/shared/assets/icons.js.map +1 -1
- package/dist/shared/hooks/useUncontrolled.cjs +2 -2
- package/dist/shared/hooks/useUncontrolled.cjs.map +1 -1
- package/dist/shared/hooks/useUncontrolled.js +19 -16
- package/dist/shared/hooks/useUncontrolled.js.map +1 -1
- package/dist/shared/utils/events.cjs +2 -2
- package/dist/shared/utils/events.cjs.map +1 -1
- package/dist/shared/utils/events.js +7 -6
- package/dist/shared/utils/events.js.map +1 -1
- package/dist/theme/breakpoints.cjs +2 -2
- package/dist/theme/breakpoints.cjs.map +1 -1
- package/dist/theme/breakpoints.js +10 -9
- package/dist/theme/breakpoints.js.map +1 -1
- package/dist/theme/conditions.cjs +2 -2
- package/dist/theme/conditions.cjs.map +1 -1
- package/dist/theme/conditions.js +23 -24
- package/dist/theme/conditions.js.map +1 -1
- package/dist/theme/containers.cjs +2 -2
- package/dist/theme/containers.cjs.map +1 -1
- package/dist/theme/containers.js +18 -17
- package/dist/theme/containers.js.map +1 -1
- package/dist/theme/globalCss.cjs +4 -4
- package/dist/theme/globalCss.cjs.map +1 -1
- package/dist/theme/globalCss.d.ts +1 -1
- package/dist/theme/globalCss.js +94 -99
- package/dist/theme/globalCss.js.map +1 -1
- package/dist/theme/keyframes.cjs +2 -2
- package/dist/theme/keyframes.cjs.map +1 -1
- package/dist/theme/keyframes.d.ts +1 -1
- package/dist/theme/keyframes.js +256 -171
- package/dist/theme/keyframes.js.map +1 -1
- package/dist/theme/recipes/accordion.cjs +2 -2
- package/dist/theme/recipes/accordion.cjs.map +1 -1
- package/dist/theme/recipes/accordion.d.ts +1 -1
- package/dist/theme/recipes/accordion.js +93 -110
- package/dist/theme/recipes/accordion.js.map +1 -1
- package/dist/theme/recipes/action-card.cjs +2 -2
- package/dist/theme/recipes/action-card.cjs.map +1 -1
- package/dist/theme/recipes/action-card.d.ts +1 -1
- package/dist/theme/recipes/action-card.js +88 -84
- package/dist/theme/recipes/action-card.js.map +1 -1
- package/dist/theme/recipes/alert.cjs +2 -2
- package/dist/theme/recipes/alert.cjs.map +1 -1
- package/dist/theme/recipes/alert.d.ts +1 -1
- package/dist/theme/recipes/alert.js +52 -65
- package/dist/theme/recipes/alert.js.map +1 -1
- package/dist/theme/recipes/app/mobile-navigation.cjs +2 -2
- package/dist/theme/recipes/app/mobile-navigation.cjs.map +1 -1
- package/dist/theme/recipes/app/mobile-navigation.d.ts +1 -1
- package/dist/theme/recipes/app/mobile-navigation.js +94 -108
- package/dist/theme/recipes/app/mobile-navigation.js.map +1 -1
- package/dist/theme/recipes/app/navigation-language-select.cjs +2 -2
- package/dist/theme/recipes/app/navigation-language-select.cjs.map +1 -1
- package/dist/theme/recipes/app/navigation-language-select.d.ts +1 -1
- package/dist/theme/recipes/app/navigation-language-select.js +135 -148
- package/dist/theme/recipes/app/navigation-language-select.js.map +1 -1
- package/dist/theme/recipes/app/navigation.cjs +2 -2
- package/dist/theme/recipes/app/navigation.cjs.map +1 -1
- package/dist/theme/recipes/app/navigation.d.ts +1 -1
- package/dist/theme/recipes/app/navigation.js +214 -269
- package/dist/theme/recipes/app/navigation.js.map +1 -1
- package/dist/theme/recipes/app/price-tag.cjs +2 -2
- package/dist/theme/recipes/app/price-tag.cjs.map +1 -1
- package/dist/theme/recipes/app/price-tag.d.ts +1 -1
- package/dist/theme/recipes/app/price-tag.js +59 -70
- package/dist/theme/recipes/app/price-tag.js.map +1 -1
- package/dist/theme/recipes/app/product-card-catalog.cjs +2 -2
- package/dist/theme/recipes/app/product-card-catalog.cjs.map +1 -1
- package/dist/theme/recipes/app/product-card-catalog.d.ts +1 -1
- package/dist/theme/recipes/app/product-card-catalog.js +189 -194
- package/dist/theme/recipes/app/product-card-catalog.js.map +1 -1
- package/dist/theme/recipes/avatar-group.cjs +2 -2
- package/dist/theme/recipes/avatar-group.cjs.map +1 -1
- package/dist/theme/recipes/avatar-group.d.ts +1 -1
- package/dist/theme/recipes/avatar-group.js +27 -38
- package/dist/theme/recipes/avatar-group.js.map +1 -1
- package/dist/theme/recipes/avatar.cjs +2 -2
- package/dist/theme/recipes/avatar.cjs.map +1 -1
- package/dist/theme/recipes/avatar.d.ts +1 -1
- package/dist/theme/recipes/avatar.js +97 -95
- package/dist/theme/recipes/avatar.js.map +1 -1
- package/dist/theme/recipes/breadcrumb.cjs +2 -2
- package/dist/theme/recipes/breadcrumb.cjs.map +1 -1
- package/dist/theme/recipes/breadcrumb.d.ts +1 -1
- package/dist/theme/recipes/breadcrumb.js +35 -31
- package/dist/theme/recipes/breadcrumb.js.map +1 -1
- package/dist/theme/recipes/button-filter.cjs +2 -2
- package/dist/theme/recipes/button-filter.cjs.map +1 -1
- package/dist/theme/recipes/button-filter.d.ts +1 -1
- package/dist/theme/recipes/button-filter.js +57 -60
- package/dist/theme/recipes/button-filter.js.map +1 -1
- package/dist/theme/recipes/button.cjs +2 -2
- package/dist/theme/recipes/button.cjs.map +1 -1
- package/dist/theme/recipes/button.d.ts +1 -1
- package/dist/theme/recipes/button.js +287 -295
- package/dist/theme/recipes/button.js.map +1 -1
- package/dist/theme/recipes/chat/chat-document-message.cjs +2 -2
- package/dist/theme/recipes/chat/chat-document-message.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-document-message.d.ts +1 -1
- package/dist/theme/recipes/chat/chat-document-message.js +38 -43
- package/dist/theme/recipes/chat/chat-document-message.js.map +1 -1
- package/dist/theme/recipes/chat/chat-input-text.cjs +2 -2
- package/dist/theme/recipes/chat/chat-input-text.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-input-text.d.ts +1 -1
- package/dist/theme/recipes/chat/chat-input-text.js +26 -27
- package/dist/theme/recipes/chat/chat-input-text.js.map +1 -1
- package/dist/theme/recipes/chat/chat-message.cjs +2 -2
- package/dist/theme/recipes/chat/chat-message.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-message.d.ts +1 -1
- package/dist/theme/recipes/chat/chat-message.js +49 -45
- package/dist/theme/recipes/chat/chat-message.js.map +1 -1
- package/dist/theme/recipes/chat/chat-profile-avatar.cjs +2 -2
- package/dist/theme/recipes/chat/chat-profile-avatar.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-profile-avatar.d.ts +1 -1
- package/dist/theme/recipes/chat/chat-profile-avatar.js +20 -25
- package/dist/theme/recipes/chat/chat-profile-avatar.js.map +1 -1
- package/dist/theme/recipes/chat/chat.cjs +2 -2
- package/dist/theme/recipes/chat/chat.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat.d.ts +1 -1
- package/dist/theme/recipes/chat/chat.js +51 -56
- package/dist/theme/recipes/chat/chat.js.map +1 -1
- package/dist/theme/recipes/checkbox-card.cjs +2 -2
- package/dist/theme/recipes/checkbox-card.cjs.map +1 -1
- package/dist/theme/recipes/checkbox-card.js +44 -40
- package/dist/theme/recipes/checkbox-card.js.map +1 -1
- package/dist/theme/recipes/checkbox-group.cjs +2 -2
- package/dist/theme/recipes/checkbox-group.cjs.map +1 -1
- package/dist/theme/recipes/checkbox-group.d.ts +1 -1
- package/dist/theme/recipes/checkbox-group.js +13 -12
- package/dist/theme/recipes/checkbox-group.js.map +1 -1
- package/dist/theme/recipes/checkbox.cjs +2 -2
- package/dist/theme/recipes/checkbox.cjs.map +1 -1
- package/dist/theme/recipes/checkbox.d.ts +1 -1
- package/dist/theme/recipes/checkbox.js +110 -129
- package/dist/theme/recipes/checkbox.js.map +1 -1
- package/dist/theme/recipes/chip.cjs +2 -2
- package/dist/theme/recipes/chip.cjs.map +1 -1
- package/dist/theme/recipes/chip.d.ts +1 -1
- package/dist/theme/recipes/chip.js +144 -182
- package/dist/theme/recipes/chip.js.map +1 -1
- package/dist/theme/recipes/collapsible.cjs +2 -2
- package/dist/theme/recipes/collapsible.cjs.map +1 -1
- package/dist/theme/recipes/collapsible.d.ts +1 -1
- package/dist/theme/recipes/collapsible.js +30 -28
- package/dist/theme/recipes/collapsible.js.map +1 -1
- package/dist/theme/recipes/combobox.cjs +2 -2
- package/dist/theme/recipes/combobox.cjs.map +1 -1
- package/dist/theme/recipes/combobox.d.ts +1 -1
- package/dist/theme/recipes/combobox.js +149 -176
- package/dist/theme/recipes/combobox.js.map +1 -1
- package/dist/theme/recipes/common/group-card.cjs +2 -2
- package/dist/theme/recipes/common/group-card.cjs.map +1 -1
- package/dist/theme/recipes/common/group-card.js +60 -80
- package/dist/theme/recipes/common/group-card.js.map +1 -1
- package/dist/theme/recipes/datepicker.cjs +2 -2
- package/dist/theme/recipes/datepicker.cjs.map +1 -1
- package/dist/theme/recipes/datepicker.d.ts +1 -1
- package/dist/theme/recipes/datepicker.js +149 -176
- package/dist/theme/recipes/datepicker.js.map +1 -1
- package/dist/theme/recipes/dialog.cjs +2 -2
- package/dist/theme/recipes/dialog.cjs.map +1 -1
- package/dist/theme/recipes/dialog.d.ts +1 -1
- package/dist/theme/recipes/dialog.js +137 -151
- package/dist/theme/recipes/dialog.js.map +1 -1
- package/dist/theme/recipes/drawer.cjs +2 -2
- package/dist/theme/recipes/drawer.cjs.map +1 -1
- package/dist/theme/recipes/drawer.d.ts +1 -1
- package/dist/theme/recipes/drawer.js +105 -125
- package/dist/theme/recipes/drawer.js.map +1 -1
- package/dist/theme/recipes/flag.cjs +2 -2
- package/dist/theme/recipes/flag.cjs.map +1 -1
- package/dist/theme/recipes/flag.d.ts +1 -1
- package/dist/theme/recipes/flag.js +21 -30
- package/dist/theme/recipes/flag.js.map +1 -1
- package/dist/theme/recipes/form/control.cjs +2 -2
- package/dist/theme/recipes/form/control.cjs.map +1 -1
- package/dist/theme/recipes/form/control.d.ts +1 -1
- package/dist/theme/recipes/form/control.js +27 -34
- package/dist/theme/recipes/form/control.js.map +1 -1
- package/dist/theme/recipes/form/helper-text.cjs +2 -2
- package/dist/theme/recipes/form/helper-text.cjs.map +1 -1
- package/dist/theme/recipes/form/helper-text.d.ts +1 -1
- package/dist/theme/recipes/form/helper-text.js +14 -13
- package/dist/theme/recipes/form/helper-text.js.map +1 -1
- package/dist/theme/recipes/form/label.cjs +2 -2
- package/dist/theme/recipes/form/label.cjs.map +1 -1
- package/dist/theme/recipes/form/label.d.ts +1 -1
- package/dist/theme/recipes/form/label.js +47 -48
- package/dist/theme/recipes/form/label.js.map +1 -1
- package/dist/theme/recipes/heading.cjs +2 -2
- package/dist/theme/recipes/heading.cjs.map +1 -1
- package/dist/theme/recipes/heading.d.ts +1 -1
- package/dist/theme/recipes/heading.js +25 -34
- package/dist/theme/recipes/heading.js.map +1 -1
- package/dist/theme/recipes/highlightedInput.cjs +2 -2
- package/dist/theme/recipes/highlightedInput.cjs.map +1 -1
- package/dist/theme/recipes/highlightedInput.d.ts +1 -1
- package/dist/theme/recipes/highlightedInput.js +54 -45
- package/dist/theme/recipes/highlightedInput.js.map +1 -1
- package/dist/theme/recipes/icon-button.cjs +2 -2
- package/dist/theme/recipes/icon-button.cjs.map +1 -1
- package/dist/theme/recipes/icon-button.js +81 -89
- package/dist/theme/recipes/icon-button.js.map +1 -1
- package/dist/theme/recipes/icon.cjs +2 -2
- package/dist/theme/recipes/icon.cjs.map +1 -1
- package/dist/theme/recipes/icon.d.ts +1 -1
- package/dist/theme/recipes/icon.js +39 -42
- package/dist/theme/recipes/icon.js.map +1 -1
- package/dist/theme/recipes/illustration.cjs +2 -2
- package/dist/theme/recipes/illustration.cjs.map +1 -1
- package/dist/theme/recipes/illustration.d.ts +1 -1
- package/dist/theme/recipes/illustration.js +29 -48
- package/dist/theme/recipes/illustration.js.map +1 -1
- package/dist/theme/recipes/index.cjs +2 -2
- package/dist/theme/recipes/index.cjs.map +1 -1
- package/dist/theme/recipes/index.d.ts +1 -1
- package/dist/theme/recipes/index.js +127 -127
- package/dist/theme/recipes/index.js.map +1 -1
- package/dist/theme/recipes/input-addon.cjs +2 -2
- package/dist/theme/recipes/input-addon.cjs.map +1 -1
- package/dist/theme/recipes/input-addon.d.ts +1 -1
- package/dist/theme/recipes/input-addon.js +24 -24
- package/dist/theme/recipes/input-addon.js.map +1 -1
- package/dist/theme/recipes/input-group.cjs +2 -2
- package/dist/theme/recipes/input-group.cjs.map +1 -1
- package/dist/theme/recipes/input-group.d.ts +1 -1
- package/dist/theme/recipes/input-group.js +40 -49
- package/dist/theme/recipes/input-group.js.map +1 -1
- package/dist/theme/recipes/input.cjs +2 -2
- package/dist/theme/recipes/input.cjs.map +1 -1
- package/dist/theme/recipes/input.d.ts +1 -1
- package/dist/theme/recipes/input.js +48 -61
- package/dist/theme/recipes/input.js.map +1 -1
- package/dist/theme/recipes/menu.cjs +2 -2
- package/dist/theme/recipes/menu.cjs.map +1 -1
- package/dist/theme/recipes/menu.d.ts +1 -1
- package/dist/theme/recipes/menu.js +96 -100
- package/dist/theme/recipes/menu.js.map +1 -1
- package/dist/theme/recipes/pagination.cjs +2 -2
- package/dist/theme/recipes/pagination.cjs.map +1 -1
- package/dist/theme/recipes/pagination.d.ts +1 -1
- package/dist/theme/recipes/pagination.js +76 -71
- package/dist/theme/recipes/pagination.js.map +1 -1
- package/dist/theme/recipes/phone-number-input.cjs +2 -2
- package/dist/theme/recipes/phone-number-input.cjs.map +1 -1
- package/dist/theme/recipes/phone-number-input.d.ts +1 -1
- package/dist/theme/recipes/phone-number-input.js +55 -66
- package/dist/theme/recipes/phone-number-input.js.map +1 -1
- package/dist/theme/recipes/popover.cjs +2 -2
- package/dist/theme/recipes/popover.cjs.map +1 -1
- package/dist/theme/recipes/popover.d.ts +1 -1
- package/dist/theme/recipes/popover.js +30 -28
- package/dist/theme/recipes/popover.js.map +1 -1
- package/dist/theme/recipes/radio-button-group.cjs +2 -2
- package/dist/theme/recipes/radio-button-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-button-group.d.ts +1 -1
- package/dist/theme/recipes/radio-button-group.js +83 -94
- package/dist/theme/recipes/radio-button-group.js.map +1 -1
- package/dist/theme/recipes/radio-card-group.cjs +2 -2
- package/dist/theme/recipes/radio-card-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-card-group.d.ts +1 -1
- package/dist/theme/recipes/radio-card-group.js +64 -67
- package/dist/theme/recipes/radio-card-group.js.map +1 -1
- package/dist/theme/recipes/radio-group.cjs +2 -2
- package/dist/theme/recipes/radio-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-group.d.ts +1 -1
- package/dist/theme/recipes/radio-group.js +101 -118
- package/dist/theme/recipes/radio-group.js.map +1 -1
- package/dist/theme/recipes/select-language.cjs +2 -2
- package/dist/theme/recipes/select-language.cjs.map +1 -1
- package/dist/theme/recipes/select-language.d.ts +1 -1
- package/dist/theme/recipes/select-language.js +93 -112
- package/dist/theme/recipes/select-language.js.map +1 -1
- package/dist/theme/recipes/select.cjs +2 -2
- package/dist/theme/recipes/select.cjs.map +1 -1
- package/dist/theme/recipes/select.d.ts +1 -1
- package/dist/theme/recipes/select.js +194 -206
- package/dist/theme/recipes/select.js.map +1 -1
- package/dist/theme/recipes/status-tag-select.cjs +2 -2
- package/dist/theme/recipes/status-tag-select.cjs.map +1 -1
- package/dist/theme/recipes/status-tag-select.d.ts +1 -1
- package/dist/theme/recipes/status-tag-select.js +162 -175
- package/dist/theme/recipes/status-tag-select.js.map +1 -1
- package/dist/theme/recipes/switch-card.cjs +2 -2
- package/dist/theme/recipes/switch-card.cjs.map +1 -1
- package/dist/theme/recipes/switch-card.js +43 -42
- package/dist/theme/recipes/switch-card.js.map +1 -1
- package/dist/theme/recipes/switch.cjs +2 -2
- package/dist/theme/recipes/switch.cjs.map +1 -1
- package/dist/theme/recipes/switch.d.ts +1 -1
- package/dist/theme/recipes/switch.js +71 -86
- package/dist/theme/recipes/switch.js.map +1 -1
- package/dist/theme/recipes/table-container.cjs +2 -2
- package/dist/theme/recipes/table-container.cjs.map +1 -1
- package/dist/theme/recipes/table-container.d.ts +1 -1
- package/dist/theme/recipes/table-container.js +19 -18
- package/dist/theme/recipes/table-container.js.map +1 -1
- package/dist/theme/recipes/table-empty-row.cjs +2 -2
- package/dist/theme/recipes/table-empty-row.cjs.map +1 -1
- package/dist/theme/recipes/table-empty-row.d.ts +1 -1
- package/dist/theme/recipes/table-empty-row.js +17 -16
- package/dist/theme/recipes/table-empty-row.js.map +1 -1
- package/dist/theme/recipes/table-group-title.cjs +2 -2
- package/dist/theme/recipes/table-group-title.cjs.map +1 -1
- package/dist/theme/recipes/table-group-title.d.ts +1 -1
- package/dist/theme/recipes/table-group-title.js +26 -33
- package/dist/theme/recipes/table-group-title.js.map +1 -1
- package/dist/theme/recipes/table.cjs +2 -2
- package/dist/theme/recipes/table.cjs.map +1 -1
- package/dist/theme/recipes/table.d.ts +1 -1
- package/dist/theme/recipes/table.js +111 -109
- package/dist/theme/recipes/table.js.map +1 -1
- package/dist/theme/recipes/tabs-chip.cjs +2 -2
- package/dist/theme/recipes/tabs-chip.cjs.map +1 -1
- package/dist/theme/recipes/tabs-chip.d.ts +1 -1
- package/dist/theme/recipes/tabs-chip.js +43 -46
- package/dist/theme/recipes/tabs-chip.js.map +1 -1
- package/dist/theme/recipes/tabs.cjs +2 -2
- package/dist/theme/recipes/tabs.cjs.map +1 -1
- package/dist/theme/recipes/tabs.d.ts +1 -1
- package/dist/theme/recipes/tabs.js +92 -125
- package/dist/theme/recipes/tabs.js.map +1 -1
- package/dist/theme/recipes/tag.cjs +2 -2
- package/dist/theme/recipes/tag.cjs.map +1 -1
- package/dist/theme/recipes/tag.d.ts +1 -1
- package/dist/theme/recipes/tag.js +110 -121
- package/dist/theme/recipes/tag.js.map +1 -1
- package/dist/theme/recipes/text.cjs +2 -2
- package/dist/theme/recipes/text.cjs.map +1 -1
- package/dist/theme/recipes/text.d.ts +1 -1
- package/dist/theme/recipes/text.js +25 -38
- package/dist/theme/recipes/text.js.map +1 -1
- package/dist/theme/recipes/textarea.cjs +2 -2
- package/dist/theme/recipes/textarea.cjs.map +1 -1
- package/dist/theme/recipes/textarea.d.ts +1 -1
- package/dist/theme/recipes/textarea.js +15 -14
- package/dist/theme/recipes/textarea.js.map +1 -1
- package/dist/theme/recipes/tooltip.cjs +2 -2
- package/dist/theme/recipes/tooltip.cjs.map +1 -1
- package/dist/theme/recipes/tooltip.d.ts +1 -1
- package/dist/theme/recipes/tooltip.js +47 -62
- package/dist/theme/recipes/tooltip.js.map +1 -1
- package/dist/theme/semantic-tokens/colors.cjs +2 -2
- package/dist/theme/semantic-tokens/colors.cjs.map +1 -1
- package/dist/theme/semantic-tokens/colors.js +189 -140
- package/dist/theme/semantic-tokens/colors.js.map +1 -1
- package/dist/theme/semantic-tokens/index.cjs +2 -2
- package/dist/theme/semantic-tokens/index.cjs.map +1 -1
- package/dist/theme/semantic-tokens/index.js +7 -8
- package/dist/theme/semantic-tokens/index.js.map +1 -1
- package/dist/theme/text-styles.cjs +2 -2
- package/dist/theme/text-styles.cjs.map +1 -1
- package/dist/theme/text-styles.d.ts +1 -1
- package/dist/theme/text-styles.js +70 -87
- package/dist/theme/text-styles.js.map +1 -1
- package/dist/theme/tokens/animations.cjs +2 -2
- package/dist/theme/tokens/animations.cjs.map +1 -1
- package/dist/theme/tokens/animations.js +22 -45
- package/dist/theme/tokens/animations.js.map +1 -1
- package/dist/theme/tokens/aspect-ratios.cjs +2 -2
- package/dist/theme/tokens/aspect-ratios.cjs.map +1 -1
- package/dist/theme/tokens/aspect-ratios.js +12 -11
- package/dist/theme/tokens/aspect-ratios.js.map +1 -1
- package/dist/theme/tokens/blurs.cjs +2 -2
- package/dist/theme/tokens/blurs.cjs.map +1 -1
- package/dist/theme/tokens/blurs.js +13 -12
- package/dist/theme/tokens/blurs.js.map +1 -1
- package/dist/theme/tokens/borders.cjs +2 -2
- package/dist/theme/tokens/borders.cjs.map +1 -1
- package/dist/theme/tokens/borders.js +6 -9
- package/dist/theme/tokens/borders.js.map +1 -1
- package/dist/theme/tokens/colors.cjs +2 -2
- package/dist/theme/tokens/colors.cjs.map +1 -1
- package/dist/theme/tokens/colors.js +78 -77
- package/dist/theme/tokens/colors.js.map +1 -1
- package/dist/theme/tokens/durations.cjs +2 -2
- package/dist/theme/tokens/durations.cjs.map +1 -1
- package/dist/theme/tokens/durations.js +14 -13
- package/dist/theme/tokens/durations.js.map +1 -1
- package/dist/theme/tokens/easings.cjs +3 -3
- package/dist/theme/tokens/easings.cjs.map +1 -1
- package/dist/theme/tokens/easings.js +24 -92
- package/dist/theme/tokens/easings.js.map +1 -1
- package/dist/theme/tokens/index.cjs +2 -2
- package/dist/theme/tokens/index.cjs.map +1 -1
- package/dist/theme/tokens/index.js +36 -35
- package/dist/theme/tokens/index.js.map +1 -1
- package/dist/theme/tokens/radii.cjs +2 -2
- package/dist/theme/tokens/radii.cjs.map +1 -1
- package/dist/theme/tokens/radii.js +28 -27
- package/dist/theme/tokens/radii.js.map +1 -1
- package/dist/theme/tokens/shadows.cjs +2 -2
- package/dist/theme/tokens/shadows.cjs.map +1 -1
- package/dist/theme/tokens/shadows.js +14 -13
- package/dist/theme/tokens/shadows.js.map +1 -1
- package/dist/theme/tokens/sizes.cjs +2 -2
- package/dist/theme/tokens/sizes.cjs.map +1 -1
- package/dist/theme/tokens/sizes.js +35 -84
- package/dist/theme/tokens/sizes.js.map +1 -1
- package/dist/theme/tokens/spacing.cjs +2 -2
- package/dist/theme/tokens/spacing.cjs.map +1 -1
- package/dist/theme/tokens/spacing.js +32 -83
- package/dist/theme/tokens/spacing.js.map +1 -1
- package/dist/theme/tokens/typography.cjs +2 -2
- package/dist/theme/tokens/typography.cjs.map +1 -1
- package/dist/theme/tokens/typography.js +82 -85
- package/dist/theme/tokens/typography.js.map +1 -1
- package/dist/theme/tokens/z-index.cjs +2 -2
- package/dist/theme/tokens/z-index.cjs.map +1 -1
- package/dist/theme/tokens/z-index.js +18 -41
- package/dist/theme/tokens/z-index.js.map +1 -1
- package/dist/theme/utilities.cjs +2 -2
- package/dist/theme/utilities.cjs.map +1 -1
- package/dist/theme/utilities.js +15 -16
- package/dist/theme/utilities.js.map +1 -1
- package/dist/ui.css +2 -1
- package/dist/utils/slots.cjs +2 -2
- package/dist/utils/slots.cjs.map +1 -1
- package/dist/utils/slots.js +42 -40
- package/dist/utils/slots.js.map +1 -1
- package/package.json +11 -7
- package/dist/_virtual/_commonjsHelpers.cjs +0 -2
- package/dist/_virtual/_commonjsHelpers.cjs.map +0 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -10
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/cjs.cjs +0 -2
- package/dist/_virtual/cjs.cjs.map +0 -1
- package/dist/_virtual/cjs.js +0 -9
- package/dist/_virtual/cjs.js.map +0 -1
- package/dist/_virtual/lodash.cjs +0 -2
- package/dist/_virtual/lodash.cjs.map +0 -1
- package/dist/_virtual/lodash.js +0 -7
- package/dist/_virtual/lodash.js.map +0 -1
- package/dist/_virtual/lodash2.cjs +0 -2
- package/dist/_virtual/lodash2.cjs.map +0 -1
- package/dist/_virtual/lodash2.js +0 -6
- package/dist/_virtual/lodash2.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +0 -2
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js +0 -30
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +0 -2
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js +0 -30
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +0 -2
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js +0 -30
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +0 -2
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js +0 -30
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +0 -1
- package/dist/node_modules/@pandacss/shared/dist/index.cjs +0 -2
- package/dist/node_modules/@pandacss/shared/dist/index.cjs.map +0 -1
- package/dist/node_modules/@pandacss/shared/dist/index.js +0 -469
- package/dist/node_modules/@pandacss/shared/dist/index.js.map +0 -1
- package/dist/node_modules/@zag-js/utils/dist/functions.cjs +0 -2
- package/dist/node_modules/@zag-js/utils/dist/functions.cjs.map +0 -1
- package/dist/node_modules/@zag-js/utils/dist/functions.js +0 -6
- package/dist/node_modules/@zag-js/utils/dist/functions.js.map +0 -1
- package/dist/node_modules/deepmerge/dist/cjs.cjs +0 -2
- package/dist/node_modules/deepmerge/dist/cjs.cjs.map +0 -1
- package/dist/node_modules/deepmerge/dist/cjs.js +0 -81
- package/dist/node_modules/deepmerge/dist/cjs.js.map +0 -1
- package/dist/node_modules/lodash/lodash.cjs +0 -21
- package/dist/node_modules/lodash/lodash.cjs.map +0 -1
- package/dist/node_modules/lodash/lodash.js +0 -3686
- package/dist/node_modules/lodash/lodash.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.cjs","sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from 'lodash'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value'> & {\n value?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n ...props\n}: ComboboxProps<T>) => {\n const [items, setItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setItems(newItems)\n } catch (error) {\n console.error(error)\n setItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n const allItems = [...items, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (initialItems && initialItems.length > 0 && !initialItems.find(item => item.label === details.inputValue)) {\n onResetInitialItems?.()\n }\n const { inputValue } = details\n\n if (debouncedLoadItems) {\n debouncedLoadItems(inputValue)\n } else {\n const items =\n withAutoFilter && inputValue !== ''\n ? itemsFromUsers.filter(item => item.label.toLowerCase().includes(inputValue.toLowerCase()))\n : itemsFromUsers\n\n if (items.length === 0 && returnItemsOnEmpty) {\n return setItems(itemsFromUsers)\n }\n setItems(items)\n }\n },\n [debouncedLoadItems, itemsFromUsers, withAutoFilter],\n )\n\n useEffect(() => {\n if (!withAutoFilter && !debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, withAutoFilter, debouncedLoadItems])\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Chargement...\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Aucun résultat\n </Text>\n )\n // TODO: const multiple = props.multiple\n // TODO: multiple design, using input chips https://ark-ui.com/reat/examples/combobox-with-tags-input\n const multiple = false\n\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n {...props}\n // TODO: multiple design\n multiple={multiple}\n >\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={e => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * allItems.length, 180)}\n itemCount={allItems.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={allItems[index].value}\n when={!!allItems[index].tooltip}\n wrapper={children => <Tooltip label={allItems[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={allItems[index].value} item={allItems[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={allItems[index]} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n </Root>\n )\n}\n"],"names":["withProvider","withContext","createStyleContext","combobox","Root","styled","ArkCombobox","ClearTrigger","Content","Input","Control","Item","ItemText","Positioner","Trigger","MultipleUncheckedIndicator","jsxs","jsx","css","MultipleCheckedIndicator","CustomInnerItem","item","isMultiple","renderItem","context","useComboboxItemContext","Fragment","Combobox","itemsFromUsers","initialItems","debounceMs","placeholder","emptyLabel","loadingLabel","usePortal","withAutoFilter","positioning","loadItems","onResetInitialItems","controlledIsLoading","value","openDropdownOnFocus","clearValueWhenEmpty","virtualized","rowHeight","returnItemsOnEmpty","props","items","setItems","useState","isLoading","setIsLoading","firstQueryTriggered","setFirstQueryTriggered","asyncMode","debouncedLoadItems","useMemo","debounce","newItems","error","allItems","handleInputChange","useCallback","details","inputValue","useEffect","collection","createListCollection","effectiveIsLoading","loadingContent","Text","emptyContent","multiple","api","e","UIInput","ConditionalWrapper","children","Portal","FixedSizeList","index","style","Tooltip"],"mappings":"oiBAsBM,CAAE,aAAAA,GAAc,YAAAC,GAAgBC,EAAAA,mBAAmBC,EAAAA,QAAQ,EAG3DC,GAAOJ,GAAaK,EAAAA,OAAOC,EAAAA,SAAY,IAAS,EAAG,OAAQ,CAC/D,aAAc,CACZ,UAAW,EAAA,CAEf,CAAC,EAEKC,GAAeN,EAAYI,EAAAA,OAAOC,EAAAA,SAAY,YAAY,EAAG,cAAc,EAC3EE,GAAUP,EAAYI,EAAAA,OAAOC,EAAAA,SAAY,OAAO,EAAG,SAAS,EAC5DG,GAAQR,EAAYI,EAAAA,OAAOC,EAAAA,SAAY,KAAK,EAAG,OAAO,EACtDI,GAAUT,EAAYI,EAAAA,OAAOC,EAAAA,SAAY,OAAO,EAAG,SAAS,EAC5DK,EAAOV,EAAYI,EAAAA,OAAOC,EAAAA,SAAY,IAAI,EAAG,MAAM,EACnDM,GAAWX,EAAYI,EAAAA,OAAOC,EAAAA,SAAY,QAAQ,EAAG,UAAU,EAC/DO,GAAaZ,EAAYI,EAAAA,OAAOC,EAAAA,SAAY,UAAU,EAAG,YAAY,EACrEQ,GAAU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EACvD,eAAC7D,EAAA,CAAgB,WAAAG,EAAwB,KAAMqC,EAASoB,CAAK,EAAG,WAAYR,CAAA,CAAU,GAD7EZ,EAASoB,CAAK,EAAE,KAE3B,CAAA,EANKpB,EAASoB,CAAK,EAAE,KAAA,CAOvB,CAAA,CAEJ,CACF,EAEApB,EAAS,IAAIvC,GACXJ,EAAAA,IAAC2D,EAAAA,mBAAA,CAEC,KAAM,CAAC,CAACvD,EAAK,QACb,QAASwD,GAAY5D,EAAAA,IAACiE,EAAAA,SAAQ,MAAO7D,EAAK,QAAU,SAAAwD,EAAS,EAE7D,SAAA5D,EAAAA,IAACN,EAAA,CAAsB,KAAAU,EACrB,SAAAJ,EAAAA,IAACG,EAAA,CAAgB,WAAAG,EAAwB,KAAAF,EAAY,WAAYmD,CAAA,CAAU,CAAA,EADlEnD,EAAK,KAEhB,CAAA,EANKA,EAAK,KAAA,CAQb,CAAA,CAEL,CAAA,CACF,CAAA,CACF,CAAA,CAAA,CAAA,CAGN"}
|
|
1
|
+
{"version":3,"file":"Combobox.cjs","names":[],"sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from 'lodash'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value'> & {\n value?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n ...props\n}: ComboboxProps<T>) => {\n const [items, setItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setItems(newItems)\n } catch (error) {\n console.error(error)\n setItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n const allItems = [...items, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (\n initialItems &&\n initialItems.length > 0 &&\n !initialItems.find((item: ComboboxItem) => item.label === details.inputValue)\n ) {\n onResetInitialItems?.()\n }\n const { inputValue } = details\n\n if (debouncedLoadItems) {\n debouncedLoadItems(inputValue)\n } else {\n const items =\n withAutoFilter && inputValue !== ''\n ? itemsFromUsers.filter((item: ComboboxItem) => item.label.toLowerCase().includes(inputValue.toLowerCase()))\n : itemsFromUsers\n\n if (items.length === 0 && returnItemsOnEmpty) {\n return setItems(itemsFromUsers)\n }\n setItems(items)\n }\n },\n [debouncedLoadItems, itemsFromUsers, withAutoFilter],\n )\n\n useEffect(() => {\n if (!withAutoFilter && !debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, withAutoFilter, debouncedLoadItems])\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Chargement...\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Aucun résultat\n </Text>\n )\n // TODO: const multiple = props.multiple\n // TODO: multiple design, using input chips https://ark-ui.com/reat/examples/combobox-with-tags-input\n const multiple = false\n\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n {...props}\n // TODO: multiple design\n multiple={multiple}\n >\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * allItems.length, 180)}\n itemCount={allItems.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={allItems[index].value}\n when={!!allItems[index].tooltip}\n wrapper={children => <Tooltip label={allItems[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={allItems[index].value} item={allItems[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={allItems[index]} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n </Root>\n )\n}\n"],"mappings":"ocAsBA,GAAM,CAAE,eAAc,eAAgB,EAAA,mBAAmB,EAAA,QAAQ,EAG3D,EAAO,GAAA,EAAA,EAAA,QAAoB,EAAA,SAAY,IAAS,EAAG,OAAQ,CAC/D,aAAc,CACZ,UAAW,EACb,CACF,CAAC,EAEK,EAAe,GAAA,EAA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,CAEE,KAAM,CAAC,CAAC,EAAS,GAAO,QACxB,QAAS,IAAY,EAAA,EAAA,KAAC,EAAA,QAAD,CAAS,MAAO,EAAS,GAAO,QAAU,UAAkB,CAAA,YAEjF,EAAA,EAAA,KAAC,EAAD,CAAkC,KAAM,EAAS,GAAe,kBAC9D,EAAA,EAAA,KAAC,EAAD,CAA6B,aAAY,KAAM,EAAS,GAAQ,WAAY,EAAW,CAAA,CACnF,EAFK,EAAS,GAAO,KAErB,CACY,EAPb,EAAS,GAAO,KAOH,CAET,CAAA,CACf,CAAA,EAEF,EAAS,IAAI,IACX,EAAA,EAAA,KAAC,EAAA,mBAAD,CAEE,KAAM,CAAC,CAAC,EAAK,QACb,QAAS,IAAY,EAAA,EAAA,KAAC,EAAA,QAAD,CAAS,MAAO,EAAK,QAAU,UAAkB,CAAA,YAEtE,EAAA,EAAA,KAAC,EAAD,CAA6B,iBAC3B,EAAA,EAAA,KAAC,EAAD,CAA6B,aAAkB,OAAM,WAAY,EAAW,CAAA,CACxE,EAFK,EAAK,KAEV,CACY,EAPb,EAAK,KAOQ,CACrB,CAEI,CAAA,CACC,CAAA,CACM,CAAA,CAChB,GAEV"}
|
|
@@ -1,176 +1,209 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
2
|
+
import { createStyleContext as e } from "../../utils/slots.js";
|
|
3
|
+
import { Tooltip as t } from "../tooltip/Tooltip.js";
|
|
4
|
+
import { Text as n } from "../text/Text.js";
|
|
5
|
+
import { ConditionalWrapper as r } from "../../shared/ConditionalWrapper.js";
|
|
6
|
+
import { Input as ee } from "../input/Input.js";
|
|
7
|
+
import { Combobox as i, Portal as a, createListCollection as o, useComboboxItemContext as s } from "@ark-ui/react";
|
|
8
|
+
import { styled as c } from "@stokelp/styled-system/jsx";
|
|
9
|
+
import { combobox as l } from "@stokelp/styled-system/recipes";
|
|
10
|
+
import { useCallback as u, useEffect as d, useMemo as f, useState as p } from "react";
|
|
11
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import { css as _ } from "@stokelp/styled-system/css";
|
|
13
|
+
import { FixedSizeList as v } from "react-window";
|
|
14
|
+
import { debounce as y } from "lodash";
|
|
15
|
+
//#region src/components/combobox/Combobox.tsx
|
|
16
|
+
var { withProvider: b, withContext: x } = e(l), S = b(c(i.Root), "root", { defaultProps: { loopFocus: !0 } }), te = x(c(i.ClearTrigger), "clearTrigger"), C = x(c(i.Content), "content"), w = x(c(i.Input), "input"), T = x(c(i.Control), "control"), E = x(c(i.Item), "item"), D = x(c(i.ItemText), "itemText"), O = x(c(i.Positioner), "positioner"), k = x(c(i.Trigger), "trigger"), A = () => /* @__PURE__ */ g("svg", {
|
|
17
|
+
width: "16",
|
|
18
|
+
height: "17",
|
|
19
|
+
viewBox: "0 0 16 17",
|
|
20
|
+
fill: "none",
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
children: [/* @__PURE__ */ h("rect", {
|
|
23
|
+
x: "0.5",
|
|
24
|
+
y: "1",
|
|
25
|
+
width: "15",
|
|
26
|
+
height: "15",
|
|
27
|
+
rx: "3.5",
|
|
28
|
+
fill: "white"
|
|
29
|
+
}), /* @__PURE__ */ h("rect", {
|
|
30
|
+
x: "0.5",
|
|
31
|
+
y: "1",
|
|
32
|
+
width: "15",
|
|
33
|
+
height: "15",
|
|
34
|
+
rx: "3.5",
|
|
35
|
+
className: _({ stroke: "grey.100" })
|
|
36
|
+
})]
|
|
37
|
+
}), j = () => /* @__PURE__ */ g("svg", {
|
|
38
|
+
width: "16",
|
|
39
|
+
height: "17",
|
|
40
|
+
viewBox: "0 0 16 17",
|
|
41
|
+
fill: "none",
|
|
42
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
43
|
+
children: [/* @__PURE__ */ h("rect", {
|
|
44
|
+
y: "0.5",
|
|
45
|
+
width: "16",
|
|
46
|
+
height: "16",
|
|
47
|
+
rx: "4",
|
|
48
|
+
className: _({ fill: "primary.500" })
|
|
49
|
+
}), /* @__PURE__ */ h("path", {
|
|
50
|
+
fillRule: "evenodd",
|
|
51
|
+
clipRule: "evenodd",
|
|
52
|
+
d: "M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z",
|
|
53
|
+
fill: "white"
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
56
|
+
function M({ item: e, isMultiple: t, renderItem: n }) {
|
|
57
|
+
let r = s();
|
|
58
|
+
return /* @__PURE__ */ g(m, { children: [t ? r.selected ? /* @__PURE__ */ h(j, {}) : /* @__PURE__ */ h(A, {}) : null, n ? n(e) : /* @__PURE__ */ h(D, {
|
|
59
|
+
truncate: !0,
|
|
60
|
+
children: e.label
|
|
61
|
+
})] });
|
|
40
62
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
63
|
+
var N = ({ items: e = [], initialItems: s, debounceMs: c = 0, placeholder: l, emptyLabel: _, loadingLabel: b, usePortal: x = !0, withAutoFilter: D = !0, positioning: A, loadItems: j, renderItem: N, onResetInitialItems: P, isLoading: F, value: I, openDropdownOnFocus: L = !0, clearValueWhenEmpty: R = !0, virtualized: z, rowHeight: B = 34, returnItemsOnEmpty: V, ...H }) => {
|
|
64
|
+
let [U, W] = p(() => e), [G, K] = p(!1), [q, J] = p(!1), Y = typeof j == "function", X = f(() => j ? y(async (e) => {
|
|
65
|
+
try {
|
|
66
|
+
J(!0), K(!0), W(await j(e));
|
|
67
|
+
} catch (e) {
|
|
68
|
+
console.error(e), W([]);
|
|
69
|
+
} finally {
|
|
70
|
+
K(!1);
|
|
71
|
+
}
|
|
72
|
+
}, c) : null, [j, c]), Z = [...U, ...s ?? []], ne = u(async (t) => {
|
|
73
|
+
s && s.length > 0 && !s.find((e) => e.label === t.inputValue) && P?.();
|
|
74
|
+
let { inputValue: n } = t;
|
|
75
|
+
if (X) X(n);
|
|
76
|
+
else {
|
|
77
|
+
let t = D && n !== "" ? e.filter((e) => e.label.toLowerCase().includes(n.toLowerCase())) : e;
|
|
78
|
+
if (t.length === 0 && V) return W(e);
|
|
79
|
+
W(t);
|
|
80
|
+
}
|
|
81
|
+
}, [
|
|
82
|
+
X,
|
|
83
|
+
e,
|
|
84
|
+
D
|
|
85
|
+
]);
|
|
86
|
+
d(() => {
|
|
87
|
+
!D && !X && W(e);
|
|
88
|
+
}, [
|
|
89
|
+
e,
|
|
90
|
+
D,
|
|
91
|
+
X
|
|
92
|
+
]);
|
|
93
|
+
let re = f(() => o({ items: Z }), [Z]), ie = F ?? G, Q = b ?? /* @__PURE__ */ h(n, {
|
|
94
|
+
p: "space-8",
|
|
95
|
+
textAlign: "center",
|
|
96
|
+
children: "Chargement..."
|
|
97
|
+
}), $ = _ ?? /* @__PURE__ */ h(n, {
|
|
98
|
+
p: "space-8",
|
|
99
|
+
textAlign: "center",
|
|
100
|
+
children: "Aucun résultat"
|
|
101
|
+
});
|
|
102
|
+
return /* @__PURE__ */ g(S, {
|
|
103
|
+
lazyMount: !0,
|
|
104
|
+
unmountOnExit: !0,
|
|
105
|
+
collection: re,
|
|
106
|
+
positioning: {
|
|
107
|
+
sameWidth: !0,
|
|
108
|
+
gutter: 0,
|
|
109
|
+
...A
|
|
110
|
+
},
|
|
111
|
+
"data-recipe": "combobox",
|
|
112
|
+
onInputValueChange: ne,
|
|
113
|
+
value: I,
|
|
114
|
+
...H,
|
|
115
|
+
multiple: !1,
|
|
116
|
+
children: [/* @__PURE__ */ g(T, { children: [
|
|
117
|
+
/* @__PURE__ */ h(i.Context, { children: (e) => /* @__PURE__ */ h(w, {
|
|
118
|
+
asChild: !0,
|
|
119
|
+
placeholder: l,
|
|
120
|
+
onInput: (t) => {
|
|
121
|
+
let n = t.currentTarget.value;
|
|
122
|
+
R && n === "" && e.clearValue();
|
|
123
|
+
},
|
|
124
|
+
onFocus: () => {
|
|
125
|
+
!L || Y || e.setOpen(!0);
|
|
126
|
+
},
|
|
127
|
+
children: /* @__PURE__ */ h(ee, {})
|
|
128
|
+
}) }),
|
|
129
|
+
/* @__PURE__ */ h(k, {
|
|
130
|
+
asChild: !0,
|
|
131
|
+
hidden: Y && (!s || s.length === 0),
|
|
132
|
+
children: /* @__PURE__ */ h("svg", {
|
|
133
|
+
width: "24",
|
|
134
|
+
height: "24",
|
|
135
|
+
viewBox: "0 0 24 24",
|
|
136
|
+
fill: "none",
|
|
137
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
138
|
+
children: /* @__PURE__ */ h("path", {
|
|
139
|
+
fillRule: "evenodd",
|
|
140
|
+
clipRule: "evenodd",
|
|
141
|
+
d: "M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z",
|
|
142
|
+
fill: "currentColor"
|
|
143
|
+
})
|
|
144
|
+
})
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ h(te, {
|
|
147
|
+
disabled: H.readOnly,
|
|
148
|
+
onClick: P,
|
|
149
|
+
asChild: !0,
|
|
150
|
+
children: /* @__PURE__ */ h("button", { children: /* @__PURE__ */ h("svg", {
|
|
151
|
+
width: "20",
|
|
152
|
+
height: "20",
|
|
153
|
+
viewBox: "0 0 20 20",
|
|
154
|
+
fill: "none",
|
|
155
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
156
|
+
children: /* @__PURE__ */ h("path", {
|
|
157
|
+
fillRule: "evenodd",
|
|
158
|
+
clipRule: "evenodd",
|
|
159
|
+
d: "M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z",
|
|
160
|
+
fill: "currentColor"
|
|
161
|
+
})
|
|
162
|
+
}) })
|
|
163
|
+
})
|
|
164
|
+
] }), /* @__PURE__ */ h(r, {
|
|
165
|
+
when: x,
|
|
166
|
+
wrapper: (e) => /* @__PURE__ */ h(a, { children: e }),
|
|
167
|
+
children: /* @__PURE__ */ h(O, { children: /* @__PURE__ */ h(C, { children: ie ? Q : Z.length === 0 ? /* @__PURE__ */ h(m, { children: Y ? q ? $ : Q : $ }) : z ? /* @__PURE__ */ h(m, { children: /* @__PURE__ */ h(v, {
|
|
168
|
+
height: Math.min(B * Z.length, 180),
|
|
169
|
+
itemCount: Z.length,
|
|
170
|
+
itemSize: B,
|
|
171
|
+
width: "100%",
|
|
172
|
+
children: ({ index: e, style: n }) => /* @__PURE__ */ h(r, {
|
|
173
|
+
when: !!Z[e].tooltip,
|
|
174
|
+
wrapper: (n) => /* @__PURE__ */ h(t, {
|
|
175
|
+
label: Z[e].tooltip,
|
|
176
|
+
children: n
|
|
177
|
+
}),
|
|
178
|
+
children: /* @__PURE__ */ h(E, {
|
|
179
|
+
item: Z[e],
|
|
180
|
+
style: n,
|
|
181
|
+
children: /* @__PURE__ */ h(M, {
|
|
182
|
+
renderItem: N,
|
|
183
|
+
item: Z[e],
|
|
184
|
+
isMultiple: !1
|
|
185
|
+
})
|
|
186
|
+
}, Z[e].value)
|
|
187
|
+
}, Z[e].value)
|
|
188
|
+
}) }) : Z.map((e) => /* @__PURE__ */ h(r, {
|
|
189
|
+
when: !!e.tooltip,
|
|
190
|
+
wrapper: (n) => /* @__PURE__ */ h(t, {
|
|
191
|
+
label: e.tooltip,
|
|
192
|
+
children: n
|
|
193
|
+
}),
|
|
194
|
+
children: /* @__PURE__ */ h(E, {
|
|
195
|
+
item: e,
|
|
196
|
+
children: /* @__PURE__ */ h(M, {
|
|
197
|
+
renderItem: N,
|
|
198
|
+
item: e,
|
|
199
|
+
isMultiple: !1
|
|
200
|
+
})
|
|
201
|
+
}, e.value)
|
|
202
|
+
}, e.value)) }) })
|
|
203
|
+
})]
|
|
204
|
+
});
|
|
172
205
|
};
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
//# sourceMappingURL=Combobox.js.map
|
|
206
|
+
//#endregion
|
|
207
|
+
export { N as Combobox };
|
|
208
|
+
|
|
209
|
+
//# sourceMappingURL=Combobox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.js","sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from 'lodash'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value'> & {\n value?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n ...props\n}: ComboboxProps<T>) => {\n const [items, setItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setItems(newItems)\n } catch (error) {\n console.error(error)\n setItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n const allItems = [...items, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (initialItems && initialItems.length > 0 && !initialItems.find(item => item.label === details.inputValue)) {\n onResetInitialItems?.()\n }\n const { inputValue } = details\n\n if (debouncedLoadItems) {\n debouncedLoadItems(inputValue)\n } else {\n const items =\n withAutoFilter && inputValue !== ''\n ? itemsFromUsers.filter(item => item.label.toLowerCase().includes(inputValue.toLowerCase()))\n : itemsFromUsers\n\n if (items.length === 0 && returnItemsOnEmpty) {\n return setItems(itemsFromUsers)\n }\n setItems(items)\n }\n },\n [debouncedLoadItems, itemsFromUsers, withAutoFilter],\n )\n\n useEffect(() => {\n if (!withAutoFilter && !debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, withAutoFilter, debouncedLoadItems])\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Chargement...\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Aucun résultat\n </Text>\n )\n // TODO: const multiple = props.multiple\n // TODO: multiple design, using input chips https://ark-ui.com/reat/examples/combobox-with-tags-input\n const multiple = false\n\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n {...props}\n // TODO: multiple design\n multiple={multiple}\n >\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={e => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * allItems.length, 180)}\n itemCount={allItems.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={allItems[index].value}\n when={!!allItems[index].tooltip}\n wrapper={children => <Tooltip label={allItems[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={allItems[index].value} item={allItems[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={allItems[index]} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n </Root>\n )\n}\n"],"names":["withProvider","withContext","createStyleContext","combobox","Root","styled","ArkCombobox","ClearTrigger","Content","Input","Control","Item","ItemText","Positioner","Trigger","MultipleUncheckedIndicator","jsxs","jsx","css","MultipleCheckedIndicator","CustomInnerItem","item","isMultiple","renderItem","context","useComboboxItemContext","Fragment","Combobox","itemsFromUsers","initialItems","debounceMs","placeholder","emptyLabel","loadingLabel","usePortal","withAutoFilter","positioning","loadItems","onResetInitialItems","controlledIsLoading","value","openDropdownOnFocus","clearValueWhenEmpty","virtualized","rowHeight","returnItemsOnEmpty","props","items","setItems","useState","isLoading","setIsLoading","firstQueryTriggered","setFirstQueryTriggered","asyncMode","debouncedLoadItems","useMemo","debounce","newItems","error","allItems","handleInputChange","useCallback","details","inputValue","useEffect","collection","createListCollection","effectiveIsLoading","loadingContent","Text","emptyContent","multiple","api","e","UIInput","ConditionalWrapper","children","Portal","FixedSizeList","index","style","Tooltip"],"mappings":";;;;;;;;;;;;;;AAsBA,MAAM,EAAE,cAAAA,IAAc,aAAAC,MAAgBC,GAAmBC,EAAQ,GAG3DC,KAAOJ,GAAaK,EAAOC,EAAY,IAAS,GAAG,QAAQ;AAAA,EAC/D,cAAc;AAAA,IACZ,WAAW;AAAA,EAAA;AAEf,CAAC,GAEKC,KAAeN,EAAYI,EAAOC,EAAY,YAAY,GAAG,cAAc,GAC3EE,KAAUP,EAAYI,EAAOC,EAAY,OAAO,GAAG,SAAS,GAC5DG,KAAQR,EAAYI,EAAOC,EAAY,KAAK,GAAG,OAAO,GACtDI,KAAUT,EAAYI,EAAOC,EAAY,OAAO,GAAG,SAAS,GAC5DK,IAAOV,EAAYI,EAAOC,EAAY,IAAI,GAAG,MAAM,GACnDM,KAAWX,EAAYI,EAAOC,EAAY,QAAQ,GAAG,UAAU,GAC/DO,KAAaZ,EAAYI,EAAOC,EAAY,UAAU,GAAG,YAAY,GACrEQ,KAAUb,EAAYI,EAAOC,EAAY,OAAO,GAAG,SAAS,GA+B5DS,KAAiC,MACrC,gBAAAC,EAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAChE,UAAA;AAAA,EAAA,gBAAAC,EAAC,QAAA,EAAK,GAAE,OAAM,GAAE,KAAI,OAAM,MAAK,QAAO,MAAK,IAAG,OAAM,MAAK,SAAQ;AAAA,oBAChE,QAAA,EAAK,GAAE,OAAM,GAAE,KAAI,OAAM,MAAK,QAAO,MAAK,IAAG,OAAM,WAAWC,EAAI,EAAE,QAAQ,WAAA,CAAY,EAAA,CAAG;AAAA,GAC9F,GAGIC,KAA+B,MACnC,gBAAAH,EAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,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EAAQ,OAAOtB,EAASoB,CAAK,EAAE,SAAU,UAAAH,EAAA,CAAS;AAAA,gBAExE,UAAA,gBAAA5D,EAACN,KAAiC,MAAMiD,EAASoB,CAAK,GAAG,OAAAC,GACvD,4BAAC7D,GAAA,EAAgB,YAAAG,GAAwB,MAAMqC,EAASoB,CAAK,GAAG,YAAYR,EAAA,CAAU,KAD7EZ,EAASoB,CAAK,EAAE,KAE3B;AAAA,cAAA;AAAA,cANKpB,EAASoB,CAAK,EAAE;AAAA,YAAA;AAAA,UAOvB;AAAA,QAAA,EAEJ,CACF,IAEApB,EAAS,IAAI,CAAAvC,MACX,gBAAAJ;AAAA,UAAC2D;AAAA,UAAA;AAAA,YAEC,MAAM,CAAC,CAACvD,EAAK;AAAA,YACb,SAAS,CAAAwD,MAAY,gBAAA5D,EAACiE,KAAQ,OAAO7D,EAAK,SAAU,UAAAwD,GAAS;AAAA,YAE7D,UAAA,gBAAA5D,EAACN,GAAA,EAAsB,MAAAU,GACrB,UAAA,gBAAAJ,EAACG,GAAA,EAAgB,YAAAG,GAAwB,MAAAF,GAAY,YAAYmD,EAAA,CAAU,EAAA,GADlEnD,EAAK,KAEhB;AAAA,UAAA;AAAA,UANKA,EAAK;AAAA,QAAA,CAQb,EAAA,CAEL,EAAA,CACF,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"Combobox.js","names":[],"sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from 'lodash'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value'> & {\n value?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n ...props\n}: ComboboxProps<T>) => {\n const [items, setItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setItems(newItems)\n } catch (error) {\n console.error(error)\n setItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n const allItems = [...items, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (\n initialItems &&\n initialItems.length > 0 &&\n !initialItems.find((item: ComboboxItem) => item.label === details.inputValue)\n ) {\n onResetInitialItems?.()\n }\n const { inputValue } = details\n\n if (debouncedLoadItems) {\n debouncedLoadItems(inputValue)\n } else {\n const items =\n withAutoFilter && inputValue !== ''\n ? itemsFromUsers.filter((item: ComboboxItem) => item.label.toLowerCase().includes(inputValue.toLowerCase()))\n : itemsFromUsers\n\n if (items.length === 0 && returnItemsOnEmpty) {\n return setItems(itemsFromUsers)\n }\n setItems(items)\n }\n },\n [debouncedLoadItems, itemsFromUsers, withAutoFilter],\n )\n\n useEffect(() => {\n if (!withAutoFilter && !debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, withAutoFilter, debouncedLoadItems])\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Chargement...\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Aucun résultat\n </Text>\n )\n // TODO: const multiple = props.multiple\n // TODO: multiple design, using input chips https://ark-ui.com/reat/examples/combobox-with-tags-input\n const multiple = false\n\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n {...props}\n // TODO: multiple design\n multiple={multiple}\n >\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * allItems.length, 180)}\n itemCount={allItems.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={allItems[index].value}\n when={!!allItems[index].tooltip}\n wrapper={children => <Tooltip label={allItems[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={allItems[index].value} item={allItems[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={allItems[index]} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )}\n </Content>\n </Positioner>\n </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