@stokelp/ui 2.127.0 → 3.0.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/README.md +4 -4
- package/dist/_virtual/_rolldown/runtime.cjs +1 -1
- package/dist/_virtual/_rolldown/runtime.js +4 -5
- package/dist/components/accordion/Accordion.cjs +1 -1
- package/dist/components/accordion/Accordion.cjs.map +1 -1
- package/dist/components/accordion/Accordion.d.ts +1 -1
- package/dist/components/accordion/Accordion.js +1 -2
- package/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/action-card/ActionCard.cjs.map +1 -1
- package/dist/components/action-card/ActionCard.d.ts +1 -1
- package/dist/components/action-card/ActionCard.js +1 -2
- package/dist/components/action-card/ActionCard.js.map +1 -1
- package/dist/components/alert/Alert.cjs.map +1 -1
- package/dist/components/alert/Alert.d.ts +1 -1
- package/dist/components/alert/Alert.js +1 -2
- package/dist/components/alert/Alert.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardEntityRow.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardEntityRow.d.ts +1 -1
- package/dist/components/app/mobile-card/MobileCardEntityRow.js +1 -2
- package/dist/components/app/mobile-card/MobileCardEntityRow.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardHeader.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardHeader.d.ts +1 -1
- package/dist/components/app/mobile-card/MobileCardHeader.js +1 -2
- package/dist/components/app/mobile-card/MobileCardHeader.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.d.ts +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.js +2 -3
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardShell.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardShell.d.ts +1 -1
- package/dist/components/app/mobile-card/MobileCardShell.js +1 -2
- package/dist/components/app/mobile-card/MobileCardShell.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardSkeleton.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardSkeleton.d.ts +3 -3
- package/dist/components/app/mobile-card/MobileCardSkeleton.js +1 -2
- package/dist/components/app/mobile-card/MobileCardSkeleton.js.map +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.cjs +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.cjs.map +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.d.ts +2 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.js +2 -3
- package/dist/components/app/mobile-navigation/MobileNavigation.js.map +1 -1
- package/dist/components/app/navigation/AppNavigation.cjs +1 -1
- package/dist/components/app/navigation/AppNavigation.cjs.map +1 -1
- package/dist/components/app/navigation/AppNavigation.d.ts +2 -2
- package/dist/components/app/navigation/AppNavigation.js +3 -4
- package/dist/components/app/navigation/AppNavigation.js.map +1 -1
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs +1 -1
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs.map +1 -1
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js +5 -6
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js.map +1 -1
- package/dist/components/app/price-tag/PriceTag.cjs.map +1 -1
- package/dist/components/app/price-tag/PriceTag.d.ts +3 -5
- package/dist/components/app/price-tag/PriceTag.js +1 -2
- package/dist/components/app/price-tag/PriceTag.js.map +1 -1
- package/dist/components/app/product-card-catalog/styled.cjs +1 -1
- package/dist/components/app/product-card-catalog/styled.cjs.map +1 -1
- package/dist/components/app/product-card-catalog/styled.d.ts +1 -1
- package/dist/components/app/product-card-catalog/styled.js +2 -3
- package/dist/components/app/product-card-catalog/styled.js.map +1 -1
- package/dist/components/avatar/styled.cjs +1 -1
- package/dist/components/avatar/styled.cjs.map +1 -1
- package/dist/components/avatar/styled.d.ts +6 -10
- package/dist/components/avatar/styled.js +2 -3
- package/dist/components/avatar/styled.js.map +1 -1
- package/dist/components/box/Box.cjs +1 -1
- package/dist/components/box/Box.cjs.map +1 -1
- package/dist/components/box/Box.d.ts +1 -1
- package/dist/components/box/Box.js +3 -4
- package/dist/components/box/Box.js.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +1 -2
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/button/Button.cjs.map +1 -1
- package/dist/components/button/Button.js +1 -2
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button-filter/ButtonFilter.cjs.map +1 -1
- package/dist/components/button-filter/ButtonFilter.d.ts +5 -6
- package/dist/components/button-filter/ButtonFilter.js +1 -2
- package/dist/components/button-filter/ButtonFilter.js.map +1 -1
- package/dist/components/chat/Chat.cjs +1 -1
- package/dist/components/chat/Chat.cjs.map +1 -1
- package/dist/components/chat/Chat.d.ts +6 -10
- package/dist/components/chat/Chat.js +2 -3
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/ChatDocumentMessage.cjs +1 -1
- package/dist/components/chat/ChatDocumentMessage.cjs.map +1 -1
- package/dist/components/chat/ChatDocumentMessage.js +3 -4
- package/dist/components/chat/ChatDocumentMessage.js.map +1 -1
- package/dist/components/chat/ChatMessage.cjs.map +1 -1
- package/dist/components/chat/ChatMessage.d.ts +5 -8
- package/dist/components/chat/ChatMessage.js +1 -2
- package/dist/components/chat/ChatMessage.js.map +1 -1
- package/dist/components/chat/ChatProfileAvatar.cjs.map +1 -1
- package/dist/components/chat/ChatProfileAvatar.js +1 -2
- package/dist/components/chat/ChatProfileAvatar.js.map +1 -1
- package/dist/components/chat/ChatScoreBreakdown.cjs.map +1 -1
- package/dist/components/chat/ChatScoreBreakdown.d.ts +1 -1
- package/dist/components/chat/ChatScoreBreakdown.js +1 -2
- package/dist/components/chat/ChatScoreBreakdown.js.map +1 -1
- package/dist/components/chat/ChatTextInput.cjs.map +1 -1
- package/dist/components/chat/ChatTextInput.js +1 -2
- package/dist/components/chat/ChatTextInput.js.map +1 -1
- package/dist/components/checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/checkbox/Checkbox.js +1 -2
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/checkbox-card/CheckboxCard.cjs.map +1 -1
- package/dist/components/checkbox-card/CheckboxCard.js +1 -2
- package/dist/components/checkbox-card/CheckboxCard.js.map +1 -1
- package/dist/components/checkbox-card/namespace.cjs +1 -1
- package/dist/components/checkbox-card/namespace.cjs.map +1 -1
- package/dist/components/checkbox-card/namespace.js +2 -3
- package/dist/components/checkbox-card/namespace.js.map +1 -1
- package/dist/components/chip/Chip.cjs.map +1 -1
- package/dist/components/chip/Chip.d.ts +2 -2
- package/dist/components/chip/Chip.js +1 -2
- package/dist/components/chip/Chip.js.map +1 -1
- package/dist/components/collapsible/styled.cjs +1 -1
- package/dist/components/collapsible/styled.cjs.map +1 -1
- package/dist/components/collapsible/styled.d.ts +1 -1
- package/dist/components/collapsible/styled.js +2 -3
- package/dist/components/collapsible/styled.js.map +1 -1
- package/dist/components/combobox/Combobox.cjs +1 -1
- package/dist/components/combobox/Combobox.cjs.map +1 -1
- package/dist/components/combobox/Combobox.d.ts +4 -3
- package/dist/components/combobox/Combobox.js +66 -64
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/date-picker/DatePicker.cjs.map +1 -1
- package/dist/components/date-picker/DatePicker.js +1 -2
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/dialog/styled.cjs +1 -1
- package/dist/components/dialog/styled.cjs.map +1 -1
- package/dist/components/dialog/styled.d.ts +2 -2
- package/dist/components/dialog/styled.js +2 -3
- package/dist/components/dialog/styled.js.map +1 -1
- package/dist/components/drawer/Drawer.cjs.map +1 -1
- package/dist/components/drawer/Drawer.d.ts +2 -2
- package/dist/components/drawer/Drawer.js +1 -2
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/flag/styled.cjs.map +1 -1
- package/dist/components/flag/styled.d.ts +211 -213
- package/dist/components/flag/styled.js +1 -2
- package/dist/components/flag/styled.js.map +1 -1
- package/dist/components/form/FormControl.cjs +1 -1
- package/dist/components/form/FormControl.cjs.map +1 -1
- package/dist/components/form/FormControl.js +11 -7
- package/dist/components/form/FormControl.js.map +1 -1
- package/dist/components/form/FormHelperText.cjs.map +1 -1
- package/dist/components/form/FormHelperText.js +1 -2
- package/dist/components/form/FormHelperText.js.map +1 -1
- package/dist/components/form/FormLabel.cjs.map +1 -1
- package/dist/components/form/FormLabel.js +1 -2
- package/dist/components/form/FormLabel.js.map +1 -1
- package/dist/components/heading/Heading.cjs +1 -1
- package/dist/components/heading/Heading.cjs.map +1 -1
- package/dist/components/heading/Heading.d.ts +1 -1
- package/dist/components/heading/Heading.js +3 -4
- package/dist/components/heading/Heading.js.map +1 -1
- package/dist/components/icon/Icon.cjs.map +1 -1
- package/dist/components/icon/Icon.js +1 -2
- package/dist/components/icon/Icon.js.map +1 -1
- package/dist/components/icon-button/IconButton.cjs.map +1 -1
- package/dist/components/icon-button/IconButton.js +1 -2
- package/dist/components/icon-button/IconButton.js.map +1 -1
- package/dist/components/illustration/Illustration.cjs.map +1 -1
- package/dist/components/illustration/Illustration.js +1 -2
- package/dist/components/illustration/Illustration.js.map +1 -1
- package/dist/components/illustration/patterns.cjs.map +1 -1
- package/dist/components/illustration/patterns.js +1 -2
- package/dist/components/illustration/patterns.js.map +1 -1
- package/dist/components/input/HighlightedInput.cjs.map +1 -1
- package/dist/components/input/HighlightedInput.d.ts +4 -4
- package/dist/components/input/HighlightedInput.js +1 -2
- package/dist/components/input/HighlightedInput.js.map +1 -1
- package/dist/components/input/Input.cjs.map +1 -1
- package/dist/components/input/Input.js +1 -2
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input/InputAddon.cjs.map +1 -1
- package/dist/components/input/InputAddon.d.ts +5 -6
- package/dist/components/input/InputAddon.js +1 -2
- package/dist/components/input/InputAddon.js.map +1 -1
- package/dist/components/input/InputGroup.cjs.map +1 -1
- package/dist/components/input/InputGroup.js +1 -2
- package/dist/components/input/InputGroup.js.map +1 -1
- package/dist/components/input/PhoneNumberInput.cjs.map +1 -1
- package/dist/components/input/PhoneNumberInput.js +1 -2
- package/dist/components/input/PhoneNumberInput.js.map +1 -1
- package/dist/components/menu/Menu.cjs +1 -1
- package/dist/components/menu/Menu.cjs.map +1 -1
- package/dist/components/menu/Menu.d.ts +2 -2
- package/dist/components/menu/Menu.js +2 -3
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/origin-select/OriginSelect.cjs.map +1 -1
- package/dist/components/origin-select/OriginSelect.d.ts +1 -1
- package/dist/components/origin-select/OriginSelect.js +1 -2
- package/dist/components/origin-select/OriginSelect.js.map +1 -1
- package/dist/components/pagination/Pagination.cjs.map +1 -1
- package/dist/components/pagination/Pagination.d.ts +2 -2
- package/dist/components/pagination/Pagination.js +1 -2
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/pagination/use-pagination.cjs.map +1 -1
- package/dist/components/pagination/use-pagination.js +1 -2
- package/dist/components/pagination/use-pagination.js.map +1 -1
- package/dist/components/popover/Popover.cjs.map +1 -1
- package/dist/components/popover/Popover.d.ts +2 -2
- package/dist/components/popover/Popover.js +1 -2
- package/dist/components/popover/Popover.js.map +1 -1
- package/dist/components/radio-button-group/RadioButtonGroup.cjs.map +1 -1
- package/dist/components/radio-button-group/RadioButtonGroup.d.ts +1 -1
- package/dist/components/radio-button-group/RadioButtonGroup.js +1 -2
- package/dist/components/radio-button-group/RadioButtonGroup.js.map +1 -1
- package/dist/components/radio-card-group/RadioCardGroup.cjs.map +1 -1
- package/dist/components/radio-card-group/RadioCardGroup.d.ts +3 -3
- package/dist/components/radio-card-group/RadioCardGroup.js +1 -2
- package/dist/components/radio-card-group/RadioCardGroup.js.map +1 -1
- package/dist/components/radio-card-group/namespace.cjs +1 -1
- package/dist/components/radio-card-group/namespace.cjs.map +1 -1
- package/dist/components/radio-card-group/namespace.js +2 -3
- package/dist/components/radio-card-group/namespace.js.map +1 -1
- package/dist/components/radio-group/RadioGroup.cjs.map +1 -1
- package/dist/components/radio-group/RadioGroup.d.ts +1 -1
- package/dist/components/radio-group/RadioGroup.js +1 -2
- package/dist/components/radio-group/RadioGroup.js.map +1 -1
- package/dist/components/select/Select.cjs +1 -1
- package/dist/components/select/Select.cjs.map +1 -1
- package/dist/components/select/Select.d.ts +1 -1
- package/dist/components/select/Select.js +2 -7
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select-language/SelectLanguage.cjs +1 -1
- package/dist/components/select-language/SelectLanguage.cjs.map +1 -1
- package/dist/components/select-language/SelectLanguage.js +45 -43
- package/dist/components/select-language/SelectLanguage.js.map +1 -1
- package/dist/components/status-tag-select/StatusTagSelect.cjs +1 -1
- package/dist/components/status-tag-select/StatusTagSelect.cjs.map +1 -1
- package/dist/components/status-tag-select/StatusTagSelect.js +30 -31
- package/dist/components/status-tag-select/StatusTagSelect.js.map +1 -1
- package/dist/components/steps/Steps.cjs.map +1 -1
- package/dist/components/steps/Steps.d.ts +1 -1
- package/dist/components/steps/Steps.js +1 -2
- package/dist/components/steps/Steps.js.map +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBadge.cjs.map +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBadge.d.ts +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBadge.js +1 -2
- package/dist/components/supplier-rating-badge/SupplierRatingBadge.js.map +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs.map +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.d.ts +1 -1
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.js +53 -54
- package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.js.map +1 -1
- package/dist/components/supplier-rating-badge/labels.cjs.map +1 -1
- package/dist/components/supplier-rating-badge/labels.js +1 -2
- package/dist/components/supplier-rating-badge/labels.js.map +1 -1
- package/dist/components/switch/Switch.cjs.map +1 -1
- package/dist/components/switch/Switch.js +1 -2
- package/dist/components/switch/Switch.js.map +1 -1
- package/dist/components/switch-card/SwitchCard.cjs.map +1 -1
- package/dist/components/switch-card/SwitchCard.d.ts +4 -3
- package/dist/components/switch-card/SwitchCard.js +1 -2
- package/dist/components/switch-card/SwitchCard.js.map +1 -1
- package/dist/components/switch-card/namespace.cjs +1 -1
- package/dist/components/switch-card/namespace.cjs.map +1 -1
- package/dist/components/switch-card/namespace.js +2 -3
- package/dist/components/switch-card/namespace.js.map +1 -1
- package/dist/components/table/Table.cjs +1 -1
- package/dist/components/table/Table.cjs.map +1 -1
- package/dist/components/table/Table.js +3 -4
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/TableProvider.cjs.map +1 -1
- package/dist/components/table/TableProvider.js +1 -2
- package/dist/components/table/TableProvider.js.map +1 -1
- package/dist/components/tabs/Tabs.cjs.map +1 -1
- package/dist/components/tabs/Tabs.d.ts +5 -9
- package/dist/components/tabs/Tabs.js +1 -2
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tag/Tag.cjs.map +1 -1
- package/dist/components/tag/Tag.js +1 -2
- package/dist/components/tag/Tag.js.map +1 -1
- package/dist/components/text/Text.cjs +1 -1
- package/dist/components/text/Text.cjs.map +1 -1
- package/dist/components/text/Text.d.ts +1 -1
- package/dist/components/text/Text.js +3 -4
- package/dist/components/text/Text.js.map +1 -1
- package/dist/components/textarea/Textarea.cjs.map +1 -1
- package/dist/components/textarea/Textarea.d.ts +5 -6
- package/dist/components/textarea/Textarea.js +1 -2
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +2 -2
- package/dist/components/tooltip/Tooltip.js +1 -2
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/ui-labels/UiLabelsProvider.cjs.map +1 -1
- package/dist/components/ui-labels/UiLabelsProvider.js +1 -2
- package/dist/components/ui-labels/UiLabelsProvider.js.map +1 -1
- package/dist/icons/index.cjs.map +1 -1
- package/dist/icons/index.js +1 -2
- package/dist/icons/index.js.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +2 -0
- package/dist/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 → @heroicons}/react/24/outline/esm/ArrowDownTrayIcon.js +4 -5
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +2 -0
- package/dist/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 → @heroicons}/react/24/outline/esm/ArrowLeftCircleIcon.js +4 -5
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +2 -0
- package/dist/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 → @heroicons}/react/24/outline/esm/ChatBubbleLeftRightIcon.js +4 -5
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs +2 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs.map +1 -0
- package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons → @heroicons}/react/24/outline/esm/CheckCircleIcon.js +4 -5
- package/dist/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +2 -0
- package/dist/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 → @heroicons}/react/24/outline/esm/DocumentTextIcon.js +4 -5
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs +2 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs.map +1 -0
- package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons → @heroicons}/react/24/outline/esm/XCircleIcon.js +4 -5
- package/dist/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js.map +1 -0
- package/dist/node_modules/deepmerge/dist/cjs.cjs +2 -0
- package/dist/node_modules/deepmerge/dist/cjs.cjs.map +1 -0
- package/dist/node_modules/{.pnpm/deepmerge@4.3.1/node_modules/deepmerge → deepmerge}/dist/cjs.js +3 -4
- package/dist/node_modules/deepmerge/dist/cjs.js.map +1 -0
- package/dist/preset.cjs +1 -1
- package/dist/preset.cjs.map +1 -1
- package/dist/preset.js +7 -6
- package/dist/preset.js.map +1 -1
- package/dist/shared/ConditionalWrapper.cjs.map +1 -1
- package/dist/shared/ConditionalWrapper.js +1 -2
- package/dist/shared/ConditionalWrapper.js.map +1 -1
- package/dist/shared/assets/icons.cjs.map +1 -1
- package/dist/shared/assets/icons.d.ts +2 -2
- package/dist/shared/assets/icons.js +1 -2
- package/dist/shared/assets/icons.js.map +1 -1
- package/dist/shared/hooks/useUncontrolled.cjs.map +1 -1
- package/dist/shared/hooks/useUncontrolled.js +1 -2
- package/dist/shared/hooks/useUncontrolled.js.map +1 -1
- package/dist/shared/utils/events.cjs.map +1 -1
- package/dist/shared/utils/events.js +1 -2
- package/dist/shared/utils/events.js.map +1 -1
- package/dist/theme/breakpoints.cjs.map +1 -1
- package/dist/theme/breakpoints.js +1 -2
- package/dist/theme/breakpoints.js.map +1 -1
- package/dist/theme/conditions.cjs.map +1 -1
- package/dist/theme/conditions.js +1 -2
- package/dist/theme/conditions.js.map +1 -1
- package/dist/theme/containers.cjs +1 -1
- package/dist/theme/containers.cjs.map +1 -1
- package/dist/theme/containers.d.ts +1 -1
- package/dist/theme/containers.js +2 -3
- package/dist/theme/containers.js.map +1 -1
- package/dist/theme/globalCss.cjs.map +1 -1
- package/dist/theme/globalCss.d.ts +1 -1
- package/dist/theme/globalCss.js +1 -2
- package/dist/theme/globalCss.js.map +1 -1
- package/dist/theme/keyframes.cjs.map +1 -1
- package/dist/theme/keyframes.d.ts +1 -1
- package/dist/theme/keyframes.js +1 -2
- package/dist/theme/keyframes.js.map +1 -1
- package/dist/theme/recipes/accordion.cjs.map +1 -1
- package/dist/theme/recipes/accordion.d.ts +32 -2
- package/dist/theme/recipes/accordion.js +1 -2
- package/dist/theme/recipes/accordion.js.map +1 -1
- package/dist/theme/recipes/action-card.cjs.map +1 -1
- package/dist/theme/recipes/action-card.d.ts +2 -2
- package/dist/theme/recipes/action-card.js +1 -2
- package/dist/theme/recipes/action-card.js.map +1 -1
- package/dist/theme/recipes/alert.cjs.map +1 -1
- package/dist/theme/recipes/alert.d.ts +30 -2
- package/dist/theme/recipes/alert.js +1 -2
- package/dist/theme/recipes/alert.js.map +1 -1
- package/dist/theme/recipes/app/mobile-navigation.cjs.map +1 -1
- package/dist/theme/recipes/app/mobile-navigation.d.ts +51 -2
- package/dist/theme/recipes/app/mobile-navigation.js +1 -2
- package/dist/theme/recipes/app/mobile-navigation.js.map +1 -1
- package/dist/theme/recipes/app/navigation-language-select.cjs +1 -1
- package/dist/theme/recipes/app/navigation-language-select.cjs.map +1 -1
- package/dist/theme/recipes/app/navigation-language-select.d.ts +105 -2
- package/dist/theme/recipes/app/navigation-language-select.js +31 -39
- package/dist/theme/recipes/app/navigation-language-select.js.map +1 -1
- package/dist/theme/recipes/app/navigation.cjs.map +1 -1
- package/dist/theme/recipes/app/navigation.d.ts +125 -2
- package/dist/theme/recipes/app/navigation.js +1 -2
- package/dist/theme/recipes/app/navigation.js.map +1 -1
- package/dist/theme/recipes/app/price-tag.cjs.map +1 -1
- package/dist/theme/recipes/app/price-tag.d.ts +41 -2
- package/dist/theme/recipes/app/price-tag.js +1 -2
- package/dist/theme/recipes/app/price-tag.js.map +1 -1
- package/dist/theme/recipes/app/product-card-catalog.cjs.map +1 -1
- package/dist/theme/recipes/app/product-card-catalog.d.ts +2 -2
- package/dist/theme/recipes/app/product-card-catalog.js +1 -2
- package/dist/theme/recipes/app/product-card-catalog.js.map +1 -1
- package/dist/theme/recipes/avatar-group.cjs.map +1 -1
- package/dist/theme/recipes/avatar-group.d.ts +14 -2
- package/dist/theme/recipes/avatar-group.js +1 -2
- package/dist/theme/recipes/avatar-group.js.map +1 -1
- package/dist/theme/recipes/avatar.cjs.map +1 -1
- package/dist/theme/recipes/avatar.d.ts +53 -2
- package/dist/theme/recipes/avatar.js +1 -2
- package/dist/theme/recipes/avatar.js.map +1 -1
- package/dist/theme/recipes/breadcrumb.cjs.map +1 -1
- package/dist/theme/recipes/breadcrumb.d.ts +2 -2
- package/dist/theme/recipes/breadcrumb.js +1 -2
- package/dist/theme/recipes/breadcrumb.js.map +1 -1
- 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 +1 -2
- package/dist/theme/recipes/button-filter.js.map +1 -1
- package/dist/theme/recipes/button.cjs.map +1 -1
- package/dist/theme/recipes/button.d.ts +93 -2
- package/dist/theme/recipes/button.js +1 -2
- package/dist/theme/recipes/button.js.map +1 -1
- 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 +1 -2
- package/dist/theme/recipes/chat/chat-document-message.js.map +1 -1
- 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 +1 -2
- package/dist/theme/recipes/chat/chat-input-text.js.map +1 -1
- package/dist/theme/recipes/chat/chat-message.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-message.d.ts +28 -2
- package/dist/theme/recipes/chat/chat-message.js +1 -2
- package/dist/theme/recipes/chat/chat-message.js.map +1 -1
- package/dist/theme/recipes/chat/chat-profile-avatar.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-profile-avatar.d.ts +9 -2
- package/dist/theme/recipes/chat/chat-profile-avatar.js +1 -2
- package/dist/theme/recipes/chat/chat-profile-avatar.js.map +1 -1
- package/dist/theme/recipes/chat/chat.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat.d.ts +2 -2
- package/dist/theme/recipes/chat/chat.js +1 -2
- package/dist/theme/recipes/chat/chat.js.map +1 -1
- package/dist/theme/recipes/checkbox-card.cjs.map +1 -1
- package/dist/theme/recipes/checkbox-card.d.ts +1 -1
- package/dist/theme/recipes/checkbox-card.js +1 -2
- package/dist/theme/recipes/checkbox-card.js.map +1 -1
- 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 +1 -2
- package/dist/theme/recipes/checkbox-group.js.map +1 -1
- package/dist/theme/recipes/checkbox.cjs +1 -1
- package/dist/theme/recipes/checkbox.cjs.map +1 -1
- package/dist/theme/recipes/checkbox.d.ts +26 -2
- package/dist/theme/recipes/checkbox.js +7 -8
- package/dist/theme/recipes/checkbox.js.map +1 -1
- package/dist/theme/recipes/chip.cjs.map +1 -1
- package/dist/theme/recipes/chip.d.ts +148 -2
- package/dist/theme/recipes/chip.js +1 -2
- package/dist/theme/recipes/chip.js.map +1 -1
- package/dist/theme/recipes/collapsible.cjs.map +1 -1
- package/dist/theme/recipes/collapsible.d.ts +2 -2
- package/dist/theme/recipes/collapsible.js +1 -2
- package/dist/theme/recipes/collapsible.js.map +1 -1
- package/dist/theme/recipes/combobox.cjs +1 -1
- package/dist/theme/recipes/combobox.cjs.map +1 -1
- package/dist/theme/recipes/combobox.d.ts +33 -2
- package/dist/theme/recipes/combobox.js +6 -6
- package/dist/theme/recipes/combobox.js.map +1 -1
- package/dist/theme/recipes/common/group-card.cjs.map +1 -1
- package/dist/theme/recipes/common/group-card.d.ts +1 -1
- package/dist/theme/recipes/common/group-card.js +1 -2
- package/dist/theme/recipes/common/group-card.js.map +1 -1
- package/dist/theme/recipes/datepicker.cjs +1 -1
- package/dist/theme/recipes/datepicker.cjs.map +1 -1
- package/dist/theme/recipes/datepicker.d.ts +2 -2
- package/dist/theme/recipes/datepicker.js +6 -7
- package/dist/theme/recipes/datepicker.js.map +1 -1
- package/dist/theme/recipes/dialog.cjs.map +1 -1
- package/dist/theme/recipes/dialog.d.ts +2 -2
- package/dist/theme/recipes/dialog.js +1 -2
- package/dist/theme/recipes/dialog.js.map +1 -1
- package/dist/theme/recipes/drawer.cjs.map +1 -1
- package/dist/theme/recipes/drawer.d.ts +31 -2
- package/dist/theme/recipes/drawer.js +4 -4
- package/dist/theme/recipes/drawer.js.map +1 -1
- package/dist/theme/recipes/flag.cjs.map +1 -1
- package/dist/theme/recipes/flag.d.ts +15 -2
- package/dist/theme/recipes/flag.js +1 -2
- package/dist/theme/recipes/flag.js.map +1 -1
- 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 +1 -2
- package/dist/theme/recipes/form/control.js.map +1 -1
- 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 +1 -2
- package/dist/theme/recipes/form/helper-text.js.map +1 -1
- package/dist/theme/recipes/form/label.cjs.map +1 -1
- package/dist/theme/recipes/form/label.d.ts +15 -2
- package/dist/theme/recipes/form/label.js +1 -2
- package/dist/theme/recipes/form/label.js.map +1 -1
- package/dist/theme/recipes/heading.cjs.map +1 -1
- package/dist/theme/recipes/heading.d.ts +33 -2
- package/dist/theme/recipes/heading.js +1 -2
- package/dist/theme/recipes/heading.js.map +1 -1
- package/dist/theme/recipes/highlightedInput.cjs.map +1 -1
- package/dist/theme/recipes/highlightedInput.d.ts +2 -2
- package/dist/theme/recipes/highlightedInput.js +1 -2
- package/dist/theme/recipes/highlightedInput.js.map +1 -1
- package/dist/theme/recipes/icon-button.cjs +1 -1
- package/dist/theme/recipes/icon-button.cjs.map +1 -1
- package/dist/theme/recipes/icon-button.d.ts +1 -1
- package/dist/theme/recipes/icon-button.js +1 -2
- package/dist/theme/recipes/icon-button.js.map +1 -1
- package/dist/theme/recipes/icon.cjs.map +1 -1
- package/dist/theme/recipes/icon.d.ts +25 -2
- package/dist/theme/recipes/icon.js +1 -2
- package/dist/theme/recipes/icon.js.map +1 -1
- package/dist/theme/recipes/illustration.cjs.map +1 -1
- package/dist/theme/recipes/illustration.d.ts +29 -2
- package/dist/theme/recipes/illustration.js +1 -2
- package/dist/theme/recipes/illustration.js.map +1 -1
- package/dist/theme/recipes/index.cjs +1 -1
- package/dist/theme/recipes/index.cjs.map +1 -1
- package/dist/theme/recipes/index.d.ts +1464 -49
- package/dist/theme/recipes/index.js +3 -4
- package/dist/theme/recipes/index.js.map +1 -1
- 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 +1 -2
- package/dist/theme/recipes/input-addon.js.map +1 -1
- 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 +1 -2
- package/dist/theme/recipes/input-group.js.map +1 -1
- package/dist/theme/recipes/input.cjs +1 -1
- package/dist/theme/recipes/input.cjs.map +1 -1
- package/dist/theme/recipes/input.d.ts +9 -2
- package/dist/theme/recipes/input.js +5 -6
- package/dist/theme/recipes/input.js.map +1 -1
- package/dist/theme/recipes/menu.cjs.map +1 -1
- package/dist/theme/recipes/menu.d.ts +20 -2
- package/dist/theme/recipes/menu.js +1 -2
- package/dist/theme/recipes/menu.js.map +1 -1
- package/dist/theme/recipes/pagination.cjs +1 -1
- package/dist/theme/recipes/pagination.cjs.map +1 -1
- package/dist/theme/recipes/pagination.d.ts +2 -2
- package/dist/theme/recipes/pagination.js +3 -4
- package/dist/theme/recipes/pagination.js.map +1 -1
- package/dist/theme/recipes/phone-number-input.cjs.map +1 -1
- package/dist/theme/recipes/phone-number-input.d.ts +9 -2
- package/dist/theme/recipes/phone-number-input.js +1 -2
- package/dist/theme/recipes/phone-number-input.js.map +1 -1
- package/dist/theme/recipes/popover.cjs.map +1 -1
- package/dist/theme/recipes/popover.d.ts +2 -2
- package/dist/theme/recipes/popover.js +1 -2
- package/dist/theme/recipes/popover.js.map +1 -1
- package/dist/theme/recipes/radio-button-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-button-group.d.ts +25 -2
- package/dist/theme/recipes/radio-button-group.js +1 -2
- package/dist/theme/recipes/radio-button-group.js.map +1 -1
- package/dist/theme/recipes/radio-card-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-card-group.d.ts +36 -2
- package/dist/theme/recipes/radio-card-group.js +1 -2
- package/dist/theme/recipes/radio-card-group.js.map +1 -1
- package/dist/theme/recipes/radio-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-group.d.ts +27 -2
- package/dist/theme/recipes/radio-group.js +1 -2
- package/dist/theme/recipes/radio-group.js.map +1 -1
- package/dist/theme/recipes/select-language.cjs.map +1 -1
- package/dist/theme/recipes/select-language.d.ts +15 -2
- package/dist/theme/recipes/select-language.js +1 -2
- package/dist/theme/recipes/select-language.js.map +1 -1
- package/dist/theme/recipes/select.cjs +1 -1
- package/dist/theme/recipes/select.cjs.map +1 -1
- package/dist/theme/recipes/select.d.ts +30 -2
- package/dist/theme/recipes/select.js +3 -18
- package/dist/theme/recipes/select.js.map +1 -1
- package/dist/theme/recipes/status-tag-select.cjs.map +1 -1
- package/dist/theme/recipes/status-tag-select.d.ts +125 -2
- package/dist/theme/recipes/status-tag-select.js +1 -2
- package/dist/theme/recipes/status-tag-select.js.map +1 -1
- package/dist/theme/recipes/steps.cjs.map +1 -1
- package/dist/theme/recipes/steps.d.ts +2 -2
- package/dist/theme/recipes/steps.js +1 -2
- package/dist/theme/recipes/steps.js.map +1 -1
- package/dist/theme/recipes/switch-card.cjs.map +1 -1
- package/dist/theme/recipes/switch-card.d.ts +1 -1
- package/dist/theme/recipes/switch-card.js +1 -2
- package/dist/theme/recipes/switch-card.js.map +1 -1
- package/dist/theme/recipes/switch.cjs.map +1 -1
- package/dist/theme/recipes/switch.d.ts +22 -2
- package/dist/theme/recipes/switch.js +1 -2
- package/dist/theme/recipes/switch.js.map +1 -1
- 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 +1 -2
- package/dist/theme/recipes/table-container.js.map +1 -1
- 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 +1 -2
- package/dist/theme/recipes/table-empty-row.js.map +1 -1
- package/dist/theme/recipes/table-group-title.cjs.map +1 -1
- package/dist/theme/recipes/table-group-title.d.ts +15 -2
- package/dist/theme/recipes/table-group-title.js +1 -2
- package/dist/theme/recipes/table-group-title.js.map +1 -1
- package/dist/theme/recipes/table.cjs.map +1 -1
- package/dist/theme/recipes/table.d.ts +2 -2
- package/dist/theme/recipes/table.js +1 -2
- package/dist/theme/recipes/table.js.map +1 -1
- package/dist/theme/recipes/tabs-chip.cjs.map +1 -1
- package/dist/theme/recipes/tabs-chip.d.ts +29 -2
- package/dist/theme/recipes/tabs-chip.js +1 -2
- package/dist/theme/recipes/tabs-chip.js.map +1 -1
- package/dist/theme/recipes/tabs.cjs.map +1 -1
- package/dist/theme/recipes/tabs.d.ts +49 -2
- package/dist/theme/recipes/tabs.js +1 -2
- package/dist/theme/recipes/tabs.js.map +1 -1
- package/dist/theme/recipes/tag.cjs.map +1 -1
- package/dist/theme/recipes/tag.d.ts +109 -2
- package/dist/theme/recipes/tag.js +1 -2
- package/dist/theme/recipes/tag.js.map +1 -1
- package/dist/theme/recipes/text.cjs.map +1 -1
- package/dist/theme/recipes/text.d.ts +29 -2
- package/dist/theme/recipes/text.js +1 -2
- package/dist/theme/recipes/text.js.map +1 -1
- package/dist/theme/recipes/textarea.cjs.map +1 -1
- package/dist/theme/recipes/textarea.d.ts +1 -1
- package/dist/theme/recipes/textarea.js +1 -2
- package/dist/theme/recipes/textarea.js.map +1 -1
- package/dist/theme/recipes/tooltip.cjs.map +1 -1
- package/dist/theme/recipes/tooltip.d.ts +2 -2
- package/dist/theme/recipes/tooltip.js +1 -2
- package/dist/theme/recipes/tooltip.js.map +1 -1
- package/dist/theme/semantic-tokens/colors.cjs.map +1 -1
- package/dist/theme/semantic-tokens/colors.js +1 -2
- package/dist/theme/semantic-tokens/colors.js.map +1 -1
- package/dist/theme/semantic-tokens/gradients.cjs.map +1 -1
- package/dist/theme/semantic-tokens/gradients.js +1 -2
- package/dist/theme/semantic-tokens/gradients.js.map +1 -1
- package/dist/theme/semantic-tokens/index.cjs.map +1 -1
- package/dist/theme/semantic-tokens/index.js +1 -2
- package/dist/theme/semantic-tokens/index.js.map +1 -1
- package/dist/theme/text-styles.cjs.map +1 -1
- package/dist/theme/text-styles.d.ts +1 -1
- package/dist/theme/text-styles.js +1 -2
- package/dist/theme/text-styles.js.map +1 -1
- package/dist/theme/tokens/animations.cjs.map +1 -1
- package/dist/theme/tokens/animations.js +1 -2
- package/dist/theme/tokens/animations.js.map +1 -1
- package/dist/theme/tokens/aspect-ratios.cjs.map +1 -1
- package/dist/theme/tokens/aspect-ratios.js +1 -2
- package/dist/theme/tokens/aspect-ratios.js.map +1 -1
- package/dist/theme/tokens/blurs.cjs.map +1 -1
- package/dist/theme/tokens/blurs.js +1 -2
- package/dist/theme/tokens/blurs.js.map +1 -1
- package/dist/theme/tokens/borders.cjs.map +1 -1
- package/dist/theme/tokens/borders.js +1 -2
- package/dist/theme/tokens/borders.js.map +1 -1
- package/dist/theme/tokens/colors.cjs.map +1 -1
- package/dist/theme/tokens/colors.js +1 -2
- package/dist/theme/tokens/colors.js.map +1 -1
- package/dist/theme/tokens/durations.cjs.map +1 -1
- package/dist/theme/tokens/durations.js +1 -2
- package/dist/theme/tokens/durations.js.map +1 -1
- package/dist/theme/tokens/easings.cjs.map +1 -1
- package/dist/theme/tokens/easings.js +1 -2
- package/dist/theme/tokens/easings.js.map +1 -1
- package/dist/theme/tokens/index.cjs.map +1 -1
- package/dist/theme/tokens/index.js +1 -2
- package/dist/theme/tokens/index.js.map +1 -1
- package/dist/theme/tokens/radii.cjs.map +1 -1
- package/dist/theme/tokens/radii.js +1 -2
- package/dist/theme/tokens/radii.js.map +1 -1
- package/dist/theme/tokens/shadows.cjs.map +1 -1
- package/dist/theme/tokens/shadows.js +1 -2
- package/dist/theme/tokens/shadows.js.map +1 -1
- package/dist/theme/tokens/sizes.cjs.map +1 -1
- package/dist/theme/tokens/sizes.js +1 -2
- package/dist/theme/tokens/sizes.js.map +1 -1
- package/dist/theme/tokens/spacing.cjs.map +1 -1
- package/dist/theme/tokens/spacing.js +1 -2
- package/dist/theme/tokens/spacing.js.map +1 -1
- package/dist/theme/tokens/typography.cjs.map +1 -1
- package/dist/theme/tokens/typography.js +1 -2
- package/dist/theme/tokens/typography.js.map +1 -1
- package/dist/theme/tokens/z-index.cjs.map +1 -1
- package/dist/theme/tokens/z-index.js +1 -2
- package/dist/theme/tokens/z-index.js.map +1 -1
- package/dist/theme/utilities.cjs.map +1 -1
- package/dist/theme/utilities.js +0 -1
- package/dist/theme/utilities.js.map +1 -1
- package/dist/ui.css +1 -1
- package/dist/utils/slots.cjs +1 -1
- package/dist/utils/slots.cjs.map +1 -1
- package/dist/utils/slots.js +3 -4
- package/dist/utils/slots.js.map +1 -1
- package/package.json +14 -15
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +0 -2
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +0 -2
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +0 -2
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs +0 -2
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +0 -2
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs +0 -2
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs.map +0 -1
- package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js.map +0 -1
- package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs +0 -2
- package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs.map +0 -1
- package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require("../../utils/slots.cjs"),t=require("../tooltip/Tooltip.cjs"),n=require("../text/Text.cjs"),r=require("../../shared/ConditionalWrapper.cjs"),i=require("../ui-labels/UiLabelsProvider.cjs"),a=require("../input/Input.cjs"),o=require("../chip/Chip.cjs");let s=require("@ark-ui/react"),c=require("@stokelp/styled-system/jsx"),l=require("@stokelp/styled-system/recipes"),u=require("react"),d=require("react/jsx-runtime"),f=require("@stokelp/styled-system/css"),p=require("react-window"),m=require("
|
|
1
|
+
"use client";const e=require("../../utils/slots.cjs"),t=require("../tooltip/Tooltip.cjs"),n=require("../text/Text.cjs"),r=require("../../shared/ConditionalWrapper.cjs"),i=require("../ui-labels/UiLabelsProvider.cjs"),a=require("../input/Input.cjs"),o=require("../chip/Chip.cjs");let s=require("@ark-ui/react"),c=require("@stokelp/styled-system/jsx"),l=require("@stokelp/styled-system/recipes"),u=require("react"),d=require("react/jsx-runtime"),f=require("@stokelp/styled-system/css"),p=require("react-window"),m=require("@zag-js/utils");var{withProvider:h,withContext:g}=e.createStyleContext(l.combobox),_=h((0,c.styled)(s.Combobox.Root),`root`,{defaultProps:{loopFocus:!0}}),v=g((0,c.styled)(s.Combobox.ClearTrigger),`clearTrigger`),y=g((0,c.styled)(s.Combobox.Content),`content`),b=g((0,c.styled)(s.Combobox.Input),`input`),x=g((0,c.styled)(s.Combobox.Control),`control`),S=g((0,c.styled)(s.Combobox.Item),`item`),C=g((0,c.styled)(s.Combobox.ItemText),`itemText`),w=g((0,c.styled)(s.Combobox.Positioner),`positioner`),T=g((0,c.styled)(s.Combobox.Trigger),`trigger`),E=()=>(0,d.jsxs)(`svg`,{width:`16`,height:`17`,viewBox:`0 0 16 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,d.jsx)(`rect`,{x:`0.5`,y:`1`,width:`15`,height:`15`,rx:`3.5`,fill:`white`}),(0,d.jsx)(`rect`,{x:`0.5`,y:`1`,width:`15`,height:`15`,rx:`3.5`,className:(0,f.css)({stroke:`grey.100`})})]}),D=()=>(0,d.jsxs)(`svg`,{width:`16`,height:`17`,viewBox:`0 0 16 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,d.jsx)(`rect`,{y:`0.5`,width:`16`,height:`16`,rx:`4`,className:(0,f.css)({fill:`primary.500`})}),(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,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`,fill:`white`})]});function O({item:e,isMultiple:t,renderItem:n}){let r=(0,s.useComboboxItemContext)();return(0,d.jsxs)(d.Fragment,{children:[t?r.selected?(0,d.jsx)(D,{}):(0,d.jsx)(E,{}):null,n?n(e):(0,d.jsx)(C,{truncate:!0,children:e.label})]})}var k=({items:e=[],initialItems:c,debounceMs:l=0,placeholder:f,emptyLabel:h,loadingLabel:g,usePortal:C=!0,withAutoFilter:E=!0,positioning:D,loadItems:k,renderItem:A,renderValue:j,onResetInitialItems:M,isLoading:N,value:P,defaultValue:F,openDropdownOnFocus:I=!0,clearValueWhenEmpty:ee=!0,virtualized:te,rowHeight:L=34,returnItemsOnEmpty:R,multiple:z=!1,...B})=>{let V=i.useUiLabels(),[H,U]=(0,u.useState)(()=>e),[W,G]=(0,u.useState)(!1),[K,q]=(0,u.useState)(!1),J=typeof k==`function`,Y=(0,u.useMemo)(()=>k?(0,m.debounce)(async e=>{try{q(!0),G(!0);let t=await k(e);U(t)}catch(e){console.error(e),U([])}finally{G(!1)}},l):null,[k,l]),X=[...!J&&!E?e:H,...c??[]],Z=(0,u.useCallback)(async t=>{c&&c.length>0&&!c.find(e=>e.label===t.inputValue)&&M?.();let{inputValue:n}=t;if(Y)Y(n);else{let t=E&&n!==``?e.filter(e=>e.label.toLowerCase().includes(n.toLowerCase())):e;if(t.length===0&&R)return U(e);U(t)}},[Y,e,E]);(0,u.useEffect)(()=>{Y||U(e)},[e,Y]);let ne=(0,u.useMemo)(()=>(0,s.createListCollection)({items:X}),[X]),re=N??W,Q=g??(0,d.jsx)(n.Text,{p:`space-8`,textAlign:`center`,children:V.loading}),$=h??(0,d.jsx)(n.Text,{p:`space-8`,textAlign:`center`,children:V.noResults});return(0,d.jsxs)(_,{lazyMount:!0,unmountOnExit:!0,collection:ne,positioning:{sameWidth:!0,gutter:0,...D},"data-recipe":`combobox`,onInputValueChange:Z,value:P,defaultValue:F,...B,multiple:z,children:[z?(0,d.jsx)(s.Combobox.Context,{children:t=>(0,d.jsxs)(x,{"data-multiple":`true`,"data-open":t.open||void 0,children:[t.value.map(n=>{let r=e.find(e=>String(e.value)===String(n));return r?(0,d.jsxs)(o.Chip,{size:`sm`,children:[j?j(r):(0,d.jsx)(o.ChipLabel,{children:r.label}),!B.readOnly&&!B.disabled&&(0,d.jsx)(o.ChipClearTrigger,{"aria-label":`Retirer ${r.label}`,onClick:()=>t.setValue(t.value.filter(e=>String(e)!==String(n)))})]},n):null}),(0,d.jsx)(b,{asChild:!0,"data-multiple":`true`,placeholder:t.hasSelectedItems?void 0:f,onFocus:()=>{I&&!J&&t.setOpen(!0)},children:(0,d.jsx)(a.Input,{})}),(0,d.jsx)(T,{asChild:!0,hidden:J&&(!c||c.length===0),children:(0,d.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,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`,fill:`currentColor`})})})]})}):(0,d.jsxs)(x,{children:[(0,d.jsx)(s.Combobox.Context,{children:e=>(0,d.jsx)(b,{asChild:!0,placeholder:f,onInput:t=>{let n=t.currentTarget.value;ee&&n===``&&e.clearValue()},onFocus:()=>{I&&!J&&e.setOpen(!0)},children:(0,d.jsx)(a.Input,{})})}),(0,d.jsx)(T,{asChild:!0,hidden:J&&(!c||c.length===0),children:(0,d.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,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`,fill:`currentColor`})})}),(0,d.jsx)(v,{disabled:B.readOnly,onClick:M,asChild:!0,children:(0,d.jsx)(`button`,{children:(0,d.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,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`,fill:`currentColor`})})})})]}),(0,d.jsx)(r.ConditionalWrapper,{when:C,wrapper:e=>(0,d.jsx)(s.Portal,{children:e}),children:(0,d.jsx)(w,{children:(0,d.jsx)(y,{children:re?Q:X.length===0?(0,d.jsx)(d.Fragment,{children:J?K?$:Q:$}):te?(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(p.FixedSizeList,{height:Math.min(L*X.length,180),itemCount:X.length,itemSize:L,width:`100%`,children:({index:e,style:n})=>(0,d.jsx)(r.ConditionalWrapper,{when:!!X[e].tooltip,wrapper:n=>(0,d.jsx)(t.Tooltip,{label:X[e].tooltip,children:n}),children:(0,d.jsx)(S,{item:X[e],style:n,children:(0,d.jsx)(O,{renderItem:A,item:X[e],isMultiple:z})},X[e].value)},X[e].value)})}):X.map(e=>(0,d.jsx)(r.ConditionalWrapper,{when:!!e.tooltip,wrapper:n=>(0,d.jsx)(t.Tooltip,{label:e.tooltip,children:n}),children:(0,d.jsx)(S,{item:e,children:(0,d.jsx)(O,{renderItem:A,item:e,isMultiple:z})},e.value)},e.value))})})})]})};exports.Combobox=k;
|
|
2
2
|
//# sourceMappingURL=Combobox.cjs.map
|
|
@@ -1 +1 @@
|
|
|
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 { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport { Chip, ChipClearTrigger, ChipLabel } from '~/components/chip'\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 /**\n * Renders the inner content of each selected chip in `multiple` mode.\n * Receives the selected item and should return the chip body (the removable\n * clear button is appended automatically). Defaults to the item label.\n */\n renderValue?: (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 renderValue,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n multiple = false,\n ...props\n}: ComboboxProps<T>) => {\n const uiLabels = useUiLabels()\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 // A sync, unfiltered list has nothing to derive: read the prop itself. The mirrored\n // `items` state only catches up in an effect, one render late, and zag re-derives the\n // input text from the collection the moment `value` changes: a value set in the same\n // render as the item that carries it was stringified against a list without it, and\n // the input went blank.\n const sourceItems = !asyncMode && !withAutoFilter ? itemsFromUsers : items\n const allItems = [...sourceItems, ...(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 // Keep the visible items in sync with the source list whenever it changes\n // (e.g. options that load asynchronously after mount). Without this, an empty\n // input shows a stale/empty list (the no-results label) until the user types.\n // Consumers memoize `items`, so this only fires on real data changes, not on\n // every keystroke.\n useEffect(() => {\n if (!debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, 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 {uiLabels.loading}\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.noResults}\n </Text>\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 multiple={multiple}\n >\n {multiple ? (\n // Tags-input layout: the control (styled via the recipe's `&[data-multiple]`\n // selectors) is the bordered box holding the selected chips and a\n // borderless growing input.\n <ArkCombobox.Context>\n {api => (\n <Control data-multiple=\"true\" data-open={api.open || undefined}>\n {/* Resolve chips from the current value against the full source\n list rather than ark's cached `selectedItems`: the cache is only\n re-derived on value changes, so async-loaded defaults would show\n 0 chips until the user selects something. Looking up in\n itemsFromUsers (never the filtered list) also keeps chips visible\n while the user is typing to filter. */}\n {api.value.map(v => {\n const item = itemsFromUsers.find((i: T) => String(i.value) === String(v))\n if (!item) return null\n return (\n <Chip key={v} size=\"sm\">\n {renderValue ? renderValue(item) : <ChipLabel>{item.label}</ChipLabel>}\n {!props.readOnly && !props.disabled && (\n <ChipClearTrigger\n aria-label={`Retirer ${item.label}`}\n // Remove by strict-equality-safe filter: stored values may\n // be numbers while item.value is compared as a string.\n onClick={() => api.setValue(api.value.filter(x => String(x) !== String(v)))}\n />\n )}\n </Chip>\n )\n })}\n <Input\n asChild\n data-multiple=\"true\"\n placeholder={api.hasSelectedItems ? undefined : placeholder}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\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 </Control>\n )}\n </ArkCombobox.Context>\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 )}\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":"ihBAwBA,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,EAAA,EAAA,QAAmB,EAAA,SAAY,YAAY,EAAG,cAAc,EAC3E,EAAU,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,OAAO,EAAG,SAAS,EAC5D,EAAQ,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,KAAK,EAAG,OAAO,EACtD,EAAU,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,OAAO,EAAG,SAAS,EAC5D,EAAO,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,IAAI,EAAG,MAAM,EACnD,EAAW,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,QAAQ,EAAG,UAAU,EAC/D,GAAa,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,UAAU,EAAG,YAAY,EACrE,EAAU,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,O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,KAAC,EAAD,CAA6B,iBAC3B,EAAA,EAAA,KAAC,EAAD,CAA6B,aAAkB,OAAM,WAAY,CAAW,CAAA,CACxE,EAFK,EAAK,KAEV,CACY,EAPb,EAAK,KAOQ,CACrB,CAEI,CAAA,CACC,CAAA,CACM,CAAA,CAChB,GAEV"}
|
|
1
|
+
{"version":3,"file":"Combobox.cjs","names":["createStyleContext","combobox","styled","ArkCombobox","css","useComboboxItemContext","_Fragment","useUiLabels","useState","useMemo","debounce","useCallback","createListCollection","Text","Chip","ChipLabel","ChipClearTrigger","UIInput","ConditionalWrapper","Portal","FixedSizeList","Tooltip","require_slots","require_Tooltip","require_Text","require_ConditionalWrapper","require_UiLabelsProvider","require_Input","require_Chip","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react","react_jsx_runtime","_stokelp_styled_system_css","react_window","_zag_js_utils","Root","withProvider","ClearTrigger","withContext","Content","Input","Control","Item","ItemText","Positioner","Trigger","MultipleUncheckedIndicator","MultipleCheckedIndicator","CustomInnerItem","context","isMultiple","renderItem","item","Combobox","itemsFromUsers","controlledIsLoading","props","uiLabels","items","setItems","isLoading","setIsLoading","firstQueryTriggered","setFirstQueryTriggered","asyncMode","loadItems","debouncedLoadItems","newItems","value","error","debounceMs","allItems","withAutoFilter","initialItems","handleInputChange","details","onResetInitialItems","inputValue","returnItemsOnEmpty","collection","effectiveIsLoading","loadingContent","loadingLabel","emptyContent","emptyLabel","positioning","multiple","api","i","v","renderValue","x","placeholder","openDropdownOnFocus","e","clearValueWhenEmpty","usePortal","virtualized","rowHeight","index"],"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 '@zag-js/utils'\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 { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport { Chip, ChipClearTrigger, ChipLabel } from '~/components/chip'\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<\n ComboboxRootProps<T>,\n 'collection' | 'value' | 'defaultValue'\n> & {\n // Item values may be numbers: the chips compare them as strings.\n value?: Array<string | number>\n defaultValue?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n /**\n * Renders the inner content of each selected chip in `multiple` mode.\n * Receives the selected item and should return the chip body (the removable\n * clear button is appended automatically). Defaults to the item label.\n */\n renderValue?: (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} & Omit<HTMLStyledProps<'div'>, 'defaultValue'> &\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 renderValue,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n defaultValue,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n multiple = false,\n ...props\n}: ComboboxProps<T>) => {\n const uiLabels = useUiLabels()\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 // A sync, unfiltered list has nothing to derive: read the prop itself. The mirrored\n // `items` state only catches up in an effect, one render late, and zag re-derives the\n // input text from the collection the moment `value` changes: a value set in the same\n // render as the item that carries it was stringified against a list without it, and\n // the input went blank.\n const sourceItems = !asyncMode && !withAutoFilter ? itemsFromUsers : items\n const allItems = [...sourceItems, ...(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 // Keep the visible items in sync with the source list whenever it changes\n // (e.g. options that load asynchronously after mount). Without this, an empty\n // input shows a stale/empty list (the no-results label) until the user types.\n // Consumers memoize `items`, so this only fires on real data changes, not on\n // every keystroke.\n useEffect(() => {\n if (!debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, 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 {uiLabels.loading}\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.noResults}\n </Text>\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 defaultValue={defaultValue as string[] | undefined}\n {...props}\n multiple={multiple}\n >\n {multiple ? (\n // Tags-input layout: the control (styled via the recipe's `&[data-multiple]`\n // selectors) is the bordered box holding the selected chips and a\n // borderless growing input.\n <ArkCombobox.Context>\n {api => (\n <Control data-multiple=\"true\" data-open={api.open || undefined}>\n {/* Resolve chips from the current value against the full source\n list rather than ark's cached `selectedItems`: the cache is only\n re-derived on value changes, so async-loaded defaults would show\n 0 chips until the user selects something. Looking up in\n itemsFromUsers (never the filtered list) also keeps chips visible\n while the user is typing to filter. */}\n {api.value.map(v => {\n const item = itemsFromUsers.find((i: T) => String(i.value) === String(v))\n if (!item) return null\n return (\n <Chip key={v} size=\"sm\">\n {renderValue ? renderValue(item) : <ChipLabel>{item.label}</ChipLabel>}\n {!props.readOnly && !props.disabled && (\n <ChipClearTrigger\n aria-label={`Retirer ${item.label}`}\n // Remove by strict-equality-safe filter: stored values may\n // be numbers while item.value is compared as a string.\n onClick={() => api.setValue(api.value.filter(x => String(x) !== String(v)))}\n />\n )}\n </Chip>\n )\n })}\n <Input\n asChild\n data-multiple=\"true\"\n placeholder={api.hasSelectedItems ? undefined : placeholder}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\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 </Control>\n )}\n </ArkCombobox.Context>\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 )}\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":"A,whBAwBA,GAAM,CAAE,eAAc,eAAgBA,EAAAA,mBAAmBC,EAAAA,QAAQ,EAG3DoC,EAAOC,GAAA,EAAapC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,IAAS,EAAG,OAAQ,CAC/D,aAAc,CACZ,UAAW,EACb,CACF,CAAC,EAEKoC,EAAeC,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,YAAY,EAAG,cAAc,EAC3EsC,EAAUD,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,OAAO,EAAG,SAAS,EAC5DuC,EAAQF,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,KAAK,EAAG,OAAO,EACtDwC,EAAUH,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,OAAO,EAAG,S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ACZ,EAAAA,QAAD,CAAS,MAAOiC,EAAK,QAAU,UAAkB,CAAA,EAEtE,UAAA,EAAArB,EAAA,IAAA,CAACW,EAAD,CAA6B,OAC3B,UAAA,EAAAX,EAAA,IAAA,CAACiB,EAAD,CAA6B,aAAkB,OAAM,WAAYsC,CAAW,CAAA,CACxE,EAFKlC,EAAK,KAEV,CACY,EAPbA,EAAK,KAOQ,CACrB,CAEI,CAAA,CACC,CAAA,CACM,CAAA,CAChB,C,EAEV,E"}
|
|
@@ -8,8 +8,9 @@ export type ComboboxItem = {
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
tooltip?: ReactNode;
|
|
10
10
|
};
|
|
11
|
-
export type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value'> & {
|
|
11
|
+
export type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value' | 'defaultValue'> & {
|
|
12
12
|
value?: Array<string | number>;
|
|
13
|
+
defaultValue?: Array<string | number>;
|
|
13
14
|
items?: T[];
|
|
14
15
|
initialItems?: T[];
|
|
15
16
|
renderItem?: (item: T) => ReactNode;
|
|
@@ -33,5 +34,5 @@ export type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, '
|
|
|
33
34
|
virtualized?: boolean;
|
|
34
35
|
rowHeight?: number;
|
|
35
36
|
returnItemsOnEmpty?: boolean;
|
|
36
|
-
} & HTMLStyledProps<'div'> & RecipeVariantProps<typeof combobox>;
|
|
37
|
-
export declare const Combobox: <T extends ComboboxItem>({ items: itemsFromUsers, initialItems, debounceMs, placeholder, emptyLabel, loadingLabel, usePortal, withAutoFilter, positioning, loadItems, renderItem, renderValue, onResetInitialItems, isLoading: controlledIsLoading, value, openDropdownOnFocus, clearValueWhenEmpty, virtualized, rowHeight, returnItemsOnEmpty, multiple, ...props }: ComboboxProps<T>) => import(
|
|
37
|
+
} & Omit<HTMLStyledProps<'div'>, 'defaultValue'> & RecipeVariantProps<typeof combobox>;
|
|
38
|
+
export declare const Combobox: <T extends ComboboxItem>({ items: itemsFromUsers, initialItems, debounceMs, placeholder, emptyLabel, loadingLabel, usePortal, withAutoFilter, positioning, loadItems, renderItem, renderValue, onResetInitialItems, isLoading: controlledIsLoading, value, defaultValue, openDropdownOnFocus, clearValueWhenEmpty, virtualized, rowHeight, returnItemsOnEmpty, multiple, ...props }: ComboboxProps<T>) => import('react').JSX.Element;
|
|
@@ -5,17 +5,17 @@ import { Text as n } from "../text/Text.js";
|
|
|
5
5
|
import { ConditionalWrapper as r } from "../../shared/ConditionalWrapper.js";
|
|
6
6
|
import { useUiLabels as i } from "../ui-labels/UiLabelsProvider.js";
|
|
7
7
|
import { Input as a } from "../input/Input.js";
|
|
8
|
-
import { Chip as
|
|
9
|
-
import { Combobox as
|
|
10
|
-
import { styled as
|
|
11
|
-
import { combobox as
|
|
12
|
-
import { useCallback as
|
|
8
|
+
import { Chip as ee, ChipClearTrigger as o, ChipLabel as s } from "../chip/Chip.js";
|
|
9
|
+
import { Combobox as c, Portal as te, createListCollection as ne, useComboboxItemContext as l } from "@ark-ui/react";
|
|
10
|
+
import { styled as u } from "@stokelp/styled-system/jsx";
|
|
11
|
+
import { combobox as d } from "@stokelp/styled-system/recipes";
|
|
12
|
+
import { useCallback as f, useEffect as re, useMemo as p, useState as m } from "react";
|
|
13
13
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
14
14
|
import { css as v } from "@stokelp/styled-system/css";
|
|
15
15
|
import { FixedSizeList as ie } from "react-window";
|
|
16
|
-
import { debounce as
|
|
17
|
-
|
|
18
|
-
var { withProvider:
|
|
16
|
+
import { debounce as y } from "@zag-js/utils";
|
|
17
|
+
// src/components/combobox/Combobox.tsx
|
|
18
|
+
var { withProvider: b, withContext: x } = e(d), ae = b(u(c.Root), "root", { defaultProps: { loopFocus: !0 } }), oe = x(u(c.ClearTrigger), "clearTrigger"), S = x(u(c.Content), "content"), C = x(u(c.Input), "input"), w = x(u(c.Control), "control"), T = x(u(c.Item), "item"), E = x(u(c.ItemText), "itemText"), D = x(u(c.Positioner), "positioner"), O = x(u(c.Trigger), "trigger"), k = () => /* @__PURE__ */ _("svg", {
|
|
19
19
|
width: "16",
|
|
20
20
|
height: "17",
|
|
21
21
|
viewBox: "0 0 16 17",
|
|
@@ -56,48 +56,50 @@ var { withProvider: y, withContext: b } = e(f), x = y(d(s.Root), "root", { defau
|
|
|
56
56
|
})]
|
|
57
57
|
});
|
|
58
58
|
function j({ item: e, isMultiple: t, renderItem: n }) {
|
|
59
|
-
let r =
|
|
60
|
-
return /* @__PURE__ */ _(h, { children: [t ? r.selected ? /* @__PURE__ */ g(A, {}) : /* @__PURE__ */ g(k, {}) : null, n ? n(e) : /* @__PURE__ */ g(
|
|
59
|
+
let r = l();
|
|
60
|
+
return /* @__PURE__ */ _(h, { children: [t ? r.selected ? /* @__PURE__ */ g(A, {}) : /* @__PURE__ */ g(k, {}) : null, n ? n(e) : /* @__PURE__ */ g(E, {
|
|
61
61
|
truncate: !0,
|
|
62
62
|
children: e.label
|
|
63
63
|
})] });
|
|
64
64
|
}
|
|
65
|
-
var M = ({ items: e = [], initialItems:
|
|
66
|
-
let
|
|
65
|
+
var M = ({ items: e = [], initialItems: l, debounceMs: u = 0, placeholder: d, emptyLabel: v, loadingLabel: b, usePortal: x = !0, withAutoFilter: E = !0, positioning: k, loadItems: A, renderItem: M, renderValue: N, onResetInitialItems: P, isLoading: F, value: I, defaultValue: L, openDropdownOnFocus: R = !0, clearValueWhenEmpty: z = !0, virtualized: B, rowHeight: V = 34, returnItemsOnEmpty: H, multiple: U = !1, ...W }) => {
|
|
66
|
+
let G = i(), [K, q] = m(() => e), [se, J] = m(!1), [ce, le] = m(!1), Y = typeof A == "function", X = p(() => A ? y(async (e) => {
|
|
67
67
|
try {
|
|
68
|
-
le(!0),
|
|
68
|
+
le(!0), J(!0);
|
|
69
|
+
let t = await A(e);
|
|
70
|
+
q(t);
|
|
69
71
|
} catch (e) {
|
|
70
|
-
console.error(e),
|
|
72
|
+
console.error(e), q([]);
|
|
71
73
|
} finally {
|
|
72
|
-
|
|
74
|
+
J(!1);
|
|
73
75
|
}
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
+
}, u) : null, [A, u]), Z = [...!Y && !E ? e : K, ...l ?? []], ue = f(async (t) => {
|
|
77
|
+
l && l.length > 0 && !l.find((e) => e.label === t.inputValue) && P?.();
|
|
76
78
|
let { inputValue: n } = t;
|
|
77
|
-
if (
|
|
79
|
+
if (X) X(n);
|
|
78
80
|
else {
|
|
79
|
-
let t =
|
|
80
|
-
if (t.length === 0 &&
|
|
81
|
-
|
|
81
|
+
let t = E && n !== "" ? e.filter((e) => e.label.toLowerCase().includes(n.toLowerCase())) : e;
|
|
82
|
+
if (t.length === 0 && H) return q(e);
|
|
83
|
+
q(t);
|
|
82
84
|
}
|
|
83
85
|
}, [
|
|
84
|
-
|
|
86
|
+
X,
|
|
85
87
|
e,
|
|
86
|
-
|
|
88
|
+
E
|
|
87
89
|
]);
|
|
88
90
|
re(() => {
|
|
89
|
-
|
|
90
|
-
}, [e,
|
|
91
|
-
let de = p(() =>
|
|
91
|
+
X || q(e);
|
|
92
|
+
}, [e, X]);
|
|
93
|
+
let de = p(() => ne({ items: Z }), [Z]), fe = F ?? se, Q = b ?? /* @__PURE__ */ g(n, {
|
|
92
94
|
p: "space-8",
|
|
93
95
|
textAlign: "center",
|
|
94
|
-
children:
|
|
96
|
+
children: G.loading
|
|
95
97
|
}), $ = v ?? /* @__PURE__ */ g(n, {
|
|
96
98
|
p: "space-8",
|
|
97
99
|
textAlign: "center",
|
|
98
|
-
children:
|
|
100
|
+
children: G.noResults
|
|
99
101
|
});
|
|
100
|
-
return /* @__PURE__ */ _(
|
|
102
|
+
return /* @__PURE__ */ _(ae, {
|
|
101
103
|
lazyMount: !0,
|
|
102
104
|
unmountOnExit: !0,
|
|
103
105
|
collection: de,
|
|
@@ -109,34 +111,35 @@ var M = ({ items: e = [], initialItems: u, debounceMs: d = 0, placeholder: f, em
|
|
|
109
111
|
"data-recipe": "combobox",
|
|
110
112
|
onInputValueChange: ue,
|
|
111
113
|
value: I,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
defaultValue: L,
|
|
115
|
+
...W,
|
|
116
|
+
multiple: U,
|
|
117
|
+
children: [U ? /* @__PURE__ */ g(c.Context, { children: (t) => /* @__PURE__ */ _(w, {
|
|
115
118
|
"data-multiple": "true",
|
|
116
119
|
"data-open": t.open || void 0,
|
|
117
120
|
children: [
|
|
118
121
|
t.value.map((n) => {
|
|
119
122
|
let r = e.find((e) => String(e.value) === String(n));
|
|
120
|
-
return r ? /* @__PURE__ */ _(
|
|
123
|
+
return r ? /* @__PURE__ */ _(ee, {
|
|
121
124
|
size: "sm",
|
|
122
|
-
children: [N ? N(r) : /* @__PURE__ */ g(
|
|
125
|
+
children: [N ? N(r) : /* @__PURE__ */ g(s, { children: r.label }), !W.readOnly && !W.disabled && /* @__PURE__ */ g(o, {
|
|
123
126
|
"aria-label": `Retirer ${r.label}`,
|
|
124
127
|
onClick: () => t.setValue(t.value.filter((e) => String(e) !== String(n)))
|
|
125
128
|
})]
|
|
126
129
|
}, n) : null;
|
|
127
130
|
}),
|
|
128
|
-
/* @__PURE__ */ g(
|
|
131
|
+
/* @__PURE__ */ g(C, {
|
|
129
132
|
asChild: !0,
|
|
130
133
|
"data-multiple": "true",
|
|
131
|
-
placeholder: t.hasSelectedItems ? void 0 :
|
|
134
|
+
placeholder: t.hasSelectedItems ? void 0 : d,
|
|
132
135
|
onFocus: () => {
|
|
133
|
-
|
|
136
|
+
R && !Y && t.setOpen(!0);
|
|
134
137
|
},
|
|
135
138
|
children: /* @__PURE__ */ g(a, {})
|
|
136
139
|
}),
|
|
137
140
|
/* @__PURE__ */ g(O, {
|
|
138
141
|
asChild: !0,
|
|
139
|
-
hidden:
|
|
142
|
+
hidden: Y && (!l || l.length === 0),
|
|
140
143
|
children: /* @__PURE__ */ g("svg", {
|
|
141
144
|
width: "24",
|
|
142
145
|
height: "24",
|
|
@@ -152,22 +155,22 @@ var M = ({ items: e = [], initialItems: u, debounceMs: d = 0, placeholder: f, em
|
|
|
152
155
|
})
|
|
153
156
|
})
|
|
154
157
|
]
|
|
155
|
-
}) }) : /* @__PURE__ */ _(
|
|
156
|
-
/* @__PURE__ */ g(
|
|
158
|
+
}) }) : /* @__PURE__ */ _(w, { children: [
|
|
159
|
+
/* @__PURE__ */ g(c.Context, { children: (e) => /* @__PURE__ */ g(C, {
|
|
157
160
|
asChild: !0,
|
|
158
|
-
placeholder:
|
|
161
|
+
placeholder: d,
|
|
159
162
|
onInput: (t) => {
|
|
160
163
|
let n = t.currentTarget.value;
|
|
161
|
-
|
|
164
|
+
z && n === "" && e.clearValue();
|
|
162
165
|
},
|
|
163
166
|
onFocus: () => {
|
|
164
|
-
|
|
167
|
+
R && !Y && e.setOpen(!0);
|
|
165
168
|
},
|
|
166
169
|
children: /* @__PURE__ */ g(a, {})
|
|
167
170
|
}) }),
|
|
168
171
|
/* @__PURE__ */ g(O, {
|
|
169
172
|
asChild: !0,
|
|
170
|
-
hidden:
|
|
173
|
+
hidden: Y && (!l || l.length === 0),
|
|
171
174
|
children: /* @__PURE__ */ g("svg", {
|
|
172
175
|
width: "24",
|
|
173
176
|
height: "24",
|
|
@@ -182,8 +185,8 @@ var M = ({ items: e = [], initialItems: u, debounceMs: d = 0, placeholder: f, em
|
|
|
182
185
|
})
|
|
183
186
|
})
|
|
184
187
|
}),
|
|
185
|
-
/* @__PURE__ */ g(
|
|
186
|
-
disabled:
|
|
188
|
+
/* @__PURE__ */ g(oe, {
|
|
189
|
+
disabled: W.readOnly,
|
|
187
190
|
onClick: P,
|
|
188
191
|
asChild: !0,
|
|
189
192
|
children: /* @__PURE__ */ g("button", { children: /* @__PURE__ */ g("svg", {
|
|
@@ -201,48 +204,47 @@ var M = ({ items: e = [], initialItems: u, debounceMs: d = 0, placeholder: f, em
|
|
|
201
204
|
}) })
|
|
202
205
|
})
|
|
203
206
|
] }), /* @__PURE__ */ g(r, {
|
|
204
|
-
when:
|
|
205
|
-
wrapper: (e) => /* @__PURE__ */ g(
|
|
206
|
-
children: /* @__PURE__ */ g(
|
|
207
|
-
height: Math.min(
|
|
208
|
-
itemCount:
|
|
209
|
-
itemSize:
|
|
207
|
+
when: x,
|
|
208
|
+
wrapper: (e) => /* @__PURE__ */ g(te, { children: e }),
|
|
209
|
+
children: /* @__PURE__ */ g(D, { children: /* @__PURE__ */ g(S, { children: fe ? Q : Z.length === 0 ? /* @__PURE__ */ g(h, { children: Y ? ce ? $ : Q : $ }) : B ? /* @__PURE__ */ g(h, { children: /* @__PURE__ */ g(ie, {
|
|
210
|
+
height: Math.min(V * Z.length, 180),
|
|
211
|
+
itemCount: Z.length,
|
|
212
|
+
itemSize: V,
|
|
210
213
|
width: "100%",
|
|
211
214
|
children: ({ index: e, style: n }) => /* @__PURE__ */ g(r, {
|
|
212
|
-
when: !!
|
|
215
|
+
when: !!Z[e].tooltip,
|
|
213
216
|
wrapper: (n) => /* @__PURE__ */ g(t, {
|
|
214
|
-
label:
|
|
217
|
+
label: Z[e].tooltip,
|
|
215
218
|
children: n
|
|
216
219
|
}),
|
|
217
|
-
children: /* @__PURE__ */ g(
|
|
218
|
-
item:
|
|
220
|
+
children: /* @__PURE__ */ g(T, {
|
|
221
|
+
item: Z[e],
|
|
219
222
|
style: n,
|
|
220
223
|
children: /* @__PURE__ */ g(j, {
|
|
221
224
|
renderItem: M,
|
|
222
|
-
item:
|
|
223
|
-
isMultiple:
|
|
225
|
+
item: Z[e],
|
|
226
|
+
isMultiple: U
|
|
224
227
|
})
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
}) }) :
|
|
228
|
+
}, Z[e].value)
|
|
229
|
+
}, Z[e].value)
|
|
230
|
+
}) }) : Z.map((e) => /* @__PURE__ */ g(r, {
|
|
228
231
|
when: !!e.tooltip,
|
|
229
232
|
wrapper: (n) => /* @__PURE__ */ g(t, {
|
|
230
233
|
label: e.tooltip,
|
|
231
234
|
children: n
|
|
232
235
|
}),
|
|
233
|
-
children: /* @__PURE__ */ g(
|
|
236
|
+
children: /* @__PURE__ */ g(T, {
|
|
234
237
|
item: e,
|
|
235
238
|
children: /* @__PURE__ */ g(j, {
|
|
236
239
|
renderItem: M,
|
|
237
240
|
item: e,
|
|
238
|
-
isMultiple:
|
|
241
|
+
isMultiple: U
|
|
239
242
|
})
|
|
240
243
|
}, e.value)
|
|
241
244
|
}, e.value)) }) })
|
|
242
245
|
})]
|
|
243
246
|
});
|
|
244
247
|
};
|
|
245
|
-
//#endregion
|
|
246
248
|
export { M as Combobox };
|
|
247
249
|
|
|
248
250
|
//# sourceMappingURL=Combobox.js.map
|
|
@@ -1 +1 @@
|
|
|
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 { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport { Chip, ChipClearTrigger, ChipLabel } from '~/components/chip'\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 /**\n * Renders the inner content of each selected chip in `multiple` mode.\n * Receives the selected item and should return the chip body (the removable\n * clear button is appended automatically). Defaults to the item label.\n */\n renderValue?: (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 renderValue,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n multiple = false,\n ...props\n}: ComboboxProps<T>) => {\n const uiLabels = useUiLabels()\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 // A sync, unfiltered list has nothing to derive: read the prop itself. The mirrored\n // `items` state only catches up in an effect, one render late, and zag re-derives the\n // input text from the collection the moment `value` changes: a value set in the same\n // render as the item that carries it was stringified against a list without it, and\n // the input went blank.\n const sourceItems = !asyncMode && !withAutoFilter ? itemsFromUsers : items\n const allItems = [...sourceItems, ...(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 // Keep the visible items in sync with the source list whenever it changes\n // (e.g. options that load asynchronously after mount). Without this, an empty\n // input shows a stale/empty list (the no-results label) until the user types.\n // Consumers memoize `items`, so this only fires on real data changes, not on\n // every keystroke.\n useEffect(() => {\n if (!debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, 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 {uiLabels.loading}\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.noResults}\n </Text>\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 multiple={multiple}\n >\n {multiple ? (\n // Tags-input layout: the control (styled via the recipe's `&[data-multiple]`\n // selectors) is the bordered box holding the selected chips and a\n // borderless growing input.\n <ArkCombobox.Context>\n {api => (\n <Control data-multiple=\"true\" data-open={api.open || undefined}>\n {/* Resolve chips from the current value against the full source\n list rather than ark's cached `selectedItems`: the cache is only\n re-derived on value changes, so async-loaded defaults would show\n 0 chips until the user selects something. Looking up in\n itemsFromUsers (never the filtered list) also keeps chips visible\n while the user is typing to filter. */}\n {api.value.map(v => {\n const item = itemsFromUsers.find((i: T) => String(i.value) === String(v))\n if (!item) return null\n return (\n <Chip key={v} size=\"sm\">\n {renderValue ? renderValue(item) : <ChipLabel>{item.label}</ChipLabel>}\n {!props.readOnly && !props.disabled && (\n <ChipClearTrigger\n aria-label={`Retirer ${item.label}`}\n // Remove by strict-equality-safe filter: stored values may\n // be numbers while item.value is compared as a string.\n onClick={() => api.setValue(api.value.filter(x => String(x) !== String(v)))}\n />\n )}\n </Chip>\n )\n })}\n <Input\n asChild\n data-multiple=\"true\"\n placeholder={api.hasSelectedItems ? undefined : placeholder}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\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 </Control>\n )}\n </ArkCombobox.Context>\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 )}\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}>\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AK,KAEV;GACY,GAPb,EAAK,KAOQ,CACrB,EAEI,CAAA,EACC,CAAA;EACM,CAAA,CAChB;;AAEV"}
|
|
1
|
+
{"version":3,"file":"Combobox.js","names":["ArkCombobox","_Fragment","Combobox","UIInput","Tooltip","Tooltip$1","Input$1","Fragment$1","createStyleContext","combobox","Root","withProvider","styled","Combobox","ClearTrigger","withContext","Content","Input","Control","Item","ItemText","Positioner","Trigger","MultipleUncheckedIndicator","css","MultipleCheckedIndicator","CustomInnerItem","context","useComboboxItemContext","isMultiple","renderItem","item","Combobox$1","itemsFromUsers","controlledIsLoading","props","uiLabels","useUiLabels","items","setItems","useState","isLoading","setIsLoading","firstQueryTriggered","setFirstQueryTriggered","asyncMode","loadItems","debouncedLoadItems","useMemo","debounce","newItems","value","error","debounceMs","allItems","withAutoFilter","initialItems","handleInputChange","useCallback","details","onResetInitialItems","inputValue","returnItemsOnEmpty","collection","createListCollection","effectiveIsLoading","loadingContent","loadingLabel","Text","emptyContent","emptyLabel","positioning","multiple","api","i","v","Chip","renderValue","ChipLabel","ChipClearTrigger","x","placeholder","openDropdownOnFocus","e","clearValueWhenEmpty","ConditionalWrapper","usePortal","Portal","virtualized","FixedSizeList","rowHeight","index"],"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 '@zag-js/utils'\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 { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport { Chip, ChipClearTrigger, ChipLabel } from '~/components/chip'\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<\n ComboboxRootProps<T>,\n 'collection' | 'value' | 'defaultValue'\n> & {\n // Item values may be numbers: the chips compare them as strings.\n value?: Array<string | number>\n defaultValue?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n /**\n * Renders the inner content of each selected chip in `multiple` mode.\n * Receives the selected item and should return the chip body (the removable\n * clear button is appended automatically). Defaults to the item label.\n */\n renderValue?: (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} & Omit<HTMLStyledProps<'div'>, 'defaultValue'> &\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 renderValue,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n defaultValue,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n multiple = false,\n ...props\n}: ComboboxProps<T>) => {\n const uiLabels = useUiLabels()\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 // A sync, unfiltered list has nothing to derive: read the prop itself. The mirrored\n // `items` state only catches up in an effect, one render late, and zag re-derives the\n // input text from the collection the moment `value` changes: a value set in the same\n // render as the item that carries it was stringified against a list without it, and\n // the input went blank.\n const sourceItems = !asyncMode && !withAutoFilter ? itemsFromUsers : items\n const allItems = [...sourceItems, ...(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 // Keep the visible items in sync with the source list whenever it changes\n // (e.g. options that load asynchronously after mount). Without this, an empty\n // input shows a stale/empty list (the no-results label) until the user types.\n // Consumers memoize `items`, so this only fires on real data changes, not on\n // every keystroke.\n useEffect(() => {\n if (!debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, 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 {uiLabels.loading}\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.noResults}\n </Text>\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 defaultValue={defaultValue as string[] | undefined}\n {...props}\n multiple={multiple}\n >\n {multiple ? (\n // Tags-input layout: the control (styled via the recipe's `&[data-multiple]`\n // selectors) is the bordered box holding the selected chips and a\n // borderless growing input.\n <ArkCombobox.Context>\n {api => (\n <Control data-multiple=\"true\" data-open={api.open || undefined}>\n {/* Resolve chips from the current value against the full source\n list rather than ark's cached `selectedItems`: the cache is only\n re-derived on value changes, so async-loaded defaults would show\n 0 chips until the user selects something. Looking up in\n itemsFromUsers (never the filtered list) also keeps chips visible\n while the user is typing to filter. */}\n {api.value.map(v => {\n const item = itemsFromUsers.find((i: T) => String(i.value) === String(v))\n if (!item) return null\n return (\n <Chip key={v} size=\"sm\">\n {renderValue ? renderValue(item) : <ChipLabel>{item.label}</ChipLabel>}\n {!props.readOnly && !props.disabled && (\n <ChipClearTrigger\n aria-label={`Retirer ${item.label}`}\n // Remove by strict-equality-safe filter: stored values may\n // be numbers while item.value is compared as a string.\n onClick={() => api.setValue(api.value.filter(x => String(x) !== String(v)))}\n />\n )}\n </Chip>\n )\n })}\n <Input\n asChild\n data-multiple=\"true\"\n placeholder={api.hasSelectedItems ? undefined : placeholder}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\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 </Control>\n )}\n </ArkCombobox.Context>\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 )}\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":";;;;;;;;;;;;;;;;;AAwBA,IAAM,EAAE,iBAAc,mBAAgBQ,EAAmBC,CAAQ,GAG3DC,KAAOC,EAAaC,EAAOZ,EAAY,IAAS,GAAG,QAAQ,EAC/D,cAAc,EACZ,WAAW,GACb,EACF,CAAC,GAEKc,KAAeC,EAAYH,EAAOZ,EAAY,YAAY,GAAG,cAAc,GAC3EgB,IAAUD,EAAYH,EAAOZ,EAAY,OAAO,GAAG,SAAS,GAC5DiB,IAAQF,EAAYH,EAAOZ,EAAY,KAAK,GAAG,OAAO,GACtDkB,IAAUH,EAAYH,EAAOZ,EAAY,OAAO,GAAG,SAAS,GAC5DmB,IAAOJ,EAAYH,EAAOZ,EAAY,IAAI,GAAG,MAAM,GACnDoB,IAAWL,EAAYH,EAAOZ,EAAY,QAAQ,GAAG,UAAU,GAC/DqB,IAAaN,EAAYH,EAAOZ,EAAY,UAAU,GAAG,YAAY,GACrEsB,IAAUP,EAAYH,EAAOZ,EAAY,OAAO,GAAG,SAAS,GA0C5DuB,UACJ,kBAAC,OAAD;CAAK,OAAM;CAAK,QAAO;CAAK,SAAQ;CAAY,MAAK;CAAO,OAAM;CAAlE,UAAA,CACE,kBAAC,QAAD;EAAM,G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