@hai-dev/ui-kit 1.0.5 → 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.
Files changed (55) hide show
  1. package/dist/Box-D8oKffw9.js +57 -0
  2. package/dist/{Button-DDlVTM6i.js → Button-BBF8hp7e.js} +30 -27
  3. package/dist/ButtonBase-T2KH9jsD.js +966 -0
  4. package/dist/CircularProgress-BQQkuSse.js +273 -0
  5. package/dist/{DialogTitle-KN1sayHD.js → Dialog-B97c7WYP.js} +910 -1401
  6. package/dist/DialogTitle-Du4tqTs0.js +254 -0
  7. package/dist/Typography-r_TXEM1e.js +257 -0
  8. package/dist/assets/circular-progress-loader.css +1 -0
  9. package/dist/assets/upload-dialog-errors.css +1 -0
  10. package/dist/assets/upload-dialog.css +1 -1
  11. package/dist/chainPropTypes-KIxDwPzf.js +387 -0
  12. package/dist/components/button/button.js +1 -1
  13. package/dist/components/circular-progress-loader/circular-progress-loader.d.ts +3 -0
  14. package/dist/components/circular-progress-loader/circular-progress-loader.js +44 -0
  15. package/dist/components/circular-progress-loader/circular-progress-loader.stories.d.ts +7 -0
  16. package/dist/components/circular-progress-loader/constants.d.ts +2 -0
  17. package/dist/components/circular-progress-loader/constants.js +5 -0
  18. package/dist/components/circular-progress-loader/index.d.ts +1 -0
  19. package/dist/components/circular-progress-loader/index.js +4 -0
  20. package/dist/components/circular-progress-loader/types.d.ts +6 -0
  21. package/dist/components/circular-progress-loader/types.js +1 -0
  22. package/dist/components/index.d.ts +1 -0
  23. package/dist/components/index.js +6 -4
  24. package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +41 -39
  25. package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +22 -73
  26. package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +17 -17
  27. package/dist/components/photo-crop-uploader/components/upload-dialog/types.d.ts +12 -1
  28. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.d.ts +3 -0
  29. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.js +10 -0
  30. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +152 -127
  31. package/dist/components/photo-crop-uploader/constants.d.ts +3 -0
  32. package/dist/components/photo-crop-uploader/constants.js +35 -32
  33. package/dist/components/photo-crop-uploader/locale.js +8 -2
  34. package/dist/components/photo-crop-uploader/photo-crop-uploader.js +169 -145
  35. package/dist/components/photo-crop-uploader/types.d.ts +4 -0
  36. package/dist/constants.d.ts +2 -0
  37. package/dist/constants.js +3 -1
  38. package/dist/createSimplePaletteValueFilter-nb0wSOzC.js +30 -0
  39. package/dist/{createTheme-DSHGFfg6.js → createTheme-RvzX1VSA.js} +4 -4
  40. package/dist/decorators/centered-decorator.d.ts +3 -0
  41. package/dist/decorators/centered-decorator.js +16 -0
  42. package/dist/decorators/index.d.ts +1 -0
  43. package/dist/decorators/index.js +4 -0
  44. package/dist/decorators/types.d.ts +4 -0
  45. package/dist/decorators/types.js +1 -0
  46. package/dist/extendSxProp-BW9e6LtL.js +36 -0
  47. package/dist/index.d.ts +1 -1
  48. package/dist/index.js +16 -14
  49. package/dist/upload-dialog-errors-ku54UrUb.js +365 -0
  50. package/dist/useId-CK6Kn3Tn.js +21 -0
  51. package/dist/useTheme-CsjkCBFJ.js +16 -0
  52. package/package.json +8 -8
  53. package/dist/ButtonBase-CXGZ-DBC.js +0 -1346
  54. package/dist/CircularProgress-CscJm1An.js +0 -291
  55. package/dist/extendSxProp-CzeED7BH.js +0 -49
@@ -1,205 +1,229 @@
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";
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 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) => {
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: z = "",
21
- onStartUpload: H = () => {
20
+ buttonClassname: Z = "",
21
+ onStartUpload: q = () => {
22
22
  },
23
- onEndUpload: j = () => {
23
+ onEndUpload: J = () => {
24
24
  },
25
- onError: B = () => {
25
+ onError: K = () => {
26
26
  },
27
- onStartCrop: X = () => {
27
+ onStartCrop: Q = () => {
28
28
  },
29
- onEndCrop: Z = () => {
29
+ onEndCrop: W = () => {
30
30
  },
31
- onDragOver: q = () => {
31
+ onDragOver: $ = () => {
32
32
  },
33
- onDragLeave: G = () => {
33
+ onDragLeave: oo = () => {
34
34
  },
35
- onDragDrop: J = () => {
35
+ onDragDrop: to = () => {
36
36
  },
37
- onClose: P = () => {
37
+ onClose: U = () => {
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: 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 (A(!0), H(), L) {
69
- const t = Array.from(r);
70
- t.forEach((c) => {
71
- 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);
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
- b(
101
+ G(
86
102
  t,
87
- { maxSize: D, allowedExtensions: d, allowedMimeTypes: S },
103
+ { maxSize: y, allowedExtensions: D, allowedMimeTypes: O },
88
104
  e
89
105
  );
90
- const n = await R(t, a, e, E);
91
- C([n]);
106
+ const n = await Y(t, l, e, x);
107
+ _([n]);
92
108
  }
93
109
  } catch (t) {
94
- g(t);
110
+ w(t);
95
111
  } finally {
96
- o.target.value = "", A(!1);
112
+ m ? setTimeout(() => {
113
+ o.target.value = "", N(0), T(!1);
114
+ }, Io) : (o.target.value = "", T(!1));
97
115
  }
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;
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
- }, lo = (o, r) => {
105
- u((t) => {
124
+ }, Po = (o, r) => {
125
+ S((t) => {
106
126
  const n = [...t];
107
- return n[l] = r, n;
127
+ return n[p] = r, n;
108
128
  });
109
- }, O = () => {
110
- const o = U.current, r = x.current;
111
- if (o && r && f)
129
+ }, z = () => {
130
+ const o = M.current, r = F.current;
131
+ if (o && r && L)
112
132
  try {
113
- X();
114
- const t = _o(
133
+ Q();
134
+ const t = Ro(
115
135
  r,
116
136
  o,
117
- f[l],
137
+ L[p],
118
138
  e
119
139
  );
120
- Z(t), l >= p.length - 1 && F();
140
+ W(t), p >= h.length - 1 && k();
121
141
  } catch (t) {
122
- t instanceof Error && (console.warn(t), g(t));
142
+ t instanceof Error && (console.warn(t), w(t));
123
143
  }
124
- }, po = () => {
125
- O(), _((o) => o + 1);
126
- }, co = async () => {
127
- const o = p.slice(l);
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) => xo(t, a, m, e)
151
+ (t) => bo(t, l, P, e)
132
152
  )
133
153
  );
134
- F(r);
154
+ k(r);
135
155
  } catch (r) {
136
- g(r);
156
+ w(r);
137
157
  }
138
158
  };
139
- return /* @__PURE__ */ io(ho, { children: [
140
- /* @__PURE__ */ h(
141
- So,
159
+ return /* @__PURE__ */ So(To, { children: [
160
+ /* @__PURE__ */ E(
161
+ Fo,
142
162
  {
143
- onChange: ao,
144
- onPhotoDataLoaded: C,
145
- buttonClassname: z,
146
- disabled: y,
147
- buttonDisabled: y,
163
+ onChange: Eo,
164
+ onPhotoDataLoaded: _,
165
+ buttonClassname: Z,
166
+ disabled: i,
167
+ buttonDisabled: i,
148
168
  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
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__ */ h(
162
- Do,
181
+ /* @__PURE__ */ E(
182
+ vo,
163
183
  {
164
- open: to,
165
- photoCrops: f,
166
- 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,
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: Q,
179
- keepSelection: W,
180
- photoIndex: l
202
+ circular: eo,
203
+ keepSelection: no,
204
+ photoIndex: p
181
205
  }
182
206
  ),
183
- /* @__PURE__ */ h(
184
- Lo,
207
+ /* @__PURE__ */ E(
208
+ Mo,
185
209
  {
186
- open: K && ro,
187
- photoError: T,
188
- onCloseErrorDialog: no,
210
+ open: ro && ho,
211
+ photoError: R,
212
+ onCloseErrorDialog: go,
189
213
  locale: e
190
214
  }
191
215
  ),
192
- /* @__PURE__ */ h(
216
+ /* @__PURE__ */ E(
193
217
  "canvas",
194
218
  {
195
- className: mo(yo.photoCropCanvas),
196
- width: a,
197
- height: a,
198
- ref: U
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
- Xo as PhotoCropUploader
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 = {
@@ -1,3 +1,5 @@
1
1
  export declare const EN_LOCALE = "en";
2
2
  export declare const RU_LOCALE = "ru";
3
3
  export declare const BYTE_TO_KILOBYTE = 1024;
4
+ export declare const PRECENT_SYMBOL = "%";
5
+ export declare const DASH_SYMBOL = "-";
package/dist/constants.js CHANGED
@@ -1,6 +1,8 @@
1
- const E = "en", L = "ru", n = 1024;
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,
6
+ o as PRECENT_SYMBOL,
5
7
  L as RU_LOCALE
6
8
  };
@@ -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
+ };
@@ -1831,7 +1831,7 @@ function vo() {
1831
1831
  var So = /* @__PURE__ */ vo();
1832
1832
  const je = /* @__PURE__ */ bn(So);
1833
1833
  /**
1834
- * @mui/styled-engine v7.3.2
1834
+ * @mui/styled-engine v7.3.3
1835
1835
  *
1836
1836
  * @license MIT
1837
1837
  * This source code is licensed under the MIT license found in the
@@ -4102,10 +4102,10 @@ export {
4102
4102
  Qt as T,
4103
4103
  Mr as _,
4104
4104
  Sa as a,
4105
- va as b,
4106
- vi as c,
4105
+ tn as b,
4106
+ va as c,
4107
4107
  Sr as d,
4108
- tn as e,
4108
+ vi as e,
4109
4109
  Cr as f,
4110
4110
  sn as g,
4111
4111
  pa as h,
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { CenteredDecoratorProps } from './types';
3
+ export declare const CenteredDecorator: FC<CenteredDecoratorProps>;
@@ -0,0 +1,16 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ const n = ({ children: e }) => /* @__PURE__ */ t(
3
+ "div",
4
+ {
5
+ style: {
6
+ width: "100%",
7
+ display: "flex",
8
+ alignItems: "center",
9
+ justifyContent: "center"
10
+ },
11
+ children: e
12
+ }
13
+ );
14
+ export {
15
+ n as CenteredDecorator
16
+ };
@@ -0,0 +1 @@
1
+ export { CenteredDecorator } from './centered-decorator';
@@ -0,0 +1,4 @@
1
+ import { CenteredDecorator as o } from "./centered-decorator.js";
2
+ export {
3
+ o as CenteredDecorator
4
+ };
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+ export type CenteredDecoratorProps = {
3
+ children: ReactNode;
4
+ };
@@ -0,0 +1 @@
1
+
@@ -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
+ };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { PhotoCropUploader, Button } from './components';
1
+ export { PhotoCropUploader, Button, CircularProgressLoader, } from './components';
2
2
  export type { Locale } from './types';
3
3
  export type { PhotoDataUrl, PhotoFileSize, PhotoExtension, PhotoMimeType, PhotoFileOptions, PhotoCropUploaderProps, } from './components/photo-crop-uploader/types';
4
4
  export { EN_LOCALE, RU_LOCALE, BYTE_TO_KILOBYTE } from './constants';
package/dist/index.js CHANGED
@@ -1,26 +1,28 @@
1
- import { BYTE_TO_KILOBYTE as G, EN_LOCALE as I, RU_LOCALE as T } from "./constants.js";
2
- import { BMP_IMAGE_EXT as P, BMP_IMAGE_TYPE as A, GIF_IMAGE_EXT as o, GIF_IMAGE_TYPE as Y, ICO_IMAGE_EXT as r, ICO_IMAGE_TYPE as O, JPEG_IMAGE_EXT as X, JPEG_IMAGE_TYPE as t, JPG_IMAGE_EXT as B, JPG_IMAGE_TYPE as C, MICROSOFT_ICO_IMAGE_TYPE as p, PNG_IMAGE_EXT as e, PNG_IMAGE_TYPE as L, SVG_IMAGE_EXT as f, SVG_IMAGE_TYPE as m, WEBP_IMAGE_EXT as x, WEBP_IMAGE_TYPE as J } from "./components/photo-crop-uploader/constants.js";
3
- import { PhotoCropUploader as N } from "./components/photo-crop-uploader/photo-crop-uploader.js";
4
- import { Button as R } from "./components/button/button.js";
1
+ import { BYTE_TO_KILOBYTE as G, EN_LOCALE as I, RU_LOCALE as P } from "./constants.js";
2
+ import { BMP_IMAGE_EXT as M, BMP_IMAGE_TYPE as A, GIF_IMAGE_EXT as o, GIF_IMAGE_TYPE as r, ICO_IMAGE_EXT as Y, ICO_IMAGE_TYPE as O, JPEG_IMAGE_EXT as e, JPEG_IMAGE_TYPE as t, JPG_IMAGE_EXT as C, JPG_IMAGE_TYPE as X, MICROSOFT_ICO_IMAGE_TYPE as p, PNG_IMAGE_EXT as B, PNG_IMAGE_TYPE as L, SVG_IMAGE_EXT as f, SVG_IMAGE_TYPE as m, WEBP_IMAGE_EXT as x, WEBP_IMAGE_TYPE as J } from "./components/photo-crop-uploader/constants.js";
3
+ import { PhotoCropUploader as F } from "./components/photo-crop-uploader/photo-crop-uploader.js";
4
+ import { Button as S } from "./components/button/button.js";
5
+ import { CircularProgressLoader as l } from "./components/circular-progress-loader/circular-progress-loader.js";
5
6
  export {
6
- P as BMP_IMAGE_EXT,
7
+ M as BMP_IMAGE_EXT,
7
8
  A as BMP_IMAGE_TYPE,
8
9
  G as BYTE_TO_KILOBYTE,
9
- R as Button,
10
+ S as Button,
11
+ l as CircularProgressLoader,
10
12
  I as EN_LOCALE,
11
13
  o as GIF_IMAGE_EXT,
12
- Y as GIF_IMAGE_TYPE,
13
- r as ICO_IMAGE_EXT,
14
+ r as GIF_IMAGE_TYPE,
15
+ Y as ICO_IMAGE_EXT,
14
16
  O as ICO_IMAGE_TYPE,
15
- X as JPEG_IMAGE_EXT,
17
+ e as JPEG_IMAGE_EXT,
16
18
  t as JPEG_IMAGE_TYPE,
17
- B as JPG_IMAGE_EXT,
18
- C as JPG_IMAGE_TYPE,
19
+ C as JPG_IMAGE_EXT,
20
+ X as JPG_IMAGE_TYPE,
19
21
  p as MICROSOFT_ICO_IMAGE_TYPE,
20
- e as PNG_IMAGE_EXT,
22
+ B as PNG_IMAGE_EXT,
21
23
  L as PNG_IMAGE_TYPE,
22
- N as PhotoCropUploader,
23
- T as RU_LOCALE,
24
+ F as PhotoCropUploader,
25
+ P as RU_LOCALE,
24
26
  f as SVG_IMAGE_EXT,
25
27
  m as SVG_IMAGE_TYPE,
26
28
  x as WEBP_IMAGE_EXT,