@krosoft/react 0.0.294 → 0.0.295

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 (58) hide show
  1. package/README.md +3 -0
  2. package/dist/{AppActions-CpbkO_3O.js → AppActions-NdUYh2ii.js} +2 -2
  3. package/dist/{AppSubTitle-BOVTZlUB.js → AppSubTitle-CunCNtvJ.js} +1 -1
  4. package/dist/ErrorAlert-0L-Dwqu8.js +37 -0
  5. package/dist/GenericForm-CLgO9HuL.js +311 -0
  6. package/dist/{ImageInput-BPNEywyf.js → ImageInput-DYGqUTBi.js} +2 -2
  7. package/dist/{MultiSelect-CZ4hye2w.js → MultiSelect-CXnF_D0R.js} +29 -30
  8. package/dist/{SearchInput-nr0CrMLK.js → SearchInput-DDcL_q7h.js} +7 -5
  9. package/dist/{cards-BBgGXmYa.js → cards-BB6V8VWw.js} +1 -1
  10. package/dist/components/core/cards/index.js +1 -1
  11. package/dist/components/core/dialogs/AppDialog.d.ts +40 -6
  12. package/dist/components/core/dialogs/AppDialog.d.ts.map +1 -1
  13. package/dist/components/core/dialogs/FormDialog.d.ts +8 -1
  14. package/dist/components/core/dialogs/FormDialog.d.ts.map +1 -1
  15. package/dist/components/core/dialogs/index.d.ts +1 -1
  16. package/dist/components/core/dialogs/index.d.ts.map +1 -1
  17. package/dist/components/core/dialogs/index.js +3 -3
  18. package/dist/components/core/filters/index.js +5 -5
  19. package/dist/components/core/forms/GenericForm.d.ts +4 -3
  20. package/dist/components/core/forms/GenericForm.d.ts.map +1 -1
  21. package/dist/components/core/forms/index.js +1 -1
  22. package/dist/components/core/index.js +17 -17
  23. package/dist/components/core/inputs/MultiSelect.d.ts +5 -1
  24. package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -1
  25. package/dist/components/core/inputs/SingleSelect.d.ts +2 -0
  26. package/dist/components/core/inputs/SingleSelect.d.ts.map +1 -1
  27. package/dist/components/core/inputs/index.d.ts +1 -0
  28. package/dist/components/core/inputs/index.d.ts.map +1 -1
  29. package/dist/components/core/inputs/index.js +4 -4
  30. package/dist/components/core/language/index.js +1 -1
  31. package/dist/components/core/layouts/index.js +6 -6
  32. package/dist/components/core/navbar/index.js +1 -1
  33. package/dist/components/core/states/ErrorAlert.d.ts +5 -2
  34. package/dist/components/core/states/ErrorAlert.d.ts.map +1 -1
  35. package/dist/components/core/states/index.js +2 -2
  36. package/dist/components/core/table/index.js +3 -3
  37. package/dist/components/core/tabs/index.js +4 -4
  38. package/dist/components/core/theme/index.js +1 -1
  39. package/dist/components/index.js +19 -19
  40. package/dist/components/ui/button.d.ts.map +1 -1
  41. package/dist/components/ui/index.js +4 -4
  42. package/dist/dialogs-DVHdqXlO.js +217 -0
  43. package/dist/{inputs-BMCt-VqZ.js → inputs-DG8o5DMW.js} +3 -3
  44. package/dist/{language-DOGOdjzx.js → language-BvPG7v7d.js} +2 -2
  45. package/dist/{navbar-CCHGdEzE.js → navbar-CU6zaS92.js} +2 -2
  46. package/dist/{select-DmLScQKX.js → select-CsXmG_sJ.js} +1 -1
  47. package/dist/{sheet-DQTOen4V.js → sheet-4VOGdoiW.js} +1 -1
  48. package/dist/{states-BQK9jqS4.js → states-C4MdmAbW.js} +1 -1
  49. package/dist/tailwind/index.d.ts +5 -0
  50. package/dist/tailwind/index.d.ts.map +1 -1
  51. package/dist/tailwind/index.js +5 -0
  52. package/dist/{theme-q2uzluEd.js → theme-uTxCKUip.js} +2 -2
  53. package/dist/{tooltip-BmZ9Bfou.js → tooltip-CWdde1-y.js} +1 -1
  54. package/dist/{ui-D8Pg34YW.js → ui-rJqnHWNK.js} +3 -3
  55. package/package.json +1 -1
  56. package/dist/ErrorAlert-L2s8Dd1_.js +0 -27
  57. package/dist/GenericForm-D7ni-5-4.js +0 -309
  58. package/dist/dialogs-BjqvZvax.js +0 -207
@@ -0,0 +1,217 @@
1
+ import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
+ import { t } from "./i18n-d2p0RJo9.js";
3
+ import { Bn as n, Gn as r, Hn as i, I as a, Kn as o, Un as s, Wn as c, qn as l } from "./ui-rJqnHWNK.js";
4
+ import { s as u } from "./tooltip-CWdde1-y.js";
5
+ import { E as d, O as f, P as p, j as m, k as h } from "./sheet-4VOGdoiW.js";
6
+ import { t as g } from "./ErrorAlert-0L-Dwqu8.js";
7
+ import { t as _ } from "./GenericForm-CLgO9HuL.js";
8
+ import { useEffect as v, useId as y, useState as b } from "react";
9
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
10
+ import { Pen as w, Save as T, X as E } from "lucide-react";
11
+ //#region src/components/core/dialogs/AppDialog.tsx
12
+ var D = {
13
+ sm: "sm:max-w-sm",
14
+ md: "sm:max-w-md",
15
+ lg: "sm:max-w-lg",
16
+ xl: "sm:max-w-xl",
17
+ "2xl": "sm:max-w-2xl",
18
+ "3xl": "sm:max-w-3xl",
19
+ "4xl": "sm:max-w-4xl",
20
+ full: "sm:max-w-[95vw]"
21
+ };
22
+ function O({ open: n, onOpenChange: r, config: i, isLoading: o, error: s, footer: c, className: l, children: _ }) {
23
+ let { t: v } = t(), { title: y, description: b, icon: x, size: w = "xl", maxWidth: T, actions: E, headerClassName: O, footerClassName: k } = i, A = o === !0, j = (e) => typeof e == "string" ? v(e) : e, M = (e) => {
24
+ !e && A || r(e);
25
+ }, N = c !== void 0 || E !== void 0 && E.length > 0;
26
+ return /* @__PURE__ */ S(d, {
27
+ open: n,
28
+ onOpenChange: M,
29
+ children: /* @__PURE__ */ C(f, {
30
+ className: e("max-h-[100dvh] sm:max-h-[90vh] border-0 shadow-2xl p-0 flex flex-col overflow-hidden", "[&>button]:text-brand-foreground [&>button]:focus:ring-brand-foreground", A && "[&>button]:pointer-events-none [&>button]:opacity-40", T ?? D[w], l),
31
+ children: [
32
+ A ? /* @__PURE__ */ S("div", {
33
+ className: "absolute top-0 left-0 right-0 z-10",
34
+ children: /* @__PURE__ */ S(a, {
35
+ indeterminate: !0,
36
+ className: "h-1 rounded-none"
37
+ })
38
+ }) : null,
39
+ /* @__PURE__ */ C(m, {
40
+ className: e("bg-gradient-to-r from-brand-from to-brand-to p-4 sm:p-6 pr-12 sm:pr-12 sm:rounded-t-surface shrink-0", O),
41
+ children: [/* @__PURE__ */ C(p, {
42
+ className: "text-xl sm:text-2xl font-bold flex items-center gap-2 text-brand-foreground",
43
+ children: [x === void 0 ? null : /* @__PURE__ */ S("div", {
44
+ className: "p-2 bg-brand-foreground/20 rounded-control",
45
+ children: /* @__PURE__ */ S(x, { className: "size-4 text-brand-foreground" })
46
+ }), j(y)]
47
+ }), b !== void 0 && b !== "" ? /* @__PURE__ */ S(h, {
48
+ className: "text-brand-foreground/80 text-base",
49
+ children: j(b)
50
+ }) : null]
51
+ }),
52
+ s ? /* @__PURE__ */ S("div", {
53
+ className: "px-4 sm:px-6 pt-4",
54
+ children: /* @__PURE__ */ S(g, {
55
+ error: s,
56
+ className: "max-w-full"
57
+ })
58
+ }) : null,
59
+ /* @__PURE__ */ S("div", {
60
+ className: "flex-1 overflow-y-auto px-4 sm:px-6 py-4",
61
+ children: _
62
+ }),
63
+ N ? /* @__PURE__ */ S("div", {
64
+ className: e("sm:rounded-b-surface border-t border-border bg-muted/40 shrink-0 p-4 sm:p-6", k),
65
+ children: c ?? /* @__PURE__ */ S("div", {
66
+ className: "flex justify-end gap-3",
67
+ children: E?.map((e) => /* @__PURE__ */ C(u, {
68
+ type: e.type ?? "button",
69
+ form: e.form,
70
+ variant: e.variant ?? "default",
71
+ onClick: e.onClick,
72
+ disabled: e.disabled === !0 || A && e.disableOnLoading !== !1,
73
+ className: e.className,
74
+ children: [e.icon === void 0 ? null : /* @__PURE__ */ S(e.icon, { className: "size-4" }), v(e.label)]
75
+ }, e.id ?? e.label))
76
+ })
77
+ }) : null
78
+ ]
79
+ })
80
+ });
81
+ }
82
+ //#endregion
83
+ //#region src/components/core/dialogs/FormDialog.tsx
84
+ function k({ open: e, onOpenChange: n, data: r, title: i, headerBadge: a, schema: o, onSave: s, customFooter: c, defaultEditing: l = !1, footerActions: d = !0, saveLabel: f, cancelLabel: p, hideSaveIcon: m = !1, size: h = "4xl", maxWidth: g, isLoading: D = !1 }) {
85
+ let { t: k } = t(), A = f ?? k("actions.save"), [j, M] = b(l), [N, P] = b(!1), F = y();
86
+ if (v(() => {
87
+ e && M(l);
88
+ }, [e, l]), r == null) return null;
89
+ let I = () => {
90
+ M(!0);
91
+ }, L = () => {
92
+ M(!1);
93
+ }, R = async (e) => {
94
+ if (s) {
95
+ P(!0);
96
+ try {
97
+ await s(e), M(!1);
98
+ } catch (e) {
99
+ console.error(e);
100
+ } finally {
101
+ P(!1);
102
+ }
103
+ }
104
+ }, z = [];
105
+ s !== void 0 && (j ? (p !== "" && z.push({
106
+ label: p ?? k("actions.cancel"),
107
+ onClick: L,
108
+ variant: "outline",
109
+ disabled: N || D,
110
+ icon: E
111
+ }), z.push({
112
+ label: N ? k("actions.saving") : A,
113
+ type: "submit",
114
+ form: F,
115
+ variant: "default",
116
+ disabled: N || D,
117
+ icon: m ? void 0 : T
118
+ })) : z.push({
119
+ label: k("actions.edit"),
120
+ onClick: I,
121
+ variant: "outline",
122
+ icon: w
123
+ }));
124
+ let B = {
125
+ title: i(r),
126
+ size: h,
127
+ maxWidth: g,
128
+ actions: d ? z : []
129
+ };
130
+ return /* @__PURE__ */ S(O, {
131
+ open: e,
132
+ onOpenChange: (e) => {
133
+ n(e), e || L();
134
+ },
135
+ config: B,
136
+ isLoading: N || D,
137
+ children: /* @__PURE__ */ C("div", { children: [
138
+ a === void 0 ? null : /* @__PURE__ */ S("div", {
139
+ className: "mb-4",
140
+ children: a(r)
141
+ }),
142
+ /* @__PURE__ */ S(_, {
143
+ id: F,
144
+ schema: o,
145
+ initialData: r,
146
+ disabled: !j,
147
+ onSubmit: (e) => {
148
+ R(e);
149
+ },
150
+ renderActions: !1,
151
+ isLoading: N || D
152
+ }),
153
+ c === void 0 ? null : c(r),
154
+ s !== void 0 && !d ? /* @__PURE__ */ S("div", {
155
+ className: "flex justify-end gap-2 border-t pt-4 mt-6",
156
+ children: j ? /* @__PURE__ */ C(x, { children: [p === "" ? null : /* @__PURE__ */ C(u, {
157
+ onClick: L,
158
+ variant: "outline",
159
+ size: "sm",
160
+ disabled: N || D,
161
+ children: [/* @__PURE__ */ S(E, { className: "size-4 mr-2" }), p ?? k("actions.cancel")]
162
+ }), /* @__PURE__ */ C(u, {
163
+ type: "submit",
164
+ form: F,
165
+ size: "sm",
166
+ disabled: N || D,
167
+ className: "text-white",
168
+ children: [m ? null : /* @__PURE__ */ S(T, { className: "size-4 mr-2" }), N ? k("actions.saving") : A]
169
+ })] }) : /* @__PURE__ */ C(u, {
170
+ onClick: I,
171
+ variant: "outline",
172
+ size: "sm",
173
+ children: [/* @__PURE__ */ S(w, { className: "size-4 mr-2" }), k("actions.edit")]
174
+ })
175
+ }) : null
176
+ ] })
177
+ });
178
+ }
179
+ //#endregion
180
+ //#region src/components/core/dialogs/ConfirmationDialog.tsx
181
+ function A({ isLoading: e, error: a, config: d, destructive: f = !1 }) {
182
+ let { t: p } = t();
183
+ return d ? /* @__PURE__ */ S(n, {
184
+ open: d.isOpen,
185
+ onOpenChange: (t) => {
186
+ !t && !e && d.onClose();
187
+ },
188
+ children: /* @__PURE__ */ C(s, { children: [
189
+ /* @__PURE__ */ C(o, { children: [
190
+ /* @__PURE__ */ C(l, {
191
+ className: d.titleClassName,
192
+ children: [d.icon && /* @__PURE__ */ S(d.icon, { className: "size-4" }), p(d.title)]
193
+ }),
194
+ d.headerClassName && /* @__PURE__ */ S(o, { className: d.headerClassName }),
195
+ /* @__PURE__ */ S(c, { children: p(d.description) }),
196
+ d.itemName && /* @__PURE__ */ S(c, { children: /* @__PURE__ */ S("span", {
197
+ className: "font-semibold block my-2",
198
+ children: d.itemName
199
+ }) })
200
+ ] }),
201
+ /* @__PURE__ */ S(g, { error: a }),
202
+ /* @__PURE__ */ C(r, { children: [/* @__PURE__ */ S(i, {
203
+ disabled: e,
204
+ children: p("actions.cancel")
205
+ }), /* @__PURE__ */ S(u, {
206
+ onClick: (e) => {
207
+ e.preventDefault(), d.onConfirm();
208
+ },
209
+ disabled: e,
210
+ className: f ? "bg-destructive text-destructive-foreground hover:bg-destructive/90" : "",
211
+ children: p(e ? d.loadingKey ?? "states.loading" : d.confirmKey)
212
+ })] })
213
+ ] })
214
+ }) : null;
215
+ }
216
+ //#endregion
217
+ export { k as n, O as r, A as t };
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import "./ImageInput-BPNEywyf.js";
3
- import "./MultiSelect-CZ4hye2w.js";
4
- import "./SearchInput-nr0CrMLK.js";
2
+ import "./ImageInput-DYGqUTBi.js";
3
+ import "./MultiSelect-CXnF_D0R.js";
4
+ import "./SearchInput-DDcL_q7h.js";
5
5
  import { jsx as t } from "react/jsx-runtime";
6
6
  import { Heart as n, Star as r } from "lucide-react";
7
7
  //#region src/components/core/inputs/RatingInput.tsx
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./i18n-d2p0RJo9.js";
2
- import { i as t, n, r, s as i, t as a } from "./tooltip-BmZ9Bfou.js";
3
- import { i as o, l as s, n as c, t as l, u } from "./select-DmLScQKX.js";
2
+ import { i as t, n, r, s as i, t as a } from "./tooltip-CWdde1-y.js";
3
+ import { i as o, l as s, n as c, t as l, u } from "./select-CsXmG_sJ.js";
4
4
  import { t as d } from "./useLanguage-BVUtoDnh.js";
5
5
  import "react";
6
6
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
2
  import { t } from "./i18n-d2p0RJo9.js";
3
- import { i as n, n as r, r as i, s as a, t as o } from "./tooltip-BmZ9Bfou.js";
4
- import { C as s, S as c, b as l, d as u, g as d, h as f, i as p, l as m, m as h, p as g, r as _, t as v, v as y, x as b, y as x } from "./sheet-DQTOen4V.js";
3
+ import { i as n, n as r, r as i, s as a, t as o } from "./tooltip-CWdde1-y.js";
4
+ import { C as s, S as c, b as l, d as u, g as d, h as f, i as p, l as m, m as h, p as g, r as _, t as v, v as y, x as b, y as x } from "./sheet-4VOGdoiW.js";
5
5
  import { t as S } from "./skeleton-D6Ga4BLw.js";
6
6
  import { c as C } from "./behavior-CFsFoY50.js";
7
7
  import "./hooks/index.js";
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import { o as t } from "./tooltip-BmZ9Bfou.js";
2
+ import { o as t } from "./tooltip-CWdde1-y.js";
3
3
  import * as n from "react";
4
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
5
  import { CheckIcon as a, ChevronDownIcon as o, ChevronUpIcon as s, XIcon as c } from "lucide-react";
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
2
  import "./helpers/index.js";
3
3
  import { t } from "./i18n-d2p0RJo9.js";
4
- import { a as n } from "./tooltip-BmZ9Bfou.js";
4
+ import { a as n } from "./tooltip-CWdde1-y.js";
5
5
  import * as r from "react";
6
6
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
7
  import { SearchIcon as o, X as s } from "lucide-react";
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./i18n-d2p0RJo9.js";
2
- import "./ErrorAlert-L2s8Dd1_.js";
2
+ import "./ErrorAlert-0L-Dwqu8.js";
3
3
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
4
  import { Loader2Icon as r } from "lucide-react";
5
5
  //#region src/components/core/states/ErrorState.tsx
@@ -82,6 +82,11 @@ declare const krosoftPreset: {
82
82
  DEFAULT: string;
83
83
  foreground: string;
84
84
  };
85
+ brand: {
86
+ from: string;
87
+ to: string;
88
+ foreground: string;
89
+ };
85
90
  success: {
86
91
  DEFAULT: string;
87
92
  foreground: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tailwind/index.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,UAAiD,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmLQ,CAAC;AAE5B,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tailwind/index.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,UAAiD,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4LQ,CAAC;AAE5B,eAAe,aAAa,CAAC"}
@@ -91,6 +91,11 @@ var t = Object.create, n = Object.defineProperty, r = Object.getOwnPropertyDescr
91
91
  DEFAULT: "hsl(var(--card))",
92
92
  foreground: "hsl(var(--card-foreground))"
93
93
  },
94
+ brand: {
95
+ from: "hsl(var(--k-brand-from))",
96
+ to: "hsl(var(--k-brand-to))",
97
+ foreground: "hsl(var(--k-brand-foreground))"
98
+ },
94
99
  success: {
95
100
  DEFAULT: "hsl(var(--k-success))",
96
101
  foreground: "hsl(var(--k-success-foreground))"
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./i18n-d2p0RJo9.js";
2
- import { i as t, n, r, s as i, t as a } from "./tooltip-BmZ9Bfou.js";
3
- import { i as o, l as s, n as c, t as l, u } from "./select-DmLScQKX.js";
2
+ import { i as t, n, r, s as i, t as a } from "./tooltip-CWdde1-y.js";
3
+ import { i as o, l as s, n as c, t as l, u } from "./select-CsXmG_sJ.js";
4
4
  import { t as d } from "./useTheme-CNx4iolb.js";
5
5
  import "react";
6
6
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
@@ -14,7 +14,7 @@ var o = r("inline-flex items-center justify-center gap-2 whitespace-nowrap round
14
14
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
15
15
  ghost: "hover:bg-accent hover:text-accent-foreground",
16
16
  link: "text-primary underline-offset-4 hover:underline",
17
- styled: "bg-gradient-to-r from-slate-900 to-purple-700 hover:from-slate-800 hover:to-purple-600 text-white shadow-lg shadow-purple-500/25 px-6 h-12"
17
+ styled: "bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from/90 hover:to-brand-to/90 text-brand-foreground shadow-lg shadow-brand-to/25 px-6 h-12"
18
18
  },
19
19
  size: {
20
20
  default: "h-10 px-4 py-2",
@@ -2,9 +2,9 @@ import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
2
  import "./helpers/index.js";
3
3
  import "./chart-Dq3AIrue.js";
4
4
  import "./alert-REQGK9bR.js";
5
- import { c as t, s as n } from "./tooltip-BmZ9Bfou.js";
6
- import "./sheet-DQTOen4V.js";
7
- import "./select-DmLScQKX.js";
5
+ import { c as t, s as n } from "./tooltip-CWdde1-y.js";
6
+ import "./sheet-4VOGdoiW.js";
7
+ import "./select-CsXmG_sJ.js";
8
8
  import "./skeleton-D6Ga4BLw.js";
9
9
  import { t as r } from "./useScrollFade-D9kqJBDh.js";
10
10
  import { n as i } from "./useToast-UeDRLovh.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.294",
3
+ "version": "0.0.295",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,27 +0,0 @@
1
- import { t as e } from "./i18n-d2p0RJo9.js";
2
- import { n as t, t as n } from "./alert-REQGK9bR.js";
3
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
- import { AlertTriangle as a } from "lucide-react";
5
- //#region src/components/core/states/ErrorAlert.tsx
6
- var o = ({ error: o }) => {
7
- let { t: s } = e();
8
- return o ? /* @__PURE__ */ i(n, {
9
- variant: "destructive",
10
- children: [/* @__PURE__ */ r(a, { className: "size-4" }), /* @__PURE__ */ i(t, { children: [/* @__PURE__ */ i("div", {
11
- className: "flex items-center space-x-2",
12
- children: [
13
- /* @__PURE__ */ r("span", {
14
- className: "font-semibold",
15
- children: s("states.errorPrefix")
16
- }),
17
- /* @__PURE__ */ r("span", { children: o.code }),
18
- /* @__PURE__ */ r("span", { children: o.message })
19
- ]
20
- }), o.errors && o.errors.length > 0 && /* @__PURE__ */ r("ul", {
21
- className: "mt-2 list-disc list-inside",
22
- children: o.errors.map((e, t) => /* @__PURE__ */ r("li", { children: e }, t))
23
- })] })]
24
- }) : null;
25
- };
26
- //#endregion
27
- export { o as t };