@hai-dev/ui-kit 1.1.11 → 1.1.12

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.
@@ -1 +1 @@
1
- ._dialog_lyvu5_1 ._dialogErrorText_lyvu5_1{color:#e2402fe0}
1
+ ._dialog_6kik7_1._dark_6kik7_1 .MuiPaper-root{background-color:#191b28;color:#fff}._dialog_6kik7_1._dark_6kik7_1 .MuiPaper-root ._dialogErrorText_6kik7_5::-webkit-scrollbar{height:8px;width:8px}._dialog_6kik7_1._dark_6kik7_1 .MuiPaper-root ._dialogErrorText_6kik7_5::-webkit-scrollbar-track{background:#070e1d;border-radius:16px}._dialog_6kik7_1._dark_6kik7_1 .MuiPaper-root ._dialogErrorText_6kik7_5::-webkit-scrollbar-thumb{background-color:#ffffff24;border-radius:16px}._dialog_6kik7_1 ._dialogErrorText_6kik7_5::-webkit-scrollbar{height:8px;width:8px}._dialog_6kik7_1 ._dialogErrorText_6kik7_5::-webkit-scrollbar-track{background:#f2f3f5;border-radius:16px}._dialog_6kik7_1 ._dialogErrorText_6kik7_5::-webkit-scrollbar-thumb{background-color:#e6e6e6;border-radius:16px}._dialog_6kik7_1 ._dialogErrorText_6kik7_5{color:#e2402fe0}
@@ -1 +1 @@
1
- ._dialog_1h5av_1 .MuiPaper-root{border-radius:24px;padding:48px;min-width:840px;max-width:100%}._dialog_1h5av_1 .MuiPaper-root ._errorContent_1h5av_7::-webkit-scrollbar{height:8px;width:8px}._dialog_1h5av_1 .MuiPaper-root ._errorContent_1h5av_7::-webkit-scrollbar-track{background:#f2f3f5;border-radius:16px}._dialog_1h5av_1 .MuiPaper-root ._errorContent_1h5av_7::-webkit-scrollbar-thumb{background-color:#e6e6e6;border-radius:16px}._dialog_1h5av_1 .MuiPaper-root ._errorContent_1h5av_7{margin:32px 0 24px}._dialog_1h5av_1 .MuiPaper-root ._errorContent_1h5av_7 ._errorItem_1h5av_22{font-size:22px;letter-spacing:0%;line-height:150%;font-weight:500;color:#e2402fe0}._dialog_1h5av_1 .MuiPaper-root ._errorContent_1h5av_7 ._errorItem_1h5av_22 ._fileName_1h5av_29{font-weight:700}._dialog_1h5av_1 .MuiPaper-root ._errorContent_1h5av_7 *+*{margin-top:16px}._dialog_1h5av_1 .MuiPaper-root ._topActions_1h5av_35{position:absolute;right:0;top:0;padding:32px}._dialog_1h5av_1 .MuiPaper-root ._topActions_1h5av_35 ._close_1h5av_41{width:40px;height:40px}._dialog_1h5av_1 .MuiPaper-root ._botActions_1h5av_45{padding:0;display:flex;justify-content:space-between}._dialog_1h5av_1 .MuiPaper-root ._botActions_1h5av_45 ._button_1h5av_50{width:100%;text-transform:none}._dialog_1h5av_1 .MuiPaper-root ._title_1h5av_54{padding:0;font-weight:600;font-size:32px;line-height:100%}._dialog_1h5av_1 .MuiPaper-root ._content_1h5av_60{margin:32px 0 24px;padding-bottom:0;display:flex;align-items:center;justify-content:center;overflow:visible}._dialog_1h5av_1 .MuiPaper-root ._content_1h5av_60._many_1h5av_68{justify-content:space-between}._dialog_1h5av_1 .MuiPaper-root ._content_1h5av_60 ._photoList_1h5av_71{display:flex;flex-direction:column}._dialog_1h5av_1 .MuiPaper-root ._content_1h5av_60 ._crop_1h5av_75{max-height:670px}._dialog_1h5av_1 .MuiPaper-root ._content_1h5av_60 ._crop_1h5av_75 .ReactCrop__child-wrapper,._dialog_1h5av_1 .MuiPaper-root ._content_1h5av_60 ._crop_1h5av_75 .ReactCrop__crop-mask{border-radius:12px}._dialog_1h5av_1 .MuiPaper-root ._dialogText_1h5av_84{color:#e2402fe0}
1
+ ._dialog_n5vpn_1._dark_n5vpn_1 .MuiPaper-root{background-color:#191b28;color:#fff}._dialog_n5vpn_1._dark_n5vpn_1 .MuiPaper-root ._errorContent_n5vpn_5::-webkit-scrollbar{height:8px;width:8px}._dialog_n5vpn_1._dark_n5vpn_1 .MuiPaper-root ._errorContent_n5vpn_5::-webkit-scrollbar-track{background:#070e1d;border-radius:16px}._dialog_n5vpn_1._dark_n5vpn_1 .MuiPaper-root ._errorContent_n5vpn_5::-webkit-scrollbar-thumb{background-color:#ffffff24;border-radius:16px}._dialog_n5vpn_1 .MuiPaper-root{border-radius:24px;padding:48px;min-width:840px;max-width:100%}._dialog_n5vpn_1 .MuiPaper-root ._errorContent_n5vpn_5::-webkit-scrollbar{height:8px;width:8px}._dialog_n5vpn_1 .MuiPaper-root ._errorContent_n5vpn_5::-webkit-scrollbar-track{background:#f2f3f5;border-radius:16px}._dialog_n5vpn_1 .MuiPaper-root ._errorContent_n5vpn_5::-webkit-scrollbar-thumb{background-color:#e6e6e6;border-radius:16px}._dialog_n5vpn_1 .MuiPaper-root ._errorContent_n5vpn_5{margin:32px 0 24px}._dialog_n5vpn_1 .MuiPaper-root ._errorContent_n5vpn_5 ._errorItem_n5vpn_38{font-size:22px;letter-spacing:0%;line-height:150%;font-weight:500;color:#e2402fe0}._dialog_n5vpn_1 .MuiPaper-root ._errorContent_n5vpn_5 ._errorItem_n5vpn_38 ._fileName_n5vpn_45{font-weight:700}._dialog_n5vpn_1 .MuiPaper-root ._errorContent_n5vpn_5 *+*{margin-top:16px}._dialog_n5vpn_1 .MuiPaper-root ._topActions_n5vpn_51{position:absolute;right:0;top:0;padding:32px}._dialog_n5vpn_1 .MuiPaper-root ._topActions_n5vpn_51 ._close_n5vpn_57{width:40px;height:40px}._dialog_n5vpn_1 .MuiPaper-root ._botActions_n5vpn_61{padding:0;display:flex;justify-content:space-between}._dialog_n5vpn_1 .MuiPaper-root ._botActions_n5vpn_61 ._button_n5vpn_66{width:100%;text-transform:none}._dialog_n5vpn_1 .MuiPaper-root ._title_n5vpn_70{padding:0;font-weight:600;font-size:32px;line-height:100%}._dialog_n5vpn_1 .MuiPaper-root ._content_n5vpn_76{margin:32px 0 24px;padding-bottom:0;display:flex;align-items:center;justify-content:center;overflow:visible}._dialog_n5vpn_1 .MuiPaper-root ._content_n5vpn_76._many_n5vpn_84{justify-content:space-between}._dialog_n5vpn_1 .MuiPaper-root ._content_n5vpn_76 ._photoList_n5vpn_87{display:flex;flex-direction:column}._dialog_n5vpn_1 .MuiPaper-root ._content_n5vpn_76 ._crop_n5vpn_91{max-height:670px}._dialog_n5vpn_1 .MuiPaper-root ._content_n5vpn_76 ._crop_n5vpn_91 .ReactCrop__child-wrapper,._dialog_n5vpn_1 .MuiPaper-root ._content_n5vpn_76 ._crop_n5vpn_91 .ReactCrop__crop-mask{border-radius:12px}._dialog_n5vpn_1 .MuiPaper-root ._dialogText_n5vpn_100{color:#e2402fe0}
@@ -1,19 +1,19 @@
1
1
  import { jsx as e, jsxs as f } from "react/jsx-runtime";
2
- import { c as p } from "../../../../index-YnD2EP-S.js";
2
+ import { c as d } from "../../../../index-YnD2EP-S.js";
3
3
  import { localizedText as m } from "../../locale.js";
4
- import { EN_LOCALE as u } from "../../../../constants.js";
4
+ import { EN_LOCALE as T, DARK_THEME as u } from "../../../../constants.js";
5
5
  import { D as x } from "../../../../Dialog-Cf0d7zi7.js";
6
- import { D as T, a as C, b as D } from "../../../../DialogTitle-BtvmXSZP.js";
7
- import * as y from "react";
8
- import { g as h, a as E, c as N, P as o } from "../../../../createTheme-D8R2Cz2N.js";
9
- import { u as _, c as b, s as P, r as j } from "../../../../chainPropTypes-DiJb1lGa.js";
10
- import { T as v } from "../../../../Typography-Bjd6ZHeX.js";
11
- import { B as w } from "../../../../Button-BN3fv8kr.js";
6
+ import { D as C, a as D, b as y } from "../../../../DialogTitle-BtvmXSZP.js";
7
+ import * as h from "react";
8
+ import { g as E, a as _, c as k, P as o } from "../../../../createTheme-D8R2Cz2N.js";
9
+ import { u as N, c as b, s as P, r as j } from "../../../../chainPropTypes-DiJb1lGa.js";
10
+ import { T as w } from "../../../../Typography-Bjd6ZHeX.js";
11
+ import { B as M } from "../../../../Button-BN3fv8kr.js";
12
12
  import '../../../../assets/error-upload-dialog.css';function O(t) {
13
- return h("MuiDialogContentText", t);
13
+ return E("MuiDialogContentText", t);
14
14
  }
15
- E("MuiDialogContentText", ["root"]);
16
- const U = (t) => {
15
+ _("MuiDialogContentText", ["root"]);
16
+ const R = (t) => {
17
17
  const {
18
18
  classes: r
19
19
  } = t, s = b({
@@ -24,28 +24,28 @@ const U = (t) => {
24
24
  // forward classes to the Typography
25
25
  ...s
26
26
  };
27
- }, M = P(v, {
27
+ }, U = P(w, {
28
28
  shouldForwardProp: (t) => j(t) || t === "classes",
29
29
  name: "MuiDialogContentText",
30
30
  slot: "Root"
31
- })({}), g = /* @__PURE__ */ y.forwardRef(function(r, a) {
32
- const s = _({
31
+ })({}), g = /* @__PURE__ */ h.forwardRef(function(r, a) {
32
+ const s = N({
33
33
  props: r,
34
34
  name: "MuiDialogContentText"
35
35
  }), {
36
- children: n,
37
- className: l,
38
- ...i
39
- } = s, c = U(i);
40
- return /* @__PURE__ */ e(M, {
36
+ children: c,
37
+ className: n,
38
+ ...l
39
+ } = s, p = R(l);
40
+ return /* @__PURE__ */ e(U, {
41
41
  component: "p",
42
42
  variant: "body1",
43
43
  color: "textSecondary",
44
44
  ref: a,
45
- ownerState: i,
46
- className: N(c.root, l),
45
+ ownerState: l,
46
+ className: k(p.root, n),
47
47
  ...s,
48
- classes: c
48
+ classes: p
49
49
  });
50
50
  });
51
51
  process.env.NODE_ENV !== "production" && (g.propTypes = {
@@ -70,31 +70,33 @@ process.env.NODE_ENV !== "production" && (g.propTypes = {
70
70
  */
71
71
  sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
72
72
  });
73
- const R = "_dialog_lyvu5_1", S = "_dialogErrorText_lyvu5_1", d = {
74
- dialog: R,
75
- dialogErrorText: S
76
- }, I = (t) => {
73
+ const S = "_dialog_6kik7_1", v = "_dark_6kik7_1", A = "_dialogErrorText_6kik7_5", i = {
74
+ dialog: S,
75
+ dark: v,
76
+ dialogErrorText: A
77
+ }, J = (t) => {
77
78
  const {
78
79
  photoError: r,
79
80
  onCloseErrorDialog: a,
80
- locale: s = u,
81
+ locale: s = T,
82
+ theme: c = u,
81
83
  className: n,
82
84
  ...l
83
85
  } = t;
84
86
  return /* @__PURE__ */ f(
85
87
  x,
86
88
  {
87
- className: p(d.dialog, n),
89
+ className: d(i.dialog, n, i[c]),
88
90
  onClose: a,
89
91
  ...l,
90
92
  children: [
91
- /* @__PURE__ */ e(T, { children: m[s].error }),
92
- /* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(g, { className: p(d.dialogErrorText), children: r }) }),
93
- /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(w, { onClick: a, children: m[s].back }) })
93
+ /* @__PURE__ */ e(C, { children: m[s].error }),
94
+ /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(g, { className: d(i.dialogErrorText), children: r }) }),
95
+ /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(M, { onClick: a, children: m[s].back }) })
94
96
  ]
95
97
  }
96
98
  );
97
99
  };
98
100
  export {
99
- I as ErrorUploadDialog
101
+ J as ErrorUploadDialog
100
102
  };
@@ -1,9 +1,10 @@
1
1
  import { DialogProps } from '@mui/material';
2
- import { Locale } from '../../../../types';
2
+ import { Locale, Theme } from '../../../../types';
3
3
  type ErrorUploadDialogCustomProps = {
4
4
  onCloseErrorDialog?: () => void;
5
5
  photoError?: string;
6
6
  locale?: Locale;
7
+ theme?: Theme;
7
8
  };
8
9
  export type ErrorUploadDialogProps = ErrorUploadDialogCustomProps & DialogProps;
9
10
  export {};
@@ -1,7 +1,7 @@
1
1
  import { SyntheticEvent } from 'react';
2
2
  import { DialogProps } from '@mui/material';
3
3
  import { Crop, PercentCrop, PixelCrop } from 'react-image-crop';
4
- import { Locale } from '../../../../types';
4
+ import { Locale, Theme } from '../../../../types';
5
5
  import { FileErrorItem, PhotoDataUrl } from '../../types';
6
6
  type OnPhotoLoad = (event: SyntheticEvent<HTMLImageElement, Event>) => void;
7
7
  type OnCropChange = (pixelCrop: PixelCrop, percentCrop: PercentCrop) => void;
@@ -29,6 +29,7 @@ type UploadDialogCustomProps = {
29
29
  photoSourceLoading: boolean;
30
30
  loadingValue?: number;
31
31
  errors?: FileErrorItem[];
32
+ theme?: Theme;
32
33
  };
33
34
  export type UploadDialogProps = UploadDialogCustomProps & DialogProps;
34
35
  export type UploadDialogErrorsProps = {
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "../../../../index-YnD2EP-S.js";
3
3
  import "../../locale.js";
4
4
  import "../../../../constants.js";
5
- import { U as s } from "../../../../upload-dialog-errors-Cyz6_7n4.js";
5
+ import { U as s } from "../../../../upload-dialog-errors-DHl0bh1n.js";
6
6
  import "../../../../DialogTitle-BtvmXSZP.js";
7
7
  import "../../../button/button.js";
8
8
  export {
@@ -1,28 +1,28 @@
1
- import { jsxs as L, jsx as a, Fragment as _ } from "react/jsx-runtime";
2
- import * as k from "react";
3
- import { S as $ } from "../../../../index-CcueJ2sD.js";
1
+ import { jsxs as L, jsx as a, Fragment as $ } from "react/jsx-runtime";
2
+ import * as w from "react";
3
+ import { S as V } from "../../../../index-CcueJ2sD.js";
4
4
  import { c as i } from "../../../../index-YnD2EP-S.js";
5
- import { s as n, U as V } from "../../../../upload-dialog-errors-Cyz6_7n4.js";
6
- import { PhotoList as H } from "../photo-list/photo-list.js";
5
+ import { s as n, U as H } from "../../../../upload-dialog-errors-DHl0bh1n.js";
6
+ import { PhotoList as Z } from "../photo-list/photo-list.js";
7
7
  import { localizedText as p } from "../../locale.js";
8
- import { EN_LOCALE as Z } from "../../../../constants.js";
9
- import { CLOSE_ICON_SIZE as w } from "./constants.js";
10
- import { DEFAULT_MIN_DIMENSION as Y, DEFAULT_ASPECT_RATIO as q } from "../../constants.js";
8
+ import { EN_LOCALE as K, DARK_THEME as Y } from "../../../../constants.js";
9
+ import { CLOSE_ICON_SIZE as D } from "./constants.js";
10
+ import { DEFAULT_MIN_DIMENSION as q, DEFAULT_ASPECT_RATIO as G } from "../../constants.js";
11
11
  import { D as O } from "../../../../Dialog-Cf0d7zi7.js";
12
- import { a as D, b as E, D as G } from "../../../../DialogTitle-BtvmXSZP.js";
13
- import { CircularProgressLoader as J } from "../../../circular-progress-loader/circular-progress-loader.js";
14
- import { g as K, a as Q, c as X, b as m, P as t } from "../../../../createTheme-D8R2Cz2N.js";
15
- import { m as A } from "../../../../memoTheme-D5VCpQCz.js";
16
- import { c as M } from "../../../../createSimplePaletteValueFilter-B7--0ryQ.js";
17
- import { u as oo, c as eo, s as W, b as to } from "../../../../chainPropTypes-DiJb1lGa.js";
18
- import { u as ao } from "../../../../useId-CK6Kn3Tn.js";
19
- import { B as ro } from "../../../../ButtonBase-CSWuFxUv.js";
20
- import { C as no } from "../../../../CircularProgress-sPARyPfh.js";
21
- import { Button as P } from "../../../button/button.js";
22
- import '../../../../assets/upload-dialog.css';function io(o) {
23
- return K("MuiIconButton", o);
12
+ import { a as A, b as P, D as J } from "../../../../DialogTitle-BtvmXSZP.js";
13
+ import { CircularProgressLoader as Q } from "../../../circular-progress-loader/circular-progress-loader.js";
14
+ import { g as X, a as oo, c as eo, b as m, P as t } from "../../../../createTheme-D8R2Cz2N.js";
15
+ import { m as M } from "../../../../memoTheme-D5VCpQCz.js";
16
+ import { c as U } from "../../../../createSimplePaletteValueFilter-B7--0ryQ.js";
17
+ import { u as to, c as ao, s as _, b as ro } from "../../../../chainPropTypes-DiJb1lGa.js";
18
+ import { u as no } from "../../../../useId-CK6Kn3Tn.js";
19
+ import { B as io } from "../../../../ButtonBase-CSWuFxUv.js";
20
+ import { C as lo } from "../../../../CircularProgress-sPARyPfh.js";
21
+ import { Button as k } from "../../../button/button.js";
22
+ import '../../../../assets/upload-dialog.css';function so(o) {
23
+ return X("MuiIconButton", o);
24
24
  }
25
- const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge", "loading", "loadingIndicator", "loadingWrapper"]), lo = (o) => {
25
+ const W = oo("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge", "loading", "loadingIndicator", "loadingWrapper"]), co = (o) => {
26
26
  const {
27
27
  classes: e,
28
28
  disabled: r,
@@ -35,8 +35,8 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
35
35
  loadingIndicator: ["loadingIndicator"],
36
36
  loadingWrapper: ["loadingWrapper"]
37
37
  };
38
- return eo(u, io, e);
39
- }, so = W(ro, {
38
+ return ao(u, so, e);
39
+ }, po = _(io, {
40
40
  name: "MuiIconButton",
41
41
  slot: "Root",
42
42
  overridesResolver: (o, e) => {
@@ -45,7 +45,7 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
45
45
  } = o;
46
46
  return [e.root, r.loading && e.loading, r.color !== "default" && e[`color${m(r.color)}`], r.edge && e[`edge${m(r.edge)}`], e[`size${m(r.size)}`]];
47
47
  }
48
- })(A(({
48
+ })(M(({
49
49
  theme: o
50
50
  }) => ({
51
51
  textAlign: "center",
@@ -100,7 +100,7 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
100
100
  marginRight: -3
101
101
  }
102
102
  }]
103
- })), A(({
103
+ })), M(({
104
104
  theme: o
105
105
  }) => ({
106
106
  variants: [{
@@ -110,14 +110,14 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
110
110
  style: {
111
111
  color: "inherit"
112
112
  }
113
- }, ...Object.entries(o.palette).filter(M()).map(([e]) => ({
113
+ }, ...Object.entries(o.palette).filter(U()).map(([e]) => ({
114
114
  props: {
115
115
  color: e
116
116
  },
117
117
  style: {
118
118
  color: (o.vars || o).palette[e].main
119
119
  }
120
- })), ...Object.entries(o.palette).filter(M()).map(([e]) => ({
120
+ })), ...Object.entries(o.palette).filter(U()).map(([e]) => ({
121
121
  props: {
122
122
  color: e
123
123
  },
@@ -141,14 +141,14 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
141
141
  fontSize: o.typography.pxToRem(28)
142
142
  }
143
143
  }],
144
- [`&.${U.disabled}`]: {
144
+ [`&.${W.disabled}`]: {
145
145
  backgroundColor: "transparent",
146
146
  color: (o.vars || o).palette.action.disabled
147
147
  },
148
- [`&.${U.loading}`]: {
148
+ [`&.${W.loading}`]: {
149
149
  color: "transparent"
150
150
  }
151
- }))), co = W("span", {
151
+ }))), go = _("span", {
152
152
  name: "MuiIconButton",
153
153
  slot: "LoadingIndicator"
154
154
  })(({
@@ -169,8 +169,8 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
169
169
  display: "flex"
170
170
  }
171
171
  }]
172
- })), j = /* @__PURE__ */ k.forwardRef(function(e, r) {
173
- const c = oo({
172
+ })), j = /* @__PURE__ */ w.forwardRef(function(e, r) {
173
+ const c = to({
174
174
  props: e,
175
175
  name: "MuiIconButton"
176
176
  }), {
@@ -185,7 +185,7 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
185
185
  loading: s = null,
186
186
  loadingIndicator: R,
187
187
  ...l
188
- } = c, N = ao(v), B = R ?? /* @__PURE__ */ a(no, {
188
+ } = c, N = no(v), B = R ?? /* @__PURE__ */ a(lo, {
189
189
  "aria-labelledby": N,
190
190
  color: "inherit",
191
191
  size: 16
@@ -198,10 +198,10 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
198
198
  loading: s,
199
199
  loadingIndicator: B,
200
200
  size: z
201
- }, d = lo(h);
202
- return /* @__PURE__ */ L(so, {
201
+ }, d = co(h);
202
+ return /* @__PURE__ */ L(po, {
203
203
  id: s ? N : v,
204
- className: X(d.root, b),
204
+ className: eo(d.root, b),
205
205
  centerRipple: !0,
206
206
  focusRipple: !I,
207
207
  disabled: y || s,
@@ -214,7 +214,7 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
214
214
  style: {
215
215
  display: "contents"
216
216
  },
217
- children: /* @__PURE__ */ a(co, {
217
+ children: /* @__PURE__ */ a(go, {
218
218
  className: d.loadingIndicator,
219
219
  ownerState: h,
220
220
  children: s && B
@@ -230,7 +230,7 @@ process.env.NODE_ENV !== "production" && (j.propTypes = {
230
230
  /**
231
231
  * The icon to display.
232
232
  */
233
- children: to(t.node, (o) => k.Children.toArray(o.children).some((r) => /* @__PURE__ */ k.isValidElement(r) && r.props.onClick) ? new Error(["MUI: You are providing an onClick event listener to a child of a button element.", "Prefer applying it to the IconButton directly.", "This guarantees that the whole <button> will be responsive to click events."].join(`
233
+ children: ro(t.node, (o) => w.Children.toArray(o.children).some((r) => /* @__PURE__ */ w.isValidElement(r) && r.props.onClick) ? new Error(["MUI: You are providing an onClick event listener to a child of a button element.", "Prefer applying it to the IconButton directly.", "This guarantees that the whole <button> will be responsive to click events."].join(`
234
234
  `)) : null),
235
235
  /**
236
236
  * Override or extend the styles applied to the component.
@@ -301,7 +301,7 @@ process.env.NODE_ENV !== "production" && (j.propTypes = {
301
301
  */
302
302
  sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
303
303
  });
304
- const po = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%200%2046%2046'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.3434%2015.4595C16.8227%2014.9388%2015.9785%2014.9388%2015.4578%2015.4595C14.9371%2015.9802%2014.9371%2016.8244%2015.4578%2017.3451L21.1146%2023.002L15.4578%2028.6588C14.9371%2029.1795%2014.9371%2030.0237%2015.4578%2030.5444C15.9785%2031.0651%2016.8227%2031.0651%2017.3434%2030.5444L23.0002%2024.8876L28.6571%2030.5444C29.1778%2031.0651%2030.022%2031.0651%2030.5427%2030.5444C31.0634%2030.0237%2031.0634%2029.1795%2030.5427%2028.6588L24.8858%2023.002L30.5427%2017.3451C31.0634%2016.8244%2031.0634%2015.9802%2030.5427%2015.4595C30.022%2014.9388%2029.1778%2014.9388%2028.6571%2015.4595L23.0002%2021.1163L17.3434%2015.4595Z'%20fill='%233AA8FF'/%3e%3c/svg%3e", Po = (o) => {
304
+ const uo = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%200%2046%2046'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.3434%2015.4595C16.8227%2014.9388%2015.9785%2014.9388%2015.4578%2015.4595C14.9371%2015.9802%2014.9371%2016.8244%2015.4578%2017.3451L21.1146%2023.002L15.4578%2028.6588C14.9371%2029.1795%2014.9371%2030.0237%2015.4578%2030.5444C15.9785%2031.0651%2016.8227%2031.0651%2017.3434%2030.5444L23.0002%2024.8876L28.6571%2030.5444C29.1778%2031.0651%2030.022%2031.0651%2030.5427%2030.5444C31.0634%2030.0237%2031.0634%2029.1795%2030.5427%2028.6588L24.8858%2023.002L30.5427%2017.3451C31.0634%2016.8244%2031.0634%2015.9802%2030.5427%2015.4595C30.022%2014.9388%2029.1778%2014.9388%2028.6571%2015.4595L23.0002%2021.1163L17.3434%2015.4595Z'%20fill='%233AA8FF'/%3e%3c/svg%3e", wo = (o) => {
305
305
  const {
306
306
  onCloseDialogHandler: e,
307
307
  photoSources: r = [],
@@ -315,38 +315,39 @@ const po = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
315
315
  onNextPhoto: I,
316
316
  onSkipCrop: z,
317
317
  onClearErrors: v,
318
- minDimension: s = Y,
319
- aspectRatio: R = q,
320
- locale: l = Z,
318
+ minDimension: s = q,
319
+ aspectRatio: R = G,
320
+ locale: l = K,
321
321
  circular: N,
322
322
  keepSelection: B = !0,
323
323
  photoSourceLoading: h,
324
324
  className: d,
325
325
  photoIndex: C,
326
326
  loadingValue: F,
327
- errors: x,
328
- ...T
327
+ errors: T,
328
+ theme: x = Y,
329
+ ...E
329
330
  } = o, S = r.slice(C).length > 1;
330
- return h || !r.length && !x?.length ? /* @__PURE__ */ a(
331
+ return h || !r.length && !T?.length ? /* @__PURE__ */ a(
331
332
  O,
332
333
  {
333
- className: i(n.dialog, d),
334
+ className: i(n.dialog, d, n[x]),
334
335
  onClose: e,
335
- ...T,
336
- children: /* @__PURE__ */ a(D, { className: i(n.content), children: /* @__PURE__ */ a(J, { value: F }) })
336
+ ...E,
337
+ children: /* @__PURE__ */ a(A, { className: i(n.content), children: /* @__PURE__ */ a(Q, { value: F }) })
337
338
  }
338
- ) : x?.length ? /* @__PURE__ */ a(
339
+ ) : T?.length ? /* @__PURE__ */ a(
339
340
  O,
340
341
  {
341
- className: i(n.dialog, d),
342
+ className: i(n.dialog, d, n[x]),
342
343
  onClose: e,
343
- ...T,
344
+ ...E,
344
345
  children: /* @__PURE__ */ a(
345
- V,
346
+ H,
346
347
  {
347
348
  locale: l,
348
349
  photoSources: r,
349
- errors: x,
350
+ errors: T,
350
351
  onCloseDialogHandler: e,
351
352
  onClearErrors: v
352
353
  }
@@ -355,11 +356,11 @@ const po = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
355
356
  ) : /* @__PURE__ */ L(
356
357
  O,
357
358
  {
358
- className: i(n.dialog, d),
359
+ className: i(n.dialog, d, n[x]),
359
360
  onClose: e,
360
- ...T,
361
+ ...E,
361
362
  children: [
362
- /* @__PURE__ */ a(E, { className: i(n.topActions), children: /* @__PURE__ */ a(
363
+ /* @__PURE__ */ a(P, { className: i(n.topActions), children: /* @__PURE__ */ a(
363
364
  j,
364
365
  {
365
366
  onClick: e,
@@ -369,19 +370,19 @@ const po = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
369
370
  "img",
370
371
  {
371
372
  draggable: !1,
372
- width: w,
373
- height: w,
374
- src: po,
373
+ width: D,
374
+ height: D,
375
+ src: uo,
375
376
  alt: p[l].back
376
377
  }
377
378
  )
378
379
  }
379
380
  ) }),
380
- /* @__PURE__ */ a(G, { className: i(n.title), children: p[l]["photo-crop"] }),
381
- /* @__PURE__ */ L(D, { className: i(n.content, S && n.many), children: [
381
+ /* @__PURE__ */ a(J, { className: i(n.title), children: p[l]["photo-crop"] }),
382
+ /* @__PURE__ */ L(A, { className: i(n.content, S && n.many), children: [
382
383
  S && /* @__PURE__ */ a("span", {}),
383
384
  !!r.length && /* @__PURE__ */ a(
384
- $,
385
+ V,
385
386
  {
386
387
  className: i(n.crop),
387
388
  crop: c[C],
@@ -404,12 +405,12 @@ const po = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
404
405
  )
405
406
  }
406
407
  ),
407
- S && /* @__PURE__ */ a(H, { photoSources: r, photoIndex: C })
408
+ S && /* @__PURE__ */ a(Z, { photoSources: r, photoIndex: C })
408
409
  ] }),
409
- u && /* @__PURE__ */ a(E, { className: i(n.dialogText), children: u }),
410
- /* @__PURE__ */ a(E, { className: i(n.botActions), children: S ? /* @__PURE__ */ L(_, { children: [
410
+ u && /* @__PURE__ */ a(P, { className: i(n.dialogText), children: u }),
411
+ /* @__PURE__ */ a(P, { className: i(n.botActions), children: S ? /* @__PURE__ */ L($, { children: [
411
412
  /* @__PURE__ */ a(
412
- P,
413
+ k,
413
414
  {
414
415
  buttonSize: "small",
415
416
  buttonColor: "blue",
@@ -421,7 +422,7 @@ const po = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
421
422
  }
422
423
  ),
423
424
  /* @__PURE__ */ a(
424
- P,
425
+ k,
425
426
  {
426
427
  buttonSize: "small",
427
428
  buttonColor: "blue",
@@ -433,7 +434,7 @@ const po = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
433
434
  }
434
435
  )
435
436
  ] }) : /* @__PURE__ */ a(
436
- P,
437
+ k,
437
438
  {
438
439
  minWidth: "100%",
439
440
  buttonSize: "small",
@@ -450,5 +451,5 @@ const po = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
450
451
  );
451
452
  };
452
453
  export {
453
- Po as UploadDialog
454
+ wo as UploadDialog
454
455
  };
@@ -1,73 +1,74 @@
1
- import { jsxs as No, Fragment as Ho, jsx as U } from "react/jsx-runtime";
2
- import { useState as i, useRef as A } from "react";
3
- import { v as Vo, D as bo } from "../../index-CcueJ2sD.js";
4
- import { c as ko } from "../../index-YnD2EP-S.js";
5
- import { localizedText as zo } from "./locale.js";
6
- import { EN_LOCALE as jo } from "../../constants.js";
7
- import { DEFAULT_MIN_DIMENSION as Wo, DEFAULT_ASPECT_RATIO as Bo, DEFAULT_TIMEOUT as Go, DEFAULT_FILE_MAX_SIZE as Xo, DEFAULT_VIDEO_FILE_MAX_SIZE as Yo, DEFAULT_BASE_DIMENSION as Zo, FULL_PROGRESS_VALUE as $, PHOTO_LOADING_DELAY as qo, RESET_DATA_DELAY as d } from "./constants.js";
8
- import { UploadDialog as Jo } from "./components/upload-dialog/upload-dialog.js";
9
- import { UploadButton as Ko } from "./components/upload-button/upload-button.js";
10
- import { ErrorUploadDialog as Qo } from "./components/error-upload-dialog/error-upload-dialog.js";
11
- import { isVideo as oo } from "./utils/is-video.js";
12
- import { validateVideoFile as eo } from "./utils/validate-video-file.js";
13
- import { validatePhotoFile as to } from "./utils/validate-photo-file.js";
14
- import { readPhoto as ro } from "./utils/read-photo.js";
15
- import { getPhotoCrop as $o } from "./utils/get-photo-crop.js";
16
- import { getCroppedSource as oe } from "./utils/get-cropped-source.js";
17
- import { getDefaultCroppedPhoto as no } from "./utils/get-default-cropped-photo.js";
18
- import '../../assets/photo-crop-uploader.css';const ee = "_photoCropCanvas_1i4lr_1", te = {
19
- photoCropCanvas: ee
1
+ import { jsxs as Ho, Fragment as Vo, jsx as A } from "react/jsx-runtime";
2
+ import { useState as i, useRef as U } from "react";
3
+ import { v as bo, D as ko } from "../../index-CcueJ2sD.js";
4
+ import { c as zo } from "../../index-YnD2EP-S.js";
5
+ import { localizedText as jo } from "./locale.js";
6
+ import { EN_LOCALE as Wo, DARK_THEME as Bo } from "../../constants.js";
7
+ import { DEFAULT_MIN_DIMENSION as Go, DEFAULT_ASPECT_RATIO as Xo, DEFAULT_TIMEOUT as Yo, DEFAULT_FILE_MAX_SIZE as Zo, DEFAULT_VIDEO_FILE_MAX_SIZE as Ko, DEFAULT_BASE_DIMENSION as qo, FULL_PROGRESS_VALUE as oo, PHOTO_LOADING_DELAY as Jo, RESET_DATA_DELAY as d } from "./constants.js";
8
+ import { UploadDialog as Qo } from "./components/upload-dialog/upload-dialog.js";
9
+ import { UploadButton as $o } from "./components/upload-button/upload-button.js";
10
+ import { ErrorUploadDialog as oe } from "./components/error-upload-dialog/error-upload-dialog.js";
11
+ import { isVideo as eo } from "./utils/is-video.js";
12
+ import { validateVideoFile as to } from "./utils/validate-video-file.js";
13
+ import { validatePhotoFile as ro } from "./utils/validate-photo-file.js";
14
+ import { readPhoto as no } from "./utils/read-photo.js";
15
+ import { getPhotoCrop as ee } from "./utils/get-photo-crop.js";
16
+ import { getCroppedSource as te } from "./utils/get-cropped-source.js";
17
+ import { getDefaultCroppedPhoto as so } from "./utils/get-default-cropped-photo.js";
18
+ import '../../assets/photo-crop-uploader.css';const re = "_photoCropCanvas_1i4lr_1", ne = {
19
+ photoCropCanvas: re
20
20
  };
21
- function Le(a) {
21
+ function Te(a) {
22
22
  const {
23
- buttonClassname: so = "",
24
- onStartUpload: ao = () => {
23
+ buttonClassname: ao = "",
24
+ onStartUpload: io = () => {
25
25
  },
26
- onEndUpload: io = () => {
26
+ onEndUpload: lo = () => {
27
27
  },
28
- onError: lo = () => {
28
+ onError: co = () => {
29
29
  },
30
- onStartCrop: co = () => {
30
+ onStartCrop: po = () => {
31
31
  },
32
- onDragOver: po = () => {
32
+ onDragOver: uo = () => {
33
33
  },
34
- onDragLeave: uo = () => {
34
+ onDragLeave: fo = () => {
35
35
  },
36
- onDragDrop: fo = () => {
36
+ onDragDrop: ho = () => {
37
37
  },
38
- showErrorPopup: ho = !1,
39
- minDimension: l = Wo,
40
- aspectRatio: C = Bo,
41
- locale: n = jo,
42
- timeout: M = Go,
43
- fileMaxSize: N = Xo,
44
- videoFileMaxSize: H = Yo,
38
+ showErrorPopup: mo = !1,
39
+ minDimension: l = Go,
40
+ aspectRatio: C = Xo,
41
+ locale: n = Wo,
42
+ timeout: y = Yo,
43
+ fileMaxSize: N = Zo,
44
+ videoFileMaxSize: H = Ko,
45
45
  allowedExtensions: w,
46
46
  allowedMimeTypes: V,
47
- circular: mo,
47
+ circular: Co,
48
48
  usePercentCrop: b = !0,
49
- width: Co,
49
+ width: Eo,
50
50
  keepSelection: go,
51
- uploadButton: Eo,
52
- multiple: g = !1,
51
+ uploadButton: Po,
52
+ multiple: E = !1,
53
53
  fromSources: k,
54
54
  withVideoUploaded: v = !1,
55
- returnCropParams: Po = !1,
55
+ returnCropParams: Do = !1,
56
56
  dialogClassname: z,
57
- defaultDimension: Do = Zo,
58
- ...So
59
- } = a, {
60
- onEndCrop: re,
61
- onClose: ne,
57
+ theme: j = Bo,
58
+ defaultDimension: So = qo,
62
59
  ...Lo
63
- } = So, [_o, E] = i(!1), [P, D] = i([]), [I, x] = i([]), f = A([]), h = A([]), [p, j] = i(0), W = A(null), B = A(null), [c, O] = i(!1), [To, G] = i(0), [X, Y] = i(""), [Uo, S] = i([]), [Ao, Z] = i(!1), wo = _o || c && g, vo = () => {
60
+ } = a, {
61
+ onEndCrop: se,
62
+ onClose: ae,
63
+ ..._o
64
+ } = Lo, [To, g] = i(!1), [P, D] = i([]), [I, x] = i([]), f = U([]), h = U([]), [p, W] = i(0), B = U(null), G = U(null), [c, O] = i(!1), [Ao, X] = i(0), [Y, Z] = i(""), [Uo, S] = i([]), [wo, K] = i(!1), vo = To || c && E, Io = () => {
64
65
  S([]);
65
66
  }, F = (e = []) => {
66
67
  c || (a.returnCropParams === !0 && a.onClose?.(
67
68
  e,
68
69
  f.current,
69
70
  h.current
70
- ), E(!1), setTimeout(() => S([]), d), setTimeout(() => D([]), d), setTimeout(() => {
71
+ ), g(!1), setTimeout(() => S([]), d), setTimeout(() => D([]), d), setTimeout(() => {
71
72
  f.current = [], h.current = [];
72
73
  }, d));
73
74
  }, R = (e = []) => {
@@ -75,32 +76,32 @@ function Le(a) {
75
76
  e,
76
77
  f.current,
77
78
  h.current
78
- ), E(!1), setTimeout(() => S([]), d), setTimeout(() => D([]), d), setTimeout(() => {
79
+ ), g(!1), setTimeout(() => S([]), d), setTimeout(() => D([]), d), setTimeout(() => {
79
80
  f.current = [], h.current = [];
80
81
  }, d));
81
82
  }, q = () => {
82
83
  c || (a.returnCropParams === !0 ? F([]) : R([]));
83
- }, Io = () => {
84
- Z(!1);
84
+ }, xo = () => {
85
+ K(!1);
85
86
  }, L = (e, t = e, o = [], r = !1) => {
86
- io(e), Y(""), D(e), x(Array(e.length)), j(0), E(!0), f.current = t, h.current = o, !e.length && !r && q();
87
- }, y = (e) => {
88
- e instanceof Error && (console.warn(e.message), lo(e), Y(e.message), Z(!0), D([]), E(!1), f.current = [], h.current = []);
89
- }, xo = async (e) => {
87
+ lo(e), Z(""), D(e), x(Array(e.length)), W(0), g(!0), f.current = t, h.current = o, !e.length && !r && q();
88
+ }, M = (e) => {
89
+ e instanceof Error && (console.warn(e.message), co(e), Z(e.message), K(!0), D([]), g(!1), f.current = [], h.current = []);
90
+ }, Oo = async (e) => {
90
91
  const { files: t } = e.target;
91
92
  if (t?.length && !c)
92
93
  try {
93
- if (O(!0), ao(), g) {
94
- const o = Array.from(t), r = $ / o.length, _ = [], u = [], K = [], T = [];
94
+ if (O(!0), io(), E) {
95
+ const o = Array.from(t), r = oo / o.length, _ = [], u = [], Q = [], T = [];
95
96
  for (const m of o) {
96
- const Mo = oo(m);
97
+ const No = eo(m);
97
98
  try {
98
- if (v && Mo) {
99
- eo(m, H, n);
99
+ if (v && No) {
100
+ to(m, H, n);
100
101
  const s = URL.createObjectURL(m);
101
- K.push(u.length), u.push(s);
102
+ Q.push(u.length), u.push(s);
102
103
  } else {
103
- to(
104
+ ro(
104
105
  m,
105
106
  {
106
107
  maxSize: N,
@@ -109,85 +110,85 @@ function Le(a) {
109
110
  },
110
111
  n
111
112
  );
112
- const s = await ro(
113
+ const s = await no(
113
114
  m,
114
115
  l,
115
116
  n,
116
- M
117
+ y
117
118
  );
118
119
  _.push(s), u.push(s);
119
120
  }
120
121
  } catch (s) {
121
- let Q = "";
122
- s instanceof Error && (Q = s.message), T.push({
122
+ let $ = "";
123
+ s instanceof Error && ($ = s.message), T.push({
123
124
  photoName: m.name,
124
- errorMessage: Q
125
+ errorMessage: $
125
126
  });
126
127
  }
127
- G(
128
- (s) => Math.min($, s + r)
128
+ X(
129
+ (s) => Math.min(oo, s + r)
129
130
  ), await new Promise((s) => setTimeout(s, 0));
130
131
  }
131
132
  if (k?.length)
132
133
  throw new Error(T[0]?.errorMessage);
133
- S(T), L(_, u, K, T.length > 0);
134
+ S(T), L(_, u, Q, T.length > 0);
134
135
  } else {
135
136
  const o = t[0];
136
- if (v && oo(o)) {
137
- eo(o, H, n);
137
+ if (v && eo(o)) {
138
+ to(o, H, n);
138
139
  const r = URL.createObjectURL(o);
139
140
  L([], [r], [0]);
140
141
  } else {
141
- to(
142
+ ro(
142
143
  o,
143
144
  { maxSize: N, allowedExtensions: w, allowedMimeTypes: V },
144
145
  n
145
146
  );
146
- const r = await ro(o, l, n, M);
147
+ const r = await no(o, l, n, y);
147
148
  L([r]);
148
149
  }
149
150
  }
150
151
  } catch (o) {
151
- y(o);
152
+ M(o);
152
153
  } finally {
153
- g ? setTimeout(() => {
154
- e.target.value = "", G(0), O(!1);
155
- }, qo) : (e.target.value = "", O(!1));
154
+ E ? setTimeout(() => {
155
+ e.target.value = "", X(0), O(!1);
156
+ }, Jo) : (e.target.value = "", O(!1));
156
157
  }
157
- }, Oo = (e) => {
158
- const { width: t, height: o } = e.currentTarget, r = $o(
158
+ }, Fo = (e) => {
159
+ const { width: t, height: o } = e.currentTarget, r = ee(
159
160
  t,
160
161
  o,
161
162
  l,
162
163
  C,
163
164
  !1,
164
- Do
165
+ So
165
166
  );
166
167
  x((_) => {
167
168
  const u = [..._];
168
169
  return u[p] = r, u;
169
170
  });
170
- }, Fo = (e, t) => {
171
+ }, Ro = (e, t) => {
171
172
  x((o) => {
172
173
  const r = [...o];
173
174
  return r[p] = t, r;
174
175
  });
175
176
  }, J = () => {
176
- const e = B.current, t = W.current;
177
+ const e = G.current, t = B.current;
177
178
  if (e && t && I)
178
179
  try {
179
180
  const o = I[p];
180
181
  if (!o) return !1;
181
- if (co(), a.returnCropParams === !0) {
182
+ if (po(), a.returnCropParams === !0) {
182
183
  if (b) {
183
- const r = Vo(
184
+ const r = bo(
184
185
  o,
185
186
  t.naturalWidth,
186
187
  t.naturalHeight
187
188
  );
188
189
  a.onEndCrop?.(r);
189
190
  } else {
190
- const r = bo(
191
+ const r = ko(
191
192
  o,
192
193
  t.naturalWidth,
193
194
  t.naturalHeight
@@ -196,7 +197,7 @@ function Le(a) {
196
197
  }
197
198
  p >= P.length - 1 && F();
198
199
  } else {
199
- const r = oe(
200
+ const r = te(
200
201
  t,
201
202
  e,
202
203
  o,
@@ -206,19 +207,19 @@ function Le(a) {
206
207
  }
207
208
  return !0;
208
209
  } catch (o) {
209
- return o instanceof Error && (console.warn(o), y(o)), !1;
210
+ return o instanceof Error && (console.warn(o), M(o)), !1;
210
211
  }
211
212
  else
212
213
  return !1;
213
- }, Ro = () => {
214
- J() && j((t) => t + 1);
214
+ }, Mo = () => {
215
+ J() && W((t) => t + 1);
215
216
  }, yo = async () => {
216
217
  const e = P.slice(p);
217
218
  try {
218
- if (Po) {
219
+ if (Do) {
219
220
  const t = await Promise.all(
220
221
  e.map(
221
- (o) => no(
222
+ (o) => so(
222
223
  o,
223
224
  l,
224
225
  C,
@@ -232,7 +233,7 @@ function Le(a) {
232
233
  } else {
233
234
  const t = await Promise.all(
234
235
  e.map(
235
- (o) => no(
236
+ (o) => so(
236
237
  o,
237
238
  l,
238
239
  C,
@@ -244,80 +245,82 @@ function Le(a) {
244
245
  R(t);
245
246
  }
246
247
  } catch (t) {
247
- y(t);
248
+ M(t);
248
249
  }
249
250
  };
250
- return /* @__PURE__ */ No(Ho, { children: [
251
- /* @__PURE__ */ U(
252
- Ko,
251
+ return /* @__PURE__ */ Ho(Vo, { children: [
252
+ /* @__PURE__ */ A(
253
+ $o,
253
254
  {
254
- onChange: xo,
255
+ onChange: Oo,
255
256
  onPhotoDataLoaded: L,
256
- buttonClassname: so,
257
+ buttonClassname: ao,
257
258
  disabled: c,
258
259
  buttonDisabled: c,
259
260
  locale: n,
260
- width: Co,
261
+ width: Eo,
261
262
  allowedExtensions: w,
262
- onDragDrop: fo,
263
- onDragLeave: uo,
264
- onDragOver: po,
265
- button: Eo,
266
- multiple: g,
263
+ onDragDrop: ho,
264
+ onDragLeave: fo,
265
+ onDragOver: uo,
266
+ button: Po,
267
+ multiple: E,
267
268
  fromSources: k,
268
269
  withVideoUploaded: v,
269
- ...Lo,
270
- children: zo[n].upload
270
+ ..._o,
271
+ children: jo[n].upload
271
272
  }
272
273
  ),
273
- /* @__PURE__ */ U(
274
- Jo,
274
+ /* @__PURE__ */ A(
275
+ Qo,
275
276
  {
276
- open: wo,
277
+ open: vo,
277
278
  className: z,
278
279
  photoSourceLoading: c,
279
- loadingValue: To,
280
+ loadingValue: Ao,
280
281
  errors: Uo,
281
282
  photoCrops: I,
282
283
  photoSources: P,
283
- onNextPhoto: Ro,
284
+ onNextPhoto: Mo,
284
285
  onSkipCrop: yo,
285
- onClearErrors: vo,
286
- photoError: X,
286
+ onClearErrors: Io,
287
+ photoError: Y,
287
288
  onCloseDialogHandler: q,
288
- onCropChange: Fo,
289
+ onCropChange: Ro,
289
290
  onPhotoCrop: J,
290
- onPhotoLoad: Oo,
291
- imageRef: W,
291
+ onPhotoLoad: Fo,
292
+ imageRef: B,
292
293
  minDimension: l,
293
294
  aspectRatio: C,
294
295
  locale: n,
295
- circular: mo,
296
+ circular: Co,
296
297
  keepSelection: go,
297
- photoIndex: p
298
+ photoIndex: p,
299
+ theme: j
298
300
  }
299
301
  ),
300
- /* @__PURE__ */ U(
301
- Qo,
302
+ /* @__PURE__ */ A(
303
+ oe,
302
304
  {
303
305
  className: z,
304
- open: ho && Ao,
305
- photoError: X,
306
- onCloseErrorDialog: Io,
307
- locale: n
306
+ open: mo && wo,
307
+ photoError: Y,
308
+ onCloseErrorDialog: xo,
309
+ locale: n,
310
+ theme: j
308
311
  }
309
312
  ),
310
- /* @__PURE__ */ U(
313
+ /* @__PURE__ */ A(
311
314
  "canvas",
312
315
  {
313
- className: ko(te.photoCropCanvas),
316
+ className: zo(ne.photoCropCanvas),
314
317
  width: l,
315
318
  height: l,
316
- ref: B
319
+ ref: G
317
320
  }
318
321
  )
319
322
  ] });
320
323
  }
321
324
  export {
322
- Le as PhotoCropUploader
325
+ Te as PhotoCropUploader
323
326
  };
@@ -1,6 +1,6 @@
1
1
  import { DragEvent, InputHTMLAttributes, ReactNode } from 'react';
2
2
  import { Crop } from 'react-image-crop';
3
- import { Locale } from '../../types';
3
+ import { Locale, Theme } from '../../types';
4
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';
5
5
  export type PhotoDataUrl = string;
6
6
  export type PhotoFileSize = number;
@@ -53,6 +53,7 @@ export type PhotoCropUploaderCustomProps = {
53
53
  fromSources?: PhotoDataUrl[];
54
54
  withVideoUploaded?: boolean;
55
55
  dialogClassname?: string;
56
+ theme?: Theme;
56
57
  };
57
58
  export type PhotoCropUploaderProps = PhotoCropUploaderCustomProps & CropProps & InputHTMLAttributes<HTMLInputElement>;
58
59
  export type PhotoCropUploaderLocaleText = Record<Locale, Record<string, string>>;
@@ -3,3 +3,5 @@ export declare const RU_LOCALE = "ru";
3
3
  export declare const BYTE_TO_KILOBYTE = 1024;
4
4
  export declare const PERCENT_SYMBOL = "%";
5
5
  export declare const DASH_SYMBOL = "-";
6
+ export declare const LIGHT_THEME = "light";
7
+ export declare const DARK_THEME = "dark";
package/dist/constants.js CHANGED
@@ -1,8 +1,10 @@
1
- const E = "en", L = "ru", n = 1024, o = "%", t = "-";
1
+ const E = "en", t = "ru", n = 1024, o = "%", L = "-", _ = "light", c = "dark";
2
2
  export {
3
3
  n as BYTE_TO_KILOBYTE,
4
- t as DASH_SYMBOL,
4
+ c as DARK_THEME,
5
+ L as DASH_SYMBOL,
5
6
  E as EN_LOCALE,
7
+ _ as LIGHT_THEME,
6
8
  o as PERCENT_SYMBOL,
7
- L as RU_LOCALE
9
+ t as RU_LOCALE
8
10
  };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export { PhotoCropUploader, Button, CircularProgressLoader, CodeInput } from './components';
1
+ export { PhotoCropUploader, Button, CircularProgressLoader, CodeInput, } from './components';
2
2
  export { drawCroppedImage } from './components';
3
3
  export type { Crop, PercentCrop, PixelCrop } from 'react-image-crop';
4
4
  export type { CodeInputProps } from './components';
5
- export type { Locale } from './types';
5
+ export type { Locale, Theme } from './types';
6
6
  export type { PhotoDataUrl, PhotoFileSize, PhotoExtension, PhotoMimeType, PhotoFileOptions, PhotoCropUploaderProps, } from './components/photo-crop-uploader/types';
7
- export { EN_LOCALE, RU_LOCALE, BYTE_TO_KILOBYTE } from './constants';
7
+ export { EN_LOCALE, RU_LOCALE, BYTE_TO_KILOBYTE, LIGHT_THEME, DARK_THEME, } from './constants';
8
8
  export { JPG_IMAGE_EXT, JPEG_IMAGE_EXT, PNG_IMAGE_EXT, SVG_IMAGE_EXT, BMP_IMAGE_EXT, GIF_IMAGE_EXT, WEBP_IMAGE_EXT, ICO_IMAGE_EXT, 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, } from './components/photo-crop-uploader/constants';
package/dist/index.js CHANGED
@@ -1,34 +1,36 @@
1
- import { BYTE_TO_KILOBYTE as G, EN_LOCALE as I, RU_LOCALE as o } from "./constants.js";
2
- import { BMP_IMAGE_EXT as P, BMP_IMAGE_TYPE as T, GIF_IMAGE_EXT as M, GIF_IMAGE_TYPE as A, ICO_IMAGE_EXT as e, ICO_IMAGE_TYPE as p, JPEG_IMAGE_EXT as t, JPEG_IMAGE_TYPE as Y, JPG_IMAGE_EXT as C, JPG_IMAGE_TYPE as O, MICROSOFT_ICO_IMAGE_TYPE as m, PNG_IMAGE_EXT as X, PNG_IMAGE_TYPE as f, SVG_IMAGE_EXT as x, SVG_IMAGE_TYPE as B, WEBP_IMAGE_EXT as L, WEBP_IMAGE_TYPE as a } from "./components/photo-crop-uploader/constants.js";
3
- import { Button as J } from "./components/button/button.js";
4
- import { CircularProgressLoader as F } from "./components/circular-progress-loader/circular-progress-loader.js";
1
+ import { BYTE_TO_KILOBYTE as G, DARK_THEME as I, EN_LOCALE as T, LIGHT_THEME as o, RU_LOCALE as r } from "./constants.js";
2
+ import { BMP_IMAGE_EXT as P, BMP_IMAGE_TYPE as A, GIF_IMAGE_EXT as e, GIF_IMAGE_TYPE as p, ICO_IMAGE_EXT as t, ICO_IMAGE_TYPE as Y, JPEG_IMAGE_EXT as C, JPEG_IMAGE_TYPE as O, JPG_IMAGE_EXT as m, JPG_IMAGE_TYPE as X, MICROSOFT_ICO_IMAGE_TYPE as f, PNG_IMAGE_EXT as x, PNG_IMAGE_TYPE as B, SVG_IMAGE_EXT as L, SVG_IMAGE_TYPE as a, WEBP_IMAGE_EXT as d, WEBP_IMAGE_TYPE as J } from "./components/photo-crop-uploader/constants.js";
3
+ import { Button as F } from "./components/button/button.js";
4
+ import { CircularProgressLoader as N } from "./components/circular-progress-loader/circular-progress-loader.js";
5
5
  import { CodeInput as S } from "./components/code-input/code-input.js";
6
6
  import { PhotoCropUploader as l } from "./components/photo-crop-uploader/photo-crop-uploader.js";
7
7
  import { drawCroppedImage as s } from "./components/photo-crop-uploader/utils/draw-cropped-image.js";
8
8
  export {
9
9
  P as BMP_IMAGE_EXT,
10
- T as BMP_IMAGE_TYPE,
10
+ A as BMP_IMAGE_TYPE,
11
11
  G as BYTE_TO_KILOBYTE,
12
- J as Button,
13
- F as CircularProgressLoader,
12
+ F as Button,
13
+ N as CircularProgressLoader,
14
14
  S as CodeInput,
15
- I as EN_LOCALE,
16
- M as GIF_IMAGE_EXT,
17
- A as GIF_IMAGE_TYPE,
18
- e as ICO_IMAGE_EXT,
19
- p as ICO_IMAGE_TYPE,
20
- t as JPEG_IMAGE_EXT,
21
- Y as JPEG_IMAGE_TYPE,
22
- C as JPG_IMAGE_EXT,
23
- O as JPG_IMAGE_TYPE,
24
- m as MICROSOFT_ICO_IMAGE_TYPE,
25
- X as PNG_IMAGE_EXT,
26
- f as PNG_IMAGE_TYPE,
15
+ I as DARK_THEME,
16
+ T as EN_LOCALE,
17
+ e as GIF_IMAGE_EXT,
18
+ p as GIF_IMAGE_TYPE,
19
+ t as ICO_IMAGE_EXT,
20
+ Y as ICO_IMAGE_TYPE,
21
+ C as JPEG_IMAGE_EXT,
22
+ O as JPEG_IMAGE_TYPE,
23
+ m as JPG_IMAGE_EXT,
24
+ X as JPG_IMAGE_TYPE,
25
+ o as LIGHT_THEME,
26
+ f as MICROSOFT_ICO_IMAGE_TYPE,
27
+ x as PNG_IMAGE_EXT,
28
+ B as PNG_IMAGE_TYPE,
27
29
  l as PhotoCropUploader,
28
- o as RU_LOCALE,
29
- x as SVG_IMAGE_EXT,
30
- B as SVG_IMAGE_TYPE,
31
- L as WEBP_IMAGE_EXT,
32
- a as WEBP_IMAGE_TYPE,
30
+ r as RU_LOCALE,
31
+ L as SVG_IMAGE_EXT,
32
+ a as SVG_IMAGE_TYPE,
33
+ d as WEBP_IMAGE_EXT,
34
+ J as WEBP_IMAGE_TYPE,
33
35
  s as drawCroppedImage
34
36
  };
package/dist/types.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- import { EN_LOCALE, RU_LOCALE } from './constants';
1
+ import { DARK_THEME, EN_LOCALE, LIGHT_THEME, RU_LOCALE } from './constants';
2
2
  export type Locale = typeof EN_LOCALE | typeof RU_LOCALE;
3
+ export type Theme = typeof LIGHT_THEME | typeof DARK_THEME;
@@ -1,33 +1,33 @@
1
1
  import { jsx as s, jsxs as g, Fragment as x } from "react/jsx-runtime";
2
2
  import { c } from "./index-YnD2EP-S.js";
3
3
  import { localizedText as f } from "./components/photo-crop-uploader/locale.js";
4
- import { EN_LOCALE as S, DASH_SYMBOL as L } from "./constants.js";
4
+ import { EN_LOCALE as L, DASH_SYMBOL as S } from "./constants.js";
5
5
  import { D as I, a as R, b as W } from "./DialogTitle-BtvmXSZP.js";
6
6
  import * as O from "react";
7
- import { g as V, a as B, c as $, P as r } from "./createTheme-D8R2Cz2N.js";
7
+ import { g as V, a as k, c as B, P as r } from "./createTheme-D8R2Cz2N.js";
8
8
  import { m as C } from "./memoTheme-D5VCpQCz.js";
9
- import { u as z, c as E, s as w } from "./chainPropTypes-DiJb1lGa.js";
9
+ import { u as $, c as z, s as w } from "./chainPropTypes-DiJb1lGa.js";
10
10
  import { Button as y } from "./components/button/button.js";
11
- import './assets/upload-dialog-errors.css';function M(e) {
11
+ import './assets/upload-dialog-errors.css';function E(e) {
12
12
  return V("MuiDivider", e);
13
13
  }
14
- B("MuiDivider", ["root", "absolute", "fullWidth", "inset", "middle", "flexItem", "light", "vertical", "withChildren", "withChildrenVertical", "textAlignRight", "textAlignLeft", "wrapper", "wrapperVertical"]);
15
- const U = (e) => {
14
+ k("MuiDivider", ["root", "absolute", "fullWidth", "inset", "middle", "flexItem", "light", "vertical", "withChildren", "withChildrenVertical", "textAlignRight", "textAlignLeft", "wrapper", "wrapperVertical"]);
15
+ const M = (e) => {
16
16
  const {
17
17
  absolute: t,
18
18
  children: o,
19
- classes: p,
19
+ classes: d,
20
20
  flexItem: h,
21
21
  light: i,
22
22
  orientation: n,
23
- textAlign: a,
24
- variant: l
23
+ textAlign: l,
24
+ variant: a
25
25
  } = e;
26
- return E({
27
- root: ["root", t && "absolute", l, i && "light", n === "vertical" && "vertical", h && "flexItem", o && "withChildren", o && n === "vertical" && "withChildrenVertical", a === "right" && n !== "vertical" && "textAlignRight", a === "left" && n !== "vertical" && "textAlignLeft"],
26
+ return z({
27
+ root: ["root", t && "absolute", a, i && "light", n === "vertical" && "vertical", h && "flexItem", o && "withChildren", o && n === "vertical" && "withChildrenVertical", l === "right" && n !== "vertical" && "textAlignRight", l === "left" && n !== "vertical" && "textAlignLeft"],
28
28
  wrapper: ["wrapper", n === "vertical" && "wrapperVertical"]
29
- }, M, p);
30
- }, j = w("div", {
29
+ }, E, d);
30
+ }, U = w("div", {
31
31
  name: "MuiDivider",
32
32
  slot: "Root",
33
33
  overridesResolver: (e, t) => {
@@ -168,7 +168,7 @@ const U = (e) => {
168
168
  }
169
169
  }
170
170
  }]
171
- }))), k = w("span", {
171
+ }))), j = w("span", {
172
172
  name: "MuiDivider",
173
173
  slot: "Wrapper",
174
174
  overridesResolver: (e, t) => {
@@ -194,41 +194,41 @@ const U = (e) => {
194
194
  }
195
195
  }]
196
196
  }))), v = /* @__PURE__ */ O.forwardRef(function(t, o) {
197
- const p = z({
197
+ const d = $({
198
198
  props: t,
199
199
  name: "MuiDivider"
200
200
  }), {
201
201
  absolute: h = !1,
202
202
  children: i,
203
203
  className: n,
204
- orientation: a = "horizontal",
205
- component: l = i || a === "vertical" ? "div" : "hr",
204
+ orientation: l = "horizontal",
205
+ component: a = i || l === "vertical" ? "div" : "hr",
206
206
  flexItem: b = !1,
207
207
  light: A = !1,
208
- role: m = l !== "hr" ? "separator" : void 0,
208
+ role: m = a !== "hr" ? "separator" : void 0,
209
209
  textAlign: D = "center",
210
210
  variant: N = "fullWidth",
211
211
  ...T
212
- } = p, u = {
213
- ...p,
212
+ } = d, u = {
213
+ ...d,
214
214
  absolute: h,
215
- component: l,
215
+ component: a,
216
216
  flexItem: b,
217
217
  light: A,
218
- orientation: a,
218
+ orientation: l,
219
219
  role: m,
220
220
  textAlign: D,
221
221
  variant: N
222
- }, _ = U(u);
223
- return /* @__PURE__ */ s(j, {
224
- as: l,
225
- className: $(_.root, n),
222
+ }, _ = M(u);
223
+ return /* @__PURE__ */ s(U, {
224
+ as: a,
225
+ className: B(_.root, n),
226
226
  role: m,
227
227
  ref: o,
228
228
  ownerState: u,
229
- "aria-orientation": m === "separator" && (l !== "hr" || a === "vertical") ? a : void 0,
229
+ "aria-orientation": m === "separator" && (a !== "hr" || l === "vertical") ? l : void 0,
230
230
  ...T,
231
- children: i ? /* @__PURE__ */ s(k, {
231
+ children: i ? /* @__PURE__ */ s(j, {
232
232
  className: _.wrapper,
233
233
  ownerState: u,
234
234
  children: i
@@ -299,39 +299,41 @@ process.env.NODE_ENV !== "production" && (v.propTypes = {
299
299
  */
300
300
  variant: r.oneOfType([r.oneOf(["fullWidth", "inset", "middle"]), r.string])
301
301
  });
302
- const H = "_dialog_1h5av_1", P = "_errorContent_1h5av_7", F = "_errorItem_1h5av_22", Y = "_fileName_1h5av_29", q = "_topActions_1h5av_35", G = "_close_1h5av_41", J = "_botActions_1h5av_45", K = "_button_1h5av_50", Q = "_title_1h5av_54", X = "_content_1h5av_60", Z = "_many_1h5av_68", tt = "_crop_1h5av_75", et = "_dialogText_1h5av_84", d = {
302
+ const H = "_dialog_n5vpn_1", P = "_dark_n5vpn_1", F = "_errorContent_n5vpn_5", Y = "_errorItem_n5vpn_38", q = "_fileName_n5vpn_45", G = "_topActions_n5vpn_51", J = "_close_n5vpn_57", K = "_botActions_n5vpn_61", Q = "_button_n5vpn_66", X = "_title_n5vpn_70", Z = "_content_n5vpn_76", tt = "_many_n5vpn_84", et = "_photoList_n5vpn_87", ot = "_crop_n5vpn_91", rt = "_dialogText_n5vpn_100", p = {
303
303
  dialog: H,
304
- errorContent: P,
305
- errorItem: F,
306
- fileName: Y,
307
- topActions: q,
308
- close: G,
309
- botActions: J,
310
- button: K,
311
- title: Q,
312
- content: X,
313
- many: Z,
314
- crop: tt,
315
- dialogText: et
316
- }, pt = (e) => {
304
+ dark: P,
305
+ errorContent: F,
306
+ errorItem: Y,
307
+ fileName: q,
308
+ topActions: G,
309
+ close: J,
310
+ botActions: K,
311
+ button: Q,
312
+ title: X,
313
+ content: Z,
314
+ many: tt,
315
+ photoList: et,
316
+ crop: ot,
317
+ dialogText: rt
318
+ }, gt = (e) => {
317
319
  const {
318
320
  photoSources: t,
319
321
  errors: o = [],
320
- onCloseDialogHandler: p,
322
+ onCloseDialogHandler: d,
321
323
  onClearErrors: h,
322
- locale: i = S
324
+ locale: i = L
323
325
  } = e;
324
326
  return /* @__PURE__ */ g(x, { children: [
325
- /* @__PURE__ */ s(I, { className: c(d.title), children: t.length ? f[i]["some-not-uploaded"] : f[i]["not-uploaded"] }),
326
- /* @__PURE__ */ s(R, { className: c(d.errorContent), children: o.map(({ photoName: n, errorMessage: a }, l) => /* @__PURE__ */ g(x, { children: [
327
- !!l && /* @__PURE__ */ s(v, {}),
328
- /* @__PURE__ */ g("div", { className: c(d.errorItem), children: [
329
- /* @__PURE__ */ s("span", { className: c(d.fileName), children: n }),
327
+ /* @__PURE__ */ s(I, { className: c(p.title), children: t.length ? f[i]["some-not-uploaded"] : f[i]["not-uploaded"] }),
328
+ /* @__PURE__ */ s(R, { className: c(p.errorContent), children: o.map(({ photoName: n, errorMessage: l }, a) => /* @__PURE__ */ g(x, { children: [
329
+ !!a && /* @__PURE__ */ s(v, {}),
330
+ /* @__PURE__ */ g("div", { className: c(p.errorItem), children: [
331
+ /* @__PURE__ */ s("span", { className: c(p.fileName), children: n }),
330
332
  " ",
331
- ` ${L} ${a}`
333
+ ` ${S} ${l}`
332
334
  ] })
333
- ] }, l)) }),
334
- /* @__PURE__ */ g(W, { className: c(d.botActions), children: [
335
+ ] }, a)) }),
336
+ /* @__PURE__ */ g(W, { className: c(p.botActions), children: [
335
337
  /* @__PURE__ */ s(
336
338
  y,
337
339
  {
@@ -339,8 +341,8 @@ const H = "_dialog_1h5av_1", P = "_errorContent_1h5av_7", F = "_errorItem_1h5av_
339
341
  buttonColor: "blue",
340
342
  buttonVariant: "outlined",
341
343
  buttonWeight: 500,
342
- onClick: p,
343
- className: c(d.button),
344
+ onClick: d,
345
+ className: c(p.button),
344
346
  children: f[i].close
345
347
  }
346
348
  ),
@@ -352,7 +354,7 @@ const H = "_dialog_1h5av_1", P = "_errorContent_1h5av_7", F = "_errorItem_1h5av_
352
354
  buttonVariant: "filled",
353
355
  buttonWeight: 500,
354
356
  onClick: h,
355
- className: c(d.button),
357
+ className: c(p.button),
356
358
  children: f[i].continue
357
359
  }
358
360
  )
@@ -360,6 +362,6 @@ const H = "_dialog_1h5av_1", P = "_errorContent_1h5av_7", F = "_errorItem_1h5av_
360
362
  ] });
361
363
  };
362
364
  export {
363
- pt as U,
364
- d as s
365
+ gt as U,
366
+ p as s
365
367
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hai-dev/ui-kit",
3
3
  "private": false,
4
- "version": "1.1.11",
4
+ "version": "1.1.12",
5
5
  "license": "UNLICENSED",
6
6
  "author": {
7
7
  "name": "Vladislav Knitrunov",