@stokelp/ui 2.102.0 → 2.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/_virtual/_rolldown/runtime.js +21 -0
- package/dist/components/accordion/Accordion.cjs +2 -2
- package/dist/components/accordion/Accordion.cjs.map +1 -1
- package/dist/components/accordion/Accordion.js +22 -27
- package/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/action-card/ActionCard.cjs +2 -2
- package/dist/components/action-card/ActionCard.cjs.map +1 -1
- package/dist/components/action-card/ActionCard.js +23 -26
- package/dist/components/action-card/ActionCard.js.map +1 -1
- package/dist/components/alert/Alert.cjs +2 -2
- package/dist/components/alert/Alert.cjs.map +1 -1
- package/dist/components/alert/Alert.js +117 -84
- package/dist/components/alert/Alert.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardEntityRow.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardEntityRow.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardEntityRow.js +44 -25
- package/dist/components/app/mobile-card/MobileCardEntityRow.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardHeader.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardHeader.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardHeader.js +18 -20
- package/dist/components/app/mobile-card/MobileCardHeader.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.js +31 -13
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardShell.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardShell.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardShell.js +17 -19
- package/dist/components/app/mobile-card/MobileCardShell.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardSkeleton.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardSkeleton.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardSkeleton.js +45 -22
- package/dist/components/app/mobile-card/MobileCardSkeleton.js.map +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.cjs +2 -2
- package/dist/components/app/mobile-navigation/MobileNavigation.cjs.map +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.js +16 -18
- package/dist/components/app/mobile-navigation/MobileNavigation.js.map +1 -1
- package/dist/components/app/navigation/AppNavigation.cjs +2 -2
- package/dist/components/app/navigation/AppNavigation.cjs.map +1 -1
- package/dist/components/app/navigation/AppNavigation.js +35 -47
- package/dist/components/app/navigation/AppNavigation.js.map +1 -1
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs +2 -2
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs.map +1 -1
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js +188 -119
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js.map +1 -1
- package/dist/components/app/price-tag/PriceTag.cjs +2 -2
- package/dist/components/app/price-tag/PriceTag.cjs.map +1 -1
- package/dist/components/app/price-tag/PriceTag.js +25 -19
- package/dist/components/app/price-tag/PriceTag.js.map +1 -1
- package/dist/components/app/product-card-catalog/styled.cjs +2 -2
- package/dist/components/app/product-card-catalog/styled.cjs.map +1 -1
- package/dist/components/app/product-card-catalog/styled.js +23 -21
- package/dist/components/app/product-card-catalog/styled.js.map +1 -1
- package/dist/components/avatar/styled.cjs +2 -2
- package/dist/components/avatar/styled.cjs.map +1 -1
- package/dist/components/avatar/styled.d.ts +2 -2
- package/dist/components/avatar/styled.js +28 -27
- package/dist/components/avatar/styled.js.map +1 -1
- package/dist/components/box/Box.cjs +2 -2
- package/dist/components/box/Box.cjs.map +1 -1
- package/dist/components/box/Box.js +11 -10
- package/dist/components/box/Box.js.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.cjs +2 -2
- package/dist/components/breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.d.ts +4 -6
- package/dist/components/breadcrumb/Breadcrumb.js +39 -35
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/button/Button.cjs +2 -2
- package/dist/components/button/Button.cjs.map +1 -1
- package/dist/components/button/Button.js +9 -8
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button-filter/ButtonFilter.cjs +2 -2
- package/dist/components/button-filter/ButtonFilter.cjs.map +1 -1
- package/dist/components/button-filter/ButtonFilter.js +9 -8
- package/dist/components/button-filter/ButtonFilter.js.map +1 -1
- package/dist/components/chat/Chat.cjs +2 -2
- package/dist/components/chat/Chat.cjs.map +1 -1
- package/dist/components/chat/Chat.d.ts +6 -4
- package/dist/components/chat/Chat.js +27 -26
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/ChatDocumentMessage.cjs +2 -2
- package/dist/components/chat/ChatDocumentMessage.cjs.map +1 -1
- package/dist/components/chat/ChatDocumentMessage.js +32 -31
- package/dist/components/chat/ChatDocumentMessage.js.map +1 -1
- package/dist/components/chat/ChatMessage.cjs +2 -2
- package/dist/components/chat/ChatMessage.cjs.map +1 -1
- package/dist/components/chat/ChatMessage.js +8 -7
- package/dist/components/chat/ChatMessage.js.map +1 -1
- package/dist/components/chat/ChatProfileAvatar.cjs +2 -2
- package/dist/components/chat/ChatProfileAvatar.cjs.map +1 -1
- package/dist/components/chat/ChatProfileAvatar.js +24 -16
- package/dist/components/chat/ChatProfileAvatar.js.map +1 -1
- package/dist/components/chat/ChatTextInput.cjs +2 -2
- package/dist/components/chat/ChatTextInput.cjs.map +1 -1
- package/dist/components/chat/ChatTextInput.d.ts +2 -2
- package/dist/components/chat/ChatTextInput.js +44 -52
- package/dist/components/chat/ChatTextInput.js.map +1 -1
- package/dist/components/checkbox/Checkbox.cjs +2 -2
- package/dist/components/checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/checkbox/Checkbox.js +36 -34
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/checkbox-card/CheckboxCard.cjs +2 -2
- package/dist/components/checkbox-card/CheckboxCard.cjs.map +1 -1
- package/dist/components/checkbox-card/CheckboxCard.js +33 -38
- package/dist/components/checkbox-card/CheckboxCard.js.map +1 -1
- package/dist/components/checkbox-card/namespace.cjs +2 -2
- package/dist/components/checkbox-card/namespace.cjs.map +1 -1
- package/dist/components/checkbox-card/namespace.js +14 -9
- package/dist/components/checkbox-card/namespace.js.map +1 -1
- package/dist/components/chip/Chip.cjs +2 -2
- package/dist/components/chip/Chip.cjs.map +1 -1
- package/dist/components/chip/Chip.js +23 -23
- package/dist/components/chip/Chip.js.map +1 -1
- package/dist/components/collapsible/styled.cjs +2 -2
- package/dist/components/collapsible/styled.cjs.map +1 -1
- package/dist/components/collapsible/styled.js +15 -11
- package/dist/components/collapsible/styled.js.map +1 -1
- package/dist/components/combobox/Combobox.cjs +2 -2
- package/dist/components/combobox/Combobox.cjs.map +1 -1
- package/dist/components/combobox/Combobox.js +206 -173
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/date-picker/DatePicker.cjs +2 -2
- package/dist/components/date-picker/DatePicker.cjs.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +2 -2
- package/dist/components/date-picker/DatePicker.js +151 -127
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/dialog/styled.cjs +2 -2
- package/dist/components/dialog/styled.cjs.map +1 -1
- package/dist/components/dialog/styled.js +75 -65
- package/dist/components/dialog/styled.js.map +1 -1
- package/dist/components/drawer/Drawer.cjs +2 -2
- package/dist/components/drawer/Drawer.cjs.map +1 -1
- package/dist/components/drawer/Drawer.js +62 -68
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/flag/styled.cjs +2 -2
- package/dist/components/flag/styled.cjs.map +1 -1
- package/dist/components/flag/styled.d.ts +2 -2
- package/dist/components/flag/styled.js +8437 -3751
- package/dist/components/flag/styled.js.map +1 -1
- package/dist/components/form/FormControl.cjs +2 -2
- package/dist/components/form/FormControl.cjs.map +1 -1
- package/dist/components/form/FormControl.d.ts +2 -2
- package/dist/components/form/FormControl.js +13 -18
- package/dist/components/form/FormControl.js.map +1 -1
- package/dist/components/form/FormHelperText.cjs +2 -2
- package/dist/components/form/FormHelperText.cjs.map +1 -1
- package/dist/components/form/FormHelperText.js +8 -9
- package/dist/components/form/FormHelperText.js.map +1 -1
- package/dist/components/form/FormLabel.cjs +2 -2
- package/dist/components/form/FormLabel.cjs.map +1 -1
- package/dist/components/form/FormLabel.d.ts +2 -2
- package/dist/components/form/FormLabel.js +38 -33
- package/dist/components/form/FormLabel.js.map +1 -1
- package/dist/components/heading/Heading.cjs +2 -2
- package/dist/components/heading/Heading.cjs.map +1 -1
- package/dist/components/heading/Heading.js +14 -10
- package/dist/components/heading/Heading.js.map +1 -1
- package/dist/components/icon/Icon.cjs +2 -2
- package/dist/components/icon/Icon.cjs.map +1 -1
- package/dist/components/icon/Icon.d.ts +2 -2
- package/dist/components/icon/Icon.js +15 -10
- package/dist/components/icon/Icon.js.map +1 -1
- package/dist/components/icon-button/IconButton.cjs +2 -2
- package/dist/components/icon-button/IconButton.cjs.map +1 -1
- package/dist/components/icon-button/IconButton.d.ts +2 -3
- package/dist/components/icon-button/IconButton.js +8 -7
- package/dist/components/icon-button/IconButton.js.map +1 -1
- package/dist/components/illustration/Illustration.cjs +2 -2
- package/dist/components/illustration/Illustration.cjs.map +1 -1
- package/dist/components/illustration/Illustration.js +35 -39
- package/dist/components/illustration/Illustration.js.map +1 -1
- package/dist/components/illustration/patterns.cjs +2 -2
- package/dist/components/illustration/patterns.cjs.map +1 -1
- package/dist/components/illustration/patterns.js +5563 -8897
- package/dist/components/illustration/patterns.js.map +1 -1
- package/dist/components/input/HighlightedInput.cjs +2 -2
- package/dist/components/input/HighlightedInput.cjs.map +1 -1
- package/dist/components/input/HighlightedInput.d.ts +9 -12
- package/dist/components/input/HighlightedInput.js +43 -58
- package/dist/components/input/HighlightedInput.js.map +1 -1
- package/dist/components/input/Input.cjs +2 -2
- package/dist/components/input/Input.cjs.map +1 -1
- package/dist/components/input/Input.d.ts +1 -2
- package/dist/components/input/Input.js +12 -13
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input/InputAddon.cjs +2 -2
- package/dist/components/input/InputAddon.cjs.map +1 -1
- package/dist/components/input/InputAddon.js +8 -9
- package/dist/components/input/InputAddon.js.map +1 -1
- package/dist/components/input/InputGroup.cjs +2 -2
- package/dist/components/input/InputGroup.cjs.map +1 -1
- package/dist/components/input/InputGroup.js +8 -9
- package/dist/components/input/InputGroup.js.map +1 -1
- package/dist/components/input/PhoneNumberInput.cjs +2 -2
- package/dist/components/input/PhoneNumberInput.cjs.map +1 -1
- package/dist/components/input/PhoneNumberInput.js +21 -23
- package/dist/components/input/PhoneNumberInput.js.map +1 -1
- package/dist/components/menu/Menu.cjs +2 -2
- package/dist/components/menu/Menu.cjs.map +1 -1
- package/dist/components/menu/Menu.js +32 -28
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/pagination/Pagination.cjs +2 -2
- package/dist/components/pagination/Pagination.cjs.map +1 -1
- package/dist/components/pagination/Pagination.js +76 -84
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/pagination/use-pagination.cjs +2 -2
- package/dist/components/pagination/use-pagination.cjs.map +1 -1
- package/dist/components/pagination/use-pagination.js +56 -54
- package/dist/components/pagination/use-pagination.js.map +1 -1
- package/dist/components/popover/Popover.cjs +2 -2
- package/dist/components/popover/Popover.cjs.map +1 -1
- package/dist/components/popover/Popover.js +21 -25
- package/dist/components/popover/Popover.js.map +1 -1
- package/dist/components/radio-button-group/RadioButtonGroup.cjs +2 -2
- package/dist/components/radio-button-group/RadioButtonGroup.cjs.map +1 -1
- package/dist/components/radio-button-group/RadioButtonGroup.js +20 -20
- package/dist/components/radio-button-group/RadioButtonGroup.js.map +1 -1
- package/dist/components/radio-card-group/RadioCardGroup.cjs +2 -2
- package/dist/components/radio-card-group/RadioCardGroup.cjs.map +1 -1
- package/dist/components/radio-card-group/RadioCardGroup.js +21 -22
- package/dist/components/radio-card-group/RadioCardGroup.js.map +1 -1
- package/dist/components/radio-card-group/namespace.cjs +2 -2
- package/dist/components/radio-card-group/namespace.cjs.map +1 -1
- package/dist/components/radio-card-group/namespace.js +15 -10
- package/dist/components/radio-card-group/namespace.js.map +1 -1
- package/dist/components/radio-group/RadioGroup.cjs +2 -2
- package/dist/components/radio-group/RadioGroup.cjs.map +1 -1
- package/dist/components/radio-group/RadioGroup.js +21 -21
- package/dist/components/radio-group/RadioGroup.js.map +1 -1
- package/dist/components/select/Select.cjs +2 -2
- package/dist/components/select/Select.cjs.map +1 -1
- package/dist/components/select/Select.js +194 -141
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select-language/SelectLanguage.cjs +2 -2
- package/dist/components/select-language/SelectLanguage.cjs.map +1 -1
- package/dist/components/select-language/SelectLanguage.js +114 -88
- package/dist/components/select-language/SelectLanguage.js.map +1 -1
- package/dist/components/status-tag-select/StatusTagSelect.cjs +2 -2
- package/dist/components/status-tag-select/StatusTagSelect.cjs.map +1 -1
- package/dist/components/status-tag-select/StatusTagSelect.js +93 -115
- package/dist/components/status-tag-select/StatusTagSelect.js.map +1 -1
- package/dist/components/switch/Switch.cjs +2 -2
- package/dist/components/switch/Switch.cjs.map +1 -1
- package/dist/components/switch/Switch.js +30 -18
- package/dist/components/switch/Switch.js.map +1 -1
- package/dist/components/switch-card/SwitchCard.cjs +2 -2
- package/dist/components/switch-card/SwitchCard.cjs.map +1 -1
- package/dist/components/switch-card/SwitchCard.js +28 -25
- package/dist/components/switch-card/SwitchCard.js.map +1 -1
- package/dist/components/switch-card/namespace.cjs +2 -2
- package/dist/components/switch-card/namespace.cjs.map +1 -1
- package/dist/components/switch-card/namespace.js +14 -9
- package/dist/components/switch-card/namespace.js.map +1 -1
- package/dist/components/table/Table.cjs +2 -2
- package/dist/components/table/Table.cjs.map +1 -1
- package/dist/components/table/Table.d.ts +3 -4
- package/dist/components/table/Table.js +133 -109
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/TableProvider.cjs +2 -2
- package/dist/components/table/TableProvider.cjs.map +1 -1
- package/dist/components/table/TableProvider.js +36 -39
- package/dist/components/table/TableProvider.js.map +1 -1
- package/dist/components/tabs/Tabs.cjs +2 -2
- package/dist/components/tabs/Tabs.cjs.map +1 -1
- package/dist/components/tabs/Tabs.js +18 -26
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tag/Tag.cjs +2 -2
- package/dist/components/tag/Tag.cjs.map +1 -1
- package/dist/components/tag/Tag.js +22 -16
- package/dist/components/tag/Tag.js.map +1 -1
- package/dist/components/text/Text.cjs +2 -2
- package/dist/components/text/Text.cjs.map +1 -1
- package/dist/components/text/Text.js +12 -11
- package/dist/components/text/Text.js.map +1 -1
- package/dist/components/textarea/Textarea.cjs +2 -2
- package/dist/components/textarea/Textarea.cjs.map +1 -1
- package/dist/components/textarea/Textarea.d.ts +1 -2
- package/dist/components/textarea/Textarea.js +9 -8
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/tooltip/Tooltip.cjs +2 -2
- package/dist/components/tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/tooltip/Tooltip.js +38 -42
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/icons/index.cjs +2 -2
- package/dist/icons/index.cjs.map +1 -1
- package/dist/icons/index.js +65 -58
- package/dist/icons/index.js.map +1 -1
- package/dist/index.cjs +1 -2
- package/dist/index.js +66 -191
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +2 -2
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js +22 -27
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +2 -2
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js +22 -27
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +2 -2
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js +22 -27
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +2 -2
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js +22 -27
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +1 -1
- package/dist/node_modules/deepmerge/dist/cjs.cjs +2 -2
- package/dist/node_modules/deepmerge/dist/cjs.cjs.map +1 -1
- package/dist/node_modules/deepmerge/dist/cjs.js +76 -80
- package/dist/node_modules/deepmerge/dist/cjs.js.map +1 -1
- package/dist/preset.cjs +2 -2
- package/dist/preset.cjs.map +1 -1
- package/dist/preset.js +30 -31
- package/dist/preset.js.map +1 -1
- package/dist/shared/ConditionalWrapper.cjs +2 -2
- package/dist/shared/ConditionalWrapper.cjs.map +1 -1
- package/dist/shared/ConditionalWrapper.js +6 -5
- package/dist/shared/ConditionalWrapper.js.map +1 -1
- package/dist/shared/assets/icons.cjs +2 -2
- package/dist/shared/assets/icons.cjs.map +1 -1
- package/dist/shared/assets/icons.js +30 -22
- package/dist/shared/assets/icons.js.map +1 -1
- package/dist/shared/hooks/useUncontrolled.cjs +2 -2
- package/dist/shared/hooks/useUncontrolled.cjs.map +1 -1
- package/dist/shared/hooks/useUncontrolled.js +19 -16
- package/dist/shared/hooks/useUncontrolled.js.map +1 -1
- package/dist/shared/utils/events.cjs +2 -2
- package/dist/shared/utils/events.cjs.map +1 -1
- package/dist/shared/utils/events.js +7 -6
- package/dist/shared/utils/events.js.map +1 -1
- package/dist/theme/breakpoints.cjs +2 -2
- package/dist/theme/breakpoints.cjs.map +1 -1
- package/dist/theme/breakpoints.js +10 -9
- package/dist/theme/breakpoints.js.map +1 -1
- package/dist/theme/conditions.cjs +2 -2
- package/dist/theme/conditions.cjs.map +1 -1
- package/dist/theme/conditions.js +23 -24
- package/dist/theme/conditions.js.map +1 -1
- package/dist/theme/containers.cjs +2 -2
- package/dist/theme/containers.cjs.map +1 -1
- package/dist/theme/containers.js +18 -17
- package/dist/theme/containers.js.map +1 -1
- package/dist/theme/globalCss.cjs +4 -4
- package/dist/theme/globalCss.cjs.map +1 -1
- package/dist/theme/globalCss.js +94 -99
- package/dist/theme/globalCss.js.map +1 -1
- package/dist/theme/keyframes.cjs +2 -2
- package/dist/theme/keyframes.cjs.map +1 -1
- package/dist/theme/keyframes.js +256 -171
- package/dist/theme/keyframes.js.map +1 -1
- package/dist/theme/recipes/accordion.cjs +2 -2
- package/dist/theme/recipes/accordion.cjs.map +1 -1
- package/dist/theme/recipes/accordion.js +93 -110
- package/dist/theme/recipes/accordion.js.map +1 -1
- package/dist/theme/recipes/action-card.cjs +2 -2
- package/dist/theme/recipes/action-card.cjs.map +1 -1
- package/dist/theme/recipes/action-card.js +88 -84
- package/dist/theme/recipes/action-card.js.map +1 -1
- package/dist/theme/recipes/alert.cjs +2 -2
- package/dist/theme/recipes/alert.cjs.map +1 -1
- package/dist/theme/recipes/alert.js +52 -65
- package/dist/theme/recipes/alert.js.map +1 -1
- package/dist/theme/recipes/app/mobile-navigation.cjs +2 -2
- package/dist/theme/recipes/app/mobile-navigation.cjs.map +1 -1
- package/dist/theme/recipes/app/mobile-navigation.js +94 -108
- package/dist/theme/recipes/app/mobile-navigation.js.map +1 -1
- package/dist/theme/recipes/app/navigation-language-select.cjs +2 -2
- package/dist/theme/recipes/app/navigation-language-select.cjs.map +1 -1
- package/dist/theme/recipes/app/navigation-language-select.js +135 -148
- package/dist/theme/recipes/app/navigation-language-select.js.map +1 -1
- package/dist/theme/recipes/app/navigation.cjs +2 -2
- package/dist/theme/recipes/app/navigation.cjs.map +1 -1
- package/dist/theme/recipes/app/navigation.js +214 -269
- package/dist/theme/recipes/app/navigation.js.map +1 -1
- package/dist/theme/recipes/app/price-tag.cjs +2 -2
- package/dist/theme/recipes/app/price-tag.cjs.map +1 -1
- package/dist/theme/recipes/app/price-tag.js +59 -70
- package/dist/theme/recipes/app/price-tag.js.map +1 -1
- package/dist/theme/recipes/app/product-card-catalog.cjs +2 -2
- package/dist/theme/recipes/app/product-card-catalog.cjs.map +1 -1
- package/dist/theme/recipes/app/product-card-catalog.js +189 -194
- package/dist/theme/recipes/app/product-card-catalog.js.map +1 -1
- package/dist/theme/recipes/avatar-group.cjs +2 -2
- package/dist/theme/recipes/avatar-group.cjs.map +1 -1
- package/dist/theme/recipes/avatar-group.js +27 -38
- package/dist/theme/recipes/avatar-group.js.map +1 -1
- package/dist/theme/recipes/avatar.cjs +2 -2
- package/dist/theme/recipes/avatar.cjs.map +1 -1
- package/dist/theme/recipes/avatar.js +97 -95
- package/dist/theme/recipes/avatar.js.map +1 -1
- package/dist/theme/recipes/breadcrumb.cjs +2 -2
- package/dist/theme/recipes/breadcrumb.cjs.map +1 -1
- package/dist/theme/recipes/breadcrumb.js +35 -31
- package/dist/theme/recipes/breadcrumb.js.map +1 -1
- package/dist/theme/recipes/button-filter.cjs +2 -2
- package/dist/theme/recipes/button-filter.cjs.map +1 -1
- package/dist/theme/recipes/button-filter.js +57 -60
- package/dist/theme/recipes/button-filter.js.map +1 -1
- package/dist/theme/recipes/button.cjs +2 -2
- package/dist/theme/recipes/button.cjs.map +1 -1
- package/dist/theme/recipes/button.js +287 -295
- package/dist/theme/recipes/button.js.map +1 -1
- package/dist/theme/recipes/chat/chat-document-message.cjs +2 -2
- package/dist/theme/recipes/chat/chat-document-message.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-document-message.js +38 -43
- package/dist/theme/recipes/chat/chat-document-message.js.map +1 -1
- package/dist/theme/recipes/chat/chat-input-text.cjs +2 -2
- package/dist/theme/recipes/chat/chat-input-text.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-input-text.js +26 -27
- package/dist/theme/recipes/chat/chat-input-text.js.map +1 -1
- package/dist/theme/recipes/chat/chat-message.cjs +2 -2
- package/dist/theme/recipes/chat/chat-message.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-message.js +49 -45
- package/dist/theme/recipes/chat/chat-message.js.map +1 -1
- package/dist/theme/recipes/chat/chat-profile-avatar.cjs +2 -2
- package/dist/theme/recipes/chat/chat-profile-avatar.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-profile-avatar.js +20 -25
- package/dist/theme/recipes/chat/chat-profile-avatar.js.map +1 -1
- package/dist/theme/recipes/chat/chat.cjs +2 -2
- package/dist/theme/recipes/chat/chat.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat.js +51 -56
- package/dist/theme/recipes/chat/chat.js.map +1 -1
- package/dist/theme/recipes/checkbox-card.cjs +2 -2
- package/dist/theme/recipes/checkbox-card.cjs.map +1 -1
- package/dist/theme/recipes/checkbox-card.js +44 -40
- package/dist/theme/recipes/checkbox-card.js.map +1 -1
- package/dist/theme/recipes/checkbox-group.cjs +2 -2
- package/dist/theme/recipes/checkbox-group.cjs.map +1 -1
- package/dist/theme/recipes/checkbox-group.js +13 -12
- package/dist/theme/recipes/checkbox-group.js.map +1 -1
- package/dist/theme/recipes/checkbox.cjs +2 -2
- package/dist/theme/recipes/checkbox.cjs.map +1 -1
- package/dist/theme/recipes/checkbox.js +110 -129
- package/dist/theme/recipes/checkbox.js.map +1 -1
- package/dist/theme/recipes/chip.cjs +2 -2
- package/dist/theme/recipes/chip.cjs.map +1 -1
- package/dist/theme/recipes/chip.js +144 -182
- package/dist/theme/recipes/chip.js.map +1 -1
- package/dist/theme/recipes/collapsible.cjs +2 -2
- package/dist/theme/recipes/collapsible.cjs.map +1 -1
- package/dist/theme/recipes/collapsible.js +30 -28
- package/dist/theme/recipes/collapsible.js.map +1 -1
- package/dist/theme/recipes/combobox.cjs +2 -2
- package/dist/theme/recipes/combobox.cjs.map +1 -1
- package/dist/theme/recipes/combobox.js +149 -176
- package/dist/theme/recipes/combobox.js.map +1 -1
- package/dist/theme/recipes/common/group-card.cjs +2 -2
- package/dist/theme/recipes/common/group-card.cjs.map +1 -1
- package/dist/theme/recipes/common/group-card.js +60 -80
- package/dist/theme/recipes/common/group-card.js.map +1 -1
- package/dist/theme/recipes/datepicker.cjs +2 -2
- package/dist/theme/recipes/datepicker.cjs.map +1 -1
- package/dist/theme/recipes/datepicker.js +149 -176
- package/dist/theme/recipes/datepicker.js.map +1 -1
- package/dist/theme/recipes/dialog.cjs +2 -2
- package/dist/theme/recipes/dialog.cjs.map +1 -1
- package/dist/theme/recipes/dialog.js +137 -151
- package/dist/theme/recipes/dialog.js.map +1 -1
- package/dist/theme/recipes/drawer.cjs +2 -2
- package/dist/theme/recipes/drawer.cjs.map +1 -1
- package/dist/theme/recipes/drawer.js +105 -125
- package/dist/theme/recipes/drawer.js.map +1 -1
- package/dist/theme/recipes/flag.cjs +2 -2
- package/dist/theme/recipes/flag.cjs.map +1 -1
- package/dist/theme/recipes/flag.js +21 -30
- package/dist/theme/recipes/flag.js.map +1 -1
- package/dist/theme/recipes/form/control.cjs +2 -2
- package/dist/theme/recipes/form/control.cjs.map +1 -1
- package/dist/theme/recipes/form/control.js +27 -34
- package/dist/theme/recipes/form/control.js.map +1 -1
- package/dist/theme/recipes/form/helper-text.cjs +2 -2
- package/dist/theme/recipes/form/helper-text.cjs.map +1 -1
- package/dist/theme/recipes/form/helper-text.js +14 -13
- package/dist/theme/recipes/form/helper-text.js.map +1 -1
- package/dist/theme/recipes/form/label.cjs +2 -2
- package/dist/theme/recipes/form/label.cjs.map +1 -1
- package/dist/theme/recipes/form/label.js +47 -48
- package/dist/theme/recipes/form/label.js.map +1 -1
- package/dist/theme/recipes/heading.cjs +2 -2
- package/dist/theme/recipes/heading.cjs.map +1 -1
- package/dist/theme/recipes/heading.js +25 -34
- package/dist/theme/recipes/heading.js.map +1 -1
- package/dist/theme/recipes/highlightedInput.cjs +2 -2
- package/dist/theme/recipes/highlightedInput.cjs.map +1 -1
- package/dist/theme/recipes/highlightedInput.js +54 -45
- package/dist/theme/recipes/highlightedInput.js.map +1 -1
- package/dist/theme/recipes/icon-button.cjs +2 -2
- package/dist/theme/recipes/icon-button.cjs.map +1 -1
- package/dist/theme/recipes/icon-button.js +81 -89
- package/dist/theme/recipes/icon-button.js.map +1 -1
- package/dist/theme/recipes/icon.cjs +2 -2
- package/dist/theme/recipes/icon.cjs.map +1 -1
- package/dist/theme/recipes/icon.js +39 -42
- package/dist/theme/recipes/icon.js.map +1 -1
- package/dist/theme/recipes/illustration.cjs +2 -2
- package/dist/theme/recipes/illustration.cjs.map +1 -1
- package/dist/theme/recipes/illustration.js +29 -48
- package/dist/theme/recipes/illustration.js.map +1 -1
- package/dist/theme/recipes/index.cjs +2 -2
- package/dist/theme/recipes/index.cjs.map +1 -1
- package/dist/theme/recipes/index.js +127 -127
- package/dist/theme/recipes/index.js.map +1 -1
- package/dist/theme/recipes/input-addon.cjs +2 -2
- package/dist/theme/recipes/input-addon.cjs.map +1 -1
- package/dist/theme/recipes/input-addon.js +24 -24
- package/dist/theme/recipes/input-addon.js.map +1 -1
- package/dist/theme/recipes/input-group.cjs +2 -2
- package/dist/theme/recipes/input-group.cjs.map +1 -1
- package/dist/theme/recipes/input-group.js +40 -49
- package/dist/theme/recipes/input-group.js.map +1 -1
- package/dist/theme/recipes/input.cjs +2 -2
- package/dist/theme/recipes/input.cjs.map +1 -1
- package/dist/theme/recipes/input.js +48 -61
- package/dist/theme/recipes/input.js.map +1 -1
- package/dist/theme/recipes/menu.cjs +2 -2
- package/dist/theme/recipes/menu.cjs.map +1 -1
- package/dist/theme/recipes/menu.js +96 -100
- package/dist/theme/recipes/menu.js.map +1 -1
- package/dist/theme/recipes/pagination.cjs +2 -2
- package/dist/theme/recipes/pagination.cjs.map +1 -1
- package/dist/theme/recipes/pagination.js +76 -71
- package/dist/theme/recipes/pagination.js.map +1 -1
- package/dist/theme/recipes/phone-number-input.cjs +2 -2
- package/dist/theme/recipes/phone-number-input.cjs.map +1 -1
- package/dist/theme/recipes/phone-number-input.js +55 -66
- package/dist/theme/recipes/phone-number-input.js.map +1 -1
- package/dist/theme/recipes/popover.cjs +2 -2
- package/dist/theme/recipes/popover.cjs.map +1 -1
- package/dist/theme/recipes/popover.js +30 -28
- package/dist/theme/recipes/popover.js.map +1 -1
- package/dist/theme/recipes/radio-button-group.cjs +2 -2
- package/dist/theme/recipes/radio-button-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-button-group.js +83 -94
- package/dist/theme/recipes/radio-button-group.js.map +1 -1
- package/dist/theme/recipes/radio-card-group.cjs +2 -2
- package/dist/theme/recipes/radio-card-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-card-group.js +64 -67
- package/dist/theme/recipes/radio-card-group.js.map +1 -1
- package/dist/theme/recipes/radio-group.cjs +2 -2
- package/dist/theme/recipes/radio-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-group.js +101 -118
- package/dist/theme/recipes/radio-group.js.map +1 -1
- package/dist/theme/recipes/select-language.cjs +2 -2
- package/dist/theme/recipes/select-language.cjs.map +1 -1
- package/dist/theme/recipes/select-language.js +93 -112
- package/dist/theme/recipes/select-language.js.map +1 -1
- package/dist/theme/recipes/select.cjs +2 -2
- package/dist/theme/recipes/select.cjs.map +1 -1
- package/dist/theme/recipes/select.js +194 -206
- package/dist/theme/recipes/select.js.map +1 -1
- package/dist/theme/recipes/status-tag-select.cjs +2 -2
- package/dist/theme/recipes/status-tag-select.cjs.map +1 -1
- package/dist/theme/recipes/status-tag-select.js +162 -175
- package/dist/theme/recipes/status-tag-select.js.map +1 -1
- package/dist/theme/recipes/switch-card.cjs +2 -2
- package/dist/theme/recipes/switch-card.cjs.map +1 -1
- package/dist/theme/recipes/switch-card.js +43 -42
- package/dist/theme/recipes/switch-card.js.map +1 -1
- package/dist/theme/recipes/switch.cjs +2 -2
- package/dist/theme/recipes/switch.cjs.map +1 -1
- package/dist/theme/recipes/switch.js +71 -86
- package/dist/theme/recipes/switch.js.map +1 -1
- package/dist/theme/recipes/table-container.cjs +2 -2
- package/dist/theme/recipes/table-container.cjs.map +1 -1
- package/dist/theme/recipes/table-container.js +19 -18
- package/dist/theme/recipes/table-container.js.map +1 -1
- package/dist/theme/recipes/table-empty-row.cjs +2 -2
- package/dist/theme/recipes/table-empty-row.cjs.map +1 -1
- package/dist/theme/recipes/table-empty-row.js +17 -16
- package/dist/theme/recipes/table-empty-row.js.map +1 -1
- package/dist/theme/recipes/table-group-title.cjs +2 -2
- package/dist/theme/recipes/table-group-title.cjs.map +1 -1
- package/dist/theme/recipes/table-group-title.js +26 -33
- package/dist/theme/recipes/table-group-title.js.map +1 -1
- package/dist/theme/recipes/table.cjs +2 -2
- package/dist/theme/recipes/table.cjs.map +1 -1
- package/dist/theme/recipes/table.js +111 -109
- package/dist/theme/recipes/table.js.map +1 -1
- package/dist/theme/recipes/tabs-chip.cjs +2 -2
- package/dist/theme/recipes/tabs-chip.cjs.map +1 -1
- package/dist/theme/recipes/tabs-chip.js +43 -46
- package/dist/theme/recipes/tabs-chip.js.map +1 -1
- package/dist/theme/recipes/tabs.cjs +2 -2
- package/dist/theme/recipes/tabs.cjs.map +1 -1
- package/dist/theme/recipes/tabs.js +92 -125
- package/dist/theme/recipes/tabs.js.map +1 -1
- package/dist/theme/recipes/tag.cjs +2 -2
- package/dist/theme/recipes/tag.cjs.map +1 -1
- package/dist/theme/recipes/tag.js +110 -121
- package/dist/theme/recipes/tag.js.map +1 -1
- package/dist/theme/recipes/text.cjs +2 -2
- package/dist/theme/recipes/text.cjs.map +1 -1
- package/dist/theme/recipes/text.js +25 -38
- package/dist/theme/recipes/text.js.map +1 -1
- package/dist/theme/recipes/textarea.cjs +2 -2
- package/dist/theme/recipes/textarea.cjs.map +1 -1
- package/dist/theme/recipes/textarea.js +15 -14
- package/dist/theme/recipes/textarea.js.map +1 -1
- package/dist/theme/recipes/tooltip.cjs +2 -2
- package/dist/theme/recipes/tooltip.cjs.map +1 -1
- package/dist/theme/recipes/tooltip.js +47 -62
- package/dist/theme/recipes/tooltip.js.map +1 -1
- package/dist/theme/semantic-tokens/colors.cjs +2 -2
- package/dist/theme/semantic-tokens/colors.cjs.map +1 -1
- package/dist/theme/semantic-tokens/colors.js +189 -140
- package/dist/theme/semantic-tokens/colors.js.map +1 -1
- package/dist/theme/semantic-tokens/index.cjs +2 -2
- package/dist/theme/semantic-tokens/index.cjs.map +1 -1
- package/dist/theme/semantic-tokens/index.js +7 -8
- package/dist/theme/semantic-tokens/index.js.map +1 -1
- package/dist/theme/text-styles.cjs +2 -2
- package/dist/theme/text-styles.cjs.map +1 -1
- package/dist/theme/text-styles.js +70 -87
- package/dist/theme/text-styles.js.map +1 -1
- package/dist/theme/tokens/animations.cjs +2 -2
- package/dist/theme/tokens/animations.cjs.map +1 -1
- package/dist/theme/tokens/animations.js +22 -45
- package/dist/theme/tokens/animations.js.map +1 -1
- package/dist/theme/tokens/aspect-ratios.cjs +2 -2
- package/dist/theme/tokens/aspect-ratios.cjs.map +1 -1
- package/dist/theme/tokens/aspect-ratios.js +12 -11
- package/dist/theme/tokens/aspect-ratios.js.map +1 -1
- package/dist/theme/tokens/blurs.cjs +2 -2
- package/dist/theme/tokens/blurs.cjs.map +1 -1
- package/dist/theme/tokens/blurs.js +13 -12
- package/dist/theme/tokens/blurs.js.map +1 -1
- package/dist/theme/tokens/borders.cjs +2 -2
- package/dist/theme/tokens/borders.cjs.map +1 -1
- package/dist/theme/tokens/borders.js +6 -9
- package/dist/theme/tokens/borders.js.map +1 -1
- package/dist/theme/tokens/colors.cjs +2 -2
- package/dist/theme/tokens/colors.cjs.map +1 -1
- package/dist/theme/tokens/colors.js +78 -77
- package/dist/theme/tokens/colors.js.map +1 -1
- package/dist/theme/tokens/durations.cjs +2 -2
- package/dist/theme/tokens/durations.cjs.map +1 -1
- package/dist/theme/tokens/durations.js +14 -13
- package/dist/theme/tokens/durations.js.map +1 -1
- package/dist/theme/tokens/easings.cjs +3 -3
- package/dist/theme/tokens/easings.cjs.map +1 -1
- package/dist/theme/tokens/easings.js +24 -92
- package/dist/theme/tokens/easings.js.map +1 -1
- package/dist/theme/tokens/index.cjs +2 -2
- package/dist/theme/tokens/index.cjs.map +1 -1
- package/dist/theme/tokens/index.js +36 -35
- package/dist/theme/tokens/index.js.map +1 -1
- package/dist/theme/tokens/radii.cjs +2 -2
- package/dist/theme/tokens/radii.cjs.map +1 -1
- package/dist/theme/tokens/radii.js +28 -27
- package/dist/theme/tokens/radii.js.map +1 -1
- package/dist/theme/tokens/shadows.cjs +2 -2
- package/dist/theme/tokens/shadows.cjs.map +1 -1
- package/dist/theme/tokens/shadows.js +14 -13
- package/dist/theme/tokens/shadows.js.map +1 -1
- package/dist/theme/tokens/sizes.cjs +2 -2
- package/dist/theme/tokens/sizes.cjs.map +1 -1
- package/dist/theme/tokens/sizes.js +35 -84
- package/dist/theme/tokens/sizes.js.map +1 -1
- package/dist/theme/tokens/spacing.cjs +2 -2
- package/dist/theme/tokens/spacing.cjs.map +1 -1
- package/dist/theme/tokens/spacing.js +32 -83
- package/dist/theme/tokens/spacing.js.map +1 -1
- package/dist/theme/tokens/typography.cjs +2 -2
- package/dist/theme/tokens/typography.cjs.map +1 -1
- package/dist/theme/tokens/typography.js +82 -85
- package/dist/theme/tokens/typography.js.map +1 -1
- package/dist/theme/tokens/z-index.cjs +2 -2
- package/dist/theme/tokens/z-index.cjs.map +1 -1
- package/dist/theme/tokens/z-index.js +18 -41
- package/dist/theme/tokens/z-index.js.map +1 -1
- package/dist/theme/utilities.cjs +2 -2
- package/dist/theme/utilities.cjs.map +1 -1
- package/dist/theme/utilities.js +15 -16
- package/dist/theme/utilities.js.map +1 -1
- package/dist/ui.css +2 -1
- package/dist/utils/slots.cjs +2 -2
- package/dist/utils/slots.cjs.map +1 -1
- package/dist/utils/slots.js +42 -40
- package/dist/utils/slots.js.map +1 -1
- package/package.json +11 -7
- package/dist/_virtual/_commonjsHelpers.cjs +0 -2
- package/dist/_virtual/_commonjsHelpers.cjs.map +0 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -10
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/cjs.cjs +0 -2
- package/dist/_virtual/cjs.cjs.map +0 -1
- package/dist/_virtual/cjs.js +0 -9
- package/dist/_virtual/cjs.js.map +0 -1
- package/dist/_virtual/lodash.cjs +0 -2
- package/dist/_virtual/lodash.cjs.map +0 -1
- package/dist/_virtual/lodash.js +0 -7
- package/dist/_virtual/lodash.js.map +0 -1
- package/dist/_virtual/lodash2.cjs +0 -2
- package/dist/_virtual/lodash2.cjs.map +0 -1
- package/dist/_virtual/lodash2.js +0 -6
- package/dist/_virtual/lodash2.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/node_modules/@pandacss/shared/dist/index.cjs +0 -2
- package/dist/node_modules/@pandacss/shared/dist/index.cjs.map +0 -1
- package/dist/node_modules/@pandacss/shared/dist/index.js +0 -469
- package/dist/node_modules/@pandacss/shared/dist/index.js.map +0 -1
- package/dist/node_modules/@zag-js/utils/dist/functions.cjs +0 -2
- package/dist/node_modules/@zag-js/utils/dist/functions.cjs.map +0 -1
- package/dist/node_modules/@zag-js/utils/dist/functions.js +0 -6
- package/dist/node_modules/@zag-js/utils/dist/functions.js.map +0 -1
- package/dist/node_modules/lodash/lodash.cjs +0 -21
- package/dist/node_modules/lodash/lodash.cjs.map +0 -1
- package/dist/node_modules/lodash/lodash.js +0 -3686
- package/dist/node_modules/lodash/lodash.js.map +0 -1
|
@@ -1,146 +1,199 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
2
|
+
import { createStyleContext as e } from "../../utils/slots.js";
|
|
3
|
+
import { Tooltip as t } from "../tooltip/Tooltip.js";
|
|
4
|
+
import { Text as n } from "../text/Text.js";
|
|
5
|
+
import { ConditionalWrapper as r } from "../../shared/ConditionalWrapper.js";
|
|
6
|
+
import { Portal as i, Select as a, createListCollection as o, useSelectContext as s, useSelectItemContext as c } from "@ark-ui/react";
|
|
7
|
+
import { styled as l } from "@stokelp/styled-system/jsx";
|
|
8
|
+
import { select as u } from "@stokelp/styled-system/recipes";
|
|
9
|
+
import { useRef as d } from "react";
|
|
10
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
11
|
+
import { css as h } from "@stokelp/styled-system/css";
|
|
12
|
+
import { FixedSizeList as g } from "react-window";
|
|
13
|
+
//#region src/components/select/Select.tsx
|
|
14
|
+
var { withProvider: _, withContext: v } = e(u), y = _(l(a.Root), "root", { defaultProps: { loopFocus: !0 } }), b = v(l(a.ClearTrigger), "clearTrigger"), x = v(l(a.Content), "content"), S = v(l(a.Control), "control"), C = v(l(a.Indicator), "indicator"), w = v(l(a.Item), "item"), T = v(l(a.ItemText), "itemText"), E = v(l(a.Positioner), "positioner"), D = v(l(a.Trigger), "trigger"), O = v(l(a.ValueText), "valueText"), k = () => /* @__PURE__ */ m("svg", {
|
|
15
|
+
width: "16",
|
|
16
|
+
height: "17",
|
|
17
|
+
viewBox: "0 0 16 17",
|
|
18
|
+
fill: "none",
|
|
19
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20
|
+
children: [/* @__PURE__ */ p("rect", {
|
|
21
|
+
x: "0.5",
|
|
22
|
+
y: "1",
|
|
23
|
+
width: "15",
|
|
24
|
+
height: "15",
|
|
25
|
+
rx: "3.5",
|
|
26
|
+
fill: "white"
|
|
27
|
+
}), /* @__PURE__ */ p("rect", {
|
|
28
|
+
x: "0.5",
|
|
29
|
+
y: "1",
|
|
30
|
+
width: "15",
|
|
31
|
+
height: "15",
|
|
32
|
+
rx: "3.5",
|
|
33
|
+
className: h({ stroke: "grey.100" })
|
|
34
|
+
})]
|
|
35
|
+
}), A = () => /* @__PURE__ */ m("svg", {
|
|
36
|
+
width: "16",
|
|
37
|
+
height: "17",
|
|
38
|
+
viewBox: "0 0 16 17",
|
|
39
|
+
fill: "none",
|
|
40
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
41
|
+
children: [/* @__PURE__ */ p("rect", {
|
|
42
|
+
y: "0.5",
|
|
43
|
+
width: "16",
|
|
44
|
+
height: "16",
|
|
45
|
+
rx: "4",
|
|
46
|
+
className: h({ fill: "primary.500" })
|
|
47
|
+
}), /* @__PURE__ */ p("path", {
|
|
48
|
+
fillRule: "evenodd",
|
|
49
|
+
clipRule: "evenodd",
|
|
50
|
+
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",
|
|
51
|
+
fill: "white"
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
function j({ placeholder: e, allSelectedLabel: t }) {
|
|
55
|
+
let n = s(), r = n.collection.items, i = n.selectedItems;
|
|
56
|
+
return n.multiple && i.filter((e) => !e.disabled).length >= r.filter((e) => !e.disabled).length && t ? /* @__PURE__ */ p(O, {
|
|
57
|
+
className: "custom",
|
|
58
|
+
truncate: !0,
|
|
59
|
+
children: t
|
|
60
|
+
}) : /* @__PURE__ */ p(O, {
|
|
61
|
+
truncate: !0,
|
|
62
|
+
placeholder: e
|
|
63
|
+
});
|
|
35
64
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
65
|
+
function M({ renderTrigger: e, placeholder: t, allSelectedLabel: n }) {
|
|
66
|
+
let r = s(), i = r.value && r.value.length > 0 ? r.collection.findMany(r.value) : [];
|
|
67
|
+
if (i.length === 0) return /* @__PURE__ */ p(O, {
|
|
68
|
+
className: "custom",
|
|
69
|
+
truncate: !0,
|
|
70
|
+
placeholder: t
|
|
71
|
+
});
|
|
72
|
+
let a = r.selectedItems;
|
|
73
|
+
return r.multiple && a.filter((e) => !e.disabled).length >= r.collection.items.filter((e) => !e.disabled).length && n ? /* @__PURE__ */ p(O, {
|
|
74
|
+
className: "custom",
|
|
75
|
+
truncate: !0,
|
|
76
|
+
children: n
|
|
77
|
+
}) : /* @__PURE__ */ p(O, {
|
|
78
|
+
className: "custom",
|
|
79
|
+
placeholder: t,
|
|
80
|
+
children: i.map((t) => /* @__PURE__ */ p("span", { children: e(t) }, t.value))
|
|
81
|
+
});
|
|
46
82
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
83
|
+
function N({ item: e, isMultiple: t, renderItem: n }) {
|
|
84
|
+
let r = c();
|
|
85
|
+
return /* @__PURE__ */ m(f, { children: [t ? r.selected ? /* @__PURE__ */ p(A, {}) : /* @__PURE__ */ p(k, {}) : null, n ? n(e) : /* @__PURE__ */ p(T, {
|
|
86
|
+
truncate: !0,
|
|
87
|
+
children: e.label
|
|
88
|
+
})] });
|
|
53
89
|
}
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
90
|
+
function P({ items: e, placeholder: s, emptyLabel: c, usePortal: l = !0, positioning: u, renderItem: h, renderTrigger: _, virtualized: v, rowHeight: T = 34, ...O }) {
|
|
91
|
+
let k = o({ items: e }), A = d(null);
|
|
92
|
+
return /* @__PURE__ */ m(y, {
|
|
93
|
+
lazyMount: !0,
|
|
94
|
+
unmountOnExit: !0,
|
|
95
|
+
collection: k,
|
|
96
|
+
positioning: {
|
|
97
|
+
sameWidth: !0,
|
|
98
|
+
gutter: 0,
|
|
99
|
+
...u
|
|
100
|
+
},
|
|
101
|
+
"data-recipe": "select",
|
|
102
|
+
...O,
|
|
103
|
+
ref: (e) => {
|
|
104
|
+
e && (A.current = e.closest("[role=\"dialog\"]"));
|
|
105
|
+
},
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ m(S, { children: [/* @__PURE__ */ m(D, { children: [_ ? /* @__PURE__ */ p(M, {
|
|
108
|
+
renderTrigger: _,
|
|
109
|
+
placeholder: s,
|
|
110
|
+
allSelectedLabel: O.allSelectedLabel
|
|
111
|
+
}) : /* @__PURE__ */ p(j, {
|
|
112
|
+
placeholder: s,
|
|
113
|
+
allSelectedLabel: O.allSelectedLabel
|
|
114
|
+
}), /* @__PURE__ */ p(C, {
|
|
115
|
+
asChild: !0,
|
|
116
|
+
children: /* @__PURE__ */ p("svg", {
|
|
117
|
+
width: "24",
|
|
118
|
+
height: "24",
|
|
119
|
+
viewBox: "0 0 24 24",
|
|
120
|
+
fill: "none",
|
|
121
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
122
|
+
children: /* @__PURE__ */ p("path", {
|
|
123
|
+
fillRule: "evenodd",
|
|
124
|
+
clipRule: "evenodd",
|
|
125
|
+
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",
|
|
126
|
+
fill: "currentColor"
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
})] }), /* @__PURE__ */ p(b, {
|
|
130
|
+
disabled: O.readOnly,
|
|
131
|
+
asChild: !0,
|
|
132
|
+
children: /* @__PURE__ */ p("button", { children: /* @__PURE__ */ p("svg", {
|
|
133
|
+
width: "20",
|
|
134
|
+
height: "20",
|
|
135
|
+
viewBox: "0 0 20 20",
|
|
136
|
+
fill: "none",
|
|
137
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
138
|
+
children: /* @__PURE__ */ p("path", {
|
|
139
|
+
fillRule: "evenodd",
|
|
140
|
+
clipRule: "evenodd",
|
|
141
|
+
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",
|
|
142
|
+
fill: "currentColor"
|
|
143
|
+
})
|
|
144
|
+
}) })
|
|
145
|
+
})] }),
|
|
146
|
+
/* @__PURE__ */ p(r, {
|
|
147
|
+
when: l,
|
|
148
|
+
wrapper: (e) => /* @__PURE__ */ p(i, {
|
|
149
|
+
container: A,
|
|
150
|
+
children: e
|
|
151
|
+
}),
|
|
152
|
+
children: /* @__PURE__ */ p(E, { children: /* @__PURE__ */ p(x, { children: e.length === 0 ? /* @__PURE__ */ p(n, {
|
|
153
|
+
px: "space-8",
|
|
154
|
+
textAlign: "center",
|
|
155
|
+
children: c ?? "Aucun résultat"
|
|
156
|
+
}) : v ? /* @__PURE__ */ p(f, { children: /* @__PURE__ */ p(g, {
|
|
157
|
+
height: Math.min(T * e.length, 180),
|
|
158
|
+
itemCount: e.length,
|
|
159
|
+
itemSize: T,
|
|
160
|
+
width: "100%",
|
|
161
|
+
children: ({ index: n, style: i }) => /* @__PURE__ */ p(r, {
|
|
162
|
+
when: !!e[n].tooltip,
|
|
163
|
+
wrapper: (r) => /* @__PURE__ */ p(t, {
|
|
164
|
+
label: e[n].tooltip,
|
|
165
|
+
children: r
|
|
166
|
+
}),
|
|
167
|
+
children: /* @__PURE__ */ p(w, {
|
|
168
|
+
item: e[n],
|
|
169
|
+
style: i,
|
|
170
|
+
children: /* @__PURE__ */ p(N, {
|
|
171
|
+
renderItem: h,
|
|
172
|
+
item: e[n]
|
|
173
|
+
})
|
|
174
|
+
}, e[n].value)
|
|
175
|
+
}, e[n].value)
|
|
176
|
+
}) }) : e.map((e) => /* @__PURE__ */ p(r, {
|
|
177
|
+
when: !!e.tooltip,
|
|
178
|
+
wrapper: (n) => /* @__PURE__ */ p(t, {
|
|
179
|
+
label: e.tooltip,
|
|
180
|
+
children: n
|
|
181
|
+
}),
|
|
182
|
+
children: /* @__PURE__ */ p(w, {
|
|
183
|
+
item: e,
|
|
184
|
+
children: /* @__PURE__ */ p(N, {
|
|
185
|
+
renderItem: h,
|
|
186
|
+
item: e,
|
|
187
|
+
isMultiple: O.multiple
|
|
188
|
+
})
|
|
189
|
+
}, e.value)
|
|
190
|
+
}, e.value)) }) })
|
|
191
|
+
}),
|
|
192
|
+
/* @__PURE__ */ p(a.HiddenSelect, {})
|
|
193
|
+
]
|
|
194
|
+
});
|
|
142
195
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
//# sourceMappingURL=Select.js.map
|
|
196
|
+
//#endregion
|
|
197
|
+
export { P as Select };
|
|
198
|
+
|
|
199
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../src/components/select/Select.tsx"],"sourcesContent":["import {\n createListCollection,\n Portal,\n Select as ArkSelect,\n type SelectRootProps,\n useSelectItemContext,\n useSelectContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useRef } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\n\nimport { select } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(select)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkSelect.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkSelect.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkSelect.Content), 'content')\nconst Control = withContext(styled(ArkSelect.Control), 'control')\nconst Indicator = withContext(styled(ArkSelect.Indicator), 'indicator')\nconst Item = withContext(styled(ArkSelect.Item), 'item')\nconst ItemText = withContext(styled(ArkSelect.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkSelect.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkSelect.Trigger), 'trigger')\nconst ValueText = withContext(styled(ArkSelect.ValueText), 'valueText')\n\nexport interface SelectItem {\n value: string | number\n label: string\n tooltip?: ReactNode\n disabled?: boolean\n}\n\nexport type SelectProps<Item extends SelectItem> = Omit<SelectRootProps<Item>, 'collection'> & {\n items: Item[] | readonly Item[]\n renderItem?: (item: Item) => ReactNode\n renderTrigger?: (item: Item) => ReactNode\n emptyLabel?: string\n placeholder?: string\n allSelectedLabel?: string\n usePortal?: boolean\n virtualized?: boolean\n rowHeight?: number\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof select>\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 SelectItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\ninterface InnerTriggerProps<Item extends SelectItem> {\n renderTrigger: (item: Item) => ReactNode\n placeholder?: string\n allSelectedLabel?: string\n}\n\ninterface DefaultInnerTriggerProps {\n placeholder?: string\n allSelectedLabel?: string\n}\n\nfunction DefaultInnerTrigger({ placeholder, allSelectedLabel }: DefaultInnerTriggerProps) {\n const context = useSelectContext()\n const items = context.collection.items\n const selectedItems = context.selectedItems\n\n if (\n context.multiple &&\n selectedItems.filter(item => !item.disabled).length >= items.filter(item => !item.disabled).length &&\n allSelectedLabel\n ) {\n return (\n <ValueText className=\"custom\" truncate>\n {allSelectedLabel}\n </ValueText>\n )\n }\n\n return <ValueText truncate placeholder={placeholder} />\n}\n\nfunction CustomInnerTrigger<Item extends SelectItem>({\n renderTrigger,\n placeholder,\n allSelectedLabel,\n}: InnerTriggerProps<Item>) {\n const context = useSelectContext()\n const items = context.value && context.value.length > 0 ? context.collection.findMany(context.value) : []\n\n if (items.length === 0) {\n return <ValueText className=\"custom\" truncate placeholder={placeholder} />\n }\n\n const selectedItems = context.selectedItems\n\n if (\n context.multiple &&\n selectedItems.filter(item => !item.disabled).length >=\n context.collection.items.filter(item => !item.disabled).length &&\n allSelectedLabel\n ) {\n return (\n <ValueText className=\"custom\" truncate>\n {allSelectedLabel}\n </ValueText>\n )\n }\n\n return (\n <ValueText className=\"custom\" placeholder={placeholder}>\n {items.map(item => (\n <span key={item.value}>{renderTrigger(item)}</span>\n ))}\n </ValueText>\n )\n}\n\nfunction CustomInnerItem<Item extends SelectItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useSelectItemContext()\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 function Select<Item extends SelectItem>({\n items,\n placeholder,\n emptyLabel,\n usePortal = true,\n positioning,\n renderItem,\n renderTrigger,\n virtualized,\n rowHeight = 34,\n ...props\n}: SelectProps<Item>) {\n const collection = createListCollection({\n items,\n })\n const $dialogContent = useRef<HTMLDivElement | null>(null)\n\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"select\"\n {...props}\n ref={node => {\n if (node) {\n $dialogContent.current = node.closest('[role=\"dialog\"]') as HTMLDivElement | null\n }\n }}\n >\n <Control>\n <Trigger>\n {renderTrigger ? (\n <CustomInnerTrigger\n renderTrigger={renderTrigger}\n placeholder={placeholder}\n allSelectedLabel={props.allSelectedLabel}\n />\n ) : (\n <DefaultInnerTrigger placeholder={placeholder} allSelectedLabel={props.allSelectedLabel} />\n )}\n <Indicator asChild>\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 </Indicator>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal container={$dialogContent}>{children}</Portal>}>\n <Positioner>\n <Content>\n {items.length === 0 ? (\n <Text px=\"space-8\" textAlign=\"center\">\n {emptyLabel ?? 'Aucun résultat'}\n </Text>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * items.length, 180)}\n itemCount={items.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={items[index].value}\n when={!!items[index].tooltip}\n wrapper={children => <Tooltip label={items[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={items[index].value} item={items[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={items[index]} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n items.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={props.multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n <ArkSelect.HiddenSelect />\n </Root>\n )\n}\n"],"names":["withProvider","withContext","createStyleContext","select","Root","styled","ArkSelect","ClearTrigger","Content","Control","Indicator","Item","ItemText","Positioner","Trigger","ValueText","MultipleUncheckedIndicator","jsxs","jsx","css","MultipleCheckedIndicator","DefaultInnerTrigger","placeholder","allSelectedLabel","context","useSelectContext","items","selectedItems","item","CustomInnerTrigger","renderTrigger","CustomInnerItem","isMultiple","renderItem","useSelectItemContext","Fragment","Select","emptyLabel","usePortal","positioning","virtualized","rowHeight","props","collection","createListCollection","$dialogContent","useRef","node","ConditionalWrapper","children","Portal","Text","FixedSizeList","index","style","Tooltip"],"mappings":";;;;;;;;;;;;AAqBA,MAAM,EAAE,cAAAA,GAAc,aAAAC,MAAgBC,EAAmBC,CAAM,GAGzDC,IAAOJ,EAAaK,EAAOC,EAAU,IAAS,GAAG,QAAQ;AAAA,EAC7D,cAAc;AAAA,IACZ,WAAW;AAAA,EAAA;AAEf,CAAC,GAEKC,IAAeN,EAAYI,EAAOC,EAAU,YAAY,GAAG,cAAc,GACzEE,IAAUP,EAAYI,EAAOC,EAAU,OAAO,GAAG,SAAS,GAC1DG,IAAUR,EAAYI,EAAOC,EAAU,OAAO,GAAG,SAAS,GAC1DI,IAAYT,EAAYI,EAAOC,EAAU,SAAS,GAAG,WAAW,GAChEK,IAAOV,EAAYI,EAAOC,EAAU,IAAI,GAAG,MAAM,GACjDM,IAAWX,EAAYI,EAAOC,EAAU,QAAQ,GAAG,UAAU,GAC7DO,IAAaZ,EAAYI,EAAOC,EAAU,UAAU,GAAG,YAAY,GACnEQ,IAAUb,EAAYI,EAAOC,EAAU,OAAO,GAAG,SAAS,GAC1DS,IAAYd,EAAYI,EAAOC,EAAU,SAAS,GAAG,WAAW,GAsBhEU,IAAiC,MACrC,gBAAAC,EAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAChE,UAAA;AAAA,EAAA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EAAK,SAAU,UAAAqB,GAAS;AAAA,YAE7D,UAAA,gBAAA/B,EAACP,GAAA,EAAsB,MAAAiB,GACrB,UAAA,gBAAAV,EAACa,GAAA,EAAgB,YAAAE,GAAwB,MAAAL,GAAY,YAAYc,EAAM,SAAA,CAAU,EAAA,GADxEd,EAAK,KAEhB;AAAA,UAAA;AAAA,UANKA,EAAK;AAAA,QAAA,CAQb,EAAA,CAEL,EAAA,CACF,GACF;AAAA,QACA,gBAAAV,EAACZ,EAAU,cAAV,CAAA,CAAuB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG9B;"}
|
|
1
|
+
{"version":3,"file":"Select.js","names":[],"sources":["../../../src/components/select/Select.tsx"],"sourcesContent":["import {\n createListCollection,\n Portal,\n Select as ArkSelect,\n type SelectRootProps,\n useSelectItemContext,\n useSelectContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useRef } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\n\nimport { select } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(select)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkSelect.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkSelect.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkSelect.Content), 'content')\nconst Control = withContext(styled(ArkSelect.Control), 'control')\nconst Indicator = withContext(styled(ArkSelect.Indicator), 'indicator')\nconst Item = withContext(styled(ArkSelect.Item), 'item')\nconst ItemText = withContext(styled(ArkSelect.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkSelect.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkSelect.Trigger), 'trigger')\nconst ValueText = withContext(styled(ArkSelect.ValueText), 'valueText')\n\nexport interface SelectItem {\n value: string | number\n label: string\n tooltip?: ReactNode\n disabled?: boolean\n}\n\nexport type SelectProps<Item extends SelectItem> = Omit<SelectRootProps<Item>, 'collection'> & {\n items: Item[] | readonly Item[]\n renderItem?: (item: Item) => ReactNode\n renderTrigger?: (item: Item) => ReactNode\n emptyLabel?: string\n placeholder?: string\n allSelectedLabel?: string\n usePortal?: boolean\n virtualized?: boolean\n rowHeight?: number\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof select>\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 SelectItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\ninterface InnerTriggerProps<Item extends SelectItem> {\n renderTrigger: (item: Item) => ReactNode\n placeholder?: string\n allSelectedLabel?: string\n}\n\ninterface DefaultInnerTriggerProps {\n placeholder?: string\n allSelectedLabel?: string\n}\n\nfunction DefaultInnerTrigger({ placeholder, allSelectedLabel }: DefaultInnerTriggerProps) {\n const context = useSelectContext()\n const items = context.collection.items\n const selectedItems = context.selectedItems\n\n if (\n context.multiple &&\n selectedItems.filter(item => !item.disabled).length >= items.filter(item => !item.disabled).length &&\n allSelectedLabel\n ) {\n return (\n <ValueText className=\"custom\" truncate>\n {allSelectedLabel}\n </ValueText>\n )\n }\n\n return <ValueText truncate placeholder={placeholder} />\n}\n\nfunction CustomInnerTrigger<Item extends SelectItem>({\n renderTrigger,\n placeholder,\n allSelectedLabel,\n}: InnerTriggerProps<Item>) {\n const context = useSelectContext()\n const items = context.value && context.value.length > 0 ? context.collection.findMany(context.value) : []\n\n if (items.length === 0) {\n return <ValueText className=\"custom\" truncate placeholder={placeholder} />\n }\n\n const selectedItems = context.selectedItems\n\n if (\n context.multiple &&\n selectedItems.filter(item => !item.disabled).length >=\n context.collection.items.filter(item => !item.disabled).length &&\n allSelectedLabel\n ) {\n return (\n <ValueText className=\"custom\" truncate>\n {allSelectedLabel}\n </ValueText>\n )\n }\n\n return (\n <ValueText className=\"custom\" placeholder={placeholder}>\n {items.map(item => (\n <span key={item.value}>{renderTrigger(item)}</span>\n ))}\n </ValueText>\n )\n}\n\nfunction CustomInnerItem<Item extends SelectItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useSelectItemContext()\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 function Select<Item extends SelectItem>({\n items,\n placeholder,\n emptyLabel,\n usePortal = true,\n positioning,\n renderItem,\n renderTrigger,\n virtualized,\n rowHeight = 34,\n ...props\n}: SelectProps<Item>) {\n const collection = createListCollection({\n items,\n })\n const $dialogContent = useRef<HTMLDivElement | null>(null)\n\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"select\"\n {...props}\n ref={(node: HTMLDivElement | null) => {\n if (node) {\n $dialogContent.current = node.closest('[role=\"dialog\"]') as HTMLDivElement | null\n }\n }}\n >\n <Control>\n <Trigger>\n {renderTrigger ? (\n <CustomInnerTrigger\n renderTrigger={renderTrigger}\n placeholder={placeholder}\n allSelectedLabel={props.allSelectedLabel}\n />\n ) : (\n <DefaultInnerTrigger placeholder={placeholder} allSelectedLabel={props.allSelectedLabel} />\n )}\n <Indicator asChild>\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 </Indicator>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal container={$dialogContent}>{children}</Portal>}>\n <Positioner>\n <Content>\n {items.length === 0 ? (\n <Text px=\"space-8\" textAlign=\"center\">\n {emptyLabel ?? 'Aucun résultat'}\n </Text>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * items.length, 180)}\n itemCount={items.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={items[index].value}\n when={!!items[index].tooltip}\n wrapper={children => <Tooltip label={items[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={items[index].value} item={items[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={items[index]} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n items.map((item: 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={props.multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )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kBAAC,GAAD;IAAoB,MAAM;IAAW,UAAS,MAAY,kBAAC,GAAD;KAAQ,WAAW;KAAiB;IAAiB,CAAA;cAC7G,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACG,EAAM,WAAW,IAChB,kBAAC,GAAD;KAAM,IAAG;KAAU,WAAU;eAC1B,KAAc;IACX,CAAA,IACJ,IACF,kBAAA,GAAA,EAAA,UACE,kBAAC,GAAD;KACE,QAAQ,KAAK,IAAI,IAAY,EAAM,QAAQ,GAAG;KAC9C,WAAW,EAAM;KACjB,UAAU;KACV,OAAM;gBAEJ,EAAE,UAAO,eACT,kBAAC,GAAD;MAEE,MAAM,CAAC,CAAC,EAAM,GAAO;MACrB,UAAS,MAAY,kBAAC,GAAD;OAAS,OAAO,EAAM,GAAO;OAAU;MAAkB,CAAA;gBAE9E,kBAAC,GAAD;OAA+B,MAAM,EAAM;OAAe;iBACxD,kBAAC,GAAD;QAA6B;QAAY,MAAM,EAAM;OAAS,CAAA;MAC1D,GAFK,EAAM,GAAO,KAElB;KACY,GAPb,EAAM,GAAO,KAOA;IAET,CAAA,EACf,CAAA,IAEF,EAAM,KAAK,MACT,kBAAC,GAAD;KAEE,MAAM,CAAC,CAAC,EAAK;KACb,UAAS,MAAY,kBAAC,GAAD;MAAS,OAAO,EAAK;MAAU;KAAkB,CAAA;eAEtE,kBAAC,GAAD;MAA6B;gBAC3B,kBAAC,GAAD;OAA6B;OAAkB;OAAM,YAAY,EAAM;MAAW,CAAA;KAC9E,GAFK,EAAK,KAEV;IACY,GAPb,EAAK,KAOQ,CACrB,EAEI,CAAA,EACC,CAAA;GACM,CAAA;GACpB,kBAAC,EAAU,cAAX,CAAyB,CAAA;EACrB;;AAEV"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
//# sourceMappingURL=SelectLanguage.cjs.map
|
|
1
|
+
"use client";const e=require("../../utils/slots.cjs"),t=require("../../shared/ConditionalWrapper.cjs");let n=require("@ark-ui/react"),r=require("@stokelp/styled-system/jsx"),i=require("@stokelp/styled-system/recipes"),a=require("react/jsx-runtime");var{withProvider:o,withContext:s}=e.createStyleContext(i.selectLanguage),c=o((0,r.styled)(n.Select.Root),`root`,{defaultProps:{loopFocus:!0}}),l=s((0,r.styled)(n.Select.Content),`content`),u=s((0,r.styled)(n.Select.Control),`control`),d=s((0,r.styled)(n.Select.Item),`item`),f=s((0,r.styled)(n.Select.ItemText),`itemText`),p=s((0,r.styled)(n.Select.Positioner),`positioner`),m=s((0,r.styled)(n.Select.Trigger),`trigger`),h=s((0,r.styled)(n.Select.ValueText),`valueText`),g=[{value:`fr`,label:`FRA`,flag:(0,a.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,id:`flag-icons-fr`,viewBox:`0 0 640 480`,children:[(0,a.jsx)(`path`,{fill:`#fff`,d:`M0 0h640v480H0z`}),(0,a.jsx)(`path`,{fill:`#000091`,d:`M0 0h213.3v480H0z`}),(0,a.jsx)(`path`,{fill:`#e1000f`,d:`M426.7 0H640v480H426.7z`})]})},{value:`en`,label:`ENG`,flag:(0,a.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,id:`flag-icons-gb`,viewBox:`0 0 640 480`,children:[(0,a.jsx)(`path`,{fill:`#012169`,d:`M0 0h640v480H0z`}),(0,a.jsx)(`path`,{fill:`#FFF`,d:`m75 0 244 181L562 0h78v62L400 241l240 178v61h-80L320 301 81 480H0v-60l239-178L0 64V0z`}),(0,a.jsx)(`path`,{fill:`#C8102E`,d:`m424 281 216 159v40L369 281zm-184 20 6 35L54 480H0zM640 0v3L391 191l2-44L590 0zM0 0l239 176h-60L0 42z`}),(0,a.jsx)(`path`,{fill:`#FFF`,d:`M241 0v480h160V0zM0 160v160h640V160z`}),(0,a.jsx)(`path`,{fill:`#C8102E`,d:`M0 193v96h640v-96zM273 0v480h96V0z`})]})}],_=({variant:e})=>{let t=(0,n.useSelectContext)();return(0,a.jsxs)(r.HStack,{gap:`space-8`,width:`full`,css:{"& > svg":{width:`21px`,height:`15px`,borderRadius:`3px`}},children:[(t.value&&t.value.length>0?t.collection.find(t.value[0]):null)?.flag,e===`default`&&(0,a.jsx)(h,{truncate:!0})]})},v=({usePortal:e=!0,positioning:r,variant:i=`default`,...o})=>(0,a.jsxs)(c,{lazyMount:!0,unmountOnExit:!0,multiple:!1,collection:(0,n.createListCollection)({items:g}),positioning:{sameWidth:!0,gutter:0,...r},"data-recipe":`select-language`,defaultValue:[`en`],...o,children:[(0,a.jsx)(u,{children:(0,a.jsx)(m,{children:(0,a.jsx)(_,{variant:i})})}),(0,a.jsx)(t.ConditionalWrapper,{when:e,wrapper:e=>(0,a.jsx)(n.Portal,{children:e}),children:(0,a.jsx)(p,{width:i===`compact`?`fit-content !important`:``,children:(0,a.jsx)(l,{children:g.map(e=>(0,a.jsxs)(d,{item:e,gap:`space-8`,width:`full`,css:{"& > svg":{width:`21px`,height:`15px`,borderRadius:`3px`}},children:[e.flag,(0,a.jsx)(f,{truncate:!0,children:e.label})]},e.value))})})}),(0,a.jsx)(n.Select.HiddenSelect,{})]});exports.SelectLanguage=v;
|
|
2
|
+
//# sourceMappingURL=SelectLanguage.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectLanguage.cjs","sources":["../../../src/components/select-language/SelectLanguage.tsx"],"sourcesContent":["import {\n createListCollection,\n Portal,\n Select as ArkSelect,\n type SelectRootProps,\n useSelectContext,\n} from '@ark-ui/react'\nimport type { FC, ReactNode } from 'react'\nimport { HStack, styled } from '@stokelp/styled-system/jsx'\n\nimport { selectLanguage } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { ConditionalValue, HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\n\nconst { withProvider, withContext } = createStyleContext(selectLanguage)\n\nconst Root = withProvider(styled(ArkSelect.Root<SelectItem>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst Content = withContext(styled(ArkSelect.Content), 'content')\nconst Control = withContext(styled(ArkSelect.Control), 'control')\nconst Item = withContext(styled(ArkSelect.Item), 'item')\nconst ItemText = withContext(styled(ArkSelect.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkSelect.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkSelect.Trigger), 'trigger')\nconst ValueText = withContext(styled(ArkSelect.ValueText), 'valueText')\n\ntype SelectItem = { value: string | number; label: string; disabled?: boolean; flag: ReactNode }\n\nexport type SelectLanguageProps = Omit<SelectRootProps<SelectItem>, 'collection' | 'multiple'> & {\n usePortal?: boolean\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof selectLanguage>\n\nconst AVAILABLE_LANGUAGES = [\n {\n value: 'fr',\n label: 'FRA',\n flag: (\n <svg xmlns=\"http://www.w3.org/2000/svg\" id=\"flag-icons-fr\" viewBox=\"0 0 640 480\">\n <path fill=\"#fff\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#000091\" d=\"M0 0h213.3v480H0z\" />\n <path fill=\"#e1000f\" d=\"M426.7 0H640v480H426.7z\" />\n </svg>\n ),\n },\n {\n value: 'en',\n label: 'ENG',\n flag: (\n <svg xmlns=\"http://www.w3.org/2000/svg\" id=\"flag-icons-gb\" viewBox=\"0 0 640 480\">\n <path fill=\"#012169\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#FFF\" d=\"m75 0 244 181L562 0h78v62L400 241l240 178v61h-80L320 301 81 480H0v-60l239-178L0 64V0z\" />\n <path\n fill=\"#C8102E\"\n d=\"m424 281 216 159v40L369 281zm-184 20 6 35L54 480H0zM640 0v3L391 191l2-44L590 0zM0 0l239 176h-60L0 42z\"\n />\n <path fill=\"#FFF\" d=\"M241 0v480h160V0zM0 160v160h640V160z\" />\n <path fill=\"#C8102E\" d=\"M0 193v96h640v-96zM273 0v480h96V0z\" />\n </svg>\n ),\n },\n] satisfies SelectItem[]\n\nconst InnerTrigger: FC<{ variant: ConditionalValue<'default' | 'compact'> }> = ({ variant }) => {\n const context = useSelectContext()\n const selected = context.value && context.value.length > 0 ? context.collection.find(context.value[0]) : null\n\n return (\n <HStack gap=\"space-8\" width=\"full\" css={{ '& > svg': { width: '21px', height: '15px', borderRadius: '3px' } }}>\n {selected?.flag}\n {variant === 'default' && <ValueText truncate />}\n </HStack>\n )\n}\n\nexport const SelectLanguage: FC<SelectLanguageProps> = ({\n usePortal = true,\n positioning,\n variant = 'default',\n ...props\n}) => {\n const collection = createListCollection<SelectItem>({\n items: AVAILABLE_LANGUAGES,\n })\n\n return (\n <Root\n lazyMount\n unmountOnExit\n multiple={false}\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"select-language\"\n defaultValue={['en']}\n {...props}\n >\n <Control>\n <Trigger>\n <InnerTrigger variant={variant} />\n </Trigger>\n </Control>\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner width={variant === 'compact' ? 'fit-content !important' : ''}>\n <Content>\n {AVAILABLE_LANGUAGES.map(item => (\n <Item\n key={item.value}\n item={item}\n gap=\"space-8\"\n width=\"full\"\n css={{ '& > svg': { width: '21px', height: '15px', borderRadius: '3px' } }}\n >\n {item.flag}\n <ItemText truncate>{item.label}</ItemText>\n </Item>\n ))}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n <ArkSelect.HiddenSelect />\n </Root>\n )\n}\n"],"
|
|
1
|
+
{"version":3,"file":"SelectLanguage.cjs","names":[],"sources":["../../../src/components/select-language/SelectLanguage.tsx"],"sourcesContent":["import {\n createListCollection,\n Portal,\n Select as ArkSelect,\n type SelectRootProps,\n useSelectContext,\n} from '@ark-ui/react'\nimport type { FC, ReactNode } from 'react'\nimport { HStack, styled } from '@stokelp/styled-system/jsx'\n\nimport { selectLanguage } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { ConditionalValue, HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\n\nconst { withProvider, withContext } = createStyleContext(selectLanguage)\n\nconst Root = withProvider(styled(ArkSelect.Root<SelectItem>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst Content = withContext(styled(ArkSelect.Content), 'content')\nconst Control = withContext(styled(ArkSelect.Control), 'control')\nconst Item = withContext(styled(ArkSelect.Item), 'item')\nconst ItemText = withContext(styled(ArkSelect.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkSelect.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkSelect.Trigger), 'trigger')\nconst ValueText = withContext(styled(ArkSelect.ValueText), 'valueText')\n\ntype SelectItem = { value: string | number; label: string; disabled?: boolean; flag: ReactNode }\n\nexport type SelectLanguageProps = Omit<SelectRootProps<SelectItem>, 'collection' | 'multiple'> & {\n usePortal?: boolean\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof selectLanguage>\n\nconst AVAILABLE_LANGUAGES = [\n {\n value: 'fr',\n label: 'FRA',\n flag: (\n <svg xmlns=\"http://www.w3.org/2000/svg\" id=\"flag-icons-fr\" viewBox=\"0 0 640 480\">\n <path fill=\"#fff\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#000091\" d=\"M0 0h213.3v480H0z\" />\n <path fill=\"#e1000f\" d=\"M426.7 0H640v480H426.7z\" />\n </svg>\n ),\n },\n {\n value: 'en',\n label: 'ENG',\n flag: (\n <svg xmlns=\"http://www.w3.org/2000/svg\" id=\"flag-icons-gb\" viewBox=\"0 0 640 480\">\n <path fill=\"#012169\" d=\"M0 0h640v480H0z\" />\n <path fill=\"#FFF\" d=\"m75 0 244 181L562 0h78v62L400 241l240 178v61h-80L320 301 81 480H0v-60l239-178L0 64V0z\" />\n <path\n fill=\"#C8102E\"\n d=\"m424 281 216 159v40L369 281zm-184 20 6 35L54 480H0zM640 0v3L391 191l2-44L590 0zM0 0l239 176h-60L0 42z\"\n />\n <path fill=\"#FFF\" d=\"M241 0v480h160V0zM0 160v160h640V160z\" />\n <path fill=\"#C8102E\" d=\"M0 193v96h640v-96zM273 0v480h96V0z\" />\n </svg>\n ),\n },\n] satisfies SelectItem[]\n\nconst InnerTrigger: FC<{ variant: ConditionalValue<'default' | 'compact'> }> = ({ variant }) => {\n const context = useSelectContext()\n const selected = context.value && context.value.length > 0 ? context.collection.find(context.value[0]) : null\n\n return (\n <HStack gap=\"space-8\" width=\"full\" css={{ '& > svg': { width: '21px', height: '15px', borderRadius: '3px' } }}>\n {selected?.flag}\n {variant === 'default' && <ValueText truncate />}\n </HStack>\n )\n}\n\nexport const SelectLanguage: FC<SelectLanguageProps> = ({\n usePortal = true,\n positioning,\n variant = 'default',\n ...props\n}) => {\n const collection = createListCollection<SelectItem>({\n items: AVAILABLE_LANGUAGES,\n })\n\n return (\n <Root\n lazyMount\n unmountOnExit\n multiple={false}\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"select-language\"\n defaultValue={['en']}\n {...props}\n >\n <Control>\n <Trigger>\n <InnerTrigger variant={variant} />\n </Trigger>\n </Control>\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner width={variant === 'compact' ? 'fit-content !important' : ''}>\n <Content>\n {AVAILABLE_LANGUAGES.map(item => (\n <Item\n key={item.value}\n item={item}\n gap=\"space-8\"\n width=\"full\"\n css={{ '& > svg': { width: '21px', height: '15px', borderRadius: '3px' } }}\n >\n {item.flag}\n <ItemText truncate>{item.label}</ItemText>\n </Item>\n ))}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n <ArkSelect.HiddenSelect />\n </Root>\n )\n}\n"],"mappings":"yPAgBA,GAAM,CAAE,eAAc,eAAgB,EAAA,mBAAmB,EAAA,cAAc,EAEjE,EAAO,GAAA,EAAA,EAAA,QAAoB,EAAA,OAAU,IAAgB,EAAG,OAAQ,CACpE,aAAc,CACZ,UAAW,EACb,CACF,CAAC,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