@konstructio/ui 0.1.2-alpha.103 → 0.1.2-alpha.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -21
- package/dist/{AdditionalOptions-Cj29eeMF.js → AdditionalOptions-D0BAS2HG.js} +1 -1
- package/dist/{AlertDialogTrigger-CgcsW_ta.js → AlertDialogTrigger-BGo_acd5.js} +3 -3
- package/dist/{Checkbox-DzAx7n67.js → Checkbox-B_ngk9Dj.js} +56 -56
- package/dist/{Combination-cjXRJS03.js → Combination-CnMM05mt.js} +51 -45
- package/dist/{CommandInput-BnvRMfLI.js → CommandInput-BLq69pOT.js} +1 -1
- package/dist/Counter-BV680M5r.js +195 -0
- package/dist/DropdownButton-DfNojmCW.js +493 -0
- package/dist/{FlagSelectorList-BoYG-_It.js → FlagSelectorList-CkTR3j6O.js} +222 -218
- package/dist/{HamburgerTrigger-1vOTrm8-.js → HamburgerTrigger-DRylBL2d.js} +1 -1
- package/dist/{ImageUpload-DZTm4SBB.js → ImageUpload-DiwymQcU.js} +1 -1
- package/dist/{Input-CW0VwW2T.js → Input-Cf44DzfE.js} +18 -18
- package/dist/{Loading-fD0Xiyeq.js → Loading-DUh9PMJN.js} +3 -1
- package/dist/Modal-Dyn088X7.js +81 -0
- package/dist/Sidebar.css +1 -1
- package/dist/{Spinner-Lw9mZYhg.js → Spinner-CUwE2bLm.js} +1 -1
- package/dist/{Switch-WBRr8uOJ.js → Switch-aPhL5rNG.js} +4 -4
- package/dist/{Toast-ByH-l4XK.js → Toast-3NEz7LLa.js} +149 -148
- package/dist/Wrapper-BhqUVI1G.js +171 -0
- package/dist/Wrapper-CVJSuYWx.js +114 -0
- package/dist/{Wrapper-XeeD3av7.js → Wrapper-DP6Sxngx.js} +185 -180
- package/dist/components/Alert/Alert.js +21 -21
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/AlertDialog/hooks/useAlertDialog.js +14 -10
- package/dist/components/Autocomplete/components/List/List.js +22 -26
- package/dist/components/Autocomplete/components/List/List.variants.js +7 -19
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +39 -38
- package/dist/components/Autocomplete/hooks/useNavigationList.js +2 -1
- package/dist/components/Badge/Badge.js +37 -36
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +6 -6
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +1 -1
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +2 -2
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Command/components/index.js +1 -1
- package/dist/components/Command/contexts/Command.provider.js +16 -12
- package/dist/components/Counter/Counter.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +57 -58
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +42 -43
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +42 -50
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +61 -79
- package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.js +89 -122
- package/dist/components/Datepicker/DatePicker.js +13 -13
- package/dist/components/Drawer/Drawer.js +54 -49
- package/dist/components/Drawer/hooks/useDrawer.js +39 -44
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +23 -22
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +42 -56
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +30 -43
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +36 -49
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +1 -1
- package/dist/components/Filter/components/ResetButton/ResetButton.js +21 -18
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +1 -1
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +31 -45
- package/dist/components/Filter/contexts/filter.provider.js +15 -10
- package/dist/components/Filter/events/index.js +26 -5
- package/dist/components/Filter/hooks/index.js +4 -0
- package/dist/components/Filter/hooks/useFilterDropdownSync.js +26 -0
- package/dist/components/ImageUpload/ImageUpload.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Loading/Loading.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/Modal/contexts/Modal.provider.js +26 -19
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
- package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/MultiSelectDropdown/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +14 -13
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +6 -4
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +16 -16
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
- package/dist/components/PhoneNumberInput/components/index.js +2 -2
- package/dist/components/PieChart/PieChart.js +33 -32
- package/dist/components/ProgressBar/ProgressBar.js +26 -20
- package/dist/components/Radio/Radio.js +28 -30
- package/dist/components/RadioCardGroup/RadioCardGroup.js +18 -18
- package/dist/components/RadioGroup/RadioGroup.js +24 -24
- package/dist/components/Range/Range.js +15 -13
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +1 -1
- package/dist/components/Select/components/List/List.js +2 -2
- package/dist/components/Select/components/ListItem/ListItem.js +30 -30
- package/dist/components/Select/components/Wrapper.js +1 -1
- package/dist/components/Select/components/index.js +2 -2
- package/dist/components/Select/hooks/useSelect.js +39 -38
- package/dist/components/Sidebar/Sidebar.js +21 -18
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.js +30 -0
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.js +20 -0
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
- package/dist/components/Sidebar/components/Logo/Logo.js +14 -10
- package/dist/components/Sidebar/components/Logo/Logo.variants.js +14 -4
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +41 -37
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +4 -5
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +75 -68
- package/dist/components/Sidebar/components/index.js +17 -15
- package/dist/components/Sidebar/contexts/SidebarContext.js +8 -5
- package/dist/components/Slider/Slider.js +17 -15
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Stepper/Stepper.variants.js +6 -6
- package/dist/components/Stepper/hooks/useStepItemLogic.js +12 -17
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/components/Filter.js +1 -1
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +1 -1
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.variants.js +17 -17
- package/dist/components/TagSelect/TagSelect.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/TagSelect/components/index.js +1 -1
- package/dist/components/TagSelect/hooks/useTagSelect.js +12 -11
- package/dist/components/TimePicker/components/HoursList/HoursList.js +34 -38
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +25 -29
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +33 -33
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +91 -99
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +29 -30
- package/dist/components/TimePicker/contexts/time-picker.provider.js +10 -10
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/Toast/Toast.variants.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +32 -29
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +0 -2
- package/dist/components/VirtualizedTable/components/Body/Body.js +5 -5
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +55 -53
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Header/Header.js +1 -1
- package/dist/components/VirtualizedTable/contexts/index.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
- package/dist/components/VirtualizedTable/events/filters/filters.js +7 -0
- package/dist/components/VirtualizedTable/events/index.js +10 -25
- package/dist/components/VirtualizedTable/events/refresh/refresh.js +7 -0
- package/dist/components/VirtualizedTable/events/row/row.js +22 -0
- package/dist/components/VirtualizedTable/utils/get-table-id.js +4 -0
- package/dist/components/VirtualizedTable/utils/index.js +4 -2
- package/dist/components/index.js +95 -89
- package/dist/{components-BIHlj4yH.js → components-Cf345jTv.js} +45 -41
- package/dist/constants-CxJJRVK3.js +31 -0
- package/dist/{dist-DISvWx7U.js → dist-BUocnzkM.js} +1 -1
- package/dist/{dist-Dse3gSmZ.js → dist-BZNE2Tnx.js} +4 -4
- package/dist/{dist-2bGlmy8N2.js → dist-BaPW7qXd2.js} +27 -26
- package/dist/dist-BdobXn93.js +192 -0
- package/dist/dist-BlPTJNIm.js +118 -0
- package/dist/{dist-BiJrNvNo.js → dist-C3YVLapk.js} +29 -28
- package/dist/dist-C4j75TwZ.js +20 -0
- package/dist/dist-CCdbu9GU.js +46 -0
- package/dist/dist-CzKqHuqJ2.js +427 -0
- package/dist/dist-D-yS0HN8.js +228 -0
- package/dist/dist-D5XYRjmR.js +15 -0
- package/dist/dist-DDck_2lb.js +451 -0
- package/dist/{dist-C2aTw0m62.js → dist-DFCz63oC2.js} +5 -5
- package/dist/dist-DGOjiAnB2.js +14 -0
- package/dist/dist-DKryKPmP.js +193 -0
- package/dist/{dist-CTvBzxW8.js → dist-DX0sBG3Q.js} +1 -1
- package/dist/dist-DYIabsrY.js +17 -0
- package/dist/dist-pWlMx4Fi2.js +36 -0
- package/dist/{dist-CVDFmWf2.js → dist-tGUUcv8n.js} +17 -16
- package/dist/dist-xCbHbMLA.js +116 -0
- package/dist/{es2015-BWf6xQHm.js → es2015-CoHq2g4y.js} +95 -86
- package/dist/es2015-DigR3dar.js +795 -0
- package/dist/events.types-BG1Uh8i6.js +6 -0
- package/dist/hooks/index.js +6 -4
- package/dist/hooks/useClickOutside.js +14 -0
- package/dist/index.js +146 -138
- package/dist/lib/components/Autocomplete/components/List/List.variants.d.ts +0 -1
- package/dist/lib/components/DropdownButton/DropdownButton.d.ts +5 -6
- package/dist/lib/components/DropdownButton/DropdownButton.types.d.ts +2 -0
- package/dist/lib/components/Filter/Filter.types.d.ts +2 -0
- package/dist/lib/components/Filter/contexts/filter.context.d.ts +1 -0
- package/dist/lib/components/Filter/events/index.d.ts +10 -2
- package/dist/lib/components/Filter/hooks/index.d.ts +1 -0
- package/dist/lib/components/Filter/hooks/useFilterDropdownSync.d.ts +2 -0
- package/dist/lib/components/Filter/hooks/useFilterDropdownSync.types.d.ts +5 -0
- package/dist/lib/components/PieChart/PieChart.types.d.ts +4 -4
- package/dist/lib/components/ProgressBar/ProgressBar.types.d.ts +2 -0
- package/dist/lib/components/Select/hooks/useSelect.d.ts +2 -1
- package/dist/lib/components/Sidebar/Sidebar.d.ts +2 -2
- package/dist/lib/components/Sidebar/Sidebar.types.d.ts +6 -5
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.d.ts +4 -0
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.types.d.ts +4 -0
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.d.ts +1 -0
- package/dist/lib/components/Sidebar/components/Logo/Logo.types.d.ts +8 -0
- package/dist/lib/components/Sidebar/components/Logo/Logo.variants.d.ts +3 -1
- package/dist/lib/components/Sidebar/components/index.d.ts +2 -0
- package/dist/lib/components/Sidebar/contexts/SidebarContext.d.ts +12 -0
- package/dist/lib/components/VirtualizedTable/VirtualizedTable.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/events/events.types.d.ts +11 -0
- package/dist/lib/components/VirtualizedTable/events/filters/filters.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/events/index.d.ts +4 -14
- package/dist/lib/components/VirtualizedTable/events/refresh/refresh.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/events/refresh/refresh.types.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/events/row/row.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/utils/get-table-id.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/utils/index.d.ts +1 -0
- package/dist/lib/components/index.d.ts +2 -2
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/useClickOutside.d.ts +2 -0
- package/dist/package.json +24 -24
- package/dist/styles.css +1 -1
- package/dist/{table.provider-2sAkE7z_.js → table.provider-B0BafHuU.js} +395 -381
- package/dist/ui/civo-theme.css +4 -0
- package/dist/ui/kubefirst-theme.css +4 -0
- package/package.json +24 -24
- package/dist/Counter-CY0xGnVM.js +0 -208
- package/dist/DropdownButton-DnlwdPmb.js +0 -92
- package/dist/Modal-Bfzggwlr.js +0 -76
- package/dist/Wrapper-ClJ_Mham.js +0 -110
- package/dist/Wrapper-DNEn4fef.js +0 -161
- package/dist/constants-DXrF9vV4.js +0 -31
- package/dist/dist-B-Aoze_D.js +0 -10
- package/dist/dist-BuFiu480.js +0 -13
- package/dist/dist-C2s4VX-42.js +0 -31
- package/dist/dist-CT6d9xe7.js +0 -441
- package/dist/dist-CVy-ulDZ.js +0 -42
- package/dist/dist-D4FePjTS.js +0 -194
- package/dist/dist-Db6UeFo4.js +0 -291
- package/dist/dist-DqKFpce5.js +0 -98
- package/dist/dist-j7FOUrFU.js +0 -206
- package/dist/dist-l-aDnQZC.js +0 -62
- package/dist/dist-ppXKUlVt.js +0 -10
- /package/dist/{x-a_LpoXzG.js → x-a_LpoXzG2.js} +0 -0
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { t as Ce } from "./x-BI9jmc7e.js";
|
|
2
|
-
import { a as
|
|
3
|
-
import { n as
|
|
4
|
-
import { n as
|
|
2
|
+
import { a as ce, t as q } from "./dist-xCbHbMLA.js";
|
|
3
|
+
import { n as xe, t as I } from "./dist-CCdbu9GU.js";
|
|
4
|
+
import { n as ue, t as Pe } from "./dist-DX0sBG3Q.js";
|
|
5
5
|
import { t as X } from "./utils-Cx-WzRZF.js";
|
|
6
|
-
import { CheckCircleFilledIcon as
|
|
7
|
-
import { ErrorIcon as
|
|
8
|
-
import { InformationOutlineIcon as
|
|
9
|
-
import { WarningTriangleIcon as
|
|
10
|
-
import { i as
|
|
11
|
-
import { t as Y } from "./dist-
|
|
12
|
-
import {
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import {
|
|
6
|
+
import { CheckCircleFilledIcon as ye } from "./assets/icons/components/CheckCircleFilled.js";
|
|
7
|
+
import { ErrorIcon as Re } from "./assets/icons/components/Error.js";
|
|
8
|
+
import { InformationOutlineIcon as ge } from "./assets/icons/components/InformationOutline.js";
|
|
9
|
+
import { WarningTriangleIcon as be } from "./assets/icons/components/WarningTriangle.js";
|
|
10
|
+
import { i as Se, n as Ae, r as A, t as _e } from "./dist-D-yS0HN8.js";
|
|
11
|
+
import { t as Y } from "./dist-D5XYRjmR.js";
|
|
12
|
+
import { r as De, t as Ie } from "./dist-DKryKPmP.js";
|
|
13
|
+
import { t as Ne } from "./dist-C4j75TwZ.js";
|
|
14
|
+
import { t as Fe } from "./dist-BUocnzkM.js";
|
|
15
|
+
import { t as Le } from "./dist-CzKqHuqJ2.js";
|
|
16
|
+
import { closeToastVariants as ke, toastVariants as Me, viewportToastVariants as Oe } from "./components/Toast/Toast.variants.js";
|
|
16
17
|
import * as s from "react";
|
|
17
|
-
import { isValidElement as G,
|
|
18
|
-
import * as
|
|
19
|
-
import { Fragment as
|
|
20
|
-
var
|
|
18
|
+
import { isValidElement as G, useEffect as Ve, useRef as Ke } from "react";
|
|
19
|
+
import * as We from "react-dom";
|
|
20
|
+
import { Fragment as le, jsx as r, jsxs as D } from "react/jsx-runtime";
|
|
21
|
+
var He = Object.defineProperty, u = (a, e) => He(a, "name", {
|
|
21
22
|
value: e,
|
|
22
23
|
configurable: !0
|
|
23
|
-
}),
|
|
24
|
-
const { __scopeToast: e, label: t = "Notification", duration: o = 5e3, swipeDirection: n = "right", swipeThreshold: l = 50, announcerContainer:
|
|
25
|
-
return t.trim() || console.error(`Invalid prop \`label\` supplied to \`${
|
|
24
|
+
}), de = "ToastProvider", [Z, fe, $e] = Le("Toast"), [pe, Ft] = Se("Toast", [$e]), [Xe, z] = pe(de), Ue = /* @__PURE__ */ u((a) => {
|
|
25
|
+
const { __scopeToast: e, label: t = "Notification", duration: o = 5e3, swipeDirection: n = "right", swipeThreshold: l = 50, announcerContainer: E, children: m } = a, [v, C] = s.useState(null), [c, h] = s.useState(0), T = s.useRef(!1);
|
|
26
|
+
return t.trim() || console.error(`Invalid prop \`label\` supplied to \`${de}\`. Expected non-empty \`string\`.`), /* @__PURE__ */ r(Z.Provider, {
|
|
26
27
|
scope: e,
|
|
27
|
-
children: /* @__PURE__ */ r(
|
|
28
|
+
children: /* @__PURE__ */ r(Xe, {
|
|
28
29
|
scope: e,
|
|
29
30
|
label: t,
|
|
30
31
|
duration: o,
|
|
@@ -32,25 +33,25 @@ var Xe = Object.defineProperty, u = (a, e) => Xe(a, "name", {
|
|
|
32
33
|
swipeThreshold: l,
|
|
33
34
|
toastCount: c,
|
|
34
35
|
viewport: v,
|
|
35
|
-
onViewportChange:
|
|
36
|
-
onToastAdd: s.useCallback(() =>
|
|
37
|
-
onToastRemove: s.useCallback(() =>
|
|
36
|
+
onViewportChange: C,
|
|
37
|
+
onToastAdd: s.useCallback(() => h((S) => S + 1), []),
|
|
38
|
+
onToastRemove: s.useCallback(() => h((S) => S - 1), []),
|
|
38
39
|
isClosePausedRef: T,
|
|
39
|
-
announcerContainer:
|
|
40
|
+
announcerContainer: E,
|
|
40
41
|
children: m
|
|
41
42
|
})
|
|
42
43
|
});
|
|
43
|
-
}, "ToastProvider"),
|
|
44
|
-
const { __scopeToast: o, hotkey: n =
|
|
44
|
+
}, "ToastProvider"), Ye = "ToastViewport", ze = ["F8"], J = "toast.viewportPause", Q = "toast.viewportResume", je = /* @__PURE__ */ s.forwardRef(/* @__PURE__ */ u(function(e, t) {
|
|
45
|
+
const { __scopeToast: o, hotkey: n = ze, label: l = "Notifications ({hotkey})", ...E } = e, m = z(Ye, o), v = fe(o), C = s.useRef(null), c = s.useRef(null), h = s.useRef(null), T = s.useRef(null), S = ce(t, T, m.onViewportChange), N = n.join("+").replace(/Key/g, "").replace(/Digit/g, ""), y = m.toastCount > 0;
|
|
45
46
|
s.useEffect(() => {
|
|
46
47
|
const d = /* @__PURE__ */ u((w) => {
|
|
47
|
-
n.length !== 0 && n.every((
|
|
48
|
+
n.length !== 0 && n.every((p) => w[p] || w.code === p) && T.current?.focus();
|
|
48
49
|
}, "handleKeyDown");
|
|
49
50
|
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
50
51
|
}, [n]), s.useEffect(() => {
|
|
51
|
-
const d =
|
|
52
|
+
const d = C.current, w = T.current;
|
|
52
53
|
if (y && d && w) {
|
|
53
|
-
const
|
|
54
|
+
const p = /* @__PURE__ */ u(() => {
|
|
54
55
|
if (!m.isClosePausedRef.current) {
|
|
55
56
|
const P = new CustomEvent(J);
|
|
56
57
|
w.dispatchEvent(P), m.isClosePausedRef.current = !0;
|
|
@@ -60,169 +61,169 @@ var Xe = Object.defineProperty, u = (a, e) => Xe(a, "name", {
|
|
|
60
61
|
const P = new CustomEvent(Q);
|
|
61
62
|
w.dispatchEvent(P), m.isClosePausedRef.current = !1;
|
|
62
63
|
}
|
|
63
|
-
}, "handleResume"),
|
|
64
|
+
}, "handleResume"), x = /* @__PURE__ */ u((P) => {
|
|
64
65
|
d.contains(P.relatedTarget) || g();
|
|
65
66
|
}, "handleFocusOutResume"), R = /* @__PURE__ */ u(() => {
|
|
66
67
|
d.contains(document.activeElement) || g();
|
|
67
68
|
}, "handlePointerLeaveResume");
|
|
68
|
-
return d.addEventListener("focusin",
|
|
69
|
-
d.removeEventListener("focusin",
|
|
69
|
+
return d.addEventListener("focusin", p), d.addEventListener("focusout", x), d.addEventListener("pointermove", p), d.addEventListener("pointerleave", R), window.addEventListener("blur", p), window.addEventListener("focus", g), () => {
|
|
70
|
+
d.removeEventListener("focusin", p), d.removeEventListener("focusout", x), d.removeEventListener("pointermove", p), d.removeEventListener("pointerleave", R), window.removeEventListener("blur", p), window.removeEventListener("focus", g);
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
73
|
}, [y, m.isClosePausedRef]);
|
|
73
|
-
const
|
|
74
|
-
const w = v().map((
|
|
75
|
-
const g =
|
|
76
|
-
return d === "forwards" ?
|
|
74
|
+
const f = s.useCallback(({ tabbingDirection: d }) => {
|
|
75
|
+
const w = v().map((p) => {
|
|
76
|
+
const g = p.ref.current, x = [g, ...we(g)];
|
|
77
|
+
return d === "forwards" ? x : x.reverse();
|
|
77
78
|
});
|
|
78
79
|
return (d === "forwards" ? w.reverse() : w).flat();
|
|
79
80
|
}, [v]);
|
|
80
81
|
return s.useEffect(() => {
|
|
81
82
|
const d = T.current;
|
|
82
83
|
if (d) {
|
|
83
|
-
const w = /* @__PURE__ */ u((
|
|
84
|
-
const g =
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
84
|
+
const w = /* @__PURE__ */ u((p) => {
|
|
85
|
+
const g = p.altKey || p.ctrlKey || p.metaKey;
|
|
86
|
+
if (p.key === "Tab" && !g) {
|
|
87
|
+
const x = document.activeElement, R = p.shiftKey;
|
|
88
|
+
if (p.target === d && R) {
|
|
88
89
|
c.current?.focus();
|
|
89
90
|
return;
|
|
90
91
|
}
|
|
91
|
-
const P =
|
|
92
|
-
U(P.slice(V + 1)) ?
|
|
92
|
+
const P = f({ tabbingDirection: R ? "backwards" : "forwards" }), V = P.findIndex((F) => F === x);
|
|
93
|
+
U(P.slice(V + 1)) ? p.preventDefault() : R ? c.current?.focus() : h.current?.focus();
|
|
93
94
|
}
|
|
94
95
|
}, "handleKeyDown");
|
|
95
96
|
return d.addEventListener("keydown", w), () => d.removeEventListener("keydown", w);
|
|
96
97
|
}
|
|
97
|
-
}, [v,
|
|
98
|
-
ref:
|
|
98
|
+
}, [v, f]), /* @__PURE__ */ D(Ie, {
|
|
99
|
+
ref: C,
|
|
99
100
|
role: "region",
|
|
100
101
|
"aria-label": l.replace("{hotkey}", N),
|
|
101
102
|
tabIndex: -1,
|
|
102
103
|
style: { pointerEvents: y ? void 0 : "none" },
|
|
103
104
|
children: [
|
|
104
|
-
y && /* @__PURE__ */ r(
|
|
105
|
+
y && /* @__PURE__ */ r(se, {
|
|
105
106
|
ref: c,
|
|
106
107
|
onFocusFromOutsideViewport: () => {
|
|
107
|
-
U(
|
|
108
|
+
U(f({ tabbingDirection: "forwards" }));
|
|
108
109
|
}
|
|
109
110
|
}),
|
|
110
111
|
/* @__PURE__ */ r(Z.Slot, {
|
|
111
112
|
scope: o,
|
|
112
113
|
children: /* @__PURE__ */ r(I.ol, {
|
|
113
114
|
tabIndex: -1,
|
|
114
|
-
...
|
|
115
|
+
...E,
|
|
115
116
|
ref: S
|
|
116
117
|
})
|
|
117
118
|
}),
|
|
118
|
-
y && /* @__PURE__ */ r(
|
|
119
|
-
ref:
|
|
119
|
+
y && /* @__PURE__ */ r(se, {
|
|
120
|
+
ref: h,
|
|
120
121
|
onFocusFromOutsideViewport: () => {
|
|
121
|
-
U(
|
|
122
|
+
U(f({ tabbingDirection: "backwards" }));
|
|
122
123
|
}
|
|
123
124
|
})
|
|
124
125
|
]
|
|
125
126
|
});
|
|
126
|
-
}, "ToastViewport")),
|
|
127
|
-
const { __scopeToast: o, onFocusFromOutsideViewport: n, ...l } = e,
|
|
128
|
-
return /* @__PURE__ */ r(
|
|
127
|
+
}, "ToastViewport")), Be = "ToastFocusProxy", se = /* @__PURE__ */ s.forwardRef(/* @__PURE__ */ u(function(e, t) {
|
|
128
|
+
const { __scopeToast: o, onFocusFromOutsideViewport: n, ...l } = e, E = z(Be, o);
|
|
129
|
+
return /* @__PURE__ */ r(ue, {
|
|
129
130
|
tabIndex: 0,
|
|
130
131
|
...l,
|
|
131
132
|
ref: t,
|
|
132
133
|
style: { position: "fixed" },
|
|
133
134
|
onFocus: (m) => {
|
|
134
135
|
const v = m.relatedTarget;
|
|
135
|
-
|
|
136
|
+
E.viewport?.contains(v) || n();
|
|
136
137
|
}
|
|
137
138
|
});
|
|
138
|
-
}, "ToastFocusProxy")), j = "Toast",
|
|
139
|
-
const { forceMount: o, open: n, defaultOpen: l, onOpenChange:
|
|
139
|
+
}, "ToastFocusProxy")), j = "Toast", qe = "toast.swipeStart", Ge = "toast.swipeMove", Je = "toast.swipeCancel", Qe = "toast.swipeEnd", Ze = /* @__PURE__ */ s.forwardRef(/* @__PURE__ */ u(function(e, t) {
|
|
140
|
+
const { forceMount: o, open: n, defaultOpen: l, onOpenChange: E, ...m } = e, [v, C] = _e({
|
|
140
141
|
prop: n,
|
|
141
142
|
defaultProp: l ?? !0,
|
|
142
|
-
onChange:
|
|
143
|
+
onChange: E,
|
|
143
144
|
caller: j
|
|
144
145
|
});
|
|
145
|
-
return /* @__PURE__ */ r(
|
|
146
|
+
return /* @__PURE__ */ r(Fe, {
|
|
146
147
|
present: o || v,
|
|
147
|
-
children: /* @__PURE__ */ r(
|
|
148
|
+
children: /* @__PURE__ */ r(ot, {
|
|
148
149
|
open: v,
|
|
149
150
|
...m,
|
|
150
151
|
ref: t,
|
|
151
|
-
onClose: () =>
|
|
152
|
+
onClose: () => C(!1),
|
|
152
153
|
onPause: Y(e.onPause),
|
|
153
154
|
onResume: Y(e.onResume),
|
|
154
155
|
onSwipeStart: A(e.onSwipeStart, (c) => {
|
|
155
156
|
c.currentTarget.setAttribute("data-swipe", "start");
|
|
156
157
|
}),
|
|
157
158
|
onSwipeMove: A(e.onSwipeMove, (c) => {
|
|
158
|
-
const { x:
|
|
159
|
-
c.currentTarget.setAttribute("data-swipe", "move"), c.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${
|
|
159
|
+
const { x: h, y: T } = c.detail.delta;
|
|
160
|
+
c.currentTarget.setAttribute("data-swipe", "move"), c.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${h}px`), c.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${T}px`);
|
|
160
161
|
}),
|
|
161
162
|
onSwipeCancel: A(e.onSwipeCancel, (c) => {
|
|
162
163
|
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");
|
|
163
164
|
}),
|
|
164
165
|
onSwipeEnd: A(e.onSwipeEnd, (c) => {
|
|
165
|
-
const { x:
|
|
166
|
-
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", `${
|
|
166
|
+
const { x: h, y: T } = c.detail.delta;
|
|
167
|
+
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", `${h}px`), c.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${T}px`), C(!1);
|
|
167
168
|
})
|
|
168
169
|
})
|
|
169
170
|
});
|
|
170
|
-
}, "Toast")), [
|
|
171
|
-
} }),
|
|
172
|
-
const { __scopeToast: o, type: n = "foreground", duration: l, open:
|
|
173
|
-
w?.contains(document.activeElement) &&
|
|
171
|
+
}, "Toast")), [et, tt] = pe(j, { onClose() {
|
|
172
|
+
} }), ot = /* @__PURE__ */ s.forwardRef(/* @__PURE__ */ u(function(e, t) {
|
|
173
|
+
const { __scopeToast: o, type: n = "foreground", duration: l, open: E, onClose: m, onEscapeKeyDown: v, onPause: C, onResume: c, onSwipeStart: h, onSwipeMove: T, onSwipeCancel: S, onSwipeEnd: N, ...y } = e, f = z(j, o), d = fe(o), [w, p] = s.useState(null), g = ce(t, p), x = s.useRef(null), R = s.useRef(null), P = l || f.duration, V = s.useRef(0), F = s.useRef(P), K = s.useRef(0), { onToastAdd: te, onToastRemove: oe } = f, L = Y(() => {
|
|
174
|
+
w?.contains(document.activeElement) && f.viewport?.focus(), m();
|
|
174
175
|
}), W = s.useCallback((i) => {
|
|
175
176
|
!i || i === 1 / 0 || (window.clearTimeout(K.current), V.current = (/* @__PURE__ */ new Date()).getTime(), K.current = window.setTimeout(L, i));
|
|
176
177
|
}, [L]);
|
|
177
178
|
s.useEffect(() => {
|
|
178
|
-
const i =
|
|
179
|
+
const i = f.viewport;
|
|
179
180
|
if (i) {
|
|
180
181
|
const b = /* @__PURE__ */ u(() => {
|
|
181
182
|
W(F.current), c?.();
|
|
182
183
|
}, "handleResume"), _ = /* @__PURE__ */ u(() => {
|
|
183
|
-
const
|
|
184
|
-
F.current = F.current -
|
|
184
|
+
const k = (/* @__PURE__ */ new Date()).getTime() - V.current;
|
|
185
|
+
F.current = F.current - k, window.clearTimeout(K.current), C?.();
|
|
185
186
|
}, "handlePause");
|
|
186
187
|
return i.addEventListener(J, _), i.addEventListener(Q, b), () => {
|
|
187
188
|
i.removeEventListener(J, _), i.removeEventListener(Q, b);
|
|
188
189
|
};
|
|
189
190
|
}
|
|
190
191
|
}, [
|
|
191
|
-
|
|
192
|
+
f.viewport,
|
|
192
193
|
P,
|
|
193
|
-
|
|
194
|
+
C,
|
|
194
195
|
c,
|
|
195
196
|
W
|
|
196
197
|
]), s.useEffect(() => {
|
|
197
|
-
|
|
198
|
+
E && !f.isClosePausedRef.current && W(P);
|
|
198
199
|
}, [
|
|
199
|
-
|
|
200
|
+
E,
|
|
200
201
|
P,
|
|
201
|
-
|
|
202
|
+
f.isClosePausedRef,
|
|
202
203
|
W
|
|
203
204
|
]), s.useEffect(() => () => {
|
|
204
205
|
window.clearTimeout(K.current);
|
|
205
206
|
}, []), s.useEffect(() => (te(), () => oe()), [te, oe]);
|
|
206
207
|
const ne = s.useMemo(() => w ? ee(w) : null, [w]);
|
|
207
|
-
return
|
|
208
|
+
return f.viewport ? /* @__PURE__ */ D(le, { children: [ne && /* @__PURE__ */ r(nt, {
|
|
208
209
|
__scopeToast: o,
|
|
209
210
|
role: "status",
|
|
210
211
|
"aria-live": n === "foreground" ? "assertive" : "polite",
|
|
211
212
|
children: ne
|
|
212
|
-
}), /* @__PURE__ */ r(
|
|
213
|
+
}), /* @__PURE__ */ r(et, {
|
|
213
214
|
scope: o,
|
|
214
215
|
onClose: L,
|
|
215
|
-
children:
|
|
216
|
+
children: We.createPortal(/* @__PURE__ */ r(Z.ItemSlot, {
|
|
216
217
|
scope: o,
|
|
217
|
-
children: /* @__PURE__ */ r(
|
|
218
|
+
children: /* @__PURE__ */ r(De, {
|
|
218
219
|
asChild: !0,
|
|
219
220
|
onEscapeKeyDown: A(v, (i) => {
|
|
220
221
|
d().some((b) => b.ref.current?.contains(i.target)) || L();
|
|
221
222
|
}),
|
|
222
223
|
children: /* @__PURE__ */ r(I.li, {
|
|
223
224
|
tabIndex: 0,
|
|
224
|
-
"data-state":
|
|
225
|
-
"data-swipe-direction":
|
|
225
|
+
"data-state": E ? "open" : "closed",
|
|
226
|
+
"data-swipe-direction": f.swipeDirection,
|
|
226
227
|
...y,
|
|
227
228
|
ref: g,
|
|
228
229
|
style: {
|
|
@@ -234,78 +235,78 @@ var Xe = Object.defineProperty, u = (a, e) => Xe(a, "name", {
|
|
|
234
235
|
i.key === "Escape" && (v?.(i.nativeEvent), i.nativeEvent.defaultPrevented || L());
|
|
235
236
|
}),
|
|
236
237
|
onPointerDown: A(e.onPointerDown, (i) => {
|
|
237
|
-
i.button === 0 && (
|
|
238
|
+
i.button === 0 && (x.current = {
|
|
238
239
|
x: i.clientX,
|
|
239
240
|
y: i.clientY
|
|
240
241
|
});
|
|
241
242
|
}),
|
|
242
243
|
onPointerMove: A(e.onPointerMove, (i) => {
|
|
243
|
-
if (!
|
|
244
|
-
const b = i.clientX -
|
|
245
|
-
x:
|
|
246
|
-
y:
|
|
244
|
+
if (!x.current) return;
|
|
245
|
+
const b = i.clientX - x.current.x, _ = i.clientY - x.current.y, k = !!R.current, M = ["left", "right"].includes(f.swipeDirection), H = ["left", "up"].includes(f.swipeDirection) ? Math.min : Math.max, Ee = M ? H(0, b) : 0, he = M ? 0 : H(0, _), B = i.pointerType === "touch" ? 10 : 2, $ = {
|
|
246
|
+
x: Ee,
|
|
247
|
+
y: he
|
|
247
248
|
}, re = {
|
|
248
249
|
originalEvent: i,
|
|
249
250
|
delta: $
|
|
250
251
|
};
|
|
251
|
-
|
|
252
|
+
k ? (R.current = $, O(Ge, T, re, { discrete: !1 })) : ae($, f.swipeDirection, B) ? (R.current = $, O(qe, h, re, { discrete: !1 }), i.target.setPointerCapture(i.pointerId)) : (Math.abs(b) > B || Math.abs(_) > B) && (x.current = null);
|
|
252
253
|
}),
|
|
253
254
|
onPointerUp: A(e.onPointerUp, (i) => {
|
|
254
255
|
const b = R.current, _ = i.target;
|
|
255
|
-
if (_.hasPointerCapture(i.pointerId) && _.releasePointerCapture(i.pointerId), R.current = null,
|
|
256
|
-
const
|
|
256
|
+
if (_.hasPointerCapture(i.pointerId) && _.releasePointerCapture(i.pointerId), R.current = null, x.current = null, b) {
|
|
257
|
+
const k = i.currentTarget, M = {
|
|
257
258
|
originalEvent: i,
|
|
258
259
|
delta: b
|
|
259
260
|
};
|
|
260
|
-
|
|
261
|
+
ae(b, f.swipeDirection, f.swipeThreshold) ? O(Qe, N, M, { discrete: !0 }) : O(Je, S, M, { discrete: !0 }), k.addEventListener("click", (H) => H.preventDefault(), { once: !0 });
|
|
261
262
|
}
|
|
262
263
|
})
|
|
263
264
|
})
|
|
264
265
|
})
|
|
265
|
-
}),
|
|
266
|
+
}), f.viewport)
|
|
266
267
|
})] }) : null;
|
|
267
|
-
}, "ToastImpl")),
|
|
268
|
-
const { __scopeToast: e, children: t, ...o } = a, n = z(j, e), [l,
|
|
269
|
-
return
|
|
270
|
-
const
|
|
271
|
-
return () => window.clearTimeout(
|
|
272
|
-
}, []), m ? null : /* @__PURE__ */ r(
|
|
268
|
+
}, "ToastImpl")), nt = /* @__PURE__ */ u((a) => {
|
|
269
|
+
const { __scopeToast: e, children: t, ...o } = a, n = z(j, e), [l, E] = s.useState(!1), [m, v] = s.useState(!1);
|
|
270
|
+
return Te(() => E(!0)), s.useEffect(() => {
|
|
271
|
+
const C = window.setTimeout(() => v(!0), 1e3);
|
|
272
|
+
return () => window.clearTimeout(C);
|
|
273
|
+
}, []), m ? null : /* @__PURE__ */ r(Ne, {
|
|
273
274
|
asChild: !0,
|
|
274
275
|
container: n.announcerContainer || void 0,
|
|
275
|
-
children: /* @__PURE__ */ r(
|
|
276
|
+
children: /* @__PURE__ */ r(ue, {
|
|
276
277
|
...o,
|
|
277
|
-
children: l && /* @__PURE__ */ D(
|
|
278
|
+
children: l && /* @__PURE__ */ D(le, { children: [
|
|
278
279
|
n.label,
|
|
279
280
|
" ",
|
|
280
281
|
t
|
|
281
282
|
] })
|
|
282
283
|
})
|
|
283
284
|
});
|
|
284
|
-
}, "ToastAnnounce"),
|
|
285
|
+
}, "ToastAnnounce"), rt = /* @__PURE__ */ s.forwardRef(/* @__PURE__ */ u(function(e, t) {
|
|
285
286
|
const { __scopeToast: o, ...n } = e;
|
|
286
287
|
return /* @__PURE__ */ r(I.div, {
|
|
287
288
|
...n,
|
|
288
289
|
ref: t
|
|
289
290
|
});
|
|
290
|
-
}, "ToastTitle")),
|
|
291
|
+
}, "ToastTitle")), st = /* @__PURE__ */ s.forwardRef(/* @__PURE__ */ u(function(e, t) {
|
|
291
292
|
const { __scopeToast: o, ...n } = e;
|
|
292
293
|
return /* @__PURE__ */ r(I.div, {
|
|
293
294
|
...n,
|
|
294
295
|
ref: t
|
|
295
296
|
});
|
|
296
|
-
}, "ToastDescription")),
|
|
297
|
+
}, "ToastDescription")), at = "ToastAction", it = /* @__PURE__ */ s.forwardRef(/* @__PURE__ */ u(function(e, t) {
|
|
297
298
|
const { altText: o, ...n } = e;
|
|
298
|
-
return o.trim() ? /* @__PURE__ */ r(
|
|
299
|
+
return o.trim() ? /* @__PURE__ */ r(me, {
|
|
299
300
|
altText: o,
|
|
300
301
|
asChild: !0,
|
|
301
|
-
children: /* @__PURE__ */ r(
|
|
302
|
+
children: /* @__PURE__ */ r(ut, {
|
|
302
303
|
...n,
|
|
303
304
|
ref: t
|
|
304
305
|
})
|
|
305
|
-
}) : (console.error(`Invalid prop \`altText\` supplied to \`${
|
|
306
|
-
}, "ToastAction")),
|
|
307
|
-
const { __scopeToast: o, ...n } = e, l =
|
|
308
|
-
return /* @__PURE__ */ r(
|
|
306
|
+
}) : (console.error(`Invalid prop \`altText\` supplied to \`${at}\`. Expected non-empty \`string\`.`), null);
|
|
307
|
+
}, "ToastAction")), ct = "ToastClose", ut = /* @__PURE__ */ s.forwardRef(/* @__PURE__ */ u(function(e, t) {
|
|
308
|
+
const { __scopeToast: o, ...n } = e, l = tt(ct, o);
|
|
309
|
+
return /* @__PURE__ */ r(me, {
|
|
309
310
|
asChild: !0,
|
|
310
311
|
children: /* @__PURE__ */ r(I.button, {
|
|
311
312
|
type: "button",
|
|
@@ -314,7 +315,7 @@ var Xe = Object.defineProperty, u = (a, e) => Xe(a, "name", {
|
|
|
314
315
|
onClick: A(e.onClick, l.onClose)
|
|
315
316
|
})
|
|
316
317
|
});
|
|
317
|
-
}, "ToastClose")),
|
|
318
|
+
}, "ToastClose")), me = /* @__PURE__ */ s.forwardRef(/* @__PURE__ */ u(function(e, t) {
|
|
318
319
|
const { __scopeToast: o, altText: n, ...l } = e;
|
|
319
320
|
return /* @__PURE__ */ r(I.div, {
|
|
320
321
|
"data-radix-toast-announce-exclude": "",
|
|
@@ -326,7 +327,7 @@ var Xe = Object.defineProperty, u = (a, e) => Xe(a, "name", {
|
|
|
326
327
|
function ee(a) {
|
|
327
328
|
const e = [];
|
|
328
329
|
return Array.from(a.childNodes).forEach((t) => {
|
|
329
|
-
if (t.nodeType === t.TEXT_NODE && t.textContent && e.push(t.textContent),
|
|
330
|
+
if (t.nodeType === t.TEXT_NODE && t.textContent && e.push(t.textContent), ve(t)) {
|
|
330
331
|
const o = t.ariaHidden || t.hidden || t.style.display === "none", n = t.dataset.radixToastAnnounceExclude === "";
|
|
331
332
|
if (!o) if (n) {
|
|
332
333
|
const l = t.dataset.radixToastAnnounceAlt;
|
|
@@ -342,29 +343,29 @@ function O(a, e, t, { discrete: o }) {
|
|
|
342
343
|
cancelable: !0,
|
|
343
344
|
detail: t
|
|
344
345
|
});
|
|
345
|
-
e && n.addEventListener(a, e, { once: !0 }), o ?
|
|
346
|
+
e && n.addEventListener(a, e, { once: !0 }), o ? xe(n, l) : n.dispatchEvent(l);
|
|
346
347
|
}
|
|
347
348
|
u(O, "handleAndDispatchCustomEvent");
|
|
348
|
-
var
|
|
349
|
+
var ae = /* @__PURE__ */ u((a, e, t = 0) => {
|
|
349
350
|
const o = Math.abs(a.x), n = Math.abs(a.y), l = o > n;
|
|
350
351
|
return e === "left" || e === "right" ? l && o > t : !l && n > t;
|
|
351
352
|
}, "isDeltaInDirection");
|
|
352
|
-
function
|
|
353
|
+
function Te(a = () => {
|
|
353
354
|
}) {
|
|
354
355
|
const e = Y(a);
|
|
355
|
-
|
|
356
|
+
Ae(() => {
|
|
356
357
|
let t = 0, o = 0;
|
|
357
358
|
return t = window.requestAnimationFrame(() => o = window.requestAnimationFrame(e)), () => {
|
|
358
359
|
window.cancelAnimationFrame(t), window.cancelAnimationFrame(o);
|
|
359
360
|
};
|
|
360
361
|
}, [e]);
|
|
361
362
|
}
|
|
362
|
-
u(
|
|
363
|
-
function
|
|
363
|
+
u(Te, "useNextFrame");
|
|
364
|
+
function ve(a) {
|
|
364
365
|
return a.nodeType === a.ELEMENT_NODE;
|
|
365
366
|
}
|
|
366
|
-
u(
|
|
367
|
-
function
|
|
367
|
+
u(ve, "isHTMLElement");
|
|
368
|
+
function we(a) {
|
|
368
369
|
const e = [], t = document.createTreeWalker(a, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */ u((o) => {
|
|
369
370
|
const n = o.tagName === "INPUT" && o.type === "hidden";
|
|
370
371
|
return o.disabled || o.hidden || n ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
@@ -372,88 +373,88 @@ function Ee(a) {
|
|
|
372
373
|
for (; t.nextNode(); ) e.push(t.currentNode);
|
|
373
374
|
return e;
|
|
374
375
|
}
|
|
375
|
-
u(
|
|
376
|
+
u(we, "getTabbableCandidates");
|
|
376
377
|
function U(a) {
|
|
377
378
|
const e = document.activeElement;
|
|
378
379
|
return a.some((t) => t === e ? !0 : (t.focus(), document.activeElement !== e));
|
|
379
380
|
}
|
|
380
381
|
u(U, "focusFirst");
|
|
381
|
-
var
|
|
382
|
-
const S =
|
|
383
|
-
|
|
384
|
-
const N =
|
|
382
|
+
var lt = Ue, dt = je, ft = Ze, pt = rt, ie = st, mt = it, Lt = ({ title: a, duration: e = 5e3, titleClassName: t, descriptionClassName: o, description: n, children: l, theme: E, showCloseButton: m = !0, closeButtonClassName: v, className: C, open: c = !1, setOpen: h, variant: T }) => {
|
|
383
|
+
const S = Ke(0);
|
|
384
|
+
Ve(() => () => clearTimeout(S.current), []);
|
|
385
|
+
const N = G(a) ? /* @__PURE__ */ r(q, {
|
|
385
386
|
className: t,
|
|
386
387
|
children: a
|
|
387
|
-
}) : a,
|
|
388
|
+
}) : a, y = G(n) ? /* @__PURE__ */ r(q, {
|
|
388
389
|
className: o,
|
|
389
390
|
children: n
|
|
390
|
-
}) : n
|
|
391
|
-
return /* @__PURE__ */ D(
|
|
391
|
+
}) : n;
|
|
392
|
+
return /* @__PURE__ */ D(lt, {
|
|
392
393
|
swipeDirection: "right",
|
|
393
394
|
duration: e,
|
|
394
395
|
children: [
|
|
395
396
|
/* @__PURE__ */ r(q, {
|
|
396
|
-
onClick:
|
|
397
|
-
|
|
398
|
-
},
|
|
397
|
+
onClick: () => {
|
|
398
|
+
h(!1), S.current = window.setTimeout(() => h(!0), 100);
|
|
399
|
+
},
|
|
399
400
|
children: l
|
|
400
401
|
}),
|
|
401
|
-
/* @__PURE__ */ D(
|
|
402
|
-
className: X(
|
|
402
|
+
/* @__PURE__ */ D(ft, {
|
|
403
|
+
className: X(Me({
|
|
403
404
|
variant: T,
|
|
404
|
-
className:
|
|
405
|
+
className: C
|
|
405
406
|
})),
|
|
406
|
-
"data-theme":
|
|
407
|
+
"data-theme": E,
|
|
407
408
|
open: c,
|
|
408
|
-
onOpenChange:
|
|
409
|
+
onOpenChange: h,
|
|
409
410
|
children: [/* @__PURE__ */ D("div", {
|
|
410
411
|
className: "flex gap-2 items-center flex-1",
|
|
411
412
|
children: [
|
|
412
|
-
T === "success" && /* @__PURE__ */ r(
|
|
413
|
+
T === "success" && /* @__PURE__ */ r(ye, {
|
|
413
414
|
size: 20,
|
|
414
415
|
className: "shrink-0"
|
|
415
416
|
}),
|
|
416
|
-
T === "error" && /* @__PURE__ */ r(
|
|
417
|
+
T === "error" && /* @__PURE__ */ r(Re, {
|
|
417
418
|
size: 20,
|
|
418
419
|
className: "shrink-0"
|
|
419
420
|
}),
|
|
420
|
-
T === "warning" && /* @__PURE__ */ r(
|
|
421
|
+
T === "warning" && /* @__PURE__ */ r(be, {
|
|
421
422
|
size: 20,
|
|
422
423
|
className: "shrink-0"
|
|
423
424
|
}),
|
|
424
|
-
T === "info" && /* @__PURE__ */ r(
|
|
425
|
+
T === "info" && /* @__PURE__ */ r(ge, {
|
|
425
426
|
size: 20,
|
|
426
427
|
className: "shrink-0"
|
|
427
428
|
}),
|
|
428
429
|
/* @__PURE__ */ D("div", {
|
|
429
430
|
className: "flex flex-col gap-1",
|
|
430
|
-
children: [/* @__PURE__ */ r(
|
|
431
|
+
children: [/* @__PURE__ */ r(pt, {
|
|
431
432
|
asChild: !0,
|
|
432
433
|
className: t,
|
|
433
434
|
children: N
|
|
434
|
-
}), y && (G(y) ? /* @__PURE__ */ r(
|
|
435
|
+
}), y && (G(y) ? /* @__PURE__ */ r(ie, {
|
|
435
436
|
asChild: !0,
|
|
436
437
|
children: y
|
|
437
|
-
}) : /* @__PURE__ */ r(
|
|
438
|
+
}) : /* @__PURE__ */ r(ie, {
|
|
438
439
|
className: X("text-sm", o),
|
|
439
440
|
children: y
|
|
440
441
|
}))]
|
|
441
442
|
})
|
|
442
443
|
]
|
|
443
|
-
}), m && /* @__PURE__ */ r(
|
|
444
|
+
}), m && /* @__PURE__ */ r(mt, {
|
|
444
445
|
asChild: !0,
|
|
445
446
|
altText: "Close the toast",
|
|
446
447
|
children: /* @__PURE__ */ D("button", {
|
|
447
448
|
type: "button",
|
|
448
449
|
className: "cursor-pointer",
|
|
449
|
-
children: [/* @__PURE__ */ r(Ce, { className: X(ke({ className: v })) }), /* @__PURE__ */ r(
|
|
450
|
+
children: [/* @__PURE__ */ r(Ce, { className: X(ke({ className: v })) }), /* @__PURE__ */ r(Pe, { children: "Close toast" })]
|
|
450
451
|
})
|
|
451
452
|
})]
|
|
452
453
|
}),
|
|
453
|
-
/* @__PURE__ */ r(
|
|
454
|
+
/* @__PURE__ */ r(dt, { className: X(Oe()) })
|
|
454
455
|
]
|
|
455
456
|
});
|
|
456
457
|
};
|
|
457
458
|
export {
|
|
458
|
-
|
|
459
|
+
Lt as t
|
|
459
460
|
};
|