@vjdesigns/vjdesigns-ui 2.4.0 → 3.0.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/LICENSE +15 -0
- package/README.md +45 -1
- package/dist/ai/llms-full.txt +141 -76
- package/dist/ai/registry.json +125 -61
- package/dist/components/data-display/Accordion/Accordion.cjs.js +1 -1
- package/dist/components/data-display/Accordion/Accordion.mjs +22 -22
- package/dist/components/data-display/Accordion/Accordion.module.css.mjs +1 -2
- package/dist/components/data-display/Avatar/Avatar.cjs.js +1 -1
- package/dist/components/data-display/Avatar/Avatar.mjs +92 -92
- package/dist/components/data-display/Avatar/Avatar.module.css.mjs +1 -2
- package/dist/components/data-display/Badge/Badge.cjs.js +1 -1
- package/dist/components/data-display/Badge/Badge.mjs +2 -2
- package/dist/components/data-display/Badge/Badge.module.css.mjs +1 -2
- package/dist/components/data-display/Card/Card.cjs.js +1 -1
- package/dist/components/data-display/Card/Card.mjs +2 -2
- package/dist/components/data-display/Card/Card.module.css.mjs +1 -2
- package/dist/components/data-display/Carousel/Carousel.cjs.js +1 -1
- package/dist/components/data-display/Carousel/Carousel.mjs +42 -42
- package/dist/components/data-display/Carousel/Carousel.module.css.mjs +1 -2
- package/dist/components/data-display/Chat/Chat.cjs.js +1 -1
- package/dist/components/data-display/Chat/Chat.mjs +114 -118
- package/dist/components/data-display/Chat/Chat.module.css.mjs +1 -2
- package/dist/components/data-display/Chat/streams.mjs +1 -2
- package/dist/components/data-display/Chip/Chip.cjs.js +1 -1
- package/dist/components/data-display/Chip/Chip.mjs +50 -54
- package/dist/components/data-display/Chip/Chip.module.css.mjs +1 -2
- package/dist/components/data-display/CodeBlock/CodeBlock.cjs.js +4 -4
- package/dist/components/data-display/CodeBlock/CodeBlock.mjs +113 -113
- package/dist/components/data-display/CodeBlock/CodeBlock.module.css.mjs +1 -2
- package/dist/components/data-display/CodeBlock/tokenize.mjs +1 -2
- package/dist/components/data-display/DataGrid/DataGrid.cjs.js +1 -1
- package/dist/components/data-display/DataGrid/DataGrid.d.ts +59 -3
- package/dist/components/data-display/DataGrid/DataGrid.mjs +382 -272
- package/dist/components/data-display/DataGrid/DataGrid.module.css.cjs.js +1 -1
- package/dist/components/data-display/DataGrid/DataGrid.module.css.mjs +29 -26
- package/dist/components/data-display/DataGrid/dataGridUtils.cjs.js +1 -1
- package/dist/components/data-display/DataGrid/dataGridUtils.d.ts +18 -0
- package/dist/components/data-display/DataGrid/dataGridUtils.mjs +100 -32
- package/dist/components/data-display/EmptyState/EmptyState.cjs.js +1 -1
- package/dist/components/data-display/EmptyState/EmptyState.mjs +53 -53
- package/dist/components/data-display/EmptyState/EmptyState.module.css.mjs +1 -2
- package/dist/components/data-display/Image/Image.cjs.js +1 -1
- package/dist/components/data-display/Image/Image.mjs +6 -6
- package/dist/components/data-display/Image/Image.module.css.mjs +1 -2
- package/dist/components/data-display/List/List.cjs.js +1 -1
- package/dist/components/data-display/List/List.mjs +68 -68
- package/dist/components/data-display/List/List.module.css.mjs +1 -2
- package/dist/components/data-display/Stat/Stat.cjs.js +1 -1
- package/dist/components/data-display/Stat/Stat.mjs +112 -112
- package/dist/components/data-display/Stat/Stat.module.css.mjs +1 -2
- package/dist/components/data-display/Table/Table.cjs.js +1 -1
- package/dist/components/data-display/Table/Table.mjs +187 -183
- package/dist/components/data-display/Table/Table.module.css.mjs +1 -2
- package/dist/components/data-display/Table/useTable.cjs.js +1 -1
- package/dist/components/data-display/Table/useTable.mjs +2 -2
- package/dist/components/data-display/Timeline/Timeline.cjs.js +1 -1
- package/dist/components/data-display/Timeline/Timeline.mjs +64 -64
- package/dist/components/data-display/Timeline/Timeline.module.css.mjs +1 -2
- package/dist/components/data-display/TreeView/TreeView.cjs.js +1 -1
- package/dist/components/data-display/TreeView/TreeView.mjs +107 -119
- package/dist/components/data-display/TreeView/TreeView.module.css.mjs +1 -2
- package/dist/components/data-display/TreeView/treeUtils.mjs +1 -2
- package/dist/components/data-display/VirtualList/VirtualList.cjs.js +1 -1
- package/dist/components/data-display/VirtualList/VirtualList.mjs +2 -2
- package/dist/components/data-display/VirtualList/VirtualList.module.css.mjs +1 -2
- package/dist/components/feedback/Alert/Alert.cjs.js +1 -1
- package/dist/components/feedback/Alert/Alert.mjs +56 -56
- package/dist/components/feedback/Alert/Alert.module.css.mjs +1 -2
- package/dist/components/feedback/Banner/Banner.cjs.js +1 -1
- package/dist/components/feedback/Banner/Banner.mjs +48 -48
- package/dist/components/feedback/Banner/Banner.module.css.mjs +1 -2
- package/dist/components/feedback/ErrorSummary/ErrorSummary.cjs.js +1 -1
- package/dist/components/feedback/ErrorSummary/ErrorSummary.mjs +10 -10
- package/dist/components/feedback/ErrorSummary/ErrorSummary.module.css.mjs +1 -2
- package/dist/components/feedback/Progress/Progress.cjs.js +1 -1
- package/dist/components/feedback/Progress/Progress.mjs +2 -2
- package/dist/components/feedback/Progress/Progress.module.css.mjs +1 -2
- package/dist/components/feedback/Skeleton/Skeleton.cjs.js +1 -1
- package/dist/components/feedback/Skeleton/Skeleton.mjs +73 -73
- package/dist/components/feedback/Skeleton/Skeleton.module.css.mjs +1 -2
- package/dist/components/feedback/Spinner/Spinner.cjs.js +1 -1
- package/dist/components/feedback/Spinner/Spinner.mjs +29 -29
- package/dist/components/feedback/Spinner/Spinner.module.css.mjs +1 -2
- package/dist/components/feedback/Toast/Toast.cjs.js +1 -1
- package/dist/components/feedback/Toast/Toast.mjs +42 -42
- package/dist/components/feedback/Toast/Toast.module.css.mjs +1 -2
- package/dist/components/feedback/Toast/ToastItem.cjs.js +1 -1
- package/dist/components/feedback/Toast/ToastItem.mjs +10 -10
- package/dist/components/feedback/Toast/ToastProvider.cjs.js +1 -1
- package/dist/components/feedback/Toast/ToastProvider.mjs +11 -11
- package/dist/components/feedback/Toast/ToastViewport.cjs.js +1 -1
- package/dist/components/feedback/Toast/ToastViewport.mjs +30 -30
- package/dist/components/feedback/Toast/toastStore.mjs +1 -2
- package/dist/components/feedback/Toast/toastTiming.cjs.js +1 -1
- package/dist/components/feedback/Toast/toastTiming.mjs +2 -2
- package/dist/components/feedback/Toast/useToast.cjs.js +1 -1
- package/dist/components/feedback/Toast/useToast.mjs +2 -2
- package/dist/components/feedback/Toast/useToastAnnouncer.cjs.js +1 -1
- package/dist/components/feedback/Toast/useToastAnnouncer.mjs +2 -2
- package/dist/components/forms/CheckBox/CheckBox.cjs.js +1 -1
- package/dist/components/forms/CheckBox/CheckBox.mjs +2 -2
- package/dist/components/forms/CheckBox/CheckBox.module.css.mjs +1 -2
- package/dist/components/forms/ColorPicker/ColorInput.cjs.js +1 -1
- package/dist/components/forms/ColorPicker/ColorInput.mjs +43 -43
- package/dist/components/forms/ColorPicker/ColorPicker.cjs.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPicker.mjs +153 -153
- package/dist/components/forms/ColorPicker/ColorPicker.module.css.mjs +1 -2
- package/dist/components/forms/ColorPicker/colorUtils.mjs +1 -2
- package/dist/components/forms/Combobox/Combobox.cjs.js +1 -1
- package/dist/components/forms/Combobox/Combobox.mjs +200 -213
- package/dist/components/forms/Combobox/Combobox.module.css.mjs +1 -2
- package/dist/components/forms/Combobox/ComboboxPopup.cjs.js +1 -1
- package/dist/components/forms/Combobox/ComboboxPopup.mjs +164 -121
- package/dist/components/forms/Combobox/comboboxUtils.cjs.js +1 -1
- package/dist/components/forms/Combobox/comboboxUtils.d.ts +4 -1
- package/dist/components/forms/Combobox/comboboxUtils.mjs +21 -20
- package/dist/components/forms/DatePicker/Calendar.cjs.js +1 -1
- package/dist/components/forms/DatePicker/Calendar.mjs +60 -66
- package/dist/components/forms/DatePicker/Calendar.module.css.mjs +1 -2
- package/dist/components/forms/DatePicker/DatePicker.cjs.js +1 -1
- package/dist/components/forms/DatePicker/DatePicker.mjs +72 -74
- package/dist/components/forms/DatePicker/DatePicker.module.css.mjs +1 -2
- package/dist/components/forms/DatePicker/DateRangePicker.cjs.js +1 -1
- package/dist/components/forms/DatePicker/DateRangePicker.mjs +117 -117
- package/dist/components/forms/DatePicker/DateRangePicker.module.css.mjs +1 -2
- package/dist/components/forms/DatePicker/dateUtils.mjs +1 -2
- package/dist/components/forms/DatePicker/index.d.ts +1 -1
- package/dist/components/forms/DateTimePicker/DateTimePicker.cjs.js +1 -1
- package/dist/components/forms/DateTimePicker/DateTimePicker.mjs +19 -19
- package/dist/components/forms/DateTimePicker/DateTimePicker.module.css.mjs +1 -2
- package/dist/components/forms/Field/Field.cjs.js +1 -1
- package/dist/components/forms/Field/Field.mjs +14 -14
- package/dist/components/forms/Field/Field.module.css.mjs +1 -2
- package/dist/components/forms/Field/FieldContext.cjs.js +1 -1
- package/dist/components/forms/Field/FieldContext.mjs +2 -2
- package/dist/components/forms/FileUpload/FileUpload.cjs.js +1 -1
- package/dist/components/forms/FileUpload/FileUpload.mjs +250 -255
- package/dist/components/forms/FileUpload/FileUpload.module.css.mjs +1 -2
- package/dist/components/forms/Input/Input.cjs.js +1 -1
- package/dist/components/forms/Input/Input.mjs +35 -35
- package/dist/components/forms/Input/Input.module.css.mjs +1 -2
- package/dist/components/forms/NumberInput/NumberInput.cjs.js +1 -1
- package/dist/components/forms/NumberInput/NumberInput.mjs +137 -142
- package/dist/components/forms/NumberInput/NumberInput.module.css.mjs +1 -2
- package/dist/components/forms/PasswordInput/PasswordInput.cjs.js +1 -1
- package/dist/components/forms/PasswordInput/PasswordInput.mjs +142 -142
- package/dist/components/forms/PasswordInput/PasswordInput.module.css.mjs +1 -2
- package/dist/components/forms/PinInput/PinInput.cjs.js +1 -1
- package/dist/components/forms/PinInput/PinInput.mjs +12 -12
- package/dist/components/forms/PinInput/PinInput.module.css.mjs +1 -2
- package/dist/components/forms/Radio/Radio.cjs.js +1 -1
- package/dist/components/forms/Radio/Radio.mjs +2 -2
- package/dist/components/forms/Radio/Radio.module.css.mjs +1 -2
- package/dist/components/forms/Rating/Rating.cjs.js +1 -1
- package/dist/components/forms/Rating/Rating.mjs +110 -109
- package/dist/components/forms/Rating/Rating.module.css.mjs +1 -2
- package/dist/components/forms/SearchInput/SearchInput.cjs.js +1 -1
- package/dist/components/forms/SearchInput/SearchInput.mjs +118 -126
- package/dist/components/forms/SearchInput/SearchInput.module.css.mjs +1 -2
- package/dist/components/forms/SegmentedControl/SegmentedControl.cjs.js +1 -1
- package/dist/components/forms/SegmentedControl/SegmentedControl.mjs +46 -43
- package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.cjs.js +1 -1
- package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.mjs +2 -3
- package/dist/components/forms/Select/Select.cjs.js +1 -1
- package/dist/components/forms/Select/Select.mjs +2 -2
- package/dist/components/forms/Select/Select.module.css.mjs +1 -2
- package/dist/components/forms/Slider/Slider.cjs.js +1 -1
- package/dist/components/forms/Slider/Slider.mjs +2 -2
- package/dist/components/forms/Slider/Slider.module.css.mjs +1 -2
- package/dist/components/forms/Switch/Switch.cjs.js +1 -1
- package/dist/components/forms/Switch/Switch.mjs +39 -39
- package/dist/components/forms/Switch/Switch.module.css.mjs +1 -2
- package/dist/components/forms/TagInput/TagInput.cjs.js +1 -1
- package/dist/components/forms/TagInput/TagInput.mjs +197 -203
- package/dist/components/forms/TagInput/TagInput.module.css.mjs +1 -2
- package/dist/components/forms/Textarea/Textarea.cjs.js +1 -1
- package/dist/components/forms/Textarea/Textarea.mjs +59 -59
- package/dist/components/forms/Textarea/Textarea.module.css.mjs +1 -2
- package/dist/components/forms/TimePicker/TimePicker.cjs.js +1 -1
- package/dist/components/forms/TimePicker/TimePicker.mjs +65 -67
- package/dist/components/forms/TimePicker/TimePicker.module.css.mjs +1 -2
- package/dist/components/forms/TimePicker/index.d.ts +1 -0
- package/dist/components/forms/TimePicker/timeUtils.cjs.js +1 -1
- package/dist/components/forms/TimePicker/timeUtils.d.ts +4 -1
- package/dist/components/forms/TimePicker/timeUtils.mjs +43 -38
- package/dist/components/forms/ToggleGroup/ToggleGroup.cjs.js +1 -1
- package/dist/components/forms/ToggleGroup/ToggleGroup.mjs +10 -10
- package/dist/components/forms/ToggleGroup/ToggleGroup.module.css.mjs +1 -2
- package/dist/components/layout/Box/Box.mjs +1 -2
- package/dist/components/layout/Box/Box.module.css.mjs +1 -2
- package/dist/components/layout/Container/Container.mjs +1 -2
- package/dist/components/layout/Container/Container.module.css.mjs +1 -2
- package/dist/components/layout/Divider/Divider.mjs +1 -2
- package/dist/components/layout/Divider/Divider.module.css.mjs +1 -2
- package/dist/components/layout/Flex/Flex.cjs.js +1 -1
- package/dist/components/layout/Flex/Flex.mjs +12 -13
- package/dist/components/layout/Flex/Flex.module.css.mjs +1 -2
- package/dist/components/layout/Grid/Grid.cjs.js +1 -1
- package/dist/components/layout/Grid/Grid.mjs +20 -21
- package/dist/components/layout/Grid/Grid.module.css.mjs +1 -2
- package/dist/components/layout/ResizablePanels/ResizablePanels.cjs.js +1 -1
- package/dist/components/layout/ResizablePanels/ResizablePanels.mjs +17 -17
- package/dist/components/layout/ResizablePanels/ResizablePanels.module.css.mjs +1 -2
- package/dist/components/layout/ScrollArea/ScrollArea.cjs.js +1 -1
- package/dist/components/layout/ScrollArea/ScrollArea.mjs +2 -2
- package/dist/components/layout/ScrollArea/ScrollArea.module.css.mjs +1 -2
- package/dist/components/layout/Stack/Stack.cjs.js +1 -1
- package/dist/components/layout/Stack/Stack.mjs +8 -9
- package/dist/components/layout/Stack/Stack.module.css.mjs +1 -2
- package/dist/components/navigation/Breadcrumbs/Breadcrumbs.cjs.js +1 -1
- package/dist/components/navigation/Breadcrumbs/Breadcrumbs.mjs +41 -41
- package/dist/components/navigation/Breadcrumbs/Breadcrumbs.module.css.mjs +1 -2
- package/dist/components/navigation/ContextMenu/ContextMenu.cjs.js +1 -1
- package/dist/components/navigation/ContextMenu/ContextMenu.mjs +48 -48
- package/dist/components/navigation/ContextMenu/ContextMenu.module.css.mjs +1 -2
- package/dist/components/navigation/Link/Link.cjs.js +1 -1
- package/dist/components/navigation/Link/Link.mjs +6 -7
- package/dist/components/navigation/Link/Link.module.css.mjs +1 -2
- package/dist/components/navigation/Menu/Menu.cjs.js +1 -1
- package/dist/components/navigation/Menu/Menu.mjs +11 -11
- package/dist/components/navigation/Menu/Menu.module.css.mjs +1 -2
- package/dist/components/navigation/Menu/MenuContent.cjs.js +1 -1
- package/dist/components/navigation/Menu/MenuContent.mjs +46 -46
- package/dist/components/navigation/Menu/MenuContext.cjs.js +1 -1
- package/dist/components/navigation/Menu/MenuContext.mjs +2 -2
- package/dist/components/navigation/Menu/MenuItem.cjs.js +1 -1
- package/dist/components/navigation/Menu/MenuItem.mjs +35 -39
- package/dist/components/navigation/Menu/MenuSub.cjs.js +1 -1
- package/dist/components/navigation/Menu/MenuSub.mjs +16 -20
- package/dist/components/navigation/Menu/useMenuRoot.cjs.js +1 -1
- package/dist/components/navigation/Menu/useMenuRoot.mjs +2 -2
- package/dist/components/navigation/Navbar/Navbar.cjs.js +1 -1
- package/dist/components/navigation/Navbar/Navbar.mjs +111 -111
- package/dist/components/navigation/Navbar/Navbar.module.css.mjs +1 -2
- package/dist/components/navigation/Pagination/Pagination.cjs.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.mjs +31 -35
- package/dist/components/navigation/Pagination/Pagination.module.css.mjs +1 -2
- package/dist/components/navigation/Sidebar/Sidebar.cjs.js +1 -1
- package/dist/components/navigation/Sidebar/Sidebar.mjs +52 -52
- package/dist/components/navigation/Sidebar/Sidebar.module.css.mjs +1 -2
- package/dist/components/navigation/Sidebar/SidebarContext.cjs.js +1 -1
- package/dist/components/navigation/Sidebar/SidebarContext.mjs +2 -2
- package/dist/components/navigation/Sidebar/SidebarParts.cjs.js +1 -1
- package/dist/components/navigation/Sidebar/SidebarParts.mjs +76 -80
- package/dist/components/navigation/SkipLink/SkipLink.cjs.js +1 -1
- package/dist/components/navigation/SkipLink/SkipLink.mjs +12 -12
- package/dist/components/navigation/SkipLink/SkipLink.module.css.mjs +1 -2
- package/dist/components/navigation/Stepper/Stepper.cjs.js +1 -1
- package/dist/components/navigation/Stepper/Stepper.mjs +46 -46
- package/dist/components/navigation/Stepper/Stepper.module.css.mjs +1 -2
- package/dist/components/navigation/Tabs/Tabs.cjs.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.mjs +2 -2
- package/dist/components/navigation/Tabs/Tabs.module.css.mjs +1 -2
- package/dist/components/overlays/CommandPalette/CommandPalette.cjs.js +1 -1
- package/dist/components/overlays/CommandPalette/CommandPalette.mjs +206 -206
- package/dist/components/overlays/CommandPalette/CommandPalette.module.css.mjs +1 -2
- package/dist/components/overlays/CommandPalette/CommandPaletteContext.cjs.js +1 -1
- package/dist/components/overlays/CommandPalette/CommandPaletteContext.mjs +2 -2
- package/dist/components/overlays/CommandPalette/CommandPaletteParts.cjs.js +1 -1
- package/dist/components/overlays/CommandPalette/CommandPaletteParts.mjs +104 -104
- package/dist/components/overlays/CommandPalette/commandPaletteUtils.cjs.js +1 -1
- package/dist/components/overlays/CommandPalette/commandPaletteUtils.mjs +62 -60
- package/dist/components/overlays/Drawer/Drawer.cjs.js +1 -1
- package/dist/components/overlays/Drawer/Drawer.mjs +31 -31
- package/dist/components/overlays/Drawer/Drawer.module.css.mjs +1 -2
- package/dist/components/overlays/Drawer/DrawerContent.cjs.js +1 -1
- package/dist/components/overlays/Drawer/DrawerContent.mjs +99 -99
- package/dist/components/overlays/Drawer/DrawerContext.cjs.js +1 -1
- package/dist/components/overlays/Drawer/DrawerContext.mjs +2 -2
- package/dist/components/overlays/Drawer/DrawerParts.cjs.js +1 -1
- package/dist/components/overlays/Drawer/DrawerParts.mjs +18 -18
- package/dist/components/overlays/Drawer/internal.mjs +1 -2
- package/dist/components/overlays/Drawer/useDragToClose.cjs.js +1 -1
- package/dist/components/overlays/Drawer/useDragToClose.mjs +2 -2
- package/dist/components/overlays/HoverCard/HoverCard.cjs.js +1 -1
- package/dist/components/overlays/HoverCard/HoverCard.mjs +31 -31
- package/dist/components/overlays/HoverCard/HoverCard.module.css.mjs +1 -2
- package/dist/components/overlays/Modal/ConfirmModal.cjs.js +1 -1
- package/dist/components/overlays/Modal/ConfirmModal.mjs +21 -23
- package/dist/components/overlays/Modal/Modal.cjs.js +1 -1
- package/dist/components/overlays/Modal/Modal.mjs +47 -47
- package/dist/components/overlays/Modal/Modal.module.css.mjs +1 -2
- package/dist/components/overlays/Modal/ModalContent.cjs.js +1 -1
- package/dist/components/overlays/Modal/ModalContent.mjs +24 -24
- package/dist/components/overlays/Modal/ModalContext.cjs.js +1 -1
- package/dist/components/overlays/Modal/ModalContext.mjs +2 -2
- package/dist/components/overlays/Modal/useScrollRegion.cjs.js +1 -1
- package/dist/components/overlays/Modal/useScrollRegion.mjs +2 -2
- package/dist/components/overlays/Popover/Popover.cjs.js +1 -1
- package/dist/components/overlays/Popover/Popover.mjs +40 -40
- package/dist/components/overlays/Popover/Popover.module.css.mjs +1 -2
- package/dist/components/overlays/Popover/PopoverContent.cjs.js +1 -1
- package/dist/components/overlays/Popover/PopoverContent.mjs +39 -39
- package/dist/components/overlays/Popover/PopoverContext.cjs.js +1 -1
- package/dist/components/overlays/Popover/PopoverContext.mjs +2 -2
- package/dist/components/overlays/Tooltip/Tooltip.cjs.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.mjs +100 -95
- package/dist/components/overlays/Tooltip/Tooltip.module.css.mjs +1 -2
- package/dist/components/primitives/Button/Button.cjs.js +1 -1
- package/dist/components/primitives/Button/Button.mjs +59 -63
- package/dist/components/primitives/Button/Button.module.css.mjs +1 -2
- package/dist/components/primitives/Icon/Icon.cjs.js +1 -1
- package/dist/components/primitives/Icon/Icon.mjs +5 -6
- package/dist/components/primitives/Icon/Icon.module.css.mjs +1 -2
- package/dist/components/primitives/Icon/IconSvg.mjs +1 -2
- package/dist/components/primitives/Icon/icons.mjs +1 -2
- package/dist/components/primitives/Kbd/Kbd.cjs.js +1 -1
- package/dist/components/primitives/Kbd/Kbd.mjs +30 -30
- package/dist/components/primitives/Kbd/Kbd.module.css.mjs +1 -2
- package/dist/components/primitives/Typography/Typography.mjs +1 -2
- package/dist/components/primitives/Typography/Typography.module.css.mjs +1 -2
- package/dist/components/utilities/LocaleProvider/LocaleProvider.cjs.js +1 -1
- package/dist/components/utilities/LocaleProvider/LocaleProvider.mjs +11 -11
- package/dist/components/utilities/LocaleProvider/LocaleProvider.module.css.mjs +1 -2
- package/dist/components/utilities/Portal/Portal.cjs.js +1 -1
- package/dist/components/utilities/Portal/Portal.mjs +2 -2
- package/dist/components/utilities/Theme/Theme.cjs.js +1 -1
- package/dist/components/utilities/Theme/Theme.mjs +13 -13
- package/dist/components/utilities/Theme/Theme.module.css.mjs +1 -2
- package/dist/components/utilities/VisuallyHidden/VisuallyHidden.mjs +1 -2
- package/dist/components/utilities/VisuallyHidden/VisuallyHidden.module.css.mjs +1 -2
- package/dist/hooks/elementSource.cjs.js +1 -1
- package/dist/hooks/elementSource.mjs +4 -3
- package/dist/hooks/useClipboard.cjs.js +1 -1
- package/dist/hooks/useClipboard.mjs +2 -2
- package/dist/hooks/useControllableState.cjs.js +1 -1
- package/dist/hooks/useControllableState.mjs +2 -2
- package/dist/hooks/useDisclosure.cjs.js +1 -1
- package/dist/hooks/useDisclosure.mjs +2 -2
- package/dist/hooks/useDismiss.cjs.js +1 -1
- package/dist/hooks/useDismiss.mjs +2 -2
- package/dist/hooks/useElementObservers.cjs.js +1 -1
- package/dist/hooks/useElementObservers.mjs +2 -2
- package/dist/hooks/useEnvironment.cjs.js +1 -1
- package/dist/hooks/useEnvironment.mjs +2 -2
- package/dist/hooks/useFloatingPosition.cjs.js +1 -1
- package/dist/hooks/useFloatingPosition.mjs +2 -2
- package/dist/hooks/useFocusTrap.cjs.js +1 -1
- package/dist/hooks/useFocusTrap.mjs +4 -15
- package/dist/hooks/useFormReset.cjs.js +1 -1
- package/dist/hooks/useFormReset.mjs +2 -2
- package/dist/hooks/useFormValidation.cjs.js +1 -1
- package/dist/hooks/useFormValidation.mjs +2 -2
- package/dist/hooks/useHotkeys.cjs.js +1 -1
- package/dist/hooks/useHotkeys.mjs +2 -2
- package/dist/hooks/useInertOutside.cjs.js +1 -1
- package/dist/hooks/useInertOutside.mjs +5 -9
- package/dist/hooks/useMediaQuery.cjs.js +1 -1
- package/dist/hooks/useMediaQuery.mjs +2 -2
- package/dist/hooks/useMergedRef.cjs.js +1 -1
- package/dist/hooks/useMergedRef.mjs +2 -2
- package/dist/hooks/useOverlayLayer.cjs.js +1 -1
- package/dist/hooks/useOverlayLayer.mjs +3 -3
- package/dist/hooks/useResponsiveValue.cjs.js +1 -1
- package/dist/hooks/useResponsiveValue.mjs +2 -2
- package/dist/hooks/useScrollLock.cjs.js +1 -1
- package/dist/hooks/useScrollLock.mjs +2 -2
- package/dist/hooks/useStorage.cjs.js +1 -1
- package/dist/hooks/useStorage.mjs +2 -2
- package/dist/hooks/useTiming.cjs.js +1 -1
- package/dist/hooks/useTiming.mjs +10 -15
- package/dist/hooks/useVirtualizer.cjs.js +1 -1
- package/dist/hooks/useVirtualizer.d.ts +13 -0
- package/dist/hooks/useVirtualizer.mjs +93 -54
- package/dist/i18n/en.cjs.js +1 -1
- package/dist/i18n/en.mjs +194 -4
- package/dist/i18n/merge.mjs +1 -2
- package/dist/i18n/plural.mjs +1 -2
- package/dist/i18n/types.d.ts +240 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +114 -114
- package/dist/locales/ar.cjs.js +1 -1
- package/dist/locales/ar.mjs +230 -4
- package/dist/locales/bn.cjs.js +1 -1
- package/dist/locales/bn.mjs +167 -4
- package/dist/locales/cs.cjs.js +1 -1
- package/dist/locales/cs.mjs +212 -4
- package/dist/locales/da.cjs.js +1 -1
- package/dist/locales/da.mjs +194 -4
- package/dist/locales/de.cjs.js +1 -1
- package/dist/locales/de.mjs +194 -4
- package/dist/locales/el.cjs.js +1 -1
- package/dist/locales/el.mjs +194 -4
- package/dist/locales/es.cjs.js +1 -1
- package/dist/locales/es.mjs +194 -4
- package/dist/locales/fa.cjs.js +1 -1
- package/dist/locales/fa.mjs +167 -4
- package/dist/locales/fi.cjs.js +1 -1
- package/dist/locales/fi.mjs +194 -4
- package/dist/locales/fr.cjs.js +1 -1
- package/dist/locales/fr.mjs +194 -4
- package/dist/locales/he.cjs.js +1 -1
- package/dist/locales/he.mjs +203 -4
- package/dist/locales/hi.cjs.js +1 -1
- package/dist/locales/hi.mjs +194 -4
- package/dist/locales/hu.cjs.js +1 -1
- package/dist/locales/hu.mjs +167 -4
- package/dist/locales/id.cjs.js +1 -1
- package/dist/locales/id.mjs +167 -4
- package/dist/locales/it.cjs.js +1 -1
- package/dist/locales/it.mjs +194 -4
- package/dist/locales/ja.cjs.js +1 -1
- package/dist/locales/ja.mjs +167 -4
- package/dist/locales/ko.cjs.js +1 -1
- package/dist/locales/ko.mjs +167 -4
- package/dist/locales/nb.cjs.js +1 -1
- package/dist/locales/nb.mjs +194 -4
- package/dist/locales/nl.cjs.js +1 -1
- package/dist/locales/nl.mjs +194 -4
- package/dist/locales/pl.cjs.js +1 -1
- package/dist/locales/pl.mjs +212 -4
- package/dist/locales/pt-BR.cjs.js +1 -1
- package/dist/locales/pt-BR.mjs +194 -4
- package/dist/locales/ro.cjs.js +1 -1
- package/dist/locales/ro.mjs +203 -4
- package/dist/locales/ru.cjs.js +1 -1
- package/dist/locales/ru.mjs +212 -4
- package/dist/locales/sv.cjs.js +1 -1
- package/dist/locales/sv.mjs +194 -4
- package/dist/locales/th.cjs.js +1 -1
- package/dist/locales/th.mjs +167 -4
- package/dist/locales/tr.cjs.js +1 -1
- package/dist/locales/tr.mjs +167 -4
- package/dist/locales/uk.cjs.js +1 -1
- package/dist/locales/uk.mjs +212 -4
- package/dist/locales/ur.cjs.js +1 -1
- package/dist/locales/ur.mjs +194 -4
- package/dist/locales/vi.cjs.js +1 -1
- package/dist/locales/vi.mjs +167 -4
- package/dist/locales/zh-Hans.cjs.js +1 -1
- package/dist/locales/zh-Hans.mjs +167 -4
- package/dist/locales/zh-Hant.cjs.js +1 -1
- package/dist/locales/zh-Hant.mjs +167 -4
- package/dist/types/common.mjs +1 -2
- package/dist/utils/announce.cjs.js +1 -1
- package/dist/utils/announce.mjs +3 -4
- package/dist/utils/brandPalette.mjs +1 -2
- package/dist/utils/clipboard.mjs +1 -2
- package/dist/utils/cx.mjs +1 -2
- package/dist/utils/fillSlot.cjs.js +1 -1
- package/dist/utils/fillSlot.mjs +2 -2
- package/dist/utils/flattenChildren.mjs +1 -2
- package/dist/utils/hotkeys.mjs +1 -2
- package/dist/utils/intl.cjs.js +1 -0
- package/dist/utils/intl.d.ts +10 -0
- package/dist/utils/intl.mjs +15 -0
- package/dist/utils/refs.mjs +1 -2
- package/dist/utils/responsive.mjs +1 -2
- package/dist/utils/slot.mjs +1 -2
- package/dist/utils/validators.mjs +1 -2
- package/dist/vjdesigns-ui.css +1 -1
- package/dist/vjdesigns-ui.css.d.ts +2 -0
- package/package.json +103 -90
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
import { cx as
|
|
3
|
-
import { VisuallyHidden as
|
|
4
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e } from "../../../utils/cx.mjs";
|
|
3
|
+
import { VisuallyHidden as t } from "../../utilities/VisuallyHidden/VisuallyHidden.mjs";
|
|
4
|
+
import n from "./Skeleton.module.css.mjs";
|
|
5
|
+
import { useMessages as r } from "../../utilities/LocaleProvider/LocaleProvider.mjs";
|
|
5
6
|
import { useEffect as i, useState as a } from "react";
|
|
6
7
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
+
// src/components/feedback/Skeleton/Skeleton.tsx
|
|
8
9
|
var l = {
|
|
9
|
-
rect:
|
|
10
|
-
text:
|
|
11
|
-
circle:
|
|
12
|
-
pill:
|
|
10
|
+
rect: n.rect,
|
|
11
|
+
text: n.text,
|
|
12
|
+
circle: n.circle,
|
|
13
|
+
pill: n.pill
|
|
13
14
|
}, u = {
|
|
14
|
-
pulse:
|
|
15
|
-
shimmer:
|
|
15
|
+
pulse: n.pulse,
|
|
16
|
+
shimmer: n.shimmer,
|
|
16
17
|
none: ""
|
|
17
18
|
}, d = {
|
|
18
|
-
none:
|
|
19
|
-
xs:
|
|
20
|
-
sm:
|
|
21
|
-
md:
|
|
22
|
-
lg:
|
|
23
|
-
xl:
|
|
24
|
-
"2xl":
|
|
25
|
-
pill:
|
|
19
|
+
none: n.radiusNone,
|
|
20
|
+
xs: n.radiusXs,
|
|
21
|
+
sm: n.radiusSm,
|
|
22
|
+
md: n.radiusMd,
|
|
23
|
+
lg: n.radiusLg,
|
|
24
|
+
xl: n.radiusXl,
|
|
25
|
+
"2xl": n.radius2xl,
|
|
26
|
+
pill: n.radiusPill
|
|
26
27
|
}, f = (e) => e === void 0 ? void 0 : typeof e == "number" ? `${e}px` : e, p = (e, t) => {
|
|
27
28
|
let n = {}, r = f(e), i = f(t);
|
|
28
29
|
return r !== void 0 && (n["--_skeleton-width"] = r), i !== void 0 && (n["--_skeleton-height"] = i), n;
|
|
@@ -41,81 +42,81 @@ var l = {
|
|
|
41
42
|
t,
|
|
42
43
|
n
|
|
43
44
|
]), r;
|
|
44
|
-
}, h = ({ message: e }) => /* @__PURE__ */ s(
|
|
45
|
+
}, h = ({ message: e }) => /* @__PURE__ */ s(t, {
|
|
45
46
|
role: "status",
|
|
46
47
|
"aria-live": "polite",
|
|
47
48
|
"aria-atomic": "true",
|
|
48
49
|
children: e
|
|
49
|
-
}), g = ({ variant:
|
|
50
|
+
}), g = ({ variant: t = "rect", width: r, height: i, radius: a, animation: f = "pulse", loading: g = !0, inline: _ = !1, loadingLabel: v, loadedLabel: y, children: b, className: x, style: S, ref: C, ...w }) => {
|
|
50
51
|
let T = b != null && b !== !1, E = T && v !== void 0, D = m(E && g, v ?? "", E ? y : void 0);
|
|
51
52
|
if (!T) return g ? /* @__PURE__ */ s("span", {
|
|
52
53
|
"aria-hidden": "true",
|
|
53
54
|
...w,
|
|
54
55
|
ref: C,
|
|
55
|
-
className:
|
|
56
|
+
className: e(n.root, l[t], u[f], a && d[a], x),
|
|
56
57
|
style: {
|
|
57
|
-
...p(
|
|
58
|
+
...p(r, i),
|
|
58
59
|
...S
|
|
59
60
|
},
|
|
60
|
-
"data-variant":
|
|
61
|
+
"data-variant": t
|
|
61
62
|
}) : null;
|
|
62
63
|
let O = /* @__PURE__ */ c("div", {
|
|
63
64
|
"aria-busy": g || void 0,
|
|
64
65
|
...w,
|
|
65
66
|
ref: C,
|
|
66
|
-
className:
|
|
67
|
+
className: e(n.wrapper, _ && n.wrapperInline, g && n.wrapperLoading, x),
|
|
67
68
|
style: {
|
|
68
|
-
...p(
|
|
69
|
+
...p(r, i),
|
|
69
70
|
...S
|
|
70
71
|
},
|
|
71
72
|
"data-loading": g ? "" : void 0,
|
|
72
73
|
children: [/* @__PURE__ */ s("div", {
|
|
73
|
-
className:
|
|
74
|
+
className: e(n.content, g && n.hiddenContent),
|
|
74
75
|
inert: g,
|
|
75
76
|
"aria-hidden": g || void 0,
|
|
76
77
|
children: b
|
|
77
78
|
}), g && /* @__PURE__ */ s("span", {
|
|
78
79
|
"aria-hidden": "true",
|
|
79
|
-
className:
|
|
80
|
+
className: e(n.root, n.overlay, t === "circle" && n.radiusRound, t === "pill" && n.radiusPill, u[f], a && d[a])
|
|
80
81
|
})]
|
|
81
82
|
});
|
|
82
83
|
return E ? /* @__PURE__ */ c(o, { children: [O, /* @__PURE__ */ s(h, { message: D })] }) : O;
|
|
83
84
|
}, _ = {
|
|
84
|
-
xs:
|
|
85
|
-
sm:
|
|
86
|
-
md:
|
|
87
|
-
lg:
|
|
88
|
-
xl:
|
|
89
|
-
"2xl":
|
|
90
|
-
"3xl":
|
|
91
|
-
"4xl":
|
|
92
|
-
"5xl":
|
|
93
|
-
"6xl":
|
|
85
|
+
xs: n.sizeXs,
|
|
86
|
+
sm: n.sizeSm,
|
|
87
|
+
md: n.sizeMd,
|
|
88
|
+
lg: n.sizeLg,
|
|
89
|
+
xl: n.sizeXl,
|
|
90
|
+
"2xl": n.size2xl,
|
|
91
|
+
"3xl": n.size3xl,
|
|
92
|
+
"4xl": n.size4xl,
|
|
93
|
+
"5xl": n.size5xl,
|
|
94
|
+
"6xl": n.size6xl
|
|
94
95
|
}, v = {
|
|
95
|
-
tight:
|
|
96
|
-
snug:
|
|
97
|
-
normal:
|
|
98
|
-
relaxed:
|
|
96
|
+
tight: n.leadingTight,
|
|
97
|
+
snug: n.leadingSnug,
|
|
98
|
+
normal: n.leadingNormal,
|
|
99
|
+
relaxed: n.leadingRelaxed
|
|
99
100
|
}, y = {
|
|
100
|
-
0:
|
|
101
|
-
1:
|
|
102
|
-
2:
|
|
103
|
-
3:
|
|
104
|
-
4:
|
|
105
|
-
5:
|
|
106
|
-
6:
|
|
107
|
-
8:
|
|
108
|
-
10:
|
|
109
|
-
12:
|
|
110
|
-
16:
|
|
111
|
-
20:
|
|
112
|
-
24:
|
|
113
|
-
}, b = ({ lines:
|
|
114
|
-
let m = Math.max(1, Math.floor(
|
|
101
|
+
0: n.gap0,
|
|
102
|
+
1: n.gap1,
|
|
103
|
+
2: n.gap2,
|
|
104
|
+
3: n.gap3,
|
|
105
|
+
4: n.gap4,
|
|
106
|
+
5: n.gap5,
|
|
107
|
+
6: n.gap6,
|
|
108
|
+
8: n.gap8,
|
|
109
|
+
10: n.gap10,
|
|
110
|
+
12: n.gap12,
|
|
111
|
+
16: n.gap16,
|
|
112
|
+
20: n.gap20,
|
|
113
|
+
24: n.gap24
|
|
114
|
+
}, b = ({ lines: t = 3, lastLineWidth: r, width: i, size: a = "md", leading: o = "normal", gap: c = 0, animation: l = "pulse", className: u, style: d, ...f }) => {
|
|
115
|
+
let m = Math.max(1, Math.floor(t)), h = r ?? (m > 1 ? "60%" : void 0);
|
|
115
116
|
return /* @__PURE__ */ s("span", {
|
|
116
117
|
"aria-hidden": "true",
|
|
117
118
|
...f,
|
|
118
|
-
className:
|
|
119
|
+
className: e(n.textBlock, _[a], v[o], y[c], u),
|
|
119
120
|
style: {
|
|
120
121
|
...p(i, void 0),
|
|
121
122
|
...d
|
|
@@ -128,30 +129,29 @@ var l = {
|
|
|
128
129
|
}, t))
|
|
129
130
|
});
|
|
130
131
|
}, x = {
|
|
131
|
-
xs:
|
|
132
|
-
sm:
|
|
133
|
-
md:
|
|
134
|
-
lg:
|
|
135
|
-
xl:
|
|
136
|
-
"2xl":
|
|
132
|
+
xs: n.avatarXs,
|
|
133
|
+
sm: n.avatarSm,
|
|
134
|
+
md: n.avatarMd,
|
|
135
|
+
lg: n.avatarLg,
|
|
136
|
+
xl: n.avatarXl,
|
|
137
|
+
"2xl": n.avatar2xl
|
|
137
138
|
}, S = {
|
|
138
|
-
circle:
|
|
139
|
-
rounded:
|
|
140
|
-
square:
|
|
141
|
-
}, C = ({ size:
|
|
139
|
+
circle: n.radiusRound,
|
|
140
|
+
rounded: n.radiusMd,
|
|
141
|
+
square: n.radiusSm
|
|
142
|
+
}, C = ({ size: t = "md", shape: r = "circle", animation: i = "pulse", className: a, ...o }) => /* @__PURE__ */ s("span", {
|
|
142
143
|
"aria-hidden": "true",
|
|
143
144
|
...o,
|
|
144
|
-
className:
|
|
145
|
+
className: e(n.root, n.avatar, x[t], S[r], u[i], a)
|
|
145
146
|
}), w = (e) => /* @__PURE__ */ s(C, {
|
|
146
147
|
...e,
|
|
147
148
|
shape: "circle"
|
|
148
|
-
}), T = ({ loading:
|
|
149
|
-
let l =
|
|
149
|
+
}), T = ({ loading: e = !0, label: t, loadedLabel: n, children: i, ...a }) => {
|
|
150
|
+
let l = r(), u = m(e, t ?? l.skeleton.loading, n);
|
|
150
151
|
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", {
|
|
151
|
-
"aria-busy":
|
|
152
|
+
"aria-busy": e || void 0,
|
|
152
153
|
...a,
|
|
153
154
|
children: i
|
|
154
155
|
}), /* @__PURE__ */ s(h, { message: u })] });
|
|
155
156
|
};
|
|
156
|
-
//#endregion
|
|
157
157
|
export { g as Skeleton, C as SkeletonAvatar, w as SkeletonCircle, T as SkeletonGroup, b as SkeletonText };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/feedback/Skeleton/Skeleton.module.css
|
|
2
2
|
var e = "_root_1vcl4_17", t = "_rect_1vcl4_55", n = "_text_1vcl4_65", r = "_circle_1vcl4_77", i = "_pill_1vcl4_91", a = "_radiusNone_1vcl4_105", o = "_radiusXs_1vcl4_111", s = "_radiusSm_1vcl4_117", c = "_radiusMd_1vcl4_123", l = "_radiusLg_1vcl4_129", u = "_radiusXl_1vcl4_135", d = "_radius2xl_1vcl4_141", f = "_radiusPill_1vcl4_147", p = "_radiusRound_1vcl4_153", m = "_pulse_1vcl4_163", h = "_shimmer_1vcl4_191", g = "_textBlock_1vcl4_271", _ = "_sizeXs_1vcl4_285", v = "_sizeSm_1vcl4_291", y = "_sizeMd_1vcl4_297", b = "_sizeLg_1vcl4_303", x = "_sizeXl_1vcl4_309", S = "_size2xl_1vcl4_315", C = "_size3xl_1vcl4_321", w = "_size4xl_1vcl4_327", T = "_size5xl_1vcl4_333", E = "_size6xl_1vcl4_339", D = "_leadingTight_1vcl4_347", O = "_leadingSnug_1vcl4_353", k = "_leadingNormal_1vcl4_359", A = "_leadingRelaxed_1vcl4_365", j = "_gap0_1vcl4_373", M = "_gap1_1vcl4_379", N = "_gap2_1vcl4_385", P = "_gap3_1vcl4_391", F = "_gap4_1vcl4_397", I = "_gap5_1vcl4_403", L = "_gap6_1vcl4_409", R = "_gap8_1vcl4_415", z = "_gap10_1vcl4_421", B = "_gap12_1vcl4_427", V = "_gap16_1vcl4_433", H = "_gap20_1vcl4_439", U = "_gap24_1vcl4_445", W = "_avatar_1vcl4_461", G = "_avatarXs_1vcl4_471", K = "_avatarSm_1vcl4_477", q = "_avatarMd_1vcl4_483", J = "_avatarLg_1vcl4_489", Y = "_avatarXl_1vcl4_495", X = "_avatar2xl_1vcl4_501", Z = "_wrapper_1vcl4_531", Q = "_wrapperInline_1vcl4_547", $ = "_content_1vcl4_561", ee = "_hiddenContent_1vcl4_571", te = "_overlay_1vcl4_579", ne = {
|
|
3
3
|
root: e,
|
|
4
4
|
rect: t,
|
|
@@ -59,5 +59,4 @@ var e = "_root_1vcl4_17", t = "_rect_1vcl4_55", n = "_text_1vcl4_65", r = "_circ
|
|
|
59
59
|
hiddenContent: ee,
|
|
60
60
|
overlay: te
|
|
61
61
|
};
|
|
62
|
-
//#endregion
|
|
63
62
|
export { W as avatar, X as avatar2xl, J as avatarLg, q as avatarMd, K as avatarSm, Y as avatarXl, G as avatarXs, r as circle, $ as content, ne as default, j as gap0, M as gap1, z as gap10, B as gap12, V as gap16, N as gap2, H as gap20, U as gap24, P as gap3, F as gap4, I as gap5, L as gap6, R as gap8, ee as hiddenContent, k as leadingNormal, A as leadingRelaxed, O as leadingSnug, D as leadingTight, te as overlay, i as pill, m as pulse, d as radius2xl, l as radiusLg, c as radiusMd, a as radiusNone, f as radiusPill, p as radiusRound, s as radiusSm, u as radiusXl, o as radiusXs, t as rect, e as root, h as shimmer, S as size2xl, C as size3xl, w as size4xl, T as size5xl, E as size6xl, b as sizeLg, y as sizeMd, v as sizeSm, x as sizeXl, _ as sizeXs, n as text, g as textBlock, Z as wrapper, Q as wrapperInline };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("
|
|
1
|
+
"use client";const e=require("../../../utils/cx.cjs.js"),t=require("../../utilities/VisuallyHidden/VisuallyHidden.cjs.js"),n=require("./Spinner.module.css.cjs.js"),r=require("../../utilities/LocaleProvider/LocaleProvider.cjs.js");let i=require("react"),a=require("react/jsx-runtime");var o={xs:n.default.xs,sm:n.default.sm,md:n.default.md,lg:n.default.lg,xl:n.default.xl},s={inherit:n.default.toneInherit,neutral:n.default.toneNeutral,primary:n.default.tonePrimary,accent:n.default.toneAccent,success:n.default.toneSuccess,warning:n.default.toneWarning,danger:n.default.toneDanger,info:n.default.toneInfo},c={ring:n.default.ring,dots:n.default.dots,bars:n.default.bars};function l(e){let[t,n]=(0,i.useState)(e<=0);return(0,i.useEffect)(()=>{if(e<=0){n(!0);return}n(!1);let t=setTimeout(()=>n(!0),e);return()=>clearTimeout(t)},[e]),t}var u=({size:i=`md`,tone:u=`inherit`,variant:d=`ring`,thickness:f,label:p,decorative:m=!1,delay:h=0,className:g,style:_,...v})=>{let y=r.useMessages(),b=p??y.spinner.loading;if(!l(h))return null;let x=typeof i==`string`,S={};x||(S[`--_size`]=`${i}px`),f!=null&&(S[`--_thickness`]=`${f}px`);let C=Object.keys(S).length>0;return(0,a.jsxs)(`span`,{role:m?void 0:`status`,"aria-hidden":m?!0:void 0,...v,className:e.cx(n.default.root,x&&o[i],s[u],c[d],g),style:C?{...S,..._}:_,children:[(0,a.jsx)(`span`,{className:n.default.indicator,"aria-hidden":`true`,children:d!==`ring`&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:n.default.part}),(0,a.jsx)(`span`,{className:n.default.part}),(0,a.jsx)(`span`,{className:n.default.part})]})}),!m&&(0,a.jsx)(t.VisuallyHidden,{children:b})]})};exports.Spinner=u;
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
import { cx as
|
|
3
|
-
import { VisuallyHidden as
|
|
4
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e } from "../../../utils/cx.mjs";
|
|
3
|
+
import { VisuallyHidden as t } from "../../utilities/VisuallyHidden/VisuallyHidden.mjs";
|
|
4
|
+
import n from "./Spinner.module.css.mjs";
|
|
5
|
+
import { useMessages as r } from "../../utilities/LocaleProvider/LocaleProvider.mjs";
|
|
5
6
|
import { useEffect as i, useState as a } from "react";
|
|
6
7
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
+
// src/components/feedback/Spinner/Spinner.tsx
|
|
8
9
|
var l = {
|
|
9
|
-
xs:
|
|
10
|
-
sm:
|
|
11
|
-
md:
|
|
12
|
-
lg:
|
|
13
|
-
xl:
|
|
10
|
+
xs: n.xs,
|
|
11
|
+
sm: n.sm,
|
|
12
|
+
md: n.md,
|
|
13
|
+
lg: n.lg,
|
|
14
|
+
xl: n.xl
|
|
14
15
|
}, u = {
|
|
15
|
-
inherit:
|
|
16
|
-
neutral:
|
|
17
|
-
primary:
|
|
18
|
-
accent:
|
|
19
|
-
success:
|
|
20
|
-
warning:
|
|
21
|
-
danger:
|
|
22
|
-
info:
|
|
16
|
+
inherit: n.toneInherit,
|
|
17
|
+
neutral: n.toneNeutral,
|
|
18
|
+
primary: n.tonePrimary,
|
|
19
|
+
accent: n.toneAccent,
|
|
20
|
+
success: n.toneSuccess,
|
|
21
|
+
warning: n.toneWarning,
|
|
22
|
+
danger: n.toneDanger,
|
|
23
|
+
info: n.toneInfo
|
|
23
24
|
}, d = {
|
|
24
|
-
ring:
|
|
25
|
-
dots:
|
|
26
|
-
bars:
|
|
25
|
+
ring: n.ring,
|
|
26
|
+
dots: n.dots,
|
|
27
|
+
bars: n.bars
|
|
27
28
|
};
|
|
28
29
|
function f(e) {
|
|
29
30
|
let [t, n] = a(e <= 0);
|
|
@@ -38,7 +39,7 @@ function f(e) {
|
|
|
38
39
|
}, [e]), t;
|
|
39
40
|
}
|
|
40
41
|
var p = ({ size: i = "md", tone: a = "inherit", variant: p = "ring", thickness: m, label: h, decorative: g = !1, delay: _ = 0, className: v, style: y, ...b }) => {
|
|
41
|
-
let x =
|
|
42
|
+
let x = r(), S = h ?? x.spinner.loading;
|
|
42
43
|
if (!f(_)) return null;
|
|
43
44
|
let C = typeof i == "string", w = {};
|
|
44
45
|
C || (w["--_size"] = `${i}px`), m != null && (w["--_thickness"] = `${m}px`);
|
|
@@ -47,21 +48,20 @@ var p = ({ size: i = "md", tone: a = "inherit", variant: p = "ring", thickness:
|
|
|
47
48
|
role: g ? void 0 : "status",
|
|
48
49
|
"aria-hidden": g ? !0 : void 0,
|
|
49
50
|
...b,
|
|
50
|
-
className:
|
|
51
|
+
className: e(n.root, C && l[i], u[a], d[p], v),
|
|
51
52
|
style: T ? {
|
|
52
53
|
...w,
|
|
53
54
|
...y
|
|
54
55
|
} : y,
|
|
55
56
|
children: [/* @__PURE__ */ s("span", {
|
|
56
|
-
className:
|
|
57
|
+
className: n.indicator,
|
|
57
58
|
"aria-hidden": "true",
|
|
58
59
|
children: p !== "ring" && /* @__PURE__ */ c(o, { children: [
|
|
59
|
-
/* @__PURE__ */ s("span", { className:
|
|
60
|
-
/* @__PURE__ */ s("span", { className:
|
|
61
|
-
/* @__PURE__ */ s("span", { className:
|
|
60
|
+
/* @__PURE__ */ s("span", { className: n.part }),
|
|
61
|
+
/* @__PURE__ */ s("span", { className: n.part }),
|
|
62
|
+
/* @__PURE__ */ s("span", { className: n.part })
|
|
62
63
|
] })
|
|
63
|
-
}), !g && /* @__PURE__ */ s(
|
|
64
|
+
}), !g && /* @__PURE__ */ s(t, { children: S })]
|
|
64
65
|
});
|
|
65
66
|
};
|
|
66
|
-
//#endregion
|
|
67
67
|
export { p as Spinner };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/feedback/Spinner/Spinner.module.css
|
|
2
2
|
var e = "_root_1tf1b_17", t = "_xs_1tf1b_51", n = "_sm_1tf1b_57", r = "_md_1tf1b_63", i = "_lg_1tf1b_69", a = "_xl_1tf1b_75", o = "_toneInherit_1tf1b_85", s = "_toneNeutral_1tf1b_91", c = "_tonePrimary_1tf1b_97", l = "_toneAccent_1tf1b_103", u = "_toneSuccess_1tf1b_109", d = "_toneWarning_1tf1b_115", f = "_toneDanger_1tf1b_121", p = "_toneInfo_1tf1b_127", m = "_indicator_1tf1b_135", h = "_ring_1tf1b_153", g = "_dots_1tf1b_195", _ = "_bars_1tf1b_197", v = "_part_1tf1b_209", y = {
|
|
3
3
|
root: e,
|
|
4
4
|
xs: t,
|
|
@@ -25,5 +25,4 @@ var e = "_root_1tf1b_17", t = "_xs_1tf1b_51", n = "_sm_1tf1b_57", r = "_md_1tf1b
|
|
|
25
25
|
"spinner-track-pulse": "_spinner-track-pulse_1tf1b_1",
|
|
26
26
|
"spinner-fade": "_spinner-fade_1tf1b_1"
|
|
27
27
|
};
|
|
28
|
-
//#endregion
|
|
29
28
|
export { _ as bars, y as default, g as dots, m as indicator, i as lg, r as md, v as part, h as ring, e as root, n as sm, l as toneAccent, f as toneDanger, p as toneInfo, o as toneInherit, s as toneNeutral, c as tonePrimary, u as toneSuccess, d as toneWarning, a as xl, t as xs };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("
|
|
1
|
+
"use client";const e=require("../../../utils/cx.cjs.js"),t=require("../../primitives/Button/Button.cjs.js"),n=require("../../primitives/Icon/icons.cjs.js"),r=require("../Spinner/Spinner.cjs.js"),i=require("../../utilities/VisuallyHidden/VisuallyHidden.cjs.js"),a=require("./Toast.module.css.cjs.js"),o=require("../../utilities/LocaleProvider/LocaleProvider.cjs.js");let s=require("react/jsx-runtime");var c={neutral:a.default.neutral,info:a.default.info,success:a.default.success,warning:a.default.warning,danger:a.default.danger,loading:a.default.loading},l={neutral:(0,s.jsx)(n.BellIcon,{size:`sm`}),info:(0,s.jsx)(n.InfoIcon,{size:`sm`}),success:(0,s.jsx)(n.SuccessIcon,{size:`sm`}),warning:(0,s.jsx)(n.WarningIcon,{size:`sm`}),danger:(0,s.jsx)(n.ErrorIcon,{size:`sm`}),loading:(0,s.jsx)(r.Spinner,{size:`sm`,tone:`primary`,decorative:!0})},u=({tone:r=`neutral`,title:u,description:d,icon:f,action:p,dismissible:m=!0,onDismiss:h,closeLabel:g,toneLabel:_,progressDuration:v,progressKey:y,paused:b=!1,children:x,className:S,...C})=>{let w=o.useMessages(),T=g??w.toast.dismiss,E=f===void 0?l[r]:f,D=_??(r===`neutral`?``:w.toast.tone[r]),O=v!==void 0&&Number.isFinite(v);return(0,s.jsxs)(`div`,{...C,className:e.cx(a.default.toast,c[r],S),"data-tone":r,"aria-busy":r===`loading`||C[`aria-busy`],children:[E!=null&&(0,s.jsx)(`span`,{className:a.default.icon,"aria-hidden":`true`,children:E}),(0,s.jsxs)(`div`,{className:a.default.body,children:[u!=null&&u!==``&&(0,s.jsxs)(`p`,{className:a.default.title,children:[D&&(0,s.jsx)(i.VisuallyHidden,{children:`${D}: `}),u]}),d!=null&&d!==``&&(0,s.jsxs)(`div`,{className:a.default.description,children:[(u==null||u===``)&&D&&(0,s.jsx)(i.VisuallyHidden,{children:`${D}: `}),d]}),x,p&&(0,s.jsx)(`div`,{className:a.default.actions,children:(0,s.jsx)(t.Button,{size:`sm`,variant:`soft`,tone:`primary`,onClick:e=>{p.onClick(e),e.defaultPrevented||h?.()},children:p.label})})]}),m&&(0,s.jsx)(t.IconButton,{className:a.default.close,size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":T,onClick:()=>h?.(),children:(0,s.jsx)(n.CloseIcon,{size:`sm`})}),O&&(0,s.jsx)(`span`,{className:a.default.progressTrack,"aria-hidden":`true`,children:(0,s.jsx)(`span`,{className:a.default.progressBar,"data-paused":b||void 0,style:{animationDuration:`${v}ms`}},y)})]})};exports.Toast=u;
|
|
@@ -1,83 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
import { cx as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e } from "../../../utils/cx.mjs";
|
|
3
|
+
import { Button as t, IconButton as n } from "../../primitives/Button/Button.mjs";
|
|
4
|
+
import { BellIcon as r, CloseIcon as i, ErrorIcon as a, InfoIcon as o, SuccessIcon as s, WarningIcon as c } from "../../primitives/Icon/icons.mjs";
|
|
5
|
+
import { Spinner as l } from "../Spinner/Spinner.mjs";
|
|
6
|
+
import { VisuallyHidden as u } from "../../utilities/VisuallyHidden/VisuallyHidden.mjs";
|
|
7
|
+
import d from "./Toast.module.css.mjs";
|
|
8
|
+
import { useMessages as f } from "../../utilities/LocaleProvider/LocaleProvider.mjs";
|
|
8
9
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
|
-
|
|
10
|
+
// src/components/feedback/Toast/Toast.tsx
|
|
10
11
|
var h = {
|
|
11
|
-
neutral:
|
|
12
|
-
info:
|
|
13
|
-
success:
|
|
14
|
-
warning:
|
|
15
|
-
danger:
|
|
16
|
-
loading:
|
|
12
|
+
neutral: d.neutral,
|
|
13
|
+
info: d.info,
|
|
14
|
+
success: d.success,
|
|
15
|
+
warning: d.warning,
|
|
16
|
+
danger: d.danger,
|
|
17
|
+
loading: d.loading
|
|
17
18
|
}, g = {
|
|
18
|
-
neutral: /* @__PURE__ */ p(
|
|
19
|
-
info: /* @__PURE__ */ p(
|
|
20
|
-
success: /* @__PURE__ */ p(
|
|
21
|
-
warning: /* @__PURE__ */ p(
|
|
22
|
-
danger: /* @__PURE__ */ p(
|
|
23
|
-
loading: /* @__PURE__ */ p(
|
|
19
|
+
neutral: /* @__PURE__ */ p(r, { size: "sm" }),
|
|
20
|
+
info: /* @__PURE__ */ p(o, { size: "sm" }),
|
|
21
|
+
success: /* @__PURE__ */ p(s, { size: "sm" }),
|
|
22
|
+
warning: /* @__PURE__ */ p(c, { size: "sm" }),
|
|
23
|
+
danger: /* @__PURE__ */ p(a, { size: "sm" }),
|
|
24
|
+
loading: /* @__PURE__ */ p(l, {
|
|
24
25
|
size: "sm",
|
|
25
26
|
tone: "primary",
|
|
26
27
|
decorative: !0
|
|
27
28
|
})
|
|
28
|
-
}, _ = ({ tone: r = "neutral", title:
|
|
29
|
-
let E =
|
|
29
|
+
}, _ = ({ tone: r = "neutral", title: a, description: o, icon: s, action: c, dismissible: l = !0, onDismiss: _, closeLabel: v, toneLabel: y, progressDuration: b, progressKey: x, paused: S = !1, children: C, className: w, ...T }) => {
|
|
30
|
+
let E = f(), D = v ?? E.toast.dismiss, O = s === void 0 ? g[r] : s, k = y ?? (r === "neutral" ? "" : E.toast.tone[r]), A = b !== void 0 && Number.isFinite(b);
|
|
30
31
|
return /* @__PURE__ */ m("div", {
|
|
31
32
|
...T,
|
|
32
|
-
className:
|
|
33
|
+
className: e(d.toast, h[r], w),
|
|
33
34
|
"data-tone": r,
|
|
34
35
|
"aria-busy": r === "loading" || T["aria-busy"],
|
|
35
36
|
children: [
|
|
36
37
|
O != null && /* @__PURE__ */ p("span", {
|
|
37
|
-
className:
|
|
38
|
+
className: d.icon,
|
|
38
39
|
"aria-hidden": "true",
|
|
39
40
|
children: O
|
|
40
41
|
}),
|
|
41
42
|
/* @__PURE__ */ m("div", {
|
|
42
|
-
className:
|
|
43
|
+
className: d.body,
|
|
43
44
|
children: [
|
|
44
|
-
|
|
45
|
-
className:
|
|
46
|
-
children: [k && /* @__PURE__ */ p(
|
|
45
|
+
a != null && a !== "" && /* @__PURE__ */ m("p", {
|
|
46
|
+
className: d.title,
|
|
47
|
+
children: [k && /* @__PURE__ */ p(u, { children: `${k}: ` }), a]
|
|
47
48
|
}),
|
|
48
|
-
|
|
49
|
-
className:
|
|
50
|
-
children: [(
|
|
49
|
+
o != null && o !== "" && /* @__PURE__ */ m("div", {
|
|
50
|
+
className: d.description,
|
|
51
|
+
children: [(a == null || a === "") && k && /* @__PURE__ */ p(u, { children: `${k}: ` }), o]
|
|
51
52
|
}),
|
|
52
53
|
C,
|
|
53
|
-
|
|
54
|
-
className:
|
|
55
|
-
children: /* @__PURE__ */ p(
|
|
54
|
+
c && /* @__PURE__ */ p("div", {
|
|
55
|
+
className: d.actions,
|
|
56
|
+
children: /* @__PURE__ */ p(t, {
|
|
56
57
|
size: "sm",
|
|
57
58
|
variant: "soft",
|
|
58
59
|
tone: "primary",
|
|
59
60
|
onClick: (e) => {
|
|
60
|
-
|
|
61
|
+
c.onClick(e), e.defaultPrevented || _?.();
|
|
61
62
|
},
|
|
62
|
-
children:
|
|
63
|
+
children: c.label
|
|
63
64
|
})
|
|
64
65
|
})
|
|
65
66
|
]
|
|
66
67
|
}),
|
|
67
|
-
|
|
68
|
-
className:
|
|
68
|
+
l && /* @__PURE__ */ p(n, {
|
|
69
|
+
className: d.close,
|
|
69
70
|
size: "sm",
|
|
70
71
|
variant: "ghost",
|
|
71
72
|
tone: "neutral",
|
|
72
73
|
"aria-label": D,
|
|
73
74
|
onClick: () => _?.(),
|
|
74
|
-
children: /* @__PURE__ */ p(
|
|
75
|
+
children: /* @__PURE__ */ p(i, { size: "sm" })
|
|
75
76
|
}),
|
|
76
77
|
A && /* @__PURE__ */ p("span", {
|
|
77
|
-
className:
|
|
78
|
+
className: d.progressTrack,
|
|
78
79
|
"aria-hidden": "true",
|
|
79
80
|
children: /* @__PURE__ */ p("span", {
|
|
80
|
-
className:
|
|
81
|
+
className: d.progressBar,
|
|
81
82
|
"data-paused": S || void 0,
|
|
82
83
|
style: { animationDuration: `${b}ms` }
|
|
83
84
|
}, x)
|
|
@@ -85,5 +86,4 @@ var h = {
|
|
|
85
86
|
]
|
|
86
87
|
});
|
|
87
88
|
};
|
|
88
|
-
//#endregion
|
|
89
89
|
export { _ as Toast };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/feedback/Toast/Toast.module.css
|
|
2
2
|
var e = "_toast_bsy81_9", t = "_neutral_bsy81_55", n = "_info_bsy81_67", r = "_success_bsy81_79", i = "_warning_bsy81_91", a = "_danger_bsy81_103", o = "_loading_bsy81_117", s = "_icon_bsy81_129", c = "_body_bsy81_153", l = "_title_bsy81_171", u = "_description_bsy81_193", d = "_actions_bsy81_209", f = "_close_bsy81_223", p = "_progressTrack_bsy81_235", m = "_progressBar_bsy81_251", h = "_toastProgress_bsy81_1", g = "_viewport_bsy81_327", _ = "_topStart_bsy81_375", v = "_topCenter_bsy81_385", y = "_topEnd_bsy81_397", b = "_bottomStart_bsy81_407", x = "_bottomCenter_bsy81_417", S = "_bottomEnd_bsy81_429", C = "_list_bsy81_457", w = "_gap0_bsy81_483", T = "_gap1_bsy81_485", E = "_gap2_bsy81_487", D = "_gap3_bsy81_489", O = "_gap4_bsy81_491", k = "_gap5_bsy81_493", A = "_gap6_bsy81_495", j = "_gap8_bsy81_497", M = "_gap10_bsy81_499", N = "_gap12_bsy81_501", P = "_gap16_bsy81_503", F = "_gap20_bsy81_505", I = "_gap24_bsy81_507", L = "_item_bsy81_511", R = "_toastEnter_bsy81_1", z = "_itemInner_bsy81_539", B = "_exiting_bsy81_549", V = "_toastExit_bsy81_1", H = "_queued_bsy81_613", U = {
|
|
3
3
|
toast: e,
|
|
4
4
|
neutral: t,
|
|
@@ -44,5 +44,4 @@ var e = "_toast_bsy81_9", t = "_neutral_bsy81_55", n = "_info_bsy81_67", r = "_s
|
|
|
44
44
|
toastExit: V,
|
|
45
45
|
queued: H
|
|
46
46
|
};
|
|
47
|
-
//#endregion
|
|
48
47
|
export { d as actions, c as body, x as bottomCenter, S as bottomEnd, b as bottomStart, f as close, a as danger, U as default, u as description, B as exiting, w as gap0, T as gap1, M as gap10, N as gap12, P as gap16, E as gap2, F as gap20, I as gap24, D as gap3, O as gap4, k as gap5, A as gap6, j as gap8, s as icon, n as info, L as item, z as itemInner, C as list, o as loading, t as neutral, m as progressBar, p as progressTrack, H as queued, r as success, l as title, e as toast, R as toastEnter, V as toastExit, h as toastProgress, v as topCenter, y as topEnd, _ as topStart, g as viewport, i as warning };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../../../utils/cx.cjs.js"),t=require("./Toast.
|
|
1
|
+
"use client";const e=require("../../../utils/cx.cjs.js"),t=require("./Toast.cjs.js"),n=require("./toastTiming.cjs.js"),r=require("./Toast.module.css.cjs.js");let i=require("react"),a=require("react/jsx-runtime");var o=600,s=({record:s,store:c,paused:l,defaultDuration:u,defaultShowProgress:d,toneLabels:f,closeLabel:p,registerRef:m,onFocusedClose:h})=>{let{id:g,status:_,version:v}=s,y=(0,i.useRef)(null),b=_===`closing`,x=s.tone??`neutral`,S=s.dismissible??!0,C=n.resolveDuration(s,u),w=(0,i.useCallback)(()=>c.dismiss(g),[c,g]);n.usePausableTimer(C,l||b,v,()=>c.dismiss(g,`auto`)),(0,i.useEffect)(()=>{if(!b)return;let e=y.current;e&&e.contains(document.activeElement)&&h(g);let t=window.setTimeout(()=>c.remove(g),o);return()=>window.clearTimeout(t)},[b,g,h,c]);let T=(0,i.useCallback)(e=>{y.current=e,m(g,e)},[g,m]),E=e=>{e.key===`Escape`&&S&&!b&&(e.stopPropagation(),e.preventDefault(),w())},D=s.showProgress??d,O=f[x];return(0,a.jsx)(`li`,{ref:T,className:e.cx(r.default.item,b&&r.default.exiting),tabIndex:0,"data-toast-id":g,"data-state":_,onKeyDown:E,onAnimationEnd:e=>{b&&e.target===e.currentTarget&&c.remove(g)},children:(0,a.jsx)(`div`,{className:r.default.itemInner,children:s.render?s.render({id:g,toast:s,dismiss:w}):(0,a.jsx)(t.Toast,{tone:x,title:s.title,description:s.description,icon:s.icon,action:s.action,dismissible:S,onDismiss:w,closeLabel:p,toneLabel:O,progressDuration:D?C:void 0,paused:l,progressKey:v})})})};exports.ToastItem=s;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { cx as e } from "../../../utils/cx.mjs";
|
|
2
|
-
import t from "./Toast.
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { Toast as t } from "./Toast.mjs";
|
|
4
|
+
import { resolveDuration as n, usePausableTimer as r } from "./toastTiming.mjs";
|
|
5
|
+
import i from "./Toast.module.css.mjs";
|
|
5
6
|
import { useCallback as a, useEffect as o, useRef as s } from "react";
|
|
6
7
|
import { jsx as c } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
+
// src/components/feedback/Toast/ToastItem.tsx
|
|
8
9
|
var l = 600, u = ({ record: u, store: d, paused: f, defaultDuration: p, defaultShowProgress: m, toneLabels: h, closeLabel: g, registerRef: _, onFocusedClose: v }) => {
|
|
9
|
-
let { id: y, status: b, version: x } = u, S = s(null), C = b === "closing", w = u.tone ?? "neutral", T = u.dismissible ?? !0, E =
|
|
10
|
-
|
|
10
|
+
let { id: y, status: b, version: x } = u, S = s(null), C = b === "closing", w = u.tone ?? "neutral", T = u.dismissible ?? !0, E = n(u, p), D = a(() => d.dismiss(y), [d, y]);
|
|
11
|
+
r(E, f || C, x, () => d.dismiss(y, "auto")), o(() => {
|
|
11
12
|
if (!C) return;
|
|
12
13
|
let e = S.current;
|
|
13
14
|
e && e.contains(document.activeElement) && v(y);
|
|
@@ -26,7 +27,7 @@ var l = 600, u = ({ record: u, store: d, paused: f, defaultDuration: p, defaultS
|
|
|
26
27
|
}, A = u.showProgress ?? m, j = h[w];
|
|
27
28
|
return /* @__PURE__ */ c("li", {
|
|
28
29
|
ref: O,
|
|
29
|
-
className: e(
|
|
30
|
+
className: e(i.item, C && i.exiting),
|
|
30
31
|
tabIndex: 0,
|
|
31
32
|
"data-toast-id": y,
|
|
32
33
|
"data-state": b,
|
|
@@ -35,12 +36,12 @@ var l = 600, u = ({ record: u, store: d, paused: f, defaultDuration: p, defaultS
|
|
|
35
36
|
C && e.target === e.currentTarget && d.remove(y);
|
|
36
37
|
},
|
|
37
38
|
children: /* @__PURE__ */ c("div", {
|
|
38
|
-
className:
|
|
39
|
+
className: i.itemInner,
|
|
39
40
|
children: u.render ? u.render({
|
|
40
41
|
id: y,
|
|
41
42
|
toast: u,
|
|
42
43
|
dismiss: D
|
|
43
|
-
}) : /* @__PURE__ */ c(
|
|
44
|
+
}) : /* @__PURE__ */ c(t, {
|
|
44
45
|
tone: w,
|
|
45
46
|
title: u.title,
|
|
46
47
|
description: u.description,
|
|
@@ -57,5 +58,4 @@ var l = 600, u = ({ record: u, store: d, paused: f, defaultDuration: p, defaultS
|
|
|
57
58
|
})
|
|
58
59
|
});
|
|
59
60
|
};
|
|
60
|
-
//#endregion
|
|
61
61
|
export { u as ToastItem };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("
|
|
1
|
+
"use client";const e=require("./toastStore.cjs.js"),t=require("./useToast.cjs.js"),n=require("./ToastViewport.cjs.js"),r=require("../../utilities/LocaleProvider/LocaleProvider.cjs.js");let i=require("react"),a=require("react/jsx-runtime");var o=[`F8`],s=globalThis.process?.env?.NODE_ENV!==`production`,c=typeof window<`u`?i.useLayoutEffect:i.useEffect,l=new Map,u=new Set,d=e=>(u.add(e),()=>{u.delete(e)}),f=()=>u.forEach(e=>e());function p(e,t){let[n]=(0,i.useState)(()=>Symbol(`ToastProvider`));return c(()=>{if(t)return;let r=l.get(e)??[];return s&&r.length>0&&console.warn("[ToastProvider] Another ToastProvider already shows this store's toasts, so this one won't draw a second viewport. Use one ToastProvider near the root of your app (inside your LocaleProvider), or pass `store={createToastStore()}` to keep separate toasts."),l.set(e,[...r,n]),f(),()=>{let t=(l.get(e)??[]).filter(e=>e!==n);t.length>0?l.set(e,t):l.delete(e),f()}},[e,t,n]),(0,i.useSyncExternalStore)(d,()=>!t&&l.get(e)?.[0]===n,()=>!t)}var m=({children:s,store:c=e.toastStore,placement:l=`bottom-end`,max:u=3,duration:d=5e3,gap:f=3,label:m,hotkey:h=o,showProgress:g=!1,toneLabels:_,closeLabel:v,queuedLabel:y,className:b})=>{let x=r.useMessages(),S=p(c,(0,i.useContext)(t.ToastContext)?.store===c),C=m??x.toast.region,w=v??x.toast.dismiss,T=y??x.toast.queued,E=(0,i.useMemo)(()=>({store:c,api:c===e.toastStore?e.toast:e.createToastApi(c)}),[c]),D=(0,i.useMemo)(()=>({neutral:``,...x.toast.tone,..._}),[x.toast.tone,_]);return(0,a.jsxs)(t.ToastContext.Provider,{value:E,children:[s,S&&(0,a.jsx)(n.ToastViewport,{store:c,placement:l,max:u,duration:d,gap:f,label:C,hotkey:h,showProgress:g,toneLabels:D,closeLabel:w,queuedLabel:T,className:b})]})};exports.ToastProvider=m;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import { createToastApi as
|
|
3
|
-
import { ToastContext as
|
|
4
|
-
import { ToastViewport as
|
|
1
|
+
"use client";
|
|
2
|
+
import { createToastApi as e, toast as t, toastStore as n } from "./toastStore.mjs";
|
|
3
|
+
import { ToastContext as r } from "./useToast.mjs";
|
|
4
|
+
import { ToastViewport as i } from "./ToastViewport.mjs";
|
|
5
|
+
import { useMessages as a } from "../../utilities/LocaleProvider/LocaleProvider.mjs";
|
|
5
6
|
import { useContext as o, useEffect as s, useLayoutEffect as c, useMemo as l, useState as u, useSyncExternalStore as d } from "react";
|
|
6
7
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
+
// src/components/feedback/Toast/ToastProvider.tsx
|
|
8
9
|
var m = ["F8"], h = globalThis.process?.env?.NODE_ENV !== "production", g = typeof window < "u" ? c : s, _ = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Set(), y = (e) => (v.add(e), () => {
|
|
9
10
|
v.delete(e);
|
|
10
11
|
}), b = () => v.forEach((e) => e());
|
|
@@ -23,18 +24,18 @@ function x(e, t) {
|
|
|
23
24
|
n
|
|
24
25
|
]), d(y, () => !t && _.get(e)?.[0] === n, () => !t);
|
|
25
26
|
}
|
|
26
|
-
var S = ({ children: s, store: c =
|
|
27
|
-
let T =
|
|
27
|
+
var S = ({ children: s, store: c = n, placement: u = "bottom-end", max: d = 3, duration: h = 5e3, gap: g = 3, label: _, hotkey: v = m, showProgress: y = !1, toneLabels: b, closeLabel: S, queuedLabel: C, className: w }) => {
|
|
28
|
+
let T = a(), E = x(c, o(r)?.store === c), D = _ ?? T.toast.region, O = S ?? T.toast.dismiss, k = C ?? T.toast.queued, A = l(() => ({
|
|
28
29
|
store: c,
|
|
29
|
-
api: c ===
|
|
30
|
+
api: c === n ? t : e(c)
|
|
30
31
|
}), [c]), j = l(() => ({
|
|
31
32
|
neutral: "",
|
|
32
33
|
...T.toast.tone,
|
|
33
34
|
...b
|
|
34
35
|
}), [T.toast.tone, b]);
|
|
35
|
-
return /* @__PURE__ */ p(
|
|
36
|
+
return /* @__PURE__ */ p(r.Provider, {
|
|
36
37
|
value: A,
|
|
37
|
-
children: [s, E && /* @__PURE__ */ f(
|
|
38
|
+
children: [s, E && /* @__PURE__ */ f(i, {
|
|
38
39
|
store: c,
|
|
39
40
|
placement: u,
|
|
40
41
|
max: d,
|
|
@@ -50,5 +51,4 @@ var S = ({ children: s, store: c = r, placement: u = "bottom-end", max: d = 3, d
|
|
|
50
51
|
})]
|
|
51
52
|
});
|
|
52
53
|
};
|
|
53
|
-
//#endregion
|
|
54
54
|
export { S as ToastProvider };
|