@stokelp/ui 2.103.0 → 2.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/_virtual/_rolldown/runtime.js +21 -0
- package/dist/components/accordion/Accordion.cjs +2 -2
- package/dist/components/accordion/Accordion.cjs.map +1 -1
- package/dist/components/accordion/Accordion.js +22 -27
- package/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/action-card/ActionCard.cjs +2 -2
- package/dist/components/action-card/ActionCard.cjs.map +1 -1
- package/dist/components/action-card/ActionCard.js +23 -26
- package/dist/components/action-card/ActionCard.js.map +1 -1
- package/dist/components/alert/Alert.cjs +2 -2
- package/dist/components/alert/Alert.cjs.map +1 -1
- package/dist/components/alert/Alert.js +117 -84
- package/dist/components/alert/Alert.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardEntityRow.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardEntityRow.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardEntityRow.js +44 -25
- package/dist/components/app/mobile-card/MobileCardEntityRow.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardHeader.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardHeader.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardHeader.js +18 -20
- package/dist/components/app/mobile-card/MobileCardHeader.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.js +31 -13
- package/dist/components/app/mobile-card/MobileCardNotificationBadge.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardShell.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardShell.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardShell.js +17 -19
- package/dist/components/app/mobile-card/MobileCardShell.js.map +1 -1
- package/dist/components/app/mobile-card/MobileCardSkeleton.cjs +2 -2
- package/dist/components/app/mobile-card/MobileCardSkeleton.cjs.map +1 -1
- package/dist/components/app/mobile-card/MobileCardSkeleton.js +45 -22
- package/dist/components/app/mobile-card/MobileCardSkeleton.js.map +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.cjs +2 -2
- package/dist/components/app/mobile-navigation/MobileNavigation.cjs.map +1 -1
- package/dist/components/app/mobile-navigation/MobileNavigation.js +16 -18
- package/dist/components/app/mobile-navigation/MobileNavigation.js.map +1 -1
- package/dist/components/app/navigation/AppNavigation.cjs +2 -2
- package/dist/components/app/navigation/AppNavigation.cjs.map +1 -1
- package/dist/components/app/navigation/AppNavigation.js +35 -47
- package/dist/components/app/navigation/AppNavigation.js.map +1 -1
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs +2 -2
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs.map +1 -1
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js +188 -119
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js.map +1 -1
- package/dist/components/app/price-tag/PriceTag.cjs +2 -2
- package/dist/components/app/price-tag/PriceTag.cjs.map +1 -1
- package/dist/components/app/price-tag/PriceTag.js +25 -19
- package/dist/components/app/price-tag/PriceTag.js.map +1 -1
- package/dist/components/app/product-card-catalog/styled.cjs +2 -2
- package/dist/components/app/product-card-catalog/styled.cjs.map +1 -1
- package/dist/components/app/product-card-catalog/styled.js +23 -21
- package/dist/components/app/product-card-catalog/styled.js.map +1 -1
- package/dist/components/avatar/styled.cjs +2 -2
- package/dist/components/avatar/styled.cjs.map +1 -1
- package/dist/components/avatar/styled.d.ts +2 -2
- package/dist/components/avatar/styled.js +28 -27
- package/dist/components/avatar/styled.js.map +1 -1
- package/dist/components/box/Box.cjs +2 -2
- package/dist/components/box/Box.cjs.map +1 -1
- package/dist/components/box/Box.js +11 -10
- package/dist/components/box/Box.js.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.cjs +2 -2
- package/dist/components/breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.d.ts +4 -6
- package/dist/components/breadcrumb/Breadcrumb.js +39 -35
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/button/Button.cjs +2 -2
- package/dist/components/button/Button.cjs.map +1 -1
- package/dist/components/button/Button.js +9 -8
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button-filter/ButtonFilter.cjs +2 -2
- package/dist/components/button-filter/ButtonFilter.cjs.map +1 -1
- package/dist/components/button-filter/ButtonFilter.js +9 -8
- package/dist/components/button-filter/ButtonFilter.js.map +1 -1
- package/dist/components/chat/Chat.cjs +2 -2
- package/dist/components/chat/Chat.cjs.map +1 -1
- package/dist/components/chat/Chat.d.ts +6 -4
- package/dist/components/chat/Chat.js +27 -26
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/ChatDocumentMessage.cjs +2 -2
- package/dist/components/chat/ChatDocumentMessage.cjs.map +1 -1
- package/dist/components/chat/ChatDocumentMessage.js +32 -31
- package/dist/components/chat/ChatDocumentMessage.js.map +1 -1
- package/dist/components/chat/ChatMessage.cjs +2 -2
- package/dist/components/chat/ChatMessage.cjs.map +1 -1
- package/dist/components/chat/ChatMessage.js +8 -7
- package/dist/components/chat/ChatMessage.js.map +1 -1
- package/dist/components/chat/ChatProfileAvatar.cjs +2 -2
- package/dist/components/chat/ChatProfileAvatar.cjs.map +1 -1
- package/dist/components/chat/ChatProfileAvatar.js +24 -16
- package/dist/components/chat/ChatProfileAvatar.js.map +1 -1
- package/dist/components/chat/ChatTextInput.cjs +2 -2
- package/dist/components/chat/ChatTextInput.cjs.map +1 -1
- package/dist/components/chat/ChatTextInput.d.ts +2 -2
- package/dist/components/chat/ChatTextInput.js +44 -52
- package/dist/components/chat/ChatTextInput.js.map +1 -1
- package/dist/components/checkbox/Checkbox.cjs +2 -2
- package/dist/components/checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/checkbox/Checkbox.js +36 -34
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/checkbox-card/CheckboxCard.cjs +2 -2
- package/dist/components/checkbox-card/CheckboxCard.cjs.map +1 -1
- package/dist/components/checkbox-card/CheckboxCard.js +33 -38
- package/dist/components/checkbox-card/CheckboxCard.js.map +1 -1
- package/dist/components/checkbox-card/namespace.cjs +2 -2
- package/dist/components/checkbox-card/namespace.cjs.map +1 -1
- package/dist/components/checkbox-card/namespace.js +14 -9
- package/dist/components/checkbox-card/namespace.js.map +1 -1
- package/dist/components/chip/Chip.cjs +2 -2
- package/dist/components/chip/Chip.cjs.map +1 -1
- package/dist/components/chip/Chip.js +23 -23
- package/dist/components/chip/Chip.js.map +1 -1
- package/dist/components/collapsible/styled.cjs +2 -2
- package/dist/components/collapsible/styled.cjs.map +1 -1
- package/dist/components/collapsible/styled.js +15 -11
- package/dist/components/collapsible/styled.js.map +1 -1
- package/dist/components/combobox/Combobox.cjs +2 -2
- package/dist/components/combobox/Combobox.cjs.map +1 -1
- package/dist/components/combobox/Combobox.js +206 -173
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/date-picker/DatePicker.cjs +2 -2
- package/dist/components/date-picker/DatePicker.cjs.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +2 -2
- package/dist/components/date-picker/DatePicker.js +151 -127
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/dialog/styled.cjs +2 -2
- package/dist/components/dialog/styled.cjs.map +1 -1
- package/dist/components/dialog/styled.js +75 -65
- package/dist/components/dialog/styled.js.map +1 -1
- package/dist/components/drawer/Drawer.cjs +2 -2
- package/dist/components/drawer/Drawer.cjs.map +1 -1
- package/dist/components/drawer/Drawer.js +62 -63
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/flag/styled.cjs +2 -2
- package/dist/components/flag/styled.cjs.map +1 -1
- package/dist/components/flag/styled.d.ts +2 -2
- package/dist/components/flag/styled.js +8437 -3751
- package/dist/components/flag/styled.js.map +1 -1
- package/dist/components/form/FormControl.cjs +2 -2
- package/dist/components/form/FormControl.cjs.map +1 -1
- package/dist/components/form/FormControl.d.ts +2 -2
- package/dist/components/form/FormControl.js +13 -18
- package/dist/components/form/FormControl.js.map +1 -1
- package/dist/components/form/FormHelperText.cjs +2 -2
- package/dist/components/form/FormHelperText.cjs.map +1 -1
- package/dist/components/form/FormHelperText.js +8 -9
- package/dist/components/form/FormHelperText.js.map +1 -1
- package/dist/components/form/FormLabel.cjs +2 -2
- package/dist/components/form/FormLabel.cjs.map +1 -1
- package/dist/components/form/FormLabel.d.ts +2 -2
- package/dist/components/form/FormLabel.js +38 -33
- package/dist/components/form/FormLabel.js.map +1 -1
- package/dist/components/heading/Heading.cjs +2 -2
- package/dist/components/heading/Heading.cjs.map +1 -1
- package/dist/components/heading/Heading.js +14 -10
- package/dist/components/heading/Heading.js.map +1 -1
- package/dist/components/icon/Icon.cjs +2 -2
- package/dist/components/icon/Icon.cjs.map +1 -1
- package/dist/components/icon/Icon.d.ts +2 -2
- package/dist/components/icon/Icon.js +15 -10
- package/dist/components/icon/Icon.js.map +1 -1
- package/dist/components/icon-button/IconButton.cjs +2 -2
- package/dist/components/icon-button/IconButton.cjs.map +1 -1
- package/dist/components/icon-button/IconButton.d.ts +2 -3
- package/dist/components/icon-button/IconButton.js +8 -7
- package/dist/components/icon-button/IconButton.js.map +1 -1
- package/dist/components/illustration/Illustration.cjs +2 -2
- package/dist/components/illustration/Illustration.cjs.map +1 -1
- package/dist/components/illustration/Illustration.js +35 -39
- package/dist/components/illustration/Illustration.js.map +1 -1
- package/dist/components/illustration/patterns.cjs +2 -2
- package/dist/components/illustration/patterns.cjs.map +1 -1
- package/dist/components/illustration/patterns.js +5563 -8897
- package/dist/components/illustration/patterns.js.map +1 -1
- package/dist/components/input/HighlightedInput.cjs +2 -2
- package/dist/components/input/HighlightedInput.cjs.map +1 -1
- package/dist/components/input/HighlightedInput.d.ts +9 -12
- package/dist/components/input/HighlightedInput.js +43 -58
- package/dist/components/input/HighlightedInput.js.map +1 -1
- package/dist/components/input/Input.cjs +2 -2
- package/dist/components/input/Input.cjs.map +1 -1
- package/dist/components/input/Input.d.ts +1 -2
- package/dist/components/input/Input.js +12 -13
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input/InputAddon.cjs +2 -2
- package/dist/components/input/InputAddon.cjs.map +1 -1
- package/dist/components/input/InputAddon.js +8 -9
- package/dist/components/input/InputAddon.js.map +1 -1
- package/dist/components/input/InputGroup.cjs +2 -2
- package/dist/components/input/InputGroup.cjs.map +1 -1
- package/dist/components/input/InputGroup.js +8 -9
- package/dist/components/input/InputGroup.js.map +1 -1
- package/dist/components/input/PhoneNumberInput.cjs +2 -2
- package/dist/components/input/PhoneNumberInput.cjs.map +1 -1
- package/dist/components/input/PhoneNumberInput.js +21 -23
- package/dist/components/input/PhoneNumberInput.js.map +1 -1
- package/dist/components/menu/Menu.cjs +2 -2
- package/dist/components/menu/Menu.cjs.map +1 -1
- package/dist/components/menu/Menu.js +32 -28
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/pagination/Pagination.cjs +2 -2
- package/dist/components/pagination/Pagination.cjs.map +1 -1
- package/dist/components/pagination/Pagination.js +76 -84
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/pagination/use-pagination.cjs +2 -2
- package/dist/components/pagination/use-pagination.cjs.map +1 -1
- package/dist/components/pagination/use-pagination.js +56 -54
- package/dist/components/pagination/use-pagination.js.map +1 -1
- package/dist/components/popover/Popover.cjs +2 -2
- package/dist/components/popover/Popover.cjs.map +1 -1
- package/dist/components/popover/Popover.js +21 -25
- package/dist/components/popover/Popover.js.map +1 -1
- package/dist/components/radio-button-group/RadioButtonGroup.cjs +2 -2
- package/dist/components/radio-button-group/RadioButtonGroup.cjs.map +1 -1
- package/dist/components/radio-button-group/RadioButtonGroup.js +20 -20
- package/dist/components/radio-button-group/RadioButtonGroup.js.map +1 -1
- package/dist/components/radio-card-group/RadioCardGroup.cjs +2 -2
- package/dist/components/radio-card-group/RadioCardGroup.cjs.map +1 -1
- package/dist/components/radio-card-group/RadioCardGroup.js +21 -22
- package/dist/components/radio-card-group/RadioCardGroup.js.map +1 -1
- package/dist/components/radio-card-group/namespace.cjs +2 -2
- package/dist/components/radio-card-group/namespace.cjs.map +1 -1
- package/dist/components/radio-card-group/namespace.js +15 -10
- package/dist/components/radio-card-group/namespace.js.map +1 -1
- package/dist/components/radio-group/RadioGroup.cjs +2 -2
- package/dist/components/radio-group/RadioGroup.cjs.map +1 -1
- package/dist/components/radio-group/RadioGroup.js +21 -21
- package/dist/components/radio-group/RadioGroup.js.map +1 -1
- package/dist/components/select/Select.cjs +2 -2
- package/dist/components/select/Select.cjs.map +1 -1
- package/dist/components/select/Select.js +194 -141
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select-language/SelectLanguage.cjs +2 -2
- package/dist/components/select-language/SelectLanguage.cjs.map +1 -1
- package/dist/components/select-language/SelectLanguage.js +114 -88
- package/dist/components/select-language/SelectLanguage.js.map +1 -1
- package/dist/components/status-tag-select/StatusTagSelect.cjs +2 -2
- package/dist/components/status-tag-select/StatusTagSelect.cjs.map +1 -1
- package/dist/components/status-tag-select/StatusTagSelect.js +93 -115
- package/dist/components/status-tag-select/StatusTagSelect.js.map +1 -1
- package/dist/components/switch/Switch.cjs +2 -2
- package/dist/components/switch/Switch.cjs.map +1 -1
- package/dist/components/switch/Switch.js +30 -18
- package/dist/components/switch/Switch.js.map +1 -1
- package/dist/components/switch-card/SwitchCard.cjs +2 -2
- package/dist/components/switch-card/SwitchCard.cjs.map +1 -1
- package/dist/components/switch-card/SwitchCard.js +28 -25
- package/dist/components/switch-card/SwitchCard.js.map +1 -1
- package/dist/components/switch-card/namespace.cjs +2 -2
- package/dist/components/switch-card/namespace.cjs.map +1 -1
- package/dist/components/switch-card/namespace.js +14 -9
- package/dist/components/switch-card/namespace.js.map +1 -1
- package/dist/components/table/Table.cjs +2 -2
- package/dist/components/table/Table.cjs.map +1 -1
- package/dist/components/table/Table.d.ts +3 -4
- package/dist/components/table/Table.js +133 -109
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/TableProvider.cjs +2 -2
- package/dist/components/table/TableProvider.cjs.map +1 -1
- package/dist/components/table/TableProvider.js +36 -39
- package/dist/components/table/TableProvider.js.map +1 -1
- package/dist/components/tabs/Tabs.cjs +2 -2
- package/dist/components/tabs/Tabs.cjs.map +1 -1
- package/dist/components/tabs/Tabs.js +18 -26
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tag/Tag.cjs +2 -2
- package/dist/components/tag/Tag.cjs.map +1 -1
- package/dist/components/tag/Tag.js +22 -16
- package/dist/components/tag/Tag.js.map +1 -1
- package/dist/components/text/Text.cjs +2 -2
- package/dist/components/text/Text.cjs.map +1 -1
- package/dist/components/text/Text.js +12 -11
- package/dist/components/text/Text.js.map +1 -1
- package/dist/components/textarea/Textarea.cjs +2 -2
- package/dist/components/textarea/Textarea.cjs.map +1 -1
- package/dist/components/textarea/Textarea.d.ts +1 -2
- package/dist/components/textarea/Textarea.js +9 -8
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/tooltip/Tooltip.cjs +2 -2
- package/dist/components/tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/tooltip/Tooltip.js +38 -42
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/icons/index.cjs +2 -2
- package/dist/icons/index.cjs.map +1 -1
- package/dist/icons/index.js +65 -58
- package/dist/icons/index.js.map +1 -1
- package/dist/index.cjs +1 -2
- package/dist/index.js +66 -191
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +2 -2
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js +22 -27
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +2 -2
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js +22 -27
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +2 -2
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js +22 -27
- package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +2 -2
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +1 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js +22 -27
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +1 -1
- package/dist/node_modules/deepmerge/dist/cjs.cjs +2 -2
- package/dist/node_modules/deepmerge/dist/cjs.cjs.map +1 -1
- package/dist/node_modules/deepmerge/dist/cjs.js +76 -80
- package/dist/node_modules/deepmerge/dist/cjs.js.map +1 -1
- package/dist/preset.cjs +2 -2
- package/dist/preset.cjs.map +1 -1
- package/dist/preset.js +30 -31
- package/dist/preset.js.map +1 -1
- package/dist/shared/ConditionalWrapper.cjs +2 -2
- package/dist/shared/ConditionalWrapper.cjs.map +1 -1
- package/dist/shared/ConditionalWrapper.js +6 -5
- package/dist/shared/ConditionalWrapper.js.map +1 -1
- package/dist/shared/assets/icons.cjs +2 -2
- package/dist/shared/assets/icons.cjs.map +1 -1
- package/dist/shared/assets/icons.js +30 -22
- package/dist/shared/assets/icons.js.map +1 -1
- package/dist/shared/hooks/useUncontrolled.cjs +2 -2
- package/dist/shared/hooks/useUncontrolled.cjs.map +1 -1
- package/dist/shared/hooks/useUncontrolled.js +19 -16
- package/dist/shared/hooks/useUncontrolled.js.map +1 -1
- package/dist/shared/utils/events.cjs +2 -2
- package/dist/shared/utils/events.cjs.map +1 -1
- package/dist/shared/utils/events.js +7 -6
- package/dist/shared/utils/events.js.map +1 -1
- package/dist/theme/breakpoints.cjs +2 -2
- package/dist/theme/breakpoints.cjs.map +1 -1
- package/dist/theme/breakpoints.js +10 -9
- package/dist/theme/breakpoints.js.map +1 -1
- package/dist/theme/conditions.cjs +2 -2
- package/dist/theme/conditions.cjs.map +1 -1
- package/dist/theme/conditions.js +23 -24
- package/dist/theme/conditions.js.map +1 -1
- package/dist/theme/containers.cjs +2 -2
- package/dist/theme/containers.cjs.map +1 -1
- package/dist/theme/containers.js +18 -17
- package/dist/theme/containers.js.map +1 -1
- package/dist/theme/globalCss.cjs +4 -4
- package/dist/theme/globalCss.cjs.map +1 -1
- package/dist/theme/globalCss.js +94 -99
- package/dist/theme/globalCss.js.map +1 -1
- package/dist/theme/keyframes.cjs +2 -2
- package/dist/theme/keyframes.cjs.map +1 -1
- package/dist/theme/keyframes.js +256 -171
- package/dist/theme/keyframes.js.map +1 -1
- package/dist/theme/recipes/accordion.cjs +2 -2
- package/dist/theme/recipes/accordion.cjs.map +1 -1
- package/dist/theme/recipes/accordion.js +93 -110
- package/dist/theme/recipes/accordion.js.map +1 -1
- package/dist/theme/recipes/action-card.cjs +2 -2
- package/dist/theme/recipes/action-card.cjs.map +1 -1
- package/dist/theme/recipes/action-card.js +88 -84
- package/dist/theme/recipes/action-card.js.map +1 -1
- package/dist/theme/recipes/alert.cjs +2 -2
- package/dist/theme/recipes/alert.cjs.map +1 -1
- package/dist/theme/recipes/alert.js +52 -65
- package/dist/theme/recipes/alert.js.map +1 -1
- package/dist/theme/recipes/app/mobile-navigation.cjs +2 -2
- package/dist/theme/recipes/app/mobile-navigation.cjs.map +1 -1
- package/dist/theme/recipes/app/mobile-navigation.js +94 -108
- package/dist/theme/recipes/app/mobile-navigation.js.map +1 -1
- package/dist/theme/recipes/app/navigation-language-select.cjs +2 -2
- package/dist/theme/recipes/app/navigation-language-select.cjs.map +1 -1
- package/dist/theme/recipes/app/navigation-language-select.js +135 -148
- package/dist/theme/recipes/app/navigation-language-select.js.map +1 -1
- package/dist/theme/recipes/app/navigation.cjs +2 -2
- package/dist/theme/recipes/app/navigation.cjs.map +1 -1
- package/dist/theme/recipes/app/navigation.js +214 -269
- package/dist/theme/recipes/app/navigation.js.map +1 -1
- package/dist/theme/recipes/app/price-tag.cjs +2 -2
- package/dist/theme/recipes/app/price-tag.cjs.map +1 -1
- package/dist/theme/recipes/app/price-tag.js +59 -70
- package/dist/theme/recipes/app/price-tag.js.map +1 -1
- package/dist/theme/recipes/app/product-card-catalog.cjs +2 -2
- package/dist/theme/recipes/app/product-card-catalog.cjs.map +1 -1
- package/dist/theme/recipes/app/product-card-catalog.js +189 -194
- package/dist/theme/recipes/app/product-card-catalog.js.map +1 -1
- package/dist/theme/recipes/avatar-group.cjs +2 -2
- package/dist/theme/recipes/avatar-group.cjs.map +1 -1
- package/dist/theme/recipes/avatar-group.js +27 -38
- package/dist/theme/recipes/avatar-group.js.map +1 -1
- package/dist/theme/recipes/avatar.cjs +2 -2
- package/dist/theme/recipes/avatar.cjs.map +1 -1
- package/dist/theme/recipes/avatar.js +97 -95
- package/dist/theme/recipes/avatar.js.map +1 -1
- package/dist/theme/recipes/breadcrumb.cjs +2 -2
- package/dist/theme/recipes/breadcrumb.cjs.map +1 -1
- package/dist/theme/recipes/breadcrumb.js +35 -31
- package/dist/theme/recipes/breadcrumb.js.map +1 -1
- package/dist/theme/recipes/button-filter.cjs +2 -2
- package/dist/theme/recipes/button-filter.cjs.map +1 -1
- package/dist/theme/recipes/button-filter.js +57 -60
- package/dist/theme/recipes/button-filter.js.map +1 -1
- package/dist/theme/recipes/button.cjs +2 -2
- package/dist/theme/recipes/button.cjs.map +1 -1
- package/dist/theme/recipes/button.js +287 -295
- package/dist/theme/recipes/button.js.map +1 -1
- package/dist/theme/recipes/chat/chat-document-message.cjs +2 -2
- package/dist/theme/recipes/chat/chat-document-message.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-document-message.js +38 -43
- package/dist/theme/recipes/chat/chat-document-message.js.map +1 -1
- package/dist/theme/recipes/chat/chat-input-text.cjs +2 -2
- package/dist/theme/recipes/chat/chat-input-text.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-input-text.js +26 -27
- package/dist/theme/recipes/chat/chat-input-text.js.map +1 -1
- package/dist/theme/recipes/chat/chat-message.cjs +2 -2
- package/dist/theme/recipes/chat/chat-message.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-message.js +49 -45
- package/dist/theme/recipes/chat/chat-message.js.map +1 -1
- package/dist/theme/recipes/chat/chat-profile-avatar.cjs +2 -2
- package/dist/theme/recipes/chat/chat-profile-avatar.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat-profile-avatar.js +20 -25
- package/dist/theme/recipes/chat/chat-profile-avatar.js.map +1 -1
- package/dist/theme/recipes/chat/chat.cjs +2 -2
- package/dist/theme/recipes/chat/chat.cjs.map +1 -1
- package/dist/theme/recipes/chat/chat.js +51 -56
- package/dist/theme/recipes/chat/chat.js.map +1 -1
- package/dist/theme/recipes/checkbox-card.cjs +2 -2
- package/dist/theme/recipes/checkbox-card.cjs.map +1 -1
- package/dist/theme/recipes/checkbox-card.js +44 -40
- package/dist/theme/recipes/checkbox-card.js.map +1 -1
- package/dist/theme/recipes/checkbox-group.cjs +2 -2
- package/dist/theme/recipes/checkbox-group.cjs.map +1 -1
- package/dist/theme/recipes/checkbox-group.js +13 -12
- package/dist/theme/recipes/checkbox-group.js.map +1 -1
- package/dist/theme/recipes/checkbox.cjs +2 -2
- package/dist/theme/recipes/checkbox.cjs.map +1 -1
- package/dist/theme/recipes/checkbox.js +110 -129
- package/dist/theme/recipes/checkbox.js.map +1 -1
- package/dist/theme/recipes/chip.cjs +2 -2
- package/dist/theme/recipes/chip.cjs.map +1 -1
- package/dist/theme/recipes/chip.js +144 -182
- package/dist/theme/recipes/chip.js.map +1 -1
- package/dist/theme/recipes/collapsible.cjs +2 -2
- package/dist/theme/recipes/collapsible.cjs.map +1 -1
- package/dist/theme/recipes/collapsible.js +30 -28
- package/dist/theme/recipes/collapsible.js.map +1 -1
- package/dist/theme/recipes/combobox.cjs +2 -2
- package/dist/theme/recipes/combobox.cjs.map +1 -1
- package/dist/theme/recipes/combobox.js +149 -176
- package/dist/theme/recipes/combobox.js.map +1 -1
- package/dist/theme/recipes/common/group-card.cjs +2 -2
- package/dist/theme/recipes/common/group-card.cjs.map +1 -1
- package/dist/theme/recipes/common/group-card.js +60 -80
- package/dist/theme/recipes/common/group-card.js.map +1 -1
- package/dist/theme/recipes/datepicker.cjs +2 -2
- package/dist/theme/recipes/datepicker.cjs.map +1 -1
- package/dist/theme/recipes/datepicker.js +149 -176
- package/dist/theme/recipes/datepicker.js.map +1 -1
- package/dist/theme/recipes/dialog.cjs +2 -2
- package/dist/theme/recipes/dialog.cjs.map +1 -1
- package/dist/theme/recipes/dialog.js +137 -151
- package/dist/theme/recipes/dialog.js.map +1 -1
- package/dist/theme/recipes/drawer.cjs +2 -2
- package/dist/theme/recipes/drawer.cjs.map +1 -1
- package/dist/theme/recipes/drawer.js +105 -125
- package/dist/theme/recipes/drawer.js.map +1 -1
- package/dist/theme/recipes/flag.cjs +2 -2
- package/dist/theme/recipes/flag.cjs.map +1 -1
- package/dist/theme/recipes/flag.js +21 -30
- package/dist/theme/recipes/flag.js.map +1 -1
- package/dist/theme/recipes/form/control.cjs +2 -2
- package/dist/theme/recipes/form/control.cjs.map +1 -1
- package/dist/theme/recipes/form/control.js +27 -34
- package/dist/theme/recipes/form/control.js.map +1 -1
- package/dist/theme/recipes/form/helper-text.cjs +2 -2
- package/dist/theme/recipes/form/helper-text.cjs.map +1 -1
- package/dist/theme/recipes/form/helper-text.js +14 -13
- package/dist/theme/recipes/form/helper-text.js.map +1 -1
- package/dist/theme/recipes/form/label.cjs +2 -2
- package/dist/theme/recipes/form/label.cjs.map +1 -1
- package/dist/theme/recipes/form/label.js +47 -48
- package/dist/theme/recipes/form/label.js.map +1 -1
- package/dist/theme/recipes/heading.cjs +2 -2
- package/dist/theme/recipes/heading.cjs.map +1 -1
- package/dist/theme/recipes/heading.js +25 -34
- package/dist/theme/recipes/heading.js.map +1 -1
- package/dist/theme/recipes/highlightedInput.cjs +2 -2
- package/dist/theme/recipes/highlightedInput.cjs.map +1 -1
- package/dist/theme/recipes/highlightedInput.js +54 -45
- package/dist/theme/recipes/highlightedInput.js.map +1 -1
- package/dist/theme/recipes/icon-button.cjs +2 -2
- package/dist/theme/recipes/icon-button.cjs.map +1 -1
- package/dist/theme/recipes/icon-button.js +81 -89
- package/dist/theme/recipes/icon-button.js.map +1 -1
- package/dist/theme/recipes/icon.cjs +2 -2
- package/dist/theme/recipes/icon.cjs.map +1 -1
- package/dist/theme/recipes/icon.js +39 -42
- package/dist/theme/recipes/icon.js.map +1 -1
- package/dist/theme/recipes/illustration.cjs +2 -2
- package/dist/theme/recipes/illustration.cjs.map +1 -1
- package/dist/theme/recipes/illustration.js +29 -48
- package/dist/theme/recipes/illustration.js.map +1 -1
- package/dist/theme/recipes/index.cjs +2 -2
- package/dist/theme/recipes/index.cjs.map +1 -1
- package/dist/theme/recipes/index.js +127 -127
- package/dist/theme/recipes/index.js.map +1 -1
- package/dist/theme/recipes/input-addon.cjs +2 -2
- package/dist/theme/recipes/input-addon.cjs.map +1 -1
- package/dist/theme/recipes/input-addon.js +24 -24
- package/dist/theme/recipes/input-addon.js.map +1 -1
- package/dist/theme/recipes/input-group.cjs +2 -2
- package/dist/theme/recipes/input-group.cjs.map +1 -1
- package/dist/theme/recipes/input-group.js +40 -49
- package/dist/theme/recipes/input-group.js.map +1 -1
- package/dist/theme/recipes/input.cjs +2 -2
- package/dist/theme/recipes/input.cjs.map +1 -1
- package/dist/theme/recipes/input.js +48 -61
- package/dist/theme/recipes/input.js.map +1 -1
- package/dist/theme/recipes/menu.cjs +2 -2
- package/dist/theme/recipes/menu.cjs.map +1 -1
- package/dist/theme/recipes/menu.js +96 -100
- package/dist/theme/recipes/menu.js.map +1 -1
- package/dist/theme/recipes/pagination.cjs +2 -2
- package/dist/theme/recipes/pagination.cjs.map +1 -1
- package/dist/theme/recipes/pagination.js +76 -71
- package/dist/theme/recipes/pagination.js.map +1 -1
- package/dist/theme/recipes/phone-number-input.cjs +2 -2
- package/dist/theme/recipes/phone-number-input.cjs.map +1 -1
- package/dist/theme/recipes/phone-number-input.js +55 -66
- package/dist/theme/recipes/phone-number-input.js.map +1 -1
- package/dist/theme/recipes/popover.cjs +2 -2
- package/dist/theme/recipes/popover.cjs.map +1 -1
- package/dist/theme/recipes/popover.js +30 -28
- package/dist/theme/recipes/popover.js.map +1 -1
- package/dist/theme/recipes/radio-button-group.cjs +2 -2
- package/dist/theme/recipes/radio-button-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-button-group.js +83 -94
- package/dist/theme/recipes/radio-button-group.js.map +1 -1
- package/dist/theme/recipes/radio-card-group.cjs +2 -2
- package/dist/theme/recipes/radio-card-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-card-group.js +64 -67
- package/dist/theme/recipes/radio-card-group.js.map +1 -1
- package/dist/theme/recipes/radio-group.cjs +2 -2
- package/dist/theme/recipes/radio-group.cjs.map +1 -1
- package/dist/theme/recipes/radio-group.js +101 -118
- package/dist/theme/recipes/radio-group.js.map +1 -1
- package/dist/theme/recipes/select-language.cjs +2 -2
- package/dist/theme/recipes/select-language.cjs.map +1 -1
- package/dist/theme/recipes/select-language.js +93 -112
- package/dist/theme/recipes/select-language.js.map +1 -1
- package/dist/theme/recipes/select.cjs +2 -2
- package/dist/theme/recipes/select.cjs.map +1 -1
- package/dist/theme/recipes/select.js +194 -206
- package/dist/theme/recipes/select.js.map +1 -1
- package/dist/theme/recipes/status-tag-select.cjs +2 -2
- package/dist/theme/recipes/status-tag-select.cjs.map +1 -1
- package/dist/theme/recipes/status-tag-select.js +162 -175
- package/dist/theme/recipes/status-tag-select.js.map +1 -1
- package/dist/theme/recipes/switch-card.cjs +2 -2
- package/dist/theme/recipes/switch-card.cjs.map +1 -1
- package/dist/theme/recipes/switch-card.js +43 -42
- package/dist/theme/recipes/switch-card.js.map +1 -1
- package/dist/theme/recipes/switch.cjs +2 -2
- package/dist/theme/recipes/switch.cjs.map +1 -1
- package/dist/theme/recipes/switch.js +71 -86
- package/dist/theme/recipes/switch.js.map +1 -1
- package/dist/theme/recipes/table-container.cjs +2 -2
- package/dist/theme/recipes/table-container.cjs.map +1 -1
- package/dist/theme/recipes/table-container.js +19 -18
- package/dist/theme/recipes/table-container.js.map +1 -1
- package/dist/theme/recipes/table-empty-row.cjs +2 -2
- package/dist/theme/recipes/table-empty-row.cjs.map +1 -1
- package/dist/theme/recipes/table-empty-row.js +17 -16
- package/dist/theme/recipes/table-empty-row.js.map +1 -1
- package/dist/theme/recipes/table-group-title.cjs +2 -2
- package/dist/theme/recipes/table-group-title.cjs.map +1 -1
- package/dist/theme/recipes/table-group-title.js +26 -33
- package/dist/theme/recipes/table-group-title.js.map +1 -1
- package/dist/theme/recipes/table.cjs +2 -2
- package/dist/theme/recipes/table.cjs.map +1 -1
- package/dist/theme/recipes/table.js +111 -109
- package/dist/theme/recipes/table.js.map +1 -1
- package/dist/theme/recipes/tabs-chip.cjs +2 -2
- package/dist/theme/recipes/tabs-chip.cjs.map +1 -1
- package/dist/theme/recipes/tabs-chip.js +43 -46
- package/dist/theme/recipes/tabs-chip.js.map +1 -1
- package/dist/theme/recipes/tabs.cjs +2 -2
- package/dist/theme/recipes/tabs.cjs.map +1 -1
- package/dist/theme/recipes/tabs.js +92 -125
- package/dist/theme/recipes/tabs.js.map +1 -1
- package/dist/theme/recipes/tag.cjs +2 -2
- package/dist/theme/recipes/tag.cjs.map +1 -1
- package/dist/theme/recipes/tag.js +110 -121
- package/dist/theme/recipes/tag.js.map +1 -1
- package/dist/theme/recipes/text.cjs +2 -2
- package/dist/theme/recipes/text.cjs.map +1 -1
- package/dist/theme/recipes/text.js +25 -38
- package/dist/theme/recipes/text.js.map +1 -1
- package/dist/theme/recipes/textarea.cjs +2 -2
- package/dist/theme/recipes/textarea.cjs.map +1 -1
- package/dist/theme/recipes/textarea.js +15 -14
- package/dist/theme/recipes/textarea.js.map +1 -1
- package/dist/theme/recipes/tooltip.cjs +2 -2
- package/dist/theme/recipes/tooltip.cjs.map +1 -1
- package/dist/theme/recipes/tooltip.js +47 -62
- package/dist/theme/recipes/tooltip.js.map +1 -1
- package/dist/theme/semantic-tokens/colors.cjs +2 -2
- package/dist/theme/semantic-tokens/colors.cjs.map +1 -1
- package/dist/theme/semantic-tokens/colors.js +189 -140
- package/dist/theme/semantic-tokens/colors.js.map +1 -1
- package/dist/theme/semantic-tokens/index.cjs +2 -2
- package/dist/theme/semantic-tokens/index.cjs.map +1 -1
- package/dist/theme/semantic-tokens/index.js +7 -8
- package/dist/theme/semantic-tokens/index.js.map +1 -1
- package/dist/theme/text-styles.cjs +2 -2
- package/dist/theme/text-styles.cjs.map +1 -1
- package/dist/theme/text-styles.js +70 -87
- package/dist/theme/text-styles.js.map +1 -1
- package/dist/theme/tokens/animations.cjs +2 -2
- package/dist/theme/tokens/animations.cjs.map +1 -1
- package/dist/theme/tokens/animations.js +22 -45
- package/dist/theme/tokens/animations.js.map +1 -1
- package/dist/theme/tokens/aspect-ratios.cjs +2 -2
- package/dist/theme/tokens/aspect-ratios.cjs.map +1 -1
- package/dist/theme/tokens/aspect-ratios.js +12 -11
- package/dist/theme/tokens/aspect-ratios.js.map +1 -1
- package/dist/theme/tokens/blurs.cjs +2 -2
- package/dist/theme/tokens/blurs.cjs.map +1 -1
- package/dist/theme/tokens/blurs.js +13 -12
- package/dist/theme/tokens/blurs.js.map +1 -1
- package/dist/theme/tokens/borders.cjs +2 -2
- package/dist/theme/tokens/borders.cjs.map +1 -1
- package/dist/theme/tokens/borders.js +6 -9
- package/dist/theme/tokens/borders.js.map +1 -1
- package/dist/theme/tokens/colors.cjs +2 -2
- package/dist/theme/tokens/colors.cjs.map +1 -1
- package/dist/theme/tokens/colors.js +78 -77
- package/dist/theme/tokens/colors.js.map +1 -1
- package/dist/theme/tokens/durations.cjs +2 -2
- package/dist/theme/tokens/durations.cjs.map +1 -1
- package/dist/theme/tokens/durations.js +14 -13
- package/dist/theme/tokens/durations.js.map +1 -1
- package/dist/theme/tokens/easings.cjs +3 -3
- package/dist/theme/tokens/easings.cjs.map +1 -1
- package/dist/theme/tokens/easings.js +24 -92
- package/dist/theme/tokens/easings.js.map +1 -1
- package/dist/theme/tokens/index.cjs +2 -2
- package/dist/theme/tokens/index.cjs.map +1 -1
- package/dist/theme/tokens/index.js +36 -35
- package/dist/theme/tokens/index.js.map +1 -1
- package/dist/theme/tokens/radii.cjs +2 -2
- package/dist/theme/tokens/radii.cjs.map +1 -1
- package/dist/theme/tokens/radii.js +28 -27
- package/dist/theme/tokens/radii.js.map +1 -1
- package/dist/theme/tokens/shadows.cjs +2 -2
- package/dist/theme/tokens/shadows.cjs.map +1 -1
- package/dist/theme/tokens/shadows.js +14 -13
- package/dist/theme/tokens/shadows.js.map +1 -1
- package/dist/theme/tokens/sizes.cjs +2 -2
- package/dist/theme/tokens/sizes.cjs.map +1 -1
- package/dist/theme/tokens/sizes.js +35 -84
- package/dist/theme/tokens/sizes.js.map +1 -1
- package/dist/theme/tokens/spacing.cjs +2 -2
- package/dist/theme/tokens/spacing.cjs.map +1 -1
- package/dist/theme/tokens/spacing.js +32 -83
- package/dist/theme/tokens/spacing.js.map +1 -1
- package/dist/theme/tokens/typography.cjs +2 -2
- package/dist/theme/tokens/typography.cjs.map +1 -1
- package/dist/theme/tokens/typography.js +82 -85
- package/dist/theme/tokens/typography.js.map +1 -1
- package/dist/theme/tokens/z-index.cjs +2 -2
- package/dist/theme/tokens/z-index.cjs.map +1 -1
- package/dist/theme/tokens/z-index.js +18 -41
- package/dist/theme/tokens/z-index.js.map +1 -1
- package/dist/theme/utilities.cjs +2 -2
- package/dist/theme/utilities.cjs.map +1 -1
- package/dist/theme/utilities.js +15 -16
- package/dist/theme/utilities.js.map +1 -1
- package/dist/ui.css +2 -1
- package/dist/utils/slots.cjs +2 -2
- package/dist/utils/slots.cjs.map +1 -1
- package/dist/utils/slots.js +42 -40
- package/dist/utils/slots.js.map +1 -1
- package/package.json +11 -7
- package/dist/_virtual/_commonjsHelpers.cjs +0 -2
- package/dist/_virtual/_commonjsHelpers.cjs.map +0 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -10
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/cjs.cjs +0 -2
- package/dist/_virtual/cjs.cjs.map +0 -1
- package/dist/_virtual/cjs.js +0 -9
- package/dist/_virtual/cjs.js.map +0 -1
- package/dist/_virtual/lodash.cjs +0 -2
- package/dist/_virtual/lodash.cjs.map +0 -1
- package/dist/_virtual/lodash.js +0 -7
- package/dist/_virtual/lodash.js.map +0 -1
- package/dist/_virtual/lodash2.cjs +0 -2
- package/dist/_virtual/lodash2.cjs.map +0 -1
- package/dist/_virtual/lodash2.js +0 -6
- package/dist/_virtual/lodash2.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/node_modules/@pandacss/shared/dist/index.cjs +0 -2
- package/dist/node_modules/@pandacss/shared/dist/index.cjs.map +0 -1
- package/dist/node_modules/@pandacss/shared/dist/index.js +0 -469
- package/dist/node_modules/@pandacss/shared/dist/index.js.map +0 -1
- package/dist/node_modules/@zag-js/utils/dist/functions.cjs +0 -2
- package/dist/node_modules/@zag-js/utils/dist/functions.cjs.map +0 -1
- package/dist/node_modules/@zag-js/utils/dist/functions.js +0 -6
- package/dist/node_modules/@zag-js/utils/dist/functions.js.map +0 -1
- package/dist/node_modules/lodash/lodash.cjs +0 -21
- package/dist/node_modules/lodash/lodash.cjs.map +0 -1
- package/dist/node_modules/lodash/lodash.js +0 -3686
- package/dist/node_modules/lodash/lodash.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","sources":["../../../src/components/menu/Menu.tsx"],"sourcesContent":["import { Menu as ArkMenu } from '@ark-ui/react'\nimport { ComponentProps, ComponentPropsWithoutRef, ElementRef, forwardRef } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { createStyleContext } from '~/utils/slots'\nimport { menu } from '@stokelp/styled-system/recipes'\nimport { Portal } from '@ark-ui/react'\n\nconst { withProvider, withContext } = createStyleContext(menu)\n\nexport const Root = withProvider(ArkMenu.Root, undefined, {\n defaultProps: {\n lazyMount: true,\n loopFocus: true,\n unmountOnExit: true,\n },\n})\nconst Positioner = withContext(styled(ArkMenu.Positioner), 'positioner')\n\nconst InnerContent = forwardRef<ElementRef<typeof ArkMenu.Content>, ComponentPropsWithoutRef<typeof ArkMenu.Content>>(\n ({ children, ...props }, ref) => {\n return (\n <Portal>\n <Positioner>\n <ArkMenu.Content ref={ref} {...props}>\n {children}\n </ArkMenu.Content>\n </Positioner>\n </Portal>\n )\n },\n)\nInnerContent.displayName = ArkMenu.Content.displayName\n\nexport const Content = withContext(styled(InnerContent), 'content')\nexport const Item = withContext(styled(ArkMenu.Item), 'item')\nexport const ItemGroup = withContext(styled(ArkMenu.ItemGroup), 'itemGroup')\nexport const ItemGroupLabel = withContext(styled(ArkMenu.ItemGroupLabel), 'itemGroupLabel')\nexport const Separator = withContext(styled(ArkMenu.Separator), 'separator')\nexport const Trigger = withContext(styled(ArkMenu.Trigger), 'trigger')\nexport const TriggerItem = withContext(styled(ArkMenu.TriggerItem), 'triggerItem')\n\nexport interface MenuProps extends ComponentProps<typeof Root> {}\nexport interface MenuContentProps extends ComponentProps<typeof Content> {}\nexport interface MenuItemProps extends ComponentProps<typeof Item> {}\nexport interface MenuItemGroupProps extends ComponentProps<typeof ItemGroup> {}\nexport interface MenuItemGroupLabelProps extends ComponentProps<typeof ItemGroupLabel> {}\nexport interface MenuSeparatorProps extends ComponentProps<typeof Separator> {}\nexport interface MenuTriggerProps extends ComponentProps<typeof Trigger> {}\nexport interface MenuTriggerItemProps extends ComponentProps<typeof TriggerItem> {}\n"],"
|
|
1
|
+
{"version":3,"file":"Menu.js","names":[],"sources":["../../../src/components/menu/Menu.tsx"],"sourcesContent":["import { Menu as ArkMenu } from '@ark-ui/react'\nimport { ComponentProps, ComponentPropsWithoutRef, ElementRef, forwardRef } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { createStyleContext } from '~/utils/slots'\nimport { menu } from '@stokelp/styled-system/recipes'\nimport { Portal } from '@ark-ui/react'\n\nconst { withProvider, withContext } = createStyleContext(menu)\n\nexport const Root = withProvider(ArkMenu.Root, undefined, {\n defaultProps: {\n lazyMount: true,\n loopFocus: true,\n unmountOnExit: true,\n },\n})\nconst Positioner = withContext(styled(ArkMenu.Positioner), 'positioner')\n\nconst InnerContent = forwardRef<ElementRef<typeof ArkMenu.Content>, ComponentPropsWithoutRef<typeof ArkMenu.Content>>(\n ({ children, ...props }, ref) => {\n return (\n <Portal>\n <Positioner>\n <ArkMenu.Content ref={ref} {...props}>\n {children}\n </ArkMenu.Content>\n </Positioner>\n </Portal>\n )\n },\n)\nInnerContent.displayName = ArkMenu.Content.displayName\n\nexport const Content = withContext(styled(InnerContent), 'content')\nexport const Item = withContext(styled(ArkMenu.Item), 'item')\nexport const ItemGroup = withContext(styled(ArkMenu.ItemGroup), 'itemGroup')\nexport const ItemGroupLabel = withContext(styled(ArkMenu.ItemGroupLabel), 'itemGroupLabel')\nexport const Separator = withContext(styled(ArkMenu.Separator), 'separator')\nexport const Trigger = withContext(styled(ArkMenu.Trigger), 'trigger')\nexport const TriggerItem = withContext(styled(ArkMenu.TriggerItem), 'triggerItem')\n\nexport interface MenuProps extends ComponentProps<typeof Root> {}\nexport interface MenuContentProps extends ComponentProps<typeof Content> {}\nexport interface MenuItemProps extends ComponentProps<typeof Item> {}\nexport interface MenuItemGroupProps extends ComponentProps<typeof ItemGroup> {}\nexport interface MenuItemGroupLabelProps extends ComponentProps<typeof ItemGroupLabel> {}\nexport interface MenuSeparatorProps extends ComponentProps<typeof Separator> {}\nexport interface MenuTriggerProps extends ComponentProps<typeof Trigger> {}\nexport interface MenuTriggerItemProps extends ComponentProps<typeof TriggerItem> {}\n"],"mappings":";;;;;;;;;;;;;;;;;;IAOM,EAAE,iBAAc,mBAAgB,EAAmB,CAAI,GAEhD,IAAO,EAAa,EAAQ,MAAM,KAAA,GAAW,EACxD,cAAc;CACZ,WAAW;CACX,WAAW;CACX,eAAe;AACjB,EACF,CAAC,GACK,IAAa,EAAY,EAAO,EAAQ,UAAU,GAAG,YAAY,GAEjE,IAAe,GAClB,EAAE,aAAU,GAAG,KAAS,MAErB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,EAAQ,SAAT;CAAsB;CAAK,GAAI;CAC5B;AACc,CAAA,EACP,CAAA,EACN,CAAA,CAGd;AACA,EAAa,cAAc,EAAQ,QAAQ;AAE3C,IAAa,IAAU,EAAY,EAAO,CAAY,GAAG,SAAS,GACrD,IAAO,EAAY,EAAO,EAAQ,IAAI,GAAG,MAAM,GAC/C,IAAY,EAAY,EAAO,EAAQ,SAAS,GAAG,WAAW,GAC9D,IAAiB,EAAY,EAAO,EAAQ,cAAc,GAAG,gBAAgB,GAC7E,IAAY,EAAY,EAAO,EAAQ,SAAS,GAAG,WAAW,GAC9D,IAAU,EAAY,EAAO,EAAQ,OAAO,GAAG,SAAS,GACxD,IAAc,EAAY,EAAO,EAAQ,WAAW,GAAG,aAAa"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
//# sourceMappingURL=Pagination.cjs.map
|
|
1
|
+
"use client";const e=require("../../utils/slots.cjs"),t=require("../icon-button/IconButton.cjs"),n=require("./use-pagination.cjs"),r=require("../../shared/utils/events.cjs");let i=require("@stokelp/styled-system/jsx"),a=require("@stokelp/styled-system/recipes"),o=require("react"),s=require("react/jsx-runtime");var{withProvider:c,withContext:l}=e.createStyleContext(a.pagination),u=c((0,i.styled)(`div`),`root`),d=l((0,i.styled)(`button`),`item`),f=l((0,i.styled)(`div`),`dots`),p=({total:e,value:i,defaultValue:a,onChange:c,disabled:l,onNextPage:p,onPrevPage:m,siblings:h=2,boundaries:g=1,..._})=>{let{range:v,setPage:y,next:b,previous:x,active:S}=n.usePagination({page:i,initialPage:a,onChange:c,total:e,siblings:h,boundaries:g}),C=r.createEventHandler(p,b),w=r.createEventHandler(m,x);return(0,s.jsxs)(u,{..._,children:[(0,s.jsx)(t.IconButton,{size:`md`,variant:`tertiary`,"aria-label":`Previous`,disabled:l||S===1,onClick:w,children:(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,s.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L10.1464 2.64645C10.3417 2.45119 10.6583 2.45119 10.8536 2.64645C11.0488 2.84171 11.0488 3.15829 10.8536 3.35355L6.20711 8L10.8536 12.6464C11.0488 12.8417 11.0488 13.1583 10.8536 13.3536C10.6583 13.5488 10.3417 13.5488 10.1464 13.3536L5.14645 8.35355Z`,fill:`currentColor`})})}),v.map((e,t)=>e===n.DOTS?(0,o.createElement)(f,{...l?{"data-disabled":!0}:{},key:t},`...`):(0,s.jsx)(d,{disabled:l,...e===S?{"data-selected":!0}:{},onClick:()=>y(e),children:e},t)),(0,s.jsx)(t.IconButton,{size:`md`,variant:`tertiary`,"aria-label":`Previous`,disabled:l||S===e,onClick:C,children:(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,s.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10.8536 7.64645C11.0488 7.84171 11.0488 8.15829 10.8536 8.35355L5.85355 13.3536C5.65829 13.5488 5.34171 13.5488 5.14645 13.3536C4.95118 13.1583 4.95118 12.8417 5.14645 12.6464L9.79289 8L5.14645 3.35355C4.95118 3.15829 4.95118 2.84171 5.14645 2.64645C5.34171 2.45118 5.65829 2.45118 5.85355 2.64645L10.8536 7.64645Z`,fill:`currentColor`})})})]})};exports.Pagination=p;
|
|
2
|
+
//# sourceMappingURL=Pagination.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.cjs","sources":["../../../src/components/pagination/Pagination.tsx"],"sourcesContent":["import type { ComponentProps, FC } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { pagination } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { DOTS, usePagination } from './use-pagination'\nimport { createEventHandler } from '~/shared/utils/events'\nimport { IconButton } from '~/components/icon-button'\n\nconst { withProvider, withContext } = createStyleContext(pagination)\n\nconst StyledPagination = withProvider(styled('div'), 'root')\ntype StyledPaginationProps = ComponentProps<typeof StyledPagination>\n\nconst PaginationItem = withContext(styled('button'), 'item')\nconst PaginationDots = withContext(styled('div'), 'dots')\n\nexport interface PaginationProps extends Omit<StyledPaginationProps, 'children' | 'defaultValue' | 'onChange'> {\n total: number\n value?: number\n defaultValue?: number\n onChange?: (value: number) => void\n disabled?: boolean\n siblings?: number\n boundaries?: number\n onNextPage?: () => void\n onPrevPage?: () => void\n}\n\nexport const Pagination: FC<PaginationProps> = ({\n total,\n value,\n defaultValue,\n onChange,\n disabled,\n onNextPage,\n onPrevPage,\n siblings = 2,\n boundaries = 1,\n ...props\n}: PaginationProps) => {\n const { range, setPage, next, previous, active } = usePagination({\n page: value,\n initialPage: defaultValue,\n onChange,\n total,\n siblings,\n boundaries,\n })\n\n const handleNextPage = createEventHandler(onNextPage, next)\n const handlePreviousPage = createEventHandler(onPrevPage, previous)\n\n return (\n <StyledPagination {...props}>\n <IconButton\n size=\"md\"\n variant=\"tertiary\"\n aria-label=\"Previous\"\n disabled={disabled || active === 1}\n onClick={handlePreviousPage}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L10.1464 2.64645C10.3417 2.45119 10.6583 2.45119 10.8536 2.64645C11.0488 2.84171 11.0488 3.15829 10.8536 3.35355L6.20711 8L10.8536 12.6464C11.0488 12.8417 11.0488 13.1583 10.8536 13.3536C10.6583 13.5488 10.3417 13.5488 10.1464 13.3536L5.14645 8.35355Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n {range.map((pageNumber, index) => {\n if (pageNumber === DOTS) {\n return (\n <PaginationDots {...(disabled ? { 'data-disabled': true } : {})} key={index}>\n ...\n </PaginationDots>\n )\n }\n\n const isSelected = pageNumber === active\n\n return (\n <PaginationItem\n key={index}\n disabled={disabled}\n {...(isSelected\n ? {\n 'data-selected': true,\n }\n : {})}\n onClick={() => setPage(pageNumber)}\n >\n {pageNumber}\n </PaginationItem>\n )\n })}\n <IconButton\n size=\"md\"\n variant=\"tertiary\"\n aria-label=\"Previous\"\n disabled={disabled || active === total}\n onClick={handleNextPage}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10.8536 7.64645C11.0488 7.84171 11.0488 8.15829 10.8536 8.35355L5.85355 13.3536C5.65829 13.5488 5.34171 13.5488 5.14645 13.3536C4.95118 13.1583 4.95118 12.8417 5.14645 12.6464L9.79289 8L5.14645 3.35355C4.95118 3.15829 4.95118 2.84171 5.14645 2.64645C5.34171 2.45118 5.65829 2.45118 5.85355 2.64645L10.8536 7.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n </StyledPagination>\n )\n}\n"],"
|
|
1
|
+
{"version":3,"file":"Pagination.cjs","names":[],"sources":["../../../src/components/pagination/Pagination.tsx"],"sourcesContent":["import type { ComponentProps, FC } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { pagination } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { DOTS, usePagination } from './use-pagination'\nimport { createEventHandler } from '~/shared/utils/events'\nimport { IconButton } from '~/components/icon-button'\n\nconst { withProvider, withContext } = createStyleContext(pagination)\n\nconst StyledPagination = withProvider(styled('div'), 'root')\ntype StyledPaginationProps = ComponentProps<typeof StyledPagination>\n\nconst PaginationItem = withContext(styled('button'), 'item')\nconst PaginationDots = withContext(styled('div'), 'dots')\n\nexport interface PaginationProps extends Omit<StyledPaginationProps, 'children' | 'defaultValue' | 'onChange'> {\n total: number\n value?: number\n defaultValue?: number\n onChange?: (value: number) => void\n disabled?: boolean\n siblings?: number\n boundaries?: number\n onNextPage?: () => void\n onPrevPage?: () => void\n}\n\nexport const Pagination: FC<PaginationProps> = ({\n total,\n value,\n defaultValue,\n onChange,\n disabled,\n onNextPage,\n onPrevPage,\n siblings = 2,\n boundaries = 1,\n ...props\n}: PaginationProps) => {\n const { range, setPage, next, previous, active } = usePagination({\n page: value,\n initialPage: defaultValue,\n onChange,\n total,\n siblings,\n boundaries,\n })\n\n const handleNextPage = createEventHandler(onNextPage, next)\n const handlePreviousPage = createEventHandler(onPrevPage, previous)\n\n return (\n <StyledPagination {...props}>\n <IconButton\n size=\"md\"\n variant=\"tertiary\"\n aria-label=\"Previous\"\n disabled={disabled || active === 1}\n onClick={handlePreviousPage}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L10.1464 2.64645C10.3417 2.45119 10.6583 2.45119 10.8536 2.64645C11.0488 2.84171 11.0488 3.15829 10.8536 3.35355L6.20711 8L10.8536 12.6464C11.0488 12.8417 11.0488 13.1583 10.8536 13.3536C10.6583 13.5488 10.3417 13.5488 10.1464 13.3536L5.14645 8.35355Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n {range.map((pageNumber, index) => {\n if (pageNumber === DOTS) {\n return (\n <PaginationDots {...(disabled ? { 'data-disabled': true } : {})} key={index}>\n ...\n </PaginationDots>\n )\n }\n\n const isSelected = pageNumber === active\n\n return (\n <PaginationItem\n key={index}\n disabled={disabled}\n {...(isSelected\n ? {\n 'data-selected': true,\n }\n : {})}\n onClick={() => setPage(pageNumber)}\n >\n {pageNumber}\n </PaginationItem>\n )\n })}\n <IconButton\n size=\"md\"\n variant=\"tertiary\"\n aria-label=\"Previous\"\n disabled={disabled || active === total}\n onClick={handleNextPage}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10.8536 7.64645C11.0488 7.84171 11.0488 8.15829 10.8536 8.35355L5.85355 13.3536C5.65829 13.5488 5.34171 13.5488 5.14645 13.3536C4.95118 13.1583 4.95118 12.8417 5.14645 12.6464L9.79289 8L5.14645 3.35355C4.95118 3.15829 4.95118 2.84171 5.14645 2.64645C5.34171 2.45118 5.65829 2.45118 5.85355 2.64645L10.8536 7.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n </StyledPagination>\n )\n}\n"],"mappings":"wTAQA,GAAM,CAAE,eAAc,eAAgB,EAAA,mBAAmB,EAAA,UAAU,EAE7D,EAAmB,GAAA,EAAA,EAAA,QAAoB,KAAK,EAAG,MAAM,EAGrD,EAAiB,GAAA,EAAA,EAAA,QAAmB,QAAQ,EAAG,MAAM,EACrD,EAAiB,GAAA,EAAA,EAAA,QAAmB,KAAK,EAAG,MAAM,EAc3C,GAAmC,CAC9C,QACA,QACA,eACA,WACA,WACA,aACA,aACA,WAAW,EACX,aAAa,EACb,GAAG,KACkB,CACrB,GAAM,CAAE,QAAO,UAAS,OAAM,WAAU,UAAW,EAAA,cAAc,CAC/D,KAAM,EACN,YAAa,EACb,WACA,QACA,WACA,YACF,CAAC,EAEK,EAAiB,EAAA,mBAAmB,EAAY,CAAI,EACpD,EAAqB,EAAA,mBAAmB,EAAY,CAAQ,EAElE,OACE,EAAA,EAAA,MAAC,EAAD,CAAkB,GAAI,WAAtB,EACE,EAAA,EAAA,KAAC,EAAA,WAAD,CACE,KAAK,KACL,QAAQ,WACR,aAAW,WACX,SAAU,GAAY,IAAW,EACjC,QAAS,YAET,EAAA,EAAA,KAAC,MAAD,CAAK,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,uCAChE,EAAA,EAAA,KAAC,OAAD,CACE,SAAS,UACT,SAAS,UACT,EAAE,8TACF,KAAK,cACN,CAAA,CACE,CAAA,CACK,CAAA,EACX,EAAM,KAAK,EAAY,IAClB,IAAe,EAAA,MAEf,EAAA,EAAA,eAAC,EAAD,CAAgB,GAAK,EAAW,CAAE,gBAAiB,EAAK,EAAI,CAAC,EAAI,IAAK,CAEtD,EAF6D,KAE7D,GAOlB,EAAA,EAAA,KAAC,EAAD,CAEY,WACV,GANe,IAAe,EAO1B,CACE,gBAAiB,EACnB,EACA,CAAC,EACL,YAAe,EAAQ,CAAU,WAEhC,CACa,EAVT,CAUS,CAEnB,GACD,EAAA,EAAA,KAAC,EAAA,WAAD,CACE,KAAK,KACL,QAAQ,WACR,aAAW,WACX,SAAU,GAAY,IAAW,EACjC,QAAS,YAET,EAAA,EAAA,KAAC,MAAD,CAAK,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,uCAChE,EAAA,EAAA,KAAC,OAAD,CACE,SAAS,UACT,SAAS,UACT,EAAE,8TACF,KAAK,cACN,CAAA,CACE,CAAA,CACK,CAAA,CACI,GAEtB"}
|
|
@@ -1,86 +1,78 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
clipRule: "evenodd",
|
|
75
|
-
d: "M10.8536 7.64645C11.0488 7.84171 11.0488 8.15829 10.8536 8.35355L5.85355 13.3536C5.65829 13.5488 5.34171 13.5488 5.14645 13.3536C4.95118 13.1583 4.95118 12.8417 5.14645 12.6464L9.79289 8L5.14645 3.35355C4.95118 3.15829 4.95118 2.84171 5.14645 2.64645C5.34171 2.45118 5.65829 2.45118 5.85355 2.64645L10.8536 7.64645Z",
|
|
76
|
-
fill: "currentColor"
|
|
77
|
-
}
|
|
78
|
-
) })
|
|
79
|
-
}
|
|
80
|
-
)
|
|
81
|
-
] });
|
|
2
|
+
import { createStyleContext as e } from "../../utils/slots.js";
|
|
3
|
+
import { IconButton as t } from "../icon-button/IconButton.js";
|
|
4
|
+
import { DOTS as n, usePagination as r } from "./use-pagination.js";
|
|
5
|
+
import { createEventHandler as i } from "../../shared/utils/events.js";
|
|
6
|
+
import { styled as a } from "@stokelp/styled-system/jsx";
|
|
7
|
+
import { pagination as o } from "@stokelp/styled-system/recipes";
|
|
8
|
+
import { createElement as s } from "react";
|
|
9
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/pagination/Pagination.tsx
|
|
11
|
+
var { withProvider: u, withContext: d } = e(o), f = u(a("div"), "root"), p = d(a("button"), "item"), m = d(a("div"), "dots"), h = ({ total: e, value: a, defaultValue: o, onChange: u, disabled: d, onNextPage: h, onPrevPage: g, siblings: _ = 2, boundaries: v = 1, ...y }) => {
|
|
12
|
+
let { range: b, setPage: x, next: S, previous: C, active: w } = r({
|
|
13
|
+
page: a,
|
|
14
|
+
initialPage: o,
|
|
15
|
+
onChange: u,
|
|
16
|
+
total: e,
|
|
17
|
+
siblings: _,
|
|
18
|
+
boundaries: v
|
|
19
|
+
}), T = i(h, S), E = i(g, C);
|
|
20
|
+
return /* @__PURE__ */ l(f, {
|
|
21
|
+
...y,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ c(t, {
|
|
24
|
+
size: "md",
|
|
25
|
+
variant: "tertiary",
|
|
26
|
+
"aria-label": "Previous",
|
|
27
|
+
disabled: d || w === 1,
|
|
28
|
+
onClick: E,
|
|
29
|
+
children: /* @__PURE__ */ c("svg", {
|
|
30
|
+
width: "16",
|
|
31
|
+
height: "16",
|
|
32
|
+
viewBox: "0 0 16 16",
|
|
33
|
+
fill: "none",
|
|
34
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
35
|
+
children: /* @__PURE__ */ c("path", {
|
|
36
|
+
fillRule: "evenodd",
|
|
37
|
+
clipRule: "evenodd",
|
|
38
|
+
d: "M5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L10.1464 2.64645C10.3417 2.45119 10.6583 2.45119 10.8536 2.64645C11.0488 2.84171 11.0488 3.15829 10.8536 3.35355L6.20711 8L10.8536 12.6464C11.0488 12.8417 11.0488 13.1583 10.8536 13.3536C10.6583 13.5488 10.3417 13.5488 10.1464 13.3536L5.14645 8.35355Z",
|
|
39
|
+
fill: "currentColor"
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
}),
|
|
43
|
+
b.map((e, t) => e === n ? /* @__PURE__ */ s(m, {
|
|
44
|
+
...d ? { "data-disabled": !0 } : {},
|
|
45
|
+
key: t
|
|
46
|
+
}, "...") : /* @__PURE__ */ c(p, {
|
|
47
|
+
disabled: d,
|
|
48
|
+
...e === w ? { "data-selected": !0 } : {},
|
|
49
|
+
onClick: () => x(e),
|
|
50
|
+
children: e
|
|
51
|
+
}, t)),
|
|
52
|
+
/* @__PURE__ */ c(t, {
|
|
53
|
+
size: "md",
|
|
54
|
+
variant: "tertiary",
|
|
55
|
+
"aria-label": "Previous",
|
|
56
|
+
disabled: d || w === e,
|
|
57
|
+
onClick: T,
|
|
58
|
+
children: /* @__PURE__ */ c("svg", {
|
|
59
|
+
width: "16",
|
|
60
|
+
height: "16",
|
|
61
|
+
viewBox: "0 0 16 16",
|
|
62
|
+
fill: "none",
|
|
63
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
64
|
+
children: /* @__PURE__ */ c("path", {
|
|
65
|
+
fillRule: "evenodd",
|
|
66
|
+
clipRule: "evenodd",
|
|
67
|
+
d: "M10.8536 7.64645C11.0488 7.84171 11.0488 8.15829 10.8536 8.35355L5.85355 13.3536C5.65829 13.5488 5.34171 13.5488 5.14645 13.3536C4.95118 13.1583 4.95118 12.8417 5.14645 12.6464L9.79289 8L5.14645 3.35355C4.95118 3.15829 4.95118 2.84171 5.14645 2.64645C5.34171 2.45118 5.65829 2.45118 5.85355 2.64645L10.8536 7.64645Z",
|
|
68
|
+
fill: "currentColor"
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
});
|
|
82
74
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
//# sourceMappingURL=Pagination.js.map
|
|
75
|
+
//#endregion
|
|
76
|
+
export { h as Pagination };
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=Pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sources":["../../../src/components/pagination/Pagination.tsx"],"sourcesContent":["import type { ComponentProps, FC } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { pagination } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { DOTS, usePagination } from './use-pagination'\nimport { createEventHandler } from '~/shared/utils/events'\nimport { IconButton } from '~/components/icon-button'\n\nconst { withProvider, withContext } = createStyleContext(pagination)\n\nconst StyledPagination = withProvider(styled('div'), 'root')\ntype StyledPaginationProps = ComponentProps<typeof StyledPagination>\n\nconst PaginationItem = withContext(styled('button'), 'item')\nconst PaginationDots = withContext(styled('div'), 'dots')\n\nexport interface PaginationProps extends Omit<StyledPaginationProps, 'children' | 'defaultValue' | 'onChange'> {\n total: number\n value?: number\n defaultValue?: number\n onChange?: (value: number) => void\n disabled?: boolean\n siblings?: number\n boundaries?: number\n onNextPage?: () => void\n onPrevPage?: () => void\n}\n\nexport const Pagination: FC<PaginationProps> = ({\n total,\n value,\n defaultValue,\n onChange,\n disabled,\n onNextPage,\n onPrevPage,\n siblings = 2,\n boundaries = 1,\n ...props\n}: PaginationProps) => {\n const { range, setPage, next, previous, active } = usePagination({\n page: value,\n initialPage: defaultValue,\n onChange,\n total,\n siblings,\n boundaries,\n })\n\n const handleNextPage = createEventHandler(onNextPage, next)\n const handlePreviousPage = createEventHandler(onPrevPage, previous)\n\n return (\n <StyledPagination {...props}>\n <IconButton\n size=\"md\"\n variant=\"tertiary\"\n aria-label=\"Previous\"\n disabled={disabled || active === 1}\n onClick={handlePreviousPage}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L10.1464 2.64645C10.3417 2.45119 10.6583 2.45119 10.8536 2.64645C11.0488 2.84171 11.0488 3.15829 10.8536 3.35355L6.20711 8L10.8536 12.6464C11.0488 12.8417 11.0488 13.1583 10.8536 13.3536C10.6583 13.5488 10.3417 13.5488 10.1464 13.3536L5.14645 8.35355Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n {range.map((pageNumber, index) => {\n if (pageNumber === DOTS) {\n return (\n <PaginationDots {...(disabled ? { 'data-disabled': true } : {})} key={index}>\n ...\n </PaginationDots>\n )\n }\n\n const isSelected = pageNumber === active\n\n return (\n <PaginationItem\n key={index}\n disabled={disabled}\n {...(isSelected\n ? {\n 'data-selected': true,\n }\n : {})}\n onClick={() => setPage(pageNumber)}\n >\n {pageNumber}\n </PaginationItem>\n )\n })}\n <IconButton\n size=\"md\"\n variant=\"tertiary\"\n aria-label=\"Previous\"\n disabled={disabled || active === total}\n onClick={handleNextPage}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10.8536 7.64645C11.0488 7.84171 11.0488 8.15829 10.8536 8.35355L5.85355 13.3536C5.65829 13.5488 5.34171 13.5488 5.14645 13.3536C4.95118 13.1583 4.95118 12.8417 5.14645 12.6464L9.79289 8L5.14645 3.35355C4.95118 3.15829 4.95118 2.84171 5.14645 2.64645C5.34171 2.45118 5.65829 2.45118 5.85355 2.64645L10.8536 7.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n </StyledPagination>\n )\n}\n"],"
|
|
1
|
+
{"version":3,"file":"Pagination.js","names":[],"sources":["../../../src/components/pagination/Pagination.tsx"],"sourcesContent":["import type { ComponentProps, FC } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { pagination } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { DOTS, usePagination } from './use-pagination'\nimport { createEventHandler } from '~/shared/utils/events'\nimport { IconButton } from '~/components/icon-button'\n\nconst { withProvider, withContext } = createStyleContext(pagination)\n\nconst StyledPagination = withProvider(styled('div'), 'root')\ntype StyledPaginationProps = ComponentProps<typeof StyledPagination>\n\nconst PaginationItem = withContext(styled('button'), 'item')\nconst PaginationDots = withContext(styled('div'), 'dots')\n\nexport interface PaginationProps extends Omit<StyledPaginationProps, 'children' | 'defaultValue' | 'onChange'> {\n total: number\n value?: number\n defaultValue?: number\n onChange?: (value: number) => void\n disabled?: boolean\n siblings?: number\n boundaries?: number\n onNextPage?: () => void\n onPrevPage?: () => void\n}\n\nexport const Pagination: FC<PaginationProps> = ({\n total,\n value,\n defaultValue,\n onChange,\n disabled,\n onNextPage,\n onPrevPage,\n siblings = 2,\n boundaries = 1,\n ...props\n}: PaginationProps) => {\n const { range, setPage, next, previous, active } = usePagination({\n page: value,\n initialPage: defaultValue,\n onChange,\n total,\n siblings,\n boundaries,\n })\n\n const handleNextPage = createEventHandler(onNextPage, next)\n const handlePreviousPage = createEventHandler(onPrevPage, previous)\n\n return (\n <StyledPagination {...props}>\n <IconButton\n size=\"md\"\n variant=\"tertiary\"\n aria-label=\"Previous\"\n disabled={disabled || active === 1}\n onClick={handlePreviousPage}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L10.1464 2.64645C10.3417 2.45119 10.6583 2.45119 10.8536 2.64645C11.0488 2.84171 11.0488 3.15829 10.8536 3.35355L6.20711 8L10.8536 12.6464C11.0488 12.8417 11.0488 13.1583 10.8536 13.3536C10.6583 13.5488 10.3417 13.5488 10.1464 13.3536L5.14645 8.35355Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n {range.map((pageNumber, index) => {\n if (pageNumber === DOTS) {\n return (\n <PaginationDots {...(disabled ? { 'data-disabled': true } : {})} key={index}>\n ...\n </PaginationDots>\n )\n }\n\n const isSelected = pageNumber === active\n\n return (\n <PaginationItem\n key={index}\n disabled={disabled}\n {...(isSelected\n ? {\n 'data-selected': true,\n }\n : {})}\n onClick={() => setPage(pageNumber)}\n >\n {pageNumber}\n </PaginationItem>\n )\n })}\n <IconButton\n size=\"md\"\n variant=\"tertiary\"\n aria-label=\"Previous\"\n disabled={disabled || active === total}\n onClick={handleNextPage}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10.8536 7.64645C11.0488 7.84171 11.0488 8.15829 10.8536 8.35355L5.85355 13.3536C5.65829 13.5488 5.34171 13.5488 5.14645 13.3536C4.95118 13.1583 4.95118 12.8417 5.14645 12.6464L9.79289 8L5.14645 3.35355C4.95118 3.15829 4.95118 2.84171 5.14645 2.64645C5.34171 2.45118 5.65829 2.45118 5.85355 2.64645L10.8536 7.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n </StyledPagination>\n )\n}\n"],"mappings":";;;;;;;;;;AAQA,IAAM,EAAE,iBAAc,mBAAgB,EAAmB,CAAU,GAE7D,IAAmB,EAAa,EAAO,KAAK,GAAG,MAAM,GAGrD,IAAiB,EAAY,EAAO,QAAQ,GAAG,MAAM,GACrD,IAAiB,EAAY,EAAO,KAAK,GAAG,MAAM,GAc3C,KAAmC,EAC9C,UACA,UACA,iBACA,aACA,aACA,eACA,eACA,cAAW,GACX,gBAAa,GACb,GAAG,QACkB;CACrB,IAAM,EAAE,UAAO,YAAS,SAAM,aAAU,cAAW,EAAc;EAC/D,MAAM;EACN,aAAa;EACb;EACA;EACA;EACA;CACF,CAAC,GAEK,IAAiB,EAAmB,GAAY,CAAI,GACpD,IAAqB,EAAmB,GAAY,CAAQ;CAElE,OACE,kBAAC,GAAD;EAAkB,GAAI;YAAtB;GACE,kBAAC,GAAD;IACE,MAAK;IACL,SAAQ;IACR,cAAW;IACX,UAAU,KAAY,MAAW;IACjC,SAAS;cAET,kBAAC,OAAD;KAAK,OAAM;KAAK,QAAO;KAAK,SAAQ;KAAY,MAAK;KAAO,OAAM;eAChE,kBAAC,QAAD;MACE,UAAS;MACT,UAAS;MACT,GAAE;MACF,MAAK;KACN,CAAA;IACE,CAAA;GACK,CAAA;GACX,EAAM,KAAK,GAAY,MAClB,MAAe,IAEf,kBAAC,GAAD;IAAgB,GAAK,IAAW,EAAE,iBAAiB,GAAK,IAAI,CAAC;IAAI,KAAK;GAEtD,GAF6D,KAE7D,IAOlB,kBAAC,GAAD;IAEY;IACV,GANe,MAAe,IAO1B,EACE,iBAAiB,GACnB,IACA,CAAC;IACL,eAAe,EAAQ,CAAU;cAEhC;GACa,GAVT,CAUS,CAEnB;GACD,kBAAC,GAAD;IACE,MAAK;IACL,SAAQ;IACR,cAAW;IACX,UAAU,KAAY,MAAW;IACjC,SAAS;cAET,kBAAC,OAAD;KAAK,OAAM;KAAK,QAAO;KAAK,SAAQ;KAAY,MAAK;KAAO,OAAM;eAChE,kBAAC,QAAD;MACE,UAAS;MACT,UAAS;MACT,GAAE;MACF,MAAK;KACN,CAAA;IACE,CAAA;GACK,CAAA;EACI;;AAEtB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
//# sourceMappingURL=use-pagination.cjs.map
|
|
1
|
+
"use client";const e=require("../../shared/hooks/useUncontrolled.cjs");let t=require("react");function n(e,t){let n=t-e+1;return Array.from({length:n},(t,n)=>n+e)}var r=Symbol(`dots`),i=({total:i,siblings:a=1,boundaries:o=1,page:s,initialPage:c=1,onChange:l})=>{let u=Math.max(Math.trunc(i),0),[d,f]=e.useUncontrolled({value:s,onChange:l,defaultValue:c,finalValue:c}),p=e=>{f(e<=0?1:e>u?u:e)};return{range:(0,t.useMemo)(()=>{if(a*2+3+o*2>=u)return n(1,u);let e=Math.max(d-a,o),t=Math.min(d+a,u-o),i=e>o+2,s=t<u-(o+1);if(!i&&s)return[...n(1,a*2+o+2),r,...n(u-(o-1),u)];if(i&&!s){let e=o+1+2*a;return[...n(1,o),r,...n(u-e,u)]}return[...n(1,o),r,...n(e,t),r,...n(u-o+1,u)]},[u,a,o,d]),active:d,setPage:p,next:()=>p(d+1),previous:()=>p(d-1),first:()=>p(1),last:()=>p(u)}};exports.DOTS=r,exports.usePagination=i;
|
|
2
|
+
//# sourceMappingURL=use-pagination.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pagination.cjs","sources":["../../../src/components/pagination/use-pagination.ts"],"sourcesContent":["// https://github.com/mantinedev/mantine/blob/95115daf60364ba2e5aba5e5d42d69103f90cb1a/packages/%40mantine/hooks/src/use-pagination/use-pagination.ts\n\nimport { useMemo } from 'react'\nimport { useUncontrolled } from '~/shared/hooks/useUncontrolled'\n\nfunction range(start: number, end: number) {\n const length = end - start + 1\n return Array.from({ length }, (_, index) => index + start)\n}\n\nexport const DOTS: unique symbol = Symbol('dots')\n\nexport interface PaginationParams {\n initialPage?: number\n page?: number\n total: number\n siblings?: number\n boundaries?: number\n onChange?: (page: number) => void\n}\n\nexport const usePagination = ({\n total,\n siblings = 1,\n boundaries = 1,\n page,\n initialPage = 1,\n onChange,\n}: PaginationParams) => {\n const _total = Math.max(Math.trunc(total), 0)\n const [activePage, setActivePage] = useUncontrolled({\n value: page,\n onChange,\n defaultValue: initialPage,\n finalValue: initialPage,\n })\n\n const setPage = (pageNumber: number) => {\n if (pageNumber <= 0) {\n setActivePage(1)\n } else if (pageNumber > _total) {\n setActivePage(_total)\n } else {\n setActivePage(pageNumber)\n }\n }\n\n const next = () => setPage(activePage + 1)\n const previous = () => setPage(activePage - 1)\n const first = () => setPage(1)\n const last = () => setPage(_total)\n\n const paginationRange = useMemo((): (number | typeof DOTS)[] => {\n const totalPageNumbers = siblings * 2 + 3 + boundaries * 2\n if (totalPageNumbers >= _total) {\n return range(1, _total)\n }\n\n const leftSiblingIndex = Math.max(activePage - siblings, boundaries)\n const rightSiblingIndex = Math.min(activePage + siblings, _total - boundaries)\n\n const shouldShowLeftDots = leftSiblingIndex > boundaries + 2\n const shouldShowRightDots = rightSiblingIndex < _total - (boundaries + 1)\n\n if (!shouldShowLeftDots && shouldShowRightDots) {\n const leftItemCount = siblings * 2 + boundaries + 2\n return [...range(1, leftItemCount), DOTS, ...range(_total - (boundaries - 1), _total)]\n }\n\n if (shouldShowLeftDots && !shouldShowRightDots) {\n const rightItemCount = boundaries + 1 + 2 * siblings\n return [...range(1, boundaries), DOTS, ...range(_total - rightItemCount, _total)]\n }\n\n return [\n ...range(1, boundaries),\n DOTS,\n ...range(leftSiblingIndex, rightSiblingIndex),\n DOTS,\n ...range(_total - boundaries + 1, _total),\n ]\n }, [_total, siblings, boundaries, activePage])\n\n return {\n range: paginationRange,\n active: activePage,\n setPage,\n next,\n previous,\n first,\n last,\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"use-pagination.cjs","names":[],"sources":["../../../src/components/pagination/use-pagination.ts"],"sourcesContent":["// https://github.com/mantinedev/mantine/blob/95115daf60364ba2e5aba5e5d42d69103f90cb1a/packages/%40mantine/hooks/src/use-pagination/use-pagination.ts\n\nimport { useMemo } from 'react'\nimport { useUncontrolled } from '~/shared/hooks/useUncontrolled'\n\nfunction range(start: number, end: number) {\n const length = end - start + 1\n return Array.from({ length }, (_, index) => index + start)\n}\n\nexport const DOTS: unique symbol = Symbol('dots')\n\nexport interface PaginationParams {\n initialPage?: number\n page?: number\n total: number\n siblings?: number\n boundaries?: number\n onChange?: (page: number) => void\n}\n\nexport const usePagination = ({\n total,\n siblings = 1,\n boundaries = 1,\n page,\n initialPage = 1,\n onChange,\n}: PaginationParams) => {\n const _total = Math.max(Math.trunc(total), 0)\n const [activePage, setActivePage] = useUncontrolled({\n value: page,\n onChange,\n defaultValue: initialPage,\n finalValue: initialPage,\n })\n\n const setPage = (pageNumber: number) => {\n if (pageNumber <= 0) {\n setActivePage(1)\n } else if (pageNumber > _total) {\n setActivePage(_total)\n } else {\n setActivePage(pageNumber)\n }\n }\n\n const next = () => setPage(activePage + 1)\n const previous = () => setPage(activePage - 1)\n const first = () => setPage(1)\n const last = () => setPage(_total)\n\n const paginationRange = useMemo((): (number | typeof DOTS)[] => {\n const totalPageNumbers = siblings * 2 + 3 + boundaries * 2\n if (totalPageNumbers >= _total) {\n return range(1, _total)\n }\n\n const leftSiblingIndex = Math.max(activePage - siblings, boundaries)\n const rightSiblingIndex = Math.min(activePage + siblings, _total - boundaries)\n\n const shouldShowLeftDots = leftSiblingIndex > boundaries + 2\n const shouldShowRightDots = rightSiblingIndex < _total - (boundaries + 1)\n\n if (!shouldShowLeftDots && shouldShowRightDots) {\n const leftItemCount = siblings * 2 + boundaries + 2\n return [...range(1, leftItemCount), DOTS, ...range(_total - (boundaries - 1), _total)]\n }\n\n if (shouldShowLeftDots && !shouldShowRightDots) {\n const rightItemCount = boundaries + 1 + 2 * siblings\n return [...range(1, boundaries), DOTS, ...range(_total - rightItemCount, _total)]\n }\n\n return [\n ...range(1, boundaries),\n DOTS,\n ...range(leftSiblingIndex, rightSiblingIndex),\n DOTS,\n ...range(_total - boundaries + 1, _total),\n ]\n }, [_total, siblings, boundaries, activePage])\n\n return {\n range: paginationRange,\n active: activePage,\n setPage,\n next,\n previous,\n first,\n last,\n }\n}\n"],"mappings":"8FAKA,SAAS,EAAM,EAAe,EAAa,CACzC,IAAM,EAAS,EAAM,EAAQ,EAC7B,OAAO,MAAM,KAAK,CAAE,QAAO,GAAI,EAAG,IAAU,EAAQ,CAAK,CAC3D,CAEA,IAAa,EAAsB,OAAO,MAAM,EAWnC,GAAiB,CAC5B,QACA,WAAW,EACX,aAAa,EACb,OACA,cAAc,EACd,cACsB,CACtB,IAAM,EAAS,KAAK,IAAI,KAAK,MAAM,CAAK,EAAG,CAAC,EACtC,CAAC,EAAY,GAAiB,EAAA,gBAAgB,CAClD,MAAO,EACP,WACA,aAAc,EACd,WAAY,CACd,CAAC,EAEK,EAAW,GAAuB,CAEpC,EADE,GAAc,EACF,EACL,EAAa,EACR,EAEA,CAAU,CAE5B,EAsCA,MAAO,CACL,OAAA,EAAA,EAAA,aAhC8D,CAE9D,GADyB,EAAW,EAAI,EAAI,EAAa,GACjC,EACtB,OAAO,EAAM,EAAG,CAAM,EAGxB,IAAM,EAAmB,KAAK,IAAI,EAAa,EAAU,CAAU,EAC7D,EAAoB,KAAK,IAAI,EAAa,EAAU,EAAS,CAAU,EAEvE,EAAqB,EAAmB,EAAa,EACrD,EAAsB,EAAoB,GAAU,EAAa,GAEvE,GAAI,CAAC,GAAsB,EAEzB,MAAO,CAAC,GAAG,EAAM,EADK,EAAW,EAAI,EAAa,CACjB,EAAG,EAAM,GAAG,EAAM,GAAU,EAAa,GAAI,CAAM,CAAC,EAGvF,GAAI,GAAsB,CAAC,EAAqB,CAC9C,IAAM,EAAiB,EAAa,EAAI,EAAI,EAC5C,MAAO,CAAC,GAAG,EAAM,EAAG,CAAU,EAAG,EAAM,GAAG,EAAM,EAAS,EAAgB,CAAM,CAAC,CAClF,CAEA,MAAO,CACL,GAAG,EAAM,EAAG,CAAU,EACtB,EACA,GAAG,EAAM,EAAkB,CAAiB,EAC5C,EACA,GAAG,EAAM,EAAS,EAAa,EAAG,CAAM,CAC1C,CACF,EAAG,CAAC,EAAQ,EAAU,EAAY,CAAU,CAGnC,EACP,OAAQ,EACR,UACA,SAxCiB,EAAQ,EAAa,CAAC,EAyCvC,aAxCqB,EAAQ,EAAa,CAAC,EAyC3C,UAxCkB,EAAQ,CAAC,EAyC3B,SAxCiB,EAAQ,CAAM,CAyCjC,CACF"}
|
|
@@ -1,57 +1,59 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { useUncontrolled as e } from "../../shared/hooks/useUncontrolled.js";
|
|
3
|
+
import { useMemo as t } from "react";
|
|
4
|
+
//#region src/components/pagination/use-pagination.ts
|
|
5
|
+
function n(e, t) {
|
|
6
|
+
let n = t - e + 1;
|
|
7
|
+
return Array.from({ length: n }, (t, n) => n + e);
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
9
|
+
var r = Symbol("dots"), i = ({ total: i, siblings: a = 1, boundaries: o = 1, page: s, initialPage: c = 1, onChange: l }) => {
|
|
10
|
+
let u = Math.max(Math.trunc(i), 0), [d, f] = e({
|
|
11
|
+
value: s,
|
|
12
|
+
onChange: l,
|
|
13
|
+
defaultValue: c,
|
|
14
|
+
finalValue: c
|
|
15
|
+
}), p = (e) => {
|
|
16
|
+
f(e <= 0 ? 1 : e > u ? u : e);
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
range: t(() => {
|
|
20
|
+
if (a * 2 + 3 + o * 2 >= u) return n(1, u);
|
|
21
|
+
let e = Math.max(d - a, o), t = Math.min(d + a, u - o), i = e > o + 2, s = t < u - (o + 1);
|
|
22
|
+
if (!i && s) return [
|
|
23
|
+
...n(1, a * 2 + o + 2),
|
|
24
|
+
r,
|
|
25
|
+
...n(u - (o - 1), u)
|
|
26
|
+
];
|
|
27
|
+
if (i && !s) {
|
|
28
|
+
let e = o + 1 + 2 * a;
|
|
29
|
+
return [
|
|
30
|
+
...n(1, o),
|
|
31
|
+
r,
|
|
32
|
+
...n(u - e, u)
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
return [
|
|
36
|
+
...n(1, o),
|
|
37
|
+
r,
|
|
38
|
+
...n(e, t),
|
|
39
|
+
r,
|
|
40
|
+
...n(u - o + 1, u)
|
|
41
|
+
];
|
|
42
|
+
}, [
|
|
43
|
+
u,
|
|
44
|
+
a,
|
|
45
|
+
o,
|
|
46
|
+
d
|
|
47
|
+
]),
|
|
48
|
+
active: d,
|
|
49
|
+
setPage: p,
|
|
50
|
+
next: () => p(d + 1),
|
|
51
|
+
previous: () => p(d - 1),
|
|
52
|
+
first: () => p(1),
|
|
53
|
+
last: () => p(u)
|
|
54
|
+
};
|
|
52
55
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
//# sourceMappingURL=use-pagination.js.map
|
|
56
|
+
//#endregion
|
|
57
|
+
export { r as DOTS, i as usePagination };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=use-pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pagination.js","sources":["../../../src/components/pagination/use-pagination.ts"],"sourcesContent":["// https://github.com/mantinedev/mantine/blob/95115daf60364ba2e5aba5e5d42d69103f90cb1a/packages/%40mantine/hooks/src/use-pagination/use-pagination.ts\n\nimport { useMemo } from 'react'\nimport { useUncontrolled } from '~/shared/hooks/useUncontrolled'\n\nfunction range(start: number, end: number) {\n const length = end - start + 1\n return Array.from({ length }, (_, index) => index + start)\n}\n\nexport const DOTS: unique symbol = Symbol('dots')\n\nexport interface PaginationParams {\n initialPage?: number\n page?: number\n total: number\n siblings?: number\n boundaries?: number\n onChange?: (page: number) => void\n}\n\nexport const usePagination = ({\n total,\n siblings = 1,\n boundaries = 1,\n page,\n initialPage = 1,\n onChange,\n}: PaginationParams) => {\n const _total = Math.max(Math.trunc(total), 0)\n const [activePage, setActivePage] = useUncontrolled({\n value: page,\n onChange,\n defaultValue: initialPage,\n finalValue: initialPage,\n })\n\n const setPage = (pageNumber: number) => {\n if (pageNumber <= 0) {\n setActivePage(1)\n } else if (pageNumber > _total) {\n setActivePage(_total)\n } else {\n setActivePage(pageNumber)\n }\n }\n\n const next = () => setPage(activePage + 1)\n const previous = () => setPage(activePage - 1)\n const first = () => setPage(1)\n const last = () => setPage(_total)\n\n const paginationRange = useMemo((): (number | typeof DOTS)[] => {\n const totalPageNumbers = siblings * 2 + 3 + boundaries * 2\n if (totalPageNumbers >= _total) {\n return range(1, _total)\n }\n\n const leftSiblingIndex = Math.max(activePage - siblings, boundaries)\n const rightSiblingIndex = Math.min(activePage + siblings, _total - boundaries)\n\n const shouldShowLeftDots = leftSiblingIndex > boundaries + 2\n const shouldShowRightDots = rightSiblingIndex < _total - (boundaries + 1)\n\n if (!shouldShowLeftDots && shouldShowRightDots) {\n const leftItemCount = siblings * 2 + boundaries + 2\n return [...range(1, leftItemCount), DOTS, ...range(_total - (boundaries - 1), _total)]\n }\n\n if (shouldShowLeftDots && !shouldShowRightDots) {\n const rightItemCount = boundaries + 1 + 2 * siblings\n return [...range(1, boundaries), DOTS, ...range(_total - rightItemCount, _total)]\n }\n\n return [\n ...range(1, boundaries),\n DOTS,\n ...range(leftSiblingIndex, rightSiblingIndex),\n DOTS,\n ...range(_total - boundaries + 1, _total),\n ]\n }, [_total, siblings, boundaries, activePage])\n\n return {\n range: paginationRange,\n active: activePage,\n setPage,\n next,\n previous,\n first,\n last,\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"use-pagination.js","names":[],"sources":["../../../src/components/pagination/use-pagination.ts"],"sourcesContent":["// https://github.com/mantinedev/mantine/blob/95115daf60364ba2e5aba5e5d42d69103f90cb1a/packages/%40mantine/hooks/src/use-pagination/use-pagination.ts\n\nimport { useMemo } from 'react'\nimport { useUncontrolled } from '~/shared/hooks/useUncontrolled'\n\nfunction range(start: number, end: number) {\n const length = end - start + 1\n return Array.from({ length }, (_, index) => index + start)\n}\n\nexport const DOTS: unique symbol = Symbol('dots')\n\nexport interface PaginationParams {\n initialPage?: number\n page?: number\n total: number\n siblings?: number\n boundaries?: number\n onChange?: (page: number) => void\n}\n\nexport const usePagination = ({\n total,\n siblings = 1,\n boundaries = 1,\n page,\n initialPage = 1,\n onChange,\n}: PaginationParams) => {\n const _total = Math.max(Math.trunc(total), 0)\n const [activePage, setActivePage] = useUncontrolled({\n value: page,\n onChange,\n defaultValue: initialPage,\n finalValue: initialPage,\n })\n\n const setPage = (pageNumber: number) => {\n if (pageNumber <= 0) {\n setActivePage(1)\n } else if (pageNumber > _total) {\n setActivePage(_total)\n } else {\n setActivePage(pageNumber)\n }\n }\n\n const next = () => setPage(activePage + 1)\n const previous = () => setPage(activePage - 1)\n const first = () => setPage(1)\n const last = () => setPage(_total)\n\n const paginationRange = useMemo((): (number | typeof DOTS)[] => {\n const totalPageNumbers = siblings * 2 + 3 + boundaries * 2\n if (totalPageNumbers >= _total) {\n return range(1, _total)\n }\n\n const leftSiblingIndex = Math.max(activePage - siblings, boundaries)\n const rightSiblingIndex = Math.min(activePage + siblings, _total - boundaries)\n\n const shouldShowLeftDots = leftSiblingIndex > boundaries + 2\n const shouldShowRightDots = rightSiblingIndex < _total - (boundaries + 1)\n\n if (!shouldShowLeftDots && shouldShowRightDots) {\n const leftItemCount = siblings * 2 + boundaries + 2\n return [...range(1, leftItemCount), DOTS, ...range(_total - (boundaries - 1), _total)]\n }\n\n if (shouldShowLeftDots && !shouldShowRightDots) {\n const rightItemCount = boundaries + 1 + 2 * siblings\n return [...range(1, boundaries), DOTS, ...range(_total - rightItemCount, _total)]\n }\n\n return [\n ...range(1, boundaries),\n DOTS,\n ...range(leftSiblingIndex, rightSiblingIndex),\n DOTS,\n ...range(_total - boundaries + 1, _total),\n ]\n }, [_total, siblings, boundaries, activePage])\n\n return {\n range: paginationRange,\n active: activePage,\n setPage,\n next,\n previous,\n first,\n last,\n }\n}\n"],"mappings":";;;;AAKA,SAAS,EAAM,GAAe,GAAa;CACzC,IAAM,IAAS,IAAM,IAAQ;CAC7B,OAAO,MAAM,KAAK,EAAE,UAAO,IAAI,GAAG,MAAU,IAAQ,CAAK;AAC3D;AAEA,IAAa,IAAsB,OAAO,MAAM,GAWnC,KAAiB,EAC5B,UACA,cAAW,GACX,gBAAa,GACb,SACA,iBAAc,GACd,kBACsB;CACtB,IAAM,IAAS,KAAK,IAAI,KAAK,MAAM,CAAK,GAAG,CAAC,GACtC,CAAC,GAAY,KAAiB,EAAgB;EAClD,OAAO;EACP;EACA,cAAc;EACd,YAAY;CACd,CAAC,GAEK,KAAW,MAAuB;EACtC,AACE,EADE,KAAc,IACF,IACL,IAAa,IACR,IAEA,CAAU;CAE5B;CAsCA,OAAO;EACL,OAhCsB,QAAwC;GAE9D,IADyB,IAAW,IAAI,IAAI,IAAa,KACjC,GACtB,OAAO,EAAM,GAAG,CAAM;GAGxB,IAAM,IAAmB,KAAK,IAAI,IAAa,GAAU,CAAU,GAC7D,IAAoB,KAAK,IAAI,IAAa,GAAU,IAAS,CAAU,GAEvE,IAAqB,IAAmB,IAAa,GACrD,IAAsB,IAAoB,KAAU,IAAa;GAEvE,IAAI,CAAC,KAAsB,GAEzB,OAAO;IAAC,GAAG,EAAM,GADK,IAAW,IAAI,IAAa,CACjB;IAAG;IAAM,GAAG,EAAM,KAAU,IAAa,IAAI,CAAM;GAAC;GAGvF,IAAI,KAAsB,CAAC,GAAqB;IAC9C,IAAM,IAAiB,IAAa,IAAI,IAAI;IAC5C,OAAO;KAAC,GAAG,EAAM,GAAG,CAAU;KAAG;KAAM,GAAG,EAAM,IAAS,GAAgB,CAAM;IAAC;GAClF;GAEA,OAAO;IACL,GAAG,EAAM,GAAG,CAAU;IACtB;IACA,GAAG,EAAM,GAAkB,CAAiB;IAC5C;IACA,GAAG,EAAM,IAAS,IAAa,GAAG,CAAM;GAC1C;EACF,GAAG;GAAC;GAAQ;GAAU;GAAY;EAAU,CAGnC;EACP,QAAQ;EACR;EACA,YAxCiB,EAAQ,IAAa,CAAC;EAyCvC,gBAxCqB,EAAQ,IAAa,CAAC;EAyC3C,aAxCkB,EAAQ,CAAC;EAyC3B,YAxCiB,EAAQ,CAAM;CAyCjC;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
//# sourceMappingURL=Popover.cjs.map
|
|
1
|
+
"use client";const e=require("../../utils/slots.cjs");let t=require("@ark-ui/react"),n=require("@stokelp/styled-system/jsx"),r=require("@stokelp/styled-system/recipes"),i=require("react"),a=require("react/jsx-runtime");var{withProvider:o,withContext:s}=e.createStyleContext(r.popover),c=o(t.Popover.Root,void 0,{defaultProps:{unmountOnExit:!0,lazyMount:!0,portalled:!0}}),l=s((0,n.styled)(t.Popover.CloseTrigger),`closeTrigger`),u=s((0,n.styled)(t.Popover.Trigger),`trigger`),d=s((0,n.styled)(t.Popover.Anchor),`anchor`),f=s((0,n.styled)(t.Popover.Positioner),`positioner`),p=(0,i.forwardRef)(({children:e,...n},r)=>(0,a.jsx)(t.Portal,{children:(0,a.jsx)(f,{children:(0,a.jsx)(t.Popover.Content,{ref:r,...n,children:e})})}));p.displayName=t.Popover.Content.displayName;var m=s((0,n.styled)(p),`content`),h=t.Popover.Context;exports.Popover=c,exports.PopoverAnchor=d,exports.PopoverCloseTrigger=l,exports.PopoverContent=m,exports.PopoverContext=h,exports.PopoverTrigger=u;
|
|
2
|
+
//# sourceMappingURL=Popover.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.cjs","sources":["../../../src/components/popover/Popover.tsx"],"sourcesContent":["import { Portal } from '@ark-ui/react'\nimport { Popover as ArkPopover } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { popover } from '@stokelp/styled-system/recipes'\nimport type { ComponentProps, ComponentPropsWithoutRef, ElementRef } from 'react'\nimport { forwardRef } from 'react'\n\nimport { createStyleContext } from '~/utils/slots'\n\nconst { withProvider, withContext } = createStyleContext(popover)\n\nexport const Popover = withProvider(ArkPopover.Root, undefined, {\n defaultProps: {\n unmountOnExit: true,\n lazyMount: true,\n portalled: true,\n },\n})\nexport const PopoverCloseTrigger = withContext(styled(ArkPopover.CloseTrigger), 'closeTrigger')\nexport const PopoverTrigger = withContext(styled(ArkPopover.Trigger), 'trigger')\nexport const PopoverAnchor = withContext(styled(ArkPopover.Anchor), 'anchor')\n\nconst PopoverPositioner = withContext(styled(ArkPopover.Positioner), 'positioner')\n\nconst Content = forwardRef<ElementRef<typeof ArkPopover.Content>, ComponentPropsWithoutRef<typeof ArkPopover.Content>>(\n ({ children, ...props }, ref) => (\n <Portal>\n <PopoverPositioner>\n <ArkPopover.Content ref={ref} {...props}>\n {children}\n </ArkPopover.Content>\n </PopoverPositioner>\n </Portal>\n ),\n)\nContent.displayName = ArkPopover.Content.displayName\n\nexport const PopoverContent = withContext(styled(Content), 'content')\nexport const PopoverContext = ArkPopover.Context\n\nexport interface PopoverProps extends ComponentProps<typeof Popover> {}\nexport interface PopoverCloseTriggerProps extends ComponentProps<typeof PopoverCloseTrigger> {}\nexport interface PopoverContentProps extends ComponentProps<typeof PopoverContent> {}\nexport interface PopoverTriggerProps extends ComponentProps<typeof PopoverTrigger> {}\nexport interface PopoverAnchorProps extends ComponentProps<typeof PopoverAnchor> {}\nexport interface PopoverContextProps extends ComponentProps<typeof PopoverContext> {}\n"],"
|
|
1
|
+
{"version":3,"file":"Popover.cjs","names":[],"sources":["../../../src/components/popover/Popover.tsx"],"sourcesContent":["import { Portal } from '@ark-ui/react'\nimport { Popover as ArkPopover } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { popover } from '@stokelp/styled-system/recipes'\nimport type { ComponentProps, ComponentPropsWithoutRef, ElementRef } from 'react'\nimport { forwardRef } from 'react'\n\nimport { createStyleContext } from '~/utils/slots'\n\nconst { withProvider, withContext } = createStyleContext(popover)\n\nexport const Popover = withProvider(ArkPopover.Root, undefined, {\n defaultProps: {\n unmountOnExit: true,\n lazyMount: true,\n portalled: true,\n },\n})\nexport const PopoverCloseTrigger = withContext(styled(ArkPopover.CloseTrigger), 'closeTrigger')\nexport const PopoverTrigger = withContext(styled(ArkPopover.Trigger), 'trigger')\nexport const PopoverAnchor = withContext(styled(ArkPopover.Anchor), 'anchor')\n\nconst PopoverPositioner = withContext(styled(ArkPopover.Positioner), 'positioner')\n\nconst Content = forwardRef<ElementRef<typeof ArkPopover.Content>, ComponentPropsWithoutRef<typeof ArkPopover.Content>>(\n ({ children, ...props }, ref) => (\n <Portal>\n <PopoverPositioner>\n <ArkPopover.Content ref={ref} {...props}>\n {children}\n </ArkPopover.Content>\n </PopoverPositioner>\n </Portal>\n ),\n)\nContent.displayName = ArkPopover.Content.displayName\n\nexport const PopoverContent = withContext(styled(Content), 'content')\nexport const PopoverContext = ArkPopover.Context\n\nexport interface PopoverProps extends ComponentProps<typeof Popover> {}\nexport interface PopoverCloseTriggerProps extends ComponentProps<typeof PopoverCloseTrigger> {}\nexport interface PopoverContentProps extends ComponentProps<typeof PopoverContent> {}\nexport interface PopoverTriggerProps extends ComponentProps<typeof PopoverTrigger> {}\nexport interface PopoverAnchorProps extends ComponentProps<typeof PopoverAnchor> {}\nexport interface PopoverContextProps extends ComponentProps<typeof PopoverContext> {}\n"],"mappings":"2NASA,GAAM,CAAE,eAAc,eAAgB,EAAA,mBAAmB,EAAA,OAAO,EAEnD,EAAU,EAAa,EAAA,QAAW,KAAM,IAAA,GAAW,CAC9D,aAAc,CACZ,cAAe,GACf,UAAW,GACX,UAAW,EACb,CACF,CAAC,EACY,EAAsB,GAAA,EAAA,EAAA,QAAmB,EAAA,QAAW,YAAY,EAAG,cAAc,EACjF,EAAiB,GAAA,EAAA,EAAA,QAAmB,EAAA,QAAW,OAAO,EAAG,SAAS,EAClE,EAAgB,GAAA,EAAA,EAAA,QAAmB,EAAA,QAAW,MAAM,EAAG,QAAQ,EAEtE,EAAoB,GAAA,EAAA,EAAA,QAAmB,EAAA,QAAW,UAAU,EAAG,YAAY,EAE3E,GAAA,EAAA,EAAA,aACH,CAAE,WAAU,GAAG,GAAS,KACvB,EAAA,EAAA,KAAC,EAAA,OAAD,CAAA,UACE,EAAA,EAAA,KAAC,EAAD,CAAA,UACE,EAAA,EAAA,KAAC,EAAA,QAAW,QAAZ,CAAyB,MAAK,GAAI,EAC/B,UACiB,CAAA,CACH,CAAA,CACb,CAAA,CAEZ,EACA,EAAQ,YAAc,EAAA,QAAW,QAAQ,YAEzC,IAAa,EAAiB,GAAA,EAAA,EAAA,QAAmB,CAAO,EAAG,SAAS,EACvD,EAAiB,EAAA,QAAW"}
|
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { Popover as
|
|
2
|
+
import { createStyleContext as e } from "../../utils/slots.js";
|
|
3
|
+
import { Popover as t, Portal as n } from "@ark-ui/react";
|
|
4
4
|
import { styled as r } from "@stokelp/styled-system/jsx";
|
|
5
|
-
import { popover as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
N as PopoverContext,
|
|
25
|
-
T as PopoverTrigger
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=Popover.js.map
|
|
5
|
+
import { popover as i } from "@stokelp/styled-system/recipes";
|
|
6
|
+
import { forwardRef as a } from "react";
|
|
7
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/popover/Popover.tsx
|
|
9
|
+
var { withProvider: s, withContext: c } = e(i), l = s(t.Root, void 0, { defaultProps: {
|
|
10
|
+
unmountOnExit: !0,
|
|
11
|
+
lazyMount: !0,
|
|
12
|
+
portalled: !0
|
|
13
|
+
} }), u = c(r(t.CloseTrigger), "closeTrigger"), d = c(r(t.Trigger), "trigger"), f = c(r(t.Anchor), "anchor"), p = c(r(t.Positioner), "positioner"), m = a(({ children: e, ...r }, i) => /* @__PURE__ */ o(n, { children: /* @__PURE__ */ o(p, { children: /* @__PURE__ */ o(t.Content, {
|
|
14
|
+
ref: i,
|
|
15
|
+
...r,
|
|
16
|
+
children: e
|
|
17
|
+
}) }) }));
|
|
18
|
+
m.displayName = t.Content.displayName;
|
|
19
|
+
var h = c(r(m), "content"), g = t.Context;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { l as Popover, f as PopoverAnchor, u as PopoverCloseTrigger, h as PopoverContent, g as PopoverContext, d as PopoverTrigger };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=Popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","sources":["../../../src/components/popover/Popover.tsx"],"sourcesContent":["import { Portal } from '@ark-ui/react'\nimport { Popover as ArkPopover } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { popover } from '@stokelp/styled-system/recipes'\nimport type { ComponentProps, ComponentPropsWithoutRef, ElementRef } from 'react'\nimport { forwardRef } from 'react'\n\nimport { createStyleContext } from '~/utils/slots'\n\nconst { withProvider, withContext } = createStyleContext(popover)\n\nexport const Popover = withProvider(ArkPopover.Root, undefined, {\n defaultProps: {\n unmountOnExit: true,\n lazyMount: true,\n portalled: true,\n },\n})\nexport const PopoverCloseTrigger = withContext(styled(ArkPopover.CloseTrigger), 'closeTrigger')\nexport const PopoverTrigger = withContext(styled(ArkPopover.Trigger), 'trigger')\nexport const PopoverAnchor = withContext(styled(ArkPopover.Anchor), 'anchor')\n\nconst PopoverPositioner = withContext(styled(ArkPopover.Positioner), 'positioner')\n\nconst Content = forwardRef<ElementRef<typeof ArkPopover.Content>, ComponentPropsWithoutRef<typeof ArkPopover.Content>>(\n ({ children, ...props }, ref) => (\n <Portal>\n <PopoverPositioner>\n <ArkPopover.Content ref={ref} {...props}>\n {children}\n </ArkPopover.Content>\n </PopoverPositioner>\n </Portal>\n ),\n)\nContent.displayName = ArkPopover.Content.displayName\n\nexport const PopoverContent = withContext(styled(Content), 'content')\nexport const PopoverContext = ArkPopover.Context\n\nexport interface PopoverProps extends ComponentProps<typeof Popover> {}\nexport interface PopoverCloseTriggerProps extends ComponentProps<typeof PopoverCloseTrigger> {}\nexport interface PopoverContentProps extends ComponentProps<typeof PopoverContent> {}\nexport interface PopoverTriggerProps extends ComponentProps<typeof PopoverTrigger> {}\nexport interface PopoverAnchorProps extends ComponentProps<typeof PopoverAnchor> {}\nexport interface PopoverContextProps extends ComponentProps<typeof PopoverContext> {}\n"],"
|
|
1
|
+
{"version":3,"file":"Popover.js","names":[],"sources":["../../../src/components/popover/Popover.tsx"],"sourcesContent":["import { Portal } from '@ark-ui/react'\nimport { Popover as ArkPopover } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { popover } from '@stokelp/styled-system/recipes'\nimport type { ComponentProps, ComponentPropsWithoutRef, ElementRef } from 'react'\nimport { forwardRef } from 'react'\n\nimport { createStyleContext } from '~/utils/slots'\n\nconst { withProvider, withContext } = createStyleContext(popover)\n\nexport const Popover = withProvider(ArkPopover.Root, undefined, {\n defaultProps: {\n unmountOnExit: true,\n lazyMount: true,\n portalled: true,\n },\n})\nexport const PopoverCloseTrigger = withContext(styled(ArkPopover.CloseTrigger), 'closeTrigger')\nexport const PopoverTrigger = withContext(styled(ArkPopover.Trigger), 'trigger')\nexport const PopoverAnchor = withContext(styled(ArkPopover.Anchor), 'anchor')\n\nconst PopoverPositioner = withContext(styled(ArkPopover.Positioner), 'positioner')\n\nconst Content = forwardRef<ElementRef<typeof ArkPopover.Content>, ComponentPropsWithoutRef<typeof ArkPopover.Content>>(\n ({ children, ...props }, ref) => (\n <Portal>\n <PopoverPositioner>\n <ArkPopover.Content ref={ref} {...props}>\n {children}\n </ArkPopover.Content>\n </PopoverPositioner>\n </Portal>\n ),\n)\nContent.displayName = ArkPopover.Content.displayName\n\nexport const PopoverContent = withContext(styled(Content), 'content')\nexport const PopoverContext = ArkPopover.Context\n\nexport interface PopoverProps extends ComponentProps<typeof Popover> {}\nexport interface PopoverCloseTriggerProps extends ComponentProps<typeof PopoverCloseTrigger> {}\nexport interface PopoverContentProps extends ComponentProps<typeof PopoverContent> {}\nexport interface PopoverTriggerProps extends ComponentProps<typeof PopoverTrigger> {}\nexport interface PopoverAnchorProps extends ComponentProps<typeof PopoverAnchor> {}\nexport interface PopoverContextProps extends ComponentProps<typeof PopoverContext> {}\n"],"mappings":";;;;;;;;AASA,IAAM,EAAE,iBAAc,mBAAgB,EAAmB,CAAO,GAEnD,IAAU,EAAa,EAAW,MAAM,KAAA,GAAW,EAC9D,cAAc;CACZ,eAAe;CACf,WAAW;CACX,WAAW;AACb,EACF,CAAC,GACY,IAAsB,EAAY,EAAO,EAAW,YAAY,GAAG,cAAc,GACjF,IAAiB,EAAY,EAAO,EAAW,OAAO,GAAG,SAAS,GAClE,IAAgB,EAAY,EAAO,EAAW,MAAM,GAAG,QAAQ,GAEtE,IAAoB,EAAY,EAAO,EAAW,UAAU,GAAG,YAAY,GAE3E,IAAU,GACb,EAAE,aAAU,GAAG,KAAS,MACvB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,EAAW,SAAZ;CAAyB;CAAK,GAAI;CAC/B;AACiB,CAAA,EACH,CAAA,EACb,CAAA,CAEZ;AACA,EAAQ,cAAc,EAAW,QAAQ;AAEzC,IAAa,IAAiB,EAAY,EAAO,CAAO,GAAG,SAAS,GACvD,IAAiB,EAAW"}
|