twenty-ui 2.47.0 → 2.48.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.
Files changed (216) hide show
  1. package/dist/{AllIcons-DrlkKKQf.cjs → AllIcons-Cyd7721G.cjs} +1 -1
  2. package/dist/{AllIcons-G3nKeM41.js → AllIcons-D132B8_i.js} +1 -1
  3. package/dist/{Button-Cs07psdD.js → Button-D5enZ0Qz.js} +1 -1
  4. package/dist/{Button-COxEKIHL.cjs → Button-Dbi5P05r.cjs} +1 -1
  5. package/dist/Dropdown-BKjAaZS0.cjs +1 -0
  6. package/dist/Dropdown-C2hXrjvD.js +820 -0
  7. package/dist/{ListItem-q6DHGlev.cjs → ListItem-CHTR-GLd.cjs} +1 -1
  8. package/dist/{ListItem-CXu35dzp.js → ListItem-CjnrSbka.js} +4 -4
  9. package/dist/ListItem.module-BJ9Ttjrc.js +34 -0
  10. package/dist/ListItem.module-CO4u2oeF.cjs +1 -0
  11. package/dist/OverflowingTextWithTooltip-BmUROIah.js +90 -0
  12. package/dist/OverflowingTextWithTooltip-Z2daM0_x.cjs +1 -0
  13. package/dist/{ProgressBar-D_3Gia0E.js → ProgressBar-BvT1dyFo.js} +1 -1
  14. package/dist/{ProgressBar-oF1qVHFx.cjs → ProgressBar-DfFz0fFB.cjs} +1 -1
  15. package/dist/{Radio-BMoQHDe7.js → Radio-DMI1B7o5.js} +1 -1
  16. package/dist/{Radio-D_YUizSv.cjs → Radio-xmHgGHQO.cjs} +1 -1
  17. package/dist/{ResizeHandle-Bjg4R0c-.js → ResizeHandle-C1kQ3MYR.js} +1 -0
  18. package/dist/ResizeHandle-DI4LHIQm.cjs +1 -0
  19. package/dist/Shortcut-BvWUZ3pb.js +72 -0
  20. package/dist/Shortcut-CgrdLv_L.cjs +1 -0
  21. package/dist/TabsTabContent-Co27Y2TU.cjs +1 -0
  22. package/dist/TabsTabContent-DVcObDp6.js +39 -0
  23. package/dist/Tooltip-Bg9Uk01p.cjs +1 -0
  24. package/dist/Tooltip-cLCgtFBF.js +124 -0
  25. package/dist/components/code-editor/CodeEditor/CodeEditor.d.ts +1 -1
  26. package/dist/components/code-editor/CodeEditor/__stories__/ControlledCodeEditor.d.ts +2 -0
  27. package/dist/components/code-editor/CodeEditor/__stories__/ModelCodeEditor.d.ts +2 -0
  28. package/dist/components/code-editor/CodeEditor/__stories__/ResizableCodeEditor.d.ts +2 -0
  29. package/dist/components/code-editor/CodeEditor/__stories__/ThemedCodeEditor.d.ts +2 -0
  30. package/dist/components/code-editor/CodeEditor/__stories__/UnmountingCodeEditor.d.ts +2 -0
  31. package/dist/components/code-editor/CodeEditor/__stories__/waitForCodeEditorContent.d.ts +4 -1
  32. package/dist/components/code-editor/CodeEditor/internal/CodeEditorAutoHeightEffect.d.ts +9 -0
  33. package/dist/components/code-editor/CodeEditor/internal/CodeEditorLifecycleEffect.d.ts +11 -0
  34. package/dist/components/code-editor/CodeEditor/internal/CodeEditorLoaderConfigurationEffect.d.ts +7 -0
  35. package/dist/components/code-editor/CodeEditor/internal/CodeEditorMarkersEffect.d.ts +10 -0
  36. package/dist/components/code-editor/CodeEditor/internal/CodeEditorResizableHeightEffect.d.ts +11 -0
  37. package/dist/components/code-editor/CodeEditor/internal/CodeEditorThemeEffect.d.ts +10 -0
  38. package/dist/components/code-editor/CodeEditor/internal/constants/CodeEditorDefaultHeight.d.ts +1 -0
  39. package/dist/components/code-editor/CodeEditor/internal/types/ResizedCodeEditorHeight.d.ts +4 -0
  40. package/dist/components/code-editor/CodeEditor/internal/useCodeEditorHeight.d.ts +13 -0
  41. package/dist/components/code-editor/CodeEditor/internal/utils/defineCodeEditorDefaultTheme.d.ts +7 -0
  42. package/dist/components/code-editor/CodeEditor/internal/utils/getBaseCodeEditorTheme.d.ts +4 -1
  43. package/dist/components/code-editor/CodeEditor/internal/utils/getBoundedCodeEditorHeight.d.ts +1 -0
  44. package/dist/components/code-editor/CodeEditor/internal/utils/getCurrentCodeEditorHeight.d.ts +7 -0
  45. package/dist/components/code-editor/CodeEditor/internal/utils/getResizableCodeEditorHeight.d.ts +5 -0
  46. package/dist/components/code-editor/CodeEditor/types/CodeEditorProps.d.ts +4 -2
  47. package/dist/components/code-editor.cjs +1 -1
  48. package/dist/components/code-editor.mjs +267 -155
  49. package/dist/components/data-display.mjs +1 -1
  50. package/dist/components/feedback/Toast/internal/components/ToastCountdownEffect.d.ts +4 -3
  51. package/dist/components/feedback/Toast/internal/components/ToastProviderLifecycleEffect.d.ts +3 -0
  52. package/dist/components/feedback/Toast/internal/constants/DefaultToastDuration.d.ts +1 -0
  53. package/dist/components/feedback/Toast/internal/contexts/ToastContext.d.ts +60 -1
  54. package/dist/components/feedback/Toast/internal/contexts/ToastTimingContext.d.ts +12 -2
  55. package/dist/components/feedback/Toast/internal/hooks/useToastContext.d.ts +60 -1
  56. package/dist/components/feedback/Toast/internal/hooks/useToastCountdown.d.ts +26 -0
  57. package/dist/components/feedback/Toast/internal/stores/createToastStore.d.ts +60 -1
  58. package/dist/components/feedback/Toast/internal/utils/assertValidToastLimit.d.ts +1 -0
  59. package/dist/components/feedback/Toast/internal/utils/completeToastExit.d.ts +3 -2
  60. package/dist/components/feedback/Toast/internal/utils/createToastCountdownStore.d.ts +22 -0
  61. package/dist/components/feedback/Toast/internal/utils/createToastLifecycle.d.ts +62 -0
  62. package/dist/components/feedback/Toast/internal/utils/dismissToasts.d.ts +3 -2
  63. package/dist/components/feedback/Toast/internal/utils/updateToastLimit.d.ts +5 -0
  64. package/dist/components/feedback/Toaster/__stories__/ToasterLifecycleControls.d.ts +7 -0
  65. package/dist/components/feedback/Toaster/__stories__/ToasterLifecycleExample.d.ts +2 -0
  66. package/dist/components/feedback/Toaster/__stories__/ToasterLifecycleExampleProps.d.ts +7 -0
  67. package/dist/components/feedback/Toaster/__stories__/ToasterLifecycleTimingOverrideExample.d.ts +9 -0
  68. package/dist/components/feedback/Toaster/__stories__/ToasterLifecycleUnrelatedNotificationActions.d.ts +5 -0
  69. package/dist/components/feedback/Toaster/__stories__/ToasterPortalExample.d.ts +5 -0
  70. package/dist/components/feedback/Toaster/__stories__/ToasterProviderLayoutReplayEffect.d.ts +4 -0
  71. package/dist/components/feedback/Toaster/__stories__/ToasterProviderPassiveReplayEffect.d.ts +4 -0
  72. package/dist/components/feedback/Toaster/__stories__/ToasterProviderReplayExample.d.ts +6 -0
  73. package/dist/components/feedback/Toaster/__stories__/ToasterProviderSuspenseExample.d.ts +4 -0
  74. package/dist/components/feedback/Toaster/__stories__/ToasterProviderSuspension.d.ts +5 -0
  75. package/dist/components/feedback/Toaster/internal/ToasterItemExitEffect.d.ts +2 -1
  76. package/dist/components/feedback.cjs +1 -1
  77. package/dist/components/feedback.mjs +1 -1
  78. package/dist/components/input/SearchInput/SearchInput.d.ts +1 -1
  79. package/dist/components/input/SearchInput/types/SearchInputProps.d.ts +2 -3
  80. package/dist/components/input/SegmentedControl/SegmentedControl.d.ts +1 -1
  81. package/dist/components/input/SegmentedControl/types/SegmentedControlProps.d.ts +2 -0
  82. package/dist/components/input/SegmentedControl/types/SegmentedControlSize.d.ts +1 -0
  83. package/dist/components/input/index.d.ts +1 -0
  84. package/dist/components/input.cjs +1 -1
  85. package/dist/components/input.mjs +2 -2
  86. package/dist/components/layout/OverflowingList/OverflowingList.d.ts +1 -1
  87. package/dist/components/layout/OverflowingList/__stories__/OverflowingListActionsExample.d.ts +7 -0
  88. package/dist/components/layout/OverflowingList/__stories__/OverflowingListCanceledCloseExample.d.ts +1 -0
  89. package/dist/components/layout/OverflowingList/__stories__/OverflowingListControlledExample.d.ts +1 -0
  90. package/dist/components/layout/OverflowingList/__stories__/OverflowingListControlledStateExample.d.ts +1 -0
  91. package/dist/components/layout/OverflowingList/__stories__/OverflowingListDisabledTriggerFocusExample.d.ts +1 -0
  92. package/dist/components/layout/OverflowingList/__stories__/OverflowingListEventBlockingExample.d.ts +7 -0
  93. package/dist/components/layout/OverflowingList/__stories__/OverflowingListFocusExample.d.ts +1 -0
  94. package/dist/components/layout/OverflowingList/__stories__/OverflowingListInstanceCleanupExample.d.ts +1 -0
  95. package/dist/components/layout/OverflowingList/__stories__/OverflowingListStateExample.d.ts +1 -0
  96. package/dist/components/layout/OverflowingList/__stories__/OverflowingListTriggerRefExample.d.ts +1 -0
  97. package/dist/components/layout/OverflowingList/internal/OverflowingListItem.d.ts +8 -2
  98. package/dist/components/layout/OverflowingList/internal/OverflowingListItemFocusEffect.d.ts +8 -0
  99. package/dist/components/layout/OverflowingList/internal/OverflowingListLayoutEffect.d.ts +16 -0
  100. package/dist/components/layout/OverflowingList/internal/OverflowingListPopupTarget.d.ts +10 -0
  101. package/dist/components/layout/OverflowingList/internal/focusOverflowingListFallback.d.ts +8 -0
  102. package/dist/components/layout/OverflowingList/internal/measureOverflowingListLayout.d.ts +10 -0
  103. package/dist/components/layout/OverflowingList/internal/types/OverflowingListLayout.d.ts +4 -0
  104. package/dist/components/layout/OverflowingList/internal/useFocusedElementUnmountRef.d.ts +1 -1
  105. package/dist/components/layout/OverflowingList/internal/useOverflowingListFocus.d.ts +30 -0
  106. package/dist/components/layout/OverflowingList/internal/useOverflowingListLayout.d.ts +6 -6
  107. package/dist/components/layout/OverflowingList/types/OverflowingListProps.d.ts +7 -2
  108. package/dist/components/layout.cjs +1 -1
  109. package/dist/components/layout.mjs +1 -1
  110. package/dist/components/navigation/Dropdown/Dropdown.d.ts +4 -4
  111. package/dist/components/navigation/Dropdown/internal/DropdownActionItem.d.ts +1 -1
  112. package/dist/components/navigation/Dropdown/internal/DropdownContent.d.ts +1 -1
  113. package/dist/components/navigation/Dropdown/internal/DropdownContextValue.d.ts +6 -5
  114. package/dist/components/navigation/Dropdown/internal/DropdownOptionItem.d.ts +1 -1
  115. package/dist/components/navigation/Dropdown/internal/DropdownRowFocus.d.ts +5 -0
  116. package/dist/components/navigation/Dropdown/internal/DropdownRowsEffect.d.ts +5 -0
  117. package/dist/components/navigation/Dropdown/internal/DropdownSubmenuTrigger.d.ts +1 -1
  118. package/dist/components/navigation/Dropdown/internal/getDropdownItemExplicitId.d.ts +5 -0
  119. package/dist/components/navigation/Dropdown/internal/getDropdownRows.d.ts +1 -0
  120. package/dist/components/navigation/Dropdown/internal/getDropdownSearch.d.ts +1 -0
  121. package/dist/components/navigation/Dropdown/internal/getDropdownTabStopRowId.d.ts +4 -0
  122. package/dist/components/navigation/Dropdown/internal/isDropdownDismissPrevented.d.ts +2 -1
  123. package/dist/components/navigation/Dropdown/internal/isDropdownRow.d.ts +4 -0
  124. package/dist/components/navigation/Dropdown/internal/isEnabledDropdownItem.d.ts +4 -0
  125. package/dist/components/navigation/Dropdown/internal/useDropdownItemFocus.d.ts +0 -1
  126. package/dist/components/navigation/Dropdown/internal/useDropdownKeyboardNavigation.d.ts +1 -6
  127. package/dist/components/navigation.cjs +1 -1
  128. package/dist/components/navigation.mjs +2 -2
  129. package/dist/components/settings.cjs +1 -1
  130. package/dist/components/settings.mjs +1 -1
  131. package/dist/components.cjs +1 -1
  132. package/dist/components.mjs +7 -7
  133. package/dist/data-display-0QO_WDSs.js +183 -0
  134. package/dist/data-display-CPmTJAWJ.cjs +1 -0
  135. package/dist/{data-display-DU3G8ZyI.js → data-display-KyZbLLy-.js} +1 -1
  136. package/dist/feedback-CM6fatE8.js +664 -0
  137. package/dist/feedback-ybO4n69s.cjs +1 -0
  138. package/dist/icon/components/TablerIcons.d.ts +1 -1
  139. package/dist/icon/constants/TwentyIconDictionary.d.ts +7 -7
  140. package/dist/icon/index.d.ts +1 -1
  141. package/dist/{icon-JuDK6Wxr.cjs → icon-BNcdwwdl.cjs} +1 -1
  142. package/dist/{icon-BdXwnJA6.js → icon-CUE-QGQK.js} +129 -128
  143. package/dist/icon.cjs +1 -1
  144. package/dist/icon.mjs +77 -76
  145. package/dist/index.cjs +1 -1
  146. package/dist/index.mjs +222 -220
  147. package/dist/input-3D2lXywH.cjs +1 -0
  148. package/dist/{input-Bnu5kNjg.cjs → input-CJDYNwoO.cjs} +1 -1
  149. package/dist/{input-vl6yK36n.js → input-DRpDiMRi.js} +4 -4
  150. package/dist/input-TM3nUdu6.js +554 -0
  151. package/dist/layout-BszCDxAO.js +441 -0
  152. package/dist/layout-VaIq7Sjr.cjs +1 -0
  153. package/dist/{navigation-itBinyPi.js → navigation-B1SRvzKK.js} +8 -8
  154. package/dist/{navigation-Dg46Wr5m.js → navigation-CYAs2LnR.js} +1 -1
  155. package/dist/{navigation-WsiYsmaq.cjs → navigation-CthkGHJ8.cjs} +1 -1
  156. package/dist/{navigation-B1hPNYv2.cjs → navigation-DrOV5E67.cjs} +1 -1
  157. package/dist/primitives/data-display.cjs +1 -1
  158. package/dist/primitives/data-display.mjs +1 -1
  159. package/dist/primitives/feedback.cjs +1 -1
  160. package/dist/primitives/feedback.mjs +1 -1
  161. package/dist/primitives/input.cjs +1 -1
  162. package/dist/primitives/input.mjs +3 -3
  163. package/dist/primitives/layout.cjs +1 -1
  164. package/dist/primitives/layout.mjs +1 -1
  165. package/dist/primitives/navigation.cjs +1 -1
  166. package/dist/primitives/navigation.mjs +2 -2
  167. package/dist/primitives/surfaces/Tooltip/Tooltip.d.ts +1 -1
  168. package/dist/primitives/surfaces/Tooltip/internal/TooltipPopup.d.ts +1 -1
  169. package/dist/primitives/surfaces/Tooltip/types/TooltipPopupProps.d.ts +2 -0
  170. package/dist/primitives/surfaces.cjs +1 -1
  171. package/dist/primitives/surfaces.mjs +2 -2
  172. package/dist/primitives/typography/OverflowingTextWithTooltip/OverflowingTextTooltipModeProvider.d.ts +6 -0
  173. package/dist/primitives/typography/OverflowingTextWithTooltip/internal/OverflowingTextTooltipModeContext.d.ts +2 -0
  174. package/dist/primitives/typography/OverflowingTextWithTooltip/internal/isElementOverflowing.d.ts +1 -0
  175. package/dist/primitives/typography/OverflowingTextWithTooltip/types/OverflowingTextTooltipMode.d.ts +1 -0
  176. package/dist/primitives/typography/Shortcut/Shortcut.d.ts +1 -1
  177. package/dist/primitives/typography/Shortcut/internal/getShortcutPresentation.d.ts +1 -1
  178. package/dist/primitives/typography/Shortcut/types/ShortcutFormatOptions.d.ts +1 -0
  179. package/dist/primitives/typography/index.d.ts +2 -0
  180. package/dist/primitives/typography.cjs +1 -1
  181. package/dist/primitives/typography.mjs +10 -9
  182. package/dist/primitives.cjs +1 -1
  183. package/dist/primitives.mjs +37 -36
  184. package/dist/{settings-BiSAY2oN.cjs → settings-BAYsnlZJ.cjs} +1 -1
  185. package/dist/{settings-CC-2gcAx.js → settings-BjEZiHXE.js} +1 -1
  186. package/dist/style.css +1 -1
  187. package/dist/surfaces-0rL5DoHt.cjs +1 -0
  188. package/dist/{surfaces-DZ2A-Nb9.js → surfaces-BLsR5ka0.js} +54 -54
  189. package/dist/typography-B5QEuPaL.cjs +1 -0
  190. package/dist/typography-fOTFr0jS.js +11 -0
  191. package/package.json +1 -1
  192. package/dist/Dropdown-BBUGkQQV.cjs +0 -1
  193. package/dist/Dropdown-CScN_olN.js +0 -784
  194. package/dist/ListItem.module-Ar-vZ7Qu.js +0 -34
  195. package/dist/ListItem.module-B8NeDH1P.cjs +0 -1
  196. package/dist/OverflowingTextWithTooltip-Be2-wCcZ.js +0 -88
  197. package/dist/OverflowingTextWithTooltip-BlufG-6n.cjs +0 -1
  198. package/dist/ResizeHandle-CNlQ4TEE.cjs +0 -1
  199. package/dist/Shortcut-DKfB0kej.js +0 -71
  200. package/dist/Shortcut-ZuZ-KYSk.cjs +0 -1
  201. package/dist/TabsTabContent-DZUNi_iE.cjs +0 -1
  202. package/dist/TabsTabContent-s6J5bZ3R.js +0 -39
  203. package/dist/Tooltip-BMkznyoi.js +0 -120
  204. package/dist/Tooltip-JOYVeSsf.cjs +0 -1
  205. package/dist/components/navigation/Dropdown/internal/DropdownSearchTargetEffect.d.ts +0 -5
  206. package/dist/data-display-BMV-nC-9.js +0 -181
  207. package/dist/data-display-BkujQe5v.cjs +0 -1
  208. package/dist/feedback-B5x8tmnG.cjs +0 -1
  209. package/dist/feedback-DhilJ_fX.js +0 -509
  210. package/dist/input-BEKjAOjS.cjs +0 -1
  211. package/dist/input-BUgnp6eA.js +0 -559
  212. package/dist/layout-BKHabkTu.js +0 -267
  213. package/dist/layout-wuIu4rJ3.cjs +0 -1
  214. package/dist/surfaces-vyAhk2Gw.cjs +0 -1
  215. package/dist/typography-8DF9mq2w.cjs +0 -1
  216. package/dist/typography-DmY7-GzQ.js +0 -5
@@ -0,0 +1,664 @@
1
+ import { t as l } from "./isDefined-fMi6eQ4r.js";
2
+ import { Ta as Y, gl as Z, hc as pe, la as _e, nt as F } from "./icon-CUE-QGQK.js";
3
+ import { a as Te, r as he, t as ge } from "./theme-B2EaXhye.js";
4
+ import { t as Ce } from "./mergeClassNames-ClFMR1v0.js";
5
+ import { t as W } from "./Button-D5enZ0Qz.js";
6
+ import { n as ee, r as be, t as we } from "./ProgressBar-BvT1dyFo.js";
7
+ import { t as y } from "./isRenderableSlot-DT_depzM.js";
8
+ import { t as xe } from "./useProvidedTextDirection-Dk8LBQeF.js";
9
+ import { t as ye } from "./OverflowingTextWithTooltip-BmUROIah.js";
10
+ import { t as Ae } from "./Separator-0LzwPfOn.js";
11
+ import { useRender as z } from "@base-ui/react/use-render";
12
+ import { isNonEmptyArray as $, isPositiveInteger as Ne, isString as Ee, isUndefined as Pe } from "@sniptt/guards";
13
+ import { clsx as S } from "clsx";
14
+ import { createContext as te, useCallback as Ie, useContext as q, useEffect as Re, useLayoutEffect as I, useMemo as Se, useRef as ke, useState as P, useSyncExternalStore as Oe } from "react";
15
+ import { Fragment as R, jsx as a, jsxs as g } from "react/jsx-runtime";
16
+ import { Store as We, useStore as Be } from "@base-ui/utils/store";
17
+ import { createPortal as Me } from "react-dom";
18
+ var Fe = "_action_3r2bm_1", De = { action: Fe }, ze = ({ className: e, ...t }) => /* @__PURE__ */ a(W, {
19
+ ...t,
20
+ size: "sm",
21
+ variant: "ghost",
22
+ className: Ce(De.action, e)
23
+ }), $e = "_container_1ix4w_1", qe = "_containerFullWidth_1ix4w_40", je = "_header_1ix4w_44", Ue = "_iconContainer_1ix4w_53", Le = "_title_1ix4w_63", Ke = "_descriptionWrapper_1ix4w_75", He = "_descriptionWrapperWithIcon_1ix4w_82", Ve = "_descriptionWrapperWithAction_1ix4w_86", Xe = "_description_1ix4w_75", Ge = "_footer_1ix4w_99", Je = "_closeButton_1ix4w_106", h = {
24
+ container: $e,
25
+ containerFullWidth: qe,
26
+ header: je,
27
+ iconContainer: Ue,
28
+ title: Le,
29
+ descriptionWrapper: Ke,
30
+ descriptionWrapperWithIcon: He,
31
+ descriptionWrapperWithAction: Ve,
32
+ description: Xe,
33
+ footer: Ge,
34
+ closeButton: Je
35
+ }, Qe = ({ status: e = "info", variant: t = "soft", color: o = be[e], title: s, description: r, fullWidth: c = !1, icon: n = /* @__PURE__ */ a(_e, {
36
+ size: Te.icon.size.md,
37
+ "aria-hidden": "true"
38
+ }), action: v, closeLabel: f = "Close", onDismiss: m, className: _, render: T, ref: u, ...d }) => {
39
+ const i = y(n), p = y(v);
40
+ return z({
41
+ render: T,
42
+ ref: u,
43
+ state: {
44
+ status: e,
45
+ variant: t,
46
+ color: o
47
+ },
48
+ props: {
49
+ ...d,
50
+ className: S(h.container, c && h.containerFullWidth, _),
51
+ children: /* @__PURE__ */ g(R, { children: [
52
+ /* @__PURE__ */ g("div", {
53
+ className: h.header,
54
+ children: [
55
+ i && /* @__PURE__ */ a("div", {
56
+ className: h.iconContainer,
57
+ children: n
58
+ }),
59
+ /* @__PURE__ */ a("div", {
60
+ className: h.title,
61
+ children: s
62
+ }),
63
+ l(m) && /* @__PURE__ */ a(W, {
64
+ type: "button",
65
+ startIcon: /* @__PURE__ */ a(Z, { "aria-hidden": "true" }),
66
+ className: h.closeButton,
67
+ variant: "ghost",
68
+ size: "sm",
69
+ "aria-label": f,
70
+ onClick: () => m()
71
+ })
72
+ ]
73
+ }),
74
+ y(r) && /* @__PURE__ */ a("div", {
75
+ className: S(h.descriptionWrapper, i && h.descriptionWrapperWithIcon, p && h.descriptionWrapperWithAction),
76
+ children: /* @__PURE__ */ a("div", {
77
+ className: h.description,
78
+ children: r
79
+ })
80
+ }),
81
+ p && /* @__PURE__ */ a("div", {
82
+ className: h.footer,
83
+ children: v
84
+ })
85
+ ] })
86
+ }
87
+ });
88
+ }, no = Object.assign(Qe, { Action: ze }), Ye = "_banner_17vm4_1", Ze = "_embedded_17vm4_6", et = "_bannerContent_17vm4_10", tt = "_icon_17vm4_18", ot = "_bannerText_17vm4_28", st = "_compact_17vm4_33", E = {
89
+ banner: Ye,
90
+ embedded: Ze,
91
+ bannerContent: et,
92
+ icon: tt,
93
+ bannerText: ot,
94
+ compact: st
95
+ }, rt = ({ children: e, layout: t = "standard", variant: o = "soft", embedded: s = !1, icon: r = /* @__PURE__ */ a(Y, { "aria-hidden": "true" }), className: c, ...n }) => {
96
+ const v = t === "compact", f = !v && Ee(e);
97
+ return /* @__PURE__ */ a(ee, {
98
+ ...n,
99
+ className: S(E.banner, v && E.compact, s && E.embedded, c),
100
+ variant: o,
101
+ "data-layout": t,
102
+ children: /* @__PURE__ */ g("div", {
103
+ className: E.bannerContent,
104
+ children: [y(r) && /* @__PURE__ */ a("span", {
105
+ className: E.icon,
106
+ children: r
107
+ }), /* @__PURE__ */ a("div", {
108
+ className: E.bannerText,
109
+ children: f ? /* @__PURE__ */ a(ye, {
110
+ isFocusable: !0,
111
+ text: /* @__PURE__ */ a(R, { children: e }),
112
+ tooltipContent: e
113
+ }) : e
114
+ })]
115
+ })
116
+ });
117
+ }, io = Object.assign(rt, { Action: ee.Action }), A = (e) => e.status === "visible", B = ({ store: e, toastsToClose: t, nextToasts: o = e.state.toasts }) => {
118
+ const s = t.filter((n) => A(n) && e.state.toasts.includes(n)), r = o.map((n) => s.includes(n) ? {
119
+ ...n,
120
+ status: "closing"
121
+ } : n), c = e.state.mountedToasterCount > 0;
122
+ e.set("toasts", c ? r : r.filter(A));
123
+ for (const n of s) n.notification.onClose?.();
124
+ }, oe = te(void 0), N = () => {
125
+ const e = q(oe);
126
+ if (!l(e)) throw new Error("Toast components must be used within a ToastProvider.");
127
+ return e;
128
+ }, se = () => {
129
+ const e = N();
130
+ return { closeToast: (o) => {
131
+ if (!e.lifecycle.isActive()) return;
132
+ const s = e.state.toasts.filter((r) => A(r) && (!l(o) || r.notification.id === o));
133
+ $(s) && B({
134
+ store: e,
135
+ toastsToClose: s
136
+ });
137
+ } };
138
+ }, J = 0, Q = () => (J += 1, `toast-${J}`), nt = () => {
139
+ const e = N();
140
+ return { enqueueToast: Se(() => {
141
+ function t(o) {
142
+ if (!l(o)) return;
143
+ if (!e.lifecycle.isActive()) return Q();
144
+ 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
+ if (l(f)) return f.notification.id;
146
+ const m = Q(), _ = Math.max(0, v.length - n + 1);
147
+ return B({
148
+ store: e,
149
+ toastsToClose: v.slice(0, _),
150
+ nextToasts: [...c, {
151
+ notification: {
152
+ ...r,
153
+ id: m
154
+ },
155
+ dedupeKey: s,
156
+ status: "visible"
157
+ }]
158
+ }), m;
159
+ }
160
+ return t;
161
+ }, [e]) };
162
+ }, it = ({ store: e, id: t, ...o }) => {
163
+ if (!e.lifecycle.isActive()) return;
164
+ const s = e.state.toasts.find((n) => n.notification.id === t && A(n)), r = Object.keys(o);
165
+ if (!l(s) || !$(r)) return;
166
+ const c = r.includes("duration") || l(s.notification.progress) && r.includes("progress") && !l(o.progress);
167
+ e.set("toasts", e.state.toasts.map((n) => n === s ? {
168
+ ...n,
169
+ notification: {
170
+ ...n.notification,
171
+ ...o,
172
+ id: t
173
+ },
174
+ ...c ? { durationRevision: (n.durationRevision ?? 0) + 1 } : {}
175
+ } : n));
176
+ }, at = () => {
177
+ const e = N();
178
+ return { updateToast: Ie((t) => it({
179
+ store: e,
180
+ ...t
181
+ }), [e]) };
182
+ }, ao = () => {
183
+ const { closeToast: e } = se(), { enqueueToast: t } = nt(), { updateToast: o } = at();
184
+ return {
185
+ enqueueToast: t,
186
+ closeToast: e,
187
+ updateToast: o
188
+ };
189
+ }, ct = "_root_181ka_1", dt = "_progress_181ka_19", lt = "_header_181ka_30", ut = "_message_181ka_40", vt = "_icon_181ka_45", ft = "_actions_181ka_50", mt = "_description_181ka_56", pt = "_footer_181ka_65", _t = "_footerAction_181ka_69", Tt = "_closeButton_181ka_76", b = {
190
+ root: ct,
191
+ progress: dt,
192
+ header: lt,
193
+ message: ut,
194
+ icon: vt,
195
+ actions: ft,
196
+ description: mt,
197
+ footer: pt,
198
+ footerAction: _t,
199
+ closeButton: Tt
200
+ }, j = te({
201
+ durationRevision: 0,
202
+ isActive: !0
203
+ }), ht = ({ clock: e, onClockChange: t, duration: o, progress: s, isPaused: r, onClose: c }) => {
204
+ const { durationRevision: n, isActive: v, lifecycle: f, id: m, rendererKey: _, timingOverrides: T } = q(j), 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");
205
+ return I(() => {
206
+ if (u) {
207
+ t(f.updateRenderer({
208
+ id: m,
209
+ key: _,
210
+ configuration: {
211
+ duration: p ? o : void 0,
212
+ isProgress: x ? i : void 0,
213
+ isPaused: r
214
+ }
215
+ }));
216
+ return;
217
+ }
218
+ d?.update({
219
+ duration: o,
220
+ durationRevision: n,
221
+ isPaused: r,
222
+ isProgress: i,
223
+ isActive: v,
224
+ onClose: c
225
+ });
226
+ }, [
227
+ d,
228
+ t,
229
+ u,
230
+ o,
231
+ n,
232
+ r,
233
+ i,
234
+ v,
235
+ c,
236
+ f,
237
+ m,
238
+ _,
239
+ p,
240
+ x
241
+ ]), I(() => () => {
242
+ if (u) {
243
+ f.removeRenderer({
244
+ id: m,
245
+ key: _
246
+ });
247
+ return;
248
+ }
249
+ d?.stop();
250
+ }, [
251
+ d,
252
+ f,
253
+ m,
254
+ _,
255
+ u
256
+ ]), null;
257
+ }, gt = ({ element: e, isFocused: t, onFocusChange: o }) => (I(() => {
258
+ if (!t || !l(e)) return;
259
+ const s = () => {
260
+ e.contains(e.ownerDocument.activeElement) || o(!1);
261
+ };
262
+ s();
263
+ const r = new MutationObserver(s);
264
+ return r.observe(e, {
265
+ childList: !0,
266
+ subtree: !0
267
+ }), () => r.disconnect();
268
+ }, [
269
+ e,
270
+ t,
271
+ o
272
+ ]), null), re = 6e3, ne = (e) => Number.isFinite(e) && e > 0, Ct = "_countdown_1vuo8_1", bt = "_toastCountdown_1vuo8_1", wt = {
273
+ countdown: Ct,
274
+ toastCountdown: bt
275
+ }, xt = ({ progress: e, duration: t, remainingDuration: o, revision: s, isPaused: r, barColor: c }) => l(e) ? /* @__PURE__ */ a(we, {
276
+ value: e,
277
+ barColor: c
278
+ }) : ne(t) ? /* @__PURE__ */ a("div", {
279
+ className: wt.countdown,
280
+ "data-paused": r || void 0,
281
+ style: {
282
+ "--toast-countdown-color": c,
283
+ "--toast-countdown-width": `${o / t * 100}%`,
284
+ "--toast-countdown-duration": `${o}ms`
285
+ }
286
+ }, s) : null, yt = 2 ** 31 - 1, At = ({ onChange: e }) => {
287
+ let t, o = 0, s, r, c = 0, n = 0, v = !1;
288
+ const f = () => {
289
+ n += 1, l(s) && (o = Math.max(0, o - (performance.now() - s)), s = void 0), clearTimeout(r), r = void 0;
290
+ }, m = () => {
291
+ l(t) && (c += 1, e({
292
+ duration: t.duration,
293
+ remainingDuration: o,
294
+ revision: c,
295
+ isPaused: t.isPaused || !t.isActive
296
+ }));
297
+ }, _ = () => {
298
+ v || (f(), v = !0, o = 0, m(), t?.onClose?.());
299
+ }, T = () => l(t) && t.isActive && !t.isPaused && !t.isProgress && ne(t.duration) && !v, u = () => {
300
+ if (!T()) return;
301
+ s = performance.now();
302
+ const i = n;
303
+ r = setTimeout(() => {
304
+ if (i === n) {
305
+ if (f(), o > 0) {
306
+ u();
307
+ return;
308
+ }
309
+ _();
310
+ }
311
+ }, Math.min(o, yt));
312
+ };
313
+ return {
314
+ update: (i) => {
315
+ const p = !l(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 = !l(s) && T();
316
+ if (!x && !C) {
317
+ t = i;
318
+ return;
319
+ }
320
+ f(), t = i, !v && (p && (o = Math.max(0, i.duration)), m(), u());
321
+ },
322
+ close: _,
323
+ stop: f
324
+ };
325
+ }, ie = ({ duration: e, isPaused: t }) => {
326
+ let o = {
327
+ duration: e,
328
+ remainingDuration: e,
329
+ revision: 0,
330
+ isPaused: t
331
+ };
332
+ const s = /* @__PURE__ */ new Set();
333
+ return {
334
+ ...At({ onChange: (r) => {
335
+ o = r;
336
+ for (const c of s) c();
337
+ } }),
338
+ getSnapshot: () => o,
339
+ subscribe: (r) => (s.add(r), () => {
340
+ s.delete(r);
341
+ })
342
+ };
343
+ }, Nt = ({ duration: e, isPaused: t }) => {
344
+ const { lifecycle: o, id: s, rendererKey: r } = q(j), [c, n] = P(() => (l(o) && l(s) && l(r) ? o.getCountdown(s) : void 0) ?? ie({
345
+ duration: e,
346
+ isPaused: t
347
+ }));
348
+ return {
349
+ countdown: Oe(c.subscribe, c.getSnapshot, c.getSnapshot),
350
+ clock: c,
351
+ setClock: n
352
+ };
353
+ }, Et = {
354
+ neutral: F,
355
+ error: F,
356
+ success: pe,
357
+ info: Y,
358
+ warning: F
359
+ }, Pt = ({ children: e, description: t, icon: o, iconLabel: s, action: r, progress: c, duration: n = re, onCancel: v, onClose: f, cancelLabel: m = "Cancel", closeLabel: _ = "Close", status: T = "neutral", role: u = "status", className: d, onMouseEnter: i, onMouseLeave: p, onFocus: x, onBlur: C, render: k, ref: ce, ...de }) => {
360
+ const U = he(), [le, L] = P(!1), [K, M] = P(!1), [ue, ve] = P(null), H = le || K, { countdown: O, clock: V, setClock: fe } = Nt({
361
+ duration: n,
362
+ isPaused: H
363
+ }), me = Et[T], X = U.snackBar[T === "neutral" ? "default" : T], G = Pe(o) ? /* @__PURE__ */ a(me, {
364
+ "aria-label": s,
365
+ "aria-hidden": !l(s),
366
+ color: X.color,
367
+ size: U.icon.size.md
368
+ }) : o;
369
+ return /* @__PURE__ */ g(R, { children: [
370
+ z({
371
+ render: k,
372
+ ref: [ce ?? null, ve],
373
+ props: {
374
+ role: u,
375
+ "aria-live": u === "alert" ? "assertive" : "polite",
376
+ ...de,
377
+ className: S(b.root, d),
378
+ onMouseEnter: (w) => {
379
+ L(!0), i?.(w);
380
+ },
381
+ onMouseLeave: (w) => {
382
+ L(!1), p?.(w);
383
+ },
384
+ onFocus: (w) => {
385
+ M(!0), x?.(w);
386
+ },
387
+ onBlur: (w) => {
388
+ w.currentTarget.contains(w.relatedTarget) || M(!1), C?.(w);
389
+ },
390
+ children: /* @__PURE__ */ g(R, { children: [
391
+ /* @__PURE__ */ a("div", {
392
+ className: b.progress,
393
+ "aria-hidden": !0,
394
+ children: /* @__PURE__ */ a(xt, {
395
+ barColor: X.backgroundColor,
396
+ progress: c,
397
+ duration: O.duration,
398
+ remainingDuration: O.remainingDuration,
399
+ revision: O.revision,
400
+ isPaused: O.isPaused
401
+ })
402
+ }),
403
+ /* @__PURE__ */ g("div", {
404
+ className: b.header,
405
+ children: [
406
+ y(G) && /* @__PURE__ */ a("div", {
407
+ className: b.icon,
408
+ children: G
409
+ }),
410
+ /* @__PURE__ */ a("div", {
411
+ className: b.message,
412
+ children: e
413
+ }),
414
+ /* @__PURE__ */ g("div", {
415
+ className: b.actions,
416
+ children: [l(v) && y(m) && /* @__PURE__ */ a(W, {
417
+ onClick: v,
418
+ size: "sm",
419
+ variant: "ghost",
420
+ style: { fontWeight: "var(--t-font-weight-regular)" },
421
+ children: m
422
+ }), l(f) && /* @__PURE__ */ a(W, {
423
+ title: _,
424
+ "aria-label": _,
425
+ startIcon: /* @__PURE__ */ a(Z, {}),
426
+ className: b.closeButton,
427
+ variant: "ghost",
428
+ size: "sm",
429
+ onClick: V.close
430
+ })]
431
+ })
432
+ ]
433
+ }),
434
+ y(t) && /* @__PURE__ */ a("div", {
435
+ className: b.description,
436
+ children: t
437
+ }),
438
+ y(r) && /* @__PURE__ */ g("div", {
439
+ className: b.footer,
440
+ children: [/* @__PURE__ */ a(Ae, {}), /* @__PURE__ */ a("div", {
441
+ className: b.footerAction,
442
+ children: r
443
+ })]
444
+ })
445
+ ] })
446
+ }
447
+ }),
448
+ /* @__PURE__ */ a(gt, {
449
+ element: ue,
450
+ isFocused: K,
451
+ onFocusChange: M
452
+ }),
453
+ /* @__PURE__ */ a(ht, {
454
+ clock: V,
455
+ onClockChange: fe,
456
+ duration: n,
457
+ progress: c,
458
+ isPaused: H,
459
+ onClose: f
460
+ })
461
+ ] });
462
+ }, ae = (e) => {
463
+ if (!Ne(e)) throw new Error("Toast limit must be a positive integer.");
464
+ }, It = ({ store: e, limit: t }) => {
465
+ if (ae(t), e.state.limit === t) return;
466
+ e.set("limit", t);
467
+ const o = e.state.toasts.filter(A), s = Math.max(0, o.length - t);
468
+ s !== 0 && B({
469
+ store: e,
470
+ toastsToClose: o.slice(0, s)
471
+ });
472
+ }, Rt = ({ limit: e }) => {
473
+ const t = N();
474
+ return Re(() => t.lifecycle.mount(), [t]), I(() => It({
475
+ store: t,
476
+ limit: e
477
+ }), [t, e]), null;
478
+ }, St = ({ store: e, toast: t }) => {
479
+ const { toasts: o } = e.state;
480
+ t.status === "closing" && o.includes(t) && e.set("toasts", o.filter((s) => s !== t));
481
+ }, kt = (e) => {
482
+ const t = /* @__PURE__ */ new Map();
483
+ let o = !1, s = !1, r = 0;
484
+ const c = (u) => {
485
+ const d = t.get(u);
486
+ if (l(d)) return d;
487
+ const i = {
488
+ countdown: ie({
489
+ duration: re,
490
+ isPaused: !0
491
+ }),
492
+ renderers: /* @__PURE__ */ new Map()
493
+ };
494
+ return t.set(u, i), i;
495
+ }, n = (u) => {
496
+ if (!o) return;
497
+ const d = t.get(u);
498
+ if (!l(d?.pendingExits) || d.pendingExits.size > 0) return;
499
+ const i = e.state.toasts.find((p) => p.notification.id === u);
500
+ l(i) && St({
501
+ store: e,
502
+ toast: i
503
+ });
504
+ }, v = () => {
505
+ for (const [u, d] of t) {
506
+ const i = e.state.toasts.find((C) => C.notification.id === u);
507
+ if (!l(i)) {
508
+ d.countdown.stop(), t.delete(u);
509
+ continue;
510
+ }
511
+ const p = d.renderers.values().next().value ?? d.lastRenderer;
512
+ d.lastRenderer = p;
513
+ const x = !o || d.renderers.size === 0 || [...d.renderers.values()].some((C) => C.isPaused);
514
+ d.countdown.update({
515
+ duration: p?.duration ?? i.notification.duration ?? 6e3,
516
+ durationRevision: i.durationRevision ?? 0,
517
+ isProgress: p?.isProgress ?? l(i.notification.progress),
518
+ isPaused: x,
519
+ isActive: i.status === "visible",
520
+ onClose: () => {
521
+ const C = e.state.toasts.find((k) => k.notification.id === u && A(k));
522
+ !o || !l(C) || B({
523
+ store: e,
524
+ toastsToClose: [C]
525
+ });
526
+ }
527
+ }), i.status !== "visible" && (d.pendingExits ??= new Set(d.renderers.keys()), n(u));
528
+ }
529
+ };
530
+ return {
531
+ mount: () => {
532
+ o = !0, s = !1, r += 1;
533
+ const u = e.subscribe(v);
534
+ return v(), () => {
535
+ o = !1, u();
536
+ for (const i of t.values()) i.countdown.stop();
537
+ const d = ++r;
538
+ queueMicrotask(() => {
539
+ o || r !== d || (s = !0, t.clear(), e.set("toasts", []));
540
+ });
541
+ };
542
+ },
543
+ isActive: () => !s,
544
+ getCountdown: (u) => t.get(u)?.countdown,
545
+ updateRenderer: ({ id: u, key: d, configuration: i }) => {
546
+ const p = c(u);
547
+ return p.renderers.has(d) || (p.countdown.stop(), p.pendingExits?.add(d)), p.renderers.set(d, i), v(), p.countdown;
548
+ },
549
+ removeRenderer: ({ id: u, key: d }) => {
550
+ const i = t.get(u);
551
+ l(i) && (i.renderers.delete(d), i.pendingExits?.delete(d), v());
552
+ },
553
+ finishExit: ({ id: u, key: d }) => {
554
+ t.get(u)?.pendingExits?.delete(d), n(u);
555
+ }
556
+ };
557
+ }, Ot = (e = 3) => {
558
+ ae(e);
559
+ const t = new We({
560
+ toasts: [],
561
+ limit: e,
562
+ mountedToasterCount: 0
563
+ });
564
+ return Object.assign(t, { lifecycle: kt(t) });
565
+ }, co = ({ children: e, limit: t = 3 }) => {
566
+ const [o] = P(() => Ot(t));
567
+ return /* @__PURE__ */ g(oe.Provider, {
568
+ value: o,
569
+ children: [e, /* @__PURE__ */ a(Rt, { limit: t })]
570
+ });
571
+ }, Wt = "_root_1q2cc_1", Bt = "_item_1q2cc_20", Mt = "_itemContent_1q2cc_47", D = {
572
+ root: Wt,
573
+ item: Bt,
574
+ itemContent: Mt
575
+ }, Ft = () => Be(N(), (e) => e.toasts), Dt = ({ elementRef: e, toastEntry: t, rendererKey: o }) => {
576
+ const s = N();
577
+ return I(() => {
578
+ if (t.status === "visible") return;
579
+ const r = () => s.lifecycle.finishExit({
580
+ id: t.notification.id,
581
+ key: o
582
+ }), c = e.current?.getAnimations?.() ?? [];
583
+ if (!$(c)) {
584
+ r();
585
+ return;
586
+ }
587
+ let n = !1;
588
+ return Promise.allSettled(c.map((v) => v.finished)).then(() => {
589
+ n || r();
590
+ }), () => {
591
+ n = !0;
592
+ };
593
+ }, [
594
+ e,
595
+ t,
596
+ s,
597
+ o
598
+ ]), null;
599
+ }, zt = ({ toastEntry: e, getToastProps: t, onClose: o }) => {
600
+ const { notification: s, status: r, durationRevision: c = 0 } = e, { id: n, ...v } = s, f = N(), m = t?.(s), [_] = P(() => /* @__PURE__ */ Symbol()), T = ke(null);
601
+ return /* @__PURE__ */ g(R, { children: [/* @__PURE__ */ a("div", {
602
+ ref: T,
603
+ className: D.item,
604
+ "data-exiting": r === "closing" || void 0,
605
+ inert: r === "closing",
606
+ children: /* @__PURE__ */ a("div", {
607
+ className: D.itemContent,
608
+ children: /* @__PURE__ */ a(j.Provider, {
609
+ value: {
610
+ durationRevision: c,
611
+ isActive: r === "visible",
612
+ lifecycle: f.lifecycle,
613
+ id: n,
614
+ rendererKey: _,
615
+ timingOverrides: m
616
+ },
617
+ children: /* @__PURE__ */ a(Pt, {
618
+ ...v,
619
+ ...m,
620
+ id: n,
621
+ onClose: () => o(n)
622
+ })
623
+ })
624
+ })
625
+ }), /* @__PURE__ */ a(Dt, {
626
+ elementRef: T,
627
+ toastEntry: e,
628
+ rendererKey: _
629
+ })] });
630
+ }, $t = ({ getToastProps: e }) => {
631
+ const t = Ft(), { closeToast: o } = se();
632
+ return t.map((s) => /* @__PURE__ */ a(zt, {
633
+ toastEntry: s,
634
+ getToastProps: e,
635
+ onClose: o
636
+ }, s.notification.id));
637
+ }, qt = () => {
638
+ const e = N();
639
+ return I(() => (e.set("mountedToasterCount", e.state.mountedToasterCount + 1), () => {
640
+ e.set("mountedToasterCount", e.state.mountedToasterCount - 1), !(e.state.mountedToasterCount > 0) && e.set("toasts", e.state.toasts.filter(A));
641
+ }), [e]), null;
642
+ }, lo = ({ container: e, getToastProps: t, className: o, render: s, ref: r, ...c }) => {
643
+ const n = ge(), v = xe(), f = e === void 0 ? n ?? (typeof document > "u" ? null : document.body) : e, m = z({
644
+ render: s,
645
+ ref: r,
646
+ props: {
647
+ role: "region",
648
+ dir: v,
649
+ "aria-label": "Notifications",
650
+ ...c,
651
+ className: S(D.root, o),
652
+ children: /* @__PURE__ */ g(R, { children: [/* @__PURE__ */ a(qt, {}), /* @__PURE__ */ a($t, { getToastProps: t })] })
653
+ }
654
+ });
655
+ return l(f) ? Me(m, f) : null;
656
+ };
657
+ export {
658
+ io as a,
659
+ ao as i,
660
+ co as n,
661
+ no as o,
662
+ Pt as r,
663
+ lo as t
664
+ };
@@ -0,0 +1 @@
1
+ const W=require("./theme-1XkFz8Qu.cjs"),d=require("./isDefined-DS2Q42p5.cjs"),le=require("./mergeClassNames-D4lshrT6.cjs"),I=require("./Button-Dbi5P05r.cjs"),q=require("./ProgressBar-DfFz0fFB.cjs"),y=require("./isRenderableSlot-Guryb6Nf.cjs"),fe=require("./useProvidedTextDirection-PVaoQCLH.cjs"),ve=require("./OverflowingTextWithTooltip-Z2daM0_x.cjs"),me=require("./Separator-UJVlrTzw.cjs");let F=require("@base-ui/react/use-render"),R=require("@sniptt/guards"),A=require("clsx"),p=require("react"),r=require("react/jsx-runtime"),J=require("@base-ui/utils/store"),_e=require("react-dom"),j=require("@tabler/icons-react");var pe="_action_3r2bm_1",Te={action:pe},xe=({className:e,...t})=>(0,r.jsx)(I.Button,{...t,size:"sm",variant:"ghost",className:le.mergeClassNames(Te.action,e)}),he="_container_1ix4w_1",ge="_containerFullWidth_1ix4w_40",be="_header_1ix4w_44",Ce="_iconContainer_1ix4w_53",je="_title_1ix4w_63",we="_descriptionWrapper_1ix4w_75",ye="_descriptionWrapperWithIcon_1ix4w_82",De="_descriptionWrapperWithAction_1ix4w_86",Pe="_description_1ix4w_75",Ee="_footer_1ix4w_99",Re="_closeButton_1ix4w_106",h={container:he,containerFullWidth:ge,header:be,iconContainer:Ce,title:je,descriptionWrapper:we,descriptionWrapperWithIcon:ye,descriptionWrapperWithAction:De,description:Pe,footer:Ee,closeButton:Re},Ae=({status:e="info",variant:t="soft",color:s=q.FEEDBACK_STATUS_COLORS[e],title:n,description:o,fullWidth:c=!1,icon:i=(0,r.jsx)(j.IconHelp,{size:W.themeCssVariables.icon.size.md,"aria-hidden":"true"}),action:f,closeLabel:v="Close",onDismiss:m,className:T,render:x,ref:l,...u})=>{const a=y.isRenderableSlot(i),_=y.isRenderableSlot(f);return(0,F.useRender)({render:x,ref:l,state:{status:e,variant:t,color:s},props:{...u,className:(0,A.clsx)(h.container,c&&h.containerFullWidth,T),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:h.header,children:[a&&(0,r.jsx)("div",{className:h.iconContainer,children:i}),(0,r.jsx)("div",{className:h.title,children:n}),d.isDefined(m)&&(0,r.jsx)(I.Button,{type:"button",startIcon:(0,r.jsx)(j.IconX,{"aria-hidden":"true"}),className:h.closeButton,variant:"ghost",size:"sm","aria-label":v,onClick:()=>m()})]}),y.isRenderableSlot(o)&&(0,r.jsx)("div",{className:(0,A.clsx)(h.descriptionWrapper,a&&h.descriptionWrapperWithIcon,_&&h.descriptionWrapperWithAction),children:(0,r.jsx)("div",{className:h.description,children:o})}),_&&(0,r.jsx)("div",{className:h.footer,children:f})]})}})},Se=Object.assign(Ae,{Action:xe}),Ne="_banner_17vm4_1",Ie="_embedded_17vm4_6",qe="_bannerContent_17vm4_10",Oe="_icon_17vm4_18",ke="_bannerText_17vm4_28",Be="_compact_17vm4_33",E={banner:Ne,embedded:Ie,bannerContent:qe,icon:Oe,bannerText:ke,compact:Be},We=({children:e,layout:t="standard",variant:s="soft",embedded:n=!1,icon:o=(0,r.jsx)(j.IconInfoCircle,{"aria-hidden":"true"}),className:c,...i})=>{const f=t==="compact",v=!f&&(0,R.isString)(e);return(0,r.jsx)(q.Banner,{...i,className:(0,A.clsx)(E.banner,f&&E.compact,n&&E.embedded,c),variant:s,"data-layout":t,children:(0,r.jsxs)("div",{className:E.bannerContent,children:[y.isRenderableSlot(o)&&(0,r.jsx)("span",{className:E.icon,children:o}),(0,r.jsx)("div",{className:E.bannerText,children:v?(0,r.jsx)(ve.OverflowingTextWithTooltip,{isFocusable:!0,text:(0,r.jsx)(r.Fragment,{children:e}),tooltipContent:e}):e})]})})},Fe=Object.assign(We,{Action:q.Banner.Action}),D=e=>e.status==="visible",O=({store:e,toastsToClose:t,nextToasts:s=e.state.toasts})=>{const n=t.filter(i=>D(i)&&e.state.toasts.includes(i)),o=s.map(i=>n.includes(i)?{...i,status:"closing"}:i),c=e.state.mountedToasterCount>0;e.set("toasts",c?o:o.filter(D));for(const i of n)i.notification.onClose?.()},Q=(0,p.createContext)(void 0),P=()=>{const e=(0,p.useContext)(Q);if(!d.isDefined(e))throw new Error("Toast components must be used within a ToastProvider.");return e},Y=()=>{const e=P();return{closeToast:s=>{if(!e.lifecycle.isActive())return;const n=e.state.toasts.filter(o=>D(o)&&(!d.isDefined(s)||o.notification.id===s));(0,R.isNonEmptyArray)(n)&&O({store:e,toastsToClose:n})}}},X=0,G=()=>(X+=1,`toast-${X}`),Me=()=>{const e=P();return{enqueueToast:(0,p.useMemo)(()=>{function t(s){if(!d.isDefined(s))return;if(!e.lifecycle.isActive())return G();const{dedupeKey:n,...o}=s,{toasts:c,limit:i}=e.state,f=c.filter(D),v=d.isDefined(n)?f.find(x=>x.dedupeKey===n):void 0;if(d.isDefined(v))return v.notification.id;const m=G(),T=Math.max(0,f.length-i+1);return O({store:e,toastsToClose:f.slice(0,T),nextToasts:[...c,{notification:{...o,id:m},dedupeKey:n,status:"visible"}]}),m}return t},[e])}},Le=({store:e,id:t,...s})=>{if(!e.lifecycle.isActive())return;const n=e.state.toasts.find(i=>i.notification.id===t&&D(i)),o=Object.keys(s);if(!d.isDefined(n)||!(0,R.isNonEmptyArray)(o))return;const c=o.includes("duration")||d.isDefined(n.notification.progress)&&o.includes("progress")&&!d.isDefined(s.progress);e.set("toasts",e.state.toasts.map(i=>i===n?{...i,notification:{...i.notification,...s,id:t},...c?{durationRevision:(i.durationRevision??0)+1}:{}}:i))},ze=()=>{const e=P();return{updateToast:(0,p.useCallback)(t=>Le({store:e,...t}),[e])}},$e=()=>{const{closeToast:e}=Y(),{enqueueToast:t}=Me(),{updateToast:s}=ze();return{enqueueToast:t,closeToast:e,updateToast:s}},Ue="_root_181ka_1",Ke="_progress_181ka_19",He="_header_181ka_30",Ve="_message_181ka_40",Xe="_icon_181ka_45",Ge="_actions_181ka_50",Je="_description_181ka_56",Qe="_footer_181ka_65",Ye="_footerAction_181ka_69",Ze="_closeButton_181ka_76",b={root:Ue,progress:Ke,header:He,message:Ve,icon:Xe,actions:Ge,description:Je,footer:Qe,footerAction:Ye,closeButton:Ze},M=(0,p.createContext)({durationRevision:0,isActive:!0}),et=({clock:e,onClockChange:t,duration:s,progress:n,isPaused:o,onClose:c})=>{const{durationRevision:i,isActive:f,lifecycle:v,id:m,rendererKey:T,timingOverrides:x}=(0,p.useContext)(M),l=d.isDefined(v)&&d.isDefined(m)&&d.isDefined(T),u=l?void 0:e,a=d.isDefined(n),_=d.isDefined(x)&&Object.prototype.propertyIsEnumerable.call(x,"duration"),w=d.isDefined(x)&&Object.prototype.propertyIsEnumerable.call(x,"progress");return(0,p.useLayoutEffect)(()=>{if(l){t(v.updateRenderer({id:m,key:T,configuration:{duration:_?s:void 0,isProgress:w?a:void 0,isPaused:o}}));return}u?.update({duration:s,durationRevision:i,isPaused:o,isProgress:a,isActive:f,onClose:c})},[u,t,l,s,i,o,a,f,c,v,m,T,_,w]),(0,p.useLayoutEffect)(()=>()=>{if(l){v.removeRenderer({id:m,key:T});return}u?.stop()},[u,v,m,T,l]),null},tt=({element:e,isFocused:t,onFocusChange:s})=>((0,p.useLayoutEffect)(()=>{if(!t||!d.isDefined(e))return;const n=()=>{e.contains(e.ownerDocument.activeElement)||s(!1)};n();const o=new MutationObserver(n);return o.observe(e,{childList:!0,subtree:!0}),()=>o.disconnect()},[e,t,s]),null),Z=6e3,ee=e=>Number.isFinite(e)&&e>0,st="_countdown_1vuo8_1",nt="_toastCountdown_1vuo8_1",rt={countdown:st,toastCountdown:nt},ot=({progress:e,duration:t,remainingDuration:s,revision:n,isPaused:o,barColor:c})=>d.isDefined(e)?(0,r.jsx)(q.ProgressBar,{value:e,barColor:c}):ee(t)?(0,r.jsx)("div",{className:rt.countdown,"data-paused":o||void 0,style:{"--toast-countdown-color":c,"--toast-countdown-width":`${s/t*100}%`,"--toast-countdown-duration":`${s}ms`}},n):null,it=2**31-1,at=({onChange:e})=>{let t,s=0,n,o,c=0,i=0,f=!1;const v=()=>{i+=1,d.isDefined(n)&&(s=Math.max(0,s-(performance.now()-n)),n=void 0),clearTimeout(o),o=void 0},m=()=>{d.isDefined(t)&&(c+=1,e({duration:t.duration,remainingDuration:s,revision:c,isPaused:t.isPaused||!t.isActive}))},T=()=>{f||(v(),f=!0,s=0,m(),t?.onClose?.())},x=()=>d.isDefined(t)&&t.isActive&&!t.isPaused&&!t.isProgress&&ee(t.duration)&&!f,l=()=>{if(!x())return;n=performance.now();const a=i;o=setTimeout(()=>{if(a===i){if(v(),s>0){l();return}T()}},Math.min(s,it))};return{update:a=>{const _=!d.isDefined(t)||a.duration!==t.duration||a.durationRevision!==t.durationRevision||t.isProgress&&!a.isProgress,w=_||a.isProgress!==t?.isProgress||a.isPaused!==t?.isPaused||a.isActive!==t?.isActive,g=!d.isDefined(n)&&x();if(!w&&!g){t=a;return}v(),t=a,!f&&(_&&(s=Math.max(0,a.duration)),m(),l())},close:T,stop:v}},te=({duration:e,isPaused:t})=>{let s={duration:e,remainingDuration:e,revision:0,isPaused:t};const n=new Set;return{...at({onChange:o=>{s=o;for(const c of n)c()}}),getSnapshot:()=>s,subscribe:o=>(n.add(o),()=>{n.delete(o)})}},ct=({duration:e,isPaused:t})=>{const{lifecycle:s,id:n,rendererKey:o}=(0,p.useContext)(M),[c,i]=(0,p.useState)(()=>(d.isDefined(s)&&d.isDefined(n)&&d.isDefined(o)?s.getCountdown(n):void 0)??te({duration:e,isPaused:t}));return{countdown:(0,p.useSyncExternalStore)(c.subscribe,c.getSnapshot,c.getSnapshot),clock:c,setClock:i}},ut={neutral:j.IconAlertTriangle,error:j.IconAlertTriangle,success:j.IconSquareRoundedCheck,info:j.IconInfoCircle,warning:j.IconAlertTriangle},se=({children:e,description:t,icon:s,iconLabel:n,action:o,progress:c,duration:i=Z,onCancel:f,onClose:v,cancelLabel:m="Cancel",closeLabel:T="Close",status:x="neutral",role:l="status",className:u,onMouseEnter:a,onMouseLeave:_,onFocus:w,onBlur:g,render:S,ref:re,...oe})=>{const L=W.useTheme(),[ie,z]=(0,p.useState)(!1),[$,k]=(0,p.useState)(!1),[ae,ce]=(0,p.useState)(null),U=ie||$,{countdown:N,clock:K,setClock:ue}=ct({duration:i,isPaused:U}),de=ut[x],H=L.snackBar[x==="neutral"?"default":x],V=(0,R.isUndefined)(s)?(0,r.jsx)(de,{"aria-label":n,"aria-hidden":!d.isDefined(n),color:H.color,size:L.icon.size.md}):s;return(0,r.jsxs)(r.Fragment,{children:[(0,F.useRender)({render:S,ref:[re??null,ce],props:{role:l,"aria-live":l==="alert"?"assertive":"polite",...oe,className:(0,A.clsx)(b.root,u),onMouseEnter:C=>{z(!0),a?.(C)},onMouseLeave:C=>{z(!1),_?.(C)},onFocus:C=>{k(!0),w?.(C)},onBlur:C=>{C.currentTarget.contains(C.relatedTarget)||k(!1),g?.(C)},children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:b.progress,"aria-hidden":!0,children:(0,r.jsx)(ot,{barColor:H.backgroundColor,progress:c,duration:N.duration,remainingDuration:N.remainingDuration,revision:N.revision,isPaused:N.isPaused})}),(0,r.jsxs)("div",{className:b.header,children:[y.isRenderableSlot(V)&&(0,r.jsx)("div",{className:b.icon,children:V}),(0,r.jsx)("div",{className:b.message,children:e}),(0,r.jsxs)("div",{className:b.actions,children:[d.isDefined(f)&&y.isRenderableSlot(m)&&(0,r.jsx)(I.Button,{onClick:f,size:"sm",variant:"ghost",style:{fontWeight:"var(--t-font-weight-regular)"},children:m}),d.isDefined(v)&&(0,r.jsx)(I.Button,{title:T,"aria-label":T,startIcon:(0,r.jsx)(j.IconX,{}),className:b.closeButton,variant:"ghost",size:"sm",onClick:K.close})]})]}),y.isRenderableSlot(t)&&(0,r.jsx)("div",{className:b.description,children:t}),y.isRenderableSlot(o)&&(0,r.jsxs)("div",{className:b.footer,children:[(0,r.jsx)(me.Separator,{}),(0,r.jsx)("div",{className:b.footerAction,children:o})]})]})}}),(0,r.jsx)(tt,{element:ae,isFocused:$,onFocusChange:k}),(0,r.jsx)(et,{clock:K,onClockChange:ue,duration:i,progress:c,isPaused:U,onClose:v})]})},ne=e=>{if(!(0,R.isPositiveInteger)(e))throw new Error("Toast limit must be a positive integer.")},dt=({store:e,limit:t})=>{if(ne(t),e.state.limit===t)return;e.set("limit",t);const s=e.state.toasts.filter(D),n=Math.max(0,s.length-t);n!==0&&O({store:e,toastsToClose:s.slice(0,n)})},lt=({limit:e})=>{const t=P();return(0,p.useEffect)(()=>t.lifecycle.mount(),[t]),(0,p.useLayoutEffect)(()=>dt({store:t,limit:e}),[t,e]),null},ft=({store:e,toast:t})=>{const{toasts:s}=e.state;t.status==="closing"&&s.includes(t)&&e.set("toasts",s.filter(n=>n!==t))},vt=e=>{const t=new Map;let s=!1,n=!1,o=0;const c=l=>{const u=t.get(l);if(d.isDefined(u))return u;const a={countdown:te({duration:Z,isPaused:!0}),renderers:new Map};return t.set(l,a),a},i=l=>{if(!s)return;const u=t.get(l);if(!d.isDefined(u?.pendingExits)||u.pendingExits.size>0)return;const a=e.state.toasts.find(_=>_.notification.id===l);d.isDefined(a)&&ft({store:e,toast:a})},f=()=>{for(const[l,u]of t){const a=e.state.toasts.find(g=>g.notification.id===l);if(!d.isDefined(a)){u.countdown.stop(),t.delete(l);continue}const _=u.renderers.values().next().value??u.lastRenderer;u.lastRenderer=_;const w=!s||u.renderers.size===0||[...u.renderers.values()].some(g=>g.isPaused);u.countdown.update({duration:_?.duration??a.notification.duration??6e3,durationRevision:a.durationRevision??0,isProgress:_?.isProgress??d.isDefined(a.notification.progress),isPaused:w,isActive:a.status==="visible",onClose:()=>{const g=e.state.toasts.find(S=>S.notification.id===l&&D(S));!s||!d.isDefined(g)||O({store:e,toastsToClose:[g]})}}),a.status!=="visible"&&(u.pendingExits??=new Set(u.renderers.keys()),i(l))}};return{mount:()=>{s=!0,n=!1,o+=1;const l=e.subscribe(f);return f(),()=>{s=!1,l();for(const a of t.values())a.countdown.stop();const u=++o;queueMicrotask(()=>{s||o!==u||(n=!0,t.clear(),e.set("toasts",[]))})}},isActive:()=>!n,getCountdown:l=>t.get(l)?.countdown,updateRenderer:({id:l,key:u,configuration:a})=>{const _=c(l);return _.renderers.has(u)||(_.countdown.stop(),_.pendingExits?.add(u)),_.renderers.set(u,a),f(),_.countdown},removeRenderer:({id:l,key:u})=>{const a=t.get(l);d.isDefined(a)&&(a.renderers.delete(u),a.pendingExits?.delete(u),f())},finishExit:({id:l,key:u})=>{t.get(l)?.pendingExits?.delete(u),i(l)}}},mt=(e=3)=>{ne(e);const t=new J.Store({toasts:[],limit:e,mountedToasterCount:0});return Object.assign(t,{lifecycle:vt(t)})},_t=({children:e,limit:t=3})=>{const[s]=(0,p.useState)(()=>mt(t));return(0,r.jsxs)(Q.Provider,{value:s,children:[e,(0,r.jsx)(lt,{limit:t})]})},pt="_root_1q2cc_1",Tt="_item_1q2cc_20",xt="_itemContent_1q2cc_47",B={root:pt,item:Tt,itemContent:xt},ht=()=>(0,J.useStore)(P(),e=>e.toasts),gt=({elementRef:e,toastEntry:t,rendererKey:s})=>{const n=P();return(0,p.useLayoutEffect)(()=>{if(t.status==="visible")return;const o=()=>n.lifecycle.finishExit({id:t.notification.id,key:s}),c=e.current?.getAnimations?.()??[];if(!(0,R.isNonEmptyArray)(c)){o();return}let i=!1;return Promise.allSettled(c.map(f=>f.finished)).then(()=>{i||o()}),()=>{i=!0}},[e,t,n,s]),null},bt=({toastEntry:e,getToastProps:t,onClose:s})=>{const{notification:n,status:o,durationRevision:c=0}=e,{id:i,...f}=n,v=P(),m=t?.(n),[T]=(0,p.useState)(()=>Symbol()),x=(0,p.useRef)(null);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{ref:x,className:B.item,"data-exiting":o==="closing"||void 0,inert:o==="closing",children:(0,r.jsx)("div",{className:B.itemContent,children:(0,r.jsx)(M.Provider,{value:{durationRevision:c,isActive:o==="visible",lifecycle:v.lifecycle,id:i,rendererKey:T,timingOverrides:m},children:(0,r.jsx)(se,{...f,...m,id:i,onClose:()=>s(i)})})})}),(0,r.jsx)(gt,{elementRef:x,toastEntry:e,rendererKey:T})]})},Ct=({getToastProps:e})=>{const t=ht(),{closeToast:s}=Y();return t.map(n=>(0,r.jsx)(bt,{toastEntry:n,getToastProps:e,onClose:s},n.notification.id))},jt=()=>{const e=P();return(0,p.useLayoutEffect)(()=>(e.set("mountedToasterCount",e.state.mountedToasterCount+1),()=>{e.set("mountedToasterCount",e.state.mountedToasterCount-1),!(e.state.mountedToasterCount>0)&&e.set("toasts",e.state.toasts.filter(D))}),[e]),null},wt=({container:e,getToastProps:t,className:s,render:n,ref:o,...c})=>{const i=W.useThemeContainer(),f=fe.useProvidedTextDirection(),v=e===void 0?i??(typeof document>"u"?null:document.body):e,m=(0,F.useRender)({render:n,ref:o,props:{role:"region",dir:f,"aria-label":"Notifications",...c,className:(0,A.clsx)(B.root,s),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(jt,{}),(0,r.jsx)(Ct,{getToastProps:t})]})}});return d.isDefined(v)?(0,_e.createPortal)(m,v):null};Object.defineProperty(exports,"Callout",{enumerable:!0,get:function(){return Se}});Object.defineProperty(exports,"InlineBanner",{enumerable:!0,get:function(){return Fe}});Object.defineProperty(exports,"Toast",{enumerable:!0,get:function(){return se}});Object.defineProperty(exports,"ToastProvider",{enumerable:!0,get:function(){return _t}});Object.defineProperty(exports,"Toaster",{enumerable:!0,get:function(){return wt}});Object.defineProperty(exports,"useToast",{enumerable:!0,get:function(){return $e}});