twenty-ui 2.55.0 → 2.56.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/dist/{AllIcons-Ca_Mat4L.js → AllIcons-DbdVWsOq.js} +1 -1
- package/dist/{AllIcons-BQasO-X_.cjs → AllIcons-RgvlIG_O.cjs} +1 -1
- package/dist/{Button-C3IE0Kup.cjs → Button-CbJ3qEQ9.cjs} +1 -1
- package/dist/{Button-By-nG5vV.js → Button-wpJzTy9O.js} +3 -3
- package/dist/{Dropdown-CyEoMEjR.cjs → Dropdown-CTTQTn7B.cjs} +1 -1
- package/dist/{Dropdown-Zdc0J7Bg.js → Dropdown-CWXJOVhy.js} +13 -13
- package/dist/{Heading-CHvEXL6n.cjs → Heading-DnDEfr6w.cjs} +1 -1
- package/dist/{Heading-Nj5BlPqB.js → Heading-prj1BR5x.js} +4 -4
- package/dist/IconAddressBook-B6S_w1Z7.cjs +1 -0
- package/dist/{IconAddressBook-DUu7W_Gw.js → IconAddressBook-yE-1oV2W.js} +2 -2
- package/dist/{Input-BKRR1xlO.js → Input-B9glruH9.js} +5 -5
- package/dist/{Input-DS19vWhl.cjs → Input-D0yWU3vB.cjs} +1 -1
- package/dist/{ListItem-D0WDJG-e.cjs → ListItem-D6FYdx6v.cjs} +1 -1
- package/dist/{ListItem-BgRDvHQG.js → ListItem-mIMpO2Ia.js} +8 -8
- package/dist/Loader-9tUcz6Y9.js +29 -0
- package/dist/Loader-r-OAVzF_.cjs +1 -0
- package/dist/{OverflowingTextWithTooltip-CuWHF8_e.cjs → OverflowingTextWithTooltip-B21zZWP6.cjs} +1 -1
- package/dist/{OverflowingTextWithTooltip-CAQ-5aUp.js → OverflowingTextWithTooltip-aPLt9O1-.js} +9 -9
- package/dist/{Popover-DhFCYRtv.js → Popover-5bTsqA1R.js} +1 -1
- package/dist/{Popover-B-VIhr5g.cjs → Popover-JaBFWSK-.cjs} +1 -1
- package/dist/{ProgressBar-km29TA-7.cjs → ProgressBar-BYw2pGjr.cjs} +1 -1
- package/dist/{ProgressBar-B_QvBWbI.js → ProgressBar-Bjj3a1R3.js} +10 -10
- package/dist/Radio-Bg-zmy-1.js +176 -0
- package/dist/{Radio-DUQ6MLGc.cjs → Radio-CjaEN7Bt.cjs} +1 -1
- package/dist/{ResizeHandle-B30OYZxS.js → ResizeHandle-BWoKp0dV.js} +11 -11
- package/dist/{ResizeHandle-B1MuHTNA.cjs → ResizeHandle-D4Q-ffcT.cjs} +1 -1
- package/dist/{Shortcut-CThgcmn_.js → Shortcut-04Wkuy0i.js} +10 -10
- package/dist/{Shortcut-CLngfg7s.cjs → Shortcut-Gp5Ix8K2.cjs} +1 -1
- package/dist/{Skeleton-tXeIy4qq.cjs → Skeleton-DSloDuSJ.cjs} +1 -1
- package/dist/{Skeleton-BbIF780H.js → Skeleton-gAiz2xVU.js} +4 -4
- package/dist/{Tooltip-BXeUFCdb.cjs → Tooltip-BTv1a0nT.cjs} +1 -1
- package/dist/{Tooltip-CT9YCDaV.js → Tooltip-C60MawQS.js} +10 -10
- package/dist/VisuallyHidden-BOlbK5vT.cjs +1 -0
- package/dist/{VisuallyHidden-CFZP7ybO.js → VisuallyHidden-EWkEBgpc.js} +4 -4
- package/dist/components/code-editor.cjs +1 -1
- package/dist/components/code-editor.mjs +11 -11
- package/dist/components/data-display/AssistantAvatar/AssistantAvatar.d.ts +2 -0
- package/dist/components/data-display/AssistantAvatar/internal/components/AnimatedAssistantAvatarFace.d.ts +6 -0
- package/dist/components/data-display/AssistantAvatar/internal/constants/assistantAvatarBodyAssetByShape.constant.d.ts +12 -0
- package/dist/components/data-display/AssistantAvatar/internal/constants/assistantAvatarColors.constant.d.ts +1 -0
- package/dist/components/data-display/AssistantAvatar/internal/constants/assistantAvatarFaceAssetByFace.constant.d.ts +8 -0
- package/dist/components/data-display/AssistantAvatar/internal/constants/assistantAvatarFaces.constant.d.ts +1 -0
- package/dist/components/data-display/AssistantAvatar/internal/constants/assistantAvatarShapes.constant.d.ts +1 -0
- package/dist/components/data-display/AssistantAvatar/internal/constants/assistantAvatarSizes.constant.d.ts +1 -0
- package/dist/components/data-display/AssistantAvatar/types/AssistantAvatarColor.d.ts +3 -0
- package/dist/components/data-display/AssistantAvatar/types/AssistantAvatarFace.d.ts +2 -0
- package/dist/components/data-display/AssistantAvatar/types/AssistantAvatarProps.d.ts +12 -0
- package/dist/components/data-display/AssistantAvatar/types/AssistantAvatarShape.d.ts +2 -0
- package/dist/components/data-display/AssistantAvatar/types/AssistantAvatarSize.d.ts +2 -0
- package/dist/components/data-display/index.d.ts +6 -0
- package/dist/components/data-display.cjs +1 -1
- package/dist/components/data-display.mjs +9 -8
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.mjs +1 -1
- package/dist/components/input/SegmentedControl/types/SegmentedControlProps.d.ts +2 -2
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.mjs +2 -2
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.mjs +1 -1
- package/dist/components/navigation.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 +43 -42
- package/dist/{data-display-DlmWaxYb.cjs → data-display-B0ANuV9c.cjs} +1 -1
- package/dist/data-display-Czu6NhqA.cjs +2 -0
- package/dist/data-display-_j--U7HG.js +520 -0
- package/dist/{data-display-DKSUI3GC.js → data-display-njtZTjjY.js} +24 -24
- package/dist/{feedback-DFTvn5aL.js → feedback-B-wGbbew.js} +31 -31
- package/dist/{feedback-Cvmm1EZX.cjs → feedback-DZF40uJe.cjs} +1 -1
- package/dist/icon/provider.cjs +1 -1
- package/dist/icon/provider.mjs +2 -2
- package/dist/{icon-zsQcq4-s.js → icon-6Nun996H.js} +2 -2
- package/dist/{icon-VuAPY3xQ.cjs → icon-BhAcFxaJ.cjs} +1 -1
- package/dist/icon.cjs +1 -1
- package/dist/icon.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +672 -670
- package/dist/{input-Clzu-UFH.js → input-BaXuEzOr.js} +36 -36
- package/dist/input-BlZ0RHaV.js +379 -0
- package/dist/input-DQfXFl5C.cjs +1 -0
- package/dist/{input-E1x0D2jA.cjs → input-cZCDLL4-.cjs} +1 -1
- package/dist/{layout-DHW99Ejj.cjs → layout-CpDps22m.cjs} +1 -1
- package/dist/{layout-4p7UQD7l.js → layout-DGrag6ua.js} +99 -99
- package/dist/{navigation-BY8X2w04.js → navigation-B4F-yaFC.js} +6 -6
- package/dist/{navigation-4RI9GlzA.js → navigation-CmTgub0K.js} +14 -14
- package/dist/{navigation-B9jOHv99.cjs → navigation-CuI3MVOM.cjs} +1 -1
- package/dist/{navigation-ByYN6NgX.cjs → navigation-Dqiqv2rb.cjs} +1 -1
- package/dist/primitives/accessibility.cjs +1 -1
- package/dist/primitives/accessibility.mjs +1 -1
- package/dist/primitives/data-display/Badge/types/BadgeColor.d.ts +1 -1
- package/dist/primitives/data-display.cjs +1 -1
- package/dist/primitives/data-display.mjs +1 -1
- package/dist/primitives/feedback.cjs +1 -1
- package/dist/primitives/feedback.mjs +3 -3
- package/dist/primitives/input/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/primitives/input/RadioGroup/types/RadioGroupProps.d.ts +2 -0
- package/dist/primitives/input.cjs +1 -1
- package/dist/primitives/input.mjs +4 -4
- 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/surfaces/Card/Card.d.ts +1 -1
- package/dist/primitives/surfaces/Card/internal/CardRoot.d.ts +1 -1
- package/dist/primitives/surfaces/Card/types/CardRootProps.d.ts +2 -0
- package/dist/primitives/surfaces.cjs +1 -1
- package/dist/primitives/surfaces.mjs +3 -3
- package/dist/primitives/typography.cjs +1 -1
- package/dist/primitives/typography.mjs +4 -4
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.mjs +19 -19
- package/dist/{settings-2ZhNkDgW.js → settings-BSIBOXgt.js} +2 -2
- package/dist/{settings-DR3dpWzy.cjs → settings-gd-ps3zs.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/surfaces-BpIdyqtX.js +227 -0
- package/dist/surfaces-GkxUWBN6.cjs +1 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.mjs +2 -2
- package/dist/theme/constants/ThemeLight.d.ts +1 -0
- package/dist/theme/internal/ThemeNumericValueByCssVariable.d.ts +1 -0
- package/dist/theme/internal/ThemeTokenTree.d.ts +3 -0
- package/dist/theme/internal/resolveThemeTokens.d.ts +2 -0
- package/dist/theme/themeCssVariables.d.ts +1 -0
- package/dist/theme/themeTypes.d.ts +1 -0
- package/dist/{theme-CuGIQBsJ.js → theme-B1jMC8En.js} +2577 -2544
- package/dist/theme-CeIzO6UU.cjs +1 -0
- package/dist/theme-dark.css +1 -0
- package/dist/theme-light.css +1 -0
- package/dist/theme.cjs +1 -1
- package/dist/theme.mjs +13 -13
- package/dist/{typography-B4hug-TZ.cjs → typography-BQbeIT60.cjs} +1 -1
- package/dist/{typography-jl1UzvVu.js → typography-DvK5mDnG.js} +2 -2
- package/dist/{useIsMobile-CZeJLJJN.js → useIsMobile-B0P21Ov9.js} +1 -1
- package/dist/{useIsMobile-VmnhfE8g.cjs → useIsMobile-BnW-j5Bq.cjs} +1 -1
- package/dist/utilities/color/utils/themeColorSchema.d.ts +15 -15
- package/dist/utilities/index.d.ts +1 -0
- package/dist/utilities/zoom/utils/isPageZoomGesture.d.ts +1 -0
- package/dist/utilities-9ARl_uku.cjs +1 -0
- package/dist/{utilities-E91ftFp_.js → utilities-IyA_ho0H.js} +19 -18
- package/dist/utilities.cjs +1 -1
- package/dist/utilities.mjs +18 -17
- package/package.json +1 -1
- package/dist/IconAddressBook-uc6K45F8.cjs +0 -1
- package/dist/Loader-Dau0YQpY.cjs +0 -1
- package/dist/Loader-U1LuZtJf.js +0 -29
- package/dist/Radio-rURvQ923.js +0 -176
- package/dist/VisuallyHidden-B-n4x1KY.cjs +0 -1
- package/dist/data-display-Cg9gF6Cb.cjs +0 -2
- package/dist/data-display-CuvXSBLo.js +0 -422
- package/dist/input-BIUZSrhq.js +0 -374
- package/dist/input-CX8QPMDn.cjs +0 -1
- package/dist/surfaces-C70biBA8.js +0 -225
- package/dist/surfaces-DcGz8LO-.cjs +0 -1
- package/dist/theme-BJRNJNPO.cjs +0 -1
- package/dist/utilities-YhvQ2XFb.cjs +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { g as b, r as H } from "./theme-B1jMC8En.js";
|
|
1
2
|
import { t as v } from "./isDefined-fMi6eQ4r.js";
|
|
2
3
|
import { t as D } from "./doNotTranslate-BSVT8Xyd.js";
|
|
3
|
-
import { a as b, r as H } from "./theme-CuGIQBsJ.js";
|
|
4
4
|
import { t as E } from "./mergeClassNames-ClFMR1v0.js";
|
|
5
|
-
import { c as
|
|
6
|
-
import { t as K } from "./Loader-
|
|
7
|
-
import { t as j } from "./OverflowingTextWithTooltip-
|
|
8
|
-
import { useRender as x } from "@base-ui/react/use-render";
|
|
5
|
+
import { c as A, l as J, r as I } from "./utilities-IyA_ho0H.js";
|
|
6
|
+
import { t as K } from "./Loader-9tUcz6Y9.js";
|
|
7
|
+
import { t as j } from "./OverflowingTextWithTooltip-aPLt9O1-.js";
|
|
9
8
|
import { isBoolean as L, isFunction as Q, isNonEmptyString as W, isString as P } from "@sniptt/guards";
|
|
10
|
-
import { clsx as
|
|
9
|
+
import { clsx as x } from "clsx";
|
|
11
10
|
import { Fragment as N, jsx as l, jsxs as h } from "react/jsx-runtime";
|
|
11
|
+
import { useRender as w } from "@base-ui/react/use-render";
|
|
12
12
|
import { Avatar as z } from "@base-ui/react/avatar";
|
|
13
13
|
var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95", ea = "_fallback_1bbob_107", B = {
|
|
14
14
|
root: X,
|
|
@@ -30,7 +30,7 @@ var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95",
|
|
|
30
30
|
string: t ?? "",
|
|
31
31
|
variant: r === "outline" ? 5 : 4,
|
|
32
32
|
theme: p
|
|
33
|
-
}) : s ?? p.background.transparent.light,
|
|
33
|
+
}) : s ?? p.background.transparent.light, k = c ?? (f ? A({
|
|
34
34
|
string: t ?? "",
|
|
35
35
|
variant: 6,
|
|
36
36
|
theme: p
|
|
@@ -45,7 +45,7 @@ var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95",
|
|
|
45
45
|
style: (u) => ({
|
|
46
46
|
"--tw-avatar-color": T,
|
|
47
47
|
"--tw-avatar-background": u.imageLoadingStatus === "loaded" ? "none" : S,
|
|
48
|
-
"--tw-avatar-border": r === "outline" && u.imageLoadingStatus !== "loaded" &&
|
|
48
|
+
"--tw-avatar-border": r === "outline" && u.imageLoadingStatus !== "loaded" && k ? D(`1px solid ${k}`) : "none",
|
|
49
49
|
...Q(m) ? m(u) : m
|
|
50
50
|
})
|
|
51
51
|
});
|
|
@@ -96,13 +96,13 @@ var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95",
|
|
|
96
96
|
fontSize: "8px",
|
|
97
97
|
width: "12px"
|
|
98
98
|
}
|
|
99
|
-
}, oa = "
|
|
99
|
+
}, oa = "_badge_eakxs_1", sa = { badge: oa }, Ba = ({ size: a = "sm", color: t = "tertiary", shape: e = "pill", className: i, render: r, ref: o, ...s }) => w({
|
|
100
100
|
defaultTagName: "span",
|
|
101
101
|
render: r,
|
|
102
102
|
ref: o,
|
|
103
103
|
props: {
|
|
104
104
|
...s,
|
|
105
|
-
className:
|
|
105
|
+
className: x(sa.badge, i),
|
|
106
106
|
"data-badge-size": a,
|
|
107
107
|
"data-badge-color": t,
|
|
108
108
|
"data-badge-shape": e
|
|
@@ -111,7 +111,7 @@ var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95",
|
|
|
111
111
|
chip: la,
|
|
112
112
|
label: ia,
|
|
113
113
|
endElementDivider: na
|
|
114
|
-
}, da = { height: "var(--t-spacing-4)" }, Fa = ({ children: a, size: t = "sm", variant: e = "ghost", color: i = "primary", shape: r = "square", weight: o = "regular", onClick: s, clickable: c = v(s), startElement: d, endElement: n, endElementDivider: _ = !1, maxWidth: m, truncate: g = !0, tooltipContent: p, tooltipDelay: f, isTooltipMultiline: T, tooltipPlace: S, alwaysShowTooltip:
|
|
114
|
+
}, da = { height: "var(--t-spacing-4)" }, Fa = ({ children: a, size: t = "sm", variant: e = "ghost", color: i = "primary", shape: r = "square", weight: o = "regular", onClick: s, clickable: c = v(s), startElement: d, endElement: n, endElementDivider: _ = !1, maxWidth: m, truncate: g = !0, tooltipContent: p, tooltipDelay: f, isTooltipMultiline: T, tooltipPlace: S, alwaysShowTooltip: k = !1, className: u, style: M, render: V, ref: Y, ...U }) => {
|
|
115
115
|
const Z = v(a) && !L(a) && a !== "", G = P(a) ? {
|
|
116
116
|
text: a,
|
|
117
117
|
tooltipContent: p
|
|
@@ -119,7 +119,7 @@ var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95",
|
|
|
119
119
|
text: a ?? !1,
|
|
120
120
|
tooltipContent: p ?? ""
|
|
121
121
|
};
|
|
122
|
-
return
|
|
122
|
+
return w({
|
|
123
123
|
render: V,
|
|
124
124
|
ref: Y,
|
|
125
125
|
state: {
|
|
@@ -134,7 +134,7 @@ var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95",
|
|
|
134
134
|
props: {
|
|
135
135
|
...U,
|
|
136
136
|
onClick: s,
|
|
137
|
-
className:
|
|
137
|
+
className: x(C.chip, u),
|
|
138
138
|
style: {
|
|
139
139
|
...v(m) ? { "--tw-chip-max-width": D(`${m}px`) } : {},
|
|
140
140
|
...M
|
|
@@ -150,7 +150,7 @@ var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95",
|
|
|
150
150
|
tooltipDelay: f,
|
|
151
151
|
isTooltipMultiline: T,
|
|
152
152
|
tooltipPlace: S,
|
|
153
|
-
alwaysShowTooltip:
|
|
153
|
+
alwaysShowTooltip: k
|
|
154
154
|
}),
|
|
155
155
|
v(n) && n !== !1 && /* @__PURE__ */ h(N, { children: [_ && /* @__PURE__ */ l("span", { className: C.endElementDivider }), n] })
|
|
156
156
|
] })
|
|
@@ -159,13 +159,13 @@ var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95",
|
|
|
159
159
|
}, ca = "_root_6bfj6_1", ma = "_circle_6bfj6_13", F = {
|
|
160
160
|
root: ca,
|
|
161
161
|
circle: ma
|
|
162
|
-
}, Ra = ({ colorName: a, color: t, variant: e, className: i, style: r, render: o, ref: s, ...c }) =>
|
|
162
|
+
}, Ra = ({ colorName: a, color: t, variant: e, className: i, style: r, render: o, ref: s, ...c }) => w({
|
|
163
163
|
defaultTagName: "div",
|
|
164
164
|
render: o,
|
|
165
165
|
ref: s,
|
|
166
166
|
props: {
|
|
167
167
|
...c,
|
|
168
|
-
className:
|
|
168
|
+
className: x(F.root, e === "circle" && F.circle, i),
|
|
169
169
|
style: {
|
|
170
170
|
"--color-sample-color": t ?? b.tag.background[a],
|
|
171
171
|
"--color-sample-border-color": b.tag.text[a],
|
|
@@ -177,7 +177,7 @@ var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95",
|
|
|
177
177
|
content: pa
|
|
178
178
|
}, Da = ({ children: a, color: t, loading: e = !1, weight: i = "regular", className: r, style: o, render: s, ref: c, ...d }) => {
|
|
179
179
|
const n = J(t);
|
|
180
|
-
return
|
|
180
|
+
return w({
|
|
181
181
|
defaultTagName: "span",
|
|
182
182
|
render: s,
|
|
183
183
|
ref: c,
|
|
@@ -188,7 +188,7 @@ var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95",
|
|
|
188
188
|
props: {
|
|
189
189
|
"aria-busy": e || void 0,
|
|
190
190
|
...d,
|
|
191
|
-
className:
|
|
191
|
+
className: x(R.status, r),
|
|
192
192
|
style: {
|
|
193
193
|
"--tw-status-background": b.tag.background[n],
|
|
194
194
|
"--tw-status-text-color": b.tag.text[n],
|
|
@@ -204,12 +204,12 @@ var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95",
|
|
|
204
204
|
})] })
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
|
-
}, va = "_tag_1ot0y_1", _a = "_content_1ot0y_49", ba = "_overflowingText_1ot0y_58", fa = "_iconContainer_1ot0y_62",
|
|
207
|
+
}, va = "_tag_1ot0y_1", _a = "_content_1ot0y_49", ba = "_overflowingText_1ot0y_58", fa = "_iconContainer_1ot0y_62", y = {
|
|
208
208
|
tag: va,
|
|
209
209
|
content: _a,
|
|
210
210
|
overflowingText: ba,
|
|
211
211
|
iconContainer: fa
|
|
212
|
-
}, Ia = ({ children: a, color: t, weight: e = "regular", variant: i = "soft", startIcon: r, truncate: o = !0, borderStyle: s = "solid", className: c, style: d, render: n, ref: _, ...m }) =>
|
|
212
|
+
}, Ia = ({ children: a, color: t, weight: e = "regular", variant: i = "soft", startIcon: r, truncate: o = !0, borderStyle: s = "solid", className: c, style: d, render: n, ref: _, ...m }) => w({
|
|
213
213
|
defaultTagName: "span",
|
|
214
214
|
render: n,
|
|
215
215
|
ref: _,
|
|
@@ -220,7 +220,7 @@ var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95",
|
|
|
220
220
|
},
|
|
221
221
|
props: {
|
|
222
222
|
...m,
|
|
223
|
-
className:
|
|
223
|
+
className: x(y.tag, c),
|
|
224
224
|
style: {
|
|
225
225
|
"--tw-tag-background": t === "transparent" ? "transparent" : b.tag.background[t] ?? b.tag.background.gray,
|
|
226
226
|
"--tw-tag-text": t === "transparent" ? b.font.color.secondary : b.tag.text[t] ?? b.font.color.secondary,
|
|
@@ -228,15 +228,15 @@ var X = "_root_1bbob_1", aa = "_avatarPulsing_1bbob_1", ta = "_image_1bbob_95",
|
|
|
228
228
|
...d
|
|
229
229
|
},
|
|
230
230
|
children: /* @__PURE__ */ h(N, { children: [v(r) && !L(r) && r !== "" && /* @__PURE__ */ l("span", {
|
|
231
|
-
className:
|
|
231
|
+
className: y.iconContainer,
|
|
232
232
|
"aria-hidden": !0,
|
|
233
233
|
children: r
|
|
234
234
|
}), /* @__PURE__ */ l("span", {
|
|
235
|
-
className:
|
|
235
|
+
className: y.content,
|
|
236
236
|
children: P(a) && o ? /* @__PURE__ */ l(j, {
|
|
237
237
|
text: a,
|
|
238
238
|
render: /* @__PURE__ */ l("span", {}),
|
|
239
|
-
className:
|
|
239
|
+
className: y.overflowingText
|
|
240
240
|
}) : a
|
|
241
241
|
})] })
|
|
242
242
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import { g as _e, r as he, t as Te } from "./theme-B1jMC8En.js";
|
|
1
2
|
import { t as d } from "./isDefined-fMi6eQ4r.js";
|
|
2
3
|
import { t as N } from "./isRenderableSlot-DT_depzM.js";
|
|
3
|
-
import { Ec as Z, Ni as ee, _i as
|
|
4
|
+
import { Ec as Z, Ni as ee, _i as ge, i as M, ws as Ce } from "./TablerIcons-B6BhOlW_.js";
|
|
4
5
|
import { t as I } from "./doNotTranslate-BSVT8Xyd.js";
|
|
5
|
-
import { a as Te, r as ge, t as Ce } from "./theme-CuGIQBsJ.js";
|
|
6
6
|
import { t as be } from "./mergeClassNames-ClFMR1v0.js";
|
|
7
|
-
import { t as z } from "./Button-
|
|
8
|
-
import { n as te, r as we, t as xe } from "./ProgressBar-
|
|
7
|
+
import { t as z } from "./Button-wpJzTy9O.js";
|
|
8
|
+
import { n as te, r as we, t as xe } from "./ProgressBar-Bjj3a1R3.js";
|
|
9
9
|
import { t as Ne } from "./useProvidedTextDirection-Dk8LBQeF.js";
|
|
10
|
-
import { t as ye } from "./OverflowingTextWithTooltip-
|
|
10
|
+
import { t as ye } from "./OverflowingTextWithTooltip-aPLt9O1-.js";
|
|
11
11
|
import { t as Ae } from "./Separator-0LzwPfOn.js";
|
|
12
|
-
import {
|
|
13
|
-
import { isNonEmptyArray as $, isPositiveInteger as Ee, isString as Pe, isUndefined as Ie } from "@sniptt/guards";
|
|
12
|
+
import { isNonEmptyArray as D, isPositiveInteger as Ee, isString as Pe, isUndefined as Ie } from "@sniptt/guards";
|
|
14
13
|
import { clsx as k } from "clsx";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
14
|
+
import { Fragment as R, jsx as c, jsxs as g } from "react/jsx-runtime";
|
|
15
|
+
import { useRender as $ } from "@base-ui/react/use-render";
|
|
16
|
+
import { createContext as oe, useCallback as Re, useContext as j, useEffect as Se, useLayoutEffect as S, useMemo as ke, useRef as We, useState as P, useSyncExternalStore as Oe } from "react";
|
|
17
17
|
import { Store as ze, useStore as qe } from "@base-ui/utils/store";
|
|
18
18
|
import { createPortal as Be } from "react-dom";
|
|
19
19
|
var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) => /* @__PURE__ */ c(z, {
|
|
@@ -33,12 +33,12 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
33
33
|
description: Ge,
|
|
34
34
|
footer: Je,
|
|
35
35
|
closeButton: Qe
|
|
36
|
-
}, Ye = ({ status: e = "info", variant: t = "soft", color: o = we[e], title: s, description: r, fullWidth: a = !1, icon: n = /* @__PURE__ */ c(
|
|
37
|
-
size:
|
|
36
|
+
}, Ye = ({ status: e = "info", variant: t = "soft", color: o = we[e], title: s, description: r, fullWidth: a = !1, icon: n = /* @__PURE__ */ c(ge, {
|
|
37
|
+
size: _e.icon.size.md,
|
|
38
38
|
"aria-hidden": "true"
|
|
39
39
|
}), action: v, closeLabel: f = I("Close"), onDismiss: m, className: _, render: h, ref: u, ...l }) => {
|
|
40
40
|
const i = N(n), p = N(v);
|
|
41
|
-
return
|
|
41
|
+
return $({
|
|
42
42
|
render: h,
|
|
43
43
|
ref: u,
|
|
44
44
|
state: {
|
|
@@ -49,7 +49,7 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
49
49
|
props: {
|
|
50
50
|
...l,
|
|
51
51
|
className: k(T.container, a && T.containerFullWidth, _),
|
|
52
|
-
children: /* @__PURE__ */ g(
|
|
52
|
+
children: /* @__PURE__ */ g(R, { children: [
|
|
53
53
|
/* @__PURE__ */ g("div", {
|
|
54
54
|
className: T.header,
|
|
55
55
|
children: [
|
|
@@ -110,7 +110,7 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
110
110
|
className: E.bannerText,
|
|
111
111
|
children: m ? /* @__PURE__ */ c(ye, {
|
|
112
112
|
isFocusable: !0,
|
|
113
|
-
text: /* @__PURE__ */ c(
|
|
113
|
+
text: /* @__PURE__ */ c(R, { children: e }),
|
|
114
114
|
tooltipContent: e
|
|
115
115
|
}) : e
|
|
116
116
|
})]
|
|
@@ -132,7 +132,7 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
132
132
|
return { closeToast: (o) => {
|
|
133
133
|
if (!e.lifecycle.isActive()) return;
|
|
134
134
|
const s = e.state.toasts.filter((r) => y(r) && (!d(o) || r.notification.id === o));
|
|
135
|
-
|
|
135
|
+
D(s) && q({
|
|
136
136
|
store: e,
|
|
137
137
|
toastsToClose: s
|
|
138
138
|
});
|
|
@@ -164,7 +164,7 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
164
164
|
}, ct = ({ store: e, id: t, ...o }) => {
|
|
165
165
|
if (!e.lifecycle.isActive()) return;
|
|
166
166
|
const s = e.state.toasts.find((n) => n.notification.id === t && y(n)), r = Object.keys(o);
|
|
167
|
-
if (!d(s) ||
|
|
167
|
+
if (!d(s) || !D(r)) return;
|
|
168
168
|
const a = r.includes("duration") || d(s.notification.progress) && r.includes("progress") && !d(o.progress);
|
|
169
169
|
e.set("toasts", e.state.toasts.map((n) => n === s ? {
|
|
170
170
|
...n,
|
|
@@ -204,7 +204,7 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
204
204
|
isActive: !0
|
|
205
205
|
}), Ct = ({ clock: e, onClockChange: t, duration: o, progress: s, isPaused: r, onClose: a }) => {
|
|
206
206
|
const { durationRevision: n, isActive: v, lifecycle: f, id: m, rendererKey: _, timingOverrides: h } = j(U), u = d(f) && d(m) && d(_), l = u ? void 0 : e, i = d(s), p = d(h) && Object.prototype.propertyIsEnumerable.call(h, "duration"), x = d(h) && Object.prototype.propertyIsEnumerable.call(h, "progress");
|
|
207
|
-
return
|
|
207
|
+
return S(() => {
|
|
208
208
|
if (u) {
|
|
209
209
|
t(f.updateRenderer({
|
|
210
210
|
id: m,
|
|
@@ -240,7 +240,7 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
240
240
|
_,
|
|
241
241
|
p,
|
|
242
242
|
x
|
|
243
|
-
]),
|
|
243
|
+
]), S(() => () => {
|
|
244
244
|
if (u) {
|
|
245
245
|
f.removeRenderer({
|
|
246
246
|
id: m,
|
|
@@ -256,7 +256,7 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
256
256
|
_,
|
|
257
257
|
u
|
|
258
258
|
]), null;
|
|
259
|
-
}, bt = ({ element: e, isFocused: t, onFocusChange: o }) => (
|
|
259
|
+
}, bt = ({ element: e, isFocused: t, onFocusChange: o }) => (S(() => {
|
|
260
260
|
if (!t || !d(e)) return;
|
|
261
261
|
const s = () => {
|
|
262
262
|
e.contains(e.ownerDocument.activeElement) || o(!1);
|
|
@@ -355,11 +355,11 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
355
355
|
}, It = {
|
|
356
356
|
neutral: M,
|
|
357
357
|
error: M,
|
|
358
|
-
success:
|
|
358
|
+
success: Ce,
|
|
359
359
|
info: ee,
|
|
360
360
|
warning: M
|
|
361
361
|
}, Rt = ({ children: e, description: t, icon: o, iconLabel: s, action: r, progress: a, duration: n = ne, onCancel: v, onClose: f, cancelLabel: m = I("Cancel"), closeLabel: _ = I("Close"), status: h = "neutral", role: u = "status", className: l, onMouseEnter: i, onMouseLeave: p, onFocus: x, onBlur: C, render: W, ref: le, ...de }) => {
|
|
362
|
-
const L =
|
|
362
|
+
const L = he(), [ue, K] = P(!1), [H, B] = P(!1), [ve, fe] = P(null), V = ue || H, { countdown: O, clock: X, setClock: me } = Pt({
|
|
363
363
|
duration: n,
|
|
364
364
|
isPaused: V
|
|
365
365
|
}), pe = It[h], G = L.snackBar[h === "neutral" ? "default" : h], J = Ie(o) ? /* @__PURE__ */ c(pe, {
|
|
@@ -368,8 +368,8 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
368
368
|
color: G.color,
|
|
369
369
|
size: L.icon.size.md
|
|
370
370
|
}) : o;
|
|
371
|
-
return /* @__PURE__ */ g(
|
|
372
|
-
|
|
371
|
+
return /* @__PURE__ */ g(R, { children: [
|
|
372
|
+
$({
|
|
373
373
|
render: W,
|
|
374
374
|
ref: [le ?? null, fe],
|
|
375
375
|
props: {
|
|
@@ -389,7 +389,7 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
389
389
|
onBlur: (w) => {
|
|
390
390
|
w.currentTarget.contains(w.relatedTarget) || B(!1), C?.(w);
|
|
391
391
|
},
|
|
392
|
-
children: /* @__PURE__ */ g(
|
|
392
|
+
children: /* @__PURE__ */ g(R, { children: [
|
|
393
393
|
/* @__PURE__ */ c("div", {
|
|
394
394
|
className: b.progress,
|
|
395
395
|
"aria-hidden": !0,
|
|
@@ -473,7 +473,7 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
473
473
|
});
|
|
474
474
|
}, kt = ({ limit: e }) => {
|
|
475
475
|
const t = A();
|
|
476
|
-
return Se(() => t.lifecycle.mount(), [t]),
|
|
476
|
+
return Se(() => t.lifecycle.mount(), [t]), S(() => St({
|
|
477
477
|
store: t,
|
|
478
478
|
limit: e
|
|
479
479
|
}), [t, e]), null;
|
|
@@ -576,13 +576,13 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
576
576
|
itemContent: Mt
|
|
577
577
|
}, Ft = () => qe(A(), (e) => e.toasts), Dt = ({ elementRef: e, toastEntry: t, rendererKey: o }) => {
|
|
578
578
|
const s = A();
|
|
579
|
-
return
|
|
579
|
+
return S(() => {
|
|
580
580
|
if (t.status === "visible") return;
|
|
581
581
|
const r = () => s.lifecycle.finishExit({
|
|
582
582
|
id: t.notification.id,
|
|
583
583
|
key: o
|
|
584
584
|
}), a = e.current?.getAnimations?.() ?? [];
|
|
585
|
-
if (
|
|
585
|
+
if (!D(a)) {
|
|
586
586
|
r();
|
|
587
587
|
return;
|
|
588
588
|
}
|
|
@@ -600,7 +600,7 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
600
600
|
]), null;
|
|
601
601
|
}, $t = ({ toastEntry: e, getToastProps: t, onClose: o }) => {
|
|
602
602
|
const { notification: s, status: r, durationRevision: a = 0 } = e, { id: n, ...v } = s, f = A(), m = t?.(s), [_] = P(() => /* @__PURE__ */ Symbol()), h = We(null);
|
|
603
|
-
return /* @__PURE__ */ g(
|
|
603
|
+
return /* @__PURE__ */ g(R, { children: [/* @__PURE__ */ c("div", {
|
|
604
604
|
ref: h,
|
|
605
605
|
className: F.item,
|
|
606
606
|
"data-exiting": r === "closing" || void 0,
|
|
@@ -638,11 +638,11 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
638
638
|
}, s.notification.id));
|
|
639
639
|
}, Ut = () => {
|
|
640
640
|
const e = A();
|
|
641
|
-
return
|
|
641
|
+
return S(() => (e.set("mountedToasterCount", e.state.mountedToasterCount + 1), () => {
|
|
642
642
|
e.set("mountedToasterCount", e.state.mountedToasterCount - 1), !(e.state.mountedToasterCount > 0) && e.set("toasts", e.state.toasts.filter(y));
|
|
643
643
|
}), [e]), null;
|
|
644
644
|
}, fo = ({ container: e, getToastProps: t, className: o, render: s, ref: r, ...a }) => {
|
|
645
|
-
const n =
|
|
645
|
+
const n = Te(), v = Ne(), f = e === void 0 ? n ?? (typeof document > "u" ? null : document.body) : e, m = $({
|
|
646
646
|
render: s,
|
|
647
647
|
ref: r,
|
|
648
648
|
props: {
|
|
@@ -651,7 +651,7 @@ var Me = "_action_3r2bm_1", Fe = { action: Me }, De = ({ className: e, ...t }) =
|
|
|
651
651
|
"aria-label": I("Notifications"),
|
|
652
652
|
...a,
|
|
653
653
|
className: k(F.root, o),
|
|
654
|
-
children: /* @__PURE__ */ g(
|
|
654
|
+
children: /* @__PURE__ */ g(R, { children: [/* @__PURE__ */ c(Ut, {}), /* @__PURE__ */ c(jt, { getToastProps: t })] })
|
|
655
655
|
}
|
|
656
656
|
});
|
|
657
657
|
return d(f) ? Be(m, f) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const z=require("./theme-BJRNJNPO.cjs"),d=require("./isDefined-DS2Q42p5.cjs"),y=require("./isRenderableSlot-Guryb6Nf.cjs"),P=require("./doNotTranslate-CHE7WmRS.cjs"),fe=require("./mergeClassNames-D4lshrT6.cjs"),I=require("./Button-C3IE0Kup.cjs"),O=require("./ProgressBar-km29TA-7.cjs"),ve=require("./useProvidedTextDirection-PVaoQCLH.cjs"),_e=require("./OverflowingTextWithTooltip-CuWHF8_e.cjs"),me=require("./Separator-UJVlrTzw.cjs");let F=require("@base-ui/react/use-render"),E=require("@sniptt/guards"),R=require("clsx"),p=require("react"),r=require("react/jsx-runtime"),Q=require("@base-ui/utils/store"),pe=require("react-dom"),j=require("@tabler/icons-react");var Te="_action_3r2bm_1",xe={action:Te},he=({className:e,...t})=>(0,r.jsx)(I.Button,{...t,size:"sm",variant:"ghost",className:fe.mergeClassNames(xe.action,e)}),ge="_container_1ix4w_1",be="_containerFullWidth_1ix4w_40",Ce="_header_1ix4w_44",je="_iconContainer_1ix4w_53",we="_title_1ix4w_63",ye="_descriptionWrapper_1ix4w_75",De="_descriptionWrapperWithIcon_1ix4w_82",Ne="_descriptionWrapperWithAction_1ix4w_86",qe="_description_1ix4w_75",Pe="_footer_1ix4w_99",Ee="_closeButton_1ix4w_106",h={container:ge,containerFullWidth:be,header:Ce,iconContainer:je,title:we,descriptionWrapper:ye,descriptionWrapperWithIcon:De,descriptionWrapperWithAction:Ne,description:qe,footer:Pe,closeButton:Ee},Re=({status:e="info",variant:t="soft",color:s=O.FEEDBACK_STATUS_COLORS[e],title:n,description:o,fullWidth:c=!1,icon:i=(0,r.jsx)(j.IconHelp,{size:z.themeCssVariables.icon.size.md,"aria-hidden":"true"}),action:f,closeLabel:v=P.doNotTranslate("Close"),onDismiss:_,className:T,render:x,ref:l,...u})=>{const a=y.isRenderableSlot(i),m=y.isRenderableSlot(f);return(0,F.useRender)({render:x,ref:l,state:{status:e,variant:t,color:s},props:{...u,className:(0,R.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(_)&&(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:()=>_()})]}),y.isRenderableSlot(o)&&(0,r.jsx)("div",{className:(0,R.clsx)(h.descriptionWrapper,a&&h.descriptionWrapperWithIcon,m&&h.descriptionWrapperWithAction),children:(0,r.jsx)("div",{className:h.description,children:o})}),m&&(0,r.jsx)("div",{className:h.footer,children:f})]})}})},Ae=Object.assign(Re,{Action:he}),Se="_banner_qbpcz_1",Ie="_embedded_qbpcz_6",Oe="_bannerContent_qbpcz_10",ke="_icon_qbpcz_18",We="_bannerText_qbpcz_28",Be="_compact_qbpcz_33",ze="_fullWidth_qbpcz_58",q={banner:Se,embedded:Ie,bannerContent:Oe,icon:ke,bannerText:We,compact:Be,fullWidth:ze},Fe=({children:e,layout:t="standard",variant:s="soft",embedded:n=!1,fullWidth:o=!1,icon:c=(0,r.jsx)(j.IconInfoCircle,{"aria-hidden":"true"}),className:i,...f})=>{const v=t==="compact",_=!v&&(0,E.isString)(e);return(0,r.jsx)(O.Banner,{...f,className:(0,R.clsx)(q.banner,v&&q.compact,n&&q.embedded,o&&q.fullWidth,i),variant:s,"data-layout":t,children:(0,r.jsxs)("div",{className:q.bannerContent,children:[y.isRenderableSlot(c)&&(0,r.jsx)("span",{className:q.icon,children:c}),(0,r.jsx)("div",{className:q.bannerText,children:_?(0,r.jsx)(_e.OverflowingTextWithTooltip,{isFocusable:!0,text:(0,r.jsx)(r.Fragment,{children:e}),tooltipContent:e}):e})]})})},Me=Object.assign(Fe,{Action:O.Banner.Action}),D=e=>e.status==="visible",k=({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?.()},Y=(0,p.createContext)(void 0),N=()=>{const e=(0,p.useContext)(Y);if(!d.isDefined(e))throw new Error(P.doNotTranslate("Toast components must be used within a ToastProvider."));return e},Z=()=>{const e=N();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,E.isNonEmptyArray)(n)&&k({store:e,toastsToClose:n})}}},G=0,J=()=>(G+=1,`toast-${G}`),Le=()=>{const e=N();return{enqueueToast:(0,p.useMemo)(()=>{function t(s){if(!d.isDefined(s))return;if(!e.lifecycle.isActive())return J();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 _=J(),T=Math.max(0,f.length-i+1);return k({store:e,toastsToClose:f.slice(0,T),nextToasts:[...c,{notification:{...o,id:_},dedupeKey:n,status:"visible"}]}),_}return t},[e])}},$e=({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,E.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))},Ue=()=>{const e=N();return{updateToast:(0,p.useCallback)(t=>$e({store:e,...t}),[e])}},Ke=()=>{const{closeToast:e}=Z(),{enqueueToast:t}=Le(),{updateToast:s}=Ue();return{enqueueToast:t,closeToast:e,updateToast:s}},He="_root_181ka_1",Ve="_progress_181ka_19",Xe="_header_181ka_30",Ge="_message_181ka_40",Je="_icon_181ka_45",Qe="_actions_181ka_50",Ye="_description_181ka_56",Ze="_footer_181ka_65",et="_footerAction_181ka_69",tt="_closeButton_181ka_76",b={root:He,progress:Ve,header:Xe,message:Ge,icon:Je,actions:Qe,description:Ye,footer:Ze,footerAction:et,closeButton:tt},M=(0,p.createContext)({durationRevision:0,isActive:!0}),st=({clock:e,onClockChange:t,duration:s,progress:n,isPaused:o,onClose:c})=>{const{durationRevision:i,isActive:f,lifecycle:v,id:_,rendererKey:T,timingOverrides:x}=(0,p.useContext)(M),l=d.isDefined(v)&&d.isDefined(_)&&d.isDefined(T),u=l?void 0:e,a=d.isDefined(n),m=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:_,key:T,configuration:{duration:m?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,_,T,m,w]),(0,p.useLayoutEffect)(()=>()=>{if(l){v.removeRenderer({id:_,key:T});return}u?.stop()},[u,v,_,T,l]),null},nt=({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),ee=6e3,te=e=>Number.isFinite(e)&&e>0,rt="_countdown_1vuo8_1",ot="_toastCountdown_1vuo8_1",it={countdown:rt,toastCountdown:ot},at=({progress:e,duration:t,remainingDuration:s,revision:n,isPaused:o,barColor:c})=>d.isDefined(e)?(0,r.jsx)(O.ProgressBar,{value:e,barColor:c}):te(t)?(0,r.jsx)("div",{className:it.countdown,"data-paused":o||void 0,style:{"--toast-countdown-color":c,"--toast-countdown-width":`${s/t*100}%`,"--toast-countdown-duration":`${s}ms`}},n):null,ct=2**31-1,ut=({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},_=()=>{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,_(),t?.onClose?.())},x=()=>d.isDefined(t)&&t.isActive&&!t.isPaused&&!t.isProgress&&te(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,ct))};return{update:a=>{const m=!d.isDefined(t)||a.duration!==t.duration||a.durationRevision!==t.durationRevision||t.isProgress&&!a.isProgress,w=m||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&&(m&&(s=Math.max(0,a.duration)),_(),l())},close:T,stop:v}},se=({duration:e,isPaused:t})=>{let s={duration:e,remainingDuration:e,revision:0,isPaused:t};const n=new Set;return{...ut({onChange:o=>{s=o;for(const c of n)c()}}),getSnapshot:()=>s,subscribe:o=>(n.add(o),()=>{n.delete(o)})}},dt=({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)??se({duration:e,isPaused:t}));return{countdown:(0,p.useSyncExternalStore)(c.subscribe,c.getSnapshot,c.getSnapshot),clock:c,setClock:i}},lt={neutral:j.IconAlertTriangle,error:j.IconAlertTriangle,success:j.IconSquareRoundedCheck,info:j.IconInfoCircle,warning:j.IconAlertTriangle},ne=({children:e,description:t,icon:s,iconLabel:n,action:o,progress:c,duration:i=ee,onCancel:f,onClose:v,cancelLabel:_=P.doNotTranslate("Cancel"),closeLabel:T=P.doNotTranslate("Close"),status:x="neutral",role:l="status",className:u,onMouseEnter:a,onMouseLeave:m,onFocus:w,onBlur:g,render:A,ref:oe,...ie})=>{const L=z.useTheme(),[ae,$]=(0,p.useState)(!1),[U,W]=(0,p.useState)(!1),[ce,ue]=(0,p.useState)(null),K=ae||U,{countdown:S,clock:H,setClock:de}=dt({duration:i,isPaused:K}),le=lt[x],V=L.snackBar[x==="neutral"?"default":x],X=(0,E.isUndefined)(s)?(0,r.jsx)(le,{"aria-label":n,"aria-hidden":!d.isDefined(n),color:V.color,size:L.icon.size.md}):s;return(0,r.jsxs)(r.Fragment,{children:[(0,F.useRender)({render:A,ref:[oe??null,ue],props:{role:l,"aria-live":l==="alert"?"assertive":"polite",...ie,className:(0,R.clsx)(b.root,u),onMouseEnter:C=>{$(!0),a?.(C)},onMouseLeave:C=>{$(!1),m?.(C)},onFocus:C=>{W(!0),w?.(C)},onBlur:C=>{C.currentTarget.contains(C.relatedTarget)||W(!1),g?.(C)},children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:b.progress,"aria-hidden":!0,children:(0,r.jsx)(at,{barColor:V.backgroundColor,progress:c,duration:S.duration,remainingDuration:S.remainingDuration,revision:S.revision,isPaused:S.isPaused})}),(0,r.jsxs)("div",{className:b.header,children:[y.isRenderableSlot(X)&&(0,r.jsx)("div",{className:b.icon,children:X}),(0,r.jsx)("div",{className:b.message,children:e}),(0,r.jsxs)("div",{className:b.actions,children:[d.isDefined(f)&&y.isRenderableSlot(_)&&(0,r.jsx)(I.Button,{onClick:f,size:"sm",variant:"ghost",style:{fontWeight:"var(--t-font-weight-regular)"},children:_}),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:H.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)(nt,{element:ce,isFocused:U,onFocusChange:W}),(0,r.jsx)(st,{clock:H,onClockChange:de,duration:i,progress:c,isPaused:K,onClose:v})]})},re=e=>{if(!(0,E.isPositiveInteger)(e))throw new Error(P.doNotTranslate("Toast limit must be a positive integer."))},ft=({store:e,limit:t})=>{if(re(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&&k({store:e,toastsToClose:s.slice(0,n)})},vt=({limit:e})=>{const t=N();return(0,p.useEffect)(()=>t.lifecycle.mount(),[t]),(0,p.useLayoutEffect)(()=>ft({store:t,limit:e}),[t,e]),null},_t=({store:e,toast:t})=>{const{toasts:s}=e.state;t.status==="closing"&&s.includes(t)&&e.set("toasts",s.filter(n=>n!==t))},mt=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:se({duration:ee,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(m=>m.notification.id===l);d.isDefined(a)&&_t({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 m=u.renderers.values().next().value??u.lastRenderer;u.lastRenderer=m;const w=!s||u.renderers.size===0||[...u.renderers.values()].some(g=>g.isPaused);u.countdown.update({duration:m?.duration??a.notification.duration??6e3,durationRevision:a.durationRevision??0,isProgress:m?.isProgress??d.isDefined(a.notification.progress),isPaused:w,isActive:a.status==="visible",onClose:()=>{const g=e.state.toasts.find(A=>A.notification.id===l&&D(A));!s||!d.isDefined(g)||k({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 m=c(l);return m.renderers.has(u)||(m.countdown.stop(),m.pendingExits?.add(u)),m.renderers.set(u,a),f(),m.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)}}},pt=(e=3)=>{re(e);const t=new Q.Store({toasts:[],limit:e,mountedToasterCount:0});return Object.assign(t,{lifecycle:mt(t)})},Tt=({children:e,limit:t=3})=>{const[s]=(0,p.useState)(()=>pt(t));return(0,r.jsxs)(Y.Provider,{value:s,children:[e,(0,r.jsx)(vt,{limit:t})]})},xt="_root_1q2cc_1",ht="_item_1q2cc_20",gt="_itemContent_1q2cc_47",B={root:xt,item:ht,itemContent:gt},bt=()=>(0,Q.useStore)(N(),e=>e.toasts),Ct=({elementRef:e,toastEntry:t,rendererKey:s})=>{const n=N();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,E.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},jt=({toastEntry:e,getToastProps:t,onClose:s})=>{const{notification:n,status:o,durationRevision:c=0}=e,{id:i,...f}=n,v=N(),_=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:_},children:(0,r.jsx)(ne,{...f,..._,id:i,onClose:()=>s(i)})})})}),(0,r.jsx)(Ct,{elementRef:x,toastEntry:e,rendererKey:T})]})},wt=({getToastProps:e})=>{const t=bt(),{closeToast:s}=Z();return t.map(n=>(0,r.jsx)(jt,{toastEntry:n,getToastProps:e,onClose:s},n.notification.id))},yt=()=>{const e=N();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},Dt=({container:e,getToastProps:t,className:s,render:n,ref:o,...c})=>{const i=z.useThemeContainer(),f=ve.useProvidedTextDirection(),v=e===void 0?i??(typeof document>"u"?null:document.body):e,_=(0,F.useRender)({render:n,ref:o,props:{role:"region",dir:f,"aria-label":P.doNotTranslate("Notifications"),...c,className:(0,R.clsx)(B.root,s),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(yt,{}),(0,r.jsx)(wt,{getToastProps:t})]})}});return d.isDefined(v)?(0,pe.createPortal)(_,v):null};Object.defineProperty(exports,"Callout",{enumerable:!0,get:function(){return Ae}});Object.defineProperty(exports,"InlineBanner",{enumerable:!0,get:function(){return Me}});Object.defineProperty(exports,"Toast",{enumerable:!0,get:function(){return ne}});Object.defineProperty(exports,"ToastProvider",{enumerable:!0,get:function(){return Tt}});Object.defineProperty(exports,"Toaster",{enumerable:!0,get:function(){return Dt}});Object.defineProperty(exports,"useToast",{enumerable:!0,get:function(){return Ke}});
|
|
1
|
+
const z=require("./theme-CeIzO6UU.cjs"),d=require("./isDefined-DS2Q42p5.cjs"),y=require("./isRenderableSlot-Guryb6Nf.cjs"),P=require("./doNotTranslate-CHE7WmRS.cjs"),fe=require("./mergeClassNames-D4lshrT6.cjs"),I=require("./Button-CbJ3qEQ9.cjs"),O=require("./ProgressBar-BYw2pGjr.cjs"),ve=require("./useProvidedTextDirection-PVaoQCLH.cjs"),_e=require("./OverflowingTextWithTooltip-B21zZWP6.cjs"),me=require("./Separator-UJVlrTzw.cjs");let E=require("@sniptt/guards"),R=require("clsx"),r=require("react/jsx-runtime"),F=require("@base-ui/react/use-render"),p=require("react"),Q=require("@base-ui/utils/store"),pe=require("react-dom"),j=require("@tabler/icons-react");var Te="_action_3r2bm_1",xe={action:Te},he=({className:e,...t})=>(0,r.jsx)(I.Button,{...t,size:"sm",variant:"ghost",className:fe.mergeClassNames(xe.action,e)}),ge="_container_1ix4w_1",be="_containerFullWidth_1ix4w_40",Ce="_header_1ix4w_44",je="_iconContainer_1ix4w_53",we="_title_1ix4w_63",ye="_descriptionWrapper_1ix4w_75",De="_descriptionWrapperWithIcon_1ix4w_82",Ne="_descriptionWrapperWithAction_1ix4w_86",qe="_description_1ix4w_75",Pe="_footer_1ix4w_99",Ee="_closeButton_1ix4w_106",h={container:ge,containerFullWidth:be,header:Ce,iconContainer:je,title:we,descriptionWrapper:ye,descriptionWrapperWithIcon:De,descriptionWrapperWithAction:Ne,description:qe,footer:Pe,closeButton:Ee},Re=({status:e="info",variant:t="soft",color:s=O.FEEDBACK_STATUS_COLORS[e],title:n,description:o,fullWidth:c=!1,icon:i=(0,r.jsx)(j.IconHelp,{size:z.themeCssVariables.icon.size.md,"aria-hidden":"true"}),action:f,closeLabel:v=P.doNotTranslate("Close"),onDismiss:_,className:T,render:x,ref:l,...u})=>{const a=y.isRenderableSlot(i),m=y.isRenderableSlot(f);return(0,F.useRender)({render:x,ref:l,state:{status:e,variant:t,color:s},props:{...u,className:(0,R.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(_)&&(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:()=>_()})]}),y.isRenderableSlot(o)&&(0,r.jsx)("div",{className:(0,R.clsx)(h.descriptionWrapper,a&&h.descriptionWrapperWithIcon,m&&h.descriptionWrapperWithAction),children:(0,r.jsx)("div",{className:h.description,children:o})}),m&&(0,r.jsx)("div",{className:h.footer,children:f})]})}})},Ae=Object.assign(Re,{Action:he}),Se="_banner_qbpcz_1",Ie="_embedded_qbpcz_6",Oe="_bannerContent_qbpcz_10",ke="_icon_qbpcz_18",We="_bannerText_qbpcz_28",Be="_compact_qbpcz_33",ze="_fullWidth_qbpcz_58",q={banner:Se,embedded:Ie,bannerContent:Oe,icon:ke,bannerText:We,compact:Be,fullWidth:ze},Fe=({children:e,layout:t="standard",variant:s="soft",embedded:n=!1,fullWidth:o=!1,icon:c=(0,r.jsx)(j.IconInfoCircle,{"aria-hidden":"true"}),className:i,...f})=>{const v=t==="compact",_=!v&&(0,E.isString)(e);return(0,r.jsx)(O.Banner,{...f,className:(0,R.clsx)(q.banner,v&&q.compact,n&&q.embedded,o&&q.fullWidth,i),variant:s,"data-layout":t,children:(0,r.jsxs)("div",{className:q.bannerContent,children:[y.isRenderableSlot(c)&&(0,r.jsx)("span",{className:q.icon,children:c}),(0,r.jsx)("div",{className:q.bannerText,children:_?(0,r.jsx)(_e.OverflowingTextWithTooltip,{isFocusable:!0,text:(0,r.jsx)(r.Fragment,{children:e}),tooltipContent:e}):e})]})})},Me=Object.assign(Fe,{Action:O.Banner.Action}),D=e=>e.status==="visible",k=({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?.()},Y=(0,p.createContext)(void 0),N=()=>{const e=(0,p.useContext)(Y);if(!d.isDefined(e))throw new Error(P.doNotTranslate("Toast components must be used within a ToastProvider."));return e},Z=()=>{const e=N();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,E.isNonEmptyArray)(n)&&k({store:e,toastsToClose:n})}}},G=0,J=()=>(G+=1,`toast-${G}`),Le=()=>{const e=N();return{enqueueToast:(0,p.useMemo)(()=>{function t(s){if(!d.isDefined(s))return;if(!e.lifecycle.isActive())return J();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 _=J(),T=Math.max(0,f.length-i+1);return k({store:e,toastsToClose:f.slice(0,T),nextToasts:[...c,{notification:{...o,id:_},dedupeKey:n,status:"visible"}]}),_}return t},[e])}},$e=({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,E.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))},Ue=()=>{const e=N();return{updateToast:(0,p.useCallback)(t=>$e({store:e,...t}),[e])}},Ke=()=>{const{closeToast:e}=Z(),{enqueueToast:t}=Le(),{updateToast:s}=Ue();return{enqueueToast:t,closeToast:e,updateToast:s}},He="_root_181ka_1",Ve="_progress_181ka_19",Xe="_header_181ka_30",Ge="_message_181ka_40",Je="_icon_181ka_45",Qe="_actions_181ka_50",Ye="_description_181ka_56",Ze="_footer_181ka_65",et="_footerAction_181ka_69",tt="_closeButton_181ka_76",b={root:He,progress:Ve,header:Xe,message:Ge,icon:Je,actions:Qe,description:Ye,footer:Ze,footerAction:et,closeButton:tt},M=(0,p.createContext)({durationRevision:0,isActive:!0}),st=({clock:e,onClockChange:t,duration:s,progress:n,isPaused:o,onClose:c})=>{const{durationRevision:i,isActive:f,lifecycle:v,id:_,rendererKey:T,timingOverrides:x}=(0,p.useContext)(M),l=d.isDefined(v)&&d.isDefined(_)&&d.isDefined(T),u=l?void 0:e,a=d.isDefined(n),m=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:_,key:T,configuration:{duration:m?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,_,T,m,w]),(0,p.useLayoutEffect)(()=>()=>{if(l){v.removeRenderer({id:_,key:T});return}u?.stop()},[u,v,_,T,l]),null},nt=({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),ee=6e3,te=e=>Number.isFinite(e)&&e>0,rt="_countdown_1vuo8_1",ot="_toastCountdown_1vuo8_1",it={countdown:rt,toastCountdown:ot},at=({progress:e,duration:t,remainingDuration:s,revision:n,isPaused:o,barColor:c})=>d.isDefined(e)?(0,r.jsx)(O.ProgressBar,{value:e,barColor:c}):te(t)?(0,r.jsx)("div",{className:it.countdown,"data-paused":o||void 0,style:{"--toast-countdown-color":c,"--toast-countdown-width":`${s/t*100}%`,"--toast-countdown-duration":`${s}ms`}},n):null,ct=2**31-1,ut=({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},_=()=>{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,_(),t?.onClose?.())},x=()=>d.isDefined(t)&&t.isActive&&!t.isPaused&&!t.isProgress&&te(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,ct))};return{update:a=>{const m=!d.isDefined(t)||a.duration!==t.duration||a.durationRevision!==t.durationRevision||t.isProgress&&!a.isProgress,w=m||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&&(m&&(s=Math.max(0,a.duration)),_(),l())},close:T,stop:v}},se=({duration:e,isPaused:t})=>{let s={duration:e,remainingDuration:e,revision:0,isPaused:t};const n=new Set;return{...ut({onChange:o=>{s=o;for(const c of n)c()}}),getSnapshot:()=>s,subscribe:o=>(n.add(o),()=>{n.delete(o)})}},dt=({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)??se({duration:e,isPaused:t}));return{countdown:(0,p.useSyncExternalStore)(c.subscribe,c.getSnapshot,c.getSnapshot),clock:c,setClock:i}},lt={neutral:j.IconAlertTriangle,error:j.IconAlertTriangle,success:j.IconSquareRoundedCheck,info:j.IconInfoCircle,warning:j.IconAlertTriangle},ne=({children:e,description:t,icon:s,iconLabel:n,action:o,progress:c,duration:i=ee,onCancel:f,onClose:v,cancelLabel:_=P.doNotTranslate("Cancel"),closeLabel:T=P.doNotTranslate("Close"),status:x="neutral",role:l="status",className:u,onMouseEnter:a,onMouseLeave:m,onFocus:w,onBlur:g,render:A,ref:oe,...ie})=>{const L=z.useTheme(),[ae,$]=(0,p.useState)(!1),[U,W]=(0,p.useState)(!1),[ce,ue]=(0,p.useState)(null),K=ae||U,{countdown:S,clock:H,setClock:de}=dt({duration:i,isPaused:K}),le=lt[x],V=L.snackBar[x==="neutral"?"default":x],X=(0,E.isUndefined)(s)?(0,r.jsx)(le,{"aria-label":n,"aria-hidden":!d.isDefined(n),color:V.color,size:L.icon.size.md}):s;return(0,r.jsxs)(r.Fragment,{children:[(0,F.useRender)({render:A,ref:[oe??null,ue],props:{role:l,"aria-live":l==="alert"?"assertive":"polite",...ie,className:(0,R.clsx)(b.root,u),onMouseEnter:C=>{$(!0),a?.(C)},onMouseLeave:C=>{$(!1),m?.(C)},onFocus:C=>{W(!0),w?.(C)},onBlur:C=>{C.currentTarget.contains(C.relatedTarget)||W(!1),g?.(C)},children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:b.progress,"aria-hidden":!0,children:(0,r.jsx)(at,{barColor:V.backgroundColor,progress:c,duration:S.duration,remainingDuration:S.remainingDuration,revision:S.revision,isPaused:S.isPaused})}),(0,r.jsxs)("div",{className:b.header,children:[y.isRenderableSlot(X)&&(0,r.jsx)("div",{className:b.icon,children:X}),(0,r.jsx)("div",{className:b.message,children:e}),(0,r.jsxs)("div",{className:b.actions,children:[d.isDefined(f)&&y.isRenderableSlot(_)&&(0,r.jsx)(I.Button,{onClick:f,size:"sm",variant:"ghost",style:{fontWeight:"var(--t-font-weight-regular)"},children:_}),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:H.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)(nt,{element:ce,isFocused:U,onFocusChange:W}),(0,r.jsx)(st,{clock:H,onClockChange:de,duration:i,progress:c,isPaused:K,onClose:v})]})},re=e=>{if(!(0,E.isPositiveInteger)(e))throw new Error(P.doNotTranslate("Toast limit must be a positive integer."))},ft=({store:e,limit:t})=>{if(re(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&&k({store:e,toastsToClose:s.slice(0,n)})},vt=({limit:e})=>{const t=N();return(0,p.useEffect)(()=>t.lifecycle.mount(),[t]),(0,p.useLayoutEffect)(()=>ft({store:t,limit:e}),[t,e]),null},_t=({store:e,toast:t})=>{const{toasts:s}=e.state;t.status==="closing"&&s.includes(t)&&e.set("toasts",s.filter(n=>n!==t))},mt=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:se({duration:ee,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(m=>m.notification.id===l);d.isDefined(a)&&_t({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 m=u.renderers.values().next().value??u.lastRenderer;u.lastRenderer=m;const w=!s||u.renderers.size===0||[...u.renderers.values()].some(g=>g.isPaused);u.countdown.update({duration:m?.duration??a.notification.duration??6e3,durationRevision:a.durationRevision??0,isProgress:m?.isProgress??d.isDefined(a.notification.progress),isPaused:w,isActive:a.status==="visible",onClose:()=>{const g=e.state.toasts.find(A=>A.notification.id===l&&D(A));!s||!d.isDefined(g)||k({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 m=c(l);return m.renderers.has(u)||(m.countdown.stop(),m.pendingExits?.add(u)),m.renderers.set(u,a),f(),m.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)}}},pt=(e=3)=>{re(e);const t=new Q.Store({toasts:[],limit:e,mountedToasterCount:0});return Object.assign(t,{lifecycle:mt(t)})},Tt=({children:e,limit:t=3})=>{const[s]=(0,p.useState)(()=>pt(t));return(0,r.jsxs)(Y.Provider,{value:s,children:[e,(0,r.jsx)(vt,{limit:t})]})},xt="_root_1q2cc_1",ht="_item_1q2cc_20",gt="_itemContent_1q2cc_47",B={root:xt,item:ht,itemContent:gt},bt=()=>(0,Q.useStore)(N(),e=>e.toasts),Ct=({elementRef:e,toastEntry:t,rendererKey:s})=>{const n=N();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,E.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},jt=({toastEntry:e,getToastProps:t,onClose:s})=>{const{notification:n,status:o,durationRevision:c=0}=e,{id:i,...f}=n,v=N(),_=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:_},children:(0,r.jsx)(ne,{...f,..._,id:i,onClose:()=>s(i)})})})}),(0,r.jsx)(Ct,{elementRef:x,toastEntry:e,rendererKey:T})]})},wt=({getToastProps:e})=>{const t=bt(),{closeToast:s}=Z();return t.map(n=>(0,r.jsx)(jt,{toastEntry:n,getToastProps:e,onClose:s},n.notification.id))},yt=()=>{const e=N();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},Dt=({container:e,getToastProps:t,className:s,render:n,ref:o,...c})=>{const i=z.useThemeContainer(),f=ve.useProvidedTextDirection(),v=e===void 0?i??(typeof document>"u"?null:document.body):e,_=(0,F.useRender)({render:n,ref:o,props:{role:"region",dir:f,"aria-label":P.doNotTranslate("Notifications"),...c,className:(0,R.clsx)(B.root,s),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(yt,{}),(0,r.jsx)(wt,{getToastProps:t})]})}});return d.isDefined(v)?(0,pe.createPortal)(_,v):null};Object.defineProperty(exports,"Callout",{enumerable:!0,get:function(){return Ae}});Object.defineProperty(exports,"InlineBanner",{enumerable:!0,get:function(){return Me}});Object.defineProperty(exports,"Toast",{enumerable:!0,get:function(){return ne}});Object.defineProperty(exports,"ToastProvider",{enumerable:!0,get:function(){return Tt}});Object.defineProperty(exports,"Toaster",{enumerable:!0,get:function(){return Dt}});Object.defineProperty(exports,"useToast",{enumerable:!0,get:function(){return Ke}});
|
package/dist/icon/provider.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});let
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});let u=require("react/jsx-runtime"),o=require("react"),d=require("@tabler/icons-react");var a=(0,o.createContext)({}),i=()=>{const e=(0,o.useContext)(a),r=d.IconNumber123;return{getIcons:()=>e,getIcon:(c,s)=>e[c??""]||e[s??""]||r}},v=({name:e,className:r,style:t,size:n,stroke:c,color:s,"aria-hidden":I})=>{const{getIcon:l}=i();return(0,u.jsx)(l(e),{className:r,style:t,size:n,stroke:c,color:s,"aria-hidden":I})},g=({children:e})=>{const[r,t]=(0,o.useState)({});return(0,o.useEffect)(()=>{Promise.resolve().then(()=>require("../AllIcons-RgvlIG_O.cjs")).then(({ALL_ICONS:n})=>{t(n)})},[]),(0,u.jsx)(a.Provider,{value:r,children:e})};exports.Icon=v;exports.IconsProvider=g;exports.useIcons=i;
|
package/dist/icon/provider.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as u } from "../TablerIcons-B6BhOlW_.js";
|
|
2
|
-
import { createContext as d, useContext as m, useEffect as v, useState as f } from "react";
|
|
3
2
|
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as d, useContext as m, useEffect as v, useState as f } from "react";
|
|
4
4
|
var a = d({}), g = () => {
|
|
5
5
|
const t = m(a), o = u;
|
|
6
6
|
return {
|
|
@@ -20,7 +20,7 @@ var a = d({}), g = () => {
|
|
|
20
20
|
}, l = ({ children: t }) => {
|
|
21
21
|
const [o, n] = f({});
|
|
22
22
|
return v(() => {
|
|
23
|
-
import("../AllIcons-
|
|
23
|
+
import("../AllIcons-DbdVWsOq.js").then(({ ALL_ICONS: e }) => {
|
|
24
24
|
n(e);
|
|
25
25
|
});
|
|
26
26
|
}, []), /* @__PURE__ */ s(a.Provider, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { r } from "./theme-B1jMC8En.js";
|
|
1
2
|
import { yt as c } from "./TablerIcons-B6BhOlW_.js";
|
|
2
|
-
import { r } from "./theme-CuGIQBsJ.js";
|
|
3
3
|
import { clsx as d } from "clsx";
|
|
4
|
-
import { forwardRef as h } from "react";
|
|
5
4
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
5
|
+
import { forwardRef as h } from "react";
|
|
6
6
|
var C = (t) => /* @__PURE__ */ e("svg", {
|
|
7
7
|
width: 24,
|
|
8
8
|
height: 24,
|