@hai-dev/ui-kit 1.0.6 → 1.0.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.
- package/dist/{Box-CiYPzbPd.js → Box-D8oKffw9.js} +18 -17
- package/dist/{Button-chJUX25I.js → Button-BBF8hp7e.js} +16 -15
- package/dist/{ButtonBase-DZwhOh56.js → ButtonBase-T2KH9jsD.js} +2 -2
- package/dist/{CircularProgress-BCrSQadM.js → CircularProgress-BQQkuSse.js} +110 -136
- package/dist/{DialogTitle-BUcXvkzd.js → Dialog-B97c7WYP.js} +765 -1010
- package/dist/DialogTitle-Du4tqTs0.js +254 -0
- package/dist/{Typography-BmYEfS8y.js → Typography-r_TXEM1e.js} +4 -4
- package/dist/assets/upload-dialog-errors.css +1 -0
- package/dist/assets/upload-dialog.css +1 -1
- package/dist/{chainPropTypes-HYSaT0L0.js → chainPropTypes-KIxDwPzf.js} +15 -15
- package/dist/components/button/button.js +1 -1
- package/dist/components/circular-progress-loader/circular-progress-loader.js +3 -3
- package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +26 -25
- package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +1 -1
- package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +17 -17
- package/dist/components/photo-crop-uploader/components/upload-dialog/types.d.ts +12 -1
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.d.ts +3 -0
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.js +10 -0
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +152 -129
- package/dist/components/photo-crop-uploader/constants.d.ts +3 -0
- package/dist/components/photo-crop-uploader/constants.js +35 -32
- package/dist/components/photo-crop-uploader/locale.js +8 -2
- package/dist/components/photo-crop-uploader/photo-crop-uploader.js +169 -145
- package/dist/components/photo-crop-uploader/types.d.ts +4 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -1
- package/dist/createSimplePaletteValueFilter-nb0wSOzC.js +30 -0
- package/dist/{createTheme-BfVKUMHQ.js → createTheme-RvzX1VSA.js} +9 -9
- package/dist/extendSxProp-BW9e6LtL.js +36 -0
- package/dist/upload-dialog-errors-ku54UrUb.js +365 -0
- package/dist/useTheme-CsjkCBFJ.js +16 -0
- package/package.json +1 -1
- package/dist/extendSxProp-bpz0eCso.js +0 -49
|
@@ -1,205 +1,229 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as s, useRef as
|
|
1
|
+
import { jsxs as So, Fragment as To, jsx as E } from "react/jsx-runtime";
|
|
2
|
+
import { useState as s, useRef as j } from "react";
|
|
3
3
|
import "../../index-BiffjjQq.js";
|
|
4
|
-
import { c as
|
|
5
|
-
import { localizedText as
|
|
6
|
-
import { EN_LOCALE as
|
|
7
|
-
import { DEFAULT_MIN_DIMENSION as
|
|
8
|
-
import { UploadDialog as
|
|
9
|
-
import { UploadButton as
|
|
10
|
-
import { ErrorUploadDialog as
|
|
11
|
-
import { validatePhotoFile as
|
|
12
|
-
import { readPhoto as
|
|
13
|
-
import { getPhotoCrop as
|
|
14
|
-
import { getCropedPhoto as
|
|
15
|
-
import { getDefaultCroppedPhoto as
|
|
16
|
-
import '../../assets/photo-crop-uploader.css';const
|
|
17
|
-
photoCropCanvas:
|
|
18
|
-
},
|
|
4
|
+
import { c as _o } from "../../index-B2JRaoNz.js";
|
|
5
|
+
import { localizedText as wo } from "./locale.js";
|
|
6
|
+
import { EN_LOCALE as Ao } from "../../constants.js";
|
|
7
|
+
import { DEFAULT_MIN_DIMENSION as Uo, DEFAULT_ASPECT_RATIO as xo, DEFAULT_TIMEOUT as yo, DEFAULT_FILE_MAX_SIZE as Oo, FULL_PROGRESS_VALUE as B, PHOTO_LOADING_DELAY as Io, RESET_DATA_DELAY as C } from "./constants.js";
|
|
8
|
+
import { UploadDialog as vo } from "./components/upload-dialog/upload-dialog.js";
|
|
9
|
+
import { UploadButton as Fo } from "./components/upload-button/upload-button.js";
|
|
10
|
+
import { ErrorUploadDialog as Mo } from "./components/error-upload-dialog/error-upload-dialog.js";
|
|
11
|
+
import { validatePhotoFile as G } from "./utils/validate-photo-file.js";
|
|
12
|
+
import { readPhoto as Y } from "./utils/read-photo.js";
|
|
13
|
+
import { getPhotoCrop as No } from "./utils/get-photo-crop.js";
|
|
14
|
+
import { getCropedPhoto as Ro } from "./utils/get-croped-photo.js";
|
|
15
|
+
import { getDefaultCroppedPhoto as bo } from "./utils/get-default-cropped-photo.js";
|
|
16
|
+
import '../../assets/photo-crop-uploader.css';const Ho = "_photoCropCanvas_1i4lr_1", ko = {
|
|
17
|
+
photoCropCanvas: Ho
|
|
18
|
+
}, tt = (X) => {
|
|
19
19
|
const {
|
|
20
|
-
buttonClassname:
|
|
21
|
-
onStartUpload:
|
|
20
|
+
buttonClassname: Z = "",
|
|
21
|
+
onStartUpload: q = () => {
|
|
22
22
|
},
|
|
23
|
-
onEndUpload:
|
|
23
|
+
onEndUpload: J = () => {
|
|
24
24
|
},
|
|
25
|
-
onError:
|
|
25
|
+
onError: K = () => {
|
|
26
26
|
},
|
|
27
|
-
onStartCrop:
|
|
27
|
+
onStartCrop: Q = () => {
|
|
28
28
|
},
|
|
29
|
-
onEndCrop:
|
|
29
|
+
onEndCrop: W = () => {
|
|
30
30
|
},
|
|
31
|
-
onDragOver:
|
|
31
|
+
onDragOver: $ = () => {
|
|
32
32
|
},
|
|
33
|
-
onDragLeave:
|
|
33
|
+
onDragLeave: oo = () => {
|
|
34
34
|
},
|
|
35
|
-
onDragDrop:
|
|
35
|
+
onDragDrop: to = () => {
|
|
36
36
|
},
|
|
37
|
-
onClose:
|
|
37
|
+
onClose: U = () => {
|
|
38
38
|
},
|
|
39
|
-
showErrorPopup:
|
|
40
|
-
minDimension:
|
|
41
|
-
aspectRatio:
|
|
42
|
-
locale: e =
|
|
43
|
-
timeout:
|
|
44
|
-
fileMaxSize:
|
|
45
|
-
allowedExtensions:
|
|
46
|
-
allowedMimeTypes:
|
|
47
|
-
circular:
|
|
48
|
-
width:
|
|
49
|
-
keepSelection:
|
|
50
|
-
uploadButton:
|
|
51
|
-
multiple:
|
|
52
|
-
fromSources:
|
|
53
|
-
...
|
|
54
|
-
} =
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
},
|
|
39
|
+
showErrorPopup: ro = !1,
|
|
40
|
+
minDimension: l = Uo,
|
|
41
|
+
aspectRatio: P = xo,
|
|
42
|
+
locale: e = Ao,
|
|
43
|
+
timeout: x = yo,
|
|
44
|
+
fileMaxSize: y = Oo,
|
|
45
|
+
allowedExtensions: D,
|
|
46
|
+
allowedMimeTypes: O,
|
|
47
|
+
circular: eo,
|
|
48
|
+
width: so,
|
|
49
|
+
keepSelection: no,
|
|
50
|
+
uploadButton: ao,
|
|
51
|
+
multiple: m = !1,
|
|
52
|
+
fromSources: I,
|
|
53
|
+
...lo
|
|
54
|
+
} = X, [io, f] = s(!1), [h, u] = s([]), [L, S] = s([]), [p, v] = s(0), F = j(null), M = j(null), [i, T] = s(!1), [po, N] = s(0), [R, b] = s(""), [co, d] = s([]), [ho, H] = s(!1), mo = io || i && m, fo = () => {
|
|
55
|
+
d([]);
|
|
56
|
+
}, k = (o = []) => {
|
|
57
|
+
i || (U(o, h), f(!1), setTimeout(() => d([]), C), setTimeout(() => u([]), C));
|
|
58
|
+
}, uo = () => {
|
|
59
|
+
i || (U([], h), f(!1), setTimeout(() => d([]), C), setTimeout(() => u([]), C));
|
|
60
|
+
}, go = () => {
|
|
61
|
+
H(!1);
|
|
62
|
+
}, _ = (o) => {
|
|
63
|
+
J(o), u(o), S(Array(o.length)), v(0), f(!0), b("");
|
|
64
|
+
}, w = (o) => {
|
|
65
|
+
o instanceof Error && (console.warn(o.message), K(o), b(o.message), H(!0), u([]), f(!1));
|
|
66
|
+
}, Eo = async (o) => {
|
|
65
67
|
const { files: r } = o.target;
|
|
66
|
-
if (r?.length)
|
|
68
|
+
if (r?.length && !i)
|
|
67
69
|
try {
|
|
68
|
-
if (
|
|
69
|
-
const t = Array.from(r);
|
|
70
|
-
t
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
70
|
+
if (T(!0), q(), m) {
|
|
71
|
+
const t = Array.from(r), n = B / t.length, g = [], c = [];
|
|
72
|
+
for (const A of t) {
|
|
73
|
+
try {
|
|
74
|
+
G(
|
|
75
|
+
A,
|
|
76
|
+
{
|
|
77
|
+
maxSize: y,
|
|
78
|
+
allowedExtensions: D,
|
|
79
|
+
allowedMimeTypes: O
|
|
80
|
+
},
|
|
81
|
+
e
|
|
82
|
+
);
|
|
83
|
+
const a = await Y(A, l, e, x);
|
|
84
|
+
g.push(a);
|
|
85
|
+
} catch (a) {
|
|
86
|
+
let V = "";
|
|
87
|
+
a instanceof Error && (V = a.message), c.push({
|
|
88
|
+
photoName: A.name,
|
|
89
|
+
errorMessage: V
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
N(
|
|
93
|
+
(a) => Math.min(B, a + n)
|
|
94
|
+
), await new Promise((a) => setTimeout(a, 0));
|
|
95
|
+
}
|
|
96
|
+
if (I?.length)
|
|
97
|
+
throw new Error(c[0]?.errorMessage);
|
|
98
|
+
d(c), _(g);
|
|
83
99
|
} else {
|
|
84
100
|
const t = r[0];
|
|
85
|
-
|
|
101
|
+
G(
|
|
86
102
|
t,
|
|
87
|
-
{ maxSize:
|
|
103
|
+
{ maxSize: y, allowedExtensions: D, allowedMimeTypes: O },
|
|
88
104
|
e
|
|
89
105
|
);
|
|
90
|
-
const n = await
|
|
91
|
-
|
|
106
|
+
const n = await Y(t, l, e, x);
|
|
107
|
+
_([n]);
|
|
92
108
|
}
|
|
93
109
|
} catch (t) {
|
|
94
|
-
|
|
110
|
+
w(t);
|
|
95
111
|
} finally {
|
|
96
|
-
|
|
112
|
+
m ? setTimeout(() => {
|
|
113
|
+
o.target.value = "", N(0), T(!1);
|
|
114
|
+
}, Io) : (o.target.value = "", T(!1));
|
|
97
115
|
}
|
|
98
|
-
},
|
|
99
|
-
const { width: r, height: t } = o.currentTarget
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
116
|
+
}, Co = (o) => {
|
|
117
|
+
const { width: r, height: t } = o.currentTarget;
|
|
118
|
+
console.log(o);
|
|
119
|
+
const n = No(r, t, l, P);
|
|
120
|
+
S((g) => {
|
|
121
|
+
const c = [...g];
|
|
122
|
+
return c[p] = n, c;
|
|
103
123
|
});
|
|
104
|
-
},
|
|
105
|
-
|
|
124
|
+
}, Po = (o, r) => {
|
|
125
|
+
S((t) => {
|
|
106
126
|
const n = [...t];
|
|
107
|
-
return n[
|
|
127
|
+
return n[p] = r, n;
|
|
108
128
|
});
|
|
109
|
-
},
|
|
110
|
-
const o =
|
|
111
|
-
if (o && r &&
|
|
129
|
+
}, z = () => {
|
|
130
|
+
const o = M.current, r = F.current;
|
|
131
|
+
if (o && r && L)
|
|
112
132
|
try {
|
|
113
|
-
|
|
114
|
-
const t =
|
|
133
|
+
Q();
|
|
134
|
+
const t = Ro(
|
|
115
135
|
r,
|
|
116
136
|
o,
|
|
117
|
-
|
|
137
|
+
L[p],
|
|
118
138
|
e
|
|
119
139
|
);
|
|
120
|
-
|
|
140
|
+
W(t), p >= h.length - 1 && k();
|
|
121
141
|
} catch (t) {
|
|
122
|
-
t instanceof Error && (console.warn(t),
|
|
142
|
+
t instanceof Error && (console.warn(t), w(t));
|
|
123
143
|
}
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
const o =
|
|
144
|
+
}, Do = () => {
|
|
145
|
+
z(), v((o) => o + 1);
|
|
146
|
+
}, Lo = async () => {
|
|
147
|
+
const o = h.slice(p);
|
|
128
148
|
try {
|
|
129
149
|
const r = await Promise.all(
|
|
130
150
|
o.map(
|
|
131
|
-
(t) =>
|
|
151
|
+
(t) => bo(t, l, P, e)
|
|
132
152
|
)
|
|
133
153
|
);
|
|
134
|
-
|
|
154
|
+
k(r);
|
|
135
155
|
} catch (r) {
|
|
136
|
-
|
|
156
|
+
w(r);
|
|
137
157
|
}
|
|
138
158
|
};
|
|
139
|
-
return /* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
|
|
159
|
+
return /* @__PURE__ */ So(To, { children: [
|
|
160
|
+
/* @__PURE__ */ E(
|
|
161
|
+
Fo,
|
|
142
162
|
{
|
|
143
|
-
onChange:
|
|
144
|
-
onPhotoDataLoaded:
|
|
145
|
-
buttonClassname:
|
|
146
|
-
disabled:
|
|
147
|
-
buttonDisabled:
|
|
163
|
+
onChange: Eo,
|
|
164
|
+
onPhotoDataLoaded: _,
|
|
165
|
+
buttonClassname: Z,
|
|
166
|
+
disabled: i,
|
|
167
|
+
buttonDisabled: i,
|
|
148
168
|
locale: e,
|
|
149
|
-
width:
|
|
150
|
-
allowedExtensions:
|
|
151
|
-
onDragDrop:
|
|
152
|
-
onDragLeave:
|
|
153
|
-
onDragOver:
|
|
154
|
-
button:
|
|
155
|
-
multiple:
|
|
156
|
-
fromSources:
|
|
157
|
-
...
|
|
158
|
-
children:
|
|
169
|
+
width: so,
|
|
170
|
+
allowedExtensions: D,
|
|
171
|
+
onDragDrop: to,
|
|
172
|
+
onDragLeave: oo,
|
|
173
|
+
onDragOver: $,
|
|
174
|
+
button: ao,
|
|
175
|
+
multiple: m,
|
|
176
|
+
fromSources: I,
|
|
177
|
+
...lo,
|
|
178
|
+
children: wo[e].upload
|
|
159
179
|
}
|
|
160
180
|
),
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
|
|
181
|
+
/* @__PURE__ */ E(
|
|
182
|
+
vo,
|
|
163
183
|
{
|
|
164
|
-
open:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
184
|
+
open: mo,
|
|
185
|
+
photoSourceLoading: i,
|
|
186
|
+
loadingValue: po,
|
|
187
|
+
errors: co,
|
|
188
|
+
photoCrops: L,
|
|
189
|
+
photoSources: h,
|
|
190
|
+
onNextPhoto: Do,
|
|
191
|
+
onSkipCrop: Lo,
|
|
192
|
+
onClearErrors: fo,
|
|
193
|
+
photoError: R,
|
|
194
|
+
onCloseDialogHandler: uo,
|
|
195
|
+
onCropChange: Po,
|
|
196
|
+
onPhotoCrop: z,
|
|
197
|
+
onPhotoLoad: Co,
|
|
198
|
+
imageRef: F,
|
|
199
|
+
minDimension: l,
|
|
200
|
+
aspectRatio: P,
|
|
177
201
|
locale: e,
|
|
178
|
-
circular:
|
|
179
|
-
keepSelection:
|
|
180
|
-
photoIndex:
|
|
202
|
+
circular: eo,
|
|
203
|
+
keepSelection: no,
|
|
204
|
+
photoIndex: p
|
|
181
205
|
}
|
|
182
206
|
),
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
|
|
207
|
+
/* @__PURE__ */ E(
|
|
208
|
+
Mo,
|
|
185
209
|
{
|
|
186
|
-
open:
|
|
187
|
-
photoError:
|
|
188
|
-
onCloseErrorDialog:
|
|
210
|
+
open: ro && ho,
|
|
211
|
+
photoError: R,
|
|
212
|
+
onCloseErrorDialog: go,
|
|
189
213
|
locale: e
|
|
190
214
|
}
|
|
191
215
|
),
|
|
192
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ E(
|
|
193
217
|
"canvas",
|
|
194
218
|
{
|
|
195
|
-
className:
|
|
196
|
-
width:
|
|
197
|
-
height:
|
|
198
|
-
ref:
|
|
219
|
+
className: _o(ko.photoCropCanvas),
|
|
220
|
+
width: l,
|
|
221
|
+
height: l,
|
|
222
|
+
ref: M
|
|
199
223
|
}
|
|
200
224
|
)
|
|
201
225
|
] });
|
|
202
226
|
};
|
|
203
227
|
export {
|
|
204
|
-
|
|
228
|
+
tt as PhotoCropUploader
|
|
205
229
|
};
|
|
@@ -3,6 +3,10 @@ import { Locale } from '../../types';
|
|
|
3
3
|
import { BMP_IMAGE_TYPE, GIF_IMAGE_TYPE, ICO_IMAGE_TYPE, JPEG_IMAGE_TYPE, JPG_IMAGE_TYPE, MICROSOFT_ICO_IMAGE_TYPE, PNG_IMAGE_TYPE, SVG_IMAGE_TYPE, WEBP_IMAGE_TYPE, ICO_IMAGE_EXT, BMP_IMAGE_EXT, GIF_IMAGE_EXT, JPEG_IMAGE_EXT, JPG_IMAGE_EXT, PNG_IMAGE_EXT, SVG_IMAGE_EXT, WEBP_IMAGE_EXT } from './constants';
|
|
4
4
|
export type PhotoDataUrl = string;
|
|
5
5
|
export type PhotoFileSize = number;
|
|
6
|
+
export type FileErrorItem = {
|
|
7
|
+
photoName: string;
|
|
8
|
+
errorMessage: string;
|
|
9
|
+
};
|
|
6
10
|
export type PhotoExtension = typeof JPG_IMAGE_EXT | typeof JPEG_IMAGE_EXT | typeof PNG_IMAGE_EXT | typeof SVG_IMAGE_EXT | typeof BMP_IMAGE_EXT | typeof GIF_IMAGE_EXT | typeof WEBP_IMAGE_EXT | typeof ICO_IMAGE_EXT;
|
|
7
11
|
export type PhotoMimeType = typeof JPG_IMAGE_TYPE | typeof JPEG_IMAGE_TYPE | typeof PNG_IMAGE_TYPE | typeof SVG_IMAGE_TYPE | typeof BMP_IMAGE_TYPE | typeof GIF_IMAGE_TYPE | typeof WEBP_IMAGE_TYPE | typeof ICO_IMAGE_TYPE | typeof MICROSOFT_ICO_IMAGE_TYPE;
|
|
8
12
|
export type PhotoFileOptions = {
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { p as o } from "./chainPropTypes-KIxDwPzf.js";
|
|
2
|
+
const l = {
|
|
3
|
+
theme: void 0
|
|
4
|
+
};
|
|
5
|
+
function u(e) {
|
|
6
|
+
let t, r;
|
|
7
|
+
return function(a) {
|
|
8
|
+
let n = t;
|
|
9
|
+
return (n === void 0 || a.theme !== r) && (l.theme = a.theme, n = o(e(l)), t = n, r = a.theme), n;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const c = u;
|
|
13
|
+
function i(e) {
|
|
14
|
+
return typeof e.main == "string";
|
|
15
|
+
}
|
|
16
|
+
function m(e, t = []) {
|
|
17
|
+
if (!i(e))
|
|
18
|
+
return !1;
|
|
19
|
+
for (const r of t)
|
|
20
|
+
if (!e.hasOwnProperty(r) || typeof e[r] != "string")
|
|
21
|
+
return !1;
|
|
22
|
+
return !0;
|
|
23
|
+
}
|
|
24
|
+
function h(e = []) {
|
|
25
|
+
return ([, t]) => t && m(t, e);
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
h as c,
|
|
29
|
+
c as m
|
|
30
|
+
};
|
|
@@ -4099,18 +4099,18 @@ export {
|
|
|
4099
4099
|
Ci as C,
|
|
4100
4100
|
ha as E,
|
|
4101
4101
|
je as P,
|
|
4102
|
-
|
|
4102
|
+
Qt as T,
|
|
4103
4103
|
Mr as _,
|
|
4104
|
-
|
|
4105
|
-
|
|
4104
|
+
Sa as a,
|
|
4105
|
+
tn as b,
|
|
4106
4106
|
va as c,
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4107
|
+
Sr as d,
|
|
4108
|
+
vi as e,
|
|
4109
|
+
Cr as f,
|
|
4110
|
+
sn as g,
|
|
4111
|
+
pa as h,
|
|
4112
4112
|
xe as i,
|
|
4113
|
-
|
|
4113
|
+
Ca as j,
|
|
4114
4114
|
Gr as k,
|
|
4115
4115
|
Jt as l,
|
|
4116
4116
|
ma as m,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { i as c, d as l } from "./createTheme-RvzX1VSA.js";
|
|
2
|
+
const a = (t) => {
|
|
3
|
+
const s = {
|
|
4
|
+
systemProps: {},
|
|
5
|
+
otherProps: {}
|
|
6
|
+
}, n = t?.theme?.unstable_sxConfig ?? l;
|
|
7
|
+
return Object.keys(t).forEach((e) => {
|
|
8
|
+
n[e] ? s.systemProps[e] = t[e] : s.otherProps[e] = t[e];
|
|
9
|
+
}), s;
|
|
10
|
+
};
|
|
11
|
+
function x(t) {
|
|
12
|
+
const {
|
|
13
|
+
sx: s,
|
|
14
|
+
...n
|
|
15
|
+
} = t, {
|
|
16
|
+
systemProps: e,
|
|
17
|
+
otherProps: i
|
|
18
|
+
} = a(n);
|
|
19
|
+
let r;
|
|
20
|
+
return Array.isArray(s) ? r = [e, ...s] : typeof s == "function" ? r = (...f) => {
|
|
21
|
+
const o = s(...f);
|
|
22
|
+
return c(o) ? {
|
|
23
|
+
...e,
|
|
24
|
+
...o
|
|
25
|
+
} : e;
|
|
26
|
+
} : r = {
|
|
27
|
+
...e,
|
|
28
|
+
...s
|
|
29
|
+
}, {
|
|
30
|
+
...i,
|
|
31
|
+
sx: r
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
x as e
|
|
36
|
+
};
|