@konstructio/ui 0.1.2-alpha.77 → 0.1.2-alpha.78
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/AdditionalOptions-C2FDVZhu.js +45 -0
- package/dist/Modal-DAWdufZ_.js +120 -0
- package/dist/assets/icons/components/Accounts.js +35 -23
- package/dist/assets/icons/components/AddChart.js +26 -20
- package/dist/assets/icons/components/AlertOutline.js +26 -20
- package/dist/assets/icons/components/AppRepo.js +26 -20
- package/dist/assets/icons/components/Apps.js +26 -20
- package/dist/assets/icons/components/Archives.js +26 -20
- package/dist/assets/icons/components/ArrowDown.js +26 -20
- package/dist/assets/icons/components/ArrowLeft.js +26 -20
- package/dist/assets/icons/components/ArrowRight.js +26 -20
- package/dist/assets/icons/components/ArrowUp.js +25 -19
- package/dist/assets/icons/components/BarChart.js +36 -24
- package/dist/assets/icons/components/BookOpen.js +30 -20
- package/dist/assets/icons/components/CalendarMonth.js +26 -20
- package/dist/assets/icons/components/Check.js +26 -20
- package/dist/assets/icons/components/CheckCircleFilled.js +29 -25
- package/dist/assets/icons/components/CheckCircleOutline.js +26 -20
- package/dist/assets/icons/components/CheckboxMarkedCircleOutline.js +24 -20
- package/dist/assets/icons/components/ClockAlert.js +26 -20
- package/dist/assets/icons/components/ClockOutline.js +26 -20
- package/dist/assets/icons/components/Close.js +26 -20
- package/dist/assets/icons/components/Cloud.js +20 -20
- package/dist/assets/icons/components/CloudLockOutline.js +26 -20
- package/dist/assets/icons/components/Clusters.js +42 -24
- package/dist/assets/icons/components/CogOutline.js +26 -20
- package/dist/assets/icons/components/Copy.js +26 -20
- package/dist/assets/icons/components/Cpu.js +39 -23
- package/dist/assets/icons/components/Cube.js +26 -20
- package/dist/assets/icons/components/Datacenter.js +26 -20
- package/dist/assets/icons/components/Delete.js +26 -20
- package/dist/assets/icons/components/DollarSign.js +28 -20
- package/dist/assets/icons/components/Download.js +26 -20
- package/dist/assets/icons/components/Edit.js +26 -20
- package/dist/assets/icons/components/Ellipses.js +26 -20
- package/dist/assets/icons/components/Environments.js +28 -20
- package/dist/assets/icons/components/Error.js +26 -20
- package/dist/assets/icons/components/ErrorOutline.js +26 -20
- package/dist/assets/icons/components/Exclamation.js +26 -20
- package/dist/assets/icons/components/Git.js +26 -20
- package/dist/assets/icons/components/GitOpsCatalog.js +39 -23
- package/dist/assets/icons/components/GridView.js +20 -20
- package/dist/assets/icons/components/Help.js +23 -25
- package/dist/assets/icons/components/HideOutline.js +35 -23
- package/dist/assets/icons/components/Home.js +26 -20
- package/dist/assets/icons/components/Home2.js +26 -20
- package/dist/assets/icons/components/Id.js +25 -19
- package/dist/assets/icons/components/InfoCircle.js +29 -25
- package/dist/assets/icons/components/InformationOutline.js +26 -20
- package/dist/assets/icons/components/InvoiceList.js +26 -20
- package/dist/assets/icons/components/Key.js +26 -20
- package/dist/assets/icons/components/LightBulb.js +41 -23
- package/dist/assets/icons/components/Loader.js +26 -20
- package/dist/assets/icons/components/Network.js +26 -20
- package/dist/assets/icons/components/PagesStack.js +23 -25
- package/dist/assets/icons/components/Pageview.js +26 -20
- package/dist/assets/icons/components/People.js +26 -20
- package/dist/assets/icons/components/PhotoLibrary.js +25 -19
- package/dist/assets/icons/components/Pipeline.js +28 -20
- package/dist/assets/icons/components/Plus.js +26 -20
- package/dist/assets/icons/components/PowerSettings.js +26 -20
- package/dist/assets/icons/components/Preview.js +26 -20
- package/dist/assets/icons/components/ReceiptLong.js +20 -20
- package/dist/assets/icons/components/Refresh.js +26 -20
- package/dist/assets/icons/components/ScatterPlot.js +20 -20
- package/dist/assets/icons/components/Search.js +30 -25
- package/dist/assets/icons/components/Server.js +26 -20
- package/dist/assets/icons/components/Start.js +26 -20
- package/dist/assets/icons/components/TabNew.js +48 -24
- package/dist/assets/icons/components/Teams.js +26 -20
- package/dist/assets/icons/components/Upload.js +25 -19
- package/dist/assets/icons/components/Warning.js +26 -20
- package/dist/assets/icons/components/WarningTriangle.js +26 -20
- package/dist/assets/icons/components/X.js +26 -20
- package/dist/components/Alert/Alert.js +61 -78
- package/dist/components/Alert/Alert.variants.js +85 -30
- package/dist/components/AlertDialog/AlertDialog.js +128 -102
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +2 -3
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/AlertDialog/hooks/useAlertDialog.js +7 -25
- package/dist/components/Autocomplete/Autocomplete.js +83 -55
- package/dist/components/Autocomplete/Autocomplete.variants.js +21 -1
- package/dist/components/Autocomplete/components/List/List.js +45 -48
- package/dist/components/Autocomplete/components/List/List.variants.js +29 -1
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +58 -74
- package/dist/components/Autocomplete/hooks/useNavigationList.js +62 -68
- package/dist/components/Badge/Badge.js +77 -66
- package/dist/components/Badge/Badge.variants.js +96 -33
- package/dist/components/Breadcrumb/Breadcrumb.js +70 -78
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +7 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +47 -33
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +63 -26
- package/dist/components/Button/Button.js +40 -37
- package/dist/components/Button/Button.variants.js +292 -96
- package/dist/components/ButtonGroup/ButtonGroup.js +138 -101
- package/dist/components/ButtonGroup/ButtonGroup.variants.js +31 -9
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +113 -105
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.js +94 -48
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.js +43 -26
- package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.js +35 -28
- package/dist/components/ButtonGroup/hooks/useButtonGroup.js +61 -63
- package/dist/components/Card/Card.js +35 -35
- package/dist/components/Card/Card.variants.js +37 -25
- package/dist/components/Checkbox/Checkbox.js +268 -247
- package/dist/components/Checkbox/Checkbox.variants.js +65 -18
- package/dist/components/Command/Command.js +38 -46
- package/dist/components/Command/Command.variants.js +44 -1
- package/dist/components/Command/components/Command.js +6 -19
- package/dist/components/Command/components/CommandEmpty.js +13 -11
- package/dist/components/Command/components/CommandGroup.js +17 -19
- package/dist/components/Command/components/CommandInput.js +52 -60
- package/dist/components/Command/components/CommandItem.js +26 -28
- package/dist/components/Command/components/CommandList.js +14 -19
- package/dist/components/Command/components/CommandSeparator.js +14 -19
- package/dist/components/Command/components/CommandShortcut.js +16 -16
- package/dist/components/Command/components/DialogContent.js +29 -35
- package/dist/components/Command/components/DialogOverlay.js +16 -18
- package/dist/components/Command/contexts/Command.provider.js +21 -23
- package/dist/components/Counter/Counter.js +154 -151
- package/dist/components/Counter/Counter.variants.js +53 -6
- package/dist/components/DateRangePicker/DateRangePicker.js +162 -93
- package/dist/components/DateRangePicker/DateRangePicker.variants.js +20 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.js +115 -81
- package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.variants.js +45 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarDivider/CalendarDivider.js +20 -14
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +57 -50
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +250 -55
- package/dist/components/DateRangePicker/components/CalendarPanel/components/NavigationButton/NavigationButton.js +37 -33
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +94 -29
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +126 -10
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +113 -138
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +16 -2
- package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +102 -68
- package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.variants.js +22 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +90 -55
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +90 -55
- package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.js +177 -204
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.js +63 -58
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.variants.js +19 -1
- package/dist/components/DateRangePicker/constants/presets.js +7 -16
- package/dist/components/DateRangePicker/contexts/date-range-picker.hook.js +3 -1
- package/dist/components/DateRangePicker/contexts/date-range-picker.provider.js +171 -187
- package/dist/components/DateRangePicker/utils/disabled-dates.js +22 -16
- package/dist/components/DateRangePicker/utils/validation.js +17 -2
- package/dist/components/Datepicker/DatePicker.js +135 -80
- package/dist/components/Divider/Divider.js +7 -18
- package/dist/components/Drawer/Drawer.js +130 -108
- package/dist/components/Drawer/Drawer.variants.js +81 -17
- package/dist/components/Drawer/components/Body/Body.js +21 -18
- package/dist/components/Drawer/components/Footer/Footer.js +23 -18
- package/dist/components/Drawer/components/Header/Header.js +24 -20
- package/dist/components/Drawer/contexts/Drawer.context.js +2 -2
- package/dist/components/Drawer/hooks/useDrawer.js +57 -81
- package/dist/components/DropdownButton/DropdownButton.js +114 -99
- package/dist/components/Filter/Filter.js +29 -40
- package/dist/components/Filter/Filter.variants.js +17 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +94 -128
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +144 -83
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +81 -87
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +120 -66
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +34 -22
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.js +117 -74
- package/dist/components/Filter/components/ResetButton/ResetButton.js +29 -24
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +135 -83
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +69 -83
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +151 -80
- package/dist/components/Filter/contexts/filter.provider.js +4 -16
- package/dist/components/Filter/events/index.js +3 -3
- package/dist/components/ImageUpload/ImageUpload.js +150 -48
- package/dist/components/ImageUpload/ImageUpload.variants.js +93 -41
- package/dist/components/Input/Input.js +168 -43
- package/dist/components/Input/Input.variants.js +51 -9
- package/dist/components/LineChart/LineChart.js +120 -83
- package/dist/components/Loading/Loading.js +18 -22
- package/dist/components/Loading/Loading.variants.js +8 -1
- package/dist/components/Modal/Modal.js +2 -3
- package/dist/components/Modal/components/Body/Body.js +5 -16
- package/dist/components/Modal/components/Footer/Footer.js +11 -16
- package/dist/components/Modal/components/Header/Header.js +11 -16
- package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -4
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +28 -1
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/Modal/contexts/Modal.context.js +3 -1
- package/dist/components/Modal/contexts/Modal.provider.js +23 -33
- package/dist/components/Modal/hooks/useModal.js +18 -29
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +32 -26
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +25 -1
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +27 -32
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +32 -13
- package/dist/components/MultiSelectDropdown/components/List/List.js +27 -26
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +21 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +123 -73
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +3 -1
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +131 -128
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +26 -30
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +6 -19
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +39 -9
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +33 -28
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +79 -21
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +41 -7
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +36 -47
- package/dist/components/PhoneNumberInput/components/Wrapper.js +503 -465
- package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +3 -1
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1135 -1163
- package/dist/components/PieChart/PieChart.js +72 -82
- package/dist/components/ProgressBar/ProgressBar.js +38 -47
- package/dist/components/ProgressBar/ProgressBar.variants.js +28 -11
- package/dist/components/Radio/Radio.js +95 -71
- package/dist/components/Radio/Radio.variants.js +85 -33
- package/dist/components/RadioCard/RadioCard.js +36 -32
- package/dist/components/RadioCardGroup/RadioCardGroup.js +43 -42
- package/dist/components/RadioGroup/RadioGroup.js +48 -48
- package/dist/components/Range/Range.js +61 -83
- package/dist/components/Range/Range.variants.js +49 -19
- package/dist/components/Select/Select.js +65 -52
- package/dist/components/Select/Select.variants.js +66 -13
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +2 -3
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.variants.js +22 -1
- package/dist/components/Select/components/EmptyList.js +3 -8
- package/dist/components/Select/components/List/List.js +168 -89
- package/dist/components/Select/components/List/List.variants.js +41 -1
- package/dist/components/Select/components/ListItem/ListItem.js +96 -41
- package/dist/components/Select/components/ListItem/ListItem.variants.js +19 -1
- package/dist/components/Select/components/Wrapper.js +233 -110
- package/dist/components/Select/components/index.js +1 -1
- package/dist/components/Select/contexts/select.provider.js +41 -34
- package/dist/components/Select/hooks/useNavigationList.js +44 -50
- package/dist/components/Select/hooks/useSelect.js +94 -104
- package/dist/components/Sidebar/Sidebar.js +21 -26
- package/dist/components/Sidebar/Sidebar.variants.js +27 -1
- package/dist/components/Sidebar/components/Footer/Footer.js +6 -18
- package/dist/components/Sidebar/components/Footer/Footer.variants.js +8 -1
- package/dist/components/Sidebar/components/Logo/Logo.js +6 -18
- package/dist/components/Sidebar/components/Logo/Logo.variants.js +19 -1
- package/dist/components/Sidebar/components/Navigation/Navigation.js +17 -26
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +24 -33
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +24 -24
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +39 -12
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +6 -17
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.js +5 -1
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +5 -20
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.js +10 -1
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +60 -21
- package/dist/components/Slider/Slider.js +56 -70
- package/dist/components/Slider/Slider.variants.js +41 -19
- package/dist/components/Spinner/Spinner.js +55 -56
- package/dist/components/Spinner/Spinner.variants.js +45 -19
- package/dist/components/Stepper/Stepper.js +72 -56
- package/dist/components/Stepper/Stepper.variants.js +188 -132
- package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +197 -151
- package/dist/components/Stepper/components/StepConnector/StepConnector.js +27 -24
- package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +20 -39
- package/dist/components/Stepper/components/StepItem/StepItem.js +6 -15
- package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +111 -93
- package/dist/components/Stepper/hooks/useStepItemLogic.js +6 -3
- package/dist/components/Switch/Switch.js +178 -135
- package/dist/components/Switch/Switch.variants.js +40 -1
- package/dist/components/Table/Table.js +25 -29
- package/dist/components/Table/Table.variants.js +30 -6
- package/dist/components/Table/components/Body.js +16 -20
- package/dist/components/Table/components/Filter.js +7 -21
- package/dist/components/Table/components/Head.js +16 -20
- package/dist/components/Table/components/Row.js +26 -28
- package/dist/components/Tabs/Tabs.js +26 -34
- package/dist/components/Tabs/Tabs.variants.js +39 -10
- package/dist/components/Tabs/components/Content.js +14 -23
- package/dist/components/Tabs/components/List.js +19 -28
- package/dist/components/Tabs/components/Trigger.js +21 -25
- package/dist/components/Tag/Tag.js +17 -33
- package/dist/components/Tag/Tag.variants.js +36 -23
- package/dist/components/TagSelect/TagSelect.js +8 -19
- package/dist/components/TagSelect/TagSelect.variants.js +22 -1
- package/dist/components/TagSelect/components/Item/Item.js +18 -24
- package/dist/components/TagSelect/components/Item/Item.variants.js +26 -13
- package/dist/components/TagSelect/components/List/List.js +9 -22
- package/dist/components/TagSelect/components/List/List.variants.js +19 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +84 -68
- package/dist/components/TagSelect/contexts/TagSelect.provider.js +65 -75
- package/dist/components/TagSelect/hooks/useTagSelect.js +26 -30
- package/dist/components/TextArea/TextArea.js +34 -35
- package/dist/components/TextArea/TextArea.variants.js +16 -1
- package/dist/components/TimePicker/TimePicker.js +11 -21
- package/dist/components/TimePicker/TimePicker.variants.js +64 -1
- package/dist/components/TimePicker/components/HoursList/HoursList.js +116 -77
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +88 -79
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +89 -66
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +228 -144
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +75 -44
- package/dist/components/TimePicker/contexts/time-picker.hook.js +3 -1
- package/dist/components/TimePicker/contexts/time-picker.provider.js +58 -76
- package/dist/components/Toast/Toast.js +338 -374
- package/dist/components/Toast/Toast.variants.js +43 -10
- package/dist/components/Tooltip/Tooltip.js +35 -36
- package/dist/components/Typography/Typography.js +23 -26
- package/dist/components/Typography/Typography.variants.js +59 -24
- package/dist/components/VirtualizedTable/VirtualizedTable.js +91 -9
- package/dist/components/VirtualizedTable/assets/chevron-down.js +23 -13
- package/dist/components/VirtualizedTable/assets/chevron-up.js +22 -12
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +115 -62
- package/dist/components/VirtualizedTable/components/Body/Body.js +83 -29
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -104
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +19 -13
- package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +49 -43
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +174 -116
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +57 -32
- package/dist/components/VirtualizedTable/components/Header/Header.js +98 -61
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +63 -65
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +102 -32
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +58 -51
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +24 -20
- package/dist/components/VirtualizedTable/contexts/table.provider.js +158 -129
- package/dist/components/VirtualizedTable/events/index.js +18 -18
- package/dist/components/index.js +1 -1
- package/dist/contexts/theme.provider.js +49 -61
- package/dist/hooks/useToggle.js +8 -10
- package/dist/index-C7zAY3xv.js +139 -0
- package/dist/{index-kTGTSLpq.js → index-Cmf-IG4l.js} +1 -1
- package/dist/{index-Dy4FVowi.js → index-CrCTywU1.js} +1 -1
- package/dist/{index-C6mt--X_.js → index-DWyM654o.js} +5 -5
- package/dist/{index-B9v5VxE2.js → index-Jr0cra7i.js} +6 -6
- package/dist/{index-CiACf4ao.js → index-mPinF0Ho.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/package.json +1 -2
- package/dist/utils/index.js +3 -1
- package/package.json +1 -2
- package/dist/AdditionalOptions-DiXvUzhu.js +0 -42
- package/dist/Modal-h5H4yxYg.js +0 -128
- package/dist/compiler-runtime-DA41awpA.js +0 -36
- package/dist/index-0g-eSmV1.js +0 -142
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { S as J } from "../../index-BvoZGpli.js";
|
|
1
|
+
import { jsx as s, jsxs as I, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
+
import { S as B } from "../../index-BvoZGpli.js";
|
|
4
3
|
import * as n from "react";
|
|
5
|
-
import { useRef as be, useEffect as ge, isValidElement as
|
|
4
|
+
import { useRef as be, useEffect as ge, useMemo as ne, isValidElement as j, useCallback as Se } from "react";
|
|
6
5
|
import * as Ne from "react-dom";
|
|
7
|
-
import { P as
|
|
8
|
-
import { u as
|
|
9
|
-
import { c as
|
|
10
|
-
import { B as
|
|
11
|
-
import { P as
|
|
12
|
-
import { u as
|
|
13
|
-
import { R as
|
|
14
|
-
import { cn as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
var
|
|
6
|
+
import { P as D, a as Ie, c as b, b as Ae, d as De, u as _e } from "../../index--l0zux8V.js";
|
|
7
|
+
import { u as ce } from "../../index-DLcqcWxM.js";
|
|
8
|
+
import { c as Fe } from "../../index-CJnS4BVW.js";
|
|
9
|
+
import { B as Le, R as Me, P as ke } from "../../index-BvEpLnOv.js";
|
|
10
|
+
import { P as Oe } from "../../index-3fEdeexs.js";
|
|
11
|
+
import { u as Y } from "../../index-0ioNhtNM.js";
|
|
12
|
+
import { R as Ve } from "../../index-BKjcReYh.js";
|
|
13
|
+
import { cn as U } from "../../utils/index.js";
|
|
14
|
+
import { closeToastVariants as Ke, toastVariants as He, viewportToastVariants as We } from "./Toast.variants.js";
|
|
15
|
+
import { CheckCircleFilledIcon as Ue } from "../../assets/icons/components/CheckCircleFilled.js";
|
|
16
|
+
import { ErrorIcon as Xe } from "../../assets/icons/components/Error.js";
|
|
17
|
+
import { WarningTriangleIcon as Ye } from "../../assets/icons/components/WarningTriangle.js";
|
|
18
|
+
import { X as $e } from "../../x-Eoa9FJjA.js";
|
|
19
|
+
var ze = Object.freeze({
|
|
21
20
|
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
22
21
|
position: "absolute",
|
|
23
22
|
border: 0,
|
|
@@ -29,142 +28,142 @@ var Xe = Object.freeze({
|
|
|
29
28
|
clip: "rect(0, 0, 0, 0)",
|
|
30
29
|
whiteSpace: "nowrap",
|
|
31
30
|
wordWrap: "normal"
|
|
32
|
-
}),
|
|
33
|
-
(
|
|
34
|
-
|
|
31
|
+
}), Be = "VisuallyHidden", Z = n.forwardRef(
|
|
32
|
+
(e, o) => /* @__PURE__ */ s(
|
|
33
|
+
D.span,
|
|
35
34
|
{
|
|
36
|
-
...
|
|
37
|
-
ref:
|
|
38
|
-
style: { ...
|
|
35
|
+
...e,
|
|
36
|
+
ref: o,
|
|
37
|
+
style: { ...ze, ...e.style }
|
|
39
38
|
}
|
|
40
39
|
)
|
|
41
40
|
);
|
|
42
|
-
|
|
43
|
-
var
|
|
41
|
+
Z.displayName = Be;
|
|
42
|
+
var ee = "ToastProvider", [te, je, qe] = Fe("Toast"), [ue] = Ae("Toast", [qe]), [Ge, $] = ue(ee), le = (e) => {
|
|
44
43
|
const {
|
|
45
|
-
__scopeToast:
|
|
44
|
+
__scopeToast: o,
|
|
46
45
|
label: r = "Notification",
|
|
47
|
-
duration:
|
|
48
|
-
swipeDirection:
|
|
49
|
-
swipeThreshold:
|
|
46
|
+
duration: t = 5e3,
|
|
47
|
+
swipeDirection: u = "right",
|
|
48
|
+
swipeThreshold: d = 50,
|
|
50
49
|
children: f
|
|
51
|
-
} =
|
|
50
|
+
} = e, [w, v] = n.useState(null), [c, E] = n.useState(0), T = n.useRef(!1), x = n.useRef(!1);
|
|
52
51
|
return r.trim() || console.error(
|
|
53
|
-
`Invalid prop \`label\` supplied to \`${
|
|
54
|
-
), /* @__PURE__ */
|
|
55
|
-
|
|
52
|
+
`Invalid prop \`label\` supplied to \`${ee}\`. Expected non-empty \`string\`.`
|
|
53
|
+
), /* @__PURE__ */ s(te.Provider, { scope: o, children: /* @__PURE__ */ s(
|
|
54
|
+
Ge,
|
|
56
55
|
{
|
|
57
|
-
scope:
|
|
56
|
+
scope: o,
|
|
58
57
|
label: r,
|
|
59
|
-
duration:
|
|
60
|
-
swipeDirection:
|
|
61
|
-
swipeThreshold:
|
|
62
|
-
toastCount:
|
|
63
|
-
viewport:
|
|
64
|
-
onViewportChange:
|
|
65
|
-
onToastAdd: n.useCallback(() =>
|
|
66
|
-
onToastRemove: n.useCallback(() =>
|
|
67
|
-
isFocusedToastEscapeKeyDownRef:
|
|
68
|
-
isClosePausedRef:
|
|
58
|
+
duration: t,
|
|
59
|
+
swipeDirection: u,
|
|
60
|
+
swipeThreshold: d,
|
|
61
|
+
toastCount: c,
|
|
62
|
+
viewport: w,
|
|
63
|
+
onViewportChange: v,
|
|
64
|
+
onToastAdd: n.useCallback(() => E((R) => R + 1), []),
|
|
65
|
+
onToastRemove: n.useCallback(() => E((R) => R - 1), []),
|
|
66
|
+
isFocusedToastEscapeKeyDownRef: T,
|
|
67
|
+
isClosePausedRef: x,
|
|
69
68
|
children: f
|
|
70
69
|
}
|
|
71
70
|
) });
|
|
72
71
|
};
|
|
73
|
-
|
|
74
|
-
var
|
|
75
|
-
(
|
|
72
|
+
le.displayName = ee;
|
|
73
|
+
var de = "ToastViewport", Je = ["F8"], G = "toast.viewportPause", J = "toast.viewportResume", fe = n.forwardRef(
|
|
74
|
+
(e, o) => {
|
|
76
75
|
const {
|
|
77
76
|
__scopeToast: r,
|
|
78
|
-
hotkey:
|
|
79
|
-
label:
|
|
80
|
-
...
|
|
81
|
-
} =
|
|
77
|
+
hotkey: t = Je,
|
|
78
|
+
label: u = "Notifications ({hotkey})",
|
|
79
|
+
...d
|
|
80
|
+
} = e, f = $(de, r), w = je(r), v = n.useRef(null), c = n.useRef(null), E = n.useRef(null), T = n.useRef(null), x = ce(o, T, f.onViewportChange), R = t.join("+").replace(/Key/g, "").replace(/Digit/g, ""), g = f.toastCount > 0;
|
|
82
81
|
n.useEffect(() => {
|
|
83
|
-
const
|
|
84
|
-
|
|
82
|
+
const a = (y) => {
|
|
83
|
+
t.length !== 0 && t.every((m) => y[m] || y.code === m) && T.current?.focus();
|
|
85
84
|
};
|
|
86
|
-
return document.addEventListener("keydown",
|
|
87
|
-
}, [
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
85
|
+
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
86
|
+
}, [t]), n.useEffect(() => {
|
|
87
|
+
const a = v.current, y = T.current;
|
|
88
|
+
if (g && a && y) {
|
|
90
89
|
const p = () => {
|
|
91
90
|
if (!f.isClosePausedRef.current) {
|
|
92
|
-
const h = new CustomEvent(
|
|
93
|
-
|
|
91
|
+
const h = new CustomEvent(G);
|
|
92
|
+
y.dispatchEvent(h), f.isClosePausedRef.current = !0;
|
|
94
93
|
}
|
|
95
94
|
}, m = () => {
|
|
96
95
|
if (f.isClosePausedRef.current) {
|
|
97
|
-
const h = new CustomEvent(
|
|
98
|
-
|
|
96
|
+
const h = new CustomEvent(J);
|
|
97
|
+
y.dispatchEvent(h), f.isClosePausedRef.current = !1;
|
|
99
98
|
}
|
|
100
|
-
},
|
|
101
|
-
!
|
|
102
|
-
},
|
|
103
|
-
|
|
99
|
+
}, P = (h) => {
|
|
100
|
+
!a.contains(h.relatedTarget) && m();
|
|
101
|
+
}, C = () => {
|
|
102
|
+
a.contains(document.activeElement) || m();
|
|
104
103
|
};
|
|
105
|
-
return
|
|
106
|
-
|
|
104
|
+
return a.addEventListener("focusin", p), a.addEventListener("focusout", P), a.addEventListener("pointermove", p), a.addEventListener("pointerleave", C), window.addEventListener("blur", p), window.addEventListener("focus", m), () => {
|
|
105
|
+
a.removeEventListener("focusin", p), a.removeEventListener("focusout", P), a.removeEventListener("pointermove", p), a.removeEventListener("pointerleave", C), window.removeEventListener("blur", p), window.removeEventListener("focus", m);
|
|
107
106
|
};
|
|
108
107
|
}
|
|
109
|
-
}, [
|
|
110
|
-
const
|
|
111
|
-
({ tabbingDirection:
|
|
112
|
-
const p =
|
|
113
|
-
const
|
|
114
|
-
return
|
|
108
|
+
}, [g, f.isClosePausedRef]);
|
|
109
|
+
const l = n.useCallback(
|
|
110
|
+
({ tabbingDirection: a }) => {
|
|
111
|
+
const p = w().map((m) => {
|
|
112
|
+
const P = m.ref.current, C = [P, ...lt(P)];
|
|
113
|
+
return a === "forwards" ? C : C.reverse();
|
|
115
114
|
});
|
|
116
|
-
return (
|
|
115
|
+
return (a === "forwards" ? p.reverse() : p).flat();
|
|
117
116
|
},
|
|
118
|
-
[
|
|
117
|
+
[w]
|
|
119
118
|
);
|
|
120
119
|
return n.useEffect(() => {
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
const
|
|
120
|
+
const a = T.current;
|
|
121
|
+
if (a) {
|
|
122
|
+
const y = (p) => {
|
|
124
123
|
const m = p.altKey || p.ctrlKey || p.metaKey;
|
|
125
124
|
if (p.key === "Tab" && !m) {
|
|
126
|
-
const
|
|
127
|
-
if (p.target ===
|
|
128
|
-
|
|
125
|
+
const C = document.activeElement, h = p.shiftKey;
|
|
126
|
+
if (p.target === a && h) {
|
|
127
|
+
c.current?.focus();
|
|
129
128
|
return;
|
|
130
129
|
}
|
|
131
|
-
const
|
|
132
|
-
|
|
130
|
+
const F = l({ tabbingDirection: h ? "backwards" : "forwards" }), V = F.findIndex((A) => A === C);
|
|
131
|
+
q(F.slice(V + 1)) ? p.preventDefault() : h ? c.current?.focus() : E.current?.focus();
|
|
133
132
|
}
|
|
134
133
|
};
|
|
135
|
-
return
|
|
134
|
+
return a.addEventListener("keydown", y), () => a.removeEventListener("keydown", y);
|
|
136
135
|
}
|
|
137
|
-
}, [
|
|
138
|
-
|
|
136
|
+
}, [w, l]), /* @__PURE__ */ I(
|
|
137
|
+
Le,
|
|
139
138
|
{
|
|
140
|
-
ref:
|
|
139
|
+
ref: v,
|
|
141
140
|
role: "region",
|
|
142
|
-
"aria-label":
|
|
141
|
+
"aria-label": u.replace("{hotkey}", R),
|
|
143
142
|
tabIndex: -1,
|
|
144
|
-
style: { pointerEvents:
|
|
143
|
+
style: { pointerEvents: g ? void 0 : "none" },
|
|
145
144
|
children: [
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
g && /* @__PURE__ */ s(
|
|
146
|
+
Q,
|
|
148
147
|
{
|
|
149
|
-
ref:
|
|
148
|
+
ref: c,
|
|
150
149
|
onFocusFromOutsideViewport: () => {
|
|
151
|
-
const
|
|
150
|
+
const a = l({
|
|
152
151
|
tabbingDirection: "forwards"
|
|
153
152
|
});
|
|
154
|
-
|
|
153
|
+
q(a);
|
|
155
154
|
}
|
|
156
155
|
}
|
|
157
156
|
),
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
/* @__PURE__ */ s(te.Slot, { scope: r, children: /* @__PURE__ */ s(D.ol, { tabIndex: -1, ...d, ref: x }) }),
|
|
158
|
+
g && /* @__PURE__ */ s(
|
|
159
|
+
Q,
|
|
161
160
|
{
|
|
162
|
-
ref:
|
|
161
|
+
ref: E,
|
|
163
162
|
onFocusFromOutsideViewport: () => {
|
|
164
|
-
const
|
|
163
|
+
const a = l({
|
|
165
164
|
tabbingDirection: "backwards"
|
|
166
165
|
});
|
|
167
|
-
|
|
166
|
+
q(a);
|
|
168
167
|
}
|
|
169
168
|
}
|
|
170
169
|
)
|
|
@@ -173,162 +172,162 @@ var fe = "ToastViewport", Ge = ["F8"], ee = "toast.viewportPause", te = "toast.v
|
|
|
173
172
|
);
|
|
174
173
|
}
|
|
175
174
|
);
|
|
176
|
-
|
|
177
|
-
var
|
|
178
|
-
(
|
|
179
|
-
const { __scopeToast: r, onFocusFromOutsideViewport:
|
|
180
|
-
return /* @__PURE__ */
|
|
181
|
-
|
|
175
|
+
fe.displayName = de;
|
|
176
|
+
var pe = "ToastFocusProxy", Q = n.forwardRef(
|
|
177
|
+
(e, o) => {
|
|
178
|
+
const { __scopeToast: r, onFocusFromOutsideViewport: t, ...u } = e, d = $(pe, r);
|
|
179
|
+
return /* @__PURE__ */ s(
|
|
180
|
+
Z,
|
|
182
181
|
{
|
|
183
182
|
tabIndex: 0,
|
|
184
|
-
...
|
|
185
|
-
ref:
|
|
183
|
+
...u,
|
|
184
|
+
ref: o,
|
|
186
185
|
style: { position: "fixed" },
|
|
187
186
|
onFocus: (f) => {
|
|
188
|
-
const
|
|
189
|
-
!
|
|
187
|
+
const w = f.relatedTarget;
|
|
188
|
+
!d.viewport?.contains(w) && t();
|
|
190
189
|
}
|
|
191
190
|
}
|
|
192
191
|
);
|
|
193
192
|
}
|
|
194
193
|
);
|
|
195
|
-
|
|
196
|
-
var
|
|
197
|
-
(
|
|
198
|
-
const { forceMount: r, open:
|
|
199
|
-
prop:
|
|
200
|
-
defaultProp:
|
|
201
|
-
onChange:
|
|
202
|
-
caller:
|
|
194
|
+
Q.displayName = pe;
|
|
195
|
+
var k = "Toast", Qe = "toast.swipeStart", Ze = "toast.swipeMove", et = "toast.swipeCancel", tt = "toast.swipeEnd", me = n.forwardRef(
|
|
196
|
+
(e, o) => {
|
|
197
|
+
const { forceMount: r, open: t, defaultOpen: u, onOpenChange: d, ...f } = e, [w, v] = Ie({
|
|
198
|
+
prop: t,
|
|
199
|
+
defaultProp: u ?? !0,
|
|
200
|
+
onChange: d,
|
|
201
|
+
caller: k
|
|
203
202
|
});
|
|
204
|
-
return /* @__PURE__ */
|
|
205
|
-
|
|
203
|
+
return /* @__PURE__ */ s(Oe, { present: r || w, children: /* @__PURE__ */ s(
|
|
204
|
+
nt,
|
|
206
205
|
{
|
|
207
|
-
open:
|
|
206
|
+
open: w,
|
|
208
207
|
...f,
|
|
209
|
-
ref:
|
|
210
|
-
onClose: () =>
|
|
211
|
-
onPause:
|
|
212
|
-
onResume:
|
|
213
|
-
onSwipeStart:
|
|
214
|
-
|
|
208
|
+
ref: o,
|
|
209
|
+
onClose: () => v(!1),
|
|
210
|
+
onPause: Y(e.onPause),
|
|
211
|
+
onResume: Y(e.onResume),
|
|
212
|
+
onSwipeStart: b(e.onSwipeStart, (c) => {
|
|
213
|
+
c.currentTarget.setAttribute("data-swipe", "start");
|
|
215
214
|
}),
|
|
216
|
-
onSwipeMove:
|
|
217
|
-
const { x:
|
|
218
|
-
|
|
215
|
+
onSwipeMove: b(e.onSwipeMove, (c) => {
|
|
216
|
+
const { x: E, y: T } = c.detail.delta;
|
|
217
|
+
c.currentTarget.setAttribute("data-swipe", "move"), c.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${E}px`), c.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${T}px`);
|
|
219
218
|
}),
|
|
220
|
-
onSwipeCancel:
|
|
221
|
-
|
|
219
|
+
onSwipeCancel: b(e.onSwipeCancel, (c) => {
|
|
220
|
+
c.currentTarget.setAttribute("data-swipe", "cancel"), c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
|
|
222
221
|
}),
|
|
223
|
-
onSwipeEnd:
|
|
224
|
-
const { x:
|
|
225
|
-
|
|
222
|
+
onSwipeEnd: b(e.onSwipeEnd, (c) => {
|
|
223
|
+
const { x: E, y: T } = c.detail.delta;
|
|
224
|
+
c.currentTarget.setAttribute("data-swipe", "end"), c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), c.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${E}px`), c.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${T}px`), v(!1);
|
|
226
225
|
})
|
|
227
226
|
}
|
|
228
227
|
) });
|
|
229
228
|
}
|
|
230
229
|
);
|
|
231
|
-
|
|
232
|
-
var [
|
|
230
|
+
me.displayName = k;
|
|
231
|
+
var [ot, rt] = ue(k, {
|
|
233
232
|
onClose() {
|
|
234
233
|
}
|
|
235
|
-
}),
|
|
236
|
-
(
|
|
234
|
+
}), nt = n.forwardRef(
|
|
235
|
+
(e, o) => {
|
|
237
236
|
const {
|
|
238
237
|
__scopeToast: r,
|
|
239
|
-
type:
|
|
240
|
-
duration:
|
|
241
|
-
open:
|
|
238
|
+
type: t = "foreground",
|
|
239
|
+
duration: u,
|
|
240
|
+
open: d,
|
|
242
241
|
onClose: f,
|
|
243
|
-
onEscapeKeyDown:
|
|
244
|
-
onPause:
|
|
245
|
-
onResume:
|
|
246
|
-
onSwipeStart:
|
|
247
|
-
onSwipeMove:
|
|
248
|
-
onSwipeCancel:
|
|
249
|
-
onSwipeEnd:
|
|
250
|
-
...
|
|
251
|
-
} =
|
|
252
|
-
|
|
253
|
-
}),
|
|
254
|
-
(
|
|
255
|
-
!
|
|
242
|
+
onEscapeKeyDown: w,
|
|
243
|
+
onPause: v,
|
|
244
|
+
onResume: c,
|
|
245
|
+
onSwipeStart: E,
|
|
246
|
+
onSwipeMove: T,
|
|
247
|
+
onSwipeCancel: x,
|
|
248
|
+
onSwipeEnd: R,
|
|
249
|
+
...g
|
|
250
|
+
} = e, l = $(k, r), [a, y] = n.useState(null), p = ce(o, (i) => y(i)), m = n.useRef(null), P = n.useRef(null), C = u || l.duration, h = n.useRef(0), _ = n.useRef(C), O = n.useRef(0), { onToastAdd: F, onToastRemove: V } = l, A = Y(() => {
|
|
251
|
+
a?.contains(document.activeElement) && l.viewport?.focus(), f();
|
|
252
|
+
}), K = n.useCallback(
|
|
253
|
+
(i) => {
|
|
254
|
+
!i || i === 1 / 0 || (window.clearTimeout(O.current), h.current = (/* @__PURE__ */ new Date()).getTime(), O.current = window.setTimeout(A, i));
|
|
256
255
|
},
|
|
257
|
-
[
|
|
256
|
+
[A]
|
|
258
257
|
);
|
|
259
258
|
n.useEffect(() => {
|
|
260
|
-
const
|
|
261
|
-
if (
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
},
|
|
265
|
-
const
|
|
266
|
-
|
|
259
|
+
const i = l.viewport;
|
|
260
|
+
if (i) {
|
|
261
|
+
const S = () => {
|
|
262
|
+
K(_.current), c?.();
|
|
263
|
+
}, N = () => {
|
|
264
|
+
const L = (/* @__PURE__ */ new Date()).getTime() - h.current;
|
|
265
|
+
_.current = _.current - L, window.clearTimeout(O.current), v?.();
|
|
267
266
|
};
|
|
268
|
-
return
|
|
269
|
-
|
|
267
|
+
return i.addEventListener(G, N), i.addEventListener(J, S), () => {
|
|
268
|
+
i.removeEventListener(G, N), i.removeEventListener(J, S);
|
|
270
269
|
};
|
|
271
270
|
}
|
|
272
|
-
}, [
|
|
273
|
-
|
|
274
|
-
}, [
|
|
275
|
-
const
|
|
276
|
-
return
|
|
277
|
-
|
|
271
|
+
}, [l.viewport, C, v, c, K]), n.useEffect(() => {
|
|
272
|
+
d && !l.isClosePausedRef.current && K(C);
|
|
273
|
+
}, [d, C, l.isClosePausedRef, K]), n.useEffect(() => (F(), () => V()), [F, V]);
|
|
274
|
+
const oe = n.useMemo(() => a ? Ce(a) : null, [a]);
|
|
275
|
+
return l.viewport ? /* @__PURE__ */ I(ie, { children: [
|
|
276
|
+
oe && /* @__PURE__ */ s(
|
|
278
277
|
st,
|
|
279
278
|
{
|
|
280
279
|
__scopeToast: r,
|
|
281
280
|
role: "status",
|
|
282
|
-
"aria-live":
|
|
283
|
-
children:
|
|
281
|
+
"aria-live": t === "foreground" ? "assertive" : "polite",
|
|
282
|
+
children: oe
|
|
284
283
|
}
|
|
285
284
|
),
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
-
|
|
285
|
+
/* @__PURE__ */ s(ot, { scope: r, onClose: A, children: Ne.createPortal(
|
|
286
|
+
/* @__PURE__ */ s(te.ItemSlot, { scope: r, children: /* @__PURE__ */ s(
|
|
287
|
+
Me,
|
|
289
288
|
{
|
|
290
289
|
asChild: !0,
|
|
291
|
-
onEscapeKeyDown:
|
|
292
|
-
|
|
290
|
+
onEscapeKeyDown: b(w, () => {
|
|
291
|
+
l.isFocusedToastEscapeKeyDownRef.current || A(), l.isFocusedToastEscapeKeyDownRef.current = !1;
|
|
293
292
|
}),
|
|
294
|
-
children: /* @__PURE__ */
|
|
295
|
-
|
|
293
|
+
children: /* @__PURE__ */ s(
|
|
294
|
+
D.li,
|
|
296
295
|
{
|
|
297
296
|
tabIndex: 0,
|
|
298
|
-
"data-state":
|
|
299
|
-
"data-swipe-direction":
|
|
300
|
-
...
|
|
297
|
+
"data-state": d ? "open" : "closed",
|
|
298
|
+
"data-swipe-direction": l.swipeDirection,
|
|
299
|
+
...g,
|
|
301
300
|
ref: p,
|
|
302
|
-
style: { userSelect: "none", touchAction: "none", ...
|
|
303
|
-
onKeyDown:
|
|
304
|
-
|
|
301
|
+
style: { userSelect: "none", touchAction: "none", ...e.style },
|
|
302
|
+
onKeyDown: b(e.onKeyDown, (i) => {
|
|
303
|
+
i.key === "Escape" && (w?.(i.nativeEvent), i.nativeEvent.defaultPrevented || (l.isFocusedToastEscapeKeyDownRef.current = !0, A()));
|
|
305
304
|
}),
|
|
306
|
-
onPointerDown:
|
|
307
|
-
|
|
305
|
+
onPointerDown: b(e.onPointerDown, (i) => {
|
|
306
|
+
i.button === 0 && (m.current = { x: i.clientX, y: i.clientY });
|
|
308
307
|
}),
|
|
309
|
-
onPointerMove:
|
|
308
|
+
onPointerMove: b(e.onPointerMove, (i) => {
|
|
310
309
|
if (!m.current) return;
|
|
311
|
-
const
|
|
312
|
-
|
|
310
|
+
const S = i.clientX - m.current.x, N = i.clientY - m.current.y, L = !!P.current, M = ["left", "right"].includes(l.swipeDirection), H = ["left", "up"].includes(l.swipeDirection) ? Math.min : Math.max, xe = M ? H(0, S) : 0, Re = M ? 0 : H(0, N), z = i.pointerType === "touch" ? 10 : 2, W = { x: xe, y: Re }, re = { originalEvent: i, delta: W };
|
|
311
|
+
L ? (P.current = W, X(Ze, T, re, {
|
|
313
312
|
discrete: !1
|
|
314
|
-
})) :
|
|
313
|
+
})) : se(W, l.swipeDirection, z) ? (P.current = W, X(Qe, E, re, {
|
|
315
314
|
discrete: !1
|
|
316
|
-
}),
|
|
315
|
+
}), i.target.setPointerCapture(i.pointerId)) : (Math.abs(S) > z || Math.abs(N) > z) && (m.current = null);
|
|
317
316
|
}),
|
|
318
|
-
onPointerUp:
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
const
|
|
322
|
-
|
|
317
|
+
onPointerUp: b(e.onPointerUp, (i) => {
|
|
318
|
+
const S = P.current, N = i.target;
|
|
319
|
+
if (N.hasPointerCapture(i.pointerId) && N.releasePointerCapture(i.pointerId), P.current = null, m.current = null, S) {
|
|
320
|
+
const L = i.currentTarget, M = { originalEvent: i, delta: S };
|
|
321
|
+
se(S, l.swipeDirection, l.swipeThreshold) ? X(tt, R, M, {
|
|
323
322
|
discrete: !0
|
|
324
|
-
}) :
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
323
|
+
}) : X(
|
|
324
|
+
et,
|
|
325
|
+
x,
|
|
326
|
+
M,
|
|
328
327
|
{
|
|
329
328
|
discrete: !0
|
|
330
329
|
}
|
|
331
|
-
),
|
|
330
|
+
), L.addEventListener("click", (H) => H.preventDefault(), {
|
|
332
331
|
once: !0
|
|
333
332
|
});
|
|
334
333
|
}
|
|
@@ -337,213 +336,178 @@ var [tt, ot] = ue(Y, {
|
|
|
337
336
|
)
|
|
338
337
|
}
|
|
339
338
|
) }),
|
|
340
|
-
|
|
339
|
+
l.viewport
|
|
341
340
|
) })
|
|
342
341
|
] }) : null;
|
|
343
342
|
}
|
|
344
|
-
), st = (
|
|
345
|
-
const { __scopeToast:
|
|
346
|
-
return
|
|
347
|
-
const
|
|
348
|
-
return () => window.clearTimeout(
|
|
349
|
-
}, []),
|
|
350
|
-
|
|
343
|
+
), st = (e) => {
|
|
344
|
+
const { __scopeToast: o, children: r, ...t } = e, u = $(k, o), [d, f] = n.useState(!1), [w, v] = n.useState(!1);
|
|
345
|
+
return ct(() => f(!0)), n.useEffect(() => {
|
|
346
|
+
const c = window.setTimeout(() => v(!0), 1e3);
|
|
347
|
+
return () => window.clearTimeout(c);
|
|
348
|
+
}, []), w ? null : /* @__PURE__ */ s(ke, { asChild: !0, children: /* @__PURE__ */ s(Z, { ...t, children: d && /* @__PURE__ */ I(ie, { children: [
|
|
349
|
+
u.label,
|
|
351
350
|
" ",
|
|
352
351
|
r
|
|
353
352
|
] }) }) });
|
|
354
|
-
},
|
|
355
|
-
(
|
|
356
|
-
const { __scopeToast: r, ...
|
|
357
|
-
return /* @__PURE__ */
|
|
353
|
+
}, at = "ToastTitle", we = n.forwardRef(
|
|
354
|
+
(e, o) => {
|
|
355
|
+
const { __scopeToast: r, ...t } = e;
|
|
356
|
+
return /* @__PURE__ */ s(D.div, { ...t, ref: o });
|
|
358
357
|
}
|
|
359
358
|
);
|
|
360
|
-
|
|
361
|
-
var
|
|
362
|
-
(
|
|
363
|
-
const { __scopeToast: r, ...
|
|
364
|
-
return /* @__PURE__ */
|
|
359
|
+
we.displayName = at;
|
|
360
|
+
var it = "ToastDescription", Te = n.forwardRef(
|
|
361
|
+
(e, o) => {
|
|
362
|
+
const { __scopeToast: r, ...t } = e;
|
|
363
|
+
return /* @__PURE__ */ s(D.div, { ...t, ref: o });
|
|
365
364
|
}
|
|
366
365
|
);
|
|
367
|
-
Te.displayName =
|
|
368
|
-
var
|
|
369
|
-
(
|
|
370
|
-
const { altText: r, ...
|
|
371
|
-
return r.trim() ? /* @__PURE__ */
|
|
372
|
-
`Invalid prop \`altText\` supplied to \`${
|
|
366
|
+
Te.displayName = it;
|
|
367
|
+
var ve = "ToastAction", Ee = n.forwardRef(
|
|
368
|
+
(e, o) => {
|
|
369
|
+
const { altText: r, ...t } = e;
|
|
370
|
+
return r.trim() ? /* @__PURE__ */ s(Pe, { altText: r, asChild: !0, children: /* @__PURE__ */ s(ye, { ...t, ref: o }) }) : (console.error(
|
|
371
|
+
`Invalid prop \`altText\` supplied to \`${ve}\`. Expected non-empty \`string\`.`
|
|
373
372
|
), null);
|
|
374
373
|
}
|
|
375
374
|
);
|
|
376
|
-
|
|
377
|
-
var
|
|
378
|
-
(
|
|
379
|
-
const { __scopeToast: r, ...
|
|
380
|
-
return /* @__PURE__ */
|
|
381
|
-
|
|
375
|
+
Ee.displayName = ve;
|
|
376
|
+
var he = "ToastClose", ye = n.forwardRef(
|
|
377
|
+
(e, o) => {
|
|
378
|
+
const { __scopeToast: r, ...t } = e, u = rt(he, r);
|
|
379
|
+
return /* @__PURE__ */ s(Pe, { asChild: !0, children: /* @__PURE__ */ s(
|
|
380
|
+
D.button,
|
|
382
381
|
{
|
|
383
382
|
type: "button",
|
|
384
|
-
...
|
|
385
|
-
ref:
|
|
386
|
-
onClick:
|
|
383
|
+
...t,
|
|
384
|
+
ref: o,
|
|
385
|
+
onClick: b(e.onClick, u.onClose)
|
|
387
386
|
}
|
|
388
387
|
) });
|
|
389
388
|
}
|
|
390
389
|
);
|
|
391
|
-
|
|
392
|
-
var Pe = n.forwardRef((
|
|
393
|
-
const { __scopeToast: r, altText:
|
|
394
|
-
return /* @__PURE__ */
|
|
395
|
-
|
|
390
|
+
ye.displayName = he;
|
|
391
|
+
var Pe = n.forwardRef((e, o) => {
|
|
392
|
+
const { __scopeToast: r, altText: t, ...u } = e;
|
|
393
|
+
return /* @__PURE__ */ s(
|
|
394
|
+
D.div,
|
|
396
395
|
{
|
|
397
396
|
"data-radix-toast-announce-exclude": "",
|
|
398
|
-
"data-radix-toast-announce-alt":
|
|
399
|
-
...
|
|
400
|
-
ref:
|
|
397
|
+
"data-radix-toast-announce-alt": t || void 0,
|
|
398
|
+
...u,
|
|
399
|
+
ref: o
|
|
401
400
|
}
|
|
402
401
|
);
|
|
403
402
|
});
|
|
404
|
-
function
|
|
405
|
-
const
|
|
406
|
-
return Array.from(
|
|
407
|
-
if (
|
|
408
|
-
const
|
|
409
|
-
if (!
|
|
410
|
-
if (
|
|
411
|
-
const f =
|
|
412
|
-
f &&
|
|
403
|
+
function Ce(e) {
|
|
404
|
+
const o = [];
|
|
405
|
+
return Array.from(e.childNodes).forEach((t) => {
|
|
406
|
+
if (t.nodeType === t.TEXT_NODE && t.textContent && o.push(t.textContent), ut(t)) {
|
|
407
|
+
const u = t.ariaHidden || t.hidden || t.style.display === "none", d = t.dataset.radixToastAnnounceExclude === "";
|
|
408
|
+
if (!u)
|
|
409
|
+
if (d) {
|
|
410
|
+
const f = t.dataset.radixToastAnnounceAlt;
|
|
411
|
+
f && o.push(f);
|
|
413
412
|
} else
|
|
414
|
-
|
|
413
|
+
o.push(...Ce(t));
|
|
415
414
|
}
|
|
416
|
-
}),
|
|
415
|
+
}), o;
|
|
417
416
|
}
|
|
418
|
-
function
|
|
419
|
-
const
|
|
420
|
-
|
|
417
|
+
function X(e, o, r, { discrete: t }) {
|
|
418
|
+
const u = r.originalEvent.currentTarget, d = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: r });
|
|
419
|
+
o && u.addEventListener(e, o, { once: !0 }), t ? De(u, d) : u.dispatchEvent(d);
|
|
421
420
|
}
|
|
422
|
-
var
|
|
423
|
-
const
|
|
424
|
-
return
|
|
421
|
+
var se = (e, o, r = 0) => {
|
|
422
|
+
const t = Math.abs(e.x), u = Math.abs(e.y), d = t > u;
|
|
423
|
+
return o === "left" || o === "right" ? d && t > r : !d && u > r;
|
|
425
424
|
};
|
|
426
|
-
function
|
|
425
|
+
function ct(e = () => {
|
|
427
426
|
}) {
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
let r = 0,
|
|
431
|
-
return r = window.requestAnimationFrame(() =>
|
|
432
|
-
window.cancelAnimationFrame(r), window.cancelAnimationFrame(
|
|
427
|
+
const o = Y(e);
|
|
428
|
+
_e(() => {
|
|
429
|
+
let r = 0, t = 0;
|
|
430
|
+
return r = window.requestAnimationFrame(() => t = window.requestAnimationFrame(o)), () => {
|
|
431
|
+
window.cancelAnimationFrame(r), window.cancelAnimationFrame(t);
|
|
433
432
|
};
|
|
434
|
-
}, [
|
|
433
|
+
}, [o]);
|
|
435
434
|
}
|
|
436
|
-
function
|
|
437
|
-
return
|
|
435
|
+
function ut(e) {
|
|
436
|
+
return e.nodeType === e.ELEMENT_NODE;
|
|
438
437
|
}
|
|
439
|
-
function lt(
|
|
440
|
-
const
|
|
441
|
-
acceptNode: (
|
|
442
|
-
const
|
|
443
|
-
return
|
|
438
|
+
function lt(e) {
|
|
439
|
+
const o = [], r = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
440
|
+
acceptNode: (t) => {
|
|
441
|
+
const u = t.tagName === "INPUT" && t.type === "hidden";
|
|
442
|
+
return t.disabled || t.hidden || u ? NodeFilter.FILTER_SKIP : t.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
444
443
|
}
|
|
445
444
|
});
|
|
446
|
-
for (; r.nextNode(); )
|
|
447
|
-
return
|
|
445
|
+
for (; r.nextNode(); ) o.push(r.currentNode);
|
|
446
|
+
return o;
|
|
448
447
|
}
|
|
449
|
-
function
|
|
450
|
-
const
|
|
451
|
-
return
|
|
448
|
+
function q(e) {
|
|
449
|
+
const o = document.activeElement;
|
|
450
|
+
return e.some((r) => r === o ? !0 : (r.focus(), document.activeElement !== o));
|
|
452
451
|
}
|
|
453
|
-
var
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
e
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
e[22] !== c || e[23] !== h ? (g = /* @__PURE__ */ a(pt, { asChild: !0, className: c, children: h }), e[22] = c, e[23] = h, e[24] = g) : g = e[24];
|
|
512
|
-
let S;
|
|
513
|
-
e[25] !== u || e[26] !== A ? (S = A && (Q(A) ? /* @__PURE__ */ a(ie, { asChild: !0, children: A }) : /* @__PURE__ */ a(ie, { className: z("text-sm", u), children: A })), e[25] = u, e[26] = A, e[27] = S) : S = e[27];
|
|
514
|
-
let I;
|
|
515
|
-
e[28] !== g || e[29] !== S ? (I = /* @__PURE__ */ U("div", { className: "flex flex-col gap-1", children: [
|
|
516
|
-
g,
|
|
517
|
-
S
|
|
518
|
-
] }), e[28] = g, e[29] = S, e[30] = I) : I = e[30];
|
|
519
|
-
let F;
|
|
520
|
-
e[31] !== k || e[32] !== s || e[33] !== x || e[34] !== I ? (F = /* @__PURE__ */ U("div", { className: "flex gap-2 items-center flex-1", children: [
|
|
521
|
-
k,
|
|
522
|
-
s,
|
|
523
|
-
x,
|
|
524
|
-
I
|
|
525
|
-
] }), e[31] = k, e[32] = s, e[33] = x, e[34] = I, e[35] = F) : F = e[35];
|
|
526
|
-
let W;
|
|
527
|
-
e[36] !== R || e[37] !== i ? (W = i && /* @__PURE__ */ a(mt, { asChild: !0, altText: "Close the toast", children: /* @__PURE__ */ U("button", { type: "button", className: "cursor-pointer", children: [
|
|
528
|
-
/* @__PURE__ */ a(We, { className: z(Ke({
|
|
529
|
-
className: R
|
|
530
|
-
})) }),
|
|
531
|
-
/* @__PURE__ */ a(ke, { children: "Close toast" })
|
|
532
|
-
] }) }), e[36] = R, e[37] = i, e[38] = W) : W = e[38];
|
|
533
|
-
let $;
|
|
534
|
-
e[39] !== C || e[40] !== b || e[41] !== D || e[42] !== F || e[43] !== W || e[44] !== T ? ($ = /* @__PURE__ */ U(ft, { className: D, "data-theme": T, open: C, onOpenChange: b, children: [
|
|
535
|
-
F,
|
|
536
|
-
W
|
|
537
|
-
] }), e[39] = C, e[40] = b, e[41] = D, e[42] = F, e[43] = W, e[44] = T, e[45] = $) : $ = e[45];
|
|
538
|
-
let B;
|
|
539
|
-
e[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ a(dt, { className: z(He()) }), e[46] = B) : B = e[46];
|
|
540
|
-
let V;
|
|
541
|
-
return e[47] !== d || e[48] !== $ || e[49] !== N ? (V = /* @__PURE__ */ U(ut, { swipeDirection: "right", duration: d, children: [
|
|
542
|
-
N,
|
|
543
|
-
$,
|
|
544
|
-
B
|
|
545
|
-
] }), e[47] = d, e[48] = $, e[49] = N, e[50] = V) : V = e[50], V;
|
|
452
|
+
var dt = le, ft = fe, pt = me, mt = we, ae = Te, wt = Ee;
|
|
453
|
+
const _t = ({
|
|
454
|
+
title: e,
|
|
455
|
+
duration: o = 5e3,
|
|
456
|
+
titleClassName: r,
|
|
457
|
+
descriptionClassName: t,
|
|
458
|
+
description: u,
|
|
459
|
+
children: d,
|
|
460
|
+
theme: f,
|
|
461
|
+
showCloseButton: w = !0,
|
|
462
|
+
closeButtonClassName: v,
|
|
463
|
+
className: c,
|
|
464
|
+
open: E = !1,
|
|
465
|
+
setOpen: T,
|
|
466
|
+
variant: x
|
|
467
|
+
}) => {
|
|
468
|
+
const R = be(0);
|
|
469
|
+
ge(() => () => clearTimeout(R.current), []);
|
|
470
|
+
const g = ne(() => j(e) ? /* @__PURE__ */ s(B, { className: r, children: e }) : e, [e, r]), l = ne(() => j(u) ? /* @__PURE__ */ s(B, { className: t, children: u }) : u, [u, t]), a = Se(() => {
|
|
471
|
+
T(!1), R.current = window.setTimeout(() => T(!0), 100);
|
|
472
|
+
}, [T]);
|
|
473
|
+
return /* @__PURE__ */ I(dt, { swipeDirection: "right", duration: o, children: [
|
|
474
|
+
/* @__PURE__ */ s(B, { onClick: a, children: d }),
|
|
475
|
+
/* @__PURE__ */ I(
|
|
476
|
+
pt,
|
|
477
|
+
{
|
|
478
|
+
className: U(He({ variant: x, className: c })),
|
|
479
|
+
"data-theme": f,
|
|
480
|
+
open: E,
|
|
481
|
+
onOpenChange: T,
|
|
482
|
+
children: [
|
|
483
|
+
/* @__PURE__ */ I("div", { className: "flex gap-2 items-center flex-1", children: [
|
|
484
|
+
x === "success" && /* @__PURE__ */ s(Ue, { size: 20, className: "shrink-0" }),
|
|
485
|
+
x === "error" && /* @__PURE__ */ s(Xe, { size: 20, className: "shrink-0" }),
|
|
486
|
+
x === "warning" && /* @__PURE__ */ s(Ye, { size: 20, className: "shrink-0" }),
|
|
487
|
+
/* @__PURE__ */ I("div", { className: "flex flex-col gap-1", children: [
|
|
488
|
+
/* @__PURE__ */ s(mt, { asChild: !0, className: r, children: g }),
|
|
489
|
+
l && (j(l) ? /* @__PURE__ */ s(ae, { asChild: !0, children: l }) : /* @__PURE__ */ s(ae, { className: U("text-sm", t), children: l }))
|
|
490
|
+
] })
|
|
491
|
+
] }),
|
|
492
|
+
w && /* @__PURE__ */ s(wt, { asChild: !0, altText: "Close the toast", children: /* @__PURE__ */ I("button", { type: "button", className: "cursor-pointer", children: [
|
|
493
|
+
/* @__PURE__ */ s(
|
|
494
|
+
$e,
|
|
495
|
+
{
|
|
496
|
+
className: U(
|
|
497
|
+
Ke({
|
|
498
|
+
className: v
|
|
499
|
+
})
|
|
500
|
+
)
|
|
501
|
+
}
|
|
502
|
+
),
|
|
503
|
+
/* @__PURE__ */ s(Ve, { children: "Close toast" })
|
|
504
|
+
] }) })
|
|
505
|
+
]
|
|
506
|
+
}
|
|
507
|
+
),
|
|
508
|
+
/* @__PURE__ */ s(ft, { className: U(We()) })
|
|
509
|
+
] });
|
|
546
510
|
};
|
|
547
511
|
export {
|
|
548
|
-
|
|
512
|
+
_t as Toast
|
|
549
513
|
};
|