@mechane-ai/elements 0.39.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/NOTICE +11 -19
  2. package/README.md +49 -25
  3. package/dist/accessibility-P89UG9-r.js +25 -0
  4. package/dist/agent.js +1 -0
  5. package/dist/ai.js +50 -44
  6. package/dist/{categorical-values-BECG-J6R.js → categorical-values-DnGR_pQx.js} +3 -3
  7. package/dist/{chart-frame-CJFnI39T.js → chart-frame-BsyI1Zc8.js} +58 -57
  8. package/dist/{chart-input-DwAobO8Y.js → chart-input-r4S3-QCT.js} +2 -2
  9. package/dist/chart-navigation-D7OkLdSx.js +119 -0
  10. package/dist/charts/cartesian.js +560 -583
  11. package/dist/charts/distribution.js +218 -218
  12. package/dist/charts/graph.js +86 -85
  13. package/dist/charts/hierarchy.js +4 -4
  14. package/dist/charts/matrix.js +148 -147
  15. package/dist/charts/timeline.js +77 -76
  16. package/dist/charts.js +2 -2
  17. package/dist/code-block-C4K1sM9O.js +255 -0
  18. package/dist/collections.js +828 -607
  19. package/dist/constants.stylex-BILvnwUk.js +84 -0
  20. package/dist/content/code.js +1 -1
  21. package/dist/content/diff.js +3 -3
  22. package/dist/content/link.js +1 -1
  23. package/dist/content/markdown.js +2 -2
  24. package/dist/content/tree.js +184 -77
  25. package/dist/{content-link-B3ObdyZY.js → content-link-CBDqSvgP.js} +1 -1
  26. package/dist/content.js +1 -1
  27. package/dist/control-styles-D3q_Qyxi.js +179 -0
  28. package/dist/csp.js +14 -1
  29. package/dist/feedback.js +1 -1
  30. package/dist/forms/dates.js +359 -245
  31. package/dist/forms-I-WMHTkr.js +139 -0
  32. package/dist/forms.js +3 -3
  33. package/dist/index.js +1 -1
  34. package/dist/layout.js +271 -241
  35. package/dist/navigation/commands.js +87 -76
  36. package/dist/{navigation-D2_sGy3C.js → navigation-CveMIuXI.js} +1 -1
  37. package/dist/navigation.js +2 -2
  38. package/dist/overlays.js +1 -1
  39. package/dist/packages/ai/src/message-action.d.ts +1 -1
  40. package/dist/packages/charts/src/chart-navigation.d.ts +18 -2
  41. package/dist/packages/charts/src/chart-surface.d.ts +23 -0
  42. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +3 -2
  43. package/dist/packages/collections/src/data-table.d.ts +7 -2
  44. package/dist/packages/collections/src/index.d.ts +4 -1
  45. package/dist/packages/collections/src/query-controls.d.ts +18 -0
  46. package/dist/packages/collections/src/table-query.d.ts +64 -0
  47. package/dist/packages/collections/src/use-collection-controls.d.ts +3 -8
  48. package/dist/packages/content/src/pierre-theme.d.ts +0 -1
  49. package/dist/packages/core/src/actions.d.ts +15 -13
  50. package/dist/packages/core/src/copy-value.d.ts +3 -2
  51. package/dist/packages/core/src/disclosure.d.ts +14 -11
  52. package/dist/packages/feedback/src/notifications.d.ts +15 -15
  53. package/dist/packages/feedback/src/toast.d.ts +9 -3
  54. package/dist/packages/forms/src/combobox.d.ts +31 -41
  55. package/dist/packages/forms/src/dates/event-month.d.ts +17 -0
  56. package/dist/packages/forms/src/dates/index.d.ts +2 -0
  57. package/dist/packages/forms/src/field-styles.d.ts +0 -19
  58. package/dist/packages/forms/src/form-controls.d.ts +26 -24
  59. package/dist/packages/forms/src/forms.d.ts +17 -14
  60. package/dist/packages/forms/src/select-control.d.ts +6 -4
  61. package/dist/packages/forms/src/select.d.ts +14 -18
  62. package/dist/packages/forms/src/selection-state.d.ts +11 -0
  63. package/dist/packages/forms/src/selection-styles.d.ts +3 -0
  64. package/dist/packages/forms/src/selection.d.ts +21 -19
  65. package/dist/packages/foundations/src/agent/index.d.ts +2 -0
  66. package/dist/packages/foundations/src/control-state.d.ts +2 -3
  67. package/dist/packages/foundations/src/control-styles.d.ts +19 -0
  68. package/dist/packages/foundations/src/csp/index.d.ts +1 -1
  69. package/dist/packages/foundations/src/csp/provider.d.ts +3 -0
  70. package/dist/packages/foundations/src/style-composition.d.ts +4 -1
  71. package/dist/packages/layout/src/app-shell.d.ts +12 -1
  72. package/dist/packages/layout/src/index.d.ts +1 -1
  73. package/dist/packages/layout/src/navigation-rail.d.ts +15 -2
  74. package/dist/packages/layout/src/resizable.d.ts +2 -2
  75. package/dist/packages/layout/src/sidebar.d.ts +4 -3
  76. package/dist/packages/navigation/src/tab-styles.d.ts +1 -1
  77. package/dist/packages/navigation/src/tabs.d.ts +12 -10
  78. package/dist/packages/overlays/src/alert-dialog.d.ts +19 -13
  79. package/dist/packages/overlays/src/dialog.d.ts +39 -24
  80. package/dist/packages/overlays/src/drawer.d.ts +16 -26
  81. package/dist/packages/overlays/src/menu.d.ts +37 -44
  82. package/dist/packages/overlays/src/overlay-root.d.ts +10 -0
  83. package/dist/packages/overlays/src/popover.d.ts +11 -20
  84. package/dist/packages/overlays/src/preview.d.ts +6 -13
  85. package/dist/packages/overlays/src/tooltip.d.ts +12 -15
  86. package/dist/{pierre-diff-CaPsfQRo.js → pierre-diff-DJ3oOfPX.js} +5 -5
  87. package/dist/{src-DPRmO-JY.js → src-CNV1ewzb.js} +379 -407
  88. package/dist/{src-CSWIG_op.js → src-CQQvXi7a.js} +58 -81
  89. package/dist/{src-DWjAoOyd.js → src-D2OHco8V.js} +42 -41
  90. package/dist/src-DfOAlAd2.js +750 -0
  91. package/dist/src-na2DdkKI.js +561 -0
  92. package/dist/{src-C-Sx37kz.js → src-s3tWwnN4.js} +361 -518
  93. package/dist/styles.js +3 -0
  94. package/dist/{elements.css → styles2.css} +195 -97
  95. package/dist/tokens.js +3 -1
  96. package/dist/{tokens.stylex-CJbIDPB9.js → tokens.stylex-dF5CACEJ.js} +13 -93
  97. package/package.json +8 -9
  98. package/skills/elements-workspace/SKILL.md +12 -0
  99. package/dist/accessibility-C-aIZ1Yx.js +0 -15
  100. package/dist/chart-navigation-CBIeNtJq.js +0 -67
  101. package/dist/code-block-aC0Htt4N.js +0 -184
  102. package/dist/forms-BQQFas9g.js +0 -118
  103. package/dist/foundations.css +0 -7
  104. package/dist/packages/content/src/tree/pierre-tree.d.ts +0 -3
  105. package/dist/pierre-theme-BpNaWn1x.js +0 -126
  106. package/dist/pierre-tree-CYCRjdGG.js +0 -106
  107. package/dist/src-d7EAi61b.js +0 -617
  108. package/dist/src-nkgFDl-g.js +0 -1171
  109. package/dist/style-composition-uYlczSsB.js +0 -9
  110. package/styles.css +0 -2
@@ -0,0 +1,750 @@
1
+ import { i as e, s as t } from "./src-s3tWwnN4.js";
2
+ import { a as n, n as r, r as i, t as a } from "./control-styles-D3q_Qyxi.js";
3
+ import { i as o, n as s, r as c } from "./tokens.stylex-dF5CACEJ.js";
4
+ import { t as l } from "./accessibility-P89UG9-r.js";
5
+ import { c as u } from "./constants.stylex-BILvnwUk.js";
6
+ import * as d from "@stylexjs/stylex";
7
+ import { mergeProps as f } from "@ui-sdk/react/primitive";
8
+ import { createContext as p, useContext as m, useEffect as h, useRef as g, useState as _ } from "react";
9
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
10
+ import { Box as ee, CircleCheck as x, CircleX as te, Info as S, LoaderCircle as C, TriangleAlert as ne, X as w } from "lucide-react";
11
+ import { Meter as T, MeterIndicator as E, MeterLabel as re, MeterTrack as ie } from "@ui-sdk/react/meter";
12
+ import { Progress as ae, ProgressIndicator as oe, ProgressLabel as se, ProgressTrack as ce } from "@ui-sdk/react/progress";
13
+ import { Toast as le, ToastAction as ue, ToastClose as de, ToastDescription as D, ToastRegion as O, ToastTitle as k, createToaster as A } from "@ui-sdk/react/toast";
14
+ // packages/feedback/src/feedback.tsx
15
+ function j({ title: n, children: r, action: i, ...a }) {
16
+ return /* @__PURE__ */ b("div", {
17
+ ...f({ className: "x78zum5 xdt5ytf x6s0dn4 xl56j7k x2b8uid xeuugli x193iq5w x9f619 x9w77qv xnx3t7k x1n8ia3y x1hz01jw xj57cvi xvmahel xj0a0fe" }, a),
18
+ children: [
19
+ /* @__PURE__ */ y(ee, {
20
+ size: 22,
21
+ "aria-hidden": !0,
22
+ className: "x153jb6y x2lah0s"
23
+ }),
24
+ /* @__PURE__ */ y(t, { children: n }),
25
+ r != null && /* @__PURE__ */ y(e, { children: r }),
26
+ i != null && /* @__PURE__ */ y("div", {
27
+ className: "x78zum5 xl56j7k x1a02dak x1hnptsi xeuugli x193iq5w",
28
+ children: i
29
+ })
30
+ ]
31
+ });
32
+ }
33
+ function M({ hasError: e = !1, ...t }) {
34
+ return /* @__PURE__ */ y("div", { ...f({ role: e ? "alert" : "status" }, {
35
+ 0: { className: "xeuugli x193iq5w x9f619 x1qokhjc x1doqdfy x1ok0vyi x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi x1dqe72f x1f9ixgr xj0a0fe" },
36
+ 1: { className: "xeuugli x193iq5w x9f619 x1qokhjc x1doqdfy x1ok0vyi x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi xj0a0fe xr5kp14 xcqwzn" }
37
+ }[!!e | 0], t) });
38
+ }
39
+ // packages/feedback/src/skeleton.tsx
40
+ var N = {
41
+ skeleton: {
42
+ k1xSpc: "x1lliihq",
43
+ ks0D6T: "x193iq5w",
44
+ kWkggS: "x1fa40ue",
45
+ kaIpWk: "x1ok0vyi",
46
+ kmuXW: "x2lah0s",
47
+ $$css: !0
48
+ },
49
+ dimensions: (e, t) => [{
50
+ kzqmXN: e == null ? e : "x5lhr3w",
51
+ kZKoxP: t == null ? t : "x16ye13r",
52
+ $$css: !0
53
+ }, {
54
+ "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
55
+ "--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
56
+ }],
57
+ width: (e) => [{
58
+ kzqmXN: e == null ? e : "x5lhr3w",
59
+ $$css: !0
60
+ }, { "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }],
61
+ circle: {
62
+ kaIpWk: "x16rqkct",
63
+ $$css: !0
64
+ },
65
+ rectangle: { $$css: !0 },
66
+ text: {
67
+ k1xSpc: "x3nfvp2",
68
+ kXwgrk: "xdt5ytf",
69
+ k7Eaqz: "xeuugli",
70
+ ks0D6T: "x193iq5w",
71
+ kXLuUW: "x16dsc37",
72
+ $$css: !0
73
+ },
74
+ label: {
75
+ k7Eaqz: "xeuugli",
76
+ $$css: !0
77
+ }
78
+ }, P = {
79
+ rectangle: N.rectangle,
80
+ circle: N.circle
81
+ };
82
+ function F({ width: e = "100%", height: t = 8, shape: n = "rectangle" }) {
83
+ return /* @__PURE__ */ y("span", {
84
+ "aria-hidden": !0,
85
+ ...d.props(N.skeleton, N.dimensions(e, t), P[n])
86
+ });
87
+ }
88
+ function I({ lines: e = 1, width: t = "100%" }) {
89
+ return /* @__PURE__ */ y("span", {
90
+ "aria-hidden": !0,
91
+ ...d.props(N.text, N.width(t)),
92
+ children: Array.from({ length: e }, (t, n) => /* @__PURE__ */ y("span", {
93
+ className: "x78zum5 x6s0dn4 xg2ss61",
94
+ children: /* @__PURE__ */ y(F, {
95
+ width: e > 1 && n === e - 1 ? "65%" : "100%",
96
+ height: "0.6em"
97
+ })
98
+ }, `placeholder-${n}`))
99
+ });
100
+ }
101
+ function L({ label: e, showLabel: t = !1 }) {
102
+ return /* @__PURE__ */ b("span", {
103
+ role: "status",
104
+ className: "x3nfvp2 x1n2onr6 x6s0dn4 xeuugli x193iq5w x1hnptsi x153jb6y x1hz01jw xtqrqnz x1778rvt xj57cvi xj0a0fe",
105
+ children: [/* @__PURE__ */ y(C, {
106
+ "aria-hidden": !0,
107
+ className: "xtwnzbg x18utl2x x2lah0s"
108
+ }), /* @__PURE__ */ y("span", {
109
+ ...d.props(N.label, !t && l.hidden),
110
+ children: e
111
+ })]
112
+ });
113
+ }
114
+ // packages/feedback/src/control-placeholders.tsx
115
+ var R = {
116
+ ks0D6T: "x193iq5w",
117
+ $$css: !0
118
+ }, z = {
119
+ kZKoxP: "x16ye13r",
120
+ $$css: !0
121
+ }, B = {
122
+ button: {
123
+ kWkggS: "x1r7kqkb",
124
+ kXLuUW: "xxymvpz",
125
+ $$css: !0
126
+ },
127
+ singleLine: {
128
+ k1xSpc: "x78zum5",
129
+ kGNEyG: "x6s0dn4",
130
+ $$css: !0
131
+ },
132
+ width: (e) => [
133
+ R,
134
+ {
135
+ kzqmXN: e == null ? e : "x5lhr3w",
136
+ $$css: !0
137
+ },
138
+ { "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }
139
+ ],
140
+ rows: (e) => [z, { "--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(`calc(${e} * 1lh + 2 * ${o.paddingBlock} + 2px)`) }]
141
+ };
142
+ function V({ width: e = "7ch", isIconOnly: t = !1, density: n = "standard", xstyle: s }) {
143
+ return /* @__PURE__ */ y("span", {
144
+ "aria-hidden": !0,
145
+ inert: !0,
146
+ ...d.props(i.base, i.button, r[n], a[n], t && i.iconButton, B.button, s),
147
+ children: t ? /* @__PURE__ */ y(F, {
148
+ width: o.iconSize,
149
+ height: o.iconSize
150
+ }) : /* @__PURE__ */ y(I, { width: e })
151
+ });
152
+ }
153
+ function H({ label: e, hint: t, isMultiline: a = !1, density: o = "standard", rows: s = 4, width: c = "100%", xstyle: l }) {
154
+ let u = a ? Math.min(s, 6) : 1;
155
+ return /* @__PURE__ */ b("div", {
156
+ "aria-hidden": !0,
157
+ ...d.props(i.fieldRoot, B.width(c), l),
158
+ children: [
159
+ e !== void 0 && /* @__PURE__ */ y("span", {
160
+ ...d.props(i.label),
161
+ children: e
162
+ }),
163
+ /* @__PURE__ */ y("div", {
164
+ ...d.props(i.base, i.field, r[o], !a && i.singleLineField, !a && n[o], !a && B.singleLine, a && i.textarea, a && B.rows(s)),
165
+ children: /* @__PURE__ */ y(I, {
166
+ width: "60%",
167
+ lines: u
168
+ })
169
+ }),
170
+ t !== void 0 && /* @__PURE__ */ y("span", {
171
+ ...d.props(i.description),
172
+ children: t
173
+ })
174
+ ]
175
+ });
176
+ }
177
+ // packages/foundations/src/chart-tones.ts
178
+ var U = {
179
+ series1: s.series1,
180
+ series2: s.series2,
181
+ series3: s.series3,
182
+ series4: s.series4,
183
+ series5: s.series5,
184
+ series6: s.series6,
185
+ positive: s.positive,
186
+ negative: s.negative,
187
+ neutral: c.muted
188
+ }, W = {
189
+ root: {
190
+ k1xSpc: "x78zum5",
191
+ kXwgrk: "xdt5ytf",
192
+ kOIVth: "x1hnptsi",
193
+ kzqmXN: "xh8yej3",
194
+ k7Eaqz: "xeuugli",
195
+ kMv6JI: "x1hz01jw",
196
+ kGuDYH: "xtqrqnz",
197
+ kLWn49: "x1778rvt",
198
+ k63SB2: "xj57cvi",
199
+ kMwMTN: "xbixft",
200
+ kHjlTd: "xj0a0fe",
201
+ $$css: !0
202
+ },
203
+ heading: {
204
+ k1xSpc: "x78zum5",
205
+ kGNEyG: "x1pha0wt",
206
+ kjj79g: "x1qughib",
207
+ kOIVth: "x1n8ia3y",
208
+ kwnvtZ: "x1a02dak",
209
+ $$css: !0
210
+ },
211
+ label: {
212
+ k7Eaqz: "xeuugli",
213
+ ks0D6T: "x193iq5w",
214
+ $$css: !0
215
+ },
216
+ value: {
217
+ k7Eaqz: "xeuugli",
218
+ ks0D6T: "x193iq5w",
219
+ kMwMTN: "x153jb6y",
220
+ kcqcaj: "xss6m8b",
221
+ $$css: !0
222
+ },
223
+ track: {
224
+ kZKoxP: "xqu0tyb",
225
+ kzqmXN: "xh8yej3",
226
+ kaIpWk: "x1ok0vyi",
227
+ kWkggS: "x1fa40ue",
228
+ kVQacm: "xb3r6kr",
229
+ $$css: !0
230
+ },
231
+ indicator: {
232
+ kZKoxP: "x5yr21d",
233
+ kWkggS: "x1pt885t",
234
+ kaIpWk: "x1ok0vyi",
235
+ $$css: !0
236
+ },
237
+ inline: {
238
+ kXwgrk: "x1q0g3np",
239
+ kGNEyG: "x6s0dn4",
240
+ kjj79g: "x13a6bvl",
241
+ kwnvtZ: "x1a02dak",
242
+ $$css: !0
243
+ },
244
+ inlineHeading: {
245
+ k1xSpc: "xjp7ctv",
246
+ $$css: !0
247
+ },
248
+ inlineValue: {
249
+ kMwMTN: "xbixft",
250
+ $$css: !0
251
+ },
252
+ inlineTrack: {
253
+ kzqmXN: "x1useyqa x1251vi3",
254
+ kmuXW: "x2lah0s",
255
+ $$css: !0
256
+ },
257
+ tone: (e) => [{
258
+ kWkggS: e == null ? e : "xl8spv7",
259
+ $$css: !0
260
+ }, { "--x-backgroundColor": e ?? void 0 }],
261
+ unknown: {
262
+ kWkggS: "x1r7kqkb",
263
+ kMzoRj: "xmkeg23",
264
+ ksu8eU: "xbsl7fq",
265
+ kVAM5u: "xqrc7c3",
266
+ kB7OPa: "x9f619",
267
+ $$css: !0
268
+ }
269
+ }, fe = {
270
+ stacked: {
271
+ root: void 0,
272
+ heading: void 0,
273
+ label: void 0,
274
+ value: void 0,
275
+ track: void 0
276
+ },
277
+ inline: {
278
+ root: W.inline,
279
+ heading: W.inlineHeading,
280
+ label: l.hidden,
281
+ value: W.inlineValue,
282
+ track: W.inlineTrack
283
+ }
284
+ };
285
+ function pe({ label: e, value: t, max: n, valueLabel: r }) {
286
+ return /* @__PURE__ */ b(ae, {
287
+ value: t,
288
+ max: n,
289
+ locale: "en-US",
290
+ getValueLabel: () => r,
291
+ className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft xj0a0fe",
292
+ children: [/* @__PURE__ */ b("div", {
293
+ className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
294
+ children: [/* @__PURE__ */ y(se, {
295
+ className: "xeuugli x193iq5w",
296
+ children: e
297
+ }), /* @__PURE__ */ y("span", {
298
+ className: "xeuugli x193iq5w x153jb6y xss6m8b",
299
+ children: r
300
+ })]
301
+ }), /* @__PURE__ */ y(ce, {
302
+ ...{
303
+ 0: { className: "xqu0tyb xh8yej3 x1ok0vyi x1fa40ue xb3r6kr" },
304
+ 1: { className: "xqu0tyb xh8yej3 x1ok0vyi xb3r6kr x1r7kqkb xmkeg23 xbsl7fq xqrc7c3 x9f619" }
305
+ }[t === null | 0],
306
+ children: t !== null && /* @__PURE__ */ y(oe, { className: "x5yr21d x1pt885t x1ok0vyi" })
307
+ })]
308
+ });
309
+ }
310
+ function me({ label: e, value: t, max: n, valueLabel: r, layout: i = "stacked", tone: a }) {
311
+ let o = fe[i], s = a === void 0 ? void 0 : W.tone(U[a]), c = t !== null && Number.isFinite(t);
312
+ return Number.isFinite(n) && n > 0 && c && t >= 0 && t <= n ? /* @__PURE__ */ b(T, {
313
+ value: t,
314
+ max: n,
315
+ locale: "en-US",
316
+ getValueLabel: () => r,
317
+ ...d.props(W.root, o.root),
318
+ children: [/* @__PURE__ */ b("div", {
319
+ ...d.props(W.heading, o.heading),
320
+ children: [/* @__PURE__ */ y(re, {
321
+ ...d.props(W.label, o.label),
322
+ children: e
323
+ }), /* @__PURE__ */ y("span", {
324
+ ...d.props(W.value, o.value),
325
+ children: r
326
+ })]
327
+ }), /* @__PURE__ */ y(ie, {
328
+ ...d.props(W.track, o.track),
329
+ children: /* @__PURE__ */ y(E, { ...d.props(W.indicator, s) })
330
+ })]
331
+ }) : /* @__PURE__ */ b("div", {
332
+ ...d.props(W.root, o.root),
333
+ children: [/* @__PURE__ */ b("div", {
334
+ ...d.props(W.heading, o.heading),
335
+ children: [/* @__PURE__ */ y("span", {
336
+ ...d.props(W.label, o.label),
337
+ children: e
338
+ }), /* @__PURE__ */ y("span", {
339
+ ...d.props(W.value, o.value),
340
+ children: r
341
+ })]
342
+ }), /* @__PURE__ */ y("div", {
343
+ "aria-hidden": !0,
344
+ ...d.props(W.track, o.track, W.unknown)
345
+ })]
346
+ });
347
+ }
348
+ // packages/feedback/src/notifications.ts
349
+ var he = 1e3, ge = 4;
350
+ function _e() {
351
+ let e = A(), t = /* @__PURE__ */ new Map();
352
+ function n(n) {
353
+ if (n === void 0) return e;
354
+ let r = t.get(n);
355
+ if (r !== void 0) return r;
356
+ let i = A();
357
+ return typeof document < "u" && t.set(n, i), i;
358
+ }
359
+ function r(e, n) {
360
+ if (e !== void 0) return t.set(e, n), () => {
361
+ t.get(e) === n && t.delete(e);
362
+ };
363
+ }
364
+ function i(n) {
365
+ e.dismiss(n);
366
+ for (let e of t.values()) e.dismiss(n);
367
+ }
368
+ return {
369
+ queueFor: n,
370
+ bind: r,
371
+ dismiss: i
372
+ };
373
+ }
374
+ var G = _e();
375
+ function K(e) {
376
+ return typeof e == "number" ? `#${e}` : e.replace(/^#/, "##");
377
+ }
378
+ function q(e, { id: t, toasterId: n, title: r, description: i, action: a, shouldPersist: o }) {
379
+ let s = G.queueFor(n)({
380
+ ...t !== void 0 && { id: K(t) },
381
+ type: e,
382
+ title: r,
383
+ description: i,
384
+ action: {
385
+ label: a?.label,
386
+ dismiss: a?.shouldDismiss ?? !0,
387
+ ...a !== void 0 && { onAction: a.onClick }
388
+ },
389
+ duration: o === !0 || a !== void 0 || e === "loading" ? Infinity : ge * he
390
+ });
391
+ return t ?? s;
392
+ }
393
+ var ve = {
394
+ success: (e) => q("success", e),
395
+ error: (e) => q("error", e),
396
+ info: (e) => q("info", e),
397
+ warning: (e) => q("warning", e),
398
+ loading: (e) => q("loading", e),
399
+ dismiss: ({ id: e }) => G.dismiss(K(e))
400
+ }, J = {
401
+ region: {
402
+ kzqmXN: "x1261nif xqu3jwc",
403
+ kqGvvJ: "xtru72a xf6ji1w",
404
+ k85nHk: "xqv9vo9 xyt9zns",
405
+ kZKoxP: "x1u22o8f",
406
+ kY2c9j: "xviucbn",
407
+ kTrA0T: "x1572sgj",
408
+ $$css: !0
409
+ },
410
+ toast: {
411
+ kVAEAm: "x10l6tqk",
412
+ kB7OPa: "x9f619",
413
+ kkqhue: "x17y0mx6",
414
+ kVQacm: "xb3r6kr",
415
+ kY2c9j: "xzsjmec",
416
+ kZKoxP: "x13dl79w",
417
+ k1ekBW: "x6o7n8i",
418
+ kAMwcw: "x1faw7qm",
419
+ kIyJzY: "xtitasy xsn8rav",
420
+ kZpE1: "xvrnp6u",
421
+ krwDK1: "xm69ghq",
422
+ kdD3Bq: "x1i2unn7",
423
+ k1xSpc: "x78zum5",
424
+ kwnvtZ: "x1a02dak",
425
+ kGNEyG: "x6s0dn4",
426
+ kOIVth: "x1hnptsi",
427
+ kmVPX3: "x1mvvolr",
428
+ k7c18f: "x1iav3hx xwuqwch",
429
+ kMzoRj: "xmkeg23",
430
+ ksu8eU: "x1y0btm7",
431
+ kVAM5u: "x1ey3b81",
432
+ kaIpWk: "xy32g2j",
433
+ kWkggS: "xpvm0e4",
434
+ kMwMTN: "xbixft",
435
+ kGVxlE: "x1ghndwu",
436
+ kMv6JI: "x1hz01jw",
437
+ khiITx: "xvmahel",
438
+ kGuDYH: "xtqrqnz",
439
+ kLWn49: "x1778rvt",
440
+ k63SB2: "xj57cvi",
441
+ $$css: !0
442
+ },
443
+ top: {
444
+ k87sOh: "x13vifvy",
445
+ k3aq6I: "x194eoxy",
446
+ kBPcrh: "xq1g0ua",
447
+ $$css: !0
448
+ },
449
+ bottom: {
450
+ krVfgx: "x1ey2m1c",
451
+ k3aq6I: "x19ey3p3",
452
+ kBPcrh: "x1eputgz",
453
+ $$css: !0
454
+ },
455
+ focus: {
456
+ kPJHz1: "x13qnu6",
457
+ k7shQP: "x9v5kkp",
458
+ kZs9gx: "x19rmrnh",
459
+ kiEn40: "x7s97pk",
460
+ $$css: !0
461
+ },
462
+ part: {
463
+ kSiTet: "x1hc1fzr x1gqwzbp",
464
+ k1ekBW: "x19991ni",
465
+ kIyJzY: "xtitasy",
466
+ kAMwcw: "x1faw7qm",
467
+ $$css: !0
468
+ },
469
+ content: {
470
+ k1xSpc: "x78zum5",
471
+ kXwgrk: "xdt5ytf",
472
+ kUk6DE: "x148l3ej",
473
+ k7Eaqz: "xeuugli",
474
+ kOIVth: "xfko13i",
475
+ $$css: !0
476
+ },
477
+ title: {
478
+ k63SB2: "xk4h15q",
479
+ k1xSpc: "x104kibb",
480
+ kgKLqz: "x1ua5tub",
481
+ kJFfOR: "xh0615m",
482
+ kVQacm: "xb3r6kr",
483
+ kHjlTd: "xj0a0fe",
484
+ $$css: !0
485
+ },
486
+ description: {
487
+ kMwMTN: "x153jb6y",
488
+ k1xSpc: "x104kibb",
489
+ kgKLqz: "x1ua5tub",
490
+ kJFfOR: "xh0615m",
491
+ kVQacm: "xb3r6kr",
492
+ kHjlTd: "xj0a0fe",
493
+ $$css: !0
494
+ },
495
+ icon: {
496
+ k1xSpc: "x78zum5",
497
+ kVAEAm: "x1n2onr6",
498
+ kmuXW: "x2lah0s",
499
+ kzqmXN: "xtwnzbg",
500
+ kZKoxP: "x18utl2x",
501
+ $$css: !0
502
+ },
503
+ glyph: {
504
+ kzqmXN: "xtwnzbg",
505
+ kZKoxP: "x18utl2x",
506
+ k44tkh: "x1m5cc3j",
507
+ $$css: !0
508
+ },
509
+ success: {
510
+ kMwMTN: "x7ixh4y",
511
+ $$css: !0
512
+ },
513
+ error: {
514
+ kMwMTN: "xr5kp14",
515
+ $$css: !0
516
+ },
517
+ warning: {
518
+ kMwMTN: "x1f9ixgr",
519
+ $$css: !0
520
+ },
521
+ neutral: {
522
+ kMwMTN: "x153jb6y",
523
+ $$css: !0
524
+ },
525
+ button: {
526
+ k1xSpc: "x3nfvp2",
527
+ kGNEyG: "x6s0dn4",
528
+ kjj79g: "xl56j7k",
529
+ kmuXW: "x2lah0s",
530
+ kB7OPa: "x9f619",
531
+ k7Eaqz: "xeuugli",
532
+ ks0D6T: "x193iq5w",
533
+ kAzted: "x17tes2r x17oiadl",
534
+ k8WAf4: "x1hmw7ec",
535
+ kg3NbH: "x1atzlso",
536
+ kMzoRj: "xc342km",
537
+ kaIpWk: "x1ok0vyi",
538
+ kMv6JI: "x1hz01jw",
539
+ kGuDYH: "xtqrqnz",
540
+ kLWn49: "x1778rvt",
541
+ k63SB2: "xk4h15q",
542
+ khDVqt: "xeaf4i8",
543
+ kHjlTd: "xj0a0fe",
544
+ kkrTdU: "x1ypdohk",
545
+ $$css: !0
546
+ },
547
+ action: {
548
+ kWkggS: "x1pt885t",
549
+ kMwMTN: "x1ymx3u3",
550
+ kGzVvX: "xmn6lam",
551
+ kSReZ0: "x1eou8nq",
552
+ $$css: !0
553
+ },
554
+ close: {
555
+ kVAEAm: "x10l6tqk",
556
+ k87sOh: "x1m7q2ru",
557
+ kt4wiu: "x1b86y6l",
558
+ k7Eaqz: "x16opp91 x1gjsuxi",
559
+ kg3NbH: "xnjsko4",
560
+ kWkggS: "xjbqb8w",
561
+ kMwMTN: "x153jb6y",
562
+ kUKaEf: "x1rfq5r5",
563
+ kfEXFh: "x1dqpf9g",
564
+ kmgZYZ: "x15wa9bl",
565
+ kBLIq6: "xvivl9a",
566
+ $$css: !0
567
+ }
568
+ }, ye = {
569
+ default: {
570
+ Icon: S,
571
+ tone: J.neutral
572
+ },
573
+ info: {
574
+ Icon: S,
575
+ tone: J.neutral
576
+ },
577
+ success: {
578
+ Icon: x,
579
+ tone: J.success
580
+ },
581
+ warning: {
582
+ Icon: ne,
583
+ tone: J.warning
584
+ },
585
+ error: {
586
+ Icon: te,
587
+ tone: J.error
588
+ },
589
+ loading: {
590
+ Icon: C,
591
+ tone: J.neutral
592
+ }
593
+ }, be = {
594
+ "x-default-marker": "x-default-marker",
595
+ $$css: !0
596
+ };
597
+ function xe({ id: e, side: t = "bottom", align: n = "end", isExpanded: r = !1, visibleToasts: i = 3, showCloseButton: a = !0, closeButtonAriaLabel: o = "Dismiss notification", containerAriaLabel: s = "Notifications" }) {
598
+ let c = G.queueFor(e);
599
+ return h(() => G.bind(e, c), [e, c]), /* @__PURE__ */ y(O, {
600
+ toaster: c,
601
+ side: t,
602
+ align: n,
603
+ expanded: r,
604
+ maxVisible: i,
605
+ shortcut: "alt+t",
606
+ "aria-label": s,
607
+ className: "x1261nif xqu3jwc xtru72a xf6ji1w xqv9vo9 xyt9zns x1u22o8f xviucbn x1572sgj",
608
+ children: (e) => {
609
+ let { Icon: n, tone: r } = ye[e.type];
610
+ return /* @__PURE__ */ b(le, {
611
+ ...d.props(J.toast, J[t], J.focus, be),
612
+ children: [
613
+ /* @__PURE__ */ y(n, {
614
+ "aria-hidden": !0,
615
+ ...d.props(J.icon, J.part, r)
616
+ }),
617
+ /* @__PURE__ */ b("div", {
618
+ className: "x78zum5 xdt5ytf x148l3ej xeuugli xfko13i x1hc1fzr x1gqwzbp x19991ni xtitasy x1faw7qm",
619
+ children: [/* @__PURE__ */ y(k, { className: "xk4h15q x104kibb x1ua5tub xh0615m xb3r6kr xj0a0fe" }), /* @__PURE__ */ y(D, { className: "x153jb6y x104kibb x1ua5tub xh0615m xb3r6kr xj0a0fe" })]
620
+ }),
621
+ e.action?.label !== void 0 && /* @__PURE__ */ y(ue, { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 xeuugli x193iq5w x17tes2r x17oiadl x1hmw7ec x1atzlso xc342km x1ok0vyi x1hz01jw xtqrqnz x1778rvt xk4h15q xeaf4i8 xj0a0fe x1ypdohk x1pt885t x1ymx3u3 xmn6lam x1eou8nq x13qnu6 x9v5kkp x19rmrnh x7s97pk x1hc1fzr x1gqwzbp x19991ni xtitasy x1faw7qm" }),
622
+ a && /* @__PURE__ */ y(de, {
623
+ "aria-label": o,
624
+ className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 x193iq5w x17tes2r x17oiadl x1hmw7ec xc342km x1ok0vyi x1hz01jw xtqrqnz x1778rvt xk4h15q xeaf4i8 xj0a0fe x1ypdohk x10l6tqk x1m7q2ru x1b86y6l x16opp91 x1gjsuxi xnjsko4 xjbqb8w x153jb6y x1rfq5r5 x1dqpf9g x15wa9bl xvivl9a x13qnu6 x9v5kkp x19rmrnh x7s97pk x1hc1fzr x1gqwzbp x19991ni xtitasy x1faw7qm",
625
+ children: /* @__PURE__ */ y(w, {
626
+ "aria-hidden": !0,
627
+ className: "xtwnzbg x18utl2x x1m5cc3j"
628
+ })
629
+ })
630
+ ]
631
+ });
632
+ }
633
+ });
634
+ }
635
+ // packages/feedback/src/async-region.tsx
636
+ var Y = p(void 0), X = p(!1), Z = u.delaySeconds * 1e3, Q = {
637
+ content: {
638
+ k7Eaqz: "xeuugli",
639
+ kAzted: "x2lwn1j",
640
+ k1xSpc: "x78zum5",
641
+ kXwgrk: "xdt5ytf",
642
+ kUk6DE: "x98rzlu",
643
+ $$css: !0
644
+ },
645
+ reveal: {
646
+ kKVMdj: "xqcmdr3 x1qme5af",
647
+ k44tkh: "x1irg2zc",
648
+ kyAemX: "x1c3o69q",
649
+ $$css: !0
650
+ },
651
+ imageReveal: {
652
+ k44tkh: "x11hm9ij",
653
+ $$css: !0
654
+ }
655
+ }, Se = {
656
+ content: null,
657
+ image: Q.imageReveal
658
+ };
659
+ function Ce({ identity: e, initialStartedAt: t, children: n }) {
660
+ let [r, i] = _(() => ({
661
+ identity: e,
662
+ startedAt: t ?? Date.now()
663
+ })), a = r;
664
+ return r.identity !== e && (a = {
665
+ identity: e,
666
+ startedAt: Date.now()
667
+ }, i(a)), /* @__PURE__ */ y(Y, {
668
+ value: a,
669
+ children: n
670
+ });
671
+ }
672
+ function $({ shouldEnter: e, presentation: t = "content", children: n }) {
673
+ let r = m(X), [i, a] = _(e && !r), o = g(null);
674
+ return h(() => {
675
+ let e = o.current;
676
+ if (!i || e === null) return;
677
+ let t = !0;
678
+ return Promise.allSettled(e.getAnimations().map((e) => e.finished)).then(() => {
679
+ t && a(!1);
680
+ }), () => {
681
+ t = !1;
682
+ };
683
+ }, [i]), /* @__PURE__ */ y("div", {
684
+ ref: o,
685
+ ...d.props(Q.content, i && Q.reveal, Se[t]),
686
+ children: /* @__PURE__ */ y(X, {
687
+ value: r || i,
688
+ children: n
689
+ })
690
+ });
691
+ }
692
+ function we({ label: e, placeholder: t, startedAt: n, presentation: r }) {
693
+ let [i, a] = _(() => Date.now() - n >= Z ? n : void 0), o = i === n, s = r === "image";
694
+ return h(() => {
695
+ let e = Math.max(0, Z - (Date.now() - n)), t = setTimeout(() => a(n), e);
696
+ return () => clearTimeout(t);
697
+ }, [n]), /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("div", {
698
+ "aria-busy": !0,
699
+ className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu",
700
+ children: /* @__PURE__ */ y("div", {
701
+ "aria-hidden": !0,
702
+ inert: !0,
703
+ ...{
704
+ 0: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu x18usnwx" },
705
+ 2: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xlshs6z x18usnwx" },
706
+ 1: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xqcmdr3 x1qme5af x1c3o69q x18usnwx" },
707
+ 3: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xlshs6z xqcmdr3 x1qme5af x1c3o69q x18usnwx" }
708
+ }[!(s || o) << 1 | !(s || !o)],
709
+ children: t
710
+ })
711
+ }), o && /* @__PURE__ */ y("span", {
712
+ role: "status",
713
+ ...d.props(l.hidden),
714
+ children: e
715
+ })] });
716
+ }
717
+ function Te(e) {
718
+ let t = m(Y), [n, r] = _(() => ({
719
+ state: e.state,
720
+ scope: t,
721
+ startedAt: t?.startedAt ?? Date.now(),
722
+ wasPending: e.state === "pending"
723
+ })), i = n;
724
+ if (n.scope !== t || n.state !== e.state) {
725
+ let a = n.scope !== t, o = n.startedAt;
726
+ a ? o = t?.startedAt ?? Date.now() : e.state === "pending" && (o = Date.now()), i = {
727
+ state: e.state,
728
+ scope: t,
729
+ startedAt: o,
730
+ wasPending: e.state === "pending" || !a && n.wasPending
731
+ }, r(i);
732
+ }
733
+ return /* @__PURE__ */ y("div", {
734
+ className: "x1n2onr6 xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu",
735
+ children: e.state === "pending" ? /* @__PURE__ */ y(we, {
736
+ label: e.label,
737
+ placeholder: e.placeholder,
738
+ startedAt: i.startedAt,
739
+ presentation: e.presentation ?? "content"
740
+ }) : e.state === "failed" ? /* @__PURE__ */ y("div", {
741
+ className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu",
742
+ children: e.children
743
+ }) : /* @__PURE__ */ y($, {
744
+ shouldEnter: i.wasPending,
745
+ presentation: e.presentation ?? "content",
746
+ children: e.children
747
+ })
748
+ });
749
+ }
750
+ export { ve as a, U as c, F as d, I as f, M as h, xe as i, V as l, j as m, $ as n, me as o, L as p, Ce as r, pe as s, Te as t, H as u };