@stokelp/ui 2.96.6 → 2.97.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/_commonjsHelpers.cjs +2 -0
- package/dist/_virtual/_commonjsHelpers.cjs.map +1 -0
- package/dist/_virtual/_commonjsHelpers.js +10 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/cjs.cjs +2 -0
- package/dist/_virtual/cjs.cjs.map +1 -0
- package/dist/_virtual/cjs.js +9 -0
- package/dist/_virtual/cjs.js.map +1 -0
- package/dist/_virtual/lodash.cjs +2 -0
- package/dist/_virtual/lodash.cjs.map +1 -0
- package/dist/_virtual/lodash.js +7 -0
- package/dist/_virtual/lodash.js.map +1 -0
- package/dist/_virtual/lodash2.cjs +2 -0
- package/dist/_virtual/lodash2.cjs.map +1 -0
- package/dist/_virtual/lodash2.js +6 -0
- package/dist/_virtual/lodash2.js.map +1 -0
- package/dist/components/accordion/Accordion.cjs +2 -0
- package/dist/components/accordion/Accordion.cjs.map +1 -0
- package/dist/components/accordion/Accordion.js +29 -0
- package/dist/components/accordion/Accordion.js.map +1 -0
- package/dist/components/action-card/ActionCard.cjs +2 -0
- package/dist/components/action-card/ActionCard.cjs.map +1 -0
- package/dist/components/action-card/ActionCard.js +28 -0
- package/dist/components/action-card/ActionCard.js.map +1 -0
- package/dist/components/alert/Alert.cjs +2 -0
- package/dist/components/alert/Alert.cjs.map +1 -0
- package/dist/components/alert/Alert.js +85 -0
- package/dist/components/alert/Alert.js.map +1 -0
- package/dist/components/app/navigation/AppNavigation.cjs +2 -0
- package/dist/components/app/navigation/AppNavigation.cjs.map +1 -0
- package/dist/components/app/navigation/AppNavigation.js +48 -0
- package/dist/components/app/navigation/AppNavigation.js.map +1 -0
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs +2 -0
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs.map +1 -0
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js +120 -0
- package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js.map +1 -0
- package/dist/components/app/price-tag/PriceTag.cjs +2 -0
- package/dist/components/app/price-tag/PriceTag.cjs.map +1 -0
- package/dist/components/app/price-tag/PriceTag.js +21 -0
- package/dist/components/app/price-tag/PriceTag.js.map +1 -0
- package/dist/components/app/product-card-catalog/styled.cjs +2 -0
- package/dist/components/app/product-card-catalog/styled.cjs.map +1 -0
- package/dist/components/app/product-card-catalog/styled.js +22 -0
- package/dist/components/app/product-card-catalog/styled.js.map +1 -0
- package/dist/components/avatar/styled.cjs +2 -0
- package/dist/components/avatar/styled.cjs.map +1 -0
- package/dist/components/avatar/styled.js +28 -0
- package/dist/components/avatar/styled.js.map +1 -0
- package/dist/components/box/Box.cjs +2 -0
- package/dist/components/box/Box.cjs.map +1 -0
- package/dist/components/box/Box.js +12 -0
- package/dist/components/box/Box.js.map +1 -0
- package/dist/components/breadcrumb/Breadcrumb.cjs +2 -0
- package/dist/components/breadcrumb/Breadcrumb.cjs.map +1 -0
- package/dist/components/breadcrumb/Breadcrumb.js +36 -0
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/button/Button.cjs +2 -0
- package/dist/components/button/Button.cjs.map +1 -0
- package/dist/components/button/Button.js +9 -0
- package/dist/components/button/Button.js.map +1 -0
- package/dist/components/button-filter/ButtonFilter.cjs +2 -0
- package/dist/components/button-filter/ButtonFilter.cjs.map +1 -0
- package/dist/components/button-filter/ButtonFilter.js +9 -0
- package/dist/components/button-filter/ButtonFilter.js.map +1 -0
- package/dist/components/chat/Chat.cjs +2 -0
- package/dist/components/chat/Chat.cjs.map +1 -0
- package/dist/components/chat/Chat.js +27 -0
- package/dist/components/chat/Chat.js.map +1 -0
- package/dist/components/chat/ChatDocumentMessage.cjs +2 -0
- package/dist/components/chat/ChatDocumentMessage.cjs.map +1 -0
- package/dist/components/chat/ChatDocumentMessage.js +33 -0
- package/dist/components/chat/ChatDocumentMessage.js.map +1 -0
- package/dist/components/chat/ChatMessage.cjs +2 -0
- package/dist/components/chat/ChatMessage.cjs.map +1 -0
- package/dist/components/chat/ChatMessage.js +9 -0
- package/dist/components/chat/ChatMessage.js.map +1 -0
- package/dist/components/chat/ChatProfileAvatar.cjs +2 -0
- package/dist/components/chat/ChatProfileAvatar.cjs.map +1 -0
- package/dist/components/chat/ChatProfileAvatar.js +17 -0
- package/dist/components/chat/ChatProfileAvatar.js.map +1 -0
- package/dist/components/chat/ChatTextInput.cjs +2 -0
- package/dist/components/chat/ChatTextInput.cjs.map +1 -0
- package/dist/components/chat/ChatTextInput.js +54 -0
- package/dist/components/chat/ChatTextInput.js.map +1 -0
- package/dist/components/checkbox/Checkbox.cjs +2 -0
- package/dist/components/checkbox/Checkbox.cjs.map +1 -0
- package/dist/components/checkbox/Checkbox.js +35 -0
- package/dist/components/checkbox/Checkbox.js.map +1 -0
- package/dist/components/checkbox-card/CheckboxCard.cjs +2 -0
- package/dist/components/checkbox-card/CheckboxCard.cjs.map +1 -0
- package/dist/components/checkbox-card/CheckboxCard.js +40 -0
- package/dist/components/checkbox-card/CheckboxCard.js.map +1 -0
- package/dist/components/checkbox-card/namespace.cjs +2 -0
- package/dist/components/checkbox-card/namespace.cjs.map +1 -0
- package/dist/components/checkbox-card/namespace.js +10 -0
- package/dist/components/checkbox-card/namespace.js.map +1 -0
- package/dist/components/chip/Chip.cjs +2 -0
- package/dist/components/chip/Chip.cjs.map +1 -0
- package/dist/components/chip/Chip.js +25 -0
- package/dist/components/chip/Chip.js.map +1 -0
- package/dist/components/collapsible/styled.cjs +2 -0
- package/dist/components/collapsible/styled.cjs.map +1 -0
- package/dist/components/collapsible/styled.js +12 -0
- package/dist/components/collapsible/styled.js.map +1 -0
- package/dist/components/combobox/Combobox.cjs +2 -0
- package/dist/components/combobox/Combobox.cjs.map +1 -0
- package/dist/components/combobox/Combobox.js +176 -0
- package/dist/components/combobox/Combobox.js.map +1 -0
- package/dist/components/date-picker/DatePicker.cjs +2 -0
- package/dist/components/date-picker/DatePicker.cjs.map +1 -0
- package/dist/components/date-picker/DatePicker.js +129 -0
- package/dist/components/date-picker/DatePicker.js.map +1 -0
- package/dist/components/dialog/styled.cjs +2 -0
- package/dist/components/dialog/styled.cjs.map +1 -0
- package/dist/components/dialog/styled.js +67 -0
- package/dist/components/dialog/styled.js.map +1 -0
- package/dist/components/drawer/Drawer.cjs +2 -0
- package/dist/components/drawer/Drawer.cjs.map +1 -0
- package/dist/components/drawer/Drawer.js +64 -0
- package/dist/components/drawer/Drawer.js.map +1 -0
- package/dist/components/flag/styled.cjs +2 -0
- package/dist/components/flag/styled.cjs.map +1 -0
- package/dist/components/flag/styled.js +3753 -0
- package/dist/components/flag/styled.js.map +1 -0
- package/dist/components/form/FormControl.cjs +2 -0
- package/dist/components/form/FormControl.cjs.map +1 -0
- package/dist/components/form/FormControl.js +19 -0
- package/dist/components/form/FormControl.js.map +1 -0
- package/dist/components/form/FormHelperText.cjs +2 -0
- package/dist/components/form/FormHelperText.cjs.map +1 -0
- package/dist/components/form/FormHelperText.js +10 -0
- package/dist/components/form/FormHelperText.js.map +1 -0
- package/dist/components/form/FormLabel.cjs +2 -0
- package/dist/components/form/FormLabel.cjs.map +1 -0
- package/dist/components/form/FormLabel.js +35 -0
- package/dist/components/form/FormLabel.js.map +1 -0
- package/dist/components/heading/Heading.cjs +2 -0
- package/dist/components/heading/Heading.cjs.map +1 -0
- package/dist/components/heading/Heading.js +13 -0
- package/dist/components/heading/Heading.js.map +1 -0
- package/dist/components/icon/Icon.cjs +2 -0
- package/dist/components/icon/Icon.cjs.map +1 -0
- package/dist/components/icon/Icon.js +12 -0
- package/dist/components/icon/Icon.js.map +1 -0
- package/dist/components/icon-button/IconButton.cjs +2 -0
- package/dist/components/icon-button/IconButton.cjs.map +1 -0
- package/dist/components/icon-button/IconButton.js +8 -0
- package/dist/components/icon-button/IconButton.js.map +1 -0
- package/dist/components/illustration/Illustration.cjs +2 -0
- package/dist/components/illustration/Illustration.cjs.map +1 -0
- package/dist/components/illustration/Illustration.js +41 -0
- package/dist/components/illustration/Illustration.js.map +1 -0
- package/dist/components/illustration/patterns.cjs +2 -0
- package/dist/components/illustration/patterns.cjs.map +1 -0
- package/dist/{ui.js → components/illustration/patterns.js} +38 -15804
- package/dist/components/illustration/patterns.js.map +1 -0
- package/dist/components/input/HighlightedInput.cjs +2 -0
- package/dist/components/input/HighlightedInput.cjs.map +1 -0
- package/dist/components/input/HighlightedInput.js +60 -0
- package/dist/components/input/HighlightedInput.js.map +1 -0
- package/dist/components/input/Input.cjs +2 -0
- package/dist/components/input/Input.cjs.map +1 -0
- package/dist/components/input/Input.js +15 -0
- package/dist/components/input/Input.js.map +1 -0
- package/dist/components/input/InputAddon.cjs +2 -0
- package/dist/components/input/InputAddon.cjs.map +1 -0
- package/dist/components/input/InputAddon.js +11 -0
- package/dist/components/input/InputAddon.js.map +1 -0
- package/dist/components/input/InputGroup.cjs +2 -0
- package/dist/components/input/InputGroup.cjs.map +1 -0
- package/dist/components/input/InputGroup.js +10 -0
- package/dist/components/input/InputGroup.js.map +1 -0
- package/dist/components/input/PhoneNumberInput.cjs +2 -0
- package/dist/components/input/PhoneNumberInput.cjs.map +1 -0
- package/dist/components/input/PhoneNumberInput.js +26 -0
- package/dist/components/input/PhoneNumberInput.js.map +1 -0
- package/dist/components/menu/Menu.cjs +2 -0
- package/dist/components/menu/Menu.cjs.map +1 -0
- package/dist/components/menu/Menu.js +29 -0
- package/dist/components/menu/Menu.js.map +1 -0
- package/dist/components/pagination/Pagination.cjs +2 -0
- package/dist/components/pagination/Pagination.cjs.map +1 -0
- package/dist/components/pagination/Pagination.js +86 -0
- package/dist/components/pagination/Pagination.js.map +1 -0
- package/dist/components/pagination/use-pagination.cjs +2 -0
- package/dist/components/pagination/use-pagination.cjs.map +1 -0
- package/dist/components/pagination/use-pagination.js +57 -0
- package/dist/components/pagination/use-pagination.js.map +1 -0
- package/dist/components/popover/Popover.cjs +2 -0
- package/dist/components/popover/Popover.cjs.map +1 -0
- package/dist/components/popover/Popover.js +27 -0
- package/dist/components/popover/Popover.js.map +1 -0
- package/dist/components/radio-button-group/RadioButtonGroup.cjs +2 -0
- package/dist/components/radio-button-group/RadioButtonGroup.cjs.map +1 -0
- package/dist/components/radio-button-group/RadioButtonGroup.js +22 -0
- package/dist/components/radio-button-group/RadioButtonGroup.js.map +1 -0
- package/dist/components/radio-card-group/RadioCardGroup.cjs +2 -0
- package/dist/components/radio-card-group/RadioCardGroup.cjs.map +1 -0
- package/dist/components/radio-card-group/RadioCardGroup.js +23 -0
- package/dist/components/radio-card-group/RadioCardGroup.js.map +1 -0
- package/dist/components/radio-card-group/namespace.cjs +2 -0
- package/dist/components/radio-card-group/namespace.cjs.map +1 -0
- package/dist/components/radio-card-group/namespace.js +11 -0
- package/dist/components/radio-card-group/namespace.js.map +1 -0
- package/dist/components/radio-group/RadioGroup.cjs +2 -0
- package/dist/components/radio-group/RadioGroup.cjs.map +1 -0
- package/dist/components/radio-group/RadioGroup.js +22 -0
- package/dist/components/radio-group/RadioGroup.js.map +1 -0
- package/dist/components/select/Select.cjs +2 -0
- package/dist/components/select/Select.cjs.map +1 -0
- package/dist/components/select/Select.js +146 -0
- package/dist/components/select/Select.js.map +1 -0
- package/dist/components/select-language/SelectLanguage.cjs +2 -0
- package/dist/components/select-language/SelectLanguage.cjs.map +1 -0
- package/dist/components/select-language/SelectLanguage.js +89 -0
- package/dist/components/select-language/SelectLanguage.js.map +1 -0
- package/dist/components/status-tag-select/StatusTagSelect.cjs +2 -0
- package/dist/components/status-tag-select/StatusTagSelect.cjs.map +1 -0
- package/dist/components/status-tag-select/StatusTagSelect.js +117 -0
- package/dist/components/status-tag-select/StatusTagSelect.js.map +1 -0
- package/dist/components/switch/Switch.cjs +2 -0
- package/dist/components/switch/Switch.cjs.map +1 -0
- package/dist/components/switch/Switch.js +20 -0
- package/dist/components/switch/Switch.js.map +1 -0
- package/dist/components/switch-card/SwitchCard.cjs +2 -0
- package/dist/components/switch-card/SwitchCard.cjs.map +1 -0
- package/dist/components/switch-card/SwitchCard.js +27 -0
- package/dist/components/switch-card/SwitchCard.js.map +1 -0
- package/dist/components/switch-card/namespace.cjs +2 -0
- package/dist/components/switch-card/namespace.cjs.map +1 -0
- package/dist/components/switch-card/namespace.js +10 -0
- package/dist/components/switch-card/namespace.js.map +1 -0
- package/dist/components/table/Table.cjs +2 -0
- package/dist/components/table/Table.cjs.map +1 -0
- package/dist/components/table/Table.js +113 -0
- package/dist/components/table/Table.js.map +1 -0
- package/dist/components/table/TableProvider.cjs +2 -0
- package/dist/components/table/TableProvider.cjs.map +1 -0
- package/dist/components/table/TableProvider.js +41 -0
- package/dist/components/table/TableProvider.js.map +1 -0
- package/dist/components/tabs/Tabs.cjs +2 -0
- package/dist/components/tabs/Tabs.cjs.map +1 -0
- package/dist/components/tabs/Tabs.js +27 -0
- package/dist/components/tabs/Tabs.js.map +1 -0
- package/dist/components/tag/Tag.cjs +2 -0
- package/dist/components/tag/Tag.cjs.map +1 -0
- package/dist/components/tag/Tag.js +18 -0
- package/dist/components/tag/Tag.js.map +1 -0
- package/dist/components/text/Text.cjs +2 -0
- package/dist/components/text/Text.cjs.map +1 -0
- package/dist/components/text/Text.js +13 -0
- package/dist/components/text/Text.js.map +1 -0
- package/dist/components/textarea/Textarea.cjs +2 -0
- package/dist/components/textarea/Textarea.cjs.map +1 -0
- package/dist/components/textarea/Textarea.js +9 -0
- package/dist/components/textarea/Textarea.js.map +1 -0
- package/dist/components/tooltip/Tooltip.cjs +2 -0
- package/dist/components/tooltip/Tooltip.cjs.map +1 -0
- package/dist/components/tooltip/Tooltip.js +44 -0
- package/dist/components/tooltip/Tooltip.js.map +1 -0
- package/dist/{icons.cjs → icons/index.cjs} +1 -1
- package/dist/icons/index.cjs.map +1 -0
- package/dist/{icons.js → icons/index.js} +1 -1
- package/dist/icons/index.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +178 -0
- package/dist/index.js.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +2 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js +30 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +2 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js +30 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +2 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +1 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js +30 -0
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +1 -0
- package/dist/node_modules/@pandacss/shared/dist/index.cjs +2 -0
- package/dist/node_modules/@pandacss/shared/dist/index.cjs.map +1 -0
- package/dist/node_modules/@pandacss/shared/dist/index.js +469 -0
- package/dist/node_modules/@pandacss/shared/dist/index.js.map +1 -0
- package/dist/node_modules/@zag-js/utils/dist/index.cjs +2 -0
- package/dist/node_modules/@zag-js/utils/dist/index.cjs.map +1 -0
- package/dist/node_modules/@zag-js/utils/dist/index.js +8 -0
- package/dist/node_modules/@zag-js/utils/dist/index.js.map +1 -0
- package/dist/node_modules/deepmerge/dist/cjs.cjs +2 -0
- package/dist/node_modules/deepmerge/dist/cjs.cjs.map +1 -0
- package/dist/node_modules/deepmerge/dist/cjs.js +81 -0
- package/dist/node_modules/deepmerge/dist/cjs.js.map +1 -0
- package/dist/node_modules/lodash/lodash.cjs +28 -0
- package/dist/node_modules/lodash/lodash.cjs.map +1 -0
- package/dist/node_modules/lodash/lodash.js +3679 -0
- package/dist/node_modules/lodash/lodash.js.map +1 -0
- package/dist/preset.cjs +2 -0
- package/dist/preset.cjs.map +1 -0
- package/dist/preset.js +35 -0
- package/dist/preset.js.map +1 -0
- package/dist/shared/ConditionalWrapper.cjs +2 -0
- package/dist/shared/ConditionalWrapper.cjs.map +1 -0
- package/dist/shared/ConditionalWrapper.js +6 -0
- package/dist/shared/ConditionalWrapper.js.map +1 -0
- package/dist/shared/assets/icons.cjs +2 -0
- package/dist/shared/assets/icons.cjs.map +1 -0
- package/dist/shared/assets/icons.js +24 -0
- package/dist/shared/assets/icons.js.map +1 -0
- package/dist/shared/hooks/useUncontrolled.cjs +2 -0
- package/dist/shared/hooks/useUncontrolled.cjs.map +1 -0
- package/dist/shared/hooks/useUncontrolled.js +18 -0
- package/dist/shared/hooks/useUncontrolled.js.map +1 -0
- package/dist/shared/utils/events.cjs +2 -0
- package/dist/shared/utils/events.cjs.map +1 -0
- package/dist/shared/utils/events.js +8 -0
- package/dist/shared/utils/events.js.map +1 -0
- package/dist/theme/breakpoints.cjs +2 -0
- package/dist/theme/breakpoints.cjs.map +1 -0
- package/dist/theme/breakpoints.js +11 -0
- package/dist/theme/breakpoints.js.map +1 -0
- package/dist/theme/conditions.cjs +2 -0
- package/dist/theme/conditions.cjs.map +1 -0
- package/dist/theme/conditions.js +25 -0
- package/dist/theme/conditions.js.map +1 -0
- package/dist/theme/containers.cjs +2 -0
- package/dist/theme/containers.cjs.map +1 -0
- package/dist/theme/containers.js +19 -0
- package/dist/theme/containers.js.map +1 -0
- package/dist/theme/globalCss.cjs +4 -0
- package/dist/theme/globalCss.cjs.map +1 -0
- package/dist/theme/globalCss.js +101 -0
- package/dist/theme/globalCss.js.map +1 -0
- package/dist/theme/keyframes.cjs +2 -0
- package/dist/theme/keyframes.cjs.map +1 -0
- package/dist/theme/keyframes.js +173 -0
- package/dist/theme/keyframes.js.map +1 -0
- package/dist/theme/recipes/accordion.cjs +2 -0
- package/dist/theme/recipes/accordion.cjs.map +1 -0
- package/dist/theme/recipes/accordion.js +112 -0
- package/dist/theme/recipes/accordion.js.map +1 -0
- package/dist/theme/recipes/action-card.cjs +2 -0
- package/dist/theme/recipes/action-card.cjs.map +1 -0
- package/dist/theme/recipes/action-card.js +87 -0
- package/dist/theme/recipes/action-card.js.map +1 -0
- package/dist/theme/recipes/alert.cjs +2 -0
- package/dist/theme/recipes/alert.cjs.map +1 -0
- package/dist/theme/recipes/alert.js +68 -0
- package/dist/theme/recipes/alert.js.map +1 -0
- package/dist/theme/recipes/app/navigation-language-select.cjs +2 -0
- package/dist/theme/recipes/app/navigation-language-select.cjs.map +1 -0
- package/dist/theme/recipes/app/navigation-language-select.js +151 -0
- package/dist/theme/recipes/app/navigation-language-select.js.map +1 -0
- package/dist/theme/recipes/app/navigation.cjs +2 -0
- package/dist/theme/recipes/app/navigation.cjs.map +1 -0
- package/dist/theme/recipes/app/navigation.js +271 -0
- package/dist/theme/recipes/app/navigation.js.map +1 -0
- package/dist/theme/recipes/app/price-tag.cjs +2 -0
- package/dist/theme/recipes/app/price-tag.cjs.map +1 -0
- package/dist/theme/recipes/app/price-tag.js +73 -0
- package/dist/theme/recipes/app/price-tag.js.map +1 -0
- package/dist/theme/recipes/app/product-card-catalog.cjs +2 -0
- package/dist/theme/recipes/app/product-card-catalog.cjs.map +1 -0
- package/dist/theme/recipes/app/product-card-catalog.js +196 -0
- package/dist/theme/recipes/app/product-card-catalog.js.map +1 -0
- package/dist/theme/recipes/avatar-group.cjs +2 -0
- package/dist/theme/recipes/avatar-group.cjs.map +1 -0
- package/dist/theme/recipes/avatar-group.js +40 -0
- package/dist/theme/recipes/avatar-group.js.map +1 -0
- package/dist/theme/recipes/avatar.cjs +2 -0
- package/dist/theme/recipes/avatar.cjs.map +1 -0
- package/dist/theme/recipes/avatar.js +99 -0
- package/dist/theme/recipes/avatar.js.map +1 -0
- package/dist/theme/recipes/breadcrumb.cjs +2 -0
- package/dist/theme/recipes/breadcrumb.cjs.map +1 -0
- package/dist/theme/recipes/breadcrumb.js +34 -0
- package/dist/theme/recipes/breadcrumb.js.map +1 -0
- package/dist/theme/recipes/button-filter.cjs +2 -0
- package/dist/theme/recipes/button-filter.cjs.map +1 -0
- package/dist/theme/recipes/button-filter.js +63 -0
- package/dist/theme/recipes/button-filter.js.map +1 -0
- package/dist/theme/recipes/button.cjs +2 -0
- package/dist/theme/recipes/button.cjs.map +1 -0
- package/dist/theme/recipes/button.js +298 -0
- package/dist/theme/recipes/button.js.map +1 -0
- package/dist/theme/recipes/chat/chat-document-message.cjs +2 -0
- package/dist/theme/recipes/chat/chat-document-message.cjs.map +1 -0
- package/dist/theme/recipes/chat/chat-document-message.js +46 -0
- package/dist/theme/recipes/chat/chat-document-message.js.map +1 -0
- package/dist/theme/recipes/chat/chat-input-text.cjs +2 -0
- package/dist/theme/recipes/chat/chat-input-text.cjs.map +1 -0
- package/dist/theme/recipes/chat/chat-input-text.js +30 -0
- package/dist/theme/recipes/chat/chat-input-text.js.map +1 -0
- package/dist/theme/recipes/chat/chat-message.cjs +2 -0
- package/dist/theme/recipes/chat/chat-message.cjs.map +1 -0
- package/dist/theme/recipes/chat/chat-message.js +48 -0
- package/dist/theme/recipes/chat/chat-message.js.map +1 -0
- package/dist/theme/recipes/chat/chat-profile-avatar.cjs +2 -0
- package/dist/theme/recipes/chat/chat-profile-avatar.cjs.map +1 -0
- package/dist/theme/recipes/chat/chat-profile-avatar.js +28 -0
- package/dist/theme/recipes/chat/chat-profile-avatar.js.map +1 -0
- package/dist/theme/recipes/chat/chat.cjs +2 -0
- package/dist/theme/recipes/chat/chat.cjs.map +1 -0
- package/dist/theme/recipes/chat/chat.js +59 -0
- package/dist/theme/recipes/chat/chat.js.map +1 -0
- package/dist/theme/recipes/checkbox-card.cjs +2 -0
- package/dist/theme/recipes/checkbox-card.cjs.map +1 -0
- package/dist/theme/recipes/checkbox-card.js +42 -0
- package/dist/theme/recipes/checkbox-card.js.map +1 -0
- package/dist/theme/recipes/checkbox-group.cjs +2 -0
- package/dist/theme/recipes/checkbox-group.cjs.map +1 -0
- package/dist/theme/recipes/checkbox-group.js +15 -0
- package/dist/theme/recipes/checkbox-group.js.map +1 -0
- package/dist/theme/recipes/checkbox.cjs +2 -0
- package/dist/theme/recipes/checkbox.cjs.map +1 -0
- package/dist/theme/recipes/checkbox.js +131 -0
- package/dist/theme/recipes/checkbox.js.map +1 -0
- package/dist/theme/recipes/chip.cjs +2 -0
- package/dist/theme/recipes/chip.cjs.map +1 -0
- package/dist/theme/recipes/chip.js +184 -0
- package/dist/theme/recipes/chip.js.map +1 -0
- package/dist/theme/recipes/collapsible.cjs +2 -0
- package/dist/theme/recipes/collapsible.cjs.map +1 -0
- package/dist/theme/recipes/collapsible.js +30 -0
- package/dist/theme/recipes/collapsible.js.map +1 -0
- package/dist/theme/recipes/combobox.cjs +2 -0
- package/dist/theme/recipes/combobox.cjs.map +1 -0
- package/dist/theme/recipes/combobox.js +179 -0
- package/dist/theme/recipes/combobox.js.map +1 -0
- package/dist/theme/recipes/common/group-card.cjs +2 -0
- package/dist/theme/recipes/common/group-card.cjs.map +1 -0
- package/dist/theme/recipes/common/group-card.js +81 -0
- package/dist/theme/recipes/common/group-card.js.map +1 -0
- package/dist/theme/recipes/datepicker.cjs +2 -0
- package/dist/theme/recipes/datepicker.cjs.map +1 -0
- package/dist/theme/recipes/datepicker.js +178 -0
- package/dist/theme/recipes/datepicker.js.map +1 -0
- package/dist/theme/recipes/dialog.cjs +2 -0
- package/dist/theme/recipes/dialog.cjs.map +1 -0
- package/dist/theme/recipes/dialog.js +154 -0
- package/dist/theme/recipes/dialog.js.map +1 -0
- package/dist/theme/recipes/drawer.cjs +2 -0
- package/dist/theme/recipes/drawer.cjs.map +1 -0
- package/dist/theme/recipes/drawer.js +129 -0
- package/dist/theme/recipes/drawer.js.map +1 -0
- package/dist/theme/recipes/flag.cjs +2 -0
- package/dist/theme/recipes/flag.cjs.map +1 -0
- package/dist/theme/recipes/flag.js +33 -0
- package/dist/theme/recipes/flag.js.map +1 -0
- package/dist/theme/recipes/form/control.cjs +2 -0
- package/dist/theme/recipes/form/control.cjs.map +1 -0
- package/dist/theme/recipes/form/control.js +37 -0
- package/dist/theme/recipes/form/control.js.map +1 -0
- package/dist/theme/recipes/form/helper-text.cjs +2 -0
- package/dist/theme/recipes/form/helper-text.cjs.map +1 -0
- package/dist/theme/recipes/form/helper-text.js +16 -0
- package/dist/theme/recipes/form/helper-text.js.map +1 -0
- package/dist/theme/recipes/form/label.cjs +2 -0
- package/dist/theme/recipes/form/label.cjs.map +1 -0
- package/dist/theme/recipes/form/label.js +50 -0
- package/dist/theme/recipes/form/label.js.map +1 -0
- package/dist/theme/recipes/heading.cjs +2 -0
- package/dist/theme/recipes/heading.cjs.map +1 -0
- package/dist/theme/recipes/heading.js +37 -0
- package/dist/theme/recipes/heading.js.map +1 -0
- package/dist/theme/recipes/highlightedInput.cjs +2 -0
- package/dist/theme/recipes/highlightedInput.cjs.map +1 -0
- package/dist/theme/recipes/highlightedInput.js +48 -0
- package/dist/theme/recipes/highlightedInput.js.map +1 -0
- package/dist/theme/recipes/icon-button.cjs +2 -0
- package/dist/theme/recipes/icon-button.cjs.map +1 -0
- package/dist/theme/recipes/icon-button.js +91 -0
- package/dist/theme/recipes/icon-button.js.map +1 -0
- package/dist/theme/recipes/icon.cjs +2 -0
- package/dist/theme/recipes/icon.cjs.map +1 -0
- package/dist/theme/recipes/icon.js +44 -0
- package/dist/theme/recipes/icon.js.map +1 -0
- package/dist/theme/recipes/illustration.cjs +2 -0
- package/dist/theme/recipes/illustration.cjs.map +1 -0
- package/dist/theme/recipes/illustration.js +50 -0
- package/dist/theme/recipes/illustration.js.map +1 -0
- package/dist/theme/recipes/index.cjs +2 -0
- package/dist/theme/recipes/index.cjs.map +1 -0
- package/dist/theme/recipes/index.js +129 -0
- package/dist/theme/recipes/index.js.map +1 -0
- package/dist/theme/recipes/input-addon.cjs +2 -0
- package/dist/theme/recipes/input-addon.cjs.map +1 -0
- package/dist/theme/recipes/input-addon.js +27 -0
- package/dist/theme/recipes/input-addon.js.map +1 -0
- package/dist/theme/recipes/input-group.cjs +2 -0
- package/dist/theme/recipes/input-group.cjs.map +1 -0
- package/dist/theme/recipes/input-group.js +52 -0
- package/dist/theme/recipes/input-group.js.map +1 -0
- package/dist/theme/recipes/input.cjs +2 -0
- package/dist/theme/recipes/input.cjs.map +1 -0
- package/dist/theme/recipes/input.js +64 -0
- package/dist/theme/recipes/input.js.map +1 -0
- package/dist/theme/recipes/menu.cjs +2 -0
- package/dist/theme/recipes/menu.cjs.map +1 -0
- package/dist/theme/recipes/menu.js +102 -0
- package/dist/theme/recipes/menu.js.map +1 -0
- package/dist/theme/recipes/pagination.cjs +2 -0
- package/dist/theme/recipes/pagination.cjs.map +1 -0
- package/dist/theme/recipes/pagination.js +73 -0
- package/dist/theme/recipes/pagination.js.map +1 -0
- package/dist/theme/recipes/phone-number-input.cjs +2 -0
- package/dist/theme/recipes/phone-number-input.cjs.map +1 -0
- package/dist/theme/recipes/phone-number-input.js +68 -0
- package/dist/theme/recipes/phone-number-input.js.map +1 -0
- package/dist/theme/recipes/popover.cjs +2 -0
- package/dist/theme/recipes/popover.cjs.map +1 -0
- package/dist/theme/recipes/popover.js +30 -0
- package/dist/theme/recipes/popover.js.map +1 -0
- package/dist/theme/recipes/radio-button-group.cjs +2 -0
- package/dist/theme/recipes/radio-button-group.cjs.map +1 -0
- package/dist/theme/recipes/radio-button-group.js +97 -0
- package/dist/theme/recipes/radio-button-group.js.map +1 -0
- package/dist/theme/recipes/radio-card-group.cjs +2 -0
- package/dist/theme/recipes/radio-card-group.cjs.map +1 -0
- package/dist/theme/recipes/radio-card-group.js +70 -0
- package/dist/theme/recipes/radio-card-group.js.map +1 -0
- package/dist/theme/recipes/radio-group.cjs +2 -0
- package/dist/theme/recipes/radio-group.cjs.map +1 -0
- package/dist/theme/recipes/radio-group.js +121 -0
- package/dist/theme/recipes/radio-group.js.map +1 -0
- package/dist/theme/recipes/select-language.cjs +2 -0
- package/dist/theme/recipes/select-language.cjs.map +1 -0
- package/dist/theme/recipes/select-language.js +115 -0
- package/dist/theme/recipes/select-language.js.map +1 -0
- package/dist/theme/recipes/select.cjs +2 -0
- package/dist/theme/recipes/select.cjs.map +1 -0
- package/dist/theme/recipes/select.js +209 -0
- package/dist/theme/recipes/select.js.map +1 -0
- package/dist/theme/recipes/status-tag-select.cjs +2 -0
- package/dist/theme/recipes/status-tag-select.cjs.map +1 -0
- package/dist/theme/recipes/status-tag-select.js +177 -0
- package/dist/theme/recipes/status-tag-select.js.map +1 -0
- package/dist/theme/recipes/switch-card.cjs +2 -0
- package/dist/theme/recipes/switch-card.cjs.map +1 -0
- package/dist/theme/recipes/switch-card.js +44 -0
- package/dist/theme/recipes/switch-card.js.map +1 -0
- package/dist/theme/recipes/switch.cjs +2 -0
- package/dist/theme/recipes/switch.cjs.map +1 -0
- package/dist/theme/recipes/switch.js +90 -0
- package/dist/theme/recipes/switch.js.map +1 -0
- package/dist/theme/recipes/table-container.cjs +2 -0
- package/dist/theme/recipes/table-container.cjs.map +1 -0
- package/dist/theme/recipes/table-container.js +21 -0
- package/dist/theme/recipes/table-container.js.map +1 -0
- package/dist/theme/recipes/table-empty-row.cjs +2 -0
- package/dist/theme/recipes/table-empty-row.cjs.map +1 -0
- package/dist/theme/recipes/table-empty-row.js +19 -0
- package/dist/theme/recipes/table-empty-row.js.map +1 -0
- package/dist/theme/recipes/table-group-title.cjs +2 -0
- package/dist/theme/recipes/table-group-title.cjs.map +1 -0
- package/dist/theme/recipes/table-group-title.js +36 -0
- package/dist/theme/recipes/table-group-title.js.map +1 -0
- package/dist/theme/recipes/table.cjs +2 -0
- package/dist/theme/recipes/table.cjs.map +1 -0
- package/dist/theme/recipes/table.js +111 -0
- package/dist/theme/recipes/table.js.map +1 -0
- package/dist/theme/recipes/tabs-chip.cjs +2 -0
- package/dist/theme/recipes/tabs-chip.cjs.map +1 -0
- package/dist/theme/recipes/tabs-chip.js +49 -0
- package/dist/theme/recipes/tabs-chip.js.map +1 -0
- package/dist/theme/recipes/tabs.cjs +2 -0
- package/dist/theme/recipes/tabs.cjs.map +1 -0
- package/dist/theme/recipes/tabs.js +128 -0
- package/dist/theme/recipes/tabs.js.map +1 -0
- package/dist/theme/recipes/tag.cjs +2 -0
- package/dist/theme/recipes/tag.cjs.map +1 -0
- package/dist/theme/recipes/tag.js +124 -0
- package/dist/theme/recipes/tag.js.map +1 -0
- package/dist/theme/recipes/text.cjs +2 -0
- package/dist/theme/recipes/text.cjs.map +1 -0
- package/dist/theme/recipes/text.js +40 -0
- package/dist/theme/recipes/text.js.map +1 -0
- package/dist/theme/recipes/textarea.cjs +2 -0
- package/dist/theme/recipes/textarea.cjs.map +1 -0
- package/dist/theme/recipes/textarea.js +16 -0
- package/dist/theme/recipes/textarea.js.map +1 -0
- package/dist/theme/recipes/tooltip.cjs +2 -0
- package/dist/theme/recipes/tooltip.cjs.map +1 -0
- package/dist/theme/recipes/tooltip.js +64 -0
- package/dist/theme/recipes/tooltip.js.map +1 -0
- package/dist/theme/semantic-tokens/colors.cjs +2 -0
- package/dist/theme/semantic-tokens/colors.cjs.map +1 -0
- package/dist/theme/semantic-tokens/colors.js +143 -0
- package/dist/theme/semantic-tokens/colors.js.map +1 -0
- package/dist/theme/semantic-tokens/index.cjs +2 -0
- package/dist/theme/semantic-tokens/index.cjs.map +1 -0
- package/dist/theme/semantic-tokens/index.js +9 -0
- package/dist/theme/semantic-tokens/index.js.map +1 -0
- package/dist/theme/text-styles.cjs +2 -0
- package/dist/theme/text-styles.cjs.map +1 -0
- package/dist/theme/text-styles.js +90 -0
- package/dist/theme/text-styles.js.map +1 -0
- package/dist/theme/tokens/animations.cjs +2 -0
- package/dist/theme/tokens/animations.cjs.map +1 -0
- package/dist/theme/tokens/animations.js +48 -0
- package/dist/theme/tokens/animations.js.map +1 -0
- package/dist/theme/tokens/aspect-ratios.cjs +2 -0
- package/dist/theme/tokens/aspect-ratios.cjs.map +1 -0
- package/dist/theme/tokens/aspect-ratios.js +14 -0
- package/dist/theme/tokens/aspect-ratios.js.map +1 -0
- package/dist/theme/tokens/blurs.cjs +2 -0
- package/dist/theme/tokens/blurs.cjs.map +1 -0
- package/dist/theme/tokens/blurs.js +15 -0
- package/dist/theme/tokens/blurs.js.map +1 -0
- package/dist/theme/tokens/borders.cjs +2 -0
- package/dist/theme/tokens/borders.cjs.map +1 -0
- package/dist/theme/tokens/borders.js +11 -0
- package/dist/theme/tokens/borders.js.map +1 -0
- package/dist/theme/tokens/colors.cjs +2 -0
- package/dist/theme/tokens/colors.cjs.map +1 -0
- package/dist/theme/tokens/colors.js +80 -0
- package/dist/theme/tokens/colors.js.map +1 -0
- package/dist/theme/tokens/durations.cjs +2 -0
- package/dist/theme/tokens/durations.cjs.map +1 -0
- package/dist/theme/tokens/durations.js +15 -0
- package/dist/theme/tokens/durations.js.map +1 -0
- package/dist/theme/tokens/easings.cjs +51 -0
- package/dist/theme/tokens/easings.cjs.map +1 -0
- package/dist/theme/tokens/easings.js +95 -0
- package/dist/theme/tokens/easings.js.map +1 -0
- package/dist/theme/tokens/index.cjs +2 -0
- package/dist/theme/tokens/index.cjs.map +1 -0
- package/dist/theme/tokens/index.js +37 -0
- package/dist/theme/tokens/index.js.map +1 -0
- package/dist/theme/tokens/radii.cjs +2 -0
- package/dist/theme/tokens/radii.cjs.map +1 -0
- package/dist/theme/tokens/radii.js +29 -0
- package/dist/theme/tokens/radii.js.map +1 -0
- package/dist/theme/tokens/shadows.cjs +2 -0
- package/dist/theme/tokens/shadows.cjs.map +1 -0
- package/dist/theme/tokens/shadows.js +15 -0
- package/dist/theme/tokens/shadows.js.map +1 -0
- package/dist/theme/tokens/sizes.cjs +2 -0
- package/dist/theme/tokens/sizes.cjs.map +1 -0
- package/dist/theme/tokens/sizes.js +87 -0
- package/dist/theme/tokens/sizes.js.map +1 -0
- package/dist/theme/tokens/spacing.cjs +2 -0
- package/dist/theme/tokens/spacing.cjs.map +1 -0
- package/dist/theme/tokens/spacing.js +86 -0
- package/dist/theme/tokens/spacing.js.map +1 -0
- package/dist/theme/tokens/typography.cjs +2 -0
- package/dist/theme/tokens/typography.cjs.map +1 -0
- package/dist/theme/tokens/typography.js +87 -0
- package/dist/theme/tokens/typography.js.map +1 -0
- package/dist/theme/tokens/z-index.cjs +2 -0
- package/dist/theme/tokens/z-index.cjs.map +1 -0
- package/dist/theme/tokens/z-index.js +44 -0
- package/dist/theme/tokens/z-index.js.map +1 -0
- package/dist/theme/utilities.cjs +2 -0
- package/dist/theme/utilities.cjs.map +1 -0
- package/dist/theme/utilities.js +17 -0
- package/dist/theme/utilities.js.map +1 -0
- package/dist/utils/slots.cjs +2 -0
- package/dist/utils/slots.cjs.map +1 -0
- package/dist/utils/slots.js +42 -0
- package/dist/utils/slots.js.map +1 -0
- package/package.json +18 -7
- package/dist/icons.cjs.map +0 -1
- package/dist/icons.js.map +0 -1
- package/dist/ui.cjs +0 -79
- package/dist/ui.cjs.map +0 -1
- package/dist/ui.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),h=require("@stokelp/styled-system/jsx"),E=require("@stokelp/styled-system/recipes"),P=require("../../utils/slots.cjs"),l=require("react"),T=require("./Input.cjs"),{withProvider:A,withContext:d}=P.createStyleContext(E.highlightedInput,{dataAttr:!0}),f=A(h.styled("div"),"root"),S=d(T.Input,"input"),j=d(h.styled("p"),"renderer"),R=d(h.styled("span"),"highlight"),L=({patterns:c,value:a,defaultValue:I,onChange:v,onScroll:y,...m})=>{const g=a!==void 0,[q,H]=l.useState(I?.toString()??""),r=g?String(a):q,i=l.useRef(null),[x,C]=l.useState(0),V=e=>{C(e.currentTarget.scrollLeft),y?.(e)};l.useEffect(()=>{i.current&&(i.current.scrollLeft=x)},[x]);const $=new RegExp(c.map(e=>e.regex.source).join("|"),"gi"),b=()=>{const e=[];let t=0;for(const o of r.matchAll($)){const s=o.index??0,w=s+o[0].length;s>t&&e.push(n.jsx("span",{children:r.slice(t,s)},`text-${t}`));const p=c.find(u=>u.regex.test(o[0]));c.forEach(u=>u.regex.lastIndex=0),e.push(p?n.jsx(R,{style:{color:p.color??"secondary.500"},children:o[0]},`highlight-${s}`):n.jsx("span",{children:o[0]},`text-${s}`)),t=w}return t<r.length&&e.push(n.jsx("span",{children:r.slice(t)},`text-${t}`)),e};return n.jsxs(f,{children:[n.jsx(S,{...m,value:r,defaultValue:void 0,onScroll:V,onChange:e=>{g||H(e.target.value),v?.(e)}}),n.jsx(j,{ref:i,children:b()})]})};exports.Highlight=R;exports.HighlightedInput=L;exports.InputSlot=S;exports.Renderer=j;exports.Root=f;
|
|
2
|
+
//# sourceMappingURL=HighlightedInput.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HighlightedInput.cjs","sources":["../../../src/components/input/HighlightedInput.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { highlightedInput } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input } from '~/components'\nimport { ComponentProps, type ElementRef, FC, ReactNode, useEffect, useRef, useState } from 'react'\n\nconst { withProvider, withContext } = createStyleContext(highlightedInput, {\n dataAttr: true,\n})\n\nexport const Root = withProvider(styled('div'), 'root')\nexport const InputSlot = withContext(Input, 'input')\nexport const Renderer = withContext(styled('p'), 'renderer')\nexport const Highlight = withContext(styled('span'), 'highlight')\n\nexport interface HighlightedInputRootProps extends ComponentProps<typeof Root> {}\nexport interface HighlightedInputInputProps extends ComponentProps<typeof InputSlot> {}\nexport interface HighlightedInputRendererProps extends ComponentProps<typeof Renderer> {}\nexport interface HighlightedInputHighlightProps extends ComponentProps<typeof Highlight> {}\n\ntype HighlightedInputProps = {\n patterns: { regex: RegExp; color: string }[]\n placeholder?: string\n} & HighlightedInputInputProps\n\nexport const HighlightedInput: FC<HighlightedInputProps> = ({\n patterns,\n value: controlledValue,\n defaultValue,\n onChange,\n onScroll,\n ...inputProps\n}) => {\n const isControlled = controlledValue !== undefined\n\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue?.toString() ?? '')\n\n const value = isControlled ? String(controlledValue) : uncontrolledValue\n\n const textBlockRef = useRef<ElementRef<typeof Renderer>>(null)\n const [scrollValue, setScrollValue] = useState(0)\n\n const handleScroll = (e: { currentTarget: { scrollLeft: number } }) => {\n setScrollValue(e.currentTarget.scrollLeft)\n onScroll?.(e as React.UIEvent<HTMLInputElement>)\n }\n\n useEffect(() => {\n if (textBlockRef.current) {\n textBlockRef.current.scrollLeft = scrollValue\n }\n }, [scrollValue])\n\n const combinedRegex = new RegExp(patterns.map(p => p.regex.source).join('|'), 'gi')\n\n const renderHighlightedText = () => {\n const nodes: ReactNode[] = []\n let lastIndex = 0\n\n for (const match of value.matchAll(combinedRegex)) {\n const start = match.index ?? 0\n const end = start + match[0].length\n\n if (start > lastIndex) {\n nodes.push(<span key={`text-${lastIndex}`}>{value.slice(lastIndex, start)}</span>)\n }\n\n const matchedPattern = patterns.find(p => p.regex.test(match[0]))\n patterns.forEach(p => (p.regex.lastIndex = 0))\n\n nodes.push(\n matchedPattern ? (\n <Highlight key={`highlight-${start}`} style={{ color: matchedPattern.color ?? 'secondary.500' }}>\n {match[0]}\n </Highlight>\n ) : (\n <span key={`text-${start}`}>{match[0]}</span>\n ),\n )\n\n lastIndex = end\n }\n\n if (lastIndex < value.length) {\n nodes.push(<span key={`text-${lastIndex}`}>{value.slice(lastIndex)}</span>)\n }\n\n return nodes\n }\n\n return (\n <Root>\n <InputSlot\n {...inputProps}\n value={value}\n defaultValue={undefined} // prevent React warning\n onScroll={handleScroll}\n onChange={e => {\n if (!isControlled) {\n setUncontrolledValue(e.target.value)\n }\n onChange?.(e)\n }}\n />\n\n <Renderer ref={textBlockRef}>{renderHighlightedText()}</Renderer>\n </Root>\n )\n}\n"],"names":["withProvider","withContext","createStyleContext","highlightedInput","Root","styled","InputSlot","Input","Renderer","Highlight","HighlightedInput","patterns","controlledValue","defaultValue","onChange","onScroll","inputProps","isControlled","uncontrolledValue","setUncontrolledValue","useState","value","textBlockRef","useRef","scrollValue","setScrollValue","handleScroll","useEffect","combinedRegex","p","renderHighlightedText","nodes","lastIndex","match","start","end","jsx","matchedPattern"],"mappings":"qSAMM,CAAE,aAAAA,EAAc,YAAAC,GAAgBC,EAAAA,mBAAmBC,EAAAA,iBAAkB,CACzE,SAAU,EACZ,CAAC,EAEYC,EAAOJ,EAAaK,SAAO,KAAK,EAAG,MAAM,EACzCC,EAAYL,EAAYM,EAAAA,MAAO,OAAO,EACtCC,EAAWP,EAAYI,SAAO,GAAG,EAAG,UAAU,EAC9CI,EAAYR,EAAYI,SAAO,MAAM,EAAG,WAAW,EAYnDK,EAA8C,CAAC,CAC1D,SAAAC,EACA,MAAOC,EACP,aAAAC,EACA,SAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMC,EAAeL,IAAoB,OAEnC,CAACM,EAAmBC,CAAoB,EAAIC,EAAAA,SAASP,GAAc,SAAA,GAAc,EAAE,EAEnFQ,EAAQJ,EAAe,OAAOL,CAAe,EAAIM,EAEjDI,EAAeC,EAAAA,OAAoC,IAAI,EACvD,CAACC,EAAaC,CAAc,EAAIL,EAAAA,SAAS,CAAC,EAE1CM,EAAgB,GAAiD,CACrED,EAAe,EAAE,cAAc,UAAU,EACzCV,IAAW,CAAoC,CACjD,EAEAY,EAAAA,UAAU,IAAM,CACVL,EAAa,UACfA,EAAa,QAAQ,WAAaE,EAEtC,EAAG,CAACA,CAAW,CAAC,EAEhB,MAAMI,EAAgB,IAAI,OAAOjB,EAAS,IAAIkB,GAAKA,EAAE,MAAM,MAAM,EAAE,KAAK,GAAG,EAAG,IAAI,EAE5EC,EAAwB,IAAM,CAClC,MAAMC,EAAqB,CAAA,EAC3B,IAAIC,EAAY,EAEhB,UAAWC,KAASZ,EAAM,SAASO,CAAa,EAAG,CACjD,MAAMM,EAAQD,EAAM,OAAS,EACvBE,EAAMD,EAAQD,EAAM,CAAC,EAAE,OAEzBC,EAAQF,GACVD,EAAM,KAAKK,EAAAA,IAAC,OAAA,CAAgC,SAAAf,EAAM,MAAMW,EAAWE,CAAK,CAAA,EAAlD,QAAQF,CAAS,EAAmC,CAAO,EAGnF,MAAMK,EAAiB1B,EAAS,KAAKkB,GAAKA,EAAE,MAAM,KAAKI,EAAM,CAAC,CAAC,CAAC,EAChEtB,EAAS,QAAQkB,GAAMA,EAAE,MAAM,UAAY,CAAE,EAE7CE,EAAM,KACJM,EACED,EAAAA,IAAC3B,EAAA,CAAqC,MAAO,CAAE,MAAO4B,EAAe,OAAS,eAAA,EAC3E,SAAAJ,EAAM,CAAC,GADM,aAAaC,CAAK,EAElC,EAEAE,EAAAA,IAAC,OAAA,CAA4B,WAAM,CAAC,CAAA,EAAzB,QAAQF,CAAK,EAAc,CAAA,EAI1CF,EAAYG,CACd,CAEA,OAAIH,EAAYX,EAAM,QACpBU,EAAM,KAAKK,EAAAA,IAAC,OAAA,CAAgC,SAAAf,EAAM,MAAMW,CAAS,CAAA,EAA3C,QAAQA,CAAS,EAA4B,CAAO,EAGrED,CACT,EAEA,cACG3B,EAAA,CACC,SAAA,CAAAgC,EAAAA,IAAC9B,EAAA,CACE,GAAGU,EACJ,MAAAK,EACA,aAAc,OACd,SAAUK,EACV,SAAU,GAAK,CACRT,GACHE,EAAqB,EAAE,OAAO,KAAK,EAErCL,IAAW,CAAC,CACd,CAAA,CAAA,EAGFsB,EAAAA,IAAC5B,EAAA,CAAS,IAAKc,EAAe,YAAsB,CAAE,CAAA,EACxD,CAEJ"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as w, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { styled as h } from "@stokelp/styled-system/jsx";
|
|
4
|
+
import { highlightedInput as E } from "@stokelp/styled-system/recipes";
|
|
5
|
+
import { createStyleContext as H } from "../../utils/slots.js";
|
|
6
|
+
import { useState as p, useRef as A, useEffect as L } from "react";
|
|
7
|
+
import { Input as P } from "./Input.js";
|
|
8
|
+
const { withProvider: T, withContext: d } = H(E, {
|
|
9
|
+
dataAttr: !0
|
|
10
|
+
}), b = T(h("div"), "root"), k = d(P, "input"), B = d(h("p"), "renderer"), U = d(h("span"), "highlight"), K = ({
|
|
11
|
+
patterns: c,
|
|
12
|
+
value: u,
|
|
13
|
+
defaultValue: x,
|
|
14
|
+
onChange: m,
|
|
15
|
+
onScroll: S,
|
|
16
|
+
...v
|
|
17
|
+
}) => {
|
|
18
|
+
const a = u !== void 0, [I, R] = p(x?.toString() ?? ""), n = a ? String(u) : I, s = A(null), [g, y] = p(0), C = (t) => {
|
|
19
|
+
y(t.currentTarget.scrollLeft), S?.(t);
|
|
20
|
+
};
|
|
21
|
+
L(() => {
|
|
22
|
+
s.current && (s.current.scrollLeft = g);
|
|
23
|
+
}, [g]);
|
|
24
|
+
const V = new RegExp(c.map((t) => t.regex.source).join("|"), "gi"), $ = () => {
|
|
25
|
+
const t = [];
|
|
26
|
+
let e = 0;
|
|
27
|
+
for (const r of n.matchAll(V)) {
|
|
28
|
+
const l = r.index ?? 0, j = l + r[0].length;
|
|
29
|
+
l > e && t.push(/* @__PURE__ */ o("span", { children: n.slice(e, l) }, `text-${e}`));
|
|
30
|
+
const f = c.find((i) => i.regex.test(r[0]));
|
|
31
|
+
c.forEach((i) => i.regex.lastIndex = 0), t.push(
|
|
32
|
+
f ? /* @__PURE__ */ o(U, { style: { color: f.color ?? "secondary.500" }, children: r[0] }, `highlight-${l}`) : /* @__PURE__ */ o("span", { children: r[0] }, `text-${l}`)
|
|
33
|
+
), e = j;
|
|
34
|
+
}
|
|
35
|
+
return e < n.length && t.push(/* @__PURE__ */ o("span", { children: n.slice(e) }, `text-${e}`)), t;
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ w(b, { children: [
|
|
38
|
+
/* @__PURE__ */ o(
|
|
39
|
+
k,
|
|
40
|
+
{
|
|
41
|
+
...v,
|
|
42
|
+
value: n,
|
|
43
|
+
defaultValue: void 0,
|
|
44
|
+
onScroll: C,
|
|
45
|
+
onChange: (t) => {
|
|
46
|
+
a || R(t.target.value), m?.(t);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ o(B, { ref: s, children: $() })
|
|
51
|
+
] });
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
U as Highlight,
|
|
55
|
+
K as HighlightedInput,
|
|
56
|
+
k as InputSlot,
|
|
57
|
+
B as Renderer,
|
|
58
|
+
b as Root
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=HighlightedInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HighlightedInput.js","sources":["../../../src/components/input/HighlightedInput.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { highlightedInput } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input } from '~/components'\nimport { ComponentProps, type ElementRef, FC, ReactNode, useEffect, useRef, useState } from 'react'\n\nconst { withProvider, withContext } = createStyleContext(highlightedInput, {\n dataAttr: true,\n})\n\nexport const Root = withProvider(styled('div'), 'root')\nexport const InputSlot = withContext(Input, 'input')\nexport const Renderer = withContext(styled('p'), 'renderer')\nexport const Highlight = withContext(styled('span'), 'highlight')\n\nexport interface HighlightedInputRootProps extends ComponentProps<typeof Root> {}\nexport interface HighlightedInputInputProps extends ComponentProps<typeof InputSlot> {}\nexport interface HighlightedInputRendererProps extends ComponentProps<typeof Renderer> {}\nexport interface HighlightedInputHighlightProps extends ComponentProps<typeof Highlight> {}\n\ntype HighlightedInputProps = {\n patterns: { regex: RegExp; color: string }[]\n placeholder?: string\n} & HighlightedInputInputProps\n\nexport const HighlightedInput: FC<HighlightedInputProps> = ({\n patterns,\n value: controlledValue,\n defaultValue,\n onChange,\n onScroll,\n ...inputProps\n}) => {\n const isControlled = controlledValue !== undefined\n\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue?.toString() ?? '')\n\n const value = isControlled ? String(controlledValue) : uncontrolledValue\n\n const textBlockRef = useRef<ElementRef<typeof Renderer>>(null)\n const [scrollValue, setScrollValue] = useState(0)\n\n const handleScroll = (e: { currentTarget: { scrollLeft: number } }) => {\n setScrollValue(e.currentTarget.scrollLeft)\n onScroll?.(e as React.UIEvent<HTMLInputElement>)\n }\n\n useEffect(() => {\n if (textBlockRef.current) {\n textBlockRef.current.scrollLeft = scrollValue\n }\n }, [scrollValue])\n\n const combinedRegex = new RegExp(patterns.map(p => p.regex.source).join('|'), 'gi')\n\n const renderHighlightedText = () => {\n const nodes: ReactNode[] = []\n let lastIndex = 0\n\n for (const match of value.matchAll(combinedRegex)) {\n const start = match.index ?? 0\n const end = start + match[0].length\n\n if (start > lastIndex) {\n nodes.push(<span key={`text-${lastIndex}`}>{value.slice(lastIndex, start)}</span>)\n }\n\n const matchedPattern = patterns.find(p => p.regex.test(match[0]))\n patterns.forEach(p => (p.regex.lastIndex = 0))\n\n nodes.push(\n matchedPattern ? (\n <Highlight key={`highlight-${start}`} style={{ color: matchedPattern.color ?? 'secondary.500' }}>\n {match[0]}\n </Highlight>\n ) : (\n <span key={`text-${start}`}>{match[0]}</span>\n ),\n )\n\n lastIndex = end\n }\n\n if (lastIndex < value.length) {\n nodes.push(<span key={`text-${lastIndex}`}>{value.slice(lastIndex)}</span>)\n }\n\n return nodes\n }\n\n return (\n <Root>\n <InputSlot\n {...inputProps}\n value={value}\n defaultValue={undefined} // prevent React warning\n onScroll={handleScroll}\n onChange={e => {\n if (!isControlled) {\n setUncontrolledValue(e.target.value)\n }\n onChange?.(e)\n }}\n />\n\n <Renderer ref={textBlockRef}>{renderHighlightedText()}</Renderer>\n </Root>\n )\n}\n"],"names":["withProvider","withContext","createStyleContext","highlightedInput","Root","styled","InputSlot","Input","Renderer","Highlight","HighlightedInput","patterns","controlledValue","defaultValue","onChange","onScroll","inputProps","isControlled","uncontrolledValue","setUncontrolledValue","useState","value","textBlockRef","useRef","scrollValue","setScrollValue","handleScroll","e","useEffect","combinedRegex","p","renderHighlightedText","nodes","lastIndex","match","start","end","jsx","matchedPattern"],"mappings":";;;;;;;AAMA,MAAM,EAAE,cAAAA,GAAc,aAAAC,MAAgBC,EAAmBC,GAAkB;AAAA,EACzE,UAAU;AACZ,CAAC,GAEYC,IAAOJ,EAAaK,EAAO,KAAK,GAAG,MAAM,GACzCC,IAAYL,EAAYM,GAAO,OAAO,GACtCC,IAAWP,EAAYI,EAAO,GAAG,GAAG,UAAU,GAC9CI,IAAYR,EAAYI,EAAO,MAAM,GAAG,WAAW,GAYnDK,IAA8C,CAAC;AAAA,EAC1D,UAAAC;AAAA,EACA,OAAOC;AAAA,EACP,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAeL,MAAoB,QAEnC,CAACM,GAAmBC,CAAoB,IAAIC,EAASP,GAAc,SAAA,KAAc,EAAE,GAEnFQ,IAAQJ,IAAe,OAAOL,CAAe,IAAIM,GAEjDI,IAAeC,EAAoC,IAAI,GACvD,CAACC,GAAaC,CAAc,IAAIL,EAAS,CAAC,GAE1CM,IAAe,CAACC,MAAiD;AACrE,IAAAF,EAAeE,EAAE,cAAc,UAAU,GACzCZ,IAAWY,CAAoC;AAAA,EACjD;AAEA,EAAAC,EAAU,MAAM;AACd,IAAIN,EAAa,YACfA,EAAa,QAAQ,aAAaE;AAAA,EAEtC,GAAG,CAACA,CAAW,CAAC;AAEhB,QAAMK,IAAgB,IAAI,OAAOlB,EAAS,IAAI,CAAAmB,MAAKA,EAAE,MAAM,MAAM,EAAE,KAAK,GAAG,GAAG,IAAI,GAE5EC,IAAwB,MAAM;AAClC,UAAMC,IAAqB,CAAA;AAC3B,QAAIC,IAAY;AAEhB,eAAWC,KAASb,EAAM,SAASQ,CAAa,GAAG;AACjD,YAAMM,IAAQD,EAAM,SAAS,GACvBE,IAAMD,IAAQD,EAAM,CAAC,EAAE;AAE7B,MAAIC,IAAQF,KACVD,EAAM,KAAK,gBAAAK,EAAC,QAAA,EAAgC,UAAAhB,EAAM,MAAMY,GAAWE,CAAK,EAAA,GAAlD,QAAQF,CAAS,EAAmC,CAAO;AAGnF,YAAMK,IAAiB3B,EAAS,KAAK,CAAAmB,MAAKA,EAAE,MAAM,KAAKI,EAAM,CAAC,CAAC,CAAC;AAChE,MAAAvB,EAAS,QAAQ,CAAAmB,MAAMA,EAAE,MAAM,YAAY,CAAE,GAE7CE,EAAM;AAAA,QACJM,IACE,gBAAAD,EAAC5B,GAAA,EAAqC,OAAO,EAAE,OAAO6B,EAAe,SAAS,gBAAA,GAC3E,UAAAJ,EAAM,CAAC,KADM,aAAaC,CAAK,EAElC,IAEA,gBAAAE,EAAC,QAAA,EAA4B,YAAM,CAAC,EAAA,GAAzB,QAAQF,CAAK,EAAc;AAAA,MAAA,GAI1CF,IAAYG;AAAA,IACd;AAEA,WAAIH,IAAYZ,EAAM,UACpBW,EAAM,KAAK,gBAAAK,EAAC,QAAA,EAAgC,UAAAhB,EAAM,MAAMY,CAAS,EAAA,GAA3C,QAAQA,CAAS,EAA4B,CAAO,GAGrED;AAAA,EACT;AAEA,2BACG5B,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAiC;AAAA,MAAC/B;AAAA,MAAA;AAAA,QACE,GAAGU;AAAA,QACJ,OAAAK;AAAA,QACA,cAAc;AAAA,QACd,UAAUK;AAAA,QACV,UAAU,CAAAC,MAAK;AACb,UAAKV,KACHE,EAAqBQ,EAAE,OAAO,KAAK,GAErCb,IAAWa,CAAC;AAAA,QACd;AAAA,MAAA;AAAA,IAAA;AAAA,IAGF,gBAAAU,EAAC7B,GAAA,EAAS,KAAKc,GAAe,cAAsB,CAAE;AAAA,EAAA,GACxD;AAEJ;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@stokelp/styled-system/jsx"),r=require("@stokelp/styled-system/recipes"),u=t.styled("input",r.input,{defaultProps:{onWheel:e=>{e.currentTarget.type==="number"&&e.currentTarget.blur()}},dataAttr:!0});exports.Input=u;
|
|
2
|
+
//# sourceMappingURL=Input.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.cjs","sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { input } from '@stokelp/styled-system/recipes'\n\nexport const Input = styled('input', input, {\n defaultProps: {\n onWheel: event => {\n if (event.currentTarget.type === 'number') {\n event.currentTarget.blur()\n }\n },\n },\n dataAttr: true,\n})\n\nexport interface InputProps extends ComponentProps<typeof Input> {}\n"],"names":["Input","styled","input","event"],"mappings":"uLAKaA,EAAQC,EAAAA,OAAO,QAASC,QAAO,CAC1C,aAAc,CACZ,QAASC,GAAS,CACZA,EAAM,cAAc,OAAS,UAC/BA,EAAM,cAAc,KAAA,CAExB,CAAA,EAEF,SAAU,EACZ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { styled as r } from "@stokelp/styled-system/jsx";
|
|
3
|
+
import { input as e } from "@stokelp/styled-system/recipes";
|
|
4
|
+
const o = r("input", e, {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
onWheel: (t) => {
|
|
7
|
+
t.currentTarget.type === "number" && t.currentTarget.blur();
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
dataAttr: !0
|
|
11
|
+
});
|
|
12
|
+
export {
|
|
13
|
+
o as Input
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { input } from '@stokelp/styled-system/recipes'\n\nexport const Input = styled('input', input, {\n defaultProps: {\n onWheel: event => {\n if (event.currentTarget.type === 'number') {\n event.currentTarget.blur()\n }\n },\n },\n dataAttr: true,\n})\n\nexport interface InputProps extends ComponentProps<typeof Input> {}\n"],"names":["Input","styled","input","event"],"mappings":";;;AAKO,MAAMA,IAAQC,EAAO,SAASC,GAAO;AAAA,EAC1C,cAAc;AAAA,IACZ,SAAS,CAAAC,MAAS;AAChB,MAAIA,EAAM,cAAc,SAAS,YAC/BA,EAAM,cAAc,KAAA;AAAA,IAExB;AAAA,EAAA;AAAA,EAEF,UAAU;AACZ,CAAC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@stokelp/styled-system/jsx"),t=require("@stokelp/styled-system/recipes"),r=require("@ark-ui/react"),n=e.styled(r.ark.div,t.inputAddon,{dataAttr:!0});exports.InputAddon=n;
|
|
2
|
+
//# sourceMappingURL=InputAddon.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputAddon.cjs","sources":["../../../src/components/input/InputAddon.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { inputAddon } from '@stokelp/styled-system/recipes'\nimport { ark } from '@ark-ui/react'\n\nexport const InputAddon = styled(ark.div, inputAddon, {\n dataAttr: true,\n})\n\nexport interface InputAddonProps extends ComponentProps<typeof InputAddon> {}\n"],"names":["InputAddon","styled","ark","inputAddon"],"mappings":"kNAMaA,EAAaC,EAAAA,OAAOC,MAAI,IAAKC,EAAAA,WAAY,CACpD,SAAU,EACZ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { styled as t } from "@stokelp/styled-system/jsx";
|
|
3
|
+
import { inputAddon as o } from "@stokelp/styled-system/recipes";
|
|
4
|
+
import { ark as r } from "@ark-ui/react";
|
|
5
|
+
const n = t(r.div, o, {
|
|
6
|
+
dataAttr: !0
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
n as InputAddon
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=InputAddon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputAddon.js","sources":["../../../src/components/input/InputAddon.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { inputAddon } from '@stokelp/styled-system/recipes'\nimport { ark } from '@ark-ui/react'\n\nexport const InputAddon = styled(ark.div, inputAddon, {\n dataAttr: true,\n})\n\nexport interface InputAddonProps extends ComponentProps<typeof InputAddon> {}\n"],"names":["InputAddon","styled","ark","inputAddon"],"mappings":";;;;AAMO,MAAMA,IAAaC,EAAOC,EAAI,KAAKC,GAAY;AAAA,EACpD,UAAU;AACZ,CAAC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@stokelp/styled-system/jsx"),e=require("@stokelp/styled-system/recipes"),r=t.styled("div",e.inputGroup,{dataAttr:!0});exports.InputGroup=r;
|
|
2
|
+
//# sourceMappingURL=InputGroup.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputGroup.cjs","sources":["../../../src/components/input/InputGroup.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { inputGroup } from '@stokelp/styled-system/recipes'\n\nexport const InputGroup = styled('div', inputGroup, {\n dataAttr: true,\n})\n\nexport interface InputGroupProps extends ComponentProps<typeof InputGroup> {}\n"],"names":["InputGroup","styled","inputGroup"],"mappings":"uLAKaA,EAAaC,EAAAA,OAAO,MAAOC,aAAY,CAClD,SAAU,EACZ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { styled as t } from "@stokelp/styled-system/jsx";
|
|
3
|
+
import { inputGroup as r } from "@stokelp/styled-system/recipes";
|
|
4
|
+
const u = t("div", r, {
|
|
5
|
+
dataAttr: !0
|
|
6
|
+
});
|
|
7
|
+
export {
|
|
8
|
+
u as InputGroup
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=InputGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputGroup.js","sources":["../../../src/components/input/InputGroup.tsx"],"sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { inputGroup } from '@stokelp/styled-system/recipes'\n\nexport const InputGroup = styled('div', inputGroup, {\n dataAttr: true,\n})\n\nexport interface InputGroupProps extends ComponentProps<typeof InputGroup> {}\n"],"names":["InputGroup","styled","inputGroup"],"mappings":";;;AAKO,MAAMA,IAAaC,EAAO,OAAOC,GAAY;AAAA,EAClD,UAAU;AACZ,CAAC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),c=require("react-phone-number-input"),e=require("react"),i=require("@stokelp/styled-system/jsx"),l=require("@stokelp/styled-system/recipes"),p=i.styled(c,l.phoneNumberInput,{dataAttr:!0}),y=e.forwardRef((t,n)=>{const[r,u]=e.useState(),[o,s]=e.useState();return a.jsx(p,{international:!0,defaultCountry:"FR",value:o,onChange:s,country:r,onCountryChange:u,...t,ref:n})});exports.PhoneNumberInput=y;
|
|
2
|
+
//# sourceMappingURL=PhoneNumberInput.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhoneNumberInput.cjs","sources":["../../../src/components/input/PhoneNumberInput.tsx"],"sourcesContent":["import NumberInput, { type Props as FeatureProps } from 'react-phone-number-input'\nimport { ComponentProps, ElementRef, FC, forwardRef, useState } from 'react'\nimport { HTMLStyledProps, styled } from '@stokelp/styled-system/jsx'\nimport { phoneNumberInput } from '@stokelp/styled-system/recipes'\n\nconst StyledNumberInput = styled(NumberInput, phoneNumberInput, { dataAttr: true })\n\ntype Ref = ElementRef<typeof NumberInput>\ntype ForwardPhoneNumberInputProps = FeatureProps<ComponentProps<typeof StyledNumberInput>>\n\ntype StyledFeatureProps = FeatureProps<HTMLStyledProps<'input'>>\n\nexport type PhoneNumberInputProps = Omit<StyledFeatureProps, 'onChange'> & {\n onChange?: StyledFeatureProps['onChange']\n}\n\nexport const PhoneNumberInput = forwardRef<Ref, ForwardPhoneNumberInputProps>((props, ref) => {\n const [country, setCountry] = useState()\n const [value, setValue] = useState()\n\n return (\n <StyledNumberInput\n international\n defaultCountry=\"FR\"\n value={value}\n onChange={setValue}\n country={country}\n onCountryChange={setCountry}\n {...props}\n ref={ref}\n />\n )\n}) as FC<PhoneNumberInputProps>\n"],"names":["StyledNumberInput","styled","NumberInput","phoneNumberInput","PhoneNumberInput","forwardRef","props","ref","country","setCountry","useState","value","setValue","jsx"],"mappings":"+QAKMA,EAAoBC,EAAAA,OAAOC,EAAaC,EAAAA,iBAAkB,CAAE,SAAU,GAAM,EAWrEC,EAAmBC,EAAAA,WAA8C,CAACC,EAAOC,IAAQ,CAC5F,KAAM,CAACC,EAASC,CAAU,EAAIC,WAAA,EACxB,CAACC,EAAOC,CAAQ,EAAIF,WAAA,EAE1B,OACEG,EAAAA,IAACb,EAAA,CACC,cAAa,GACb,eAAe,KACf,MAAAW,EACA,SAAUC,EACV,QAAAJ,EACA,gBAAiBC,EAChB,GAAGH,EACJ,IAAAC,CAAA,CAAA,CAGN,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import p from "react-phone-number-input";
|
|
4
|
+
import { forwardRef as s, useState as t } from "react";
|
|
5
|
+
import { styled as f } from "@stokelp/styled-system/jsx";
|
|
6
|
+
import { phoneNumberInput as i } from "@stokelp/styled-system/recipes";
|
|
7
|
+
const l = f(p, i, { dataAttr: !0 }), h = s((r, e) => {
|
|
8
|
+
const [o, n] = t(), [u, m] = t();
|
|
9
|
+
return /* @__PURE__ */ a(
|
|
10
|
+
l,
|
|
11
|
+
{
|
|
12
|
+
international: !0,
|
|
13
|
+
defaultCountry: "FR",
|
|
14
|
+
value: u,
|
|
15
|
+
onChange: m,
|
|
16
|
+
country: o,
|
|
17
|
+
onCountryChange: n,
|
|
18
|
+
...r,
|
|
19
|
+
ref: e
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
h as PhoneNumberInput
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=PhoneNumberInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhoneNumberInput.js","sources":["../../../src/components/input/PhoneNumberInput.tsx"],"sourcesContent":["import NumberInput, { type Props as FeatureProps } from 'react-phone-number-input'\nimport { ComponentProps, ElementRef, FC, forwardRef, useState } from 'react'\nimport { HTMLStyledProps, styled } from '@stokelp/styled-system/jsx'\nimport { phoneNumberInput } from '@stokelp/styled-system/recipes'\n\nconst StyledNumberInput = styled(NumberInput, phoneNumberInput, { dataAttr: true })\n\ntype Ref = ElementRef<typeof NumberInput>\ntype ForwardPhoneNumberInputProps = FeatureProps<ComponentProps<typeof StyledNumberInput>>\n\ntype StyledFeatureProps = FeatureProps<HTMLStyledProps<'input'>>\n\nexport type PhoneNumberInputProps = Omit<StyledFeatureProps, 'onChange'> & {\n onChange?: StyledFeatureProps['onChange']\n}\n\nexport const PhoneNumberInput = forwardRef<Ref, ForwardPhoneNumberInputProps>((props, ref) => {\n const [country, setCountry] = useState()\n const [value, setValue] = useState()\n\n return (\n <StyledNumberInput\n international\n defaultCountry=\"FR\"\n value={value}\n onChange={setValue}\n country={country}\n onCountryChange={setCountry}\n {...props}\n ref={ref}\n />\n )\n}) as FC<PhoneNumberInputProps>\n"],"names":["StyledNumberInput","styled","NumberInput","phoneNumberInput","PhoneNumberInput","forwardRef","props","ref","country","setCountry","useState","value","setValue","jsx"],"mappings":";;;;;;AAKA,MAAMA,IAAoBC,EAAOC,GAAaC,GAAkB,EAAE,UAAU,IAAM,GAWrEC,IAAmBC,EAA8C,CAACC,GAAOC,MAAQ;AAC5F,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAA,GACxB,CAACC,GAAOC,CAAQ,IAAIF,EAAA;AAE1B,SACE,gBAAAG;AAAA,IAACb;AAAA,IAAA;AAAA,MACC,eAAa;AAAA,MACb,gBAAe;AAAA,MACf,OAAAW;AAAA,MACA,UAAUC;AAAA,MACV,SAAAJ;AAAA,MACA,iBAAiBC;AAAA,MAChB,GAAGH;AAAA,MACJ,KAAAC;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),e=require("@ark-ui/react"),c=require("react"),t=require("@stokelp/styled-system/jsx"),l=require("../../utils/slots.cjs"),a=require("@stokelp/styled-system/recipes"),{withProvider:m,withContext:r}=l.createStyleContext(a.menu),p=m(e.Menu.Root,void 0,{defaultProps:{lazyMount:!0,loopFocus:!0,unmountOnExit:!0}}),d=r(t.styled(e.Menu.Positioner),"positioner"),n=c.forwardRef(({children:s,...u},i)=>o.jsx(e.Portal,{children:o.jsx(d,{children:o.jsx(e.Menu.Content,{ref:i,...u,children:s})})}));n.displayName=e.Menu.Content.displayName;const g=r(t.styled(n),"content"),y=r(t.styled(e.Menu.Item),"item"),I=r(t.styled(e.Menu.ItemGroup),"itemGroup"),M=r(t.styled(e.Menu.ItemGroupLabel),"itemGroupLabel"),x=r(t.styled(e.Menu.Separator),"separator"),G=r(t.styled(e.Menu.Trigger),"trigger"),C=r(t.styled(e.Menu.TriggerItem),"triggerItem");exports.Content=g;exports.Item=y;exports.ItemGroup=I;exports.ItemGroupLabel=M;exports.Root=p;exports.Separator=x;exports.Trigger=G;exports.TriggerItem=C;
|
|
2
|
+
//# sourceMappingURL=Menu.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.cjs","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"],"names":["withProvider","withContext","createStyleContext","menu","Root","ArkMenu","Positioner","styled","InnerContent","forwardRef","children","props","ref","jsx","Portal","Content","Item","ItemGroup","ItemGroupLabel","Separator","Trigger","TriggerItem"],"mappings":"uSAOM,CAAE,aAAAA,EAAc,YAAAC,GAAgBC,EAAAA,mBAAmBC,EAAAA,IAAI,EAEhDC,EAAOJ,EAAaK,OAAQ,KAAM,OAAW,CACxD,aAAc,CACZ,UAAW,GACX,UAAW,GACX,cAAe,EAAA,CAEnB,CAAC,EACKC,EAAaL,EAAYM,EAAAA,OAAOF,EAAAA,KAAQ,UAAU,EAAG,YAAY,EAEjEG,EAAeC,EAAAA,WACnB,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAA,EAASC,IAErBC,EAAAA,IAACC,EAAAA,OAAA,CACC,SAAAD,EAAAA,IAACP,EAAA,CACC,SAAAO,EAAAA,IAACR,EAAAA,KAAQ,QAAR,CAAgB,IAAAO,EAAW,GAAGD,EAC5B,SAAAD,CAAA,CACH,EACF,EACF,CAGN,EACAF,EAAa,YAAcH,OAAQ,QAAQ,YAEpC,MAAMU,EAAUd,EAAYM,SAAOC,CAAY,EAAG,SAAS,EACrDQ,EAAOf,EAAYM,EAAAA,OAAOF,EAAAA,KAAQ,IAAI,EAAG,MAAM,EAC/CY,EAAYhB,EAAYM,EAAAA,OAAOF,EAAAA,KAAQ,SAAS,EAAG,WAAW,EAC9Da,EAAiBjB,EAAYM,EAAAA,OAAOF,EAAAA,KAAQ,cAAc,EAAG,gBAAgB,EAC7Ec,EAAYlB,EAAYM,EAAAA,OAAOF,EAAAA,KAAQ,SAAS,EAAG,WAAW,EAC9De,EAAUnB,EAAYM,EAAAA,OAAOF,EAAAA,KAAQ,OAAO,EAAG,SAAS,EACxDgB,EAAcpB,EAAYM,EAAAA,OAAOF,EAAAA,KAAQ,WAAW,EAAG,aAAa"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { Menu as t, Portal as p } from "@ark-ui/react";
|
|
4
|
+
import { forwardRef as a } from "react";
|
|
5
|
+
import { styled as o } from "@stokelp/styled-system/jsx";
|
|
6
|
+
import { createStyleContext as u } from "../../utils/slots.js";
|
|
7
|
+
import { menu as c } from "@stokelp/styled-system/recipes";
|
|
8
|
+
const { withProvider: l, withContext: e } = u(c), y = l(t.Root, void 0, {
|
|
9
|
+
defaultProps: {
|
|
10
|
+
lazyMount: !0,
|
|
11
|
+
loopFocus: !0,
|
|
12
|
+
unmountOnExit: !0
|
|
13
|
+
}
|
|
14
|
+
}), g = e(o(t.Positioner), "positioner"), n = a(
|
|
15
|
+
({ children: i, ...m }, s) => /* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(t.Content, { ref: s, ...m, children: i }) }) })
|
|
16
|
+
);
|
|
17
|
+
n.displayName = t.Content.displayName;
|
|
18
|
+
const P = e(o(n), "content"), h = e(o(t.Item), "item"), T = e(o(t.ItemGroup), "itemGroup"), b = e(o(t.ItemGroupLabel), "itemGroupLabel"), w = e(o(t.Separator), "separator"), L = e(o(t.Trigger), "trigger"), R = e(o(t.TriggerItem), "triggerItem");
|
|
19
|
+
export {
|
|
20
|
+
P as Content,
|
|
21
|
+
h as Item,
|
|
22
|
+
T as ItemGroup,
|
|
23
|
+
b as ItemGroupLabel,
|
|
24
|
+
y as Root,
|
|
25
|
+
w as Separator,
|
|
26
|
+
L as Trigger,
|
|
27
|
+
R as TriggerItem
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=Menu.js.map
|
|
@@ -0,0 +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"],"names":["withProvider","withContext","createStyleContext","menu","Root","ArkMenu","Positioner","styled","InnerContent","forwardRef","children","props","ref","jsx","Portal","Content","Item","ItemGroup","ItemGroupLabel","Separator","Trigger","TriggerItem"],"mappings":";;;;;;;AAOA,MAAM,EAAE,cAAAA,GAAc,aAAAC,MAAgBC,EAAmBC,CAAI,GAEhDC,IAAOJ,EAAaK,EAAQ,MAAM,QAAW;AAAA,EACxD,cAAc;AAAA,IACZ,WAAW;AAAA,IACX,WAAW;AAAA,IACX,eAAe;AAAA,EAAA;AAEnB,CAAC,GACKC,IAAaL,EAAYM,EAAOF,EAAQ,UAAU,GAAG,YAAY,GAEjEG,IAAeC;AAAA,EACnB,CAAC,EAAE,UAAAC,GAAU,GAAGC,EAAA,GAASC,MAErB,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACP,GAAA,EACC,UAAA,gBAAAO,EAACR,EAAQ,SAAR,EAAgB,KAAAO,GAAW,GAAGD,GAC5B,UAAAD,EAAA,CACH,GACF,GACF;AAGN;AACAF,EAAa,cAAcH,EAAQ,QAAQ;AAEpC,MAAMU,IAAUd,EAAYM,EAAOC,CAAY,GAAG,SAAS,GACrDQ,IAAOf,EAAYM,EAAOF,EAAQ,IAAI,GAAG,MAAM,GAC/CY,IAAYhB,EAAYM,EAAOF,EAAQ,SAAS,GAAG,WAAW,GAC9Da,IAAiBjB,EAAYM,EAAOF,EAAQ,cAAc,GAAG,gBAAgB,GAC7Ec,IAAYlB,EAAYM,EAAOF,EAAQ,SAAS,GAAG,WAAW,GAC9De,IAAUnB,EAAYM,EAAOF,EAAQ,OAAO,GAAG,SAAS,GACxDgB,IAAcpB,EAAYM,EAAOF,EAAQ,WAAW,GAAG,aAAa;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),R=require("react"),o=require("@stokelp/styled-system/jsx"),S=require("@stokelp/styled-system/recipes"),B=require("../../utils/slots.cjs"),l=require("./use-pagination.cjs"),a=require("../../shared/utils/events.cjs"),c=require("../icon-button/IconButton.cjs"),{withProvider:k,withContext:d}=B.createStyleContext(S.pagination),I=k(o.styled("div"),"root"),E=d(o.styled("button"),"item"),M=d(o.styled("div"),"dots"),b=({total:r,value:u,defaultValue:v,onChange:g,disabled:t,onNextPage:h,onPrevPage:x,siblings:C=2,boundaries:P=1,...w})=>{const{range:j,setPage:y,next:p,previous:f,active:i}=l.usePagination({page:u,initialPage:v,onChange:g,total:r,siblings:C,boundaries:P}),q=a.createEventHandler(h,p),L=a.createEventHandler(x,f);return e.jsxs(I,{...w,children:[e.jsx(c.IconButton,{size:"md",variant:"tertiary","aria-label":"Previous",disabled:t||i===1,onClick:L,children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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"})})}),j.map((n,s)=>{if(n===l.DOTS)return R.createElement(M,{...t?{"data-disabled":!0}:{},key:s},"...");const m=n===i;return e.jsx(E,{disabled:t,...m?{"data-selected":!0}:{},onClick:()=>y(n),children:n},s)}),e.jsx(c.IconButton,{size:"md",variant:"tertiary","aria-label":"Previous",disabled:t||i===r,onClick:q,children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.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=b;
|
|
2
|
+
//# sourceMappingURL=Pagination.cjs.map
|
|
@@ -0,0 +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"],"names":["withProvider","withContext","createStyleContext","pagination","StyledPagination","styled","PaginationItem","PaginationDots","Pagination","total","value","defaultValue","onChange","disabled","onNextPage","onPrevPage","siblings","boundaries","props","range","setPage","next","previous","active","usePagination","handleNextPage","createEventHandler","handlePreviousPage","jsxs","jsx","IconButton","pageNumber","index","DOTS","createElement","isSelected"],"mappings":"oYAQM,CAAE,aAAAA,EAAc,YAAAC,GAAgBC,EAAAA,mBAAmBC,EAAAA,UAAU,EAE7DC,EAAmBJ,EAAaK,EAAAA,OAAO,KAAK,EAAG,MAAM,EAGrDC,EAAiBL,EAAYI,EAAAA,OAAO,QAAQ,EAAG,MAAM,EACrDE,EAAiBN,EAAYI,EAAAA,OAAO,KAAK,EAAG,MAAM,EAc3CG,EAAkC,CAAC,CAC9C,MAAAC,EACA,MAAAC,EACA,aAAAC,EACA,SAAAC,EACA,SAAAC,EACA,WAAAC,EACA,WAAAC,EACA,SAAAC,EAAW,EACX,WAAAC,EAAa,EACb,GAAGC,CACL,IAAuB,CACrB,KAAM,CAAE,MAAAC,EAAO,QAAAC,EAAS,KAAAC,EAAM,SAAAC,EAAU,OAAAC,CAAA,EAAWC,gBAAc,CAC/D,KAAMd,EACN,YAAaC,EACb,SAAAC,EACA,MAAAH,EACA,SAAAO,EACA,WAAAC,CAAA,CACD,EAEKQ,EAAiBC,EAAAA,mBAAmBZ,EAAYO,CAAI,EACpDM,EAAqBD,EAAAA,mBAAmBX,EAAYO,CAAQ,EAElE,OACEM,EAAAA,KAACxB,EAAA,CAAkB,GAAGc,EACpB,SAAA,CAAAW,EAAAA,IAACC,EAAAA,WAAA,CACC,KAAK,KACL,QAAQ,WACR,aAAW,WACX,SAAUjB,GAAYU,IAAW,EACjC,QAASI,EAET,SAAAE,EAAAA,IAAC,MAAA,CAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,SAAAA,EAAAA,IAAC,OAAA,CACC,SAAS,UACT,SAAS,UACT,EAAE,8TACF,KAAK,cAAA,CAAA,CACP,CACF,CAAA,CAAA,EAEDV,EAAM,IAAI,CAACY,EAAYC,IAAU,CAChC,GAAID,IAAeE,EAAAA,KACjB,OACEC,gBAAC3B,EAAA,CAAgB,GAAIM,EAAW,CAAE,gBAAiB,EAAA,EAAS,CAAA,EAAK,IAAKmB,CAAA,EAAO,KAE7E,EAIJ,MAAMG,EAAaJ,IAAeR,EAElC,OACEM,EAAAA,IAACvB,EAAA,CAEC,SAAAO,EACC,GAAIsB,EACD,CACE,gBAAiB,EAAA,EAEnB,CAAA,EACJ,QAAS,IAAMf,EAAQW,CAAU,EAEhC,SAAAA,CAAA,EATIC,CAAA,CAYX,CAAC,EACDH,EAAAA,IAACC,EAAAA,WAAA,CACC,KAAK,KACL,QAAQ,WACR,aAAW,WACX,SAAUjB,GAAYU,IAAWd,EACjC,QAASgB,EAET,SAAAI,EAAAA,IAAC,MAAA,CAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,SAAAA,EAAAA,IAAC,OAAA,CACC,SAAS,UACT,SAAS,UACT,EAAE,8TACF,KAAK,cAAA,CAAA,CACP,CACF,CAAA,CAAA,CACF,EACF,CAEJ"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as S, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { createElement as k } from "react";
|
|
4
|
+
import { styled as n } from "@stokelp/styled-system/jsx";
|
|
5
|
+
import { pagination as R } from "@stokelp/styled-system/recipes";
|
|
6
|
+
import { createStyleContext as B } from "../../utils/slots.js";
|
|
7
|
+
import { usePagination as j, DOTS as z } from "./use-pagination.js";
|
|
8
|
+
import { createEventHandler as a } from "../../shared/utils/events.js";
|
|
9
|
+
import { IconButton as d } from "../icon-button/IconButton.js";
|
|
10
|
+
const { withProvider: D, withContext: s } = B(R), E = D(n("div"), "root"), I = s(n("button"), "item"), M = s(n("div"), "dots"), J = ({
|
|
11
|
+
total: r,
|
|
12
|
+
value: c,
|
|
13
|
+
defaultValue: m,
|
|
14
|
+
onChange: v,
|
|
15
|
+
disabled: e,
|
|
16
|
+
onNextPage: h,
|
|
17
|
+
onPrevPage: g,
|
|
18
|
+
siblings: C = 2,
|
|
19
|
+
boundaries: p = 1,
|
|
20
|
+
...u
|
|
21
|
+
}) => {
|
|
22
|
+
const { range: f, setPage: w, next: P, previous: x, active: o } = j({
|
|
23
|
+
page: c,
|
|
24
|
+
initialPage: m,
|
|
25
|
+
onChange: v,
|
|
26
|
+
total: r,
|
|
27
|
+
siblings: C,
|
|
28
|
+
boundaries: p
|
|
29
|
+
}), L = a(h, P), y = a(g, x);
|
|
30
|
+
return /* @__PURE__ */ S(E, { ...u, children: [
|
|
31
|
+
/* @__PURE__ */ t(
|
|
32
|
+
d,
|
|
33
|
+
{
|
|
34
|
+
size: "md",
|
|
35
|
+
variant: "tertiary",
|
|
36
|
+
"aria-label": "Previous",
|
|
37
|
+
disabled: e || o === 1,
|
|
38
|
+
onClick: y,
|
|
39
|
+
children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t(
|
|
40
|
+
"path",
|
|
41
|
+
{
|
|
42
|
+
fillRule: "evenodd",
|
|
43
|
+
clipRule: "evenodd",
|
|
44
|
+
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",
|
|
45
|
+
fill: "currentColor"
|
|
46
|
+
}
|
|
47
|
+
) })
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
f.map((i, l) => i === z ? /* @__PURE__ */ k(M, { ...e ? { "data-disabled": !0 } : {}, key: l }, "...") : /* @__PURE__ */ t(
|
|
51
|
+
I,
|
|
52
|
+
{
|
|
53
|
+
disabled: e,
|
|
54
|
+
...i === o ? {
|
|
55
|
+
"data-selected": !0
|
|
56
|
+
} : {},
|
|
57
|
+
onClick: () => w(i),
|
|
58
|
+
children: i
|
|
59
|
+
},
|
|
60
|
+
l
|
|
61
|
+
)),
|
|
62
|
+
/* @__PURE__ */ t(
|
|
63
|
+
d,
|
|
64
|
+
{
|
|
65
|
+
size: "md",
|
|
66
|
+
variant: "tertiary",
|
|
67
|
+
"aria-label": "Previous",
|
|
68
|
+
disabled: e || o === r,
|
|
69
|
+
onClick: L,
|
|
70
|
+
children: /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t(
|
|
71
|
+
"path",
|
|
72
|
+
{
|
|
73
|
+
fillRule: "evenodd",
|
|
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
|
+
] });
|
|
82
|
+
};
|
|
83
|
+
export {
|
|
84
|
+
J as Pagination
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=Pagination.js.map
|
|
@@ -0,0 +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"],"names":["withProvider","withContext","createStyleContext","pagination","StyledPagination","styled","PaginationItem","PaginationDots","Pagination","total","value","defaultValue","onChange","disabled","onNextPage","onPrevPage","siblings","boundaries","props","range","setPage","next","previous","active","usePagination","handleNextPage","createEventHandler","handlePreviousPage","jsxs","jsx","IconButton","pageNumber","index","DOTS","createElement"],"mappings":";;;;;;;;;AAQA,MAAM,EAAE,cAAAA,GAAc,aAAAC,MAAgBC,EAAmBC,CAAU,GAE7DC,IAAmBJ,EAAaK,EAAO,KAAK,GAAG,MAAM,GAGrDC,IAAiBL,EAAYI,EAAO,QAAQ,GAAG,MAAM,GACrDE,IAAiBN,EAAYI,EAAO,KAAK,GAAG,MAAM,GAc3CG,IAAkC,CAAC;AAAA,EAC9C,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,YAAAC,IAAa;AAAA,EACb,GAAGC;AACL,MAAuB;AACrB,QAAM,EAAE,OAAAC,GAAO,SAAAC,GAAS,MAAAC,GAAM,UAAAC,GAAU,QAAAC,EAAA,IAAWC,EAAc;AAAA,IAC/D,MAAMd;AAAA,IACN,aAAaC;AAAA,IACb,UAAAC;AAAA,IACA,OAAAH;AAAA,IACA,UAAAO;AAAA,IACA,YAAAC;AAAA,EAAA,CACD,GAEKQ,IAAiBC,EAAmBZ,GAAYO,CAAI,GACpDM,IAAqBD,EAAmBX,GAAYO,CAAQ;AAElE,SACE,gBAAAM,EAACxB,GAAA,EAAkB,GAAGc,GACpB,UAAA;AAAA,IAAA,gBAAAW;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,cAAW;AAAA,QACX,UAAUjB,KAAYU,MAAW;AAAA,QACjC,SAASI;AAAA,QAET,UAAA,gBAAAE,EAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAChE,UAAA,gBAAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,UAAS;AAAA,YACT,GAAE;AAAA,YACF,MAAK;AAAA,UAAA;AAAA,QAAA,EACP,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,IAEDV,EAAM,IAAI,CAACY,GAAYC,MAClBD,MAAeE,IAEf,gBAAAC,EAAC3B,GAAA,EAAgB,GAAIM,IAAW,EAAE,iBAAiB,GAAA,IAAS,CAAA,GAAK,KAAKmB,EAAA,GAAO,KAE7E,IAOF,gBAAAH;AAAA,MAACvB;AAAA,MAAA;AAAA,QAEC,UAAAO;AAAA,QACC,GANckB,MAAeR,IAO1B;AAAA,UACE,iBAAiB;AAAA,QAAA,IAEnB,CAAA;AAAA,QACJ,SAAS,MAAMH,EAAQW,CAAU;AAAA,QAEhC,UAAAA;AAAA,MAAA;AAAA,MATIC;AAAA,IAAA,CAYV;AAAA,IACD,gBAAAH;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,cAAW;AAAA,QACX,UAAUjB,KAAYU,MAAWd;AAAA,QACjC,SAASgB;AAAA,QAET,UAAA,gBAAAI,EAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAChE,UAAA,gBAAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,UAAS;AAAA,YACT,GAAE;AAAA,YACF,MAAK;AAAA,UAAA;AAAA,QAAA,EACP,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),R=require("../../shared/hooks/useUncontrolled.cjs");function o(r,n){const t=n-r+1;return Array.from({length:t},(h,s)=>s+r)}const l=Symbol("dots"),O=({total:r,siblings:n=1,boundaries:t=1,page:h,initialPage:s=1,onChange:v})=>{const e=Math.max(Math.trunc(r),0),[c,f]=R.useUncontrolled({value:h,onChange:v,defaultValue:s,finalValue:s}),a=u=>{u<=0?f(1):u>e?f(e):f(u)},M=()=>a(c+1),x=()=>a(c-1),y=()=>a(1),D=()=>a(e);return{range:I.useMemo(()=>{if(n*2+3+t*2>=e)return o(1,e);const i=Math.max(c-n,t),m=Math.min(c+n,e-t),S=i>t+2,P=m<e-(t+1);if(!S&&P){const g=n*2+t+2;return[...o(1,g),l,...o(e-(t-1),e)]}if(S&&!P){const g=t+1+2*n;return[...o(1,t),l,...o(e-g,e)]}return[...o(1,t),l,...o(i,m),l,...o(e-t+1,e)]},[e,n,t,c]),active:c,setPage:a,next:M,previous:x,first:y,last:D}};exports.DOTS=l;exports.usePagination=O;
|
|
2
|
+
//# sourceMappingURL=use-pagination.cjs.map
|
|
@@ -0,0 +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"],"names":["range","start","end","length","_","index","DOTS","usePagination","total","siblings","boundaries","page","initialPage","onChange","_total","activePage","setActivePage","useUncontrolled","setPage","pageNumber","next","previous","first","last","useMemo","leftSiblingIndex","rightSiblingIndex","shouldShowLeftDots","shouldShowRightDots","leftItemCount","rightItemCount"],"mappings":"0KAKA,SAASA,EAAMC,EAAeC,EAAa,CACzC,MAAMC,EAASD,EAAMD,EAAQ,EAC7B,OAAO,MAAM,KAAK,CAAE,OAAAE,CAAA,EAAU,CAACC,EAAGC,IAAUA,EAAQJ,CAAK,CAC3D,CAEO,MAAMK,EAAsB,OAAO,MAAM,EAWnCC,EAAgB,CAAC,CAC5B,MAAAC,EACA,SAAAC,EAAW,EACX,WAAAC,EAAa,EACb,KAAAC,EACA,YAAAC,EAAc,EACd,SAAAC,CACF,IAAwB,CACtB,MAAMC,EAAS,KAAK,IAAI,KAAK,MAAMN,CAAK,EAAG,CAAC,EACtC,CAACO,EAAYC,CAAa,EAAIC,kBAAgB,CAClD,MAAON,EACP,SAAAE,EACA,aAAcD,EACd,WAAYA,CAAA,CACb,EAEKM,EAAWC,GAAuB,CAClCA,GAAc,EAChBH,EAAc,CAAC,EACNG,EAAaL,EACtBE,EAAcF,CAAM,EAEpBE,EAAcG,CAAU,CAE5B,EAEMC,EAAO,IAAMF,EAAQH,EAAa,CAAC,EACnCM,EAAW,IAAMH,EAAQH,EAAa,CAAC,EACvCO,EAAQ,IAAMJ,EAAQ,CAAC,EACvBK,EAAO,IAAML,EAAQJ,CAAM,EAiCjC,MAAO,CACL,MAhCsBU,EAAAA,QAAQ,IAAgC,CAE9D,GADyBf,EAAW,EAAI,EAAIC,EAAa,GACjCI,EACtB,OAAOd,EAAM,EAAGc,CAAM,EAGxB,MAAMW,EAAmB,KAAK,IAAIV,EAAaN,EAAUC,CAAU,EAC7DgB,EAAoB,KAAK,IAAIX,EAAaN,EAAUK,EAASJ,CAAU,EAEvEiB,EAAqBF,EAAmBf,EAAa,EACrDkB,EAAsBF,EAAoBZ,GAAUJ,EAAa,GAEvE,GAAI,CAACiB,GAAsBC,EAAqB,CAC9C,MAAMC,EAAgBpB,EAAW,EAAIC,EAAa,EAClD,MAAO,CAAC,GAAGV,EAAM,EAAG6B,CAAa,EAAGvB,EAAM,GAAGN,EAAMc,GAAUJ,EAAa,GAAII,CAAM,CAAC,CACvF,CAEA,GAAIa,GAAsB,CAACC,EAAqB,CAC9C,MAAME,EAAiBpB,EAAa,EAAI,EAAID,EAC5C,MAAO,CAAC,GAAGT,EAAM,EAAGU,CAAU,EAAGJ,EAAM,GAAGN,EAAMc,EAASgB,EAAgBhB,CAAM,CAAC,CAClF,CAEA,MAAO,CACL,GAAGd,EAAM,EAAGU,CAAU,EACtBJ,EACA,GAAGN,EAAMyB,EAAkBC,CAAiB,EAC5CpB,EACA,GAAGN,EAAMc,EAASJ,EAAa,EAAGI,CAAM,CAAA,CAE5C,EAAG,CAACA,EAAQL,EAAUC,EAAYK,CAAU,CAAC,EAI3C,OAAQA,EACR,QAAAG,EACA,KAAAE,EACA,SAAAC,EACA,MAAAC,EACA,KAAAC,CAAA,CAEJ"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMemo as D } from "react";
|
|
3
|
+
import { useUncontrolled as R } from "../../shared/hooks/useUncontrolled.js";
|
|
4
|
+
function e(l, n) {
|
|
5
|
+
const t = n - l + 1;
|
|
6
|
+
return Array.from({ length: t }, (g, r) => r + l);
|
|
7
|
+
}
|
|
8
|
+
const s = Symbol("dots"), C = ({
|
|
9
|
+
total: l,
|
|
10
|
+
siblings: n = 1,
|
|
11
|
+
boundaries: t = 1,
|
|
12
|
+
page: g,
|
|
13
|
+
initialPage: r = 1,
|
|
14
|
+
onChange: v
|
|
15
|
+
}) => {
|
|
16
|
+
const o = Math.max(Math.trunc(l), 0), [c, h] = R({
|
|
17
|
+
value: g,
|
|
18
|
+
onChange: v,
|
|
19
|
+
defaultValue: r,
|
|
20
|
+
finalValue: r
|
|
21
|
+
}), a = (f) => {
|
|
22
|
+
f <= 0 ? h(1) : f > o ? h(o) : h(f);
|
|
23
|
+
}, M = () => a(c + 1), P = () => a(c - 1), p = () => a(1), I = () => a(o);
|
|
24
|
+
return {
|
|
25
|
+
range: D(() => {
|
|
26
|
+
if (n * 2 + 3 + t * 2 >= o)
|
|
27
|
+
return e(1, o);
|
|
28
|
+
const u = Math.max(c - n, t), x = Math.min(c + n, o - t), S = u > t + 2, i = x < o - (t + 1);
|
|
29
|
+
if (!S && i) {
|
|
30
|
+
const m = n * 2 + t + 2;
|
|
31
|
+
return [...e(1, m), s, ...e(o - (t - 1), o)];
|
|
32
|
+
}
|
|
33
|
+
if (S && !i) {
|
|
34
|
+
const m = t + 1 + 2 * n;
|
|
35
|
+
return [...e(1, t), s, ...e(o - m, o)];
|
|
36
|
+
}
|
|
37
|
+
return [
|
|
38
|
+
...e(1, t),
|
|
39
|
+
s,
|
|
40
|
+
...e(u, x),
|
|
41
|
+
s,
|
|
42
|
+
...e(o - t + 1, o)
|
|
43
|
+
];
|
|
44
|
+
}, [o, n, t, c]),
|
|
45
|
+
active: c,
|
|
46
|
+
setPage: a,
|
|
47
|
+
next: M,
|
|
48
|
+
previous: P,
|
|
49
|
+
first: p,
|
|
50
|
+
last: I
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
s as DOTS,
|
|
55
|
+
C as usePagination
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=use-pagination.js.map
|
|
@@ -0,0 +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"],"names":["range","start","end","length","_","index","DOTS","usePagination","total","siblings","boundaries","page","initialPage","onChange","_total","activePage","setActivePage","useUncontrolled","setPage","pageNumber","next","previous","first","last","useMemo","leftSiblingIndex","rightSiblingIndex","shouldShowLeftDots","shouldShowRightDots","leftItemCount","rightItemCount"],"mappings":";;;AAKA,SAASA,EAAMC,GAAeC,GAAa;AACzC,QAAMC,IAASD,IAAMD,IAAQ;AAC7B,SAAO,MAAM,KAAK,EAAE,QAAAE,EAAA,GAAU,CAACC,GAAGC,MAAUA,IAAQJ,CAAK;AAC3D;AAEO,MAAMK,IAAsB,OAAO,MAAM,GAWnCC,IAAgB,CAAC;AAAA,EAC5B,OAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,YAAAC,IAAa;AAAA,EACb,MAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,UAAAC;AACF,MAAwB;AACtB,QAAMC,IAAS,KAAK,IAAI,KAAK,MAAMN,CAAK,GAAG,CAAC,GACtC,CAACO,GAAYC,CAAa,IAAIC,EAAgB;AAAA,IAClD,OAAON;AAAA,IACP,UAAAE;AAAA,IACA,cAAcD;AAAA,IACd,YAAYA;AAAA,EAAA,CACb,GAEKM,IAAU,CAACC,MAAuB;AACtC,IAAIA,KAAc,IAChBH,EAAc,CAAC,IACNG,IAAaL,IACtBE,EAAcF,CAAM,IAEpBE,EAAcG,CAAU;AAAA,EAE5B,GAEMC,IAAO,MAAMF,EAAQH,IAAa,CAAC,GACnCM,IAAW,MAAMH,EAAQH,IAAa,CAAC,GACvCO,IAAQ,MAAMJ,EAAQ,CAAC,GACvBK,IAAO,MAAML,EAAQJ,CAAM;AAiCjC,SAAO;AAAA,IACL,OAhCsBU,EAAQ,MAAgC;AAE9D,UADyBf,IAAW,IAAI,IAAIC,IAAa,KACjCI;AACtB,eAAOd,EAAM,GAAGc,CAAM;AAGxB,YAAMW,IAAmB,KAAK,IAAIV,IAAaN,GAAUC,CAAU,GAC7DgB,IAAoB,KAAK,IAAIX,IAAaN,GAAUK,IAASJ,CAAU,GAEvEiB,IAAqBF,IAAmBf,IAAa,GACrDkB,IAAsBF,IAAoBZ,KAAUJ,IAAa;AAEvE,UAAI,CAACiB,KAAsBC,GAAqB;AAC9C,cAAMC,IAAgBpB,IAAW,IAAIC,IAAa;AAClD,eAAO,CAAC,GAAGV,EAAM,GAAG6B,CAAa,GAAGvB,GAAM,GAAGN,EAAMc,KAAUJ,IAAa,IAAII,CAAM,CAAC;AAAA,MACvF;AAEA,UAAIa,KAAsB,CAACC,GAAqB;AAC9C,cAAME,IAAiBpB,IAAa,IAAI,IAAID;AAC5C,eAAO,CAAC,GAAGT,EAAM,GAAGU,CAAU,GAAGJ,GAAM,GAAGN,EAAMc,IAASgB,GAAgBhB,CAAM,CAAC;AAAA,MAClF;AAEA,aAAO;AAAA,QACL,GAAGd,EAAM,GAAGU,CAAU;AAAA,QACtBJ;AAAA,QACA,GAAGN,EAAMyB,GAAkBC,CAAiB;AAAA,QAC5CpB;AAAA,QACA,GAAGN,EAAMc,IAASJ,IAAa,GAAGI,CAAM;AAAA,MAAA;AAAA,IAE5C,GAAG,CAACA,GAAQL,GAAUC,GAAYK,CAAU,CAAC;AAAA,IAI3C,QAAQA;AAAA,IACR,SAAAG;AAAA,IACA,MAAAE;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),o=require("@ark-ui/react"),e=require("@stokelp/styled-system/jsx"),p=require("@stokelp/styled-system/recipes"),P=require("react"),v=require("../../utils/slots.cjs"),{withProvider:l,withContext:r}=v.createStyleContext(p.popover),g=l(o.Popover.Root,void 0,{defaultProps:{unmountOnExit:!0,lazyMount:!0,portalled:!0}}),u=r(e.styled(o.Popover.CloseTrigger),"closeTrigger"),d=r(e.styled(o.Popover.Trigger),"trigger"),a=r(e.styled(o.Popover.Anchor),"anchor"),C=r(e.styled(o.Popover.Positioner),"positioner"),n=P.forwardRef(({children:s,...i},c)=>t.jsx(o.Portal,{children:t.jsx(C,{children:t.jsx(o.Popover.Content,{ref:c,...i,children:s})})}));n.displayName=o.Popover.Content.displayName;const x=r(e.styled(n),"content"),y=o.Popover.Context;exports.Popover=g;exports.PopoverAnchor=a;exports.PopoverCloseTrigger=u;exports.PopoverContent=x;exports.PopoverContext=y;exports.PopoverTrigger=d;
|
|
2
|
+
//# sourceMappingURL=Popover.cjs.map
|
|
@@ -0,0 +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"],"names":["withProvider","withContext","createStyleContext","popover","Popover","ArkPopover","PopoverCloseTrigger","styled","PopoverTrigger","PopoverAnchor","PopoverPositioner","Content","forwardRef","children","props","ref","Portal","jsx","PopoverContent","PopoverContext"],"mappings":"uSASM,CAAE,aAAAA,EAAc,YAAAC,GAAgBC,EAAAA,mBAAmBC,EAAAA,OAAO,EAEnDC,EAAUJ,EAAaK,UAAW,KAAM,OAAW,CAC9D,aAAc,CACZ,cAAe,GACf,UAAW,GACX,UAAW,EAAA,CAEf,CAAC,EACYC,EAAsBL,EAAYM,EAAAA,OAAOF,EAAAA,QAAW,YAAY,EAAG,cAAc,EACjFG,EAAiBP,EAAYM,EAAAA,OAAOF,EAAAA,QAAW,OAAO,EAAG,SAAS,EAClEI,EAAgBR,EAAYM,EAAAA,OAAOF,EAAAA,QAAW,MAAM,EAAG,QAAQ,EAEtEK,EAAoBT,EAAYM,EAAAA,OAAOF,EAAAA,QAAW,UAAU,EAAG,YAAY,EAE3EM,EAAUC,EAAAA,WACd,CAAC,CAAE,SAAAC,EAAU,GAAGC,GAASC,UACtBC,EAAAA,OAAA,CACC,SAAAC,MAACP,GACC,SAAAO,EAAAA,IAACZ,EAAAA,QAAW,QAAX,CAAmB,IAAAU,EAAW,GAAGD,EAC/B,SAAAD,EACH,EACF,CAAA,CACF,CAEJ,EACAF,EAAQ,YAAcN,UAAW,QAAQ,YAElC,MAAMa,EAAiBjB,EAAYM,SAAOI,CAAO,EAAG,SAAS,EACvDQ,EAAiBd,EAAAA,QAAW"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { Popover as o, Portal as c } from "@ark-ui/react";
|
|
4
|
+
import { styled as r } from "@stokelp/styled-system/jsx";
|
|
5
|
+
import { popover as l } from "@stokelp/styled-system/recipes";
|
|
6
|
+
import { forwardRef as m } from "react";
|
|
7
|
+
import { createStyleContext as P } from "../../utils/slots.js";
|
|
8
|
+
const { withProvider: a, withContext: t } = P(l), x = a(o.Root, void 0, {
|
|
9
|
+
defaultProps: {
|
|
10
|
+
unmountOnExit: !0,
|
|
11
|
+
lazyMount: !0,
|
|
12
|
+
portalled: !0
|
|
13
|
+
}
|
|
14
|
+
}), y = t(r(o.CloseTrigger), "closeTrigger"), T = t(r(o.Trigger), "trigger"), w = t(r(o.Anchor), "anchor"), g = t(r(o.Positioner), "positioner"), n = m(
|
|
15
|
+
({ children: i, ...p }, s) => /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(o.Content, { ref: s, ...p, children: i }) }) })
|
|
16
|
+
);
|
|
17
|
+
n.displayName = o.Content.displayName;
|
|
18
|
+
const A = t(r(n), "content"), N = o.Context;
|
|
19
|
+
export {
|
|
20
|
+
x as Popover,
|
|
21
|
+
w as PopoverAnchor,
|
|
22
|
+
y as PopoverCloseTrigger,
|
|
23
|
+
A as PopoverContent,
|
|
24
|
+
N as PopoverContext,
|
|
25
|
+
T as PopoverTrigger
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=Popover.js.map
|
|
@@ -0,0 +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"],"names":["withProvider","withContext","createStyleContext","popover","Popover","ArkPopover","PopoverCloseTrigger","styled","PopoverTrigger","PopoverAnchor","PopoverPositioner","Content","forwardRef","children","props","ref","Portal","jsx","PopoverContent","PopoverContext"],"mappings":";;;;;;;AASA,MAAM,EAAE,cAAAA,GAAc,aAAAC,MAAgBC,EAAmBC,CAAO,GAEnDC,IAAUJ,EAAaK,EAAW,MAAM,QAAW;AAAA,EAC9D,cAAc;AAAA,IACZ,eAAe;AAAA,IACf,WAAW;AAAA,IACX,WAAW;AAAA,EAAA;AAEf,CAAC,GACYC,IAAsBL,EAAYM,EAAOF,EAAW,YAAY,GAAG,cAAc,GACjFG,IAAiBP,EAAYM,EAAOF,EAAW,OAAO,GAAG,SAAS,GAClEI,IAAgBR,EAAYM,EAAOF,EAAW,MAAM,GAAG,QAAQ,GAEtEK,IAAoBT,EAAYM,EAAOF,EAAW,UAAU,GAAG,YAAY,GAE3EM,IAAUC;AAAA,EACd,CAAC,EAAE,UAAAC,GAAU,GAAGC,KAASC,wBACtBC,GAAA,EACC,UAAA,gBAAAC,EAACP,KACC,UAAA,gBAAAO,EAACZ,EAAW,SAAX,EAAmB,KAAAU,GAAW,GAAGD,GAC/B,UAAAD,GACH,GACF,EAAA,CACF;AAEJ;AACAF,EAAQ,cAAcN,EAAW,QAAQ;AAElC,MAAMa,IAAiBjB,EAAYM,EAAOI,CAAO,GAAG,SAAS,GACvDQ,IAAiBd,EAAW;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("@ark-ui/react"),a=require("@stokelp/styled-system/recipes"),d=require("../../utils/slots.cjs"),l=require("react"),o=require("@stokelp/styled-system/jsx"),{withProvider:c,withContext:r}=d.createStyleContext(a.radioButtonGroup),p=r(o.styled(t.RadioGroup.ItemControl),"itemControl"),R=r(o.styled(t.RadioGroup.ItemText),"itemText"),G=l.forwardRef(({children:i,value:n,...u},s)=>e.jsxs(t.RadioGroup.Item,{ref:s,...u,value:n,children:[e.jsx(R,{children:i}),e.jsx(p,{}),e.jsx(t.RadioGroup.ItemHiddenInput,{})]})),m=c(o.styled(t.RadioGroup.Root),"root",{defaultProps:{orientation:"horizontal"}}),x=r(o.styled(G),"item"),I=r(o.styled(t.RadioGroup.Label),"label");exports.RadioButtonGroup=m;exports.RadioButtonGroupItem=x;exports.RadioButtonGroupLabel=I;
|
|
2
|
+
//# sourceMappingURL=RadioButtonGroup.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButtonGroup.cjs","sources":["../../../src/components/radio-button-group/RadioButtonGroup.tsx"],"sourcesContent":["import { RadioGroup as ArkRadioGroup } from '@ark-ui/react'\nimport { radioButtonGroup } from '@stokelp/styled-system/recipes'\n\nimport { createStyleContext } from '~/utils/slots'\nimport type { ComponentProps, ComponentPropsWithoutRef, ElementRef } from 'react'\nimport { forwardRef } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\n\nconst { withProvider, withContext } = createStyleContext(radioButtonGroup)\n\nconst RadioButtonGroupItemControl = withContext(styled(ArkRadioGroup.ItemControl), 'itemControl')\nconst RadioButtonGroupItemText = withContext(styled(ArkRadioGroup.ItemText), 'itemText')\ntype ArkItemProps = ComponentPropsWithoutRef<typeof ArkRadioGroup.Item>\ntype ItemProps = Omit<ArkItemProps, 'value'> & { value: string | number | boolean }\nconst Item = forwardRef<ElementRef<typeof ArkRadioGroup.Item>, ItemProps>(({ children, value, ...props }, ref) => (\n <ArkRadioGroup.Item ref={ref} {...props} value={value as string}>\n <RadioButtonGroupItemText>{children}</RadioButtonGroupItemText>\n <RadioButtonGroupItemControl />\n <ArkRadioGroup.ItemHiddenInput />\n </ArkRadioGroup.Item>\n))\n\nexport const RadioButtonGroup = withProvider(styled(ArkRadioGroup.Root), 'root', {\n defaultProps: {\n orientation: 'horizontal',\n },\n})\nexport const RadioButtonGroupItem = withContext(styled(Item), 'item')\nexport const RadioButtonGroupLabel = withContext(styled(ArkRadioGroup.Label), 'label')\n\nexport interface RadioButtonGroupProps extends ComponentProps<typeof RadioButtonGroup> {}\nexport interface RadioButtonGroupItemProps extends ComponentProps<typeof RadioButtonGroupItem> {}\nexport interface RadioButtonGroupLabelProps extends ComponentProps<typeof RadioButtonGroupLabel> {}\n"],"names":["withProvider","withContext","createStyleContext","radioButtonGroup","RadioButtonGroupItemControl","styled","ArkRadioGroup","RadioButtonGroupItemText","Item","forwardRef","children","value","props","ref","jsx","RadioButtonGroup","RadioButtonGroupItem","RadioButtonGroupLabel"],"mappings":"uSAQM,CAAE,aAAAA,EAAc,YAAAC,GAAgBC,EAAAA,mBAAmBC,EAAAA,gBAAgB,EAEnEC,EAA8BH,EAAYI,EAAAA,OAAOC,EAAAA,WAAc,WAAW,EAAG,aAAa,EAC1FC,EAA2BN,EAAYI,EAAAA,OAAOC,EAAAA,WAAc,QAAQ,EAAG,UAAU,EAGjFE,EAAOC,EAAAA,WAA6D,CAAC,CAAE,SAAAC,EAAU,MAAAC,EAAO,GAAGC,GAASC,WACvGP,EAAAA,WAAc,KAAd,CAAmB,IAAAO,EAAW,GAAGD,EAAO,MAAAD,EACvC,SAAA,CAAAG,MAACP,GAA0B,SAAAG,EAAS,QACnCN,EAAA,EAA4B,EAC7BU,MAACR,EAAAA,WAAc,gBAAd,CAAA,CAA8B,CAAA,CAAA,CACjC,CACD,EAEYS,EAAmBf,EAAaK,EAAAA,OAAOC,EAAAA,WAAc,IAAI,EAAG,OAAQ,CAC/E,aAAc,CACZ,YAAa,YAAA,CAEjB,CAAC,EACYU,EAAuBf,EAAYI,SAAOG,CAAI,EAAG,MAAM,EACvDS,EAAwBhB,EAAYI,EAAAA,OAAOC,EAAAA,WAAc,KAAK,EAAG,OAAO"}
|