@vkzstudio/muza-ui 1.0.6 → 1.0.8

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 (107) hide show
  1. package/dist/components/Button/buttonVariants.d.ts +1 -1
  2. package/dist/components/Calendar/Calendar.d.ts +2 -2
  3. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  4. package/dist/components/Calendar/Calendar.js +158 -150
  5. package/dist/components/Chip/Chip.d.ts +43 -0
  6. package/dist/components/Chip/Chip.d.ts.map +1 -0
  7. package/dist/components/Chip/Chip.js +98 -0
  8. package/dist/components/Chip/Chip.stories.d.ts +9 -0
  9. package/dist/components/Chip/Chip.stories.d.ts.map +1 -0
  10. package/dist/components/Chip/index.d.ts +2 -0
  11. package/dist/components/Chip/index.d.ts.map +1 -0
  12. package/dist/components/DataTable/DataTable.d.ts +23 -0
  13. package/dist/components/DataTable/DataTable.d.ts.map +1 -0
  14. package/dist/components/DataTable/DataTable.js +101 -0
  15. package/dist/components/DataTable/DataTable.stories.d.ts +14 -0
  16. package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -0
  17. package/dist/components/DataTable/index.d.ts +2 -0
  18. package/dist/components/DataTable/index.d.ts.map +1 -0
  19. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  20. package/dist/components/Dialog/Dialog.js +28 -26
  21. package/dist/components/ExpandableTable/Table.d.ts +1 -1
  22. package/dist/components/FileUpload/FileItem.d.ts.map +1 -1
  23. package/dist/components/FileUpload/FileItem.js +81 -77
  24. package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
  25. package/dist/components/FileUpload/FileUpload.js +98 -94
  26. package/dist/components/Flex/Flex.d.ts +1 -1
  27. package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
  28. package/dist/components/MultiSelect/MultiSelect.js +51 -50
  29. package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts +19 -0
  30. package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts.map +1 -0
  31. package/dist/components/MuzaUIProvider/MuzaUIProvider.js +19 -0
  32. package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts +10 -0
  33. package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts.map +1 -0
  34. package/dist/components/MuzaUIProvider/index.d.ts +2 -0
  35. package/dist/components/MuzaUIProvider/index.d.ts.map +1 -0
  36. package/dist/components/Reorderable/Reorderable.d.ts +100 -0
  37. package/dist/components/Reorderable/Reorderable.d.ts.map +1 -0
  38. package/dist/components/Reorderable/Reorderable.js +197 -0
  39. package/dist/components/Reorderable/Reorderable.stories.d.ts +14 -0
  40. package/dist/components/Reorderable/Reorderable.stories.d.ts.map +1 -0
  41. package/dist/components/Reorderable/index.d.ts +2 -0
  42. package/dist/components/Reorderable/index.d.ts.map +1 -0
  43. package/dist/components/ReorderableTable/ReorderableTable.d.ts +40 -0
  44. package/dist/components/ReorderableTable/ReorderableTable.d.ts.map +1 -0
  45. package/dist/components/ReorderableTable/ReorderableTable.js +175 -0
  46. package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts +18 -0
  47. package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -0
  48. package/dist/components/ReorderableTable/index.d.ts +2 -0
  49. package/dist/components/ReorderableTable/index.d.ts.map +1 -0
  50. package/dist/components/Searchbar/Searchbar.d.ts +1 -1
  51. package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
  52. package/dist/components/Searchbar/Searchbar.js +50 -49
  53. package/dist/components/Select/Select.d.ts.map +1 -1
  54. package/dist/components/Select/Select.js +43 -42
  55. package/dist/components/Stepper/Stepper.d.ts +1 -1
  56. package/dist/components/Stepper/Stepper.d.ts.map +1 -1
  57. package/dist/components/Stepper/Stepper.js +43 -42
  58. package/dist/components/SwipeButton/SwipeButton.d.ts +1 -1
  59. package/dist/components/SwipeButton/SwipeButton.d.ts.map +1 -1
  60. package/dist/components/SwipeButton/SwipeButton.js +85 -84
  61. package/dist/components/SwipeButton/SwipeButton.stories.d.ts +1 -1
  62. package/dist/components/Typography/Typography.d.ts +1 -1
  63. package/dist/components/index.d.ts +6 -0
  64. package/dist/components/index.d.ts.map +1 -1
  65. package/dist/index.js +217 -189
  66. package/dist/muza-ui.css +1 -1
  67. package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
  68. package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
  69. package/dist/node_modules/date-fns/constants.js +4 -0
  70. package/dist/node_modules/date-fns/constructFrom.js +8 -0
  71. package/dist/node_modules/date-fns/isSameWeek.js +14 -0
  72. package/dist/node_modules/date-fns/locale/cs/_lib/formatDistance.js +275 -0
  73. package/dist/node_modules/date-fns/locale/cs/_lib/formatLong.js +33 -0
  74. package/dist/node_modules/date-fns/locale/cs/_lib/formatRelative.js +25 -0
  75. package/dist/node_modules/date-fns/locale/cs/_lib/localize.js +167 -0
  76. package/dist/node_modules/date-fns/locale/cs/_lib/match.js +109 -0
  77. package/dist/node_modules/date-fns/locale/cs.js +21 -0
  78. package/dist/node_modules/date-fns/locale/sk/_lib/formatDistance.js +158 -0
  79. package/dist/node_modules/date-fns/locale/sk/_lib/formatLong.js +33 -0
  80. package/dist/node_modules/date-fns/locale/sk/_lib/formatRelative.js +60 -0
  81. package/dist/node_modules/date-fns/locale/sk/_lib/localize.js +175 -0
  82. package/dist/node_modules/date-fns/locale/sk/_lib/match.js +111 -0
  83. package/dist/node_modules/date-fns/locale/sk.js +21 -0
  84. package/dist/node_modules/date-fns/startOfWeek.js +11 -0
  85. package/dist/node_modules/date-fns/toDate.js +8 -0
  86. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +38 -0
  87. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +29 -0
  88. package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.js +17 -0
  89. package/dist/node_modules/framer-motion/dist/es/context/ReorderContext.js +5 -0
  90. package/dist/node_modules/motion-utils/dist/es/array.js +15 -6
  91. package/dist/translations/TranslationContext.d.ts +61 -0
  92. package/dist/translations/TranslationContext.d.ts.map +1 -0
  93. package/dist/translations/TranslationContext.js +74 -0
  94. package/dist/translations/index.d.ts +6 -0
  95. package/dist/translations/index.d.ts.map +1 -0
  96. package/dist/translations/locales/cs.d.ts +3 -0
  97. package/dist/translations/locales/cs.d.ts.map +1 -0
  98. package/dist/translations/locales/cs.js +56 -0
  99. package/dist/translations/locales/en.d.ts +3 -0
  100. package/dist/translations/locales/en.d.ts.map +1 -0
  101. package/dist/translations/locales/en.js +56 -0
  102. package/dist/translations/locales/sk.d.ts +3 -0
  103. package/dist/translations/locales/sk.d.ts.map +1 -0
  104. package/dist/translations/locales/sk.js +56 -0
  105. package/dist/translations/types.d.ts +126 -0
  106. package/dist/translations/types.d.ts.map +1 -0
  107. package/package.json +2 -2
@@ -1,13 +1,14 @@
1
- import { jsxs as m, jsx as i } from "react/jsx-runtime";
1
+ import { jsxs as n, jsx as i } from "react/jsx-runtime";
2
2
  import * as y from "react";
3
- import { cva as A } from "class-variance-authority";
4
- import { useDropzone as X } from "react-dropzone";
5
- import { FileItem as Y } from "./FileItem.js";
6
- import { Flex as I } from "../Flex/Flex.js";
7
- import { Typography as n } from "../Typography/Typography.js";
8
- import { cn as R } from "../../utils/cn.js";
9
- import { CloudUploadOutline as Z } from "@solar-icons/react-perf";
10
- const D = A(
3
+ import { cva as P } from "class-variance-authority";
4
+ import { useDropzone as D } from "react-dropzone";
5
+ import { FileItem as H } from "./FileItem.js";
6
+ import { useMuzaTranslations as E } from "../../translations/TranslationContext.js";
7
+ import { Flex as j } from "../Flex/Flex.js";
8
+ import { Typography as x } from "../Typography/Typography.js";
9
+ import { cn as A } from "../../utils/cn.js";
10
+ import { CloudUploadOutline as C } from "@solar-icons/react-perf";
11
+ const ee = P(
11
12
  [
12
13
  "group relative cursor-pointer rounded-xl border-1 border-dashed transition-colors",
13
14
  "p-4xl pt-3xl pr-4xl pb-3xl",
@@ -43,7 +44,7 @@ const D = A(
43
44
  }
44
45
  }
45
46
  }
46
- ), H = A(
47
+ ), te = P(
47
48
  [
48
49
  "text-center transition-colors",
49
50
  "text-comp-file-upload-text-dark-secondary"
@@ -55,148 +56,151 @@ const D = A(
55
56
  }
56
57
  }
57
58
  }
58
- ), C = y.forwardRef(
59
+ ), oe = y.forwardRef(
59
60
  ({
60
- className: M,
61
- onDrop: x,
61
+ className: S,
62
+ onDrop: g,
62
63
  accept: f,
63
- multiple: k = !0,
64
+ multiple: U = !0,
64
65
  maxSize: b,
65
- maxSizeErrorMessage: F,
66
- size: P = "base",
66
+ maxSizeErrorMessage: T,
67
+ size: V = "base",
67
68
  disabled: p = !1,
68
- readOnly: g = !1,
69
- dropzoneOptions: V,
70
- label: u,
71
- title: B = "Nahraj soubor nebo obrázek",
72
- subtitle: w,
73
- preselectedFiles: K = [],
74
- fileStatus: T = [],
75
- itemErrors: h,
76
- itemHints: v,
77
- error: _,
69
+ readOnly: h = !1,
70
+ dropzoneOptions: K,
71
+ label: m,
72
+ title: _,
73
+ subtitle: k,
74
+ preselectedFiles: q = [],
75
+ fileStatus: B = [],
76
+ itemErrors: v,
77
+ itemHints: z,
78
+ error: G,
78
79
  onError: o,
79
- onDelete: z,
80
+ onDelete: M,
80
81
  onChange: c,
81
- ...q
82
- }, G) => {
83
- const [N, $] = y.useState(K), [S, U] = y.useState(!1), j = b ? `Max file size: ${(b / (1024 * 1024)).toFixed(0)}MB` : "", { getRootProps: J, getInputProps: L, isDragActive: O } = X({
84
- onDrop: (t, d) => {
82
+ ...J
83
+ }, L) => {
84
+ const u = E(), [w, F] = y.useState(q), [N, $] = y.useState(!1), O = _ ?? u.fileUpload.title, I = b ? u.fileUpload.maxSizeError.replace(
85
+ "{size}",
86
+ (b / (1024 * 1024)).toFixed(0)
87
+ ) : "", R = T ?? I, { getRootProps: Q, getInputProps: W, isDragActive: X } = D({
88
+ onDrop: (t, a) => {
85
89
  try {
86
- if (U(!1), d.length > 0 && d.some(
87
- (l) => l.errors.some((r) => r.code === "file-too-large")
90
+ if ($(!1), a.length > 0 && a.some(
91
+ (r) => r.errors.some((l) => l.code === "file-too-large")
88
92
  )) {
89
- U(!0);
90
- const l = F || j;
91
- o == null || o(l, d[0].file);
93
+ $(!0);
94
+ const r = R || I;
95
+ o == null || o(r, a[0].file);
92
96
  return;
93
97
  }
94
- $((e) => {
95
- const l = new Set(
98
+ F((e) => {
99
+ const r = new Set(
96
100
  e.map((s) => `${s.name}-${s.size}-${s.lastModified}`)
97
- ), r = t.filter(
98
- (s) => !l.has(`${s.name}-${s.size}-${s.lastModified}`)
99
- ), a = [...e, ...r];
100
- return c == null || c(a), a;
101
- }), x == null || x(t);
101
+ ), l = t.filter(
102
+ (s) => !r.has(`${s.name}-${s.size}-${s.lastModified}`)
103
+ ), d = [...e, ...l];
104
+ return c == null || c(d), d;
105
+ }), g == null || g(t);
102
106
  } catch (e) {
103
- const l = e instanceof Error ? e.message : "Failed to process files";
104
- o == null || o(l);
107
+ const r = e instanceof Error ? e.message : u.fileUpload.processingError;
108
+ o == null || o(r);
105
109
  }
106
110
  },
107
111
  accept: typeof f == "string" ? { [f]: [] } : f ? Object.fromEntries(f.map((t) => [t, []])) : void 0,
108
- multiple: k,
112
+ multiple: U,
109
113
  maxSize: b,
110
114
  disabled: p,
111
- ...V
112
- }), Q = g || !k && N.length > 0;
113
- return /* @__PURE__ */ m(I, { direction: "column", gap: "lg", children: [
114
- !Q && /* @__PURE__ */ m(I, { direction: "column", gap: "sm", children: [
115
- u && (typeof u == "string" ? /* @__PURE__ */ i(
116
- n,
115
+ ...K
116
+ }), Y = h || !U && w.length > 0;
117
+ return /* @__PURE__ */ n(j, { direction: "column", gap: "lg", children: [
118
+ !Y && /* @__PURE__ */ n(j, { direction: "column", gap: "sm", children: [
119
+ m && (typeof m == "string" ? /* @__PURE__ */ i(
120
+ x,
117
121
  {
118
122
  size: "sm",
119
123
  component: "label",
120
124
  weight: "regular",
121
125
  variant: "body",
122
126
  className: "caret-comp-input-text-primary",
123
- children: u
127
+ children: m
124
128
  }
125
- ) : u),
126
- /* @__PURE__ */ m(
129
+ ) : m),
130
+ /* @__PURE__ */ n(
127
131
  "div",
128
132
  {
129
- ref: G,
133
+ ref: L,
130
134
  tabIndex: p ? void 0 : 0,
131
- className: R(
132
- D({
133
- error: _ || S,
135
+ className: A(
136
+ ee({
137
+ error: G || N,
134
138
  disabled: p,
135
- className: M,
136
- isDragActive: O
139
+ className: S,
140
+ isDragActive: X
137
141
  })
138
142
  ),
139
- ...J(),
140
- ...q,
143
+ ...Q(),
144
+ ...J,
141
145
  children: [
142
- /* @__PURE__ */ i("input", { ...L() }),
143
- /* @__PURE__ */ i(Z, { className: "inline size-comp-file-upload-ico-size" }),
144
- /* @__PURE__ */ m("div", { children: [
145
- /* @__PURE__ */ i(n, { size: "base", component: "p", weight: "medium", children: B }),
146
- w && /* @__PURE__ */ i(
147
- n,
146
+ /* @__PURE__ */ i("input", { ...W() }),
147
+ /* @__PURE__ */ i(C, { className: "inline size-comp-file-upload-ico-size" }),
148
+ /* @__PURE__ */ n("div", { children: [
149
+ /* @__PURE__ */ i(x, { size: "base", component: "p", weight: "medium", children: O }),
150
+ k && /* @__PURE__ */ i(
151
+ x,
148
152
  {
149
153
  size: "sm",
150
154
  component: "p",
151
155
  weight: "regular",
152
- className: R(
153
- H({
156
+ className: A(
157
+ te({
154
158
  disabled: p,
155
- className: M
159
+ className: S
156
160
  })
157
161
  ),
158
- children: w
162
+ children: k
159
163
  }
160
164
  )
161
165
  ] })
162
166
  ]
163
167
  }
164
168
  ),
165
- S && /* @__PURE__ */ i(
166
- n,
169
+ N && /* @__PURE__ */ i(
170
+ x,
167
171
  {
168
172
  size: "sm",
169
173
  variant: "body",
170
174
  component: "p",
171
175
  weight: "regular",
172
176
  className: "text-comp-file-upload-text-error-def",
173
- children: F || j
177
+ children: R
174
178
  }
175
179
  )
176
180
  ] }),
177
- /* @__PURE__ */ i("ul", { className: "flex flex-col gap-md", children: N.map((t, d) => {
178
- const e = T[d], l = e == null ? void 0 : e.uploaded;
179
- return g && !l ? null : /* @__PURE__ */ i(
180
- Y,
181
+ /* @__PURE__ */ i("ul", { className: "flex flex-col gap-md", children: w.map((t, a) => {
182
+ const e = B[a], r = e == null ? void 0 : e.uploaded;
183
+ return h && !r ? null : /* @__PURE__ */ i(
184
+ H,
181
185
  {
182
186
  file: t,
183
- uploaded: l,
187
+ uploaded: r,
184
188
  progress: e == null ? void 0 : e.progress,
185
189
  disabled: p,
186
- readOnly: g,
187
- error: h == null ? void 0 : h.get(t),
188
- note: v == null ? void 0 : v.get(t),
190
+ readOnly: h,
191
+ error: v == null ? void 0 : v.get(t),
192
+ note: z == null ? void 0 : z.get(t),
189
193
  onError: o,
190
- size: P,
194
+ size: V,
191
195
  onDelete: () => {
192
196
  try {
193
- $((r) => {
194
- const a = r.filter((s, W) => W !== d);
195
- return c == null || c(a), a;
196
- }), z == null || z(t, d);
197
- } catch (r) {
198
- const a = r instanceof Error ? r.message : "Failed to delete file";
199
- o == null || o(a, t);
197
+ F((l) => {
198
+ const d = l.filter((s, Z) => Z !== a);
199
+ return c == null || c(d), d;
200
+ }), M == null || M(t, a);
201
+ } catch (l) {
202
+ const d = l instanceof Error ? l.message : u.fileUpload.deleteError;
203
+ o == null || o(d, t);
200
204
  }
201
205
  }
202
206
  },
@@ -206,7 +210,7 @@ const D = A(
206
210
  ] });
207
211
  }
208
212
  );
209
- C.displayName = "FileUpload";
213
+ oe.displayName = "FileUpload";
210
214
  export {
211
- C as FileUpload
215
+ oe as FileUpload
212
216
  };
@@ -23,7 +23,7 @@ declare const flexVariants: (props?: ({
23
23
  wrap?: "wrap" | "nowrap" | "wrap-reverse" | null | undefined;
24
24
  justify?: "end" | "start" | "center" | "between" | "around" | "evenly" | "stretch" | null | undefined;
25
25
  align?: "end" | "start" | "center" | "stretch" | "baseline" | null | undefined;
26
- flex?: "none" | 1 | "auto" | "initial" | null | undefined;
26
+ flex?: 1 | "none" | "auto" | "initial" | null | undefined;
27
27
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
28
28
  type HTMLElementTag = keyof React.JSX.IntrinsicElements & keyof HTMLElementTagNameMap;
29
29
  export interface FlexProps extends Omit<VariantProps<typeof flexVariants>, 'gap' | 'gapX' | 'gapY' | 'p' | 'px' | 'py' | 'pt' | 'pr' | 'pb' | 'pl' | 'm' | 'mx' | 'my' | 'mt' | 'mr' | 'mb' | 'ml'>, SpacingProps {
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../src/components/MultiSelect/MultiSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,KAAK,SAAS,EAKf,MAAM,OAAO,CAAA;AAad,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,OAAO,EAAE,KAAK,CAAC;QACb,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,SAAS,CAAA;QAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB,IAAI,CAAC,EAAE,SAAS,CAAA;KACjB,CAAC,CAAA;IACF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACrC;AAED,eAAO,MAAM,WAAW,6FAqMvB,CAAA"}
1
+ {"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../src/components/MultiSelect/MultiSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,KAAK,SAAS,EAKf,MAAM,OAAO,CAAA;AAcd,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,OAAO,EAAE,KAAK,CAAC;QACb,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,SAAS,CAAA;QAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB,IAAI,CAAC,EAAE,SAAS,CAAA;KACjB,CAAC,CAAA;IACF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACrC;AAED,eAAO,MAAM,WAAW,6FAwMvB,CAAA"}
@@ -1,43 +1,44 @@
1
1
  import { jsx as t, jsxs as i } from "react/jsx-runtime";
2
- import p, { forwardRef as O, useMemo as R, useRef as j, useEffect as k } from "react";
3
- import { triggerWrapperVariants as A } from "../Select/utils.js";
4
- import { Typography as u } from "../Typography/Typography.js";
2
+ import u, { forwardRef as k, useMemo as R, useRef as A, useEffect as I } from "react";
3
+ import { triggerWrapperVariants as V } from "../Select/utils.js";
4
+ import { useMuzaTranslations as E } from "../../translations/TranslationContext.js";
5
+ import { Typography as f } from "../Typography/Typography.js";
5
6
  import { Tag as h } from "../Tag/Tag.js";
6
- import { DropdownMenu as I, DropdownMenuTrigger as V, DropdownMenuContent as E, DropdownMenuCheckboxItem as _ } from "../DropdownMenu/DropdownMenu.js";
7
- import { AltArrowUpOutline as B } from "@solar-icons/react-perf";
8
- import { cn as F } from "../../utils/cn.js";
9
- const L = O(
7
+ import { DropdownMenu as _, DropdownMenuTrigger as B, DropdownMenuContent as F, DropdownMenuCheckboxItem as L } from "../DropdownMenu/DropdownMenu.js";
8
+ import { AltArrowUpOutline as P } from "@solar-icons/react-perf";
9
+ import { cn as U } from "../../utils/cn.js";
10
+ const $ = k(
10
11
  (T, x) => {
11
- const {
12
+ const z = E(), {
12
13
  label: g,
13
14
  hint: b,
14
15
  error: w,
15
16
  options: o,
16
- onChange: l,
17
+ onChange: s,
17
18
  value: r,
18
- disabled: m,
19
- prefix: d,
19
+ disabled: d,
20
+ prefix: m,
20
21
  maxNumberOfVisibleTags: c = 2,
21
- size: z,
22
- placeholder: N = "Select..."
23
- } = T, v = R(() => new Map(o.map((e) => [e.value, e.label])), [o]), S = R(() => {
24
- const e = r && r.map((s) => v.get(s));
25
- return e != null && e.length ? e.length <= c ? /* @__PURE__ */ t("div", { className: "flex flex-1 items-start justify-start gap-xs", children: e.map((s, a) => /* @__PURE__ */ t(h, { variant: "info", className: "max-w-[72px]", children: s }, a)) }) : /* @__PURE__ */ t("div", { className: "flex flex-1 items-center gap-xs", children: [
26
- ...e.slice(0, c).map((s, a) => /* @__PURE__ */ t(
22
+ size: D,
23
+ placeholder: S
24
+ } = T, N = S ?? z.select.placeholder, v = R(() => new Map(o.map((e) => [e.value, e.label])), [o]), W = R(() => {
25
+ const e = r && r.map((l) => v.get(l));
26
+ return e != null && e.length ? e.length <= c ? /* @__PURE__ */ t("div", { className: "flex flex-1 items-start justify-start gap-xs", children: e.map((l, n) => /* @__PURE__ */ t(h, { variant: "info", className: "max-w-[72px]", children: l }, n)) }) : /* @__PURE__ */ t("div", { className: "flex flex-1 items-center gap-xs", children: [
27
+ ...e.slice(0, c).map((l, n) => /* @__PURE__ */ t(
27
28
  h,
28
29
  {
29
30
  variant: "info",
30
31
  className: "max-w-[72px] overflow-hidden",
31
- children: /* @__PURE__ */ t("span", { className: "truncate", children: s })
32
+ children: /* @__PURE__ */ t("span", { className: "truncate", children: l })
32
33
  },
33
- a
34
+ n
34
35
  )),
35
36
  /* @__PURE__ */ i(h, { variant: "info", children: [
36
37
  e.length - c,
37
38
  "+"
38
39
  ] }, "more")
39
40
  ] }) : /* @__PURE__ */ t(
40
- u,
41
+ f,
41
42
  {
42
43
  size: "input",
43
44
  className: "grow-1 fix-y-text truncate text-left text-comp-select-text-placeholder",
@@ -46,19 +47,19 @@ const L = O(
46
47
  children: N
47
48
  }
48
49
  );
49
- }, [r, N, c, v]), [y, D] = p.useState(!1), [M, W] = p.useState(0), f = p.useRef(!1), C = j(null), n = (typeof x == "function" ? null : x) ?? C;
50
- return k(() => {
50
+ }, [r, N, c, v]), [y, C] = u.useState(!1), [M, O] = u.useState(0), p = u.useRef(!1), j = A(null), a = (typeof x == "function" ? null : x) ?? j;
51
+ return I(() => {
51
52
  const e = () => {
52
- n.current && W(n.current.offsetWidth);
53
+ a.current && O(a.current.offsetWidth);
53
54
  };
54
55
  e();
55
- const s = new ResizeObserver(e);
56
- return n.current && s.observe(n.current), () => {
57
- s.disconnect();
56
+ const l = new ResizeObserver(e);
57
+ return a.current && l.observe(a.current), () => {
58
+ l.disconnect();
58
59
  };
59
- }, [n]), /* @__PURE__ */ i("div", { className: "flex flex-col gap-sm", children: [
60
+ }, [a]), /* @__PURE__ */ i("div", { className: "flex flex-col gap-sm", children: [
60
61
  g && /* @__PURE__ */ t(
61
- u,
62
+ f,
62
63
  {
63
64
  component: "label",
64
65
  size: "sm",
@@ -68,39 +69,39 @@ const L = O(
68
69
  }
69
70
  ),
70
71
  /* @__PURE__ */ i(
71
- I,
72
+ _,
72
73
  {
73
74
  onOpenChange: (e) => {
74
- D(e);
75
+ C(e);
75
76
  },
76
77
  children: [
77
- /* @__PURE__ */ t(V, { disabled: m, asChild: !0, children: /* @__PURE__ */ t(
78
+ /* @__PURE__ */ t(B, { disabled: d, asChild: !0, children: /* @__PURE__ */ t(
78
79
  "button",
79
80
  {
80
- ref: n,
81
+ ref: a,
81
82
  type: "button",
82
83
  role: "input",
83
84
  tabIndex: 0,
84
- disabled: m,
85
- className: A({
86
- size: z,
85
+ disabled: d,
86
+ className: V({
87
+ size: D,
87
88
  error: w,
88
89
  expanded: y,
89
- hasIcon: !!d || (r == null ? void 0 : r.length) === 0
90
+ hasIcon: !!m || (r == null ? void 0 : r.length) === 0
90
91
  }),
91
92
  children: /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 items-center gap-sm", children: [
92
- d && /* @__PURE__ */ t(
93
+ m && /* @__PURE__ */ t(
93
94
  "span",
94
95
  {
95
- className: m ? "text-comp-select-icon-disabled" : "text-comp-select-icon-brand-def",
96
- children: d
96
+ className: d ? "text-comp-select-icon-disabled" : "text-comp-select-icon-brand-def",
97
+ children: m
97
98
  }
98
99
  ),
99
- S,
100
+ W,
100
101
  /* @__PURE__ */ t(
101
- B,
102
+ P,
102
103
  {
103
- className: F(
104
+ className: U(
104
105
  "transition-transform duration-200",
105
106
  y ? "rotate-0" : "rotate-180"
106
107
  )
@@ -110,23 +111,23 @@ const L = O(
110
111
  }
111
112
  ) }),
112
113
  /* @__PURE__ */ t(
113
- E,
114
+ F,
114
115
  {
115
116
  className: "mt-1",
116
117
  style: {
117
118
  width: M > 0 ? `${M}px` : void 0
118
119
  },
119
120
  onCloseAutoFocus: (e) => {
120
- f.current || e.preventDefault(), f.current = !1;
121
+ p.current || e.preventDefault(), p.current = !1;
121
122
  },
122
123
  children: o.map((e) => /* @__PURE__ */ t(
123
- _,
124
+ L,
124
125
  {
125
126
  checked: r == null ? void 0 : r.includes(e.value),
126
127
  disabled: e.disabled,
127
128
  icon: e.icon,
128
- onCheckedChange: (s) => {
129
- s ? l == null || l([...r || [], e.value]) : l == null || l((r || []).filter((a) => a !== e.value)), f.current = !0;
129
+ onCheckedChange: (l) => {
130
+ l ? s == null || s([...r || [], e.value]) : s == null || s((r || []).filter((n) => n !== e.value)), p.current = !0;
130
131
  },
131
132
  children: e.label
132
133
  },
@@ -138,7 +139,7 @@ const L = O(
138
139
  }
139
140
  ),
140
141
  b && /* @__PURE__ */ t(
141
- u,
142
+ f,
142
143
  {
143
144
  component: "p",
144
145
  size: "sm",
@@ -150,7 +151,7 @@ const L = O(
150
151
  ] });
151
152
  }
152
153
  );
153
- L.displayName = "MultiSelect";
154
+ $.displayName = "MultiSelect";
154
155
  export {
155
- L as MultiSelect
156
+ $ as MultiSelect
156
157
  };
@@ -0,0 +1,19 @@
1
+ import { ToasterProps } from 'sonner';
2
+ import { TranslationConfig } from '../../translations/index';
3
+ import { TooltipProvider } from '../Tooltip';
4
+ import * as React from 'react';
5
+ export type MuzaTooltipConfig = Omit<React.ComponentPropsWithoutRef<typeof TooltipProvider>, 'children'>;
6
+ export type MuzaToastConfig = Omit<ToasterProps, 'children'>;
7
+ export interface MuzaUIProviderProps {
8
+ children: React.ReactNode;
9
+ tooltipConfig?: MuzaTooltipConfig;
10
+ toastConfig?: MuzaToastConfig;
11
+ /** Translation configuration for locale and custom translations */
12
+ translationConfig?: TranslationConfig;
13
+ }
14
+ declare const MuzaUIProvider: {
15
+ ({ children, tooltipConfig, toastConfig, translationConfig, }: MuzaUIProviderProps): import("react/jsx-runtime").JSX.Element;
16
+ displayName: string;
17
+ };
18
+ export { MuzaUIProvider };
19
+ //# sourceMappingURL=MuzaUIProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MuzaUIProvider.d.ts","sourceRoot":"","sources":["../../../src/components/MuzaUIProvider/MuzaUIProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,EACtD,UAAU,CACX,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAA;AAE5D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,aAAa,CAAC,EAAE,iBAAiB,CAAA;IACjC,WAAW,CAAC,EAAE,eAAe,CAAA;IAC7B,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACtC;AAED,QAAA,MAAM,cAAc;mEAKjB,mBAAmB;;CASrB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,19 @@
1
+ import { jsx as r, jsxs as e } from "react/jsx-runtime";
2
+ import "react";
3
+ import "sonner";
4
+ import { TranslationProvider as p } from "../../translations/TranslationContext.js";
5
+ import { TooltipProvider as a } from "../Tooltip/Tooltip.js";
6
+ import { ToastContainer as n } from "../Toast/ToastContainer.js";
7
+ const d = ({
8
+ children: o,
9
+ tooltipConfig: i = {},
10
+ toastConfig: t = {},
11
+ translationConfig: m = {}
12
+ }) => /* @__PURE__ */ r(p, { ...m, children: /* @__PURE__ */ e(a, { ...i, children: [
13
+ o,
14
+ /* @__PURE__ */ r(n, { ...t })
15
+ ] }) });
16
+ d.displayName = "MuzaUIProvider";
17
+ export {
18
+ d as MuzaUIProvider
19
+ };
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { MuzaUIProvider } from './MuzaUIProvider';
3
+ declare const meta: Meta<typeof MuzaUIProvider>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MuzaUIProvider>;
6
+ export declare const Default: Story;
7
+ export declare const CustomTooltipDelay: Story;
8
+ export declare const CustomToastPosition: Story;
9
+ export declare const LanguageProviderShowcase: Story;
10
+ //# sourceMappingURL=MuzaUIProvider.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MuzaUIProvider.stories.d.ts","sourceRoot":"","sources":["../../../src/components/MuzaUIProvider/MuzaUIProvider.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAQ3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CA0ErC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAA;AAE5C,eAAO,MAAM,OAAO,EAAE,KAoCrB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAsBhC,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAwBjC,CAAA;AAED,eAAO,MAAM,wBAAwB,EAAE,KA+CtC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './MuzaUIProvider';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MuzaUIProvider/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}