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