@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 +1 @@
|
|
|
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, Fragment, 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 { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\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 ItemGroup = withContext(styled(ArkSelect.ItemGroup), 'itemGroup')\nconst ItemGroupLabel = withContext(styled(ArkSelect.ItemGroupLabel), 'itemGroupLabel')\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 * Renders a thin divider line after this item, separating option groups.\n * Ignored by the virtualized list (fixed row heights).\n */\n separatorAfter?: boolean\n /**\n * Heading for the group this item belongs to. Consecutive items sharing a label are\n * wrapped in one labelled group, so the heading is announced by screen readers instead\n * of being faked with a decorative row inside `renderItem`. Items without a label stay\n * ungrouped. Ignored by the virtualized list (fixed row heights).\n */\n groupLabel?: string\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\n/**\n * Splits the flat item list into consecutive runs sharing a `groupLabel`. Runs are built\n * from adjacency rather than by collecting every item with the same label, so the caller\n * keeps full control of the order: sorting is the caller's business, grouping is ours.\n */\nfunction toGroupRuns<Item extends SelectItem>(items: readonly Item[]) {\n const runs: Array<{ label?: string; items: Item[] }> = []\n\n for (const item of items) {\n const current = runs[runs.length - 1]\n if (current && current.label === item.groupLabel) {\n current.items.push(item)\n continue\n }\n runs.push({ label: item.groupLabel, items: [item] })\n }\n\n return runs\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 uiLabels = useUiLabels()\n const collection = createListCollection({\n items,\n })\n const $dialogContent = useRef<HTMLDivElement | null>(null)\n\n const renderOption = (item: Item) => (\n <Fragment key={item.value}>\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 {item.separatorAfter && (\n <div\n role=\"separator\"\n className={css({\n height: '1px',\n flexShrink: 0,\n backgroundColor: 'grey.100',\n marginY: 'space-4',\n marginX: 'space-8',\n })}\n />\n )}\n </Fragment>\n )\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 ?? uiLabels.noResults}\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 toGroupRuns<Item>(items).map((run, runIndex) =>\n run.label === undefined ? (\n <Fragment key={`group-${runIndex}`}>{run.items.map(renderOption)}</Fragment>\n ) : (\n <ItemGroup key={`group-${runIndex}`}>\n <ItemGroupLabel>{run.label}</ItemGroupLabel>\n {run.items.map(renderOption)}\n </ItemGroup>\n ),\n )\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n <ArkSelect.HiddenSelect />\n </Root>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAsBA,IAAM,EAAE,iBAAc,mBAAgB,EAAmB,CAAM,GAGzD,IAAO,EAAa,EAAO,EAAU,IAAS,GAAG,QAAQ,EAC7D,cAAc,EACZ,WAAW,GACb,EACF,CAAC,GAEK,IAAe,EAAY,EAAO,EAAU,YAAY,GAAG,cAAc,GACzE,IAAU,EAAY,EAAO,EAAU,OAAO,GAAG,SAAS,GAC1D,IAAU,EAAY,EAAO,EAAU,OAAO,GAAG,SAAS,GAC1D,IAAY,EAAY,EAAO,EAAU,SAAS,GAAG,WAAW,GAChE,IAAO,EAAY,EAAO,EAAU,IAAI,GAAG,MAAM,GACjD,IAAY,EAAY,EAAO,EAAU,SAAS,GAAG,WAAW,GAChE,IAAiB,EAAY,EAAO,EAAU,cAAc,GAAG,gBAAgB,GAC/E,IAAW,EAAY,EAAO,EAAU,QAAQ,GAAG,UAAU,GAC7D,IAAa,EAAY,EAAO,EAAU,UAAU,GAAG,YAAY,GACnE,IAAU,EAAY,EAAO,EAAU,OAAO,GAAG,SAAS,GAC1D,IAAY,EAAY,EAAO,EAAU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
1
|
+
{"version":3,"file":"Select.js","names":["ArkSelect","_Fragment","Select","Tooltip","Tooltip$1","Fragment$1","createStyleContext","select","Root","withProvider","styled","Select","ClearTrigger","withContext","Content","Control","Indicator","Item","ItemGroup","ItemGroupLabel","ItemText","Positioner","Trigger","ValueText","MultipleUncheckedIndicator","css","MultipleCheckedIndicator","DefaultInnerTrigger","context","useSelectContext","items","selectedItems","item","allSelectedLabel","CustomInnerTrigger","renderTrigger","CustomInnerItem","useSelectItemContext","isMultiple","renderItem","toGroupRuns","runs","current","Select$1","props","uiLabels","useUiLabels","collection","createListCollection","$dialogContent","useRef","renderOption","Fragment","ConditionalWrapper","positioning","node","usePortal","Portal","Text","emptyLabel","virtualized","FixedSizeList","rowHeight","index","run","runIndex"],"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, Fragment, 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 { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\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 ItemGroup = withContext(styled(ArkSelect.ItemGroup), 'itemGroup')\nconst ItemGroupLabel = withContext(styled(ArkSelect.ItemGroupLabel), 'itemGroupLabel')\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 * Renders a thin divider line after this item, separating option groups.\n * Ignored by the virtualized list (fixed row heights).\n */\n separatorAfter?: boolean\n /**\n * Heading for the group this item belongs to. Consecutive items sharing a label are\n * wrapped in one labelled group, so the heading is announced by screen readers instead\n * of being faked with a decorative row inside `renderItem`. Items without a label stay\n * ungrouped. Ignored by the virtualized list (fixed row heights).\n */\n groupLabel?: string\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\n/**\n * Splits the flat item list into consecutive runs sharing a `groupLabel`. Runs are built\n * from adjacency rather than by collecting every item with the same label, so the caller\n * keeps full control of the order: sorting is the caller's business, grouping is ours.\n */\nfunction toGroupRuns<Item extends SelectItem>(items: readonly Item[]) {\n const runs: Array<{ label?: string; items: Item[] }> = []\n\n for (const item of items) {\n const current = runs[runs.length - 1]\n if (current && current.label === item.groupLabel) {\n current.items.push(item)\n continue\n }\n runs.push({ label: item.groupLabel, items: [item] })\n }\n\n return runs\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 uiLabels = useUiLabels()\n const collection = createListCollection({\n items,\n })\n const $dialogContent = useRef<HTMLDivElement | null>(null)\n\n const renderOption = (item: Item) => (\n <Fragment key={item.value}>\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 {item.separatorAfter && (\n <div\n role=\"separator\"\n className={css({\n height: '1px',\n flexShrink: 0,\n backgroundColor: 'grey.100',\n marginY: 'space-4',\n marginX: 'space-8',\n })}\n />\n )}\n </Fragment>\n )\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 ?? uiLabels.noResults}\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 toGroupRuns<Item>(items).map((run, runIndex) =>\n run.label === undefined ? (\n <Fragment key={`group-${runIndex}`}>{run.items.map(renderOption)}</Fragment>\n ) : (\n <ItemGroup key={`group-${runIndex}`}>\n <ItemGroupLabel>{run.label}</ItemGroupLabel>\n {run.items.map(renderOption)}\n </ItemGroup>\n ),\n )\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n <ArkSelect.HiddenSelect />\n </Root>\n )\n}\n"],"mappings":";;;;;;;;;;;;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,UACGgB,EAAM,WAAW,IAChB,kBAAC4B,GAAD;KAAM,IAAG;KAAU,WAAU;KAC1B,UAAAC,KAAcd,EAAS;IACpB,CAAA,IACJe,IACF,kBAAA3D,GAAA,EAAA,UACE,kBAAC4D,GAAD;KACE,QAAQ,KAAK,IAAIC,IAAYhC,EAAM,QAAQ,GAAG;KAC9C,WAAWA,EAAM;KACjB,UAAUgC;KACV,OAAM;KAEJ,WAAA,EAAE,UAAO,eACT,kBAACT,GAAD;MAEE,MAAM,CAAC,CAACvB,EAAMiC,EAAM,CAAC;MACrB,UAAS,MAAY,kBAAC5D,GAAD;OAAS,OAAO2B,EAAMiC,EAAM,CAAC;OAAU;MAAkB,CAAA;MAE9E,UAAA,kBAAC9C,GAAD;OAA+B,MAAMa,EAAMiC;OAAe;OACxD,UAAA,kBAAC3B,GAAD;QAA6B;QAAY,MAAMN,EAAMiC;OAAS,CAAA;MAC1D,GAFKjC,EAAMiC,EAAM,CAAC,KAElB;KACY,GAPbjC,EAAMiC,EAAM,CAAC,KAOA;IAET,CAAA,EACf,CAAA,IAEFvB,EAAkBV,CAAK,CAAC,CAAC,KAAK,GAAK,MACjCkC,EAAI,UAAU,KAAA,IACZ,kBAACZ,GAAD,EAAA,UAAqCY,EAAI,MAAM,IAAIb,CAAY,EAAY,GAA5D,SAASc,GAAmD,IAE3E,kBAAC/C,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD,EAAA,UAAiB6C,EAAI,MAAsB,CAAA,GAC1CA,EAAI,MAAM,IAAIb,CAAY,CAClB,EAAA,GAHK,SAASc,GAGd,CAEf,EAEK,CAAA,EACC,CAAA;GACM,CAAA;GACpB,kBAACjE,EAAU,cAAX,CAAyB,CAAA;EACrB;;AAEV"}
|
|
@@ -1,2 +1,2 @@
|
|
|
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:[
|
|
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)(),i=t.value&&t.value.length>0?t.collection.find(t.value[0]):null;return(0,a.jsxs)(r.HStack,{gap:`space-8`,width:`full`,css:{"& > svg":{width:`21px`,height:`15px`,borderRadius:`3px`}},children:[i?.flag,e==="default"&&(0,a.jsx)(h,{truncate:!0})]})},v=({usePortal:e=!0,positioning:r,variant:i=`default`,...o})=>{let s=(0,n.createListCollection)({items:g});return(0,a.jsxs)(c,{lazyMount:!0,unmountOnExit:!0,multiple:!1,collection:s,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
2
|
//# sourceMappingURL=SelectLanguage.cjs.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
1
|
+
{"version":3,"file":"SelectLanguage.cjs","names":["createStyleContext","selectLanguage","styled","ArkSelect","useSelectContext","HStack","createListCollection","ConditionalWrapper","Portal","require_slots","require_ConditionalWrapper","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react_jsx_runtime","Root","withProvider","Content","withContext","Control","Item","ItemText","Positioner","Trigger","ValueText","AVAILABLE_LANGUAGES","InnerTrigger","context","selected","variant","SelectLanguage","props","collection","positioning","usePortal","item"],"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":"A,yPAgBA,GAAM,CAAE,eAAc,eAAgBA,EAAAA,mBAAmBC,EAAAA,cAAc,EAEjEc,EAAOC,GAAA,EAAad,EAAAA,OAAAA,CAAOC,EAAAA,OAAU,IAAgB,EAAG,OAAQ,CACpE,aAAc,CACZ,UAAW,EACb,CACF,CAAC,EAEKc,EAAUC,GAAA,EAAYhB,EAAAA,OAAAA,CAAOC,EAAAA,OAAU,OAAO,EAAG,SAAS,EAC1DgB,EAAUD,GAAA,EAAYhB,EAAAA,OAAAA,CAAOC,EAAAA,OAAU,OAAO,EAAG,SAAS,EAC1DiB,EAAOF,GAAA,EAAYhB,EAAAA,OAAAA,CAAOC,EAAAA,OAAU,IAAI,EAAG,MAAM,EACjDkB,EAAWH,GAAA,EAAYhB,EAAAA,OAAAA,CAAOC,EAAAA,OAAU,QAAQ,EAAG,UAAU,EAC7DmB,EAAaJ,GAAA,EAAYhB,EAAAA,OAAAA,CAAOC,EAAAA,OAAU,UAAU,EAAG,YAAY,EACnEoB,EAAUL,GAAA,EAAYhB,EAAAA,OAAAA,CAAOC,EAAAA,OAAU,OAAO,EAAG,SAAS,EAC1DqB,EAAYN,GAAA,EAAYhB,EAAAA,OAAAA,CAAOC,EAAAA,OAAU,SAAS,EAAG,WAAW,EAShEsB,EAAsB,CAC1B,CACE,MAAO,KACP,MAAO,MACP,MACE,EAAAX,EAAA,KAAA,CAAC,MAAD,CAAK,MAAM,6BAA6B,GAAG,gBAAgB,QAAQ,cAAnE,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,KAAK,OAAO,EAAE,iBAAmB,CAAA,GACvC,EAAAA,EAAA,IAAA,CA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T,CAAC,EAED,OACE,EAAAX,EAAA,KAAA,CAACC,EAAD,CACE,UAAA,GACA,cAAA,GACA,SAAU,GACE,aACZ,YAAa,CAAE,UAAW,GAAM,OAAQ,EAAG,GAAGkB,CAAY,EAC1D,cAAY,kBACZ,aAAc,CAAC,IAAI,EACnB,GAAIF,EARN,SAAA,EAUE,EAAAjB,EAAA,IAAA,CAACK,EAAD,CAAA,UACE,EAAAL,EAAA,IAAA,CAACS,EAAD,CAAA,UACE,EAAAT,EAAA,IAAA,CAACY,EAAD,CAAuB,SAAU,CAAA,CAC1B,CAAA,CACF,CAAA,GACT,EAAAZ,EAAA,IAAA,CAACP,EAAAA,mBAAD,CAAoB,KAAM2B,EAAW,QAAS,IAAY,EAAApB,EAAA,IAAA,CAACN,EAAAA,OAAD,CAAS,UAAiB,CAAA,EAClF,UAAA,EAAAM,EAAA,IAAA,CAACQ,EAAD,CAAY,MAAOO,IAAY,UAAY,yBAA2B,GACpE,UAAA,EAAAf,EAAA,IAAA,CAACG,EAAD,CAAA,SACGQ,EAAoB,IAAI,IACvB,EAAAX,EAAA,KAAA,CAACM,EAAD,CAEQ,OACN,IAAI,UACJ,MAAM,OACN,IAAK,CAAE,UAAW,CAAE,MAAO,OAAQ,OAAQ,OAAQ,aAAc,KAAM,CAAE,EAL3E,SAAA,CAOGe,EAAK,MACN,EAAArB,EAAA,IAAA,CAACO,EAAD,CAAU,SAAA,GAAU,SAAAc,EAAK,KAAgB,CAAA,CACrC,CARC,EAAAA,EAAK,KAQN,CACP,CACM,CAAA,CACC,CAAA,CACM,CAAA,GACpB,EAAArB,EAAA,IAAA,CAACX,EAAAA,OAAU,aAAX,CAAyB,CAAA,CACrB,C,EAEV,E"}
|
|
@@ -5,7 +5,7 @@ import { Portal as n, Select as r, createListCollection as i, useSelectContext a
|
|
|
5
5
|
import { HStack as o, styled as s } from "@stokelp/styled-system/jsx";
|
|
6
6
|
import { selectLanguage as c } from "@stokelp/styled-system/recipes";
|
|
7
7
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
// src/components/select-language/SelectLanguage.tsx
|
|
9
9
|
var { withProvider: d, withContext: f } = e(c), p = d(s(r.Root), "root", { defaultProps: { loopFocus: !0 } }), m = f(s(r.Content), "content"), h = f(s(r.Control), "control"), g = f(s(r.Item), "item"), _ = f(s(r.ItemText), "itemText"), v = f(s(r.Positioner), "positioner"), y = f(s(r.Trigger), "trigger"), b = f(s(r.ValueText), "valueText"), x = [{
|
|
10
10
|
value: "fr",
|
|
11
11
|
label: "FRA",
|
|
@@ -59,7 +59,7 @@ var { withProvider: d, withContext: f } = e(c), p = d(s(r.Root), "root", { defau
|
|
|
59
59
|
]
|
|
60
60
|
})
|
|
61
61
|
}], S = ({ variant: e }) => {
|
|
62
|
-
let t = a();
|
|
62
|
+
let t = a(), n = t.value && t.value.length > 0 ? t.collection.find(t.value[0]) : null;
|
|
63
63
|
return /* @__PURE__ */ u(o, {
|
|
64
64
|
gap: "space-8",
|
|
65
65
|
width: "full",
|
|
@@ -68,48 +68,50 @@ var { withProvider: d, withContext: f } = e(c), p = d(s(r.Root), "root", { defau
|
|
|
68
68
|
height: "15px",
|
|
69
69
|
borderRadius: "3px"
|
|
70
70
|
} },
|
|
71
|
-
children: [
|
|
71
|
+
children: [n?.flag, e === "default" && /* @__PURE__ */ l(b, { truncate: !0 })]
|
|
72
72
|
});
|
|
73
|
-
}, C = ({ usePortal: e = !0, positioning: a, variant: o = "default", ...s }) =>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
children: /* @__PURE__ */ l(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
width: "
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
children: e.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
})
|
|
112
|
-
|
|
73
|
+
}, C = ({ usePortal: e = !0, positioning: a, variant: o = "default", ...s }) => {
|
|
74
|
+
let c = i({ items: x });
|
|
75
|
+
return /* @__PURE__ */ u(p, {
|
|
76
|
+
lazyMount: !0,
|
|
77
|
+
unmountOnExit: !0,
|
|
78
|
+
multiple: !1,
|
|
79
|
+
collection: c,
|
|
80
|
+
positioning: {
|
|
81
|
+
sameWidth: !0,
|
|
82
|
+
gutter: 0,
|
|
83
|
+
...a
|
|
84
|
+
},
|
|
85
|
+
"data-recipe": "select-language",
|
|
86
|
+
defaultValue: ["en"],
|
|
87
|
+
...s,
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ l(h, { children: /* @__PURE__ */ l(y, { children: /* @__PURE__ */ l(S, { variant: o }) }) }),
|
|
90
|
+
/* @__PURE__ */ l(t, {
|
|
91
|
+
when: e,
|
|
92
|
+
wrapper: (e) => /* @__PURE__ */ l(n, { children: e }),
|
|
93
|
+
children: /* @__PURE__ */ l(v, {
|
|
94
|
+
width: o === "compact" ? "fit-content !important" : "",
|
|
95
|
+
children: /* @__PURE__ */ l(m, { children: x.map((e) => /* @__PURE__ */ u(g, {
|
|
96
|
+
item: e,
|
|
97
|
+
gap: "space-8",
|
|
98
|
+
width: "full",
|
|
99
|
+
css: { "& > svg": {
|
|
100
|
+
width: "21px",
|
|
101
|
+
height: "15px",
|
|
102
|
+
borderRadius: "3px"
|
|
103
|
+
} },
|
|
104
|
+
children: [e.flag, /* @__PURE__ */ l(_, {
|
|
105
|
+
truncate: !0,
|
|
106
|
+
children: e.label
|
|
107
|
+
})]
|
|
108
|
+
}, e.value)) })
|
|
109
|
+
})
|
|
110
|
+
}),
|
|
111
|
+
/* @__PURE__ */ l(r.HiddenSelect, {})
|
|
112
|
+
]
|
|
113
|
+
});
|
|
114
|
+
};
|
|
113
115
|
export { C as SelectLanguage };
|
|
114
116
|
|
|
115
117
|
//# sourceMappingURL=SelectLanguage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectLanguage.js","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":";;;;;;;;AAgBA,IAAM,EAAE,iBAAc,
|
|
1
|
+
{"version":3,"file":"SelectLanguage.js","names":["ArkSelect","createStyleContext","selectLanguage","Root","withProvider","styled","Select","Content","withContext","Control","Item","ItemText","Positioner","Trigger","ValueText","AVAILABLE_LANGUAGES","InnerTrigger","context","useSelectContext","selected","HStack","variant","SelectLanguage","props","collection","createListCollection","positioning","ConditionalWrapper","usePortal","Portal","item"],"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":";;;;;;;;AAgBA,IAAM,EAAE,iBAAc,mBAAgBC,EAAmBC,CAAc,GAEjEC,IAAOC,EAAaC,EAAOL,EAAU,IAAgB,GAAG,QAAQ,EACpE,cAAc,EACZ,WAAW,GACb,EACF,CAAC,GAEKO,IAAUC,EAAYH,EAAOL,EAAU,OAAO,GAAG,SAAS,GAC1DS,IAAUD,EAAYH,EAAOL,EAAU,OAAO,GAAG,SAAS,GAC1DU,IAAOF,EAAYH,EAAOL,EAAU,IAAI,GAAG,MAAM,GACjDW,IAAWH,EAAYH,EAAOL,EAAU,QAAQ,GAAG,UAAU,GAC7DY,IAAaJ,EAAYH,EAAOL,EAAU,UAAU,GAAG,YAAY,GACnEa,IAAUL,EAAYH,EAAOL,EAAU,OAAO,GAAG,SAAS,GAC1Dc,IAAYN,EAAYH,EAAOL,EAAU,S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AD;EACE,WAAA;EACA,eAAA;EACA,UAAU;EACE;EACZ,aAAa;GAAE,WAAW;GAAM,QAAQ;GAAG,GAAGuB;EAAY;EAC1D,eAAY;EACZ,cAAc,CAAC,IAAI;EACnB,GAAIH;EARN,UAAA;GAUE,kBAACd,GAAD,EAAA,UACE,kBAACI,GAAD,EAAA,UACE,kBAACG,GAAD,EAAuB,WAAU,CAAA,EAC1B,CAAA,EACF,CAAA;GACT,kBAACW,GAAD;IAAoB,MAAMC;IAAW,UAAS,MAAY,kBAACC,GAAD,EAAS,YAAiB,CAAA;IAClF,UAAA,kBAACjB,GAAD;KAAY,OAAOS,MAAY,YAAY,2BAA2B;KACpE,UAAA,kBAACd,GAAD,EAAA,UACGQ,EAAoB,KAAI,MACvB,kBAACL,GAAD;MAEQ;MACN,KAAI;MACJ,OAAM;MACN,KAAK,EAAE,WAAW;OAAE,OAAO;OAAQ,QAAQ;OAAQ,cAAc;MAAM,EAAE;MAL3E,UAAA,CAOGoB,EAAK,MACN,kBAACnB,GAAD;OAAU,UAAA;OAAU,UAAAmB,EAAK;MAAgB,CAAA,CACrC;KARC,GAAAA,EAAK,KAQN,CACP,EACM,CAAA;IACC,CAAA;GACM,CAAA;GACpB,kBAAC9B,EAAU,cAAX,CAAyB,CAAA;EACrB;;AAEV"}
|
|
@@ -1,2 +1,2 @@
|
|
|
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"),o=require("react/jsx-runtime");var{withProvider:s,withContext:c}=e.createStyleContext(i.statusTagSelect),l=s((0,r.styled)(n.Select.Root),`root`,{defaultProps:{loopFocus:!0}}),u=c((0,r.styled)(n.Select.Content),`content`),d=c((0,r.styled)(n.Select.Indicator),`indicator`),f=c((0,r.styled)(n.Select.Item),`item`),p=c((0,r.styled)(n.Select.ItemText),`itemText`),m=c((0,r.styled)(n.Select.Positioner),`positioner`),h=c((0,r.styled)(n.Select.Trigger),`trigger`),g=c((0,r.styled)(n.Select.ValueText),`valueText`),_=({items:e,lazyMount:r=!0,usePortal:i=!0,unmountOnExit:s=!0,positioning:c,onValueChange:_,severity:v,size:y,closeOnSelect:b,composite:x,defaultOpen:S,defaultValue:C,disabled:w,form:T,highlightedValue:E,id:D,ids:O,immediate:k,invalid:A,loopFocus:j,name:M,onExitComplete:N,onFocusOutside:P,onHighlightChange:F,onInteractOutside:I,onOpenChange:L,onPointerDownOutside:R,open:z,present:B,readOnly:V,required:H,scrollToIndexFn:U,value:W,...G})=>{let K=e.every(e=>`severity`in e&&!!e.severity),q=C||(e.length>0?[e[0].value.toString()]:void 0),[J,Y]=(0,a.useState)(()=>{if(q){let t=e.find(e=>e.value.toString()===q[0]);return t&&K?t.severity:`neutral`}return e.length>0&&K?e[0].severity:`neutral`}),X=e=>{e.items.length>0&&typeof e.items[0]==`object`&&Y(e.items[0].severity??`neutral`),_?.(e)};return(0,o.jsxs)(l,{closeOnSelect:b,composite:x,defaultOpen:S,lazyMount:r,unmountOnExit:s,collection:
|
|
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"),o=require("react/jsx-runtime");var{withProvider:s,withContext:c}=e.createStyleContext(i.statusTagSelect),l=s((0,r.styled)(n.Select.Root),`root`,{defaultProps:{loopFocus:!0}}),u=c((0,r.styled)(n.Select.Content),`content`),d=c((0,r.styled)(n.Select.Indicator),`indicator`),f=c((0,r.styled)(n.Select.Item),`item`),p=c((0,r.styled)(n.Select.ItemText),`itemText`),m=c((0,r.styled)(n.Select.Positioner),`positioner`),h=c((0,r.styled)(n.Select.Trigger),`trigger`),g=c((0,r.styled)(n.Select.ValueText),`valueText`),_=({items:e,lazyMount:r=!0,usePortal:i=!0,unmountOnExit:s=!0,positioning:c,onValueChange:_,severity:v,size:y,closeOnSelect:b,composite:x,defaultOpen:S,defaultValue:C,disabled:w,form:T,highlightedValue:E,id:D,ids:O,immediate:k,invalid:A,loopFocus:j,name:M,onExitComplete:N,onFocusOutside:P,onHighlightChange:F,onInteractOutside:I,onOpenChange:L,onPointerDownOutside:R,open:z,present:B,readOnly:V,required:H,scrollToIndexFn:U,value:W,...G})=>{let K=e.every(e=>`severity`in e&&!!e.severity),q=C||(e.length>0?[e[0].value.toString()]:void 0),[J,Y]=(0,a.useState)(()=>{if(q){let t=e.find(e=>e.value.toString()===q[0]);return t&&K?t.severity:`neutral`}return e.length>0&&K?e[0].severity:`neutral`}),X=e=>{e.items.length>0&&typeof e.items[0]==`object`&&Y(e.items[0].severity??`neutral`),_?.(e)},Z=(0,n.createListCollection)({items:e});return(0,o.jsxs)(l,{closeOnSelect:b,composite:x,defaultOpen:S,lazyMount:r,unmountOnExit:s,collection:Z,defaultValue:q,positioning:{sameWidth:!0,gutter:0,...c},onValueChange:K?X:_,severity:K?J:v,size:y,disabled:w,form:T,highlightedValue:E,id:D,ids:O,immediate:k,invalid:A,loopFocus:j,name:M,onExitComplete:N,onFocusOutside:P,onHighlightChange:F,onInteractOutside:I,onOpenChange:L,onPointerDownOutside:R,open:z,present:B,readOnly:V,required:H,scrollToIndexFn:U,value:W,children:[(0,o.jsxs)(h,{...G,children:[(0,o.jsx)(g,{}),(0,o.jsx)(d,{asChild:!0,children:(0,o.jsx)(`svg`,{width:`23`,height:`24`,viewBox:`0 0 23 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,o.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.0082 16.2803C11.7275 16.5732 11.2725 16.5732 10.9918 16.2803L3.80427 8.78033C3.52358 8.48744 3.52358 8.01257 3.80427 7.71967C4.08496 7.42678 4.54004 7.42678 4.82073 7.71967L11.5 14.6893L18.1793 7.71967C18.46 7.42678 18.915 7.42678 19.1957 7.71967C19.4764 8.01256 19.4764 8.48744 19.1957 8.78033L12.0082 16.2803Z`,fill:`currentColor`})})})]}),(0,o.jsx)(t.ConditionalWrapper,{when:i,wrapper:e=>(0,o.jsx)(n.Portal,{children:e}),children:(0,o.jsx)(m,{children:(0,o.jsx)(u,{children:e.map(e=>(0,o.jsx)(f,{item:e,children:(0,o.jsx)(p,{truncate:!0,children:e.label})},e.value))})})}),(0,o.jsx)(n.Select.HiddenSelect,{})]})};exports.StatusTagSelect=_;
|
|
2
2
|
//# sourceMappingURL=StatusTagSelect.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusTagSelect.cjs","names":[],"sources":["../../../src/components/status-tag-select/StatusTagSelect.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { statusTagSelect, type StatusTagSelectVariantProps } from '@stokelp/styled-system/recipes'\nimport { HTMLStyledProps } from '@stokelp/styled-system/types'\nimport { type FC, useState } from 'react'\nimport {\n Portal,\n Select as ArkSelect,\n type SelectRootProps,\n type SelectValueChangeDetails,\n createListCollection,\n} from '@ark-ui/react'\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper.tsx'\nimport { createStyleContext } from '~/utils/slots.tsx'\n\nconst { withProvider, withContext } = createStyleContext(statusTagSelect)\n\nconst Root = withProvider(styled(ArkSelect.Root<StatusTagSelectItem>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst Content = withContext(styled(ArkSelect.Content), 'content')\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\ntype Severity = StatusTagSelectVariantProps['severity']\n\nexport type StatusTagSelectItem = {\n value: string | number\n label: string\n disabled?: boolean\n severity?: Severity\n}\n\nexport type StatusTagSelectProps = Omit<SelectRootProps<StatusTagSelectItem>, 'collection' | 'multiple' | 'asChild'> & {\n items: StatusTagSelectItem[]\n usePortal?: boolean\n} & HTMLStyledProps<'button'> &\n StatusTagSelectVariantProps\n\nexport const StatusTagSelect: FC<StatusTagSelectProps> = ({\n items,\n lazyMount = true,\n usePortal = true,\n unmountOnExit = true,\n positioning,\n onValueChange,\n severity: severityFromUser,\n size,\n closeOnSelect,\n composite,\n defaultOpen,\n defaultValue: defaultValueFromUser,\n disabled,\n form,\n highlightedValue,\n id,\n ids,\n immediate,\n invalid,\n loopFocus,\n name,\n onExitComplete,\n onFocusOutside,\n onHighlightChange,\n onInteractOutside,\n onOpenChange,\n onPointerDownOutside,\n open,\n present,\n readOnly,\n required,\n scrollToIndexFn,\n value,\n ...props\n}) => {\n const shouldControlSeverity = items.every((item: StatusTagSelectItem) => 'severity' in item && !!item.severity)\n const defaultValue = defaultValueFromUser\n ? defaultValueFromUser\n : items.length > 0\n ? [items[0].value.toString()]\n : undefined\n\n const [severity, setSeverity] = useState<Severity>(() => {\n if (defaultValue) {\n const match = items.find((item: StatusTagSelectItem) => item.value.toString() === defaultValue[0])\n\n return match && shouldControlSeverity ? match.severity : 'neutral'\n }\n return items.length > 0 && shouldControlSeverity ? items[0].severity : 'neutral'\n })\n\n const onValueChangeHandler = (details: SelectValueChangeDetails<StatusTagSelectItem>) => {\n if (details.items.length > 0 && typeof details.items[0] === 'object') {\n setSeverity(((details.items[0] as StatusTagSelectItem).severity ?? 'neutral') as Severity)\n }\n onValueChange?.(details)\n }\n const collection = createListCollection({\n items,\n })\n\n return (\n <Root\n closeOnSelect={closeOnSelect}\n composite={composite}\n defaultOpen={defaultOpen}\n lazyMount={lazyMount}\n unmountOnExit={unmountOnExit}\n collection={collection}\n defaultValue={defaultValue}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n onValueChange={shouldControlSeverity ? onValueChangeHandler : onValueChange}\n severity={shouldControlSeverity ? severity : severityFromUser}\n size={size}\n disabled={disabled}\n form={form}\n highlightedValue={highlightedValue}\n id={id}\n ids={ids}\n immediate={immediate}\n invalid={invalid}\n loopFocus={loopFocus}\n name={name}\n onExitComplete={onExitComplete}\n onFocusOutside={onFocusOutside}\n onHighlightChange={onHighlightChange}\n onInteractOutside={onInteractOutside}\n onOpenChange={onOpenChange}\n onPointerDownOutside={onPointerDownOutside}\n open={open}\n present={present}\n readOnly={readOnly}\n required={required}\n scrollToIndexFn={scrollToIndexFn}\n value={value}\n >\n <Trigger {...props}>\n <ValueText />\n <Indicator asChild>\n <svg width=\"23\" height=\"24\" viewBox=\"0 0 23 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.0082 16.2803C11.7275 16.5732 11.2725 16.5732 10.9918 16.2803L3.80427 8.78033C3.52358 8.48744 3.52358 8.01257 3.80427 7.71967C4.08496 7.42678 4.54004 7.42678 4.82073 7.71967L11.5 14.6893L18.1793 7.71967C18.46 7.42678 18.915 7.42678 19.1957 7.71967C19.4764 8.01256 19.4764 8.48744 19.1957 8.78033L12.0082 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Indicator>\n </Trigger>\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {items.map((item: StatusTagSelectItem) => (\n <Item key={item.value} item={item}>\n <ItemText truncate>{item.label}</ItemText>\n </Item>\n ))}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n <ArkSelect.HiddenSelect />\n </Root>\n )\n}\n"],"mappings":"4QAcA,GAAM,CAAE,eAAc,
|
|
1
|
+
{"version":3,"file":"StatusTagSelect.cjs","names":["createStyleContext","statusTagSelect","styled","ArkSelect","useState","createListCollection","ConditionalWrapper","Portal","require_slots","require_ConditionalWrapper","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react","react_jsx_runtime","Root","withProvider","Content","withContext","Indicator","Item","ItemText","Positioner","Trigger","ValueText","StatusTagSelect","severityFromUser","defaultValueFromUser","props","shouldControlSeverity","items","item","defaultValue","severity","setSeverity","match","onValueChangeHandler","details","onValueChange","collection","positioning","usePortal"],"sources":["../../../src/components/status-tag-select/StatusTagSelect.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { statusTagSelect, type StatusTagSelectVariantProps } from '@stokelp/styled-system/recipes'\nimport { HTMLStyledProps } from '@stokelp/styled-system/types'\nimport { type FC, useState } from 'react'\nimport {\n Portal,\n Select as ArkSelect,\n type SelectRootProps,\n type SelectValueChangeDetails,\n createListCollection,\n} from '@ark-ui/react'\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper.tsx'\nimport { createStyleContext } from '~/utils/slots.tsx'\n\nconst { withProvider, withContext } = createStyleContext(statusTagSelect)\n\nconst Root = withProvider(styled(ArkSelect.Root<StatusTagSelectItem>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst Content = withContext(styled(ArkSelect.Content), 'content')\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\ntype Severity = StatusTagSelectVariantProps['severity']\n\nexport type StatusTagSelectItem = {\n value: string | number\n label: string\n disabled?: boolean\n severity?: Severity\n}\n\nexport type StatusTagSelectProps = Omit<SelectRootProps<StatusTagSelectItem>, 'collection' | 'multiple' | 'asChild'> & {\n items: StatusTagSelectItem[]\n usePortal?: boolean\n} & HTMLStyledProps<'button'> &\n StatusTagSelectVariantProps\n\nexport const StatusTagSelect: FC<StatusTagSelectProps> = ({\n items,\n lazyMount = true,\n usePortal = true,\n unmountOnExit = true,\n positioning,\n onValueChange,\n severity: severityFromUser,\n size,\n closeOnSelect,\n composite,\n defaultOpen,\n defaultValue: defaultValueFromUser,\n disabled,\n form,\n highlightedValue,\n id,\n ids,\n immediate,\n invalid,\n loopFocus,\n name,\n onExitComplete,\n onFocusOutside,\n onHighlightChange,\n onInteractOutside,\n onOpenChange,\n onPointerDownOutside,\n open,\n present,\n readOnly,\n required,\n scrollToIndexFn,\n value,\n ...props\n}) => {\n const shouldControlSeverity = items.every((item: StatusTagSelectItem) => 'severity' in item && !!item.severity)\n const defaultValue = defaultValueFromUser\n ? defaultValueFromUser\n : items.length > 0\n ? [items[0].value.toString()]\n : undefined\n\n const [severity, setSeverity] = useState<Severity>(() => {\n if (defaultValue) {\n const match = items.find((item: StatusTagSelectItem) => item.value.toString() === defaultValue[0])\n\n return match && shouldControlSeverity ? match.severity : 'neutral'\n }\n return items.length > 0 && shouldControlSeverity ? items[0].severity : 'neutral'\n })\n\n const onValueChangeHandler = (details: SelectValueChangeDetails<StatusTagSelectItem>) => {\n if (details.items.length > 0 && typeof details.items[0] === 'object') {\n setSeverity(((details.items[0] as StatusTagSelectItem).severity ?? 'neutral') as Severity)\n }\n onValueChange?.(details)\n }\n const collection = createListCollection<StatusTagSelectItem>({\n items,\n })\n\n return (\n <Root\n closeOnSelect={closeOnSelect}\n composite={composite}\n defaultOpen={defaultOpen}\n lazyMount={lazyMount}\n unmountOnExit={unmountOnExit}\n collection={collection}\n defaultValue={defaultValue}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n onValueChange={shouldControlSeverity ? onValueChangeHandler : onValueChange}\n severity={shouldControlSeverity ? severity : severityFromUser}\n size={size}\n disabled={disabled}\n form={form}\n highlightedValue={highlightedValue}\n id={id}\n ids={ids}\n immediate={immediate}\n invalid={invalid}\n loopFocus={loopFocus}\n name={name}\n onExitComplete={onExitComplete}\n onFocusOutside={onFocusOutside}\n onHighlightChange={onHighlightChange}\n onInteractOutside={onInteractOutside}\n onOpenChange={onOpenChange}\n onPointerDownOutside={onPointerDownOutside}\n open={open}\n present={present}\n readOnly={readOnly}\n required={required}\n scrollToIndexFn={scrollToIndexFn}\n value={value}\n >\n <Trigger {...props}>\n <ValueText />\n <Indicator asChild>\n <svg width=\"23\" height=\"24\" viewBox=\"0 0 23 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.0082 16.2803C11.7275 16.5732 11.2725 16.5732 10.9918 16.2803L3.80427 8.78033C3.52358 8.48744 3.52358 8.01257 3.80427 7.71967C4.08496 7.42678 4.54004 7.42678 4.82073 7.71967L11.5 14.6893L18.1793 7.71967C18.46 7.42678 18.915 7.42678 19.1957 7.71967C19.4764 8.01256 19.4764 8.48744 19.1957 8.78033L12.0082 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Indicator>\n </Trigger>\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {items.map((item: StatusTagSelectItem) => (\n <Item key={item.value} item={item}>\n <ItemText truncate>{item.label}</ItemText>\n </Item>\n ))}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n <ArkSelect.HiddenSelect />\n </Root>\n )\n}\n"],"mappings":"A,4QAcA,GAAM,CAAE,eAAc,eAAgBA,EAAAA,mBAAmBC,EAAAA,eAAe,EAElEc,EAAOC,GAAA,EAAad,EAAAA,OAAAA,CAAOC,EAAAA,OAAU,IAAyB,EAAG,OAAQ,CAC7E,aAAc,CACZ,UAAW,EACb,CACF,CAAC,EAEKc,EAAUC,GAAA,EAAYhB,EAAAA,OAAAA,CAAOC,EAAAA,OAAU,OAAO,EAAG,SAAS,EAC1DgB,EAAYD,GAAA,EAAYhB,EAAAA,OAAAA,CAAOC,EAAAA,OAAU,SAAS,EAAG,WAAW,EAChEiB,EAAOF,GAAA,EAAYhB,EAAAA,OAAAA,CAAOC,EAAAA,OAAU,IAAI,EAAG,MAAM,EACjDkB,EAAWH,GAAA,EAAYhB,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ACrB,C,EAEV,E"}
|
|
@@ -6,32 +6,32 @@ import { styled as a } from "@stokelp/styled-system/jsx";
|
|
|
6
6
|
import { statusTagSelect as o } from "@stokelp/styled-system/recipes";
|
|
7
7
|
import { useState as s } from "react";
|
|
8
8
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
|
-
|
|
10
|
-
var { withProvider: u, withContext: d } = e(o), f = u(a(r.Root), "root", { defaultProps: { loopFocus: !0 } }), p = d(a(r.Content), "content"), m = d(a(r.Indicator), "indicator"), h = d(a(r.Item), "item"), g = d(a(r.ItemText), "itemText"), _ = d(a(r.Positioner), "positioner"), v = d(a(r.Trigger), "trigger"), y = d(a(r.ValueText), "valueText"), b = ({ items: e, lazyMount: a = !0, usePortal: o = !0, unmountOnExit: u = !0, positioning: d, onValueChange: b, severity: x, size: S, closeOnSelect: C, composite: w, defaultOpen: T, defaultValue: E, disabled: D, form: O, highlightedValue: k, id: A, ids: j, immediate: M, invalid:
|
|
11
|
-
let
|
|
12
|
-
if (
|
|
13
|
-
let t = e.find((e) => e.value.toString() ===
|
|
14
|
-
return t &&
|
|
9
|
+
// src/components/status-tag-select/StatusTagSelect.tsx
|
|
10
|
+
var { withProvider: u, withContext: d } = e(o), f = u(a(r.Root), "root", { defaultProps: { loopFocus: !0 } }), p = d(a(r.Content), "content"), m = d(a(r.Indicator), "indicator"), h = d(a(r.Item), "item"), g = d(a(r.ItemText), "itemText"), _ = d(a(r.Positioner), "positioner"), v = d(a(r.Trigger), "trigger"), y = d(a(r.ValueText), "valueText"), b = ({ items: e, lazyMount: a = !0, usePortal: o = !0, unmountOnExit: u = !0, positioning: d, onValueChange: b, severity: x, size: S, closeOnSelect: C, composite: w, defaultOpen: T, defaultValue: E, disabled: D, form: O, highlightedValue: k, id: A, ids: j, immediate: M, invalid: ee, loopFocus: N, name: P, onExitComplete: F, onFocusOutside: I, onHighlightChange: L, onInteractOutside: R, onOpenChange: z, onPointerDownOutside: B, open: V, present: H, readOnly: U, required: W, scrollToIndexFn: G, value: K, ...q }) => {
|
|
11
|
+
let J = e.every((e) => "severity" in e && !!e.severity), Y = E || (e.length > 0 ? [e[0].value.toString()] : void 0), [X, Z] = s(() => {
|
|
12
|
+
if (Y) {
|
|
13
|
+
let t = e.find((e) => e.value.toString() === Y[0]);
|
|
14
|
+
return t && J ? t.severity : "neutral";
|
|
15
15
|
}
|
|
16
|
-
return e.length > 0 &&
|
|
17
|
-
}),
|
|
18
|
-
e.items.length > 0 && typeof e.items[0] == "object" &&
|
|
19
|
-
};
|
|
16
|
+
return e.length > 0 && J ? e[0].severity : "neutral";
|
|
17
|
+
}), Q = (e) => {
|
|
18
|
+
e.items.length > 0 && typeof e.items[0] == "object" && Z(e.items[0].severity ?? "neutral"), b?.(e);
|
|
19
|
+
}, $ = i({ items: e });
|
|
20
20
|
return /* @__PURE__ */ l(f, {
|
|
21
21
|
closeOnSelect: C,
|
|
22
22
|
composite: w,
|
|
23
23
|
defaultOpen: T,
|
|
24
24
|
lazyMount: a,
|
|
25
25
|
unmountOnExit: u,
|
|
26
|
-
collection:
|
|
27
|
-
defaultValue:
|
|
26
|
+
collection: $,
|
|
27
|
+
defaultValue: Y,
|
|
28
28
|
positioning: {
|
|
29
29
|
sameWidth: !0,
|
|
30
30
|
gutter: 0,
|
|
31
31
|
...d
|
|
32
32
|
},
|
|
33
|
-
onValueChange:
|
|
34
|
-
severity:
|
|
33
|
+
onValueChange: J ? Q : b,
|
|
34
|
+
severity: J ? X : x,
|
|
35
35
|
size: S,
|
|
36
36
|
disabled: D,
|
|
37
37
|
form: O,
|
|
@@ -39,24 +39,24 @@ var { withProvider: u, withContext: d } = e(o), f = u(a(r.Root), "root", { defau
|
|
|
39
39
|
id: A,
|
|
40
40
|
ids: j,
|
|
41
41
|
immediate: M,
|
|
42
|
-
invalid:
|
|
43
|
-
loopFocus:
|
|
44
|
-
name:
|
|
45
|
-
onExitComplete:
|
|
46
|
-
onFocusOutside:
|
|
47
|
-
onHighlightChange:
|
|
48
|
-
onInteractOutside:
|
|
49
|
-
onOpenChange:
|
|
50
|
-
onPointerDownOutside:
|
|
51
|
-
open:
|
|
52
|
-
present:
|
|
53
|
-
readOnly:
|
|
54
|
-
required:
|
|
55
|
-
scrollToIndexFn:
|
|
56
|
-
value:
|
|
42
|
+
invalid: ee,
|
|
43
|
+
loopFocus: N,
|
|
44
|
+
name: P,
|
|
45
|
+
onExitComplete: F,
|
|
46
|
+
onFocusOutside: I,
|
|
47
|
+
onHighlightChange: L,
|
|
48
|
+
onInteractOutside: R,
|
|
49
|
+
onOpenChange: z,
|
|
50
|
+
onPointerDownOutside: B,
|
|
51
|
+
open: V,
|
|
52
|
+
present: H,
|
|
53
|
+
readOnly: U,
|
|
54
|
+
required: W,
|
|
55
|
+
scrollToIndexFn: G,
|
|
56
|
+
value: K,
|
|
57
57
|
children: [
|
|
58
58
|
/* @__PURE__ */ l(v, {
|
|
59
|
-
...
|
|
59
|
+
...q,
|
|
60
60
|
children: [/* @__PURE__ */ c(y, {}), /* @__PURE__ */ c(m, {
|
|
61
61
|
asChild: !0,
|
|
62
62
|
children: /* @__PURE__ */ c("svg", {
|
|
@@ -89,7 +89,6 @@ var { withProvider: u, withContext: d } = e(o), f = u(a(r.Root), "root", { defau
|
|
|
89
89
|
]
|
|
90
90
|
});
|
|
91
91
|
};
|
|
92
|
-
//#endregion
|
|
93
92
|
export { b as StatusTagSelect };
|
|
94
93
|
|
|
95
94
|
//# sourceMappingURL=StatusTagSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusTagSelect.js","names":[],"sources":["../../../src/components/status-tag-select/StatusTagSelect.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { statusTagSelect, type StatusTagSelectVariantProps } from '@stokelp/styled-system/recipes'\nimport { HTMLStyledProps } from '@stokelp/styled-system/types'\nimport { type FC, useState } from 'react'\nimport {\n Portal,\n Select as ArkSelect,\n type SelectRootProps,\n type SelectValueChangeDetails,\n createListCollection,\n} from '@ark-ui/react'\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper.tsx'\nimport { createStyleContext } from '~/utils/slots.tsx'\n\nconst { withProvider, withContext } = createStyleContext(statusTagSelect)\n\nconst Root = withProvider(styled(ArkSelect.Root<StatusTagSelectItem>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst Content = withContext(styled(ArkSelect.Content), 'content')\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\ntype Severity = StatusTagSelectVariantProps['severity']\n\nexport type StatusTagSelectItem = {\n value: string | number\n label: string\n disabled?: boolean\n severity?: Severity\n}\n\nexport type StatusTagSelectProps = Omit<SelectRootProps<StatusTagSelectItem>, 'collection' | 'multiple' | 'asChild'> & {\n items: StatusTagSelectItem[]\n usePortal?: boolean\n} & HTMLStyledProps<'button'> &\n StatusTagSelectVariantProps\n\nexport const StatusTagSelect: FC<StatusTagSelectProps> = ({\n items,\n lazyMount = true,\n usePortal = true,\n unmountOnExit = true,\n positioning,\n onValueChange,\n severity: severityFromUser,\n size,\n closeOnSelect,\n composite,\n defaultOpen,\n defaultValue: defaultValueFromUser,\n disabled,\n form,\n highlightedValue,\n id,\n ids,\n immediate,\n invalid,\n loopFocus,\n name,\n onExitComplete,\n onFocusOutside,\n onHighlightChange,\n onInteractOutside,\n onOpenChange,\n onPointerDownOutside,\n open,\n present,\n readOnly,\n required,\n scrollToIndexFn,\n value,\n ...props\n}) => {\n const shouldControlSeverity = items.every((item: StatusTagSelectItem) => 'severity' in item && !!item.severity)\n const defaultValue = defaultValueFromUser\n ? defaultValueFromUser\n : items.length > 0\n ? [items[0].value.toString()]\n : undefined\n\n const [severity, setSeverity] = useState<Severity>(() => {\n if (defaultValue) {\n const match = items.find((item: StatusTagSelectItem) => item.value.toString() === defaultValue[0])\n\n return match && shouldControlSeverity ? match.severity : 'neutral'\n }\n return items.length > 0 && shouldControlSeverity ? items[0].severity : 'neutral'\n })\n\n const onValueChangeHandler = (details: SelectValueChangeDetails<StatusTagSelectItem>) => {\n if (details.items.length > 0 && typeof details.items[0] === 'object') {\n setSeverity(((details.items[0] as StatusTagSelectItem).severity ?? 'neutral') as Severity)\n }\n onValueChange?.(details)\n }\n const collection = createListCollection({\n items,\n })\n\n return (\n <Root\n closeOnSelect={closeOnSelect}\n composite={composite}\n defaultOpen={defaultOpen}\n lazyMount={lazyMount}\n unmountOnExit={unmountOnExit}\n collection={collection}\n defaultValue={defaultValue}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n onValueChange={shouldControlSeverity ? onValueChangeHandler : onValueChange}\n severity={shouldControlSeverity ? severity : severityFromUser}\n size={size}\n disabled={disabled}\n form={form}\n highlightedValue={highlightedValue}\n id={id}\n ids={ids}\n immediate={immediate}\n invalid={invalid}\n loopFocus={loopFocus}\n name={name}\n onExitComplete={onExitComplete}\n onFocusOutside={onFocusOutside}\n onHighlightChange={onHighlightChange}\n onInteractOutside={onInteractOutside}\n onOpenChange={onOpenChange}\n onPointerDownOutside={onPointerDownOutside}\n open={open}\n present={present}\n readOnly={readOnly}\n required={required}\n scrollToIndexFn={scrollToIndexFn}\n value={value}\n >\n <Trigger {...props}>\n <ValueText />\n <Indicator asChild>\n <svg width=\"23\" height=\"24\" viewBox=\"0 0 23 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.0082 16.2803C11.7275 16.5732 11.2725 16.5732 10.9918 16.2803L3.80427 8.78033C3.52358 8.48744 3.52358 8.01257 3.80427 7.71967C4.08496 7.42678 4.54004 7.42678 4.82073 7.71967L11.5 14.6893L18.1793 7.71967C18.46 7.42678 18.915 7.42678 19.1957 7.71967C19.4764 8.01256 19.4764 8.48744 19.1957 8.78033L12.0082 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Indicator>\n </Trigger>\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {items.map((item: StatusTagSelectItem) => (\n <Item key={item.value} item={item}>\n <ItemText truncate>{item.label}</ItemText>\n </Item>\n ))}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n <ArkSelect.HiddenSelect />\n </Root>\n )\n}\n"],"mappings":";;;;;;;;;AAcA,IAAM,EAAE,iBAAc,
|
|
1
|
+
{"version":3,"file":"StatusTagSelect.js","names":["ArkSelect","createStyleContext","statusTagSelect","Root","withProvider","styled","Select","Content","withContext","Indicator","Item","ItemText","Positioner","Trigger","ValueText","StatusTagSelect","severityFromUser","defaultValueFromUser","props","shouldControlSeverity","items","item","defaultValue","severity","setSeverity","useState","match","onValueChangeHandler","details","onValueChange","collection","createListCollection","positioning","ConditionalWrapper","usePortal","Portal"],"sources":["../../../src/components/status-tag-select/StatusTagSelect.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { statusTagSelect, type StatusTagSelectVariantProps } from '@stokelp/styled-system/recipes'\nimport { HTMLStyledProps } from '@stokelp/styled-system/types'\nimport { type FC, useState } from 'react'\nimport {\n Portal,\n Select as ArkSelect,\n type SelectRootProps,\n type SelectValueChangeDetails,\n createListCollection,\n} from '@ark-ui/react'\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper.tsx'\nimport { createStyleContext } from '~/utils/slots.tsx'\n\nconst { withProvider, withContext } = createStyleContext(statusTagSelect)\n\nconst Root = withProvider(styled(ArkSelect.Root<StatusTagSelectItem>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst Content = withContext(styled(ArkSelect.Content), 'content')\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\ntype Severity = StatusTagSelectVariantProps['severity']\n\nexport type StatusTagSelectItem = {\n value: string | number\n label: string\n disabled?: boolean\n severity?: Severity\n}\n\nexport type StatusTagSelectProps = Omit<SelectRootProps<StatusTagSelectItem>, 'collection' | 'multiple' | 'asChild'> & {\n items: StatusTagSelectItem[]\n usePortal?: boolean\n} & HTMLStyledProps<'button'> &\n StatusTagSelectVariantProps\n\nexport const StatusTagSelect: FC<StatusTagSelectProps> = ({\n items,\n lazyMount = true,\n usePortal = true,\n unmountOnExit = true,\n positioning,\n onValueChange,\n severity: severityFromUser,\n size,\n closeOnSelect,\n composite,\n defaultOpen,\n defaultValue: defaultValueFromUser,\n disabled,\n form,\n highlightedValue,\n id,\n ids,\n immediate,\n invalid,\n loopFocus,\n name,\n onExitComplete,\n onFocusOutside,\n onHighlightChange,\n onInteractOutside,\n onOpenChange,\n onPointerDownOutside,\n open,\n present,\n readOnly,\n required,\n scrollToIndexFn,\n value,\n ...props\n}) => {\n const shouldControlSeverity = items.every((item: StatusTagSelectItem) => 'severity' in item && !!item.severity)\n const defaultValue = defaultValueFromUser\n ? defaultValueFromUser\n : items.length > 0\n ? [items[0].value.toString()]\n : undefined\n\n const [severity, setSeverity] = useState<Severity>(() => {\n if (defaultValue) {\n const match = items.find((item: StatusTagSelectItem) => item.value.toString() === defaultValue[0])\n\n return match && shouldControlSeverity ? match.severity : 'neutral'\n }\n return items.length > 0 && shouldControlSeverity ? items[0].severity : 'neutral'\n })\n\n const onValueChangeHandler = (details: SelectValueChangeDetails<StatusTagSelectItem>) => {\n if (details.items.length > 0 && typeof details.items[0] === 'object') {\n setSeverity(((details.items[0] as StatusTagSelectItem).severity ?? 'neutral') as Severity)\n }\n onValueChange?.(details)\n }\n const collection = createListCollection<StatusTagSelectItem>({\n items,\n })\n\n return (\n <Root\n closeOnSelect={closeOnSelect}\n composite={composite}\n defaultOpen={defaultOpen}\n lazyMount={lazyMount}\n unmountOnExit={unmountOnExit}\n collection={collection}\n defaultValue={defaultValue}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n onValueChange={shouldControlSeverity ? onValueChangeHandler : onValueChange}\n severity={shouldControlSeverity ? severity : severityFromUser}\n size={size}\n disabled={disabled}\n form={form}\n highlightedValue={highlightedValue}\n id={id}\n ids={ids}\n immediate={immediate}\n invalid={invalid}\n loopFocus={loopFocus}\n name={name}\n onExitComplete={onExitComplete}\n onFocusOutside={onFocusOutside}\n onHighlightChange={onHighlightChange}\n onInteractOutside={onInteractOutside}\n onOpenChange={onOpenChange}\n onPointerDownOutside={onPointerDownOutside}\n open={open}\n present={present}\n readOnly={readOnly}\n required={required}\n scrollToIndexFn={scrollToIndexFn}\n value={value}\n >\n <Trigger {...props}>\n <ValueText />\n <Indicator asChild>\n <svg width=\"23\" height=\"24\" viewBox=\"0 0 23 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.0082 16.2803C11.7275 16.5732 11.2725 16.5732 10.9918 16.2803L3.80427 8.78033C3.52358 8.48744 3.52358 8.01257 3.80427 7.71967C4.08496 7.42678 4.54004 7.42678 4.82073 7.71967L11.5 14.6893L18.1793 7.71967C18.46 7.42678 18.915 7.42678 19.1957 7.71967C19.4764 8.01256 19.4764 8.48744 19.1957 8.78033L12.0082 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Indicator>\n </Trigger>\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {items.map((item: StatusTagSelectItem) => (\n <Item key={item.value} item={item}>\n <ItemText truncate>{item.label}</ItemText>\n </Item>\n ))}\n </Content>\n </Positioner>\n </Conditional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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.cjs","names":[],"sources":["../../../src/components/steps/Steps.tsx"],"sourcesContent":["import { Steps as ArkSteps } from '@ark-ui/react'\nimport { ComponentProps } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { steps } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots.tsx'\n\nconst { withProvider, withContext } = createStyleContext(steps)\n\nexport const Steps = withProvider(styled(ArkSteps.Root), 'root')\nexport const StepsList = withContext(styled(ArkSteps.List), 'list')\nexport const StepsItem = withContext(styled(ArkSteps.Item), 'item')\nexport const StepsTrigger = withContext(styled(ArkSteps.Trigger), 'trigger')\nexport const StepsIndicator = withContext(styled(ArkSteps.Indicator), 'indicator')\nexport const StepsSeparator = withContext(styled(ArkSteps.Separator), 'separator')\nexport const StepsContent = withContext(styled(ArkSteps.Content), 'content')\n\nexport interface StepsProps extends ComponentProps<typeof Steps> {}\n\nexport interface StepsListProps extends ComponentProps<typeof StepsList> {}\n\nexport interface StepsItemProps extends ComponentProps<typeof StepsItem> {}\n\nexport interface StepsTriggerProps extends ComponentProps<typeof StepsTrigger> {}\n\nexport interface StepsIndicatorProps extends ComponentProps<typeof StepsIndicator> {}\n\nexport interface StepsSeparatorProps extends ComponentProps<typeof StepsSeparator> {}\n\nexport interface StepsContentProps extends ComponentProps<typeof StepsContent> {}\n"],"mappings":"yKAMA,GAAM,CAAE,eAAc,
|
|
1
|
+
{"version":3,"file":"Steps.cjs","names":["createStyleContext","steps","styled","ArkSteps","require_slots","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","Steps","withProvider","StepsList","withContext","StepsItem","StepsTrigger","StepsIndicator","StepsSeparator","StepsContent"],"sources":["../../../src/components/steps/Steps.tsx"],"sourcesContent":["import { Steps as ArkSteps } from '@ark-ui/react'\nimport { ComponentProps } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { steps } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots.tsx'\n\nconst { withProvider, withContext } = createStyleContext(steps)\n\nexport const Steps = withProvider(styled(ArkSteps.Root), 'root')\nexport const StepsList = withContext(styled(ArkSteps.List), 'list')\nexport const StepsItem = withContext(styled(ArkSteps.Item), 'item')\nexport const StepsTrigger = withContext(styled(ArkSteps.Trigger), 'trigger')\nexport const StepsIndicator = withContext(styled(ArkSteps.Indicator), 'indicator')\nexport const StepsSeparator = withContext(styled(ArkSteps.Separator), 'separator')\nexport const StepsContent = withContext(styled(ArkSteps.Content), 'content')\n\nexport interface StepsProps extends ComponentProps<typeof Steps> {}\n\nexport interface StepsListProps extends ComponentProps<typeof StepsList> {}\n\nexport interface StepsItemProps extends ComponentProps<typeof StepsItem> {}\n\nexport interface StepsTriggerProps extends ComponentProps<typeof StepsTrigger> {}\n\nexport interface StepsIndicatorProps extends ComponentProps<typeof StepsIndicator> {}\n\nexport interface StepsSeparatorProps extends ComponentProps<typeof StepsSeparator> {}\n\nexport interface StepsContentProps extends ComponentProps<typeof StepsContent> {}\n"],"mappings":"A,yKAMA,GAAM,CAAE,eAAc,eAAgBA,EAAAA,mBAAmBC,EAAAA,KAAK,EAEjDO,EAAQC,GAAA,EAAaP,EAAAA,OAAAA,CAAOC,EAAAA,MAAS,IAAI,EAAG,MAAM,EAClDO,EAAYC,GAAA,EAAYT,EAAAA,OAAAA,CAAOC,EAAAA,MAAS,IAAI,EAAG,MAAM,EACrDS,EAAYD,GAAA,EAAYT,EAAAA,OAAAA,CAAOC,EAAAA,MAAS,IAAI,EAAG,MAAM,EACrDU,EAAeF,GAAA,EAAYT,EAAAA,OAAAA,CAAOC,EAAAA,MAAS,OAAO,EAAG,SAAS,EAC9DW,EAAiBH,GAAA,EAAYT,EAAAA,OAAAA,CAAOC,EAAAA,MAAS,SAAS,EAAG,WAAW,EACpEY,EAAiBJ,GAAA,EAAYT,EAAAA,OAAAA,CAAOC,EAAAA,MAAS,SAAS,EAAG,WAAW,EACpEa,EAAeL,GAAA,EAAYT,EAAAA,OAAAA,CAAOC,EAAAA,MAAS,OAAO,EAAG,SAAS,E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Steps as ArkSteps } from '@ark-ui/react';
|
|
2
2
|
import { ComponentProps, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
3
|
import { ComponentVariants } from '../../utils/slots.tsx';
|
|
4
|
-
import { StyledComponent } from '@stokelp/styled-system/
|
|
4
|
+
import { StyledComponent } from '@stokelp/styled-system/jsx';
|
|
5
5
|
import { StepsRecipe } from '@stokelp/styled-system/recipes';
|
|
6
6
|
export declare const Steps: ComponentVariants<StyledComponent<ForwardRefExoticComponent<ArkSteps.RootProps & RefAttributes<HTMLDivElement>>, {}>, StepsRecipe>;
|
|
7
7
|
export declare const StepsList: StyledComponent<ForwardRefExoticComponent<ArkSteps.ListProps & RefAttributes<HTMLDivElement>>, {}>;
|
|
@@ -3,9 +3,8 @@ import { createStyleContext as e } from "../../utils/slots.js";
|
|
|
3
3
|
import { Steps as t } from "@ark-ui/react";
|
|
4
4
|
import { styled as n } from "@stokelp/styled-system/jsx";
|
|
5
5
|
import { steps as r } from "@stokelp/styled-system/recipes";
|
|
6
|
-
|
|
6
|
+
// src/components/steps/Steps.tsx
|
|
7
7
|
var { withProvider: i, withContext: a } = e(r), o = i(n(t.Root), "root"), s = a(n(t.List), "list"), c = a(n(t.Item), "item"), l = a(n(t.Trigger), "trigger"), u = a(n(t.Indicator), "indicator"), d = a(n(t.Separator), "separator"), f = a(n(t.Content), "content");
|
|
8
|
-
//#endregion
|
|
9
8
|
export { o as Steps, f as StepsContent, u as StepsIndicator, c as StepsItem, s as StepsList, d as StepsSeparator, l as StepsTrigger };
|
|
10
9
|
|
|
11
10
|
//# sourceMappingURL=Steps.js.map
|