@bfrs/agentic-components 0.8.6 → 0.8.7
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/components/feedback/Toast/Toast.js +48 -48
- package/dist/components/feedback/Toast/Toast.js.map +1 -1
- package/dist/components/ui/feedback/warningVisual.d.ts +1 -0
- package/dist/components/ui/feedback/warningVisual.js +20 -16
- package/dist/components/ui/feedback/warningVisual.js.map +1 -1
- package/dist/custom-elements.js +3587 -3584
- package/dist/custom-elements.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as r, jsxs as w } from "react/jsx-runtime";
|
|
2
|
-
import { X as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { createPortal as
|
|
2
|
+
import { X as W } from "../../../node_modules/@phosphor-icons/react/dist/csr/X.es.js";
|
|
3
|
+
import { useState as B, useRef as F, useCallback as s, useMemo as L, useEffect as j } from "react";
|
|
4
|
+
import { createPortal as D } from "react-dom";
|
|
5
5
|
import i from "@emotion/styled";
|
|
6
|
-
import { twTransform as I, kfContentIn as
|
|
7
|
-
import { warningSurfaceStyle as
|
|
8
|
-
import { ToastContext as
|
|
9
|
-
import { BfrsPortalScope as
|
|
10
|
-
const
|
|
6
|
+
import { twTransform as I, kfContentIn as H, twRing as $ } from "../../../lib/emotionTw.js";
|
|
7
|
+
import { warningToastSurfaceStyle as E, warningSurfaceStyle as N, WarningAlertIcon as M } from "../../ui/feedback/warningVisual.js";
|
|
8
|
+
import { ToastContext as O } from "./Toast.context.js";
|
|
9
|
+
import { BfrsPortalScope as G } from "../../ui/providers/BfrsProvider/BfrsProvider.js";
|
|
10
|
+
const V = {
|
|
11
11
|
"top-left": { left: "1rem", top: "1rem", alignItems: "flex-start" },
|
|
12
12
|
"top-center": { left: "50%", top: "1rem", ...I({ "--tw-translate-x": "-50%" }), alignItems: "center" },
|
|
13
13
|
"top-right": { right: "1rem", top: "1rem", alignItems: "flex-end" },
|
|
@@ -17,7 +17,7 @@ const G = {
|
|
|
17
17
|
}, p = (t) => ({
|
|
18
18
|
"--tw-border-opacity": "1",
|
|
19
19
|
borderLeftColor: `hsl(var(--bfrs-color-${t}) / var(--tw-border-opacity, 1))`
|
|
20
|
-
}),
|
|
20
|
+
}), X = {
|
|
21
21
|
neutral: p("primary"),
|
|
22
22
|
success: p("success"),
|
|
23
23
|
warning: {},
|
|
@@ -26,7 +26,7 @@ const G = {
|
|
|
26
26
|
}, u = (t) => ({
|
|
27
27
|
"--tw-bg-opacity": "1",
|
|
28
28
|
backgroundColor: `hsl(var(--bfrs-color-${t}) / var(--tw-bg-opacity, 1))`
|
|
29
|
-
}),
|
|
29
|
+
}), q = {
|
|
30
30
|
neutral: u("primary"),
|
|
31
31
|
success: u("success"),
|
|
32
32
|
warning: {},
|
|
@@ -52,8 +52,8 @@ const G = {
|
|
|
52
52
|
"--tw-text-opacity": "1",
|
|
53
53
|
color: "rgb(255 255 255 / var(--tw-text-opacity, 1))"
|
|
54
54
|
},
|
|
55
|
-
!t.plain &&
|
|
56
|
-
]),
|
|
55
|
+
!t.plain && q[t.tone]
|
|
56
|
+
]), J = /* @__PURE__ */ i("div", {
|
|
57
57
|
label: "AgenticToast-item",
|
|
58
58
|
shouldForwardProp: (t) => t !== "ownerState"
|
|
59
59
|
})(({ ownerState: t }) => [
|
|
@@ -85,16 +85,16 @@ const G = {
|
|
|
85
85
|
boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)",
|
|
86
86
|
outline: "2px solid transparent",
|
|
87
87
|
outlineOffset: "2px",
|
|
88
|
-
|
|
88
|
+
...H,
|
|
89
89
|
animation: "bfrs-bfrs-content-in var(--bfrs-motion-normal) var(--bfrs-ease-out)"
|
|
90
90
|
},
|
|
91
|
-
|
|
92
|
-
]),
|
|
91
|
+
X[t.tone]
|
|
92
|
+
]), K = /* @__PURE__ */ i("div", {
|
|
93
93
|
label: "AgenticToast-content"
|
|
94
94
|
})({
|
|
95
95
|
minWidth: "0px",
|
|
96
96
|
flex: "1 1 0%"
|
|
97
|
-
}),
|
|
97
|
+
}), Q = /* @__PURE__ */ i("div", {
|
|
98
98
|
label: "AgenticToast-title"
|
|
99
99
|
})({
|
|
100
100
|
fontSize: "13px",
|
|
@@ -102,7 +102,7 @@ const G = {
|
|
|
102
102
|
lineHeight: "1.25rem",
|
|
103
103
|
"--tw-text-opacity": "1",
|
|
104
104
|
color: "hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))"
|
|
105
|
-
}),
|
|
105
|
+
}), U = /* @__PURE__ */ i("div", {
|
|
106
106
|
label: "AgenticToast-description"
|
|
107
107
|
})({
|
|
108
108
|
marginTop: ".125rem",
|
|
@@ -110,12 +110,12 @@ const G = {
|
|
|
110
110
|
lineHeight: "1.25rem",
|
|
111
111
|
"--tw-text-opacity": "1",
|
|
112
112
|
color: "hsl(var(--bfrs-color-text-secondary) / var(--tw-text-opacity, 1))"
|
|
113
|
-
}),
|
|
113
|
+
}), Y = /* @__PURE__ */ i("div", {
|
|
114
114
|
label: "AgenticToast-action"
|
|
115
115
|
})({
|
|
116
116
|
marginLeft: ".25rem",
|
|
117
117
|
flexShrink: 0
|
|
118
|
-
}),
|
|
118
|
+
}), Z = /* @__PURE__ */ i("button", {
|
|
119
119
|
label: "AgenticToast-dismissButton"
|
|
120
120
|
})({
|
|
121
121
|
marginRight: "-.25rem",
|
|
@@ -139,8 +139,8 @@ const G = {
|
|
|
139
139
|
"--tw-text-opacity": "1",
|
|
140
140
|
color: "hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))"
|
|
141
141
|
},
|
|
142
|
-
"&:focus-visible":
|
|
143
|
-
}),
|
|
142
|
+
"&:focus-visible": $("2px", "hsl(var(--bfrs-color-border-focus) / .5)")
|
|
143
|
+
}), _ = /* @__PURE__ */ i("div", {
|
|
144
144
|
label: "AgenticToast-stack",
|
|
145
145
|
shouldForwardProp: (t) => t !== "ownerState"
|
|
146
146
|
})(({ ownerState: t }) => [
|
|
@@ -154,15 +154,15 @@ const G = {
|
|
|
154
154
|
flexDirection: "column",
|
|
155
155
|
gap: ".625rem"
|
|
156
156
|
},
|
|
157
|
-
|
|
158
|
-
]),
|
|
157
|
+
V[t.placement]
|
|
158
|
+
]), tt = {
|
|
159
159
|
neutral: "i",
|
|
160
160
|
success: "✓",
|
|
161
161
|
warning: "",
|
|
162
162
|
danger: "!",
|
|
163
163
|
info: "i"
|
|
164
164
|
};
|
|
165
|
-
function
|
|
165
|
+
function et(t, e) {
|
|
166
166
|
return typeof t == "string" ? {
|
|
167
167
|
title: t,
|
|
168
168
|
tone: "neutral",
|
|
@@ -178,69 +178,69 @@ function tt(t, e) {
|
|
|
178
178
|
function b(t, e) {
|
|
179
179
|
return typeof e == "string" ? { title: e, tone: t } : { ...e, tone: t };
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
return t === "warning" ? /* @__PURE__ */ r(k, { ownerState: { tone: t, plain: !0 }, style:
|
|
181
|
+
function rt({ tone: t }) {
|
|
182
|
+
return t === "warning" ? /* @__PURE__ */ r(k, { ownerState: { tone: t, plain: !0 }, style: N, "aria-hidden": "true", children: /* @__PURE__ */ r(M, {}) }) : /* @__PURE__ */ r(k, { ownerState: { tone: t }, "aria-hidden": "true", children: tt[t] });
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
|
|
184
|
+
function ot({ toast: t, onDismiss: e }) {
|
|
185
|
+
j(() => {
|
|
186
186
|
if (t.duration <= 0 || !Number.isFinite(t.duration)) return;
|
|
187
187
|
const c = window.setTimeout(() => e(t.id), t.duration);
|
|
188
188
|
return () => window.clearTimeout(c);
|
|
189
189
|
}, [e, t.duration, t.id]);
|
|
190
190
|
const a = t.tone === "danger" ? "alert" : "status";
|
|
191
191
|
return /* @__PURE__ */ w(
|
|
192
|
-
|
|
192
|
+
J,
|
|
193
193
|
{
|
|
194
194
|
role: a,
|
|
195
195
|
"aria-live": a === "alert" ? "assertive" : "polite",
|
|
196
196
|
ownerState: { tone: t.tone },
|
|
197
197
|
className: t.className,
|
|
198
|
-
style: t.tone === "warning" ?
|
|
198
|
+
style: t.tone === "warning" ? E : void 0,
|
|
199
199
|
children: [
|
|
200
|
-
t.icon ?? /* @__PURE__ */ r(
|
|
201
|
-
/* @__PURE__ */ w(
|
|
202
|
-
/* @__PURE__ */ r(
|
|
203
|
-
t.description && /* @__PURE__ */ r(
|
|
200
|
+
t.icon ?? /* @__PURE__ */ r(rt, { tone: t.tone }),
|
|
201
|
+
/* @__PURE__ */ w(K, { children: [
|
|
202
|
+
/* @__PURE__ */ r(Q, { children: t.title }),
|
|
203
|
+
t.description && /* @__PURE__ */ r(U, { children: t.description })
|
|
204
204
|
] }),
|
|
205
|
-
t.action && /* @__PURE__ */ r(
|
|
206
|
-
t.dismissible && /* @__PURE__ */ r(
|
|
205
|
+
t.action && /* @__PURE__ */ r(Y, { children: t.action }),
|
|
206
|
+
t.dismissible && /* @__PURE__ */ r(Z, { type: "button", onClick: () => e(t.id), "aria-label": "Dismiss notification", children: /* @__PURE__ */ r(W, { size: 13, weight: "bold" }) })
|
|
207
207
|
]
|
|
208
208
|
}
|
|
209
209
|
);
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function nt({ toasts: t, onDismiss: e, placement: a = "bottom-center", className: c }) {
|
|
212
212
|
if (t.length === 0) return null;
|
|
213
213
|
const f = (
|
|
214
214
|
// Portaled to <body> so the fixed, z-[9999] stack escapes any ancestor
|
|
215
215
|
// stacking context (a transformed/opacity/filtered parent would otherwise
|
|
216
216
|
// trap it and let page content paint over the toasts). BfrsPortalScope
|
|
217
217
|
// re-applies the .bfrs token scope at the portal root.
|
|
218
|
-
/* @__PURE__ */ r(
|
|
218
|
+
/* @__PURE__ */ r(G, { children: /* @__PURE__ */ r(_, { ownerState: { placement: a }, className: c, children: t.map((l) => /* @__PURE__ */ r(ot, { toast: l, onDismiss: e }, l.id)) }) })
|
|
219
219
|
);
|
|
220
|
-
return typeof document > "u" ? f :
|
|
220
|
+
return typeof document > "u" ? f : D(f, document.body);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
const [l, g] =
|
|
222
|
+
function ut({ children: t, placement: e = "bottom-center", maxToasts: a = 4, defaultDuration: c = 2600, className: f }) {
|
|
223
|
+
const [l, g] = B([]), C = F(0), h = s((o) => {
|
|
224
224
|
g((m) => m.filter((d) => d.id !== o));
|
|
225
225
|
}, []), x = s(() => {
|
|
226
226
|
g([]);
|
|
227
227
|
}, []), n = s(
|
|
228
228
|
(o) => {
|
|
229
|
-
const m =
|
|
230
|
-
return g((
|
|
229
|
+
const m = et(o, c), d = m.id ?? `toast-${Date.now()}-${C.current++}`, z = { ...m, id: d };
|
|
230
|
+
return g((P) => [...P.filter((R) => R.id !== d), z].slice(-a)), d;
|
|
231
231
|
},
|
|
232
232
|
[c, a]
|
|
233
|
-
), v = s((o) => n(b("success", o)), [n]), y = s((o) => n(b("warning", o)), [n]), T = s((o) => n(b("danger", o)), [n]), S = s((o) => n(b("info", o)), [n]),
|
|
233
|
+
), v = s((o) => n(b("success", o)), [n]), y = s((o) => n(b("warning", o)), [n]), T = s((o) => n(b("danger", o)), [n]), S = s((o) => n(b("info", o)), [n]), A = L(
|
|
234
234
|
() => ({ toasts: l, toast: n, success: v, warning: y, danger: T, info: S, dismiss: h, clear: x }),
|
|
235
235
|
[x, T, h, S, v, n, l, y]
|
|
236
236
|
);
|
|
237
|
-
return /* @__PURE__ */ w(
|
|
237
|
+
return /* @__PURE__ */ w(O.Provider, { value: A, children: [
|
|
238
238
|
t,
|
|
239
|
-
/* @__PURE__ */ r(
|
|
239
|
+
/* @__PURE__ */ r(nt, { toasts: l, onDismiss: h, placement: e, className: f })
|
|
240
240
|
] });
|
|
241
241
|
}
|
|
242
242
|
export {
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
nt as ToastManager,
|
|
244
|
+
ut as ToastProvider
|
|
245
245
|
};
|
|
246
246
|
//# sourceMappingURL=Toast.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.js","sources":["../../../../src/components/feedback/Toast/Toast.tsx"],"sourcesContent":["import { X } from \"@phosphor-icons/react\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport styled from \"@emotion/styled\";\nimport type { CSSObject } from \"@emotion/react\";\nimport { kfContentIn, twRing, twTransform } from \"@/lib/emotionTw\";\nimport { BfrsPortalScope } from \"@/components/ui/providers/BfrsProvider\";\nimport { WarningAlertIcon, warningSurfaceStyle } from \"@/components/ui/feedback/warningVisual\";\nimport { ToastContext } from \"./Toast.context\";\nimport type { ToastContextValue, ToastInput, ToastManagerProps, ToastPlacement, ToastProviderProps, ToastRecord, ToastTone } from \"./Toast.types\";\n\n/* Exact compiled output of the pre-migration Tailwind utilities. */\n\nconst toastPlacementStyles: Record<ToastPlacement, CSSObject> = {\n \"top-left\": { left: \"1rem\", top: \"1rem\", alignItems: \"flex-start\" },\n \"top-center\": { left: \"50%\", top: \"1rem\", ...twTransform({ \"--tw-translate-x\": \"-50%\" }), alignItems: \"center\" },\n \"top-right\": { right: \"1rem\", top: \"1rem\", alignItems: \"flex-end\" },\n \"bottom-left\": { bottom: \"1rem\", left: \"1rem\", alignItems: \"flex-start\" },\n \"bottom-center\": { bottom: \"1.25rem\", left: \"50%\", ...twTransform({ \"--tw-translate-x\": \"-50%\" }), alignItems: \"center\" },\n \"bottom-right\": { bottom: \"1rem\", right: \"1rem\", alignItems: \"flex-end\" }\n};\n\nconst borderL = (token: string): CSSObject => ({\n \"--tw-border-opacity\": \"1\",\n borderLeftColor: `hsl(var(--bfrs-color-${token}) / var(--tw-border-opacity, 1))`\n});\n\nconst toastToneBorderStyles: Record<ToastTone, CSSObject> = {\n neutral: borderL(\"primary\"),\n success: borderL(\"success\"),\n warning: {},\n danger: borderL(\"danger\"),\n info: borderL(\"info\")\n};\n\nconst bgTone = (token: string): CSSObject => ({\n \"--tw-bg-opacity\": \"1\",\n backgroundColor: `hsl(var(--bfrs-color-${token}) / var(--tw-bg-opacity, 1))`\n});\n\nconst toastToneIconStyles: Record<ToastTone, CSSObject> = {\n neutral: bgTone(\"primary\"),\n success: bgTone(\"success\"),\n warning: {},\n danger: bgTone(\"danger\"),\n info: bgTone(\"info\")\n};\n\nconst ToastIconBubble = /*#__PURE__*/ styled(\"span\", {\n label: \"AgenticToast-iconBubble\",\n shouldForwardProp: (propName) => propName !== \"ownerState\"\n})<{ ownerState: { tone: ToastTone; plain?: boolean } }>(({ ownerState }) => [\n {\n display: \"flex\",\n width: \"1.25rem\",\n height: \"1.25rem\",\n flexShrink: 0,\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"var(--bfrs-radius-pill)\"\n },\n !ownerState.plain && {\n fontSize: \"12px\",\n fontWeight: 700,\n lineHeight: 1,\n \"--tw-text-opacity\": \"1\",\n color: \"rgb(255 255 255 / var(--tw-text-opacity, 1))\"\n },\n !ownerState.plain && toastToneIconStyles[ownerState.tone]\n]);\n\nconst ToastItemRoot = /*#__PURE__*/ styled(\"div\", {\n label: \"AgenticToast-item\",\n shouldForwardProp: (propName) => propName !== \"ownerState\"\n})<{ ownerState: { tone: ToastTone } }>(({ ownerState }) => [\n {\n pointerEvents: \"auto\",\n display: \"flex\",\n width: \"100%\",\n minWidth: \"300px\",\n maxWidth: \"400px\",\n alignItems: \"flex-start\",\n gap: \".625rem\",\n borderRadius: \"10px\",\n borderWidth: \"1px\",\n borderLeftWidth: \"3px\",\n \"--tw-border-opacity\": \"1\",\n borderColor: \"hsl(var(--bfrs-color-border) / var(--tw-border-opacity, 1))\",\n \"--tw-bg-opacity\": \"1\",\n backgroundColor: \"hsl(var(--bfrs-color-surface-card) / var(--tw-bg-opacity, 1))\",\n paddingLeft: \"14px\",\n paddingRight: \"14px\",\n paddingTop: \".75rem\",\n paddingBottom: \".75rem\",\n fontSize: \".875rem\",\n lineHeight: \"1.25rem\",\n \"--tw-text-opacity\": \"1\",\n color: \"hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))\",\n \"--tw-shadow\": \"var(--bfrs-shadow-elevated)\",\n \"--tw-shadow-colored\": \"var(--bfrs-shadow-elevated)\",\n boxShadow: \"var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)\",\n outline: \"2px solid transparent\",\n outlineOffset: \"2px\",\n ...kfContentIn,\n animation: \"bfrs-bfrs-content-in var(--bfrs-motion-normal) var(--bfrs-ease-out)\"\n },\n toastToneBorderStyles[ownerState.tone]\n]);\n\nconst ToastContent = /*#__PURE__*/ styled(\"div\", {\n label: \"AgenticToast-content\"\n})({\n minWidth: \"0px\",\n flex: \"1 1 0%\"\n});\n\nconst ToastTitle = /*#__PURE__*/ styled(\"div\", {\n label: \"AgenticToast-title\"\n})({\n fontSize: \"13px\",\n fontWeight: 600,\n lineHeight: \"1.25rem\",\n \"--tw-text-opacity\": \"1\",\n color: \"hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))\"\n});\n\nconst ToastDescription = /*#__PURE__*/ styled(\"div\", {\n label: \"AgenticToast-description\"\n})({\n marginTop: \".125rem\",\n fontSize: \".75rem\",\n lineHeight: \"1.25rem\",\n \"--tw-text-opacity\": \"1\",\n color: \"hsl(var(--bfrs-color-text-secondary) / var(--tw-text-opacity, 1))\"\n});\n\nconst ToastAction = /*#__PURE__*/ styled(\"div\", {\n label: \"AgenticToast-action\"\n})({\n marginLeft: \".25rem\",\n flexShrink: 0\n});\n\nconst ToastDismissButton = /*#__PURE__*/ styled(\"button\", {\n label: \"AgenticToast-dismissButton\"\n})({\n marginRight: \"-.25rem\",\n display: \"flex\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n flexShrink: 0,\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"var(--bfrs-radius-md)\",\n \"--tw-text-opacity\": \"1\",\n color: \"hsl(var(--bfrs-color-text-secondary) / var(--tw-text-opacity, 1))\",\n outline: \"2px solid transparent\",\n outlineOffset: \"2px\",\n transitionProperty:\n \"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter\",\n transitionTimingFunction: \"cubic-bezier(.4,0,.2,1)\",\n transitionDuration: \".15s\",\n \"&:hover\": {\n \"--tw-bg-opacity\": \"1\",\n backgroundColor: \"hsl(var(--bfrs-color-surface-muted) / var(--tw-bg-opacity, 1))\",\n \"--tw-text-opacity\": \"1\",\n color: \"hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))\"\n },\n \"&:focus-visible\": twRing(\"2px\", \"hsl(var(--bfrs-color-border-focus) / .5)\")\n});\n\nconst ToastStack = /*#__PURE__*/ styled(\"div\", {\n label: \"AgenticToast-stack\",\n shouldForwardProp: (propName) => propName !== \"ownerState\"\n})<{ ownerState: { placement: ToastPlacement } }>(({ ownerState }) => [\n {\n pointerEvents: \"none\",\n position: \"fixed\",\n zIndex: 2147483646,\n display: \"flex\",\n width: \"calc(100vw - 2rem)\",\n maxWidth: \"400px\",\n flexDirection: \"column\",\n gap: \".625rem\"\n },\n toastPlacementStyles[ownerState.placement]\n]);\n\nconst toneIconGlyph: Record<ToastTone, string> = {\n neutral: \"i\",\n success: \"✓\",\n warning: \"\",\n danger: \"!\",\n info: \"i\"\n};\n\nfunction normalizeToast(input: ToastInput, defaultDuration: number): Omit<ToastRecord, \"id\"> & { id?: string } {\n if (typeof input === \"string\") {\n return {\n title: input,\n tone: \"neutral\",\n duration: defaultDuration,\n dismissible: true\n };\n }\n\n return {\n tone: \"neutral\",\n duration: defaultDuration,\n dismissible: true,\n ...input\n };\n}\n\nfunction withTone(tone: ToastTone, input: string | Omit<Extract<ToastInput, object>, \"tone\">): ToastInput {\n return typeof input === \"string\" ? { title: input, tone } : { ...input, tone };\n}\n\nfunction DefaultToastIcon({ tone }: { tone: ToastTone }) {\n if (tone === \"warning\") {\n return (\n <ToastIconBubble ownerState={{ tone, plain: true }} style={warningSurfaceStyle} aria-hidden=\"true\">\n <WarningAlertIcon />\n </ToastIconBubble>\n );\n }\n\n return (\n <ToastIconBubble ownerState={{ tone }} aria-hidden=\"true\">\n {toneIconGlyph[tone]}\n </ToastIconBubble>\n );\n}\n\nfunction ToastItem({ toast, onDismiss }: { toast: ToastRecord; onDismiss: (id: string) => void }) {\n useEffect(() => {\n if (toast.duration <= 0 || !Number.isFinite(toast.duration)) return undefined;\n\n const timeout = window.setTimeout(() => onDismiss(toast.id), toast.duration);\n return () => window.clearTimeout(timeout);\n }, [onDismiss, toast.duration, toast.id]);\n\n const role = toast.tone === \"danger\" ? \"alert\" : \"status\";\n\n return (\n <ToastItemRoot\n role={role}\n aria-live={role === \"alert\" ? \"assertive\" : \"polite\"}\n ownerState={{ tone: toast.tone }}\n className={toast.className}\n style={toast.tone === \"warning\" ? warningSurfaceStyle : undefined}\n >\n {toast.icon ?? <DefaultToastIcon tone={toast.tone} />}\n <ToastContent>\n <ToastTitle>{toast.title}</ToastTitle>\n {toast.description && <ToastDescription>{toast.description}</ToastDescription>}\n </ToastContent>\n {toast.action && <ToastAction>{toast.action}</ToastAction>}\n {toast.dismissible && (\n <ToastDismissButton type=\"button\" onClick={() => onDismiss(toast.id)} aria-label=\"Dismiss notification\">\n <X size={13} weight=\"bold\" />\n </ToastDismissButton>\n )}\n </ToastItemRoot>\n );\n}\n\nexport function ToastManager({ toasts, onDismiss, placement = \"bottom-center\", className }: ToastManagerProps) {\n if (toasts.length === 0) return null;\n\n const stack = (\n // Portaled to <body> so the fixed, z-[9999] stack escapes any ancestor\n // stacking context (a transformed/opacity/filtered parent would otherwise\n // trap it and let page content paint over the toasts). BfrsPortalScope\n // re-applies the .bfrs token scope at the portal root.\n <BfrsPortalScope>\n <ToastStack ownerState={{ placement }} className={className}>\n {toasts.map((toast) => (\n <ToastItem key={toast.id} toast={toast} onDismiss={onDismiss} />\n ))}\n </ToastStack>\n </BfrsPortalScope>\n );\n\n if (typeof document === \"undefined\") return stack;\n return createPortal(stack, document.body);\n}\n\nexport function ToastProvider({ children, placement = \"bottom-center\", maxToasts = 4, defaultDuration = 2600, className }: ToastProviderProps) {\n const [toasts, setToasts] = useState<ToastRecord[]>([]);\n const idCounterRef = useRef(0);\n\n const dismiss = useCallback((id: string) => {\n setToasts((current) => current.filter((toast) => toast.id !== id));\n }, []);\n\n const clear = useCallback(() => {\n setToasts([]);\n }, []);\n\n const toast = useCallback(\n (input: ToastInput) => {\n const normalized = normalizeToast(input, defaultDuration);\n const id = normalized.id ?? `toast-${Date.now()}-${idCounterRef.current++}`;\n const nextToast: ToastRecord = { ...normalized, id };\n\n setToasts((current) => [...current.filter((item) => item.id !== id), nextToast].slice(-maxToasts));\n return id;\n },\n [defaultDuration, maxToasts]\n );\n\n const success = useCallback((input: string | Omit<Extract<ToastInput, object>, \"tone\">) => toast(withTone(\"success\", input)), [toast]);\n const warning = useCallback((input: string | Omit<Extract<ToastInput, object>, \"tone\">) => toast(withTone(\"warning\", input)), [toast]);\n const danger = useCallback((input: string | Omit<Extract<ToastInput, object>, \"tone\">) => toast(withTone(\"danger\", input)), [toast]);\n const info = useCallback((input: string | Omit<Extract<ToastInput, object>, \"tone\">) => toast(withTone(\"info\", input)), [toast]);\n\n const contextValue = useMemo<ToastContextValue>(\n () => ({ toasts, toast, success, warning, danger, info, dismiss, clear }),\n [clear, danger, dismiss, info, success, toast, toasts, warning]\n );\n\n return (\n <ToastContext.Provider value={contextValue}>\n {children}\n <ToastManager toasts={toasts} onDismiss={dismiss} placement={placement} className={className} />\n </ToastContext.Provider>\n );\n}\n"],"names":["toastPlacementStyles","twTransform","borderL","token","toastToneBorderStyles","bgTone","toastToneIconStyles","ToastIconBubble","propName","ownerState","ToastItemRoot","kfContentIn","ToastContent","ToastTitle","ToastDescription","ToastAction","ToastDismissButton","twRing","ToastStack","toneIconGlyph","normalizeToast","input","defaultDuration","withTone","tone","DefaultToastIcon","jsx","warningSurfaceStyle","WarningAlertIcon","ToastItem","toast","onDismiss","useEffect","timeout","role","jsxs","X","ToastManager","toasts","placement","className","stack","BfrsPortalScope","createPortal","ToastProvider","children","maxToasts","setToasts","useState","idCounterRef","useRef","dismiss","useCallback","id","current","clear","normalized","nextToast","item","success","warning","danger","info","contextValue","useMemo","ToastContext"],"mappings":";;;;;;;;;AAaA,MAAMA,IAA0D;AAAA,EAC9D,YAAY,EAAE,MAAM,QAAQ,KAAK,QAAQ,YAAY,aAAA;AAAA,EACrD,cAAc,EAAE,MAAM,OAAO,KAAK,QAAQ,GAAGC,EAAY,EAAE,oBAAoB,OAAA,CAAQ,GAAG,YAAY,SAAA;AAAA,EACtG,aAAa,EAAE,OAAO,QAAQ,KAAK,QAAQ,YAAY,WAAA;AAAA,EACvD,eAAe,EAAE,QAAQ,QAAQ,MAAM,QAAQ,YAAY,aAAA;AAAA,EAC3D,iBAAiB,EAAE,QAAQ,WAAW,MAAM,OAAO,GAAGA,EAAY,EAAE,oBAAoB,OAAA,CAAQ,GAAG,YAAY,SAAA;AAAA,EAC/G,gBAAgB,EAAE,QAAQ,QAAQ,OAAO,QAAQ,YAAY,WAAA;AAC/D,GAEMC,IAAU,CAACC,OAA8B;AAAA,EAC7C,uBAAuB;AAAA,EACvB,iBAAiB,wBAAwBA,CAAK;AAChD,IAEMC,IAAsD;AAAA,EAC1D,SAASF,EAAQ,SAAS;AAAA,EAC1B,SAASA,EAAQ,SAAS;AAAA,EAC1B,SAAS,CAAA;AAAA,EACT,QAAQA,EAAQ,QAAQ;AAAA,EACxB,MAAMA,EAAQ,MAAM;AACtB,GAEMG,IAAS,CAACF,OAA8B;AAAA,EAC5C,mBAAmB;AAAA,EACnB,iBAAiB,wBAAwBA,CAAK;AAChD,IAEMG,IAAoD;AAAA,EACxD,SAASD,EAAO,SAAS;AAAA,EACzB,SAASA,EAAO,SAAS;AAAA,EACzB,SAAS,CAAA;AAAA,EACT,QAAQA,EAAO,QAAQ;AAAA,EACvB,MAAMA,EAAO,MAAM;AACrB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AK,CAAC,GAAG,CAACS,CAAK,CAAC,GAEzHiC,IAAeC;AAAA,IACnB,OAAO,EAAE,QAAA1B,GAAQ,OAAAR,GAAO,SAAA6B,GAAS,SAAAC,GAAS,QAAAC,GAAQ,MAAAC,GAAM,SAAAX,GAAS,OAAAI;IACjE,CAACA,GAAOM,GAAQV,GAASW,GAAMH,GAAS7B,GAAOQ,GAAQsB,CAAO;AAAA,EAAA;AAGhE,SACE,gBAAAzB,EAAC8B,EAAa,UAAb,EAAsB,OAAOF,GAC3B,UAAA;AAAA,IAAAlB;AAAA,sBACAR,IAAA,EAAa,QAAAC,GAAgB,WAAWa,GAAS,WAAAZ,GAAsB,WAAAC,EAAA,CAAsB;AAAA,EAAA,GAChG;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"Toast.js","sources":["../../../../src/components/feedback/Toast/Toast.tsx"],"sourcesContent":["import { X } from \"@phosphor-icons/react\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport styled from \"@emotion/styled\";\nimport type { CSSObject } from \"@emotion/react\";\nimport { kfContentIn, twRing, twTransform } from \"@/lib/emotionTw\";\nimport { BfrsPortalScope } from \"@/components/ui/providers/BfrsProvider\";\nimport { WarningAlertIcon, warningSurfaceStyle, warningToastSurfaceStyle } from \"@/components/ui/feedback/warningVisual\";\nimport { ToastContext } from \"./Toast.context\";\nimport type { ToastContextValue, ToastInput, ToastManagerProps, ToastPlacement, ToastProviderProps, ToastRecord, ToastTone } from \"./Toast.types\";\n\n/* Exact compiled output of the pre-migration Tailwind utilities. */\n\nconst toastPlacementStyles: Record<ToastPlacement, CSSObject> = {\n \"top-left\": { left: \"1rem\", top: \"1rem\", alignItems: \"flex-start\" },\n \"top-center\": { left: \"50%\", top: \"1rem\", ...twTransform({ \"--tw-translate-x\": \"-50%\" }), alignItems: \"center\" },\n \"top-right\": { right: \"1rem\", top: \"1rem\", alignItems: \"flex-end\" },\n \"bottom-left\": { bottom: \"1rem\", left: \"1rem\", alignItems: \"flex-start\" },\n \"bottom-center\": { bottom: \"1.25rem\", left: \"50%\", ...twTransform({ \"--tw-translate-x\": \"-50%\" }), alignItems: \"center\" },\n \"bottom-right\": { bottom: \"1rem\", right: \"1rem\", alignItems: \"flex-end\" }\n};\n\nconst borderL = (token: string): CSSObject => ({\n \"--tw-border-opacity\": \"1\",\n borderLeftColor: `hsl(var(--bfrs-color-${token}) / var(--tw-border-opacity, 1))`\n});\n\nconst toastToneBorderStyles: Record<ToastTone, CSSObject> = {\n neutral: borderL(\"primary\"),\n success: borderL(\"success\"),\n warning: {},\n danger: borderL(\"danger\"),\n info: borderL(\"info\")\n};\n\nconst bgTone = (token: string): CSSObject => ({\n \"--tw-bg-opacity\": \"1\",\n backgroundColor: `hsl(var(--bfrs-color-${token}) / var(--tw-bg-opacity, 1))`\n});\n\nconst toastToneIconStyles: Record<ToastTone, CSSObject> = {\n neutral: bgTone(\"primary\"),\n success: bgTone(\"success\"),\n warning: {},\n danger: bgTone(\"danger\"),\n info: bgTone(\"info\")\n};\n\nconst ToastIconBubble = /*#__PURE__*/ styled(\"span\", {\n label: \"AgenticToast-iconBubble\",\n shouldForwardProp: (propName) => propName !== \"ownerState\"\n})<{ ownerState: { tone: ToastTone; plain?: boolean } }>(({ ownerState }) => [\n {\n display: \"flex\",\n width: \"1.25rem\",\n height: \"1.25rem\",\n flexShrink: 0,\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"var(--bfrs-radius-pill)\"\n },\n !ownerState.plain && {\n fontSize: \"12px\",\n fontWeight: 700,\n lineHeight: 1,\n \"--tw-text-opacity\": \"1\",\n color: \"rgb(255 255 255 / var(--tw-text-opacity, 1))\"\n },\n !ownerState.plain && toastToneIconStyles[ownerState.tone]\n]);\n\nconst ToastItemRoot = /*#__PURE__*/ styled(\"div\", {\n label: \"AgenticToast-item\",\n shouldForwardProp: (propName) => propName !== \"ownerState\"\n})<{ ownerState: { tone: ToastTone } }>(({ ownerState }) => [\n {\n pointerEvents: \"auto\",\n display: \"flex\",\n width: \"100%\",\n minWidth: \"300px\",\n maxWidth: \"400px\",\n alignItems: \"flex-start\",\n gap: \".625rem\",\n borderRadius: \"10px\",\n borderWidth: \"1px\",\n borderLeftWidth: \"3px\",\n \"--tw-border-opacity\": \"1\",\n borderColor: \"hsl(var(--bfrs-color-border) / var(--tw-border-opacity, 1))\",\n \"--tw-bg-opacity\": \"1\",\n backgroundColor: \"hsl(var(--bfrs-color-surface-card) / var(--tw-bg-opacity, 1))\",\n paddingLeft: \"14px\",\n paddingRight: \"14px\",\n paddingTop: \".75rem\",\n paddingBottom: \".75rem\",\n fontSize: \".875rem\",\n lineHeight: \"1.25rem\",\n \"--tw-text-opacity\": \"1\",\n color: \"hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))\",\n \"--tw-shadow\": \"var(--bfrs-shadow-elevated)\",\n \"--tw-shadow-colored\": \"var(--bfrs-shadow-elevated)\",\n boxShadow: \"var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)\",\n outline: \"2px solid transparent\",\n outlineOffset: \"2px\",\n ...kfContentIn,\n animation: \"bfrs-bfrs-content-in var(--bfrs-motion-normal) var(--bfrs-ease-out)\"\n },\n toastToneBorderStyles[ownerState.tone]\n]);\n\nconst ToastContent = /*#__PURE__*/ styled(\"div\", {\n label: \"AgenticToast-content\"\n})({\n minWidth: \"0px\",\n flex: \"1 1 0%\"\n});\n\nconst ToastTitle = /*#__PURE__*/ styled(\"div\", {\n label: \"AgenticToast-title\"\n})({\n fontSize: \"13px\",\n fontWeight: 600,\n lineHeight: \"1.25rem\",\n \"--tw-text-opacity\": \"1\",\n color: \"hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))\"\n});\n\nconst ToastDescription = /*#__PURE__*/ styled(\"div\", {\n label: \"AgenticToast-description\"\n})({\n marginTop: \".125rem\",\n fontSize: \".75rem\",\n lineHeight: \"1.25rem\",\n \"--tw-text-opacity\": \"1\",\n color: \"hsl(var(--bfrs-color-text-secondary) / var(--tw-text-opacity, 1))\"\n});\n\nconst ToastAction = /*#__PURE__*/ styled(\"div\", {\n label: \"AgenticToast-action\"\n})({\n marginLeft: \".25rem\",\n flexShrink: 0\n});\n\nconst ToastDismissButton = /*#__PURE__*/ styled(\"button\", {\n label: \"AgenticToast-dismissButton\"\n})({\n marginRight: \"-.25rem\",\n display: \"flex\",\n width: \"1.5rem\",\n height: \"1.5rem\",\n flexShrink: 0,\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"var(--bfrs-radius-md)\",\n \"--tw-text-opacity\": \"1\",\n color: \"hsl(var(--bfrs-color-text-secondary) / var(--tw-text-opacity, 1))\",\n outline: \"2px solid transparent\",\n outlineOffset: \"2px\",\n transitionProperty:\n \"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter\",\n transitionTimingFunction: \"cubic-bezier(.4,0,.2,1)\",\n transitionDuration: \".15s\",\n \"&:hover\": {\n \"--tw-bg-opacity\": \"1\",\n backgroundColor: \"hsl(var(--bfrs-color-surface-muted) / var(--tw-bg-opacity, 1))\",\n \"--tw-text-opacity\": \"1\",\n color: \"hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))\"\n },\n \"&:focus-visible\": twRing(\"2px\", \"hsl(var(--bfrs-color-border-focus) / .5)\")\n});\n\nconst ToastStack = /*#__PURE__*/ styled(\"div\", {\n label: \"AgenticToast-stack\",\n shouldForwardProp: (propName) => propName !== \"ownerState\"\n})<{ ownerState: { placement: ToastPlacement } }>(({ ownerState }) => [\n {\n pointerEvents: \"none\",\n position: \"fixed\",\n zIndex: 2147483646,\n display: \"flex\",\n width: \"calc(100vw - 2rem)\",\n maxWidth: \"400px\",\n flexDirection: \"column\",\n gap: \".625rem\"\n },\n toastPlacementStyles[ownerState.placement]\n]);\n\nconst toneIconGlyph: Record<ToastTone, string> = {\n neutral: \"i\",\n success: \"✓\",\n warning: \"\",\n danger: \"!\",\n info: \"i\"\n};\n\nfunction normalizeToast(input: ToastInput, defaultDuration: number): Omit<ToastRecord, \"id\"> & { id?: string } {\n if (typeof input === \"string\") {\n return {\n title: input,\n tone: \"neutral\",\n duration: defaultDuration,\n dismissible: true\n };\n }\n\n return {\n tone: \"neutral\",\n duration: defaultDuration,\n dismissible: true,\n ...input\n };\n}\n\nfunction withTone(tone: ToastTone, input: string | Omit<Extract<ToastInput, object>, \"tone\">): ToastInput {\n return typeof input === \"string\" ? { title: input, tone } : { ...input, tone };\n}\n\nfunction DefaultToastIcon({ tone }: { tone: ToastTone }) {\n if (tone === \"warning\") {\n return (\n <ToastIconBubble ownerState={{ tone, plain: true }} style={warningSurfaceStyle} aria-hidden=\"true\">\n <WarningAlertIcon />\n </ToastIconBubble>\n );\n }\n\n return (\n <ToastIconBubble ownerState={{ tone }} aria-hidden=\"true\">\n {toneIconGlyph[tone]}\n </ToastIconBubble>\n );\n}\n\nfunction ToastItem({ toast, onDismiss }: { toast: ToastRecord; onDismiss: (id: string) => void }) {\n useEffect(() => {\n if (toast.duration <= 0 || !Number.isFinite(toast.duration)) return undefined;\n\n const timeout = window.setTimeout(() => onDismiss(toast.id), toast.duration);\n return () => window.clearTimeout(timeout);\n }, [onDismiss, toast.duration, toast.id]);\n\n const role = toast.tone === \"danger\" ? \"alert\" : \"status\";\n\n return (\n <ToastItemRoot\n role={role}\n aria-live={role === \"alert\" ? \"assertive\" : \"polite\"}\n ownerState={{ tone: toast.tone }}\n className={toast.className}\n style={toast.tone === \"warning\" ? warningToastSurfaceStyle : undefined}\n >\n {toast.icon ?? <DefaultToastIcon tone={toast.tone} />}\n <ToastContent>\n <ToastTitle>{toast.title}</ToastTitle>\n {toast.description && <ToastDescription>{toast.description}</ToastDescription>}\n </ToastContent>\n {toast.action && <ToastAction>{toast.action}</ToastAction>}\n {toast.dismissible && (\n <ToastDismissButton type=\"button\" onClick={() => onDismiss(toast.id)} aria-label=\"Dismiss notification\">\n <X size={13} weight=\"bold\" />\n </ToastDismissButton>\n )}\n </ToastItemRoot>\n );\n}\n\nexport function ToastManager({ toasts, onDismiss, placement = \"bottom-center\", className }: ToastManagerProps) {\n if (toasts.length === 0) return null;\n\n const stack = (\n // Portaled to <body> so the fixed, z-[9999] stack escapes any ancestor\n // stacking context (a transformed/opacity/filtered parent would otherwise\n // trap it and let page content paint over the toasts). BfrsPortalScope\n // re-applies the .bfrs token scope at the portal root.\n <BfrsPortalScope>\n <ToastStack ownerState={{ placement }} className={className}>\n {toasts.map((toast) => (\n <ToastItem key={toast.id} toast={toast} onDismiss={onDismiss} />\n ))}\n </ToastStack>\n </BfrsPortalScope>\n );\n\n if (typeof document === \"undefined\") return stack;\n return createPortal(stack, document.body);\n}\n\nexport function ToastProvider({ children, placement = \"bottom-center\", maxToasts = 4, defaultDuration = 2600, className }: ToastProviderProps) {\n const [toasts, setToasts] = useState<ToastRecord[]>([]);\n const idCounterRef = useRef(0);\n\n const dismiss = useCallback((id: string) => {\n setToasts((current) => current.filter((toast) => toast.id !== id));\n }, []);\n\n const clear = useCallback(() => {\n setToasts([]);\n }, []);\n\n const toast = useCallback(\n (input: ToastInput) => {\n const normalized = normalizeToast(input, defaultDuration);\n const id = normalized.id ?? `toast-${Date.now()}-${idCounterRef.current++}`;\n const nextToast: ToastRecord = { ...normalized, id };\n\n setToasts((current) => [...current.filter((item) => item.id !== id), nextToast].slice(-maxToasts));\n return id;\n },\n [defaultDuration, maxToasts]\n );\n\n const success = useCallback((input: string | Omit<Extract<ToastInput, object>, \"tone\">) => toast(withTone(\"success\", input)), [toast]);\n const warning = useCallback((input: string | Omit<Extract<ToastInput, object>, \"tone\">) => toast(withTone(\"warning\", input)), [toast]);\n const danger = useCallback((input: string | Omit<Extract<ToastInput, object>, \"tone\">) => toast(withTone(\"danger\", input)), [toast]);\n const info = useCallback((input: string | Omit<Extract<ToastInput, object>, \"tone\">) => toast(withTone(\"info\", input)), [toast]);\n\n const contextValue = useMemo<ToastContextValue>(\n () => ({ toasts, toast, success, warning, danger, info, dismiss, clear }),\n [clear, danger, dismiss, info, success, toast, toasts, warning]\n );\n\n return (\n <ToastContext.Provider value={contextValue}>\n {children}\n <ToastManager toasts={toasts} onDismiss={dismiss} placement={placement} className={className} />\n </ToastContext.Provider>\n );\n}\n"],"names":["toastPlacementStyles","twTransform","borderL","token","toastToneBorderStyles","bgTone","toastToneIconStyles","ToastIconBubble","propName","ownerState","ToastItemRoot","kfContentIn","ToastContent","ToastTitle","ToastDescription","ToastAction","ToastDismissButton","twRing","ToastStack","toneIconGlyph","normalizeToast","input","defaultDuration","withTone","tone","DefaultToastIcon","jsx","warningSurfaceStyle","WarningAlertIcon","ToastItem","toast","onDismiss","useEffect","timeout","role","jsxs","warningToastSurfaceStyle","X","ToastManager","toasts","placement","className","stack","BfrsPortalScope","createPortal","ToastProvider","children","maxToasts","setToasts","useState","idCounterRef","useRef","dismiss","useCallback","id","current","clear","normalized","nextToast","item","success","warning","danger","info","contextValue","useMemo","ToastContext"],"mappings":";;;;;;;;;AAaA,MAAMA,IAA0D;AAAA,EAC9D,YAAY,EAAE,MAAM,QAAQ,KAAK,QAAQ,YAAY,aAAA;AAAA,EACrD,cAAc,EAAE,MAAM,OAAO,KAAK,QAAQ,GAAGC,EAAY,EAAE,oBAAoB,OAAA,CAAQ,GAAG,YAAY,SAAA;AAAA,EACtG,aAAa,EAAE,OAAO,QAAQ,KAAK,QAAQ,YAAY,WAAA;AAAA,EACvD,eAAe,EAAE,QAAQ,QAAQ,MAAM,QAAQ,YAAY,aAAA;AAAA,EAC3D,iBAAiB,EAAE,QAAQ,WAAW,MAAM,OAAO,GAAGA,EAAY,EAAE,oBAAoB,OAAA,CAAQ,GAAG,YAAY,SAAA;AAAA,EAC/G,gBAAgB,EAAE,QAAQ,QAAQ,OAAO,QAAQ,YAAY,WAAA;AAC/D,GAEMC,IAAU,CAACC,OAA8B;AAAA,EAC7C,uBAAuB;AAAA,EACvB,iBAAiB,wBAAwBA,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AE,MAAM,CAACX,CAAS,CAAC,GAC1FO;AAAA,IACT;AAAA,IACA,CAAChC,GAAiByB,CAAS;AAAA,EAAA,GAGvBa,IAAUP,EAAY,CAAChC,MAA8DS,EAAMP,EAAS,WAAWF,CAAK,CAAC,GAAG,CAACS,CAAK,CAAC,GAC/H+B,IAAUR,EAAY,CAAChC,MAA8DS,EAAMP,EAAS,WAAWF,CAAK,CAAC,GAAG,CAACS,CAAK,CAAC,GAC/HgC,IAAST,EAAY,CAAChC,MAA8DS,EAAMP,EAAS,UAAUF,CAAK,CAAC,GAAG,CAACS,CAAK,CAAC,GAC7HiC,IAAOV,EAAY,CAAChC,MAA8DS,EAAMP,EAAS,QAAQF,CAAK,CAAC,GAAG,CAACS,CAAK,CAAC,GAEzHkC,IAAeC;AAAA,IACnB,OAAO,EAAE,QAAA1B,GAAQ,OAAAT,GAAO,SAAA8B,GAAS,SAAAC,GAAS,QAAAC,GAAQ,MAAAC,GAAM,SAAAX,GAAS,OAAAI;IACjE,CAACA,GAAOM,GAAQV,GAASW,GAAMH,GAAS9B,GAAOS,GAAQsB,CAAO;AAAA,EAAA;AAGhE,SACE,gBAAA1B,EAAC+B,EAAa,UAAb,EAAsB,OAAOF,GAC3B,UAAA;AAAA,IAAAlB;AAAA,sBACAR,IAAA,EAAa,QAAAC,GAAgB,WAAWa,GAAS,WAAAZ,GAAsB,WAAAC,EAAA,CAAsB;AAAA,EAAA,GAChG;AAEJ;"}
|
|
@@ -4,6 +4,7 @@ export declare const warningSurfaceBackground = "rgba(217, 119, 6, 0.08)";
|
|
|
4
4
|
export declare const warningSurfaceBorder = "1px solid rgba(217, 119, 6, 0.2)";
|
|
5
5
|
export declare const warningSurfaceBorderColor = "rgba(217, 119, 6, 0.2)";
|
|
6
6
|
export declare const warningSurfaceStyle: CSSProperties;
|
|
7
|
+
export declare const warningToastSurfaceStyle: CSSProperties;
|
|
7
8
|
export declare const warningSurfaceTextStyle: CSSProperties;
|
|
8
9
|
export declare const warningTextStyle: CSSProperties;
|
|
9
10
|
export declare const warningAccentBackgroundStyle: CSSProperties;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
const r = "#D97706",
|
|
3
|
-
backgroundColor:
|
|
4
|
-
border:
|
|
1
|
+
import { jsxs as t, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
const r = "#D97706", o = "rgba(217, 119, 6, 0.08)", e = "1px solid rgba(217, 119, 6, 0.2)", c = "rgba(217, 119, 6, 0.2)", a = {
|
|
3
|
+
backgroundColor: o,
|
|
4
|
+
border: e
|
|
5
|
+
}, g = {
|
|
6
|
+
backgroundImage: `linear-gradient(${o}, ${o})`,
|
|
7
|
+
border: e
|
|
5
8
|
}, l = {
|
|
6
9
|
...a,
|
|
7
10
|
color: r
|
|
@@ -9,28 +12,29 @@ const r = "#D97706", e = "rgba(217, 119, 6, 0.08)", t = "1px solid rgba(217, 119
|
|
|
9
12
|
color: r
|
|
10
13
|
}, d = {
|
|
11
14
|
backgroundColor: r
|
|
12
|
-
}, g = {
|
|
13
|
-
borderColor: r
|
|
14
15
|
}, u = {
|
|
16
|
+
borderColor: r
|
|
17
|
+
}, S = {
|
|
15
18
|
borderColor: c
|
|
16
19
|
};
|
|
17
|
-
function
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
20
|
+
function w() {
|
|
21
|
+
return /* @__PURE__ */ t("svg", { width: "11", height: "11", viewBox: "0 0 16 16", fill: "none", style: { flexShrink: 0 }, children: [
|
|
22
|
+
/* @__PURE__ */ n("path", { d: "M8 1.5l6.5 11.5h-13L8 1.5z", stroke: "#D97706", strokeWidth: "1.4", strokeLinejoin: "round" }),
|
|
23
|
+
/* @__PURE__ */ n("path", { d: "M8 6v3M8 11h.01", stroke: "#D97706", strokeWidth: "1.4", strokeLinecap: "round" })
|
|
21
24
|
] });
|
|
22
25
|
}
|
|
23
26
|
export {
|
|
24
|
-
|
|
27
|
+
w as WarningAlertIcon,
|
|
25
28
|
d as warningAccentBackgroundStyle,
|
|
26
|
-
|
|
29
|
+
u as warningAccentBorderStyle,
|
|
27
30
|
r as warningAccentColor,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
S as warningSoftBorderStyle,
|
|
32
|
+
o as warningSurfaceBackground,
|
|
33
|
+
e as warningSurfaceBorder,
|
|
31
34
|
c as warningSurfaceBorderColor,
|
|
32
35
|
a as warningSurfaceStyle,
|
|
33
36
|
l as warningSurfaceTextStyle,
|
|
34
|
-
s as warningTextStyle
|
|
37
|
+
s as warningTextStyle,
|
|
38
|
+
g as warningToastSurfaceStyle
|
|
35
39
|
};
|
|
36
40
|
//# sourceMappingURL=warningVisual.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warningVisual.js","sources":["../../../../src/components/ui/feedback/warningVisual.tsx"],"sourcesContent":["import type { CSSProperties } from \"react\";\n\nexport const warningAccentColor = \"#D97706\";\nexport const warningSurfaceBackground = \"rgba(217, 119, 6, 0.08)\";\nexport const warningSurfaceBorder = \"1px solid rgba(217, 119, 6, 0.2)\";\nexport const warningSurfaceBorderColor = \"rgba(217, 119, 6, 0.2)\";\n\nexport const warningSurfaceStyle: CSSProperties = {\n backgroundColor: warningSurfaceBackground,\n border: warningSurfaceBorder\n};\n\nexport const warningSurfaceTextStyle: CSSProperties = {\n ...warningSurfaceStyle,\n color: warningAccentColor\n};\n\nexport const warningTextStyle: CSSProperties = {\n color: warningAccentColor\n};\n\nexport const warningAccentBackgroundStyle: CSSProperties = {\n backgroundColor: warningAccentColor\n};\n\nexport const warningAccentBorderStyle: CSSProperties = {\n borderColor: warningAccentColor\n};\n\nexport const warningSoftBorderStyle: CSSProperties = {\n borderColor: warningSurfaceBorderColor\n};\n\nexport function WarningAlertIcon() {\n return (\n <svg width=\"11\" height=\"11\" viewBox=\"0 0 16 16\" fill=\"none\" style={{ flexShrink: 0 }}>\n <path d=\"M8 1.5l6.5 11.5h-13L8 1.5z\" stroke=\"#D97706\" strokeWidth=\"1.4\" strokeLinejoin=\"round\" />\n <path d=\"M8 6v3M8 11h.01\" stroke=\"#D97706\" strokeWidth=\"1.4\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n"],"names":["warningAccentColor","warningSurfaceBackground","warningSurfaceBorder","warningSurfaceBorderColor","warningSurfaceStyle","warningSurfaceTextStyle","warningTextStyle","warningAccentBackgroundStyle","warningAccentBorderStyle","warningSoftBorderStyle","WarningAlertIcon","jsxs","jsx"],"mappings":";AAEO,MAAMA,IAAqB,WACrBC,IAA2B,2BAC3BC,IAAuB,oCACvBC,IAA4B,0BAE5BC,IAAqC;AAAA,EAChD,iBAAiBH;AAAA,EACjB,QAAQC;AACV,
|
|
1
|
+
{"version":3,"file":"warningVisual.js","sources":["../../../../src/components/ui/feedback/warningVisual.tsx"],"sourcesContent":["import type { CSSProperties } from \"react\";\n\nexport const warningAccentColor = \"#D97706\";\nexport const warningSurfaceBackground = \"rgba(217, 119, 6, 0.08)\";\nexport const warningSurfaceBorder = \"1px solid rgba(217, 119, 6, 0.2)\";\nexport const warningSurfaceBorderColor = \"rgba(217, 119, 6, 0.2)\";\n\nexport const warningSurfaceStyle: CSSProperties = {\n backgroundColor: warningSurfaceBackground,\n border: warningSurfaceBorder\n};\n\n// A toast is a FLOATING overlay (portaled to <body>) with nothing opaque behind it — unlike an\n// inline warning surface, which sits over the opaque page. So the warning tint must sit OVER the\n// toast's own opaque surface, not REPLACE it: using `warningSurfaceStyle` (a translucent\n// backgroundColor) on the toast made the whole toast see-through. Apply the tint as a\n// background-image instead, so the toast item's opaque `surface-card` backgroundColor still shows\n// through beneath it.\nexport const warningToastSurfaceStyle: CSSProperties = {\n backgroundImage: `linear-gradient(${warningSurfaceBackground}, ${warningSurfaceBackground})`,\n border: warningSurfaceBorder\n};\n\nexport const warningSurfaceTextStyle: CSSProperties = {\n ...warningSurfaceStyle,\n color: warningAccentColor\n};\n\nexport const warningTextStyle: CSSProperties = {\n color: warningAccentColor\n};\n\nexport const warningAccentBackgroundStyle: CSSProperties = {\n backgroundColor: warningAccentColor\n};\n\nexport const warningAccentBorderStyle: CSSProperties = {\n borderColor: warningAccentColor\n};\n\nexport const warningSoftBorderStyle: CSSProperties = {\n borderColor: warningSurfaceBorderColor\n};\n\nexport function WarningAlertIcon() {\n return (\n <svg width=\"11\" height=\"11\" viewBox=\"0 0 16 16\" fill=\"none\" style={{ flexShrink: 0 }}>\n <path d=\"M8 1.5l6.5 11.5h-13L8 1.5z\" stroke=\"#D97706\" strokeWidth=\"1.4\" strokeLinejoin=\"round\" />\n <path d=\"M8 6v3M8 11h.01\" stroke=\"#D97706\" strokeWidth=\"1.4\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n"],"names":["warningAccentColor","warningSurfaceBackground","warningSurfaceBorder","warningSurfaceBorderColor","warningSurfaceStyle","warningToastSurfaceStyle","warningSurfaceTextStyle","warningTextStyle","warningAccentBackgroundStyle","warningAccentBorderStyle","warningSoftBorderStyle","WarningAlertIcon","jsxs","jsx"],"mappings":";AAEO,MAAMA,IAAqB,WACrBC,IAA2B,2BAC3BC,IAAuB,oCACvBC,IAA4B,0BAE5BC,IAAqC;AAAA,EAChD,iBAAiBH;AAAA,EACjB,QAAQC;AACV,GAQaG,IAA0C;AAAA,EACrD,iBAAiB,mBAAmBJ,CAAwB,KAAKA,CAAwB;AAAA,EACzF,QAAQC;AACV,GAEaI,IAAyC;AAAA,EACpD,GAAGF;AAAA,EACH,OAAOJ;AACT,GAEaO,IAAkC;AAAA,EAC7C,OAAOP;AACT,GAEaQ,IAA8C;AAAA,EACzD,iBAAiBR;AACnB,GAEaS,IAA0C;AAAA,EACrD,aAAaT;AACf,GAEaU,IAAwC;AAAA,EACnD,aAAaP;AACf;AAEO,SAASQ,IAAmB;AACjC,SACE,gBAAAC,EAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,OAAO,EAAE,YAAY,KAC/E,UAAA;AAAA,IAAA,gBAAAC,EAAC,QAAA,EAAK,GAAE,8BAA6B,QAAO,WAAU,aAAY,OAAM,gBAAe,QAAA,CAAQ;AAAA,IAC/F,gBAAAA,EAAC,UAAK,GAAE,mBAAkB,QAAO,WAAU,aAAY,OAAM,eAAc,QAAA,CAAQ;AAAA,EAAA,GACrF;AAEJ;"}
|