twenty-ui 2.48.0 → 2.49.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/README.md +27 -2
- package/dist/Avatar-C6WxBgjS.cjs +1 -0
- package/dist/{Avatar-D-QA0RE5.js → Avatar-ifVlxbx_.js} +18 -17
- package/dist/{Button-D5enZ0Qz.js → Button-DIw804CX.js} +1 -1
- package/dist/{Button-Dbi5P05r.cjs → Button-DTm1WDzp.cjs} +1 -1
- package/dist/Dropdown-1OAJvS1f.js +1000 -0
- package/dist/Dropdown-Bl4OXCf9.cjs +1 -0
- package/dist/{ListItem-CjnrSbka.js → ListItem-DizNUBT8.js} +1 -1
- package/dist/{ListItem-CHTR-GLd.cjs → ListItem-DwBb-I1D.cjs} +1 -1
- package/dist/{ProgressBar-BvT1dyFo.js → ProgressBar-B3xACTV2.js} +1 -1
- package/dist/{ProgressBar-DfFz0fFB.cjs → ProgressBar-OpSMnDBz.cjs} +1 -1
- package/dist/{Radio-DMI1B7o5.js → Radio-BEAztmPu.js} +1 -1
- package/dist/{Radio-xmHgGHQO.cjs → Radio-Dx6b4SYZ.cjs} +1 -1
- package/dist/ResizeHandle-B1MuHTNA.cjs +1 -0
- package/dist/{ResizeHandle-C1kQ3MYR.js → ResizeHandle-B30OYZxS.js} +56 -55
- package/dist/Shortcut-Bp9iDdQg.js +73 -0
- package/dist/Shortcut-N8TELGPI.cjs +1 -0
- package/dist/{TintedIconTile-4BGa8g8n.js → TintedIconTile-B1XDtGrF.js} +1 -1
- package/dist/{TintedIconTile-CU2hCerq.cjs → TintedIconTile-DO1XJXCQ.cjs} +1 -1
- package/dist/components/__stories__/reading-direction/DirectionalLayoutExample.d.ts +3 -1
- package/dist/components/code-editor.cjs +1 -1
- package/dist/components/code-editor.mjs +52 -51
- package/dist/components/data-display.cjs +1 -1
- package/dist/components/data-display.mjs +2 -2
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.mjs +1 -1
- package/dist/components/input/CountrySelect/CountrySelect.d.ts +5 -2
- package/dist/components/input/CountrySelect/__stories__/CountrySelectPartsExample.d.ts +11 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectComponent.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectContext.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectContextValue.d.ts +11 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectDropdown.d.ts +4 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectOptions.d.ts +2 -11
- package/dist/components/input/CountrySelect/internal/CountrySelectOptionsContent.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectRoot.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectTrigger.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/NO_COUNTRY_SELECTION_VALUE.d.ts +1 -0
- package/dist/components/input/CountrySelect/internal/PreparedCountryChoice.d.ts +5 -0
- package/dist/components/input/CountrySelect/internal/getCountrySelectionValue.d.ts +1 -0
- package/dist/components/input/CountrySelect/internal/useCountrySelectContextOrThrow.d.ts +1 -0
- package/dist/components/input/CountrySelect/types/CountryChoice.d.ts +1 -0
- package/dist/components/input/CountrySelect/types/CountrySelectOptionsProps.d.ts +10 -0
- package/dist/components/input/CountrySelect/types/CountrySelectOptionsState.d.ts +4 -0
- package/dist/components/input/CountrySelect/types/CountrySelectProps.d.ts +7 -13
- package/dist/components/input/CountrySelect/types/CountrySelectRootProps.d.ts +12 -0
- package/dist/components/input/CountrySelect/types/CountrySelectTriggerProps.d.ts +6 -0
- package/dist/components/input/CurrencyPicker/CurrencyPicker.d.ts +4 -3
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerChangingDefaultExample.d.ts +5 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerControlledExample.d.ts +5 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerControlledSearchExample.d.ts +5 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerExample.d.ts +3 -4
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerListLabelExample.d.ts +1 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerRootStateExample.d.ts +1 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerContext.d.ts +11 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerOptions.d.ts +1 -1
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerRoot.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerShorthand.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerTrigger.d.ts +1 -1
- package/dist/components/input/CurrencyPicker/internal/PreparedCurrencyPickerOption.d.ts +7 -0
- package/dist/components/input/CurrencyPicker/internal/getCurrencyPickerSearchText.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/internal/useCurrencyPickerContextOrThrow.d.ts +7 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerChangeEventDetails.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerOption.d.ts +1 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerOptionsProps.d.ts +6 -5
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerProps.d.ts +10 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerRootProps.d.ts +17 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerState.d.ts +6 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerTriggerProps.d.ts +3 -2
- package/dist/components/input/IconButton/__stories__/IconButtonExample.d.ts +7 -0
- package/dist/components/input/PhoneCountryPicker/PhoneCountryPicker.d.ts +5 -3
- package/dist/components/input/PhoneCountryPicker/__stories__/PhoneCountryPickerExample.d.ts +7 -3
- package/dist/components/input/PhoneCountryPicker/__stories__/testDisabledPhoneCountryPicker.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountryCallingCodeDirection.d.ts +3 -0
- package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountryNullSelection.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountrySelection.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerContext.d.ts +9 -0
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerOptions.d.ts +1 -1
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerRoot.d.ts +2 -0
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerTrigger.d.ts +1 -1
- package/dist/components/input/PhoneCountryPicker/internal/PreparedPhoneCountryOption.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/internal/getPhoneCountryOptionTooltipLabel.d.ts +2 -0
- package/dist/components/input/PhoneCountryPicker/internal/matchesPhoneCountrySearch.d.ts +6 -0
- package/dist/components/input/PhoneCountryPicker/internal/usePhoneCountryPickerContextOrThrow.d.ts +7 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryOption.d.ts +1 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerOptionsProps.d.ts +4 -5
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerProps.d.ts +10 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerRootProps.d.ts +12 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerTriggerProps.d.ts +1 -3
- package/dist/components/input/index.d.ts +10 -0
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.mjs +13 -13
- package/dist/components/layout/OverflowingList/internal/measureItemWidths.d.ts +1 -2
- package/dist/components/layout/OverflowingList/internal/measureOverflowingListLayout.d.ts +1 -2
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.mjs +1 -1
- package/dist/components/navigation/Dropdown/Dropdown.d.ts +2 -1
- package/dist/components/navigation/Dropdown/__stories__/DropdownIconGridExample.d.ts +3 -0
- package/dist/components/navigation/Dropdown/__stories__/DropdownSelectionGroupsExample.d.ts +1 -0
- package/dist/components/navigation/Dropdown/internal/DropdownContextValue.d.ts +6 -1
- package/dist/components/navigation/Dropdown/internal/DropdownOptionItem.d.ts +1 -1
- package/dist/components/navigation/Dropdown/internal/DropdownOptionItemOwner.d.ts +7 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionContext.d.ts +2 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionContextValue.d.ts +9 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionGroup.d.ts +2 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionGroupEffect.d.ts +11 -0
- package/dist/components/navigation/Dropdown/internal/createDropdownSelectionEventDetails.d.ts +5 -0
- package/dist/components/navigation/Dropdown/internal/dropdownItemActivation.d.ts +11 -0
- package/dist/components/navigation/Dropdown/internal/getDropdownItemExplicitId.d.ts +2 -2
- package/dist/components/navigation/Dropdown/internal/getDropdownOptionItemRole.d.ts +9 -0
- package/dist/components/navigation/Dropdown/internal/getDropdownSelectionGroupState.d.ts +6 -0
- package/dist/components/navigation/Dropdown/internal/getTrailingFocusGuard.d.ts +1 -0
- package/dist/components/navigation/Dropdown/internal/isDropdownOptionItemSelected.d.ts +6 -0
- package/dist/components/navigation/Dropdown/internal/useDropdownSelections.d.ts +12 -0
- package/dist/components/navigation/Dropdown/types/DropdownOptionItemProps.d.ts +7 -2
- package/dist/components/navigation/Dropdown/types/DropdownOptionItemSelectEventDetails.d.ts +2 -0
- package/dist/components/navigation/Dropdown/types/DropdownOptionItemState.d.ts +5 -0
- package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupChangeEventDetails.d.ts +7 -0
- package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupProps.d.ts +21 -0
- package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupState.d.ts +7 -0
- package/dist/components/navigation/index.d.ts +5 -0
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.mjs +2 -2
- package/dist/components/settings.cjs +1 -1
- package/dist/components/settings.mjs +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.mjs +22 -22
- package/dist/data-display-BSKGlijb.cjs +1 -0
- package/dist/{data-display-KyZbLLy-.js → data-display-BtXCGOGw.js} +81 -80
- package/dist/{data-display-0QO_WDSs.js → data-display-DtXIhJ4B.js} +45 -44
- package/dist/data-display-XV3ht1rC.cjs +2 -0
- package/dist/doNotTranslate-BSVT8Xyd.js +4 -0
- package/dist/doNotTranslate-CHE7WmRS.cjs +1 -0
- package/dist/feedback-Cs-38OH4.cjs +1 -0
- package/dist/{feedback-CM6fatE8.js → feedback-DTyVVcTb.js} +198 -197
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +42 -42
- package/dist/{input-CJDYNwoO.cjs → input-B_rBplmn.cjs} +1 -1
- package/dist/input-BrjD91wv.js +785 -0
- package/dist/input-ChlFcqIS.cjs +1 -0
- package/dist/{input-DRpDiMRi.js → input-D1oyk0tD.js} +2 -2
- package/dist/layout-CthYckvl.cjs +1 -0
- package/dist/layout-DQcjBu08.js +439 -0
- package/dist/{navigation-B1SRvzKK.js → navigation-B6nka3bW.js} +125 -128
- package/dist/navigation-CIVYqPc5.js +132 -0
- package/dist/navigation-CflGBYv-.cjs +1 -0
- package/dist/navigation-DoInK0Sp.cjs +1 -0
- package/dist/preventDismissingClickActivation-AaqHBLnW.js +45 -0
- package/dist/preventDismissingClickActivation-CIhWvKCu.cjs +1 -0
- package/dist/primitives/data-display.cjs +1 -1
- package/dist/primitives/data-display.mjs +2 -2
- package/dist/primitives/feedback.cjs +1 -1
- package/dist/primitives/feedback.mjs +1 -1
- package/dist/primitives/input/Radio/__stories__/RadioCardContent.d.ts +8 -0
- package/dist/primitives/input.cjs +1 -1
- package/dist/primitives/input.mjs +3 -3
- package/dist/primitives/layout/ResizeHandle/__stories__/ResizableNotesExample.d.ts +2 -0
- package/dist/primitives/layout.cjs +1 -1
- package/dist/primitives/layout.mjs +1 -1
- package/dist/primitives/navigation.cjs +1 -1
- package/dist/primitives/navigation.mjs +2 -2
- package/dist/primitives/typography.cjs +1 -1
- package/dist/primitives/typography.mjs +2 -2
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.mjs +11 -11
- package/dist/{settings-BjEZiHXE.js → settings-BgVuLpg9.js} +1 -1
- package/dist/{settings-BAYsnlZJ.cjs → settings-CPXhrmbK.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/testing/GroupedCatalog.d.ts +14 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.mjs +96 -66
- package/dist/{typography-fOTFr0jS.js → typography-DT2eKLvd.js} +1 -1
- package/dist/{typography-B5QEuPaL.cjs → typography-bKeSMuJd.cjs} +1 -1
- package/dist/useIsMobile-Byp9AIq-.cjs +1 -0
- package/dist/useIsMobile-D1ImfQnE.js +38 -0
- package/dist/utilities/internal/doNotTranslate.d.ts +1 -0
- package/dist/utilities-BKCMZyqZ.js +53 -0
- package/dist/utilities-xZh8D2gd.cjs +1 -0
- package/dist/utilities.cjs +1 -1
- package/dist/utilities.mjs +3 -3
- package/package.json +3 -3
- package/dist/Avatar-CQhIEazb.cjs +0 -1
- package/dist/Dropdown-BKjAaZS0.cjs +0 -1
- package/dist/Dropdown-C2hXrjvD.js +0 -820
- package/dist/ResizeHandle-DI4LHIQm.cjs +0 -1
- package/dist/Shortcut-BvWUZ3pb.js +0 -72
- package/dist/Shortcut-CgrdLv_L.cjs +0 -1
- package/dist/data-display-CPmTJAWJ.cjs +0 -1
- package/dist/data-display-DjhAHvj1.cjs +0 -2
- package/dist/feedback-ybO4n69s.cjs +0 -1
- package/dist/input-3D2lXywH.cjs +0 -1
- package/dist/input-TM3nUdu6.js +0 -554
- package/dist/layout-BszCDxAO.js +0 -441
- package/dist/layout-VaIq7Sjr.cjs +0 -1
- package/dist/navigation-CYAs2LnR.js +0 -131
- package/dist/navigation-CthkGHJ8.cjs +0 -1
- package/dist/navigation-DrOV5E67.cjs +0 -1
- package/dist/preventDismissingClickActivation-CzWqpjiX.js +0 -44
- package/dist/preventDismissingClickActivation-DZxTSLV3.cjs +0 -1
- package/dist/useIsMobile-DxOPI2_E.cjs +0 -1
- package/dist/useIsMobile-nrufFzMb.js +0 -37
- package/dist/utilities-BeLfNQ0Q.cjs +0 -1
- package/dist/utilities-CEi9I09B.js +0 -52
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import { t as l } from "./isDefined-fMi6eQ4r.js";
|
|
2
|
-
import { Ta as
|
|
3
|
-
import {
|
|
4
|
-
import { t as Ce } from "./
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
2
|
+
import { Ta as Z, gl as ee, hc as _e, la as Te, nt as D } from "./icon-CUE-QGQK.js";
|
|
3
|
+
import { t as I } from "./doNotTranslate-BSVT8Xyd.js";
|
|
4
|
+
import { a as he, r as ge, t as Ce } from "./theme-B2EaXhye.js";
|
|
5
|
+
import { t as be } from "./mergeClassNames-ClFMR1v0.js";
|
|
6
|
+
import { t as B } from "./Button-DIw804CX.js";
|
|
7
|
+
import { n as te, r as we, t as xe } from "./ProgressBar-B3xACTV2.js";
|
|
7
8
|
import { t as y } from "./isRenderableSlot-DT_depzM.js";
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { useRender as
|
|
12
|
-
import { isNonEmptyArray as
|
|
13
|
-
import { clsx as
|
|
14
|
-
import { createContext as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { Store as
|
|
17
|
-
import { createPortal as
|
|
18
|
-
var
|
|
9
|
+
import { t as ye } from "./useProvidedTextDirection-Dk8LBQeF.js";
|
|
10
|
+
import { t as Ae } from "./OverflowingTextWithTooltip-BmUROIah.js";
|
|
11
|
+
import { t as Ne } from "./Separator-0LzwPfOn.js";
|
|
12
|
+
import { useRender as $ } from "@base-ui/react/use-render";
|
|
13
|
+
import { isNonEmptyArray as q, isPositiveInteger as Ee, isString as Pe, isUndefined as Ie } from "@sniptt/guards";
|
|
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 Oe, useState as P, useSyncExternalStore as We } from "react";
|
|
16
|
+
import { Fragment as S, jsx as a, jsxs as g } from "react/jsx-runtime";
|
|
17
|
+
import { Store as Be, useStore as Me } from "@base-ui/utils/store";
|
|
18
|
+
import { createPortal as Fe } from "react-dom";
|
|
19
|
+
var De = "_action_3r2bm_1", ze = { action: De }, $e = ({ className: e, ...t }) => /* @__PURE__ */ a(B, {
|
|
19
20
|
...t,
|
|
20
21
|
size: "sm",
|
|
21
22
|
variant: "ghost",
|
|
22
|
-
className:
|
|
23
|
-
}),
|
|
24
|
-
container:
|
|
25
|
-
containerFullWidth:
|
|
26
|
-
header:
|
|
27
|
-
iconContainer:
|
|
28
|
-
title:
|
|
29
|
-
descriptionWrapper:
|
|
30
|
-
descriptionWrapperWithIcon:
|
|
31
|
-
descriptionWrapperWithAction:
|
|
32
|
-
description:
|
|
33
|
-
footer:
|
|
34
|
-
closeButton:
|
|
35
|
-
},
|
|
36
|
-
size:
|
|
23
|
+
className: be(ze.action, e)
|
|
24
|
+
}), qe = "_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", h = {
|
|
25
|
+
container: qe,
|
|
26
|
+
containerFullWidth: je,
|
|
27
|
+
header: Ue,
|
|
28
|
+
iconContainer: Le,
|
|
29
|
+
title: Ke,
|
|
30
|
+
descriptionWrapper: He,
|
|
31
|
+
descriptionWrapperWithIcon: Ve,
|
|
32
|
+
descriptionWrapperWithAction: Xe,
|
|
33
|
+
description: Ge,
|
|
34
|
+
footer: Je,
|
|
35
|
+
closeButton: Qe
|
|
36
|
+
}, Ye = ({ status: e = "info", variant: t = "soft", color: o = we[e], title: s, description: r, fullWidth: c = !1, icon: n = /* @__PURE__ */ a(Te, {
|
|
37
|
+
size: he.icon.size.md,
|
|
37
38
|
"aria-hidden": "true"
|
|
38
|
-
}), action: v, closeLabel: f = "Close", onDismiss: m, className: _, render: T, ref: u, ...d }) => {
|
|
39
|
+
}), action: v, closeLabel: f = I("Close"), onDismiss: m, className: _, render: T, ref: u, ...d }) => {
|
|
39
40
|
const i = y(n), p = y(v);
|
|
40
|
-
return
|
|
41
|
+
return $({
|
|
41
42
|
render: T,
|
|
42
43
|
ref: u,
|
|
43
44
|
state: {
|
|
@@ -47,8 +48,8 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
47
48
|
},
|
|
48
49
|
props: {
|
|
49
50
|
...d,
|
|
50
|
-
className:
|
|
51
|
-
children: /* @__PURE__ */ g(
|
|
51
|
+
className: k(h.container, c && h.containerFullWidth, _),
|
|
52
|
+
children: /* @__PURE__ */ g(S, { children: [
|
|
52
53
|
/* @__PURE__ */ g("div", {
|
|
53
54
|
className: h.header,
|
|
54
55
|
children: [
|
|
@@ -60,9 +61,9 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
60
61
|
className: h.title,
|
|
61
62
|
children: s
|
|
62
63
|
}),
|
|
63
|
-
l(m) && /* @__PURE__ */ a(
|
|
64
|
+
l(m) && /* @__PURE__ */ a(B, {
|
|
64
65
|
type: "button",
|
|
65
|
-
startIcon: /* @__PURE__ */ a(
|
|
66
|
+
startIcon: /* @__PURE__ */ a(ee, { "aria-hidden": "true" }),
|
|
66
67
|
className: h.closeButton,
|
|
67
68
|
variant: "ghost",
|
|
68
69
|
size: "sm",
|
|
@@ -72,7 +73,7 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
72
73
|
]
|
|
73
74
|
}),
|
|
74
75
|
y(r) && /* @__PURE__ */ a("div", {
|
|
75
|
-
className:
|
|
76
|
+
className: k(h.descriptionWrapper, i && h.descriptionWrapperWithIcon, p && h.descriptionWrapperWithAction),
|
|
76
77
|
children: /* @__PURE__ */ a("div", {
|
|
77
78
|
className: h.description,
|
|
78
79
|
children: r
|
|
@@ -85,18 +86,18 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
85
86
|
] })
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
|
-
},
|
|
89
|
-
banner:
|
|
90
|
-
embedded:
|
|
91
|
-
bannerContent:
|
|
92
|
-
icon:
|
|
93
|
-
bannerText:
|
|
94
|
-
compact:
|
|
95
|
-
},
|
|
96
|
-
const v = t === "compact", f = !v &&
|
|
97
|
-
return /* @__PURE__ */ a(
|
|
89
|
+
}, ao = Object.assign(Ye, { Action: $e }), Ze = "_banner_17vm4_1", et = "_embedded_17vm4_6", tt = "_bannerContent_17vm4_10", ot = "_icon_17vm4_18", st = "_bannerText_17vm4_28", rt = "_compact_17vm4_33", E = {
|
|
90
|
+
banner: Ze,
|
|
91
|
+
embedded: et,
|
|
92
|
+
bannerContent: tt,
|
|
93
|
+
icon: ot,
|
|
94
|
+
bannerText: st,
|
|
95
|
+
compact: rt
|
|
96
|
+
}, nt = ({ children: e, layout: t = "standard", variant: o = "soft", embedded: s = !1, icon: r = /* @__PURE__ */ a(Z, { "aria-hidden": "true" }), className: c, ...n }) => {
|
|
97
|
+
const v = t === "compact", f = !v && Pe(e);
|
|
98
|
+
return /* @__PURE__ */ a(te, {
|
|
98
99
|
...n,
|
|
99
|
-
className:
|
|
100
|
+
className: k(E.banner, v && E.compact, s && E.embedded, c),
|
|
100
101
|
variant: o,
|
|
101
102
|
"data-layout": t,
|
|
102
103
|
children: /* @__PURE__ */ g("div", {
|
|
@@ -106,45 +107,45 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
106
107
|
children: r
|
|
107
108
|
}), /* @__PURE__ */ a("div", {
|
|
108
109
|
className: E.bannerText,
|
|
109
|
-
children: f ? /* @__PURE__ */ a(
|
|
110
|
+
children: f ? /* @__PURE__ */ a(Ae, {
|
|
110
111
|
isFocusable: !0,
|
|
111
|
-
text: /* @__PURE__ */ a(
|
|
112
|
+
text: /* @__PURE__ */ a(S, { children: e }),
|
|
112
113
|
tooltipContent: e
|
|
113
114
|
}) : e
|
|
114
115
|
})]
|
|
115
116
|
})
|
|
116
117
|
});
|
|
117
|
-
},
|
|
118
|
+
}, co = Object.assign(nt, { Action: te.Action }), A = (e) => e.status === "visible", M = ({ store: e, toastsToClose: t, nextToasts: o = e.state.toasts }) => {
|
|
118
119
|
const s = t.filter((n) => A(n) && e.state.toasts.includes(n)), r = o.map((n) => s.includes(n) ? {
|
|
119
120
|
...n,
|
|
120
121
|
status: "closing"
|
|
121
122
|
} : n), c = e.state.mountedToasterCount > 0;
|
|
122
123
|
e.set("toasts", c ? r : r.filter(A));
|
|
123
124
|
for (const n of s) n.notification.onClose?.();
|
|
124
|
-
},
|
|
125
|
-
const e =
|
|
126
|
-
if (!l(e)) throw new Error("Toast components must be used within a ToastProvider.");
|
|
125
|
+
}, se = oe(void 0), N = () => {
|
|
126
|
+
const e = j(se);
|
|
127
|
+
if (!l(e)) throw new Error(I("Toast components must be used within a ToastProvider."));
|
|
127
128
|
return e;
|
|
128
|
-
},
|
|
129
|
+
}, re = () => {
|
|
129
130
|
const e = N();
|
|
130
131
|
return { closeToast: (o) => {
|
|
131
132
|
if (!e.lifecycle.isActive()) return;
|
|
132
133
|
const s = e.state.toasts.filter((r) => A(r) && (!l(o) || r.notification.id === o));
|
|
133
|
-
|
|
134
|
+
q(s) && M({
|
|
134
135
|
store: e,
|
|
135
136
|
toastsToClose: s
|
|
136
137
|
});
|
|
137
138
|
} };
|
|
138
|
-
},
|
|
139
|
+
}, Q = 0, Y = () => (Q += 1, `toast-${Q}`), it = () => {
|
|
139
140
|
const e = N();
|
|
140
|
-
return { enqueueToast:
|
|
141
|
+
return { enqueueToast: ke(() => {
|
|
141
142
|
function t(o) {
|
|
142
143
|
if (!l(o)) return;
|
|
143
|
-
if (!e.lifecycle.isActive()) return
|
|
144
|
+
if (!e.lifecycle.isActive()) return Y();
|
|
144
145
|
const { dedupeKey: s, ...r } = o, { toasts: c, limit: n } = e.state, v = c.filter(A), f = l(s) ? v.find((T) => T.dedupeKey === s) : void 0;
|
|
145
146
|
if (l(f)) return f.notification.id;
|
|
146
|
-
const m =
|
|
147
|
-
return
|
|
147
|
+
const m = Y(), _ = Math.max(0, v.length - n + 1);
|
|
148
|
+
return M({
|
|
148
149
|
store: e,
|
|
149
150
|
toastsToClose: v.slice(0, _),
|
|
150
151
|
nextToasts: [...c, {
|
|
@@ -159,10 +160,10 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
159
160
|
}
|
|
160
161
|
return t;
|
|
161
162
|
}, [e]) };
|
|
162
|
-
},
|
|
163
|
+
}, at = ({ store: e, id: t, ...o }) => {
|
|
163
164
|
if (!e.lifecycle.isActive()) return;
|
|
164
165
|
const s = e.state.toasts.find((n) => n.notification.id === t && A(n)), r = Object.keys(o);
|
|
165
|
-
if (!l(s) ||
|
|
166
|
+
if (!l(s) || !q(r)) return;
|
|
166
167
|
const c = r.includes("duration") || l(s.notification.progress) && r.includes("progress") && !l(o.progress);
|
|
167
168
|
e.set("toasts", e.state.toasts.map((n) => n === s ? {
|
|
168
169
|
...n,
|
|
@@ -173,36 +174,36 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
173
174
|
},
|
|
174
175
|
...c ? { durationRevision: (n.durationRevision ?? 0) + 1 } : {}
|
|
175
176
|
} : n));
|
|
176
|
-
},
|
|
177
|
+
}, ct = () => {
|
|
177
178
|
const e = N();
|
|
178
|
-
return { updateToast:
|
|
179
|
+
return { updateToast: Re((t) => at({
|
|
179
180
|
store: e,
|
|
180
181
|
...t
|
|
181
182
|
}), [e]) };
|
|
182
|
-
},
|
|
183
|
-
const { closeToast: e } =
|
|
183
|
+
}, lo = () => {
|
|
184
|
+
const { closeToast: e } = re(), { enqueueToast: t } = it(), { updateToast: o } = ct();
|
|
184
185
|
return {
|
|
185
186
|
enqueueToast: t,
|
|
186
187
|
closeToast: e,
|
|
187
188
|
updateToast: o
|
|
188
189
|
};
|
|
189
|
-
},
|
|
190
|
-
root:
|
|
191
|
-
progress:
|
|
192
|
-
header:
|
|
193
|
-
message:
|
|
194
|
-
icon:
|
|
195
|
-
actions:
|
|
196
|
-
description:
|
|
197
|
-
footer:
|
|
198
|
-
footerAction:
|
|
199
|
-
closeButton:
|
|
200
|
-
},
|
|
190
|
+
}, dt = "_root_181ka_1", lt = "_progress_181ka_19", ut = "_header_181ka_30", vt = "_message_181ka_40", ft = "_icon_181ka_45", mt = "_actions_181ka_50", pt = "_description_181ka_56", _t = "_footer_181ka_65", Tt = "_footerAction_181ka_69", ht = "_closeButton_181ka_76", b = {
|
|
191
|
+
root: dt,
|
|
192
|
+
progress: lt,
|
|
193
|
+
header: ut,
|
|
194
|
+
message: vt,
|
|
195
|
+
icon: ft,
|
|
196
|
+
actions: mt,
|
|
197
|
+
description: pt,
|
|
198
|
+
footer: _t,
|
|
199
|
+
footerAction: Tt,
|
|
200
|
+
closeButton: ht
|
|
201
|
+
}, U = oe({
|
|
201
202
|
durationRevision: 0,
|
|
202
203
|
isActive: !0
|
|
203
|
-
}),
|
|
204
|
-
const { durationRevision: n, isActive: v, lifecycle: f, id: m, rendererKey: _, timingOverrides: T } =
|
|
205
|
-
return
|
|
204
|
+
}), gt = ({ clock: e, onClockChange: t, duration: o, progress: s, isPaused: r, onClose: c }) => {
|
|
205
|
+
const { durationRevision: n, isActive: v, lifecycle: f, id: m, rendererKey: _, timingOverrides: T } = j(U), u = l(f) && l(m) && l(_), d = u ? void 0 : e, i = l(s), p = l(T) && Object.prototype.propertyIsEnumerable.call(T, "duration"), x = l(T) && Object.prototype.propertyIsEnumerable.call(T, "progress");
|
|
206
|
+
return R(() => {
|
|
206
207
|
if (u) {
|
|
207
208
|
t(f.updateRenderer({
|
|
208
209
|
id: m,
|
|
@@ -238,7 +239,7 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
238
239
|
_,
|
|
239
240
|
p,
|
|
240
241
|
x
|
|
241
|
-
]),
|
|
242
|
+
]), R(() => () => {
|
|
242
243
|
if (u) {
|
|
243
244
|
f.removeRenderer({
|
|
244
245
|
id: m,
|
|
@@ -254,7 +255,7 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
254
255
|
_,
|
|
255
256
|
u
|
|
256
257
|
]), null;
|
|
257
|
-
},
|
|
258
|
+
}, Ct = ({ element: e, isFocused: t, onFocusChange: o }) => (R(() => {
|
|
258
259
|
if (!t || !l(e)) return;
|
|
259
260
|
const s = () => {
|
|
260
261
|
e.contains(e.ownerDocument.activeElement) || o(!1);
|
|
@@ -269,21 +270,21 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
269
270
|
e,
|
|
270
271
|
t,
|
|
271
272
|
o
|
|
272
|
-
]), null),
|
|
273
|
-
countdown:
|
|
274
|
-
toastCountdown:
|
|
275
|
-
},
|
|
273
|
+
]), null), ne = 6e3, ie = (e) => Number.isFinite(e) && e > 0, bt = "_countdown_1vuo8_1", wt = "_toastCountdown_1vuo8_1", xt = {
|
|
274
|
+
countdown: bt,
|
|
275
|
+
toastCountdown: wt
|
|
276
|
+
}, yt = ({ progress: e, duration: t, remainingDuration: o, revision: s, isPaused: r, barColor: c }) => l(e) ? /* @__PURE__ */ a(xe, {
|
|
276
277
|
value: e,
|
|
277
278
|
barColor: c
|
|
278
|
-
}) :
|
|
279
|
-
className:
|
|
279
|
+
}) : ie(t) ? /* @__PURE__ */ a("div", {
|
|
280
|
+
className: xt.countdown,
|
|
280
281
|
"data-paused": r || void 0,
|
|
281
282
|
style: {
|
|
282
283
|
"--toast-countdown-color": c,
|
|
283
284
|
"--toast-countdown-width": `${o / t * 100}%`,
|
|
284
285
|
"--toast-countdown-duration": `${o}ms`
|
|
285
286
|
}
|
|
286
|
-
}, s) : null,
|
|
287
|
+
}, s) : null, At = 2 ** 31 - 1, Nt = ({ onChange: e }) => {
|
|
287
288
|
let t, o = 0, s, r, c = 0, n = 0, v = !1;
|
|
288
289
|
const f = () => {
|
|
289
290
|
n += 1, l(s) && (o = Math.max(0, o - (performance.now() - s)), s = void 0), clearTimeout(r), r = void 0;
|
|
@@ -296,7 +297,7 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
296
297
|
}));
|
|
297
298
|
}, _ = () => {
|
|
298
299
|
v || (f(), v = !0, o = 0, m(), t?.onClose?.());
|
|
299
|
-
}, T = () => l(t) && t.isActive && !t.isPaused && !t.isProgress &&
|
|
300
|
+
}, T = () => l(t) && t.isActive && !t.isPaused && !t.isProgress && ie(t.duration) && !v, u = () => {
|
|
300
301
|
if (!T()) return;
|
|
301
302
|
s = performance.now();
|
|
302
303
|
const i = n;
|
|
@@ -308,7 +309,7 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
308
309
|
}
|
|
309
310
|
_();
|
|
310
311
|
}
|
|
311
|
-
}, Math.min(o,
|
|
312
|
+
}, Math.min(o, At));
|
|
312
313
|
};
|
|
313
314
|
return {
|
|
314
315
|
update: (i) => {
|
|
@@ -322,7 +323,7 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
322
323
|
close: _,
|
|
323
324
|
stop: f
|
|
324
325
|
};
|
|
325
|
-
},
|
|
326
|
+
}, ae = ({ duration: e, isPaused: t }) => {
|
|
326
327
|
let o = {
|
|
327
328
|
duration: e,
|
|
328
329
|
remainingDuration: e,
|
|
@@ -331,7 +332,7 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
331
332
|
};
|
|
332
333
|
const s = /* @__PURE__ */ new Set();
|
|
333
334
|
return {
|
|
334
|
-
...
|
|
335
|
+
...Nt({ onChange: (r) => {
|
|
335
336
|
o = r;
|
|
336
337
|
for (const c of s) c();
|
|
337
338
|
} }),
|
|
@@ -340,72 +341,72 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
340
341
|
s.delete(r);
|
|
341
342
|
})
|
|
342
343
|
};
|
|
343
|
-
},
|
|
344
|
-
const { lifecycle: o, id: s, rendererKey: r } =
|
|
344
|
+
}, Et = ({ duration: e, isPaused: t }) => {
|
|
345
|
+
const { lifecycle: o, id: s, rendererKey: r } = j(U), [c, n] = P(() => (l(o) && l(s) && l(r) ? o.getCountdown(s) : void 0) ?? ae({
|
|
345
346
|
duration: e,
|
|
346
347
|
isPaused: t
|
|
347
348
|
}));
|
|
348
349
|
return {
|
|
349
|
-
countdown:
|
|
350
|
+
countdown: We(c.subscribe, c.getSnapshot, c.getSnapshot),
|
|
350
351
|
clock: c,
|
|
351
352
|
setClock: n
|
|
352
353
|
};
|
|
353
|
-
},
|
|
354
|
-
neutral:
|
|
355
|
-
error:
|
|
356
|
-
success:
|
|
357
|
-
info:
|
|
358
|
-
warning:
|
|
359
|
-
},
|
|
360
|
-
const
|
|
354
|
+
}, Pt = {
|
|
355
|
+
neutral: D,
|
|
356
|
+
error: D,
|
|
357
|
+
success: _e,
|
|
358
|
+
info: Z,
|
|
359
|
+
warning: D
|
|
360
|
+
}, It = ({ children: e, description: t, icon: o, iconLabel: s, action: r, progress: c, duration: n = ne, onCancel: v, onClose: f, cancelLabel: m = I("Cancel"), closeLabel: _ = I("Close"), status: T = "neutral", role: u = "status", className: d, onMouseEnter: i, onMouseLeave: p, onFocus: x, onBlur: C, render: O, ref: de, ...le }) => {
|
|
361
|
+
const L = ge(), [ue, K] = P(!1), [H, F] = P(!1), [ve, fe] = P(null), V = ue || H, { countdown: W, clock: X, setClock: me } = Et({
|
|
361
362
|
duration: n,
|
|
362
|
-
isPaused:
|
|
363
|
-
}),
|
|
363
|
+
isPaused: V
|
|
364
|
+
}), pe = Pt[T], G = L.snackBar[T === "neutral" ? "default" : T], J = Ie(o) ? /* @__PURE__ */ a(pe, {
|
|
364
365
|
"aria-label": s,
|
|
365
366
|
"aria-hidden": !l(s),
|
|
366
|
-
color:
|
|
367
|
-
size:
|
|
367
|
+
color: G.color,
|
|
368
|
+
size: L.icon.size.md
|
|
368
369
|
}) : o;
|
|
369
|
-
return /* @__PURE__ */ g(
|
|
370
|
-
|
|
371
|
-
render:
|
|
372
|
-
ref: [
|
|
370
|
+
return /* @__PURE__ */ g(S, { children: [
|
|
371
|
+
$({
|
|
372
|
+
render: O,
|
|
373
|
+
ref: [de ?? null, fe],
|
|
373
374
|
props: {
|
|
374
375
|
role: u,
|
|
375
376
|
"aria-live": u === "alert" ? "assertive" : "polite",
|
|
376
|
-
...
|
|
377
|
-
className:
|
|
377
|
+
...le,
|
|
378
|
+
className: k(b.root, d),
|
|
378
379
|
onMouseEnter: (w) => {
|
|
379
|
-
|
|
380
|
+
K(!0), i?.(w);
|
|
380
381
|
},
|
|
381
382
|
onMouseLeave: (w) => {
|
|
382
|
-
|
|
383
|
+
K(!1), p?.(w);
|
|
383
384
|
},
|
|
384
385
|
onFocus: (w) => {
|
|
385
|
-
|
|
386
|
+
F(!0), x?.(w);
|
|
386
387
|
},
|
|
387
388
|
onBlur: (w) => {
|
|
388
|
-
w.currentTarget.contains(w.relatedTarget) ||
|
|
389
|
+
w.currentTarget.contains(w.relatedTarget) || F(!1), C?.(w);
|
|
389
390
|
},
|
|
390
|
-
children: /* @__PURE__ */ g(
|
|
391
|
+
children: /* @__PURE__ */ g(S, { children: [
|
|
391
392
|
/* @__PURE__ */ a("div", {
|
|
392
393
|
className: b.progress,
|
|
393
394
|
"aria-hidden": !0,
|
|
394
|
-
children: /* @__PURE__ */ a(
|
|
395
|
-
barColor:
|
|
395
|
+
children: /* @__PURE__ */ a(yt, {
|
|
396
|
+
barColor: G.backgroundColor,
|
|
396
397
|
progress: c,
|
|
397
|
-
duration:
|
|
398
|
-
remainingDuration:
|
|
399
|
-
revision:
|
|
400
|
-
isPaused:
|
|
398
|
+
duration: W.duration,
|
|
399
|
+
remainingDuration: W.remainingDuration,
|
|
400
|
+
revision: W.revision,
|
|
401
|
+
isPaused: W.isPaused
|
|
401
402
|
})
|
|
402
403
|
}),
|
|
403
404
|
/* @__PURE__ */ g("div", {
|
|
404
405
|
className: b.header,
|
|
405
406
|
children: [
|
|
406
|
-
y(
|
|
407
|
+
y(J) && /* @__PURE__ */ a("div", {
|
|
407
408
|
className: b.icon,
|
|
408
|
-
children:
|
|
409
|
+
children: J
|
|
409
410
|
}),
|
|
410
411
|
/* @__PURE__ */ a("div", {
|
|
411
412
|
className: b.message,
|
|
@@ -413,20 +414,20 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
413
414
|
}),
|
|
414
415
|
/* @__PURE__ */ g("div", {
|
|
415
416
|
className: b.actions,
|
|
416
|
-
children: [l(v) && y(m) && /* @__PURE__ */ a(
|
|
417
|
+
children: [l(v) && y(m) && /* @__PURE__ */ a(B, {
|
|
417
418
|
onClick: v,
|
|
418
419
|
size: "sm",
|
|
419
420
|
variant: "ghost",
|
|
420
421
|
style: { fontWeight: "var(--t-font-weight-regular)" },
|
|
421
422
|
children: m
|
|
422
|
-
}), l(f) && /* @__PURE__ */ a(
|
|
423
|
+
}), l(f) && /* @__PURE__ */ a(B, {
|
|
423
424
|
title: _,
|
|
424
425
|
"aria-label": _,
|
|
425
|
-
startIcon: /* @__PURE__ */ a(
|
|
426
|
+
startIcon: /* @__PURE__ */ a(ee, {}),
|
|
426
427
|
className: b.closeButton,
|
|
427
428
|
variant: "ghost",
|
|
428
429
|
size: "sm",
|
|
429
|
-
onClick:
|
|
430
|
+
onClick: X.close
|
|
430
431
|
})]
|
|
431
432
|
})
|
|
432
433
|
]
|
|
@@ -437,7 +438,7 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
437
438
|
}),
|
|
438
439
|
y(r) && /* @__PURE__ */ g("div", {
|
|
439
440
|
className: b.footer,
|
|
440
|
-
children: [/* @__PURE__ */ a(
|
|
441
|
+
children: [/* @__PURE__ */ a(Ne, {}), /* @__PURE__ */ a("div", {
|
|
441
442
|
className: b.footerAction,
|
|
442
443
|
children: r
|
|
443
444
|
})]
|
|
@@ -445,48 +446,48 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
445
446
|
] })
|
|
446
447
|
}
|
|
447
448
|
}),
|
|
448
|
-
/* @__PURE__ */ a(
|
|
449
|
-
element:
|
|
450
|
-
isFocused:
|
|
451
|
-
onFocusChange:
|
|
449
|
+
/* @__PURE__ */ a(Ct, {
|
|
450
|
+
element: ve,
|
|
451
|
+
isFocused: H,
|
|
452
|
+
onFocusChange: F
|
|
452
453
|
}),
|
|
453
|
-
/* @__PURE__ */ a(
|
|
454
|
-
clock:
|
|
455
|
-
onClockChange:
|
|
454
|
+
/* @__PURE__ */ a(gt, {
|
|
455
|
+
clock: X,
|
|
456
|
+
onClockChange: me,
|
|
456
457
|
duration: n,
|
|
457
458
|
progress: c,
|
|
458
|
-
isPaused:
|
|
459
|
+
isPaused: V,
|
|
459
460
|
onClose: f
|
|
460
461
|
})
|
|
461
462
|
] });
|
|
462
|
-
},
|
|
463
|
-
if (!
|
|
464
|
-
},
|
|
465
|
-
if (
|
|
463
|
+
}, ce = (e) => {
|
|
464
|
+
if (!Ee(e)) throw new Error(I("Toast limit must be a positive integer."));
|
|
465
|
+
}, Rt = ({ store: e, limit: t }) => {
|
|
466
|
+
if (ce(t), e.state.limit === t) return;
|
|
466
467
|
e.set("limit", t);
|
|
467
468
|
const o = e.state.toasts.filter(A), s = Math.max(0, o.length - t);
|
|
468
|
-
s !== 0 &&
|
|
469
|
+
s !== 0 && M({
|
|
469
470
|
store: e,
|
|
470
471
|
toastsToClose: o.slice(0, s)
|
|
471
472
|
});
|
|
472
|
-
},
|
|
473
|
+
}, St = ({ limit: e }) => {
|
|
473
474
|
const t = N();
|
|
474
|
-
return
|
|
475
|
+
return Se(() => t.lifecycle.mount(), [t]), R(() => Rt({
|
|
475
476
|
store: t,
|
|
476
477
|
limit: e
|
|
477
478
|
}), [t, e]), null;
|
|
478
|
-
},
|
|
479
|
+
}, kt = ({ store: e, toast: t }) => {
|
|
479
480
|
const { toasts: o } = e.state;
|
|
480
481
|
t.status === "closing" && o.includes(t) && e.set("toasts", o.filter((s) => s !== t));
|
|
481
|
-
},
|
|
482
|
+
}, Ot = (e) => {
|
|
482
483
|
const t = /* @__PURE__ */ new Map();
|
|
483
484
|
let o = !1, s = !1, r = 0;
|
|
484
485
|
const c = (u) => {
|
|
485
486
|
const d = t.get(u);
|
|
486
487
|
if (l(d)) return d;
|
|
487
488
|
const i = {
|
|
488
|
-
countdown:
|
|
489
|
-
duration:
|
|
489
|
+
countdown: ae({
|
|
490
|
+
duration: ne,
|
|
490
491
|
isPaused: !0
|
|
491
492
|
}),
|
|
492
493
|
renderers: /* @__PURE__ */ new Map()
|
|
@@ -497,7 +498,7 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
497
498
|
const d = t.get(u);
|
|
498
499
|
if (!l(d?.pendingExits) || d.pendingExits.size > 0) return;
|
|
499
500
|
const i = e.state.toasts.find((p) => p.notification.id === u);
|
|
500
|
-
l(i) &&
|
|
501
|
+
l(i) && kt({
|
|
501
502
|
store: e,
|
|
502
503
|
toast: i
|
|
503
504
|
});
|
|
@@ -518,8 +519,8 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
518
519
|
isPaused: x,
|
|
519
520
|
isActive: i.status === "visible",
|
|
520
521
|
onClose: () => {
|
|
521
|
-
const C = e.state.toasts.find((
|
|
522
|
-
!o || !l(C) ||
|
|
522
|
+
const C = e.state.toasts.find((O) => O.notification.id === u && A(O));
|
|
523
|
+
!o || !l(C) || M({
|
|
523
524
|
store: e,
|
|
524
525
|
toastsToClose: [C]
|
|
525
526
|
});
|
|
@@ -554,33 +555,33 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
554
555
|
t.get(u)?.pendingExits?.delete(d), n(u);
|
|
555
556
|
}
|
|
556
557
|
};
|
|
557
|
-
},
|
|
558
|
-
|
|
559
|
-
const t = new
|
|
558
|
+
}, Wt = (e = 3) => {
|
|
559
|
+
ce(e);
|
|
560
|
+
const t = new Be({
|
|
560
561
|
toasts: [],
|
|
561
562
|
limit: e,
|
|
562
563
|
mountedToasterCount: 0
|
|
563
564
|
});
|
|
564
|
-
return Object.assign(t, { lifecycle:
|
|
565
|
-
},
|
|
566
|
-
const [o] = P(() =>
|
|
567
|
-
return /* @__PURE__ */ g(
|
|
565
|
+
return Object.assign(t, { lifecycle: Ot(t) });
|
|
566
|
+
}, uo = ({ children: e, limit: t = 3 }) => {
|
|
567
|
+
const [o] = P(() => Wt(t));
|
|
568
|
+
return /* @__PURE__ */ g(se.Provider, {
|
|
568
569
|
value: o,
|
|
569
|
-
children: [e, /* @__PURE__ */ a(
|
|
570
|
+
children: [e, /* @__PURE__ */ a(St, { limit: t })]
|
|
570
571
|
});
|
|
571
|
-
},
|
|
572
|
-
root:
|
|
573
|
-
item:
|
|
574
|
-
itemContent:
|
|
575
|
-
},
|
|
572
|
+
}, Bt = "_root_1q2cc_1", Mt = "_item_1q2cc_20", Ft = "_itemContent_1q2cc_47", z = {
|
|
573
|
+
root: Bt,
|
|
574
|
+
item: Mt,
|
|
575
|
+
itemContent: Ft
|
|
576
|
+
}, Dt = () => Me(N(), (e) => e.toasts), zt = ({ elementRef: e, toastEntry: t, rendererKey: o }) => {
|
|
576
577
|
const s = N();
|
|
577
|
-
return
|
|
578
|
+
return R(() => {
|
|
578
579
|
if (t.status === "visible") return;
|
|
579
580
|
const r = () => s.lifecycle.finishExit({
|
|
580
581
|
id: t.notification.id,
|
|
581
582
|
key: o
|
|
582
583
|
}), c = e.current?.getAnimations?.() ?? [];
|
|
583
|
-
if (
|
|
584
|
+
if (!q(c)) {
|
|
584
585
|
r();
|
|
585
586
|
return;
|
|
586
587
|
}
|
|
@@ -596,16 +597,16 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
596
597
|
s,
|
|
597
598
|
o
|
|
598
599
|
]), null;
|
|
599
|
-
},
|
|
600
|
-
const { notification: s, status: r, durationRevision: c = 0 } = e, { id: n, ...v } = s, f = N(), m = t?.(s), [_] = P(() => /* @__PURE__ */ Symbol()), T =
|
|
601
|
-
return /* @__PURE__ */ g(
|
|
600
|
+
}, $t = ({ toastEntry: e, getToastProps: t, onClose: o }) => {
|
|
601
|
+
const { notification: s, status: r, durationRevision: c = 0 } = e, { id: n, ...v } = s, f = N(), m = t?.(s), [_] = P(() => /* @__PURE__ */ Symbol()), T = Oe(null);
|
|
602
|
+
return /* @__PURE__ */ g(S, { children: [/* @__PURE__ */ a("div", {
|
|
602
603
|
ref: T,
|
|
603
|
-
className:
|
|
604
|
+
className: z.item,
|
|
604
605
|
"data-exiting": r === "closing" || void 0,
|
|
605
606
|
inert: r === "closing",
|
|
606
607
|
children: /* @__PURE__ */ a("div", {
|
|
607
|
-
className:
|
|
608
|
-
children: /* @__PURE__ */ a(
|
|
608
|
+
className: z.itemContent,
|
|
609
|
+
children: /* @__PURE__ */ a(U.Provider, {
|
|
609
610
|
value: {
|
|
610
611
|
durationRevision: c,
|
|
611
612
|
isActive: r === "visible",
|
|
@@ -614,7 +615,7 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
614
615
|
rendererKey: _,
|
|
615
616
|
timingOverrides: m
|
|
616
617
|
},
|
|
617
|
-
children: /* @__PURE__ */ a(
|
|
618
|
+
children: /* @__PURE__ */ a(It, {
|
|
618
619
|
...v,
|
|
619
620
|
...m,
|
|
620
621
|
id: n,
|
|
@@ -622,43 +623,43 @@ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) =
|
|
|
622
623
|
})
|
|
623
624
|
})
|
|
624
625
|
})
|
|
625
|
-
}), /* @__PURE__ */ a(
|
|
626
|
+
}), /* @__PURE__ */ a(zt, {
|
|
626
627
|
elementRef: T,
|
|
627
628
|
toastEntry: e,
|
|
628
629
|
rendererKey: _
|
|
629
630
|
})] });
|
|
630
|
-
},
|
|
631
|
-
const t =
|
|
632
|
-
return t.map((s) => /* @__PURE__ */ a(
|
|
631
|
+
}, qt = ({ getToastProps: e }) => {
|
|
632
|
+
const t = Dt(), { closeToast: o } = re();
|
|
633
|
+
return t.map((s) => /* @__PURE__ */ a($t, {
|
|
633
634
|
toastEntry: s,
|
|
634
635
|
getToastProps: e,
|
|
635
636
|
onClose: o
|
|
636
637
|
}, s.notification.id));
|
|
637
|
-
},
|
|
638
|
+
}, jt = () => {
|
|
638
639
|
const e = N();
|
|
639
|
-
return
|
|
640
|
+
return R(() => (e.set("mountedToasterCount", e.state.mountedToasterCount + 1), () => {
|
|
640
641
|
e.set("mountedToasterCount", e.state.mountedToasterCount - 1), !(e.state.mountedToasterCount > 0) && e.set("toasts", e.state.toasts.filter(A));
|
|
641
642
|
}), [e]), null;
|
|
642
|
-
},
|
|
643
|
-
const n =
|
|
643
|
+
}, vo = ({ container: e, getToastProps: t, className: o, render: s, ref: r, ...c }) => {
|
|
644
|
+
const n = Ce(), v = ye(), f = e === void 0 ? n ?? (typeof document > "u" ? null : document.body) : e, m = $({
|
|
644
645
|
render: s,
|
|
645
646
|
ref: r,
|
|
646
647
|
props: {
|
|
647
648
|
role: "region",
|
|
648
649
|
dir: v,
|
|
649
|
-
"aria-label": "Notifications",
|
|
650
|
+
"aria-label": I("Notifications"),
|
|
650
651
|
...c,
|
|
651
|
-
className:
|
|
652
|
-
children: /* @__PURE__ */ g(
|
|
652
|
+
className: k(z.root, o),
|
|
653
|
+
children: /* @__PURE__ */ g(S, { children: [/* @__PURE__ */ a(jt, {}), /* @__PURE__ */ a(qt, { getToastProps: t })] })
|
|
653
654
|
}
|
|
654
655
|
});
|
|
655
|
-
return l(f) ?
|
|
656
|
+
return l(f) ? Fe(m, f) : null;
|
|
656
657
|
};
|
|
657
658
|
export {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
659
|
+
co as a,
|
|
660
|
+
lo as i,
|
|
661
|
+
uo as n,
|
|
662
|
+
ao as o,
|
|
663
|
+
It as r,
|
|
664
|
+
vo as t
|
|
664
665
|
};
|