twenty-ui 2.49.0 → 2.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/Button-CU8BS-Yd.js +75 -0
- package/dist/Button-iVyxlrwO.cjs +1 -0
- package/dist/Dropdown-ChTVyesF.js +1018 -0
- package/dist/Dropdown-DlItz8Gh.cjs +1 -0
- package/dist/Heading-CHvEXL6n.cjs +1 -0
- package/dist/{Heading-pXllCJCO.js → Heading-Nj5BlPqB.js} +3 -3
- package/dist/{ListItem-DwBb-I1D.cjs → ListItem-C6Xl00m1.cjs} +1 -1
- package/dist/{ListItem-DizNUBT8.js → ListItem-C84ANa76.js} +1 -1
- package/dist/{OverflowingTextWithTooltip-Z2daM0_x.cjs → OverflowingTextWithTooltip-BQmpPObX.cjs} +1 -1
- package/dist/{OverflowingTextWithTooltip-BmUROIah.js → OverflowingTextWithTooltip-BtB9cGdJ.js} +20 -21
- package/dist/ProgressBar-CzGs7cuE.cjs +1 -0
- package/dist/ProgressBar-D4tKQ7OA.js +84 -0
- package/dist/{Radio-BEAztmPu.js → Radio-BwBZ4e8g.js} +29 -29
- package/dist/{Radio-Dx6b4SYZ.cjs → Radio-sIYxZnR_.cjs} +1 -1
- package/dist/TabsTabContent-6rkARU9F.cjs +1 -0
- package/dist/TabsTabContent-DPkLTBi2.js +39 -0
- package/dist/Tooltip-6uS8_wdA.js +132 -0
- package/dist/Tooltip-DL3sfbuw.cjs +1 -0
- package/dist/components/data-display.cjs +1 -1
- package/dist/components/data-display.mjs +6 -7
- package/dist/components/feedback/InlineBanner/InlineBanner.d.ts +2 -2
- package/dist/components/feedback/InlineBanner/internal/InlineBannerComponent.d.ts +1 -1
- package/dist/components/feedback/InlineBanner/types/InlineBannerProps.d.ts +1 -0
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.mjs +1 -1
- package/dist/components/input/SegmentedControl/types/SegmentedControlProps.d.ts +1 -1
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.mjs +2 -2
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.mjs +1 -1
- package/dist/components/navigation/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/navigation/Dropdown/internal/DropdownSearch.d.ts +1 -1
- package/dist/components/navigation/Dropdown/internal/DropdownSearchEffect.d.ts +8 -0
- package/dist/components/navigation/index.d.ts +0 -11
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.mjs +6 -11
- package/dist/components/settings.cjs +1 -1
- package/dist/components/settings.mjs +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.mjs +35 -41
- package/dist/data-display-C-eoJ5En.js +378 -0
- package/dist/data-display-CM1yXpnE.cjs +2 -0
- package/dist/data-display-CXw-mxeS.js +252 -0
- package/dist/data-display-DdES9XqZ.cjs +1 -0
- package/dist/{feedback-DTyVVcTb.js → feedback-4HKPcMRs.js} +216 -215
- package/dist/feedback-BSOWDBI0.js +38 -0
- package/dist/feedback-DBRXDPSP.cjs +1 -0
- package/dist/feedback-DspXawf9.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +605 -611
- package/dist/input-CWWp7cqL.cjs +1 -0
- package/dist/input-CvZ_uB_9.cjs +1 -0
- package/dist/{input-BrjD91wv.js → input-Qn5_aFYU.js} +5 -5
- package/dist/input-k5cMhFI_.js +428 -0
- package/dist/{layout-DQcjBu08.js → layout-DDqeMgFv.js} +2 -2
- package/dist/{layout-CthYckvl.cjs → layout-iSfGrMrH.cjs} +1 -1
- package/dist/navigation-7Y6gHFlj.cjs +1 -0
- package/dist/{navigation-CIVYqPc5.js → navigation-BY8X2w04.js} +31 -31
- package/dist/navigation-BcXCiLE1.js +86 -0
- package/dist/navigation-ByYN6NgX.cjs +1 -0
- package/dist/normalizeSearchText-DLmPiBUZ.js +19 -0
- package/dist/normalizeSearchText-Do0MELpQ.cjs +1 -0
- package/dist/preventDismissingClickActivation-BEBrL9aB.cjs +1 -0
- package/dist/preventDismissingClickActivation-BQFMKRey.js +29 -0
- package/dist/primitives/accessibility.cjs +1 -1
- package/dist/primitives/accessibility.mjs +1 -1
- package/dist/primitives/data-display/Avatar/constants/AvatarPropertiesBySize.d.ts +4 -0
- package/dist/primitives/data-display/Avatar/types/AvatarSize.d.ts +1 -1
- package/dist/primitives/data-display/Badge/types/BadgeColor.d.ts +1 -1
- package/dist/primitives/data-display/Chip/types/ChipVariant.d.ts +1 -1
- package/dist/primitives/data-display.cjs +1 -1
- package/dist/primitives/data-display.mjs +7 -8
- package/dist/primitives/feedback/Banner/Banner.d.ts +1 -1
- package/dist/primitives/feedback/Banner/internal/BannerAction.d.ts +1 -1
- package/dist/primitives/feedback.cjs +1 -1
- package/dist/primitives/feedback.mjs +2 -2
- package/dist/primitives/input/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/primitives/input/Autocomplete/internal/AutocompleteInput.d.ts +1 -1
- package/dist/primitives/input/Autocomplete/types/AutocompleteInputProps.d.ts +8 -1
- package/dist/primitives/input/Button/types/ButtonColor.d.ts +1 -1
- package/dist/primitives/input/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/primitives/input/RadioGroup/types/RadioGroupProps.d.ts +3 -1
- package/dist/primitives/input.cjs +1 -1
- package/dist/primitives/input.mjs +3 -3
- package/dist/primitives/navigation/Tabs/types/TabsSize.d.ts +1 -1
- package/dist/primitives/navigation.cjs +1 -1
- package/dist/primitives/navigation.mjs +2 -2
- package/dist/primitives/surfaces/Card/Card.d.ts +1 -1
- package/dist/primitives/surfaces/Card/internal/CardRoot.d.ts +1 -1
- package/dist/primitives/surfaces/Card/types/CardRootProps.d.ts +0 -1
- package/dist/primitives/surfaces/Tooltip/Tooltip.d.ts +1 -0
- package/dist/primitives/surfaces/Tooltip/__stories__/findTooltip.d.ts +1 -0
- package/dist/primitives/surfaces/Tooltip/internal/TooltipBody.d.ts +2 -8
- package/dist/primitives/surfaces/Tooltip/types/TooltipBodyProps.d.ts +6 -0
- package/dist/primitives/surfaces/index.d.ts +1 -0
- package/dist/primitives/surfaces.cjs +1 -1
- package/dist/primitives/surfaces.mjs +2 -2
- package/dist/primitives/typography/Heading/types/HeadingProps.d.ts +1 -1
- package/dist/primitives/typography.cjs +1 -1
- package/dist/primitives/typography.mjs +3 -3
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.mjs +45 -46
- package/dist/{settings-CPXhrmbK.cjs → settings-DT5bEO6A.cjs} +1 -1
- package/dist/{settings-BgVuLpg9.js → settings-XGSJtobU.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/surfaces-q8voTXEJ.cjs +1 -0
- package/dist/{surfaces-BLsR5ka0.js → surfaces-vhSZBmbz.js} +77 -78
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/utils/waitForStorybookFontsLoaded.d.ts +1 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.mjs +87 -77
- package/dist/{typography-DT2eKLvd.js → typography-BPdXzW2T.js} +1 -1
- package/dist/{typography-bKeSMuJd.cjs → typography-CWtuNruY.cjs} +1 -1
- package/dist/utilities.cjs +1 -1
- package/dist/utilities.mjs +11 -10
- package/package.json +1 -1
- package/dist/Avatar-C6WxBgjS.cjs +0 -1
- package/dist/Avatar-ifVlxbx_.js +0 -73
- package/dist/Button-DIw804CX.js +0 -72
- package/dist/Button-DTm1WDzp.cjs +0 -1
- package/dist/Dropdown-1OAJvS1f.js +0 -1000
- package/dist/Dropdown-Bl4OXCf9.cjs +0 -1
- package/dist/Heading-CTRYClCO.cjs +0 -1
- package/dist/ProgressBar-B3xACTV2.js +0 -84
- package/dist/ProgressBar-OpSMnDBz.cjs +0 -1
- package/dist/TabsTabContent-Co27Y2TU.cjs +0 -1
- package/dist/TabsTabContent-DVcObDp6.js +0 -39
- package/dist/TintedIconTile-B1XDtGrF.js +0 -40
- package/dist/TintedIconTile-DO1XJXCQ.cjs +0 -1
- package/dist/Tooltip-Bg9Uk01p.cjs +0 -1
- package/dist/Tooltip-cLCgtFBF.js +0 -124
- package/dist/components/navigation/MenuItem/MenuItem.d.ts +0 -2
- package/dist/components/navigation/MenuItem/parts/MenuItemIcon.d.ts +0 -9
- package/dist/components/navigation/MenuItem/parts/MenuItemIconBoxContainer.d.ts +0 -7
- package/dist/components/navigation/MenuItem/parts/MenuItemIconWithGripSwap.d.ts +0 -8
- package/dist/components/navigation/MenuItem/parts/MenuItemLeftContent.d.ts +0 -19
- package/dist/components/navigation/MenuItem/parts/StyledMenuItemBase.d.ts +0 -25
- package/dist/components/navigation/MenuItem/types/MenuItemDraggableGripMode.d.ts +0 -1
- package/dist/components/navigation/MenuItem/types/MenuItemProps.d.ts +0 -33
- package/dist/components/navigation/MenuItemAvatar/MenuItemAvatar.d.ts +0 -2
- package/dist/components/navigation/MenuItemAvatar/types/MenuItemAvatarProps.d.ts +0 -18
- package/dist/components/navigation/MenuItemDraggable/MenuItemDraggable.d.ts +0 -2
- package/dist/components/navigation/MenuItemDraggable/types/MenuItemDraggableProps.d.ts +0 -20
- package/dist/components/navigation/MenuItemSuggestion/MenuItemSuggestion.d.ts +0 -2
- package/dist/components/navigation/MenuItemSuggestion/types/MenuItemSuggestionProps.d.ts +0 -12
- package/dist/components/navigation/MenuPicker/MenuPicker.d.ts +0 -2
- package/dist/components/navigation/MenuPicker/types/MenuPickerProps.d.ts +0 -15
- package/dist/data-display-BSKGlijb.cjs +0 -1
- package/dist/data-display-BtXCGOGw.js +0 -345
- package/dist/data-display-DtXIhJ4B.js +0 -184
- package/dist/data-display-XV3ht1rC.cjs +0 -2
- package/dist/feedback-Cs-38OH4.cjs +0 -1
- package/dist/feedback-DA-AU5z5.js +0 -38
- package/dist/feedback-DNLERYY9.cjs +0 -1
- package/dist/input-B_rBplmn.cjs +0 -1
- package/dist/input-ChlFcqIS.cjs +0 -1
- package/dist/input-D1oyk0tD.js +0 -421
- package/dist/navigation-B6nka3bW.js +0 -400
- package/dist/navigation-CflGBYv-.cjs +0 -1
- package/dist/navigation-DoInK0Sp.cjs +0 -1
- package/dist/preventDismissingClickActivation-AaqHBLnW.js +0 -45
- package/dist/preventDismissingClickActivation-CIhWvKCu.cjs +0 -1
- package/dist/surfaces-0rL5DoHt.cjs +0 -1
- /package/dist/{handleClickableElementKeyDown-C8Uz61XJ.js → accessibility-C8Uz61XJ.js} +0 -0
- /package/dist/{handleClickableElementKeyDown-CByqtBhO.cjs → accessibility-CByqtBhO.cjs} +0 -0
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { Ta as Z, gl as ee, hc as _e, la as
|
|
1
|
+
import { t as d } from "./isDefined-fMi6eQ4r.js";
|
|
2
|
+
import { Ta as Z, gl as ee, hc as _e, la as he, nt as M } from "./icon-CUE-QGQK.js";
|
|
3
3
|
import { t as I } from "./doNotTranslate-BSVT8Xyd.js";
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as Te, r as ge, t as Ce } from "./theme-B2EaXhye.js";
|
|
5
5
|
import { t as be } from "./mergeClassNames-ClFMR1v0.js";
|
|
6
|
-
import { t as
|
|
7
|
-
import { n as te, r as we, t as xe } from "./ProgressBar-
|
|
6
|
+
import { t as z } from "./Button-CU8BS-Yd.js";
|
|
7
|
+
import { n as te, r as we, t as xe } from "./ProgressBar-D4tKQ7OA.js";
|
|
8
8
|
import { t as y } from "./isRenderableSlot-DT_depzM.js";
|
|
9
9
|
import { t as ye } from "./useProvidedTextDirection-Dk8LBQeF.js";
|
|
10
|
-
import { t as Ae } from "./OverflowingTextWithTooltip-
|
|
10
|
+
import { t as Ae } from "./OverflowingTextWithTooltip-BtB9cGdJ.js";
|
|
11
11
|
import { t as Ne } from "./Separator-0LzwPfOn.js";
|
|
12
|
-
import { useRender as
|
|
13
|
-
import { isNonEmptyArray as
|
|
12
|
+
import { useRender as D } from "@base-ui/react/use-render";
|
|
13
|
+
import { isNonEmptyArray as $, isPositiveInteger as Ee, isString as Pe, isUndefined as Ie } from "@sniptt/guards";
|
|
14
14
|
import { clsx as k } from "clsx";
|
|
15
|
-
import { createContext as oe, useCallback as Re, useContext as j, useEffect as Se, useLayoutEffect as R, useMemo as ke, useRef as
|
|
16
|
-
import { Fragment as S, jsx as
|
|
17
|
-
import { Store as
|
|
18
|
-
import { createPortal as
|
|
19
|
-
var
|
|
15
|
+
import { createContext as oe, useCallback as Re, useContext as j, useEffect as Se, useLayoutEffect as R, useMemo as ke, useRef as We, useState as P, useSyncExternalStore as Oe } from "react";
|
|
16
|
+
import { Fragment as S, jsx as c, jsxs as g } from "react/jsx-runtime";
|
|
17
|
+
import { Store as ze, useStore as qe } from "@base-ui/utils/store";
|
|
18
|
+
import { createPortal as Be } from "react-dom";
|
|
19
|
+
var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) => /* @__PURE__ */ c(z, {
|
|
20
20
|
...t,
|
|
21
21
|
size: "sm",
|
|
22
22
|
variant: "ghost",
|
|
23
|
-
className: be(
|
|
24
|
-
}),
|
|
25
|
-
container:
|
|
23
|
+
className: be(Fe.action, e)
|
|
24
|
+
}), $e = "_container_1ix4w_1", je = "_containerFullWidth_1ix4w_40", Ue = "_header_1ix4w_44", Le = "_iconContainer_1ix4w_53", Ke = "_title_1ix4w_63", He = "_descriptionWrapper_1ix4w_75", Ve = "_descriptionWrapperWithIcon_1ix4w_82", Xe = "_descriptionWrapperWithAction_1ix4w_86", Ge = "_description_1ix4w_75", Je = "_footer_1ix4w_99", Qe = "_closeButton_1ix4w_106", T = {
|
|
25
|
+
container: $e,
|
|
26
26
|
containerFullWidth: je,
|
|
27
27
|
header: Ue,
|
|
28
28
|
iconContainer: Le,
|
|
@@ -33,13 +33,13 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
33
33
|
description: Ge,
|
|
34
34
|
footer: Je,
|
|
35
35
|
closeButton: Qe
|
|
36
|
-
}, Ye = ({ status: e = "info", variant: t = "soft", color: o = we[e], title: s, description: r, fullWidth:
|
|
37
|
-
size:
|
|
36
|
+
}, Ye = ({ status: e = "info", variant: t = "soft", color: o = we[e], title: s, description: r, fullWidth: a = !1, icon: n = /* @__PURE__ */ c(he, {
|
|
37
|
+
size: Te.icon.size.md,
|
|
38
38
|
"aria-hidden": "true"
|
|
39
|
-
}), action: v, closeLabel: f = I("Close"), onDismiss: m, className: _, render:
|
|
39
|
+
}), action: v, closeLabel: f = I("Close"), onDismiss: m, className: _, render: h, ref: u, ...l }) => {
|
|
40
40
|
const i = y(n), p = y(v);
|
|
41
|
-
return
|
|
42
|
-
render:
|
|
41
|
+
return D({
|
|
42
|
+
render: h,
|
|
43
43
|
ref: u,
|
|
44
44
|
state: {
|
|
45
45
|
status: e,
|
|
@@ -47,24 +47,24 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
47
47
|
color: o
|
|
48
48
|
},
|
|
49
49
|
props: {
|
|
50
|
-
...
|
|
51
|
-
className: k(
|
|
50
|
+
...l,
|
|
51
|
+
className: k(T.container, a && T.containerFullWidth, _),
|
|
52
52
|
children: /* @__PURE__ */ g(S, { children: [
|
|
53
53
|
/* @__PURE__ */ g("div", {
|
|
54
|
-
className:
|
|
54
|
+
className: T.header,
|
|
55
55
|
children: [
|
|
56
|
-
i && /* @__PURE__ */
|
|
57
|
-
className:
|
|
56
|
+
i && /* @__PURE__ */ c("div", {
|
|
57
|
+
className: T.iconContainer,
|
|
58
58
|
children: n
|
|
59
59
|
}),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
className:
|
|
60
|
+
/* @__PURE__ */ c("div", {
|
|
61
|
+
className: T.title,
|
|
62
62
|
children: s
|
|
63
63
|
}),
|
|
64
|
-
|
|
64
|
+
d(m) && /* @__PURE__ */ c(z, {
|
|
65
65
|
type: "button",
|
|
66
|
-
startIcon: /* @__PURE__ */
|
|
67
|
-
className:
|
|
66
|
+
startIcon: /* @__PURE__ */ c(ee, { "aria-hidden": "true" }),
|
|
67
|
+
className: T.closeButton,
|
|
68
68
|
variant: "ghost",
|
|
69
69
|
size: "sm",
|
|
70
70
|
"aria-label": f,
|
|
@@ -72,83 +72,84 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
72
72
|
})
|
|
73
73
|
]
|
|
74
74
|
}),
|
|
75
|
-
y(r) && /* @__PURE__ */
|
|
76
|
-
className: k(
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
-
className:
|
|
75
|
+
y(r) && /* @__PURE__ */ c("div", {
|
|
76
|
+
className: k(T.descriptionWrapper, i && T.descriptionWrapperWithIcon, p && T.descriptionWrapperWithAction),
|
|
77
|
+
children: /* @__PURE__ */ c("div", {
|
|
78
|
+
className: T.description,
|
|
79
79
|
children: r
|
|
80
80
|
})
|
|
81
81
|
}),
|
|
82
|
-
p && /* @__PURE__ */
|
|
83
|
-
className:
|
|
82
|
+
p && /* @__PURE__ */ c("div", {
|
|
83
|
+
className: T.footer,
|
|
84
84
|
children: v
|
|
85
85
|
})
|
|
86
86
|
] })
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
|
-
},
|
|
89
|
+
}, co = Object.assign(Ye, { Action: De }), Ze = "_banner_qbpcz_1", et = "_embedded_qbpcz_6", tt = "_bannerContent_qbpcz_10", ot = "_icon_qbpcz_18", st = "_bannerText_qbpcz_28", rt = "_compact_qbpcz_33", nt = "_fullWidth_qbpcz_58", E = {
|
|
90
90
|
banner: Ze,
|
|
91
91
|
embedded: et,
|
|
92
92
|
bannerContent: tt,
|
|
93
93
|
icon: ot,
|
|
94
94
|
bannerText: st,
|
|
95
|
-
compact: rt
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
compact: rt,
|
|
96
|
+
fullWidth: nt
|
|
97
|
+
}, it = ({ children: e, layout: t = "standard", variant: o = "soft", embedded: s = !1, fullWidth: r = !1, icon: a = /* @__PURE__ */ c(Z, { "aria-hidden": "true" }), className: n, ...v }) => {
|
|
98
|
+
const f = t === "compact", m = !f && Pe(e);
|
|
99
|
+
return /* @__PURE__ */ c(te, {
|
|
100
|
+
...v,
|
|
101
|
+
className: k(E.banner, f && E.compact, s && E.embedded, r && E.fullWidth, n),
|
|
101
102
|
variant: o,
|
|
102
103
|
"data-layout": t,
|
|
103
104
|
children: /* @__PURE__ */ g("div", {
|
|
104
105
|
className: E.bannerContent,
|
|
105
|
-
children: [y(
|
|
106
|
+
children: [y(a) && /* @__PURE__ */ c("span", {
|
|
106
107
|
className: E.icon,
|
|
107
|
-
children:
|
|
108
|
-
}), /* @__PURE__ */
|
|
108
|
+
children: a
|
|
109
|
+
}), /* @__PURE__ */ c("div", {
|
|
109
110
|
className: E.bannerText,
|
|
110
|
-
children:
|
|
111
|
+
children: m ? /* @__PURE__ */ c(Ae, {
|
|
111
112
|
isFocusable: !0,
|
|
112
|
-
text: /* @__PURE__ */
|
|
113
|
+
text: /* @__PURE__ */ c(S, { children: e }),
|
|
113
114
|
tooltipContent: e
|
|
114
115
|
}) : e
|
|
115
116
|
})]
|
|
116
117
|
})
|
|
117
118
|
});
|
|
118
|
-
},
|
|
119
|
+
}, lo = Object.assign(it, { Action: te.Action }), A = (e) => e.status === "visible", q = ({ store: e, toastsToClose: t, nextToasts: o = e.state.toasts }) => {
|
|
119
120
|
const s = t.filter((n) => A(n) && e.state.toasts.includes(n)), r = o.map((n) => s.includes(n) ? {
|
|
120
121
|
...n,
|
|
121
122
|
status: "closing"
|
|
122
|
-
} : n),
|
|
123
|
-
e.set("toasts",
|
|
123
|
+
} : n), a = e.state.mountedToasterCount > 0;
|
|
124
|
+
e.set("toasts", a ? r : r.filter(A));
|
|
124
125
|
for (const n of s) n.notification.onClose?.();
|
|
125
126
|
}, se = oe(void 0), N = () => {
|
|
126
127
|
const e = j(se);
|
|
127
|
-
if (!
|
|
128
|
+
if (!d(e)) throw new Error(I("Toast components must be used within a ToastProvider."));
|
|
128
129
|
return e;
|
|
129
130
|
}, re = () => {
|
|
130
131
|
const e = N();
|
|
131
132
|
return { closeToast: (o) => {
|
|
132
133
|
if (!e.lifecycle.isActive()) return;
|
|
133
|
-
const s = e.state.toasts.filter((r) => A(r) && (!
|
|
134
|
-
|
|
134
|
+
const s = e.state.toasts.filter((r) => A(r) && (!d(o) || r.notification.id === o));
|
|
135
|
+
$(s) && q({
|
|
135
136
|
store: e,
|
|
136
137
|
toastsToClose: s
|
|
137
138
|
});
|
|
138
139
|
} };
|
|
139
|
-
}, Q = 0, Y = () => (Q += 1, `toast-${Q}`),
|
|
140
|
+
}, Q = 0, Y = () => (Q += 1, `toast-${Q}`), at = () => {
|
|
140
141
|
const e = N();
|
|
141
142
|
return { enqueueToast: ke(() => {
|
|
142
143
|
function t(o) {
|
|
143
|
-
if (!
|
|
144
|
+
if (!d(o)) return;
|
|
144
145
|
if (!e.lifecycle.isActive()) return Y();
|
|
145
|
-
const { dedupeKey: s, ...r } = o, { toasts:
|
|
146
|
-
if (
|
|
146
|
+
const { dedupeKey: s, ...r } = o, { toasts: a, limit: n } = e.state, v = a.filter(A), f = d(s) ? v.find((h) => h.dedupeKey === s) : void 0;
|
|
147
|
+
if (d(f)) return f.notification.id;
|
|
147
148
|
const m = Y(), _ = Math.max(0, v.length - n + 1);
|
|
148
|
-
return
|
|
149
|
+
return q({
|
|
149
150
|
store: e,
|
|
150
151
|
toastsToClose: v.slice(0, _),
|
|
151
|
-
nextToasts: [...
|
|
152
|
+
nextToasts: [...a, {
|
|
152
153
|
notification: {
|
|
153
154
|
...r,
|
|
154
155
|
id: m
|
|
@@ -160,11 +161,11 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
160
161
|
}
|
|
161
162
|
return t;
|
|
162
163
|
}, [e]) };
|
|
163
|
-
},
|
|
164
|
+
}, ct = ({ store: e, id: t, ...o }) => {
|
|
164
165
|
if (!e.lifecycle.isActive()) return;
|
|
165
166
|
const s = e.state.toasts.find((n) => n.notification.id === t && A(n)), r = Object.keys(o);
|
|
166
|
-
if (!
|
|
167
|
-
const
|
|
167
|
+
if (!d(s) || !$(r)) return;
|
|
168
|
+
const a = r.includes("duration") || d(s.notification.progress) && r.includes("progress") && !d(o.progress);
|
|
168
169
|
e.set("toasts", e.state.toasts.map((n) => n === s ? {
|
|
169
170
|
...n,
|
|
170
171
|
notification: {
|
|
@@ -172,37 +173,37 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
172
173
|
...o,
|
|
173
174
|
id: t
|
|
174
175
|
},
|
|
175
|
-
...
|
|
176
|
+
...a ? { durationRevision: (n.durationRevision ?? 0) + 1 } : {}
|
|
176
177
|
} : n));
|
|
177
|
-
},
|
|
178
|
+
}, lt = () => {
|
|
178
179
|
const e = N();
|
|
179
|
-
return { updateToast: Re((t) =>
|
|
180
|
+
return { updateToast: Re((t) => ct({
|
|
180
181
|
store: e,
|
|
181
182
|
...t
|
|
182
183
|
}), [e]) };
|
|
183
|
-
},
|
|
184
|
-
const { closeToast: e } = re(), { enqueueToast: t } =
|
|
184
|
+
}, uo = () => {
|
|
185
|
+
const { closeToast: e } = re(), { enqueueToast: t } = at(), { updateToast: o } = lt();
|
|
185
186
|
return {
|
|
186
187
|
enqueueToast: t,
|
|
187
188
|
closeToast: e,
|
|
188
189
|
updateToast: o
|
|
189
190
|
};
|
|
190
|
-
}, dt = "_root_181ka_1",
|
|
191
|
+
}, dt = "_root_181ka_1", ut = "_progress_181ka_19", vt = "_header_181ka_30", ft = "_message_181ka_40", mt = "_icon_181ka_45", pt = "_actions_181ka_50", _t = "_description_181ka_56", ht = "_footer_181ka_65", Tt = "_footerAction_181ka_69", gt = "_closeButton_181ka_76", b = {
|
|
191
192
|
root: dt,
|
|
192
|
-
progress:
|
|
193
|
-
header:
|
|
194
|
-
message:
|
|
195
|
-
icon:
|
|
196
|
-
actions:
|
|
197
|
-
description:
|
|
198
|
-
footer:
|
|
193
|
+
progress: ut,
|
|
194
|
+
header: vt,
|
|
195
|
+
message: ft,
|
|
196
|
+
icon: mt,
|
|
197
|
+
actions: pt,
|
|
198
|
+
description: _t,
|
|
199
|
+
footer: ht,
|
|
199
200
|
footerAction: Tt,
|
|
200
|
-
closeButton:
|
|
201
|
+
closeButton: gt
|
|
201
202
|
}, U = oe({
|
|
202
203
|
durationRevision: 0,
|
|
203
204
|
isActive: !0
|
|
204
|
-
}),
|
|
205
|
-
const { durationRevision: n, isActive: v, lifecycle: f, id: m, rendererKey: _, timingOverrides:
|
|
205
|
+
}), Ct = ({ clock: e, onClockChange: t, duration: o, progress: s, isPaused: r, onClose: a }) => {
|
|
206
|
+
const { durationRevision: n, isActive: v, lifecycle: f, id: m, rendererKey: _, timingOverrides: h } = j(U), u = d(f) && d(m) && d(_), l = u ? void 0 : e, i = d(s), p = d(h) && Object.prototype.propertyIsEnumerable.call(h, "duration"), x = d(h) && Object.prototype.propertyIsEnumerable.call(h, "progress");
|
|
206
207
|
return R(() => {
|
|
207
208
|
if (u) {
|
|
208
209
|
t(f.updateRenderer({
|
|
@@ -216,16 +217,16 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
216
217
|
}));
|
|
217
218
|
return;
|
|
218
219
|
}
|
|
219
|
-
|
|
220
|
+
l?.update({
|
|
220
221
|
duration: o,
|
|
221
222
|
durationRevision: n,
|
|
222
223
|
isPaused: r,
|
|
223
224
|
isProgress: i,
|
|
224
225
|
isActive: v,
|
|
225
|
-
onClose:
|
|
226
|
+
onClose: a
|
|
226
227
|
});
|
|
227
228
|
}, [
|
|
228
|
-
|
|
229
|
+
l,
|
|
229
230
|
t,
|
|
230
231
|
u,
|
|
231
232
|
o,
|
|
@@ -233,7 +234,7 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
233
234
|
r,
|
|
234
235
|
i,
|
|
235
236
|
v,
|
|
236
|
-
|
|
237
|
+
a,
|
|
237
238
|
f,
|
|
238
239
|
m,
|
|
239
240
|
_,
|
|
@@ -247,16 +248,16 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
247
248
|
});
|
|
248
249
|
return;
|
|
249
250
|
}
|
|
250
|
-
|
|
251
|
+
l?.stop();
|
|
251
252
|
}, [
|
|
252
|
-
|
|
253
|
+
l,
|
|
253
254
|
f,
|
|
254
255
|
m,
|
|
255
256
|
_,
|
|
256
257
|
u
|
|
257
258
|
]), null;
|
|
258
|
-
},
|
|
259
|
-
if (!t || !
|
|
259
|
+
}, bt = ({ element: e, isFocused: t, onFocusChange: o }) => (R(() => {
|
|
260
|
+
if (!t || !d(e)) return;
|
|
260
261
|
const s = () => {
|
|
261
262
|
e.contains(e.ownerDocument.activeElement) || o(!1);
|
|
262
263
|
};
|
|
@@ -270,35 +271,35 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
270
271
|
e,
|
|
271
272
|
t,
|
|
272
273
|
o
|
|
273
|
-
]), null), ne = 6e3, ie = (e) => Number.isFinite(e) && e > 0,
|
|
274
|
-
countdown:
|
|
275
|
-
toastCountdown:
|
|
276
|
-
},
|
|
274
|
+
]), null), ne = 6e3, ie = (e) => Number.isFinite(e) && e > 0, wt = "_countdown_1vuo8_1", xt = "_toastCountdown_1vuo8_1", yt = {
|
|
275
|
+
countdown: wt,
|
|
276
|
+
toastCountdown: xt
|
|
277
|
+
}, At = ({ progress: e, duration: t, remainingDuration: o, revision: s, isPaused: r, barColor: a }) => d(e) ? /* @__PURE__ */ c(xe, {
|
|
277
278
|
value: e,
|
|
278
|
-
barColor:
|
|
279
|
-
}) : ie(t) ? /* @__PURE__ */
|
|
280
|
-
className:
|
|
279
|
+
barColor: a
|
|
280
|
+
}) : ie(t) ? /* @__PURE__ */ c("div", {
|
|
281
|
+
className: yt.countdown,
|
|
281
282
|
"data-paused": r || void 0,
|
|
282
283
|
style: {
|
|
283
|
-
"--toast-countdown-color":
|
|
284
|
+
"--toast-countdown-color": a,
|
|
284
285
|
"--toast-countdown-width": `${o / t * 100}%`,
|
|
285
286
|
"--toast-countdown-duration": `${o}ms`
|
|
286
287
|
}
|
|
287
|
-
}, s) : null,
|
|
288
|
-
let t, o = 0, s, r,
|
|
288
|
+
}, s) : null, Nt = 2 ** 31 - 1, Et = ({ onChange: e }) => {
|
|
289
|
+
let t, o = 0, s, r, a = 0, n = 0, v = !1;
|
|
289
290
|
const f = () => {
|
|
290
|
-
n += 1,
|
|
291
|
+
n += 1, d(s) && (o = Math.max(0, o - (performance.now() - s)), s = void 0), clearTimeout(r), r = void 0;
|
|
291
292
|
}, m = () => {
|
|
292
|
-
|
|
293
|
+
d(t) && (a += 1, e({
|
|
293
294
|
duration: t.duration,
|
|
294
295
|
remainingDuration: o,
|
|
295
|
-
revision:
|
|
296
|
+
revision: a,
|
|
296
297
|
isPaused: t.isPaused || !t.isActive
|
|
297
298
|
}));
|
|
298
299
|
}, _ = () => {
|
|
299
300
|
v || (f(), v = !0, o = 0, m(), t?.onClose?.());
|
|
300
|
-
},
|
|
301
|
-
if (!
|
|
301
|
+
}, h = () => d(t) && t.isActive && !t.isPaused && !t.isProgress && ie(t.duration) && !v, u = () => {
|
|
302
|
+
if (!h()) return;
|
|
302
303
|
s = performance.now();
|
|
303
304
|
const i = n;
|
|
304
305
|
r = setTimeout(() => {
|
|
@@ -309,11 +310,11 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
309
310
|
}
|
|
310
311
|
_();
|
|
311
312
|
}
|
|
312
|
-
}, Math.min(o,
|
|
313
|
+
}, Math.min(o, Nt));
|
|
313
314
|
};
|
|
314
315
|
return {
|
|
315
316
|
update: (i) => {
|
|
316
|
-
const p = !
|
|
317
|
+
const p = !d(t) || i.duration !== t.duration || i.durationRevision !== t.durationRevision || t.isProgress && !i.isProgress, x = p || i.isProgress !== t?.isProgress || i.isPaused !== t?.isPaused || i.isActive !== t?.isActive, C = !d(s) && h();
|
|
317
318
|
if (!x && !C) {
|
|
318
319
|
t = i;
|
|
319
320
|
return;
|
|
@@ -332,50 +333,50 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
332
333
|
};
|
|
333
334
|
const s = /* @__PURE__ */ new Set();
|
|
334
335
|
return {
|
|
335
|
-
...
|
|
336
|
+
...Et({ onChange: (r) => {
|
|
336
337
|
o = r;
|
|
337
|
-
for (const
|
|
338
|
+
for (const a of s) a();
|
|
338
339
|
} }),
|
|
339
340
|
getSnapshot: () => o,
|
|
340
341
|
subscribe: (r) => (s.add(r), () => {
|
|
341
342
|
s.delete(r);
|
|
342
343
|
})
|
|
343
344
|
};
|
|
344
|
-
},
|
|
345
|
-
const { lifecycle: o, id: s, rendererKey: r } = j(U), [
|
|
345
|
+
}, Pt = ({ duration: e, isPaused: t }) => {
|
|
346
|
+
const { lifecycle: o, id: s, rendererKey: r } = j(U), [a, n] = P(() => (d(o) && d(s) && d(r) ? o.getCountdown(s) : void 0) ?? ae({
|
|
346
347
|
duration: e,
|
|
347
348
|
isPaused: t
|
|
348
349
|
}));
|
|
349
350
|
return {
|
|
350
|
-
countdown:
|
|
351
|
-
clock:
|
|
351
|
+
countdown: Oe(a.subscribe, a.getSnapshot, a.getSnapshot),
|
|
352
|
+
clock: a,
|
|
352
353
|
setClock: n
|
|
353
354
|
};
|
|
354
|
-
},
|
|
355
|
-
neutral:
|
|
356
|
-
error:
|
|
355
|
+
}, It = {
|
|
356
|
+
neutral: M,
|
|
357
|
+
error: M,
|
|
357
358
|
success: _e,
|
|
358
359
|
info: Z,
|
|
359
|
-
warning:
|
|
360
|
-
},
|
|
361
|
-
const L = ge(), [ue, K] = P(!1), [H,
|
|
360
|
+
warning: M
|
|
361
|
+
}, Rt = ({ children: e, description: t, icon: o, iconLabel: s, action: r, progress: a, duration: n = ne, onCancel: v, onClose: f, cancelLabel: m = I("Cancel"), closeLabel: _ = I("Close"), status: h = "neutral", role: u = "status", className: l, onMouseEnter: i, onMouseLeave: p, onFocus: x, onBlur: C, render: W, ref: le, ...de }) => {
|
|
362
|
+
const L = ge(), [ue, K] = P(!1), [H, B] = P(!1), [ve, fe] = P(null), V = ue || H, { countdown: O, clock: X, setClock: me } = Pt({
|
|
362
363
|
duration: n,
|
|
363
364
|
isPaused: V
|
|
364
|
-
}), pe =
|
|
365
|
+
}), pe = It[h], G = L.snackBar[h === "neutral" ? "default" : h], J = Ie(o) ? /* @__PURE__ */ c(pe, {
|
|
365
366
|
"aria-label": s,
|
|
366
|
-
"aria-hidden": !
|
|
367
|
+
"aria-hidden": !d(s),
|
|
367
368
|
color: G.color,
|
|
368
369
|
size: L.icon.size.md
|
|
369
370
|
}) : o;
|
|
370
371
|
return /* @__PURE__ */ g(S, { children: [
|
|
371
|
-
|
|
372
|
-
render:
|
|
373
|
-
ref: [
|
|
372
|
+
D({
|
|
373
|
+
render: W,
|
|
374
|
+
ref: [le ?? null, fe],
|
|
374
375
|
props: {
|
|
375
376
|
role: u,
|
|
376
377
|
"aria-live": u === "alert" ? "assertive" : "polite",
|
|
377
|
-
...
|
|
378
|
-
className: k(b.root,
|
|
378
|
+
...de,
|
|
379
|
+
className: k(b.root, l),
|
|
379
380
|
onMouseEnter: (w) => {
|
|
380
381
|
K(!0), i?.(w);
|
|
381
382
|
},
|
|
@@ -383,47 +384,47 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
383
384
|
K(!1), p?.(w);
|
|
384
385
|
},
|
|
385
386
|
onFocus: (w) => {
|
|
386
|
-
|
|
387
|
+
B(!0), x?.(w);
|
|
387
388
|
},
|
|
388
389
|
onBlur: (w) => {
|
|
389
|
-
w.currentTarget.contains(w.relatedTarget) ||
|
|
390
|
+
w.currentTarget.contains(w.relatedTarget) || B(!1), C?.(w);
|
|
390
391
|
},
|
|
391
392
|
children: /* @__PURE__ */ g(S, { children: [
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ c("div", {
|
|
393
394
|
className: b.progress,
|
|
394
395
|
"aria-hidden": !0,
|
|
395
|
-
children: /* @__PURE__ */
|
|
396
|
+
children: /* @__PURE__ */ c(At, {
|
|
396
397
|
barColor: G.backgroundColor,
|
|
397
|
-
progress:
|
|
398
|
-
duration:
|
|
399
|
-
remainingDuration:
|
|
400
|
-
revision:
|
|
401
|
-
isPaused:
|
|
398
|
+
progress: a,
|
|
399
|
+
duration: O.duration,
|
|
400
|
+
remainingDuration: O.remainingDuration,
|
|
401
|
+
revision: O.revision,
|
|
402
|
+
isPaused: O.isPaused
|
|
402
403
|
})
|
|
403
404
|
}),
|
|
404
405
|
/* @__PURE__ */ g("div", {
|
|
405
406
|
className: b.header,
|
|
406
407
|
children: [
|
|
407
|
-
y(J) && /* @__PURE__ */
|
|
408
|
+
y(J) && /* @__PURE__ */ c("div", {
|
|
408
409
|
className: b.icon,
|
|
409
410
|
children: J
|
|
410
411
|
}),
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ c("div", {
|
|
412
413
|
className: b.message,
|
|
413
414
|
children: e
|
|
414
415
|
}),
|
|
415
416
|
/* @__PURE__ */ g("div", {
|
|
416
417
|
className: b.actions,
|
|
417
|
-
children: [
|
|
418
|
+
children: [d(v) && y(m) && /* @__PURE__ */ c(z, {
|
|
418
419
|
onClick: v,
|
|
419
420
|
size: "sm",
|
|
420
421
|
variant: "ghost",
|
|
421
422
|
style: { fontWeight: "var(--t-font-weight-regular)" },
|
|
422
423
|
children: m
|
|
423
|
-
}),
|
|
424
|
+
}), d(f) && /* @__PURE__ */ c(z, {
|
|
424
425
|
title: _,
|
|
425
426
|
"aria-label": _,
|
|
426
|
-
startIcon: /* @__PURE__ */
|
|
427
|
+
startIcon: /* @__PURE__ */ c(ee, {}),
|
|
427
428
|
className: b.closeButton,
|
|
428
429
|
variant: "ghost",
|
|
429
430
|
size: "sm",
|
|
@@ -432,13 +433,13 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
432
433
|
})
|
|
433
434
|
]
|
|
434
435
|
}),
|
|
435
|
-
y(t) && /* @__PURE__ */
|
|
436
|
+
y(t) && /* @__PURE__ */ c("div", {
|
|
436
437
|
className: b.description,
|
|
437
438
|
children: t
|
|
438
439
|
}),
|
|
439
440
|
y(r) && /* @__PURE__ */ g("div", {
|
|
440
441
|
className: b.footer,
|
|
441
|
-
children: [/* @__PURE__ */
|
|
442
|
+
children: [/* @__PURE__ */ c(Ne, {}), /* @__PURE__ */ c("div", {
|
|
442
443
|
className: b.footerAction,
|
|
443
444
|
children: r
|
|
444
445
|
})]
|
|
@@ -446,45 +447,45 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
446
447
|
] })
|
|
447
448
|
}
|
|
448
449
|
}),
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ c(bt, {
|
|
450
451
|
element: ve,
|
|
451
452
|
isFocused: H,
|
|
452
|
-
onFocusChange:
|
|
453
|
+
onFocusChange: B
|
|
453
454
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ c(Ct, {
|
|
455
456
|
clock: X,
|
|
456
457
|
onClockChange: me,
|
|
457
458
|
duration: n,
|
|
458
|
-
progress:
|
|
459
|
+
progress: a,
|
|
459
460
|
isPaused: V,
|
|
460
461
|
onClose: f
|
|
461
462
|
})
|
|
462
463
|
] });
|
|
463
464
|
}, ce = (e) => {
|
|
464
465
|
if (!Ee(e)) throw new Error(I("Toast limit must be a positive integer."));
|
|
465
|
-
},
|
|
466
|
+
}, St = ({ store: e, limit: t }) => {
|
|
466
467
|
if (ce(t), e.state.limit === t) return;
|
|
467
468
|
e.set("limit", t);
|
|
468
469
|
const o = e.state.toasts.filter(A), s = Math.max(0, o.length - t);
|
|
469
|
-
s !== 0 &&
|
|
470
|
+
s !== 0 && q({
|
|
470
471
|
store: e,
|
|
471
472
|
toastsToClose: o.slice(0, s)
|
|
472
473
|
});
|
|
473
|
-
},
|
|
474
|
+
}, kt = ({ limit: e }) => {
|
|
474
475
|
const t = N();
|
|
475
|
-
return Se(() => t.lifecycle.mount(), [t]), R(() =>
|
|
476
|
+
return Se(() => t.lifecycle.mount(), [t]), R(() => St({
|
|
476
477
|
store: t,
|
|
477
478
|
limit: e
|
|
478
479
|
}), [t, e]), null;
|
|
479
|
-
},
|
|
480
|
+
}, Wt = ({ store: e, toast: t }) => {
|
|
480
481
|
const { toasts: o } = e.state;
|
|
481
482
|
t.status === "closing" && o.includes(t) && e.set("toasts", o.filter((s) => s !== t));
|
|
482
483
|
}, Ot = (e) => {
|
|
483
484
|
const t = /* @__PURE__ */ new Map();
|
|
484
485
|
let o = !1, s = !1, r = 0;
|
|
485
|
-
const
|
|
486
|
-
const
|
|
487
|
-
if (l
|
|
486
|
+
const a = (u) => {
|
|
487
|
+
const l = t.get(u);
|
|
488
|
+
if (d(l)) return l;
|
|
488
489
|
const i = {
|
|
489
490
|
countdown: ae({
|
|
490
491
|
duration: ne,
|
|
@@ -495,37 +496,37 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
495
496
|
return t.set(u, i), i;
|
|
496
497
|
}, n = (u) => {
|
|
497
498
|
if (!o) return;
|
|
498
|
-
const
|
|
499
|
-
if (!l
|
|
499
|
+
const l = t.get(u);
|
|
500
|
+
if (!d(l?.pendingExits) || l.pendingExits.size > 0) return;
|
|
500
501
|
const i = e.state.toasts.find((p) => p.notification.id === u);
|
|
501
|
-
|
|
502
|
+
d(i) && Wt({
|
|
502
503
|
store: e,
|
|
503
504
|
toast: i
|
|
504
505
|
});
|
|
505
506
|
}, v = () => {
|
|
506
|
-
for (const [u,
|
|
507
|
+
for (const [u, l] of t) {
|
|
507
508
|
const i = e.state.toasts.find((C) => C.notification.id === u);
|
|
508
|
-
if (!
|
|
509
|
-
|
|
509
|
+
if (!d(i)) {
|
|
510
|
+
l.countdown.stop(), t.delete(u);
|
|
510
511
|
continue;
|
|
511
512
|
}
|
|
512
|
-
const p =
|
|
513
|
-
|
|
514
|
-
const x = !o ||
|
|
515
|
-
|
|
513
|
+
const p = l.renderers.values().next().value ?? l.lastRenderer;
|
|
514
|
+
l.lastRenderer = p;
|
|
515
|
+
const x = !o || l.renderers.size === 0 || [...l.renderers.values()].some((C) => C.isPaused);
|
|
516
|
+
l.countdown.update({
|
|
516
517
|
duration: p?.duration ?? i.notification.duration ?? 6e3,
|
|
517
518
|
durationRevision: i.durationRevision ?? 0,
|
|
518
|
-
isProgress: p?.isProgress ??
|
|
519
|
+
isProgress: p?.isProgress ?? d(i.notification.progress),
|
|
519
520
|
isPaused: x,
|
|
520
521
|
isActive: i.status === "visible",
|
|
521
522
|
onClose: () => {
|
|
522
|
-
const C = e.state.toasts.find((
|
|
523
|
-
!o || !
|
|
523
|
+
const C = e.state.toasts.find((W) => W.notification.id === u && A(W));
|
|
524
|
+
!o || !d(C) || q({
|
|
524
525
|
store: e,
|
|
525
526
|
toastsToClose: [C]
|
|
526
527
|
});
|
|
527
528
|
}
|
|
528
|
-
}), i.status !== "visible" && (
|
|
529
|
+
}), i.status !== "visible" && (l.pendingExits ??= new Set(l.renderers.keys()), n(u));
|
|
529
530
|
}
|
|
530
531
|
};
|
|
531
532
|
return {
|
|
@@ -535,58 +536,58 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
535
536
|
return v(), () => {
|
|
536
537
|
o = !1, u();
|
|
537
538
|
for (const i of t.values()) i.countdown.stop();
|
|
538
|
-
const
|
|
539
|
+
const l = ++r;
|
|
539
540
|
queueMicrotask(() => {
|
|
540
|
-
o || r !==
|
|
541
|
+
o || r !== l || (s = !0, t.clear(), e.set("toasts", []));
|
|
541
542
|
});
|
|
542
543
|
};
|
|
543
544
|
},
|
|
544
545
|
isActive: () => !s,
|
|
545
546
|
getCountdown: (u) => t.get(u)?.countdown,
|
|
546
|
-
updateRenderer: ({ id: u, key:
|
|
547
|
-
const p =
|
|
548
|
-
return p.renderers.has(
|
|
547
|
+
updateRenderer: ({ id: u, key: l, configuration: i }) => {
|
|
548
|
+
const p = a(u);
|
|
549
|
+
return p.renderers.has(l) || (p.countdown.stop(), p.pendingExits?.add(l)), p.renderers.set(l, i), v(), p.countdown;
|
|
549
550
|
},
|
|
550
|
-
removeRenderer: ({ id: u, key:
|
|
551
|
+
removeRenderer: ({ id: u, key: l }) => {
|
|
551
552
|
const i = t.get(u);
|
|
552
|
-
|
|
553
|
+
d(i) && (i.renderers.delete(l), i.pendingExits?.delete(l), v());
|
|
553
554
|
},
|
|
554
|
-
finishExit: ({ id: u, key:
|
|
555
|
-
t.get(u)?.pendingExits?.delete(
|
|
555
|
+
finishExit: ({ id: u, key: l }) => {
|
|
556
|
+
t.get(u)?.pendingExits?.delete(l), n(u);
|
|
556
557
|
}
|
|
557
558
|
};
|
|
558
|
-
},
|
|
559
|
+
}, zt = (e = 3) => {
|
|
559
560
|
ce(e);
|
|
560
|
-
const t = new
|
|
561
|
+
const t = new ze({
|
|
561
562
|
toasts: [],
|
|
562
563
|
limit: e,
|
|
563
564
|
mountedToasterCount: 0
|
|
564
565
|
});
|
|
565
566
|
return Object.assign(t, { lifecycle: Ot(t) });
|
|
566
|
-
},
|
|
567
|
-
const [o] = P(() =>
|
|
567
|
+
}, vo = ({ children: e, limit: t = 3 }) => {
|
|
568
|
+
const [o] = P(() => zt(t));
|
|
568
569
|
return /* @__PURE__ */ g(se.Provider, {
|
|
569
570
|
value: o,
|
|
570
|
-
children: [e, /* @__PURE__ */
|
|
571
|
+
children: [e, /* @__PURE__ */ c(kt, { limit: t })]
|
|
571
572
|
});
|
|
572
|
-
},
|
|
573
|
-
root:
|
|
574
|
-
item:
|
|
575
|
-
itemContent:
|
|
576
|
-
},
|
|
573
|
+
}, qt = "_root_1q2cc_1", Bt = "_item_1q2cc_20", Mt = "_itemContent_1q2cc_47", F = {
|
|
574
|
+
root: qt,
|
|
575
|
+
item: Bt,
|
|
576
|
+
itemContent: Mt
|
|
577
|
+
}, Ft = () => qe(N(), (e) => e.toasts), Dt = ({ elementRef: e, toastEntry: t, rendererKey: o }) => {
|
|
577
578
|
const s = N();
|
|
578
579
|
return R(() => {
|
|
579
580
|
if (t.status === "visible") return;
|
|
580
581
|
const r = () => s.lifecycle.finishExit({
|
|
581
582
|
id: t.notification.id,
|
|
582
583
|
key: o
|
|
583
|
-
}),
|
|
584
|
-
if (
|
|
584
|
+
}), a = e.current?.getAnimations?.() ?? [];
|
|
585
|
+
if (!$(a)) {
|
|
585
586
|
r();
|
|
586
587
|
return;
|
|
587
588
|
}
|
|
588
589
|
let n = !1;
|
|
589
|
-
return Promise.allSettled(
|
|
590
|
+
return Promise.allSettled(a.map((v) => v.finished)).then(() => {
|
|
590
591
|
n || r();
|
|
591
592
|
}), () => {
|
|
592
593
|
n = !0;
|
|
@@ -598,24 +599,24 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
598
599
|
o
|
|
599
600
|
]), null;
|
|
600
601
|
}, $t = ({ toastEntry: e, getToastProps: t, onClose: o }) => {
|
|
601
|
-
const { notification: s, status: r, durationRevision:
|
|
602
|
-
return /* @__PURE__ */ g(S, { children: [/* @__PURE__ */
|
|
603
|
-
ref:
|
|
604
|
-
className:
|
|
602
|
+
const { notification: s, status: r, durationRevision: a = 0 } = e, { id: n, ...v } = s, f = N(), m = t?.(s), [_] = P(() => /* @__PURE__ */ Symbol()), h = We(null);
|
|
603
|
+
return /* @__PURE__ */ g(S, { children: [/* @__PURE__ */ c("div", {
|
|
604
|
+
ref: h,
|
|
605
|
+
className: F.item,
|
|
605
606
|
"data-exiting": r === "closing" || void 0,
|
|
606
607
|
inert: r === "closing",
|
|
607
|
-
children: /* @__PURE__ */
|
|
608
|
-
className:
|
|
609
|
-
children: /* @__PURE__ */
|
|
608
|
+
children: /* @__PURE__ */ c("div", {
|
|
609
|
+
className: F.itemContent,
|
|
610
|
+
children: /* @__PURE__ */ c(U.Provider, {
|
|
610
611
|
value: {
|
|
611
|
-
durationRevision:
|
|
612
|
+
durationRevision: a,
|
|
612
613
|
isActive: r === "visible",
|
|
613
614
|
lifecycle: f.lifecycle,
|
|
614
615
|
id: n,
|
|
615
616
|
rendererKey: _,
|
|
616
617
|
timingOverrides: m
|
|
617
618
|
},
|
|
618
|
-
children: /* @__PURE__ */
|
|
619
|
+
children: /* @__PURE__ */ c(Rt, {
|
|
619
620
|
...v,
|
|
620
621
|
...m,
|
|
621
622
|
id: n,
|
|
@@ -623,43 +624,43 @@ var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) =
|
|
|
623
624
|
})
|
|
624
625
|
})
|
|
625
626
|
})
|
|
626
|
-
}), /* @__PURE__ */
|
|
627
|
-
elementRef:
|
|
627
|
+
}), /* @__PURE__ */ c(Dt, {
|
|
628
|
+
elementRef: h,
|
|
628
629
|
toastEntry: e,
|
|
629
630
|
rendererKey: _
|
|
630
631
|
})] });
|
|
631
|
-
},
|
|
632
|
-
const t =
|
|
633
|
-
return t.map((s) => /* @__PURE__ */
|
|
632
|
+
}, jt = ({ getToastProps: e }) => {
|
|
633
|
+
const t = Ft(), { closeToast: o } = re();
|
|
634
|
+
return t.map((s) => /* @__PURE__ */ c($t, {
|
|
634
635
|
toastEntry: s,
|
|
635
636
|
getToastProps: e,
|
|
636
637
|
onClose: o
|
|
637
638
|
}, s.notification.id));
|
|
638
|
-
},
|
|
639
|
+
}, Ut = () => {
|
|
639
640
|
const e = N();
|
|
640
641
|
return R(() => (e.set("mountedToasterCount", e.state.mountedToasterCount + 1), () => {
|
|
641
642
|
e.set("mountedToasterCount", e.state.mountedToasterCount - 1), !(e.state.mountedToasterCount > 0) && e.set("toasts", e.state.toasts.filter(A));
|
|
642
643
|
}), [e]), null;
|
|
643
|
-
},
|
|
644
|
-
const n = Ce(), v = ye(), f = e === void 0 ? n ?? (typeof document > "u" ? null : document.body) : e, m =
|
|
644
|
+
}, fo = ({ container: e, getToastProps: t, className: o, render: s, ref: r, ...a }) => {
|
|
645
|
+
const n = Ce(), v = ye(), f = e === void 0 ? n ?? (typeof document > "u" ? null : document.body) : e, m = D({
|
|
645
646
|
render: s,
|
|
646
647
|
ref: r,
|
|
647
648
|
props: {
|
|
648
649
|
role: "region",
|
|
649
650
|
dir: v,
|
|
650
651
|
"aria-label": I("Notifications"),
|
|
651
|
-
...
|
|
652
|
-
className: k(
|
|
653
|
-
children: /* @__PURE__ */ g(S, { children: [/* @__PURE__ */
|
|
652
|
+
...a,
|
|
653
|
+
className: k(F.root, o),
|
|
654
|
+
children: /* @__PURE__ */ g(S, { children: [/* @__PURE__ */ c(Ut, {}), /* @__PURE__ */ c(jt, { getToastProps: t })] })
|
|
654
655
|
}
|
|
655
656
|
});
|
|
656
|
-
return
|
|
657
|
+
return d(f) ? Be(m, f) : null;
|
|
657
658
|
};
|
|
658
659
|
export {
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
660
|
+
lo as a,
|
|
661
|
+
uo as i,
|
|
662
|
+
vo as n,
|
|
663
|
+
co as o,
|
|
664
|
+
Rt as r,
|
|
665
|
+
fo as t
|
|
665
666
|
};
|