ics-ui-kit 0.1.0-alpha.5 → 0.1.0-alpha.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.
Files changed (30) hide show
  1. package/dist/ToastAction-C6gMf3Zg.js +880 -0
  2. package/dist/ToastAction-C6gMf3Zg.js.map +1 -0
  3. package/dist/components/toast/Toast.d.ts +24 -404
  4. package/dist/components/toast/Toast.stories.d.ts +6 -449
  5. package/dist/components/toast/ToastStory.d.ts +10 -0
  6. package/dist/components/toast/ToastView.d.ts +418 -0
  7. package/dist/components/toast/ToastView.stories.d.ts +9 -0
  8. package/dist/components/toast/components/large-toast/LargeToast.d.ts +1 -1
  9. package/dist/components/toast/components/medium-toast/MediumToast.d.ts +1 -1
  10. package/dist/components/toast/components/small-toast/SmallToast.d.ts +1 -1
  11. package/dist/components/toast/components/toast-action/ToastAction.d.ts +4 -1
  12. package/dist/components/toast/components/toast-action/ToastAction.stories.d.ts +4 -5
  13. package/dist/components/toast/components/toast-close-action/ToastCloseButton.stories.d.ts +1 -1
  14. package/dist/components/toast/components/toast-icon/ToastIcon.stories.d.ts +1 -1
  15. package/dist/components/toast/context/ToastContext.d.ts +1 -1
  16. package/dist/components/toast/hooks/useToast.d.ts +1 -1
  17. package/dist/components/toast/hooks/useToastContainer.d.ts +1 -1
  18. package/dist/components/toast/hooks/useToastContext.d.ts +1 -1
  19. package/dist/components/toast/index.d.ts +2 -0
  20. package/dist/components/toast/utils/ToastUtils.d.ts +1 -1
  21. package/dist/components/toast.d.ts +2 -0
  22. package/dist/components/toast.js +344 -0
  23. package/dist/components/toast.js.map +1 -0
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +4 -870
  26. package/dist/index.js.map +1 -1
  27. package/dist/styles-scoped.css +14 -10
  28. package/dist/styles.css +11 -5
  29. package/dist/uiKitClassName.d.ts +5 -0
  30. package/package.json +2 -1
@@ -0,0 +1,880 @@
1
+ var H = Object.defineProperty, X = Object.defineProperties;
2
+ var D = Object.getOwnPropertyDescriptors;
3
+ var z = Object.getOwnPropertySymbols;
4
+ var B = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
5
+ var W = (t, s, r) => s in t ? H(t, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[s] = r, l = (t, s) => {
6
+ for (var r in s || (s = {}))
7
+ B.call(s, r) && W(t, r, s[r]);
8
+ if (z)
9
+ for (var r of z(s))
10
+ I.call(s, r) && W(t, r, s[r]);
11
+ return t;
12
+ }, b = (t, s) => X(t, D(s));
13
+ var h = (t, s) => {
14
+ var r = {};
15
+ for (var e in t)
16
+ B.call(t, e) && s.indexOf(e) < 0 && (r[e] = t[e]);
17
+ if (t != null && z)
18
+ for (var e of z(t))
19
+ s.indexOf(e) < 0 && I.call(t, e) && (r[e] = t[e]);
20
+ return r;
21
+ };
22
+ import { jsx as a, jsxs as g, Fragment as y } from "react/jsx-runtime";
23
+ import { c as d, S as F, t as O } from "./bundle-mjs-BQaSeS8G.js";
24
+ import { forwardRef as C, createContext as K, useContext as R, createElement as A } from "react";
25
+ const G = d({
26
+ base: "inline-flex shrink-0 cursor-pointer select-none items-center justify-center rounded-md font-medium text-primary-fg",
27
+ variants: {
28
+ variant: {
29
+ primary: "bg-primary text-primary-bg hover:bg-primary-hover",
30
+ secondary: "bg-primary-bg hover:bg-primary-bg-hover",
31
+ outline: "border border-solid border-secondary-border bg-secondary-bg hover:border-primary-border hover:bg-secondary-bg-hover",
32
+ ghost: "bg-transparent hover:bg-secondary-bg-hover",
33
+ link: "bg-transparent text-muted underline underline-offset-base hover:text-primary-fg",
34
+ text: "bg-transparent text-muted hover:text-primary-fg"
35
+ },
36
+ state: {
37
+ default: "",
38
+ disabled: "pointer-events-none opacity-50"
39
+ },
40
+ status: {
41
+ default: "",
42
+ info: "text-status-info",
43
+ success: "text-status-success",
44
+ warning: "text-status-warning",
45
+ error: "text-status-error"
46
+ },
47
+ size: {
48
+ xs: "h-7 gap-2 px-2 py-1.5 text-xs leading-none",
49
+ sm: "h-8 gap-2 px-3 py-2 text-xs leading-none",
50
+ md: "h-9 gap-2 px-4 py-2 text-sm leading-none",
51
+ lg: "h-10 gap-2 px-6 py-2 text-base leading-none",
52
+ xl: "h-11 gap-3 px-8 py-3 text-lg leading-none"
53
+ },
54
+ iconOnly: {
55
+ true: "",
56
+ false: ""
57
+ }
58
+ },
59
+ defaultVariants: {
60
+ variant: "primary",
61
+ size: "md",
62
+ status: "default",
63
+ state: "default",
64
+ iconOnly: !1
65
+ },
66
+ compoundVariants: [
67
+ /*
68
+ * Statuses
69
+ */
70
+ // Primary
71
+ {
72
+ variant: "primary",
73
+ status: ["info", "success", "warning", "error"],
74
+ class: "text-white hover:text-white"
75
+ },
76
+ {
77
+ variant: "primary",
78
+ status: "info",
79
+ class: "bg-status-info hover:bg-status-info-hover"
80
+ },
81
+ {
82
+ variant: "primary",
83
+ status: "success",
84
+ class: "bg-status-success hover:bg-status-success-hover"
85
+ },
86
+ {
87
+ variant: "primary",
88
+ status: "warning",
89
+ class: "bg-status-warning hover:bg-status-warning-hover"
90
+ },
91
+ {
92
+ variant: "primary",
93
+ status: "error",
94
+ class: "bg-status-error hover:bg-status-error-hover"
95
+ },
96
+ // Secondary
97
+ {
98
+ variant: "secondary",
99
+ status: "info",
100
+ class: "bg-status-info-bg hover:bg-status-info-bg-hover"
101
+ },
102
+ {
103
+ variant: "secondary",
104
+ status: "success",
105
+ class: "bg-status-success-bg hover:bg-status-success-bg-hover"
106
+ },
107
+ {
108
+ variant: "secondary",
109
+ status: "warning",
110
+ class: "bg-status-warning-bg hover:bg-status-warning-bg-hover"
111
+ },
112
+ {
113
+ variant: "secondary",
114
+ status: "error",
115
+ class: "bg-status-error-bg hover:bg-status-error-bg-hover"
116
+ },
117
+ // Outline
118
+ {
119
+ variant: "outline",
120
+ status: "info",
121
+ class: "border-status-info-border hover:border-status-info-border hover:bg-status-info-bg"
122
+ },
123
+ {
124
+ variant: "outline",
125
+ status: "success",
126
+ class: "border-status-success-border hover:border-status-success-border hover:bg-status-success-bg"
127
+ },
128
+ {
129
+ variant: "outline",
130
+ status: "warning",
131
+ class: "border-status-warning-border hover:border-status-warning-border hover:bg-status-warning-bg"
132
+ },
133
+ {
134
+ variant: "outline",
135
+ status: "error",
136
+ class: "border-status-error-secondary-border hover:border-status-error-secondary-border hover:bg-status-error-bg"
137
+ },
138
+ // Ghost
139
+ {
140
+ variant: "ghost",
141
+ status: "info",
142
+ class: "text-status-info hover:bg-status-info-bg"
143
+ },
144
+ {
145
+ variant: "ghost",
146
+ status: "success",
147
+ class: "text-status-success hover:bg-status-success-bg"
148
+ },
149
+ {
150
+ variant: "ghost",
151
+ status: "warning",
152
+ class: "text-status-warning hover:bg-status-warning-bg"
153
+ },
154
+ {
155
+ variant: "ghost",
156
+ status: "error",
157
+ class: "text-status-error hover:bg-status-error-bg"
158
+ },
159
+ // Text & Link
160
+ {
161
+ variant: ["text", "link"],
162
+ status: "info",
163
+ class: "text-status-info/70 hover:text-status-info"
164
+ },
165
+ {
166
+ variant: ["text", "link"],
167
+ status: "success",
168
+ class: "text-status-success/70 hover:text-status-success"
169
+ },
170
+ {
171
+ variant: ["text", "link"],
172
+ status: "warning",
173
+ class: "text-status-warning/70 hover:text-status-warning"
174
+ },
175
+ {
176
+ variant: ["text", "link"],
177
+ status: "error",
178
+ class: "text-status-error/70 hover:text-status-error"
179
+ },
180
+ /*
181
+ * IconOnly
182
+ */
183
+ {
184
+ iconOnly: !0,
185
+ size: "xl",
186
+ class: "p-3.5"
187
+ },
188
+ {
189
+ iconOnly: !0,
190
+ size: "lg",
191
+ class: "p-3"
192
+ },
193
+ {
194
+ iconOnly: !0,
195
+ size: "md",
196
+ class: "p-2.5"
197
+ },
198
+ {
199
+ iconOnly: !0,
200
+ size: "sm",
201
+ class: "p-2"
202
+ },
203
+ {
204
+ iconOnly: !0,
205
+ size: "xs",
206
+ class: "p-1.5"
207
+ }
208
+ ]
209
+ }), M = C(
210
+ (f, p) => {
211
+ var u = f, { variant: t, state: s, size: r, children: e, status: c, className: o, iconOnly: n, asChild: i = !1 } = u, m = h(u, ["variant", "state", "size", "children", "status", "className", "iconOnly", "asChild"]);
212
+ return /* @__PURE__ */ a(
213
+ i ? F : "button",
214
+ b(l({
215
+ className: G({ variant: t, state: s, size: r, status: c, iconOnly: n, className: o }),
216
+ ref: p
217
+ }, m), {
218
+ children: e
219
+ })
220
+ );
221
+ }
222
+ ), $ = K(null), J = ({ children: t, value: s }) => /* @__PURE__ */ a($.Provider, { value: s, children: t }), x = () => {
223
+ const t = R($);
224
+ if (!t)
225
+ throw new Error("useToastContext must be used within a ToastProvider");
226
+ return t;
227
+ }, Q = d({
228
+ variants: {
229
+ orientation: {
230
+ horizontal: "h-px w-full bg-secondary-border",
231
+ vertical: "h-full w-px bg-secondary-border"
232
+ }
233
+ }
234
+ }), S = ({ orientation: t, className: s }) => /* @__PURE__ */ a("div", { className: Q({ orientation: t, className: s }) });
235
+ /**
236
+ * @license lucide-react v0.460.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */
241
+ const U = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), L = (...t) => t.filter((s, r, e) => !!s && s.trim() !== "" && e.indexOf(s) === r).join(" ").trim();
242
+ /**
243
+ * @license lucide-react v0.460.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */
248
+ var Y = {
249
+ xmlns: "http://www.w3.org/2000/svg",
250
+ width: 24,
251
+ height: 24,
252
+ viewBox: "0 0 24 24",
253
+ fill: "none",
254
+ stroke: "currentColor",
255
+ strokeWidth: 2,
256
+ strokeLinecap: "round",
257
+ strokeLinejoin: "round"
258
+ };
259
+ /**
260
+ * @license lucide-react v0.460.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */
265
+ const _ = C(
266
+ (p, m) => {
267
+ var f = p, {
268
+ color: t = "currentColor",
269
+ size: s = 24,
270
+ strokeWidth: r = 2,
271
+ absoluteStrokeWidth: e,
272
+ className: c = "",
273
+ children: o,
274
+ iconNode: n
275
+ } = f, i = h(f, [
276
+ "color",
277
+ "size",
278
+ "strokeWidth",
279
+ "absoluteStrokeWidth",
280
+ "className",
281
+ "children",
282
+ "iconNode"
283
+ ]);
284
+ return A(
285
+ "svg",
286
+ l(b(l({
287
+ ref: m
288
+ }, Y), {
289
+ width: s,
290
+ height: s,
291
+ stroke: t,
292
+ strokeWidth: e ? Number(r) * 24 / Number(s) : r,
293
+ className: L("lucide", c)
294
+ }), i),
295
+ [
296
+ ...n.map(([u, v]) => A(u, v)),
297
+ ...Array.isArray(o) ? o : [o]
298
+ ]
299
+ );
300
+ }
301
+ );
302
+ /**
303
+ * @license lucide-react v0.460.0 - ISC
304
+ *
305
+ * This source code is licensed under the ISC license.
306
+ * See the LICENSE file in the root directory of this source tree.
307
+ */
308
+ const w = (t, s) => {
309
+ const r = C(
310
+ (n, o) => {
311
+ var i = n, { className: e } = i, c = h(i, ["className"]);
312
+ return A(_, l({
313
+ ref: o,
314
+ iconNode: s,
315
+ className: L(`lucide-${U(t)}`, e)
316
+ }, c));
317
+ }
318
+ );
319
+ return r.displayName = `${t}`, r;
320
+ };
321
+ /**
322
+ * @license lucide-react v0.460.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */
327
+ const j = w("CircleAlert", [
328
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
329
+ ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
330
+ ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
331
+ ]);
332
+ /**
333
+ * @license lucide-react v0.460.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */
338
+ const tt = w("CircleCheckBig", [
339
+ ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
340
+ ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
341
+ ]);
342
+ /**
343
+ * @license lucide-react v0.460.0 - ISC
344
+ *
345
+ * This source code is licensed under the ISC license.
346
+ * See the LICENSE file in the root directory of this source tree.
347
+ */
348
+ const st = w("Info", [
349
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
350
+ ["path", { d: "M12 16v-4", key: "1dtifu" }],
351
+ ["path", { d: "M12 8h.01", key: "e9boi3" }]
352
+ ]);
353
+ /**
354
+ * @license lucide-react v0.460.0 - ISC
355
+ *
356
+ * This source code is licensed under the ISC license.
357
+ * See the LICENSE file in the root directory of this source tree.
358
+ */
359
+ const et = w("TriangleAlert", [
360
+ [
361
+ "path",
362
+ {
363
+ d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
364
+ key: "wmoenq"
365
+ }
366
+ ],
367
+ ["path", { d: "M12 9v4", key: "juzpu7" }],
368
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
369
+ ]);
370
+ /**
371
+ * @license lucide-react v0.460.0 - ISC
372
+ *
373
+ * This source code is licensed under the ISC license.
374
+ * See the LICENSE file in the root directory of this source tree.
375
+ */
376
+ const rt = w("X", [
377
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
378
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
379
+ ]), at = d({
380
+ base: "h-4 w-4",
381
+ variants: {
382
+ size: {
383
+ sm: "h-3 w-3",
384
+ md: "h-4 w-4"
385
+ }
386
+ },
387
+ defaultVariants: {
388
+ size: "md"
389
+ }
390
+ }), E = ({ icon: t, className: s, size: r }) => /* @__PURE__ */ a(t, { className: at({ size: r, className: s }) }), P = (t) => ({
391
+ low: "ghost",
392
+ medium: "secondary",
393
+ high: "primary"
394
+ })[t != null ? t : "low"];
395
+ function Z(t, s) {
396
+ const { size: r, focus: e, status: c } = t, n = {
397
+ status: ["medium", "high"].includes(e != null ? e : "") && r === "sm" ? c : "default"
398
+ };
399
+ if (s === "close")
400
+ return b(l({}, n), {
401
+ size: r === "lg" ? "xl" : "lg",
402
+ iconOnly: !0,
403
+ variant: r === "sm" ? P(e) : "text"
404
+ });
405
+ const i = {
406
+ sm: P(e),
407
+ md: "link",
408
+ lg: s === "primary" ? e === "high" ? "secondary" : "outline" : "text"
409
+ };
410
+ return b(l({}, n), {
411
+ size: r === "lg" ? "md" : "lg",
412
+ variant: i[r != null ? r : "sm"]
413
+ });
414
+ }
415
+ const ot = d({
416
+ variants: {
417
+ status: {
418
+ default: "",
419
+ info: "",
420
+ success: "",
421
+ warning: "",
422
+ error: ""
423
+ },
424
+ focus: {
425
+ low: "",
426
+ medium: "",
427
+ high: ""
428
+ },
429
+ size: {
430
+ sm: "h-full rounded-none",
431
+ md: "",
432
+ lg: ""
433
+ }
434
+ },
435
+ compoundVariants: [
436
+ {
437
+ size: "sm",
438
+ focus: "medium",
439
+ className: "text-primary-fg"
440
+ },
441
+ {
442
+ size: ["md", "lg"],
443
+ focus: "high",
444
+ status: "default",
445
+ className: "text-primary-bg/70 hover:text-primary-bg"
446
+ },
447
+ {
448
+ size: ["md", "lg"],
449
+ focus: "high",
450
+ status: ["info", "success", "warning", "error"],
451
+ className: "text-white/70 hover:text-white"
452
+ }
453
+ ]
454
+ }), V = ({ className: t }) => {
455
+ const s = x();
456
+ if (!s)
457
+ throw new Error("ToastCloseButton must be used within Toast");
458
+ const r = Z(s, "close");
459
+ return /* @__PURE__ */ a(
460
+ M,
461
+ b(l({}, r), {
462
+ onClick: s.onClose,
463
+ className: O(
464
+ ot({
465
+ size: s.size,
466
+ focus: s.focus,
467
+ status: s.status
468
+ }),
469
+ t
470
+ ),
471
+ children: /* @__PURE__ */ a(E, { icon: rt })
472
+ })
473
+ );
474
+ }, nt = d({
475
+ slots: {
476
+ contentWrapper: "flex min-w-0 flex-grow items-center gap-2 pr-3",
477
+ titleWrapper: "min-w-0 truncate"
478
+ }
479
+ }), it = (r) => {
480
+ var e = r, { titleIcon: t } = e, s = h(e, ["titleIcon"]);
481
+ const { titleText: c, close: o, separator: n } = s, { contentWrapper: i, titleWrapper: m } = nt(), p = x();
482
+ return /* @__PURE__ */ g(y, { children: [
483
+ /* @__PURE__ */ g("div", { className: i(), children: [
484
+ t,
485
+ /* @__PURE__ */ a("div", { className: O(m(), c()), children: /* @__PURE__ */ a("span", { children: p.title }) })
486
+ ] }),
487
+ p.primaryAction && /* @__PURE__ */ g(y, { children: [
488
+ /* @__PURE__ */ a(S, { className: n(), orientation: "vertical" }),
489
+ p.primaryAction
490
+ ] }),
491
+ p.closeAction && /* @__PURE__ */ g(y, { children: [
492
+ /* @__PURE__ */ a(S, { className: n(), orientation: "vertical" }),
493
+ /* @__PURE__ */ a(V, { className: o() })
494
+ ] })
495
+ ] });
496
+ }, ct = d({
497
+ slots: {
498
+ wrapper: "flex h-5 w-5 items-center justify-center",
499
+ icon: "h-4 w-4 [&>svg]:h-4 [&>svg]:w-4"
500
+ },
501
+ variants: {
502
+ status: {
503
+ default: { wrapper: "text-status-default" },
504
+ info: { wrapper: "text-status-info" },
505
+ success: { wrapper: "text-status-success" },
506
+ warning: { wrapper: "text-status-warning" },
507
+ error: { wrapper: "text-status-error" }
508
+ },
509
+ focus: {
510
+ low: "",
511
+ medium: "",
512
+ high: { wrapper: "text-secondary-bg" }
513
+ }
514
+ },
515
+ compoundVariants: [
516
+ {
517
+ status: ["info", "success", "warning", "error"],
518
+ focus: "high",
519
+ class: { wrapper: "text-white" }
520
+ }
521
+ ]
522
+ }), ut = ({ icon: t }) => {
523
+ var n;
524
+ const s = x();
525
+ if (!s)
526
+ throw new Error("ToastIcon must be used within Toast");
527
+ const { wrapper: r, icon: e } = ct({ focus: s.focus, status: s.status }), c = lt[(n = s.status) != null ? n : "default"], o = () => t ? /* @__PURE__ */ a("div", { className: e(), children: t }) : /* @__PURE__ */ a(E, { icon: c, className: e() });
528
+ return /* @__PURE__ */ a("div", { className: r(), children: o() });
529
+ }, lt = {
530
+ default: j,
531
+ info: st,
532
+ success: tt,
533
+ warning: et,
534
+ error: j
535
+ }, pt = d({
536
+ slots: {
537
+ contentWrapper: "flex flex-grow gap-3 py-2.5 pr-2.5"
538
+ }
539
+ }), gt = (r) => {
540
+ var e = r, { titleIcon: t } = e, s = h(e, ["titleIcon"]);
541
+ const { titleText: c, close: o } = s, { contentWrapper: n } = pt(), i = x();
542
+ return /* @__PURE__ */ g(y, { children: [
543
+ /* @__PURE__ */ g("div", { className: n(), children: [
544
+ t,
545
+ /* @__PURE__ */ a("span", { className: c(), children: i.title })
546
+ ] }),
547
+ i.primaryAction && i.primaryAction,
548
+ i.closeAction && /* @__PURE__ */ a(V, { className: o() })
549
+ ] });
550
+ }, dt = d({
551
+ slots: {
552
+ contentWrapper: "flex w-full flex-col gap-4",
553
+ topZone: "flex gap-3",
554
+ textWrapper: "flex flex-grow flex-col gap-1",
555
+ actionsWrapper: "flex w-full justify-end gap-2"
556
+ }
557
+ }), mt = (r) => {
558
+ var e = r, { titleIcon: t } = e, s = h(e, ["titleIcon"]);
559
+ const { titleText: c, close: o, descriptionText: n } = s, { contentWrapper: i, topZone: m, textWrapper: p, actionsWrapper: f } = dt(), u = x();
560
+ return /* @__PURE__ */ a(y, { children: /* @__PURE__ */ g("div", { className: i(), children: [
561
+ /* @__PURE__ */ g("div", { className: m(), children: [
562
+ t,
563
+ /* @__PURE__ */ g("div", { className: p(), children: [
564
+ /* @__PURE__ */ a("span", { className: c(), children: u.title }),
565
+ u.description && /* @__PURE__ */ a("span", { className: n(), children: u.description })
566
+ ] }),
567
+ u.closeAction && /* @__PURE__ */ a(V, { className: o() })
568
+ ] }),
569
+ u.secondaryAction || u.primaryAction ? /* @__PURE__ */ g("div", { className: f(), children: [
570
+ u.secondaryAction,
571
+ u.primaryAction
572
+ ] }) : null
573
+ ] }) });
574
+ }, ht = d({
575
+ slots: {
576
+ /**
577
+ * Ширина уведомления задается в переменной --width.
578
+ * Библиотека sonner не поддерживает динамические ширины и использует эту переменную для вычисления позиции уведомления.
579
+ */
580
+ wrapper: "inline-flex w-[--width] items-start overflow-hidden rounded-lg border border-solid border-secondary-border",
581
+ text: "flex min-w-0 flex-auto flex-col justify-center gap-1 truncate pr-3",
582
+ titleText: "min-w-0 text-sm font-semibold text-primary-fg",
583
+ descriptionText: "inline-block text-sm font-normal text-secondary-fg",
584
+ contentWrapper: "flex items-center",
585
+ content: "flex",
586
+ actions: "flex items-center justify-center gap-2",
587
+ close: "",
588
+ separator: ""
589
+ },
590
+ variants: {
591
+ status: {
592
+ default: {
593
+ wrapper: ""
594
+ },
595
+ success: {
596
+ wrapper: "bg-status-success-bg"
597
+ },
598
+ info: {
599
+ wrapper: "bg-status-info-bg"
600
+ },
601
+ warning: {
602
+ wrapper: "bg-status-warning-bg"
603
+ },
604
+ error: {
605
+ wrapper: "bg-status-error-bg"
606
+ }
607
+ },
608
+ focus: {
609
+ low: {
610
+ wrapper: "bg-secondary-bg"
611
+ },
612
+ medium: {
613
+ wrapper: "bg-primary-bg"
614
+ },
615
+ high: {
616
+ titleText: "text-white",
617
+ descriptionText: "text-white/70",
618
+ separator: "bg-white"
619
+ }
620
+ },
621
+ size: {
622
+ sm: {
623
+ wrapper: "h-10 items-center pl-3 shadow-sm",
624
+ titleText: "text-xs font-medium leading-5",
625
+ contentWrapper: "gap-2"
626
+ },
627
+ md: {
628
+ wrapper: "py-1.5 pl-4 pr-1.5 shadow-md",
629
+ contentWrapper: "gap-3"
630
+ },
631
+ lg: {
632
+ wrapper: "relative items-start p-4 shadow-lg",
633
+ contentWrapper: "items-start gap-3",
634
+ content: "flex flex-1 flex-col gap-4",
635
+ actions: "justify-end self-stretch",
636
+ close: "mr-[-16px] mt-[-16px]",
637
+ titleText: "text-wrap"
638
+ }
639
+ }
640
+ },
641
+ defaultVariants: {
642
+ status: "default",
643
+ focus: "medium",
644
+ size: "sm"
645
+ },
646
+ compoundVariants: [
647
+ // Medium focus
648
+ {
649
+ status: "info",
650
+ focus: "medium",
651
+ class: {
652
+ separator: "bg-status-info/30",
653
+ wrapper: "border-status-info/30 bg-status-info-bg",
654
+ titleText: "text-status-info"
655
+ }
656
+ },
657
+ {
658
+ status: "success",
659
+ focus: "medium",
660
+ class: {
661
+ separator: "bg-status-success/30",
662
+ wrapper: "border-status-success/30 bg-status-success-bg",
663
+ titleText: "text-status-success"
664
+ }
665
+ },
666
+ {
667
+ status: "warning",
668
+ focus: "medium",
669
+ class: {
670
+ separator: "bg-status-warning/30",
671
+ wrapper: "border-status-warning/30 bg-status-warning-bg",
672
+ titleText: "text-status-warning"
673
+ }
674
+ },
675
+ {
676
+ status: "error",
677
+ focus: "medium",
678
+ class: {
679
+ separator: "bg-status-error/30",
680
+ wrapper: "border-status-error/30 bg-status-error-bg",
681
+ titleText: "text-status-error"
682
+ }
683
+ },
684
+ // High focus
685
+ {
686
+ status: "default",
687
+ focus: "high",
688
+ class: {
689
+ wrapper: "bg-primary",
690
+ titleText: "text-primary-bg",
691
+ descriptionText: "text-primary-bg/70",
692
+ separator: "bg-primary-border"
693
+ }
694
+ },
695
+ {
696
+ status: "info",
697
+ focus: "high",
698
+ class: {
699
+ wrapper: "bg-status-info"
700
+ }
701
+ },
702
+ {
703
+ status: "success",
704
+ focus: "high",
705
+ class: {
706
+ wrapper: "bg-status-success"
707
+ }
708
+ },
709
+ {
710
+ status: "warning",
711
+ focus: "high",
712
+ class: {
713
+ wrapper: "bg-status-warning"
714
+ }
715
+ },
716
+ {
717
+ status: "error",
718
+ focus: "high",
719
+ class: {
720
+ wrapper: "bg-status-error"
721
+ }
722
+ }
723
+ ]
724
+ }), vt = (c) => {
725
+ var o = c, { closeAction: t = !0, id: s, onClose: r } = o, e = h(o, ["closeAction", "id", "onClose"]);
726
+ const { wrapper: n, titleText: i, descriptionText: m, actions: p, close: f, separator: u } = ht({
727
+ status: e.status,
728
+ focus: e.focus,
729
+ size: e.size
730
+ }), v = e.icon ? /* @__PURE__ */ a(ut, { icon: e.icon }) : null, q = {
731
+ id: s,
732
+ status: e.status,
733
+ focus: e.focus,
734
+ size: e.size,
735
+ title: e.title,
736
+ description: e.description,
737
+ icon: e.icon,
738
+ primaryAction: e.primaryAction,
739
+ secondaryAction: e.secondaryAction,
740
+ closeAction: t,
741
+ onClose: r
742
+ }, N = {
743
+ titleText: i,
744
+ descriptionText: m,
745
+ actions: p,
746
+ close: f,
747
+ separator: u,
748
+ titleIcon: v
749
+ };
750
+ let T = null;
751
+ const k = e.size || "md";
752
+ return k === "sm" ? T = /* @__PURE__ */ a(it, l({}, N)) : k === "md" ? T = /* @__PURE__ */ a(gt, l({}, N)) : k === "lg" && (T = /* @__PURE__ */ a(mt, l({}, N))), /* @__PURE__ */ a(J, { value: q, children: /* @__PURE__ */ a("div", { className: n(), children: T }) });
753
+ }, ft = d({
754
+ variants: {
755
+ actionType: {
756
+ primary: "",
757
+ /*
758
+ * Доступен только для toast размером sm и md
759
+ */
760
+ secondary: ""
761
+ },
762
+ status: {
763
+ default: "",
764
+ info: "",
765
+ success: "",
766
+ warning: "",
767
+ error: ""
768
+ },
769
+ focus: {
770
+ low: "",
771
+ medium: "",
772
+ high: ""
773
+ },
774
+ size: {
775
+ sm: "h-full rounded-none px-3 py-3 text-xs font-semibold leading-none",
776
+ md: "rounded-none px-3 py-2 text-sm",
777
+ lg: ""
778
+ }
779
+ },
780
+ defaultVariants: {
781
+ actionType: "primary"
782
+ },
783
+ compoundVariants: [
784
+ // Small size
785
+ {
786
+ actionType: "primary",
787
+ size: "sm",
788
+ focus: "medium",
789
+ className: "text-primary-fg"
790
+ },
791
+ // Medium size
792
+ {
793
+ actionType: "primary",
794
+ size: "md",
795
+ focus: "high",
796
+ status: "default",
797
+ className: "text-primary-bg/70 hover:text-primary-bg"
798
+ },
799
+ {
800
+ actionType: "primary",
801
+ size: "md",
802
+ focus: "high",
803
+ status: ["info", "success", "warning", "error"],
804
+ className: "text-white/70 hover:text-white"
805
+ },
806
+ // Large size
807
+ {
808
+ actionType: "primary",
809
+ size: "lg",
810
+ className: "px-4 py-2"
811
+ },
812
+ {
813
+ actionType: "primary",
814
+ size: "lg",
815
+ focus: "low",
816
+ status: "default",
817
+ className: "bg-secondary-bg"
818
+ },
819
+ {
820
+ actionType: "primary",
821
+ size: "lg",
822
+ focus: ["medium", "high"],
823
+ status: "default",
824
+ className: "bg-primary-bg"
825
+ },
826
+ {
827
+ actionType: "secondary",
828
+ size: "lg",
829
+ className: "p-2"
830
+ },
831
+ {
832
+ actionType: "primary",
833
+ size: "lg",
834
+ focus: "high",
835
+ status: ["info", "success", "warning", "error"],
836
+ className: "bg-white/70 text-black hover:bg-white"
837
+ },
838
+ {
839
+ actionType: "secondary",
840
+ size: "lg",
841
+ focus: "high",
842
+ status: "default",
843
+ className: "text-primary-bg/70 hover:text-primary-bg"
844
+ },
845
+ {
846
+ actionType: "secondary",
847
+ size: "lg",
848
+ focus: "high",
849
+ status: ["info", "success", "warning", "error"],
850
+ className: "text-white/70 hover:text-white"
851
+ }
852
+ ]
853
+ }), Tt = ({ children: t, onClick: s }) => {
854
+ var o, n;
855
+ const r = x();
856
+ if (!r)
857
+ throw new Error("ToastAction must be used within Toast");
858
+ const e = ((o = r.primaryAction) == null ? void 0 : o.props.children) === t ? "primary" : "secondary";
859
+ if (e === "secondary" && ["sm", "md"].includes((n = r.size) != null ? n : "")) return null;
860
+ const c = Z(r, e);
861
+ return /* @__PURE__ */ a(
862
+ M,
863
+ b(l({}, c), {
864
+ onClick: s,
865
+ className: ft({
866
+ actionType: e,
867
+ size: r.size,
868
+ focus: r.focus,
869
+ status: r.status
870
+ }),
871
+ children: t
872
+ })
873
+ );
874
+ };
875
+ export {
876
+ M as B,
877
+ vt as T,
878
+ Tt as a
879
+ };
880
+ //# sourceMappingURL=ToastAction-C6gMf3Zg.js.map