@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.
- package/dist/components/Button/buttonVariants.d.ts +1 -1
- package/dist/components/Calendar/Calendar.d.ts +2 -2
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +158 -150
- package/dist/components/Chip/Chip.d.ts +43 -0
- package/dist/components/Chip/Chip.d.ts.map +1 -0
- package/dist/components/Chip/Chip.js +98 -0
- package/dist/components/Chip/Chip.stories.d.ts +9 -0
- package/dist/components/Chip/Chip.stories.d.ts.map +1 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/Chip/index.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.d.ts +23 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.js +101 -0
- package/dist/components/DataTable/DataTable.stories.d.ts +14 -0
- package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +28 -26
- package/dist/components/ExpandableTable/Table.d.ts +1 -1
- package/dist/components/FileUpload/FileItem.d.ts.map +1 -1
- package/dist/components/FileUpload/FileItem.js +81 -77
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.js +98 -94
- package/dist/components/Flex/Flex.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +51 -50
- package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts +19 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts.map +1 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.js +19 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts +10 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts.map +1 -0
- package/dist/components/MuzaUIProvider/index.d.ts +2 -0
- package/dist/components/MuzaUIProvider/index.d.ts.map +1 -0
- package/dist/components/Reorderable/Reorderable.d.ts +100 -0
- package/dist/components/Reorderable/Reorderable.d.ts.map +1 -0
- package/dist/components/Reorderable/Reorderable.js +197 -0
- package/dist/components/Reorderable/Reorderable.stories.d.ts +14 -0
- package/dist/components/Reorderable/Reorderable.stories.d.ts.map +1 -0
- package/dist/components/Reorderable/index.d.ts +2 -0
- package/dist/components/Reorderable/index.d.ts.map +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.d.ts +40 -0
- package/dist/components/ReorderableTable/ReorderableTable.d.ts.map +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.js +175 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts +18 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -0
- package/dist/components/ReorderableTable/index.d.ts +2 -0
- package/dist/components/ReorderableTable/index.d.ts.map +1 -0
- package/dist/components/Searchbar/Searchbar.d.ts +1 -1
- package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
- package/dist/components/Searchbar/Searchbar.js +50 -49
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +43 -42
- package/dist/components/Stepper/Stepper.d.ts +1 -1
- package/dist/components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.js +43 -42
- package/dist/components/SwipeButton/SwipeButton.d.ts +1 -1
- package/dist/components/SwipeButton/SwipeButton.d.ts.map +1 -1
- package/dist/components/SwipeButton/SwipeButton.js +85 -84
- package/dist/components/SwipeButton/SwipeButton.stories.d.ts +1 -1
- package/dist/components/Typography/Typography.d.ts +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.js +217 -189
- package/dist/muza-ui.css +1 -1
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
- package/dist/node_modules/date-fns/constants.js +4 -0
- package/dist/node_modules/date-fns/constructFrom.js +8 -0
- package/dist/node_modules/date-fns/isSameWeek.js +14 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/formatDistance.js +275 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/formatLong.js +33 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/formatRelative.js +25 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/localize.js +167 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/match.js +109 -0
- package/dist/node_modules/date-fns/locale/cs.js +21 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/formatDistance.js +158 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/formatLong.js +33 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/formatRelative.js +60 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/localize.js +175 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/match.js +111 -0
- package/dist/node_modules/date-fns/locale/sk.js +21 -0
- package/dist/node_modules/date-fns/startOfWeek.js +11 -0
- package/dist/node_modules/date-fns/toDate.js +8 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +38 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +29 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.js +17 -0
- package/dist/node_modules/framer-motion/dist/es/context/ReorderContext.js +5 -0
- package/dist/node_modules/motion-utils/dist/es/array.js +15 -6
- package/dist/translations/TranslationContext.d.ts +61 -0
- package/dist/translations/TranslationContext.d.ts.map +1 -0
- package/dist/translations/TranslationContext.js +74 -0
- package/dist/translations/index.d.ts +6 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/locales/cs.d.ts +3 -0
- package/dist/translations/locales/cs.d.ts.map +1 -0
- package/dist/translations/locales/cs.js +56 -0
- package/dist/translations/locales/en.d.ts +3 -0
- package/dist/translations/locales/en.d.ts.map +1 -0
- package/dist/translations/locales/en.js +56 -0
- package/dist/translations/locales/sk.d.ts +3 -0
- package/dist/translations/locales/sk.d.ts.map +1 -0
- package/dist/translations/locales/sk.js +56 -0
- package/dist/translations/types.d.ts +126 -0
- package/dist/translations/types.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import * as y from "react";
|
|
3
|
-
import { cva as
|
|
4
|
-
import { useDropzone as
|
|
5
|
-
import { FileItem as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
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
|
-
),
|
|
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
|
-
),
|
|
59
|
+
), oe = y.forwardRef(
|
|
59
60
|
({
|
|
60
|
-
className:
|
|
61
|
-
onDrop:
|
|
61
|
+
className: S,
|
|
62
|
+
onDrop: g,
|
|
62
63
|
accept: f,
|
|
63
|
-
multiple:
|
|
64
|
+
multiple: U = !0,
|
|
64
65
|
maxSize: b,
|
|
65
|
-
maxSizeErrorMessage:
|
|
66
|
-
size:
|
|
66
|
+
maxSizeErrorMessage: T,
|
|
67
|
+
size: V = "base",
|
|
67
68
|
disabled: p = !1,
|
|
68
|
-
readOnly:
|
|
69
|
-
dropzoneOptions:
|
|
70
|
-
label:
|
|
71
|
-
title:
|
|
72
|
-
subtitle:
|
|
73
|
-
preselectedFiles:
|
|
74
|
-
fileStatus:
|
|
75
|
-
itemErrors:
|
|
76
|
-
itemHints:
|
|
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:
|
|
80
|
+
onDelete: M,
|
|
80
81
|
onChange: c,
|
|
81
|
-
...
|
|
82
|
-
},
|
|
83
|
-
const [
|
|
84
|
-
|
|
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 (
|
|
87
|
-
(
|
|
90
|
+
if ($(!1), a.length > 0 && a.some(
|
|
91
|
+
(r) => r.errors.some((l) => l.code === "file-too-large")
|
|
88
92
|
)) {
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
o == null || o(
|
|
93
|
+
$(!0);
|
|
94
|
+
const r = R || I;
|
|
95
|
+
o == null || o(r, a[0].file);
|
|
92
96
|
return;
|
|
93
97
|
}
|
|
94
|
-
|
|
95
|
-
const
|
|
98
|
+
F((e) => {
|
|
99
|
+
const r = new Set(
|
|
96
100
|
e.map((s) => `${s.name}-${s.size}-${s.lastModified}`)
|
|
97
|
-
),
|
|
98
|
-
(s) => !
|
|
99
|
-
),
|
|
100
|
-
return c == null || c(
|
|
101
|
-
}),
|
|
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
|
|
104
|
-
o == null || o(
|
|
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:
|
|
112
|
+
multiple: U,
|
|
109
113
|
maxSize: b,
|
|
110
114
|
disabled: p,
|
|
111
|
-
...
|
|
112
|
-
}),
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
!
|
|
115
|
-
|
|
116
|
-
|
|
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:
|
|
127
|
+
children: m
|
|
124
128
|
}
|
|
125
|
-
) :
|
|
126
|
-
/* @__PURE__ */
|
|
129
|
+
) : m),
|
|
130
|
+
/* @__PURE__ */ n(
|
|
127
131
|
"div",
|
|
128
132
|
{
|
|
129
|
-
ref:
|
|
133
|
+
ref: L,
|
|
130
134
|
tabIndex: p ? void 0 : 0,
|
|
131
|
-
className:
|
|
132
|
-
|
|
133
|
-
error:
|
|
135
|
+
className: A(
|
|
136
|
+
ee({
|
|
137
|
+
error: G || N,
|
|
134
138
|
disabled: p,
|
|
135
|
-
className:
|
|
136
|
-
isDragActive:
|
|
139
|
+
className: S,
|
|
140
|
+
isDragActive: X
|
|
137
141
|
})
|
|
138
142
|
),
|
|
139
|
-
...
|
|
140
|
-
...
|
|
143
|
+
...Q(),
|
|
144
|
+
...J,
|
|
141
145
|
children: [
|
|
142
|
-
/* @__PURE__ */ i("input", { ...
|
|
143
|
-
/* @__PURE__ */ i(
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
/* @__PURE__ */ i(
|
|
146
|
-
|
|
147
|
-
|
|
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:
|
|
153
|
-
|
|
156
|
+
className: A(
|
|
157
|
+
te({
|
|
154
158
|
disabled: p,
|
|
155
|
-
className:
|
|
159
|
+
className: S
|
|
156
160
|
})
|
|
157
161
|
),
|
|
158
|
-
children:
|
|
162
|
+
children: k
|
|
159
163
|
}
|
|
160
164
|
)
|
|
161
165
|
] })
|
|
162
166
|
]
|
|
163
167
|
}
|
|
164
168
|
),
|
|
165
|
-
|
|
166
|
-
|
|
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:
|
|
177
|
+
children: R
|
|
174
178
|
}
|
|
175
179
|
)
|
|
176
180
|
] }),
|
|
177
|
-
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-md", children:
|
|
178
|
-
const e =
|
|
179
|
-
return
|
|
180
|
-
|
|
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:
|
|
187
|
+
uploaded: r,
|
|
184
188
|
progress: e == null ? void 0 : e.progress,
|
|
185
189
|
disabled: p,
|
|
186
|
-
readOnly:
|
|
187
|
-
error:
|
|
188
|
-
note:
|
|
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:
|
|
194
|
+
size: V,
|
|
191
195
|
onDelete: () => {
|
|
192
196
|
try {
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
return c == null || c(
|
|
196
|
-
}),
|
|
197
|
-
} catch (
|
|
198
|
-
const
|
|
199
|
-
o == null || o(
|
|
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
|
-
|
|
213
|
+
oe.displayName = "FileUpload";
|
|
210
214
|
export {
|
|
211
|
-
|
|
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" |
|
|
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;
|
|
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
|
|
3
|
-
import { triggerWrapperVariants as
|
|
4
|
-
import {
|
|
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
|
|
7
|
-
import { AltArrowUpOutline as
|
|
8
|
-
import { cn as
|
|
9
|
-
const
|
|
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:
|
|
17
|
+
onChange: s,
|
|
17
18
|
value: r,
|
|
18
|
-
disabled:
|
|
19
|
-
prefix:
|
|
19
|
+
disabled: d,
|
|
20
|
+
prefix: m,
|
|
20
21
|
maxNumberOfVisibleTags: c = 2,
|
|
21
|
-
size:
|
|
22
|
-
placeholder:
|
|
23
|
-
} = T, v = R(() => new Map(o.map((e) => [e.value, e.label])), [o]),
|
|
24
|
-
const e = r && r.map((
|
|
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((
|
|
26
|
-
...e.slice(0, c).map((
|
|
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:
|
|
32
|
+
children: /* @__PURE__ */ t("span", { className: "truncate", children: l })
|
|
32
33
|
},
|
|
33
|
-
|
|
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
|
-
|
|
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,
|
|
50
|
-
return
|
|
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
|
-
|
|
53
|
+
a.current && O(a.current.offsetWidth);
|
|
53
54
|
};
|
|
54
55
|
e();
|
|
55
|
-
const
|
|
56
|
-
return
|
|
57
|
-
|
|
56
|
+
const l = new ResizeObserver(e);
|
|
57
|
+
return a.current && l.observe(a.current), () => {
|
|
58
|
+
l.disconnect();
|
|
58
59
|
};
|
|
59
|
-
}, [
|
|
60
|
+
}, [a]), /* @__PURE__ */ i("div", { className: "flex flex-col gap-sm", children: [
|
|
60
61
|
g && /* @__PURE__ */ t(
|
|
61
|
-
|
|
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
|
-
|
|
72
|
+
_,
|
|
72
73
|
{
|
|
73
74
|
onOpenChange: (e) => {
|
|
74
|
-
|
|
75
|
+
C(e);
|
|
75
76
|
},
|
|
76
77
|
children: [
|
|
77
|
-
/* @__PURE__ */ t(
|
|
78
|
+
/* @__PURE__ */ t(B, { disabled: d, asChild: !0, children: /* @__PURE__ */ t(
|
|
78
79
|
"button",
|
|
79
80
|
{
|
|
80
|
-
ref:
|
|
81
|
+
ref: a,
|
|
81
82
|
type: "button",
|
|
82
83
|
role: "input",
|
|
83
84
|
tabIndex: 0,
|
|
84
|
-
disabled:
|
|
85
|
-
className:
|
|
86
|
-
size:
|
|
85
|
+
disabled: d,
|
|
86
|
+
className: V({
|
|
87
|
+
size: D,
|
|
87
88
|
error: w,
|
|
88
89
|
expanded: y,
|
|
89
|
-
hasIcon: !!
|
|
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
|
-
|
|
93
|
+
m && /* @__PURE__ */ t(
|
|
93
94
|
"span",
|
|
94
95
|
{
|
|
95
|
-
className:
|
|
96
|
-
children:
|
|
96
|
+
className: d ? "text-comp-select-icon-disabled" : "text-comp-select-icon-brand-def",
|
|
97
|
+
children: m
|
|
97
98
|
}
|
|
98
99
|
),
|
|
99
|
-
|
|
100
|
+
W,
|
|
100
101
|
/* @__PURE__ */ t(
|
|
101
|
-
|
|
102
|
+
P,
|
|
102
103
|
{
|
|
103
|
-
className:
|
|
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
|
-
|
|
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
|
-
|
|
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: (
|
|
129
|
-
|
|
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
|
-
|
|
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
|
-
|
|
154
|
+
$.displayName = "MultiSelect";
|
|
154
155
|
export {
|
|
155
|
-
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MuzaUIProvider/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|