@hai-dev/ui-kit 1.1.11 → 1.2.0

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 (65) hide show
  1. package/dist/{Box-TrgOqpYk.js → Box-BgNAyP2L.js} +2 -2
  2. package/dist/{Button-BN3fv8kr.js → Button-DTV8ztWw.js} +5 -5
  3. package/dist/{ButtonBase-CSWuFxUv.js → ButtonBase-C4krg_zd.js} +3 -3
  4. package/dist/{CircularProgress-sPARyPfh.js → CircularProgress-BoaEg4rF.js} +3 -3
  5. package/dist/{Dialog-Cf0d7zi7.js → Dialog-BK9lMUKV.js} +12 -11
  6. package/dist/{DialogTitle-BtvmXSZP.js → DialogTitle-ByUfLB5M.js} +4 -4
  7. package/dist/{Typography-Bjd6ZHeX.js → Typography-BMyz0ZCh.js} +4 -4
  8. package/dist/assets/button.css +1 -1
  9. package/dist/assets/circular-progress-loader.css +1 -1
  10. package/dist/assets/code-input.css +1 -1
  11. package/dist/assets/error-upload-dialog.css +1 -1
  12. package/dist/assets/inter.css +1 -0
  13. package/dist/assets/photo-list.css +1 -1
  14. package/dist/assets/upload-dialog-errors.css +1 -1
  15. package/dist/button.module-C0UNQnBk.js +40 -0
  16. package/dist/chainPropTypes-DgqFdXGi.js +532 -0
  17. package/dist/components/button/button-content.js +11 -11
  18. package/dist/components/button/button.d.ts +18 -0
  19. package/dist/components/button/button.js +42 -35
  20. package/dist/components/button/constants.d.ts +17 -0
  21. package/dist/components/button/constants.js +28 -11
  22. package/dist/components/button/types.d.ts +11 -8
  23. package/dist/components/button/utils/get-button-classnames.d.ts +6 -0
  24. package/dist/components/button/utils/get-button-classnames.js +22 -10
  25. package/dist/components/circular-progress-loader/circular-progress-loader.js +14 -13
  26. package/dist/components/code-input/code-input.js +114 -112
  27. package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +37 -34
  28. package/dist/components/photo-crop-uploader/components/error-upload-dialog/types.d.ts +2 -1
  29. package/dist/components/photo-crop-uploader/components/photo-list/constants.d.ts +5 -1
  30. package/dist/components/photo-crop-uploader/components/photo-list/constants.js +6 -2
  31. package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +136 -33
  32. package/dist/components/photo-crop-uploader/components/photo-list/types.d.ts +2 -0
  33. package/dist/components/photo-crop-uploader/components/photo-list/use-container-size.d.ts +4 -0
  34. package/dist/components/photo-crop-uploader/components/photo-list/use-container-size.js +22 -0
  35. package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +1 -1
  36. package/dist/components/photo-crop-uploader/components/upload-dialog/constants.d.ts +1 -1
  37. package/dist/components/photo-crop-uploader/components/upload-dialog/constants.js +1 -1
  38. package/dist/components/photo-crop-uploader/components/upload-dialog/types.d.ts +2 -1
  39. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.js +4 -3
  40. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +159 -147
  41. package/dist/components/photo-crop-uploader/components/upload-dialog/use-scaled-min-dimension.d.ts +4 -0
  42. package/dist/components/photo-crop-uploader/components/upload-dialog/use-scaled-min-dimension.js +31 -0
  43. package/dist/components/photo-crop-uploader/locale.js +6 -2
  44. package/dist/components/photo-crop-uploader/photo-crop-uploader.js +131 -128
  45. package/dist/components/photo-crop-uploader/types.d.ts +2 -1
  46. package/dist/constants.d.ts +2 -0
  47. package/dist/constants.js +5 -3
  48. package/dist/{createTheme-D8R2Cz2N.js → createTheme-BoOmbNvy.js} +426 -390
  49. package/dist/{extendSxProp-Cw_ym9sl.js → extendSxProp-BaUCVMKV.js} +2 -1
  50. package/dist/{index-CL3JU48X.js → index-h5oTv8GF.js} +3 -3
  51. package/dist/index.d.ts +3 -3
  52. package/dist/index.js +26 -24
  53. package/dist/{memoTheme-D5VCpQCz.js → memoTheme-BYBJ2Fe6.js} +1 -1
  54. package/dist/refType-CsohaiiT.js +60 -0
  55. package/dist/types.d.ts +2 -1
  56. package/dist/{upload-dialog-errors-Cyz6_7n4.js → upload-dialog-errors-CCRxzIZp.js} +69 -67
  57. package/dist/useEnhancedEffect-CJGo-L3B.js +5 -0
  58. package/dist/utils/debounce.d.ts +5 -0
  59. package/dist/utils/debounce.js +12 -0
  60. package/dist/utils/index.d.ts +1 -0
  61. package/dist/utils/index.js +4 -0
  62. package/package.json +10 -2
  63. package/dist/button.module-BZPPmSAS.js +0 -21
  64. package/dist/chainPropTypes-DiJb1lGa.js +0 -568
  65. package/dist/refType-CUEs_vK5.js +0 -61
@@ -1,51 +1,53 @@
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 S, jsx as r, Fragment as Z } from "react/jsx-runtime";
2
+ import * as O from "react";
3
+ import { useState as q, useCallback as G } from "react";
4
+ import { useScaledMinDimension as J } from "./use-scaled-min-dimension.js";
5
+ import { S as Q } from "../../../../index-CcueJ2sD.js";
4
6
  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";
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";
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";
7
+ import { s as n, U as X } from "../../../../upload-dialog-errors-CCRxzIZp.js";
8
+ import { PhotoList as oo } from "../photo-list/photo-list.js";
9
+ import { localizedText as g } from "../../locale.js";
10
+ import { EN_LOCALE as eo, DARK_THEME as to } from "../../../../constants.js";
11
+ import { DEFAULT_MIN_DIMENSION as ao, DEFAULT_ASPECT_RATIO as ro } from "../../constants.js";
12
+ import '../../../../assets/inter.css';import '../../../../assets/upload-dialog.css';/* empty css */
13
+ import { D as k } from "../../../../Dialog-BK9lMUKV.js";
14
+ import { a as A, b as D, D as no } from "../../../../DialogTitle-ByUfLB5M.js";
15
+ import { CircularProgressLoader as io } from "../../../circular-progress-loader/circular-progress-loader.js";
16
+ import { g as so, a as lo, c as co, b as f, P as t } from "../../../../createTheme-BoOmbNvy.js";
17
+ import { m as M } from "../../../../memoTheme-BYBJ2Fe6.js";
18
+ import { c as U } from "../../../../createSimplePaletteValueFilter-B7--0ryQ.js";
19
+ import { u as po, c as go, s as j, b as uo } from "../../../../chainPropTypes-DgqFdXGi.js";
20
+ import { u as mo } from "../../../../useId-CK6Kn3Tn.js";
21
+ import { B as fo } from "../../../../ButtonBase-C4krg_zd.js";
22
+ import { C as bo } from "../../../../CircularProgress-BoaEg4rF.js";
21
23
  import { Button as P } from "../../../button/button.js";
22
- import '../../../../assets/upload-dialog.css';function io(o) {
23
- return K("MuiIconButton", o);
24
+ function ho(o) {
25
+ return so("MuiIconButton", o);
24
26
  }
25
- const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge", "loading", "loadingIndicator", "loadingWrapper"]), lo = (o) => {
27
+ const W = lo("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge", "loading", "loadingIndicator", "loadingWrapper"]), Co = (o) => {
26
28
  const {
27
29
  classes: e,
28
- disabled: r,
29
- color: c,
30
- edge: g,
31
- size: f,
32
- loading: b
33
- } = o, u = {
34
- root: ["root", b && "loading", r && "disabled", c !== "default" && `color${m(c)}`, g && `edge${m(g)}`, `size${m(f)}`],
30
+ disabled: a,
31
+ color: l,
32
+ edge: u,
33
+ size: b,
34
+ loading: c
35
+ } = o, m = {
36
+ root: ["root", c && "loading", a && "disabled", l !== "default" && `color${f(l)}`, u && `edge${f(u)}`, `size${f(b)}`],
35
37
  loadingIndicator: ["loadingIndicator"],
36
38
  loadingWrapper: ["loadingWrapper"]
37
39
  };
38
- return eo(u, io, e);
39
- }, so = W(ro, {
40
+ return go(m, ho, e);
41
+ }, yo = j(fo, {
40
42
  name: "MuiIconButton",
41
43
  slot: "Root",
42
44
  overridesResolver: (o, e) => {
43
45
  const {
44
- ownerState: r
46
+ ownerState: a
45
47
  } = o;
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)}`]];
48
+ return [e.root, a.loading && e.loading, a.color !== "default" && e[`color${f(a.color)}`], a.edge && e[`edge${f(a.edge)}`], e[`size${f(a.size)}`]];
47
49
  }
48
- })(A(({
50
+ })(M(({
49
51
  theme: o
50
52
  }) => ({
51
53
  textAlign: "center",
@@ -100,7 +102,7 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
100
102
  marginRight: -3
101
103
  }
102
104
  }]
103
- })), A(({
105
+ })), M(({
104
106
  theme: o
105
107
  }) => ({
106
108
  variants: [{
@@ -110,14 +112,14 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
110
112
  style: {
111
113
  color: "inherit"
112
114
  }
113
- }, ...Object.entries(o.palette).filter(M()).map(([e]) => ({
115
+ }, ...Object.entries(o.palette).filter(U()).map(([e]) => ({
114
116
  props: {
115
117
  color: e
116
118
  },
117
119
  style: {
118
120
  color: (o.vars || o).palette[e].main
119
121
  }
120
- })), ...Object.entries(o.palette).filter(M()).map(([e]) => ({
122
+ })), ...Object.entries(o.palette).filter(U()).map(([e]) => ({
121
123
  props: {
122
124
  color: e
123
125
  },
@@ -141,14 +143,14 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
141
143
  fontSize: o.typography.pxToRem(28)
142
144
  }
143
145
  }],
144
- [`&.${U.disabled}`]: {
146
+ [`&.${W.disabled}`]: {
145
147
  backgroundColor: "transparent",
146
148
  color: (o.vars || o).palette.action.disabled
147
149
  },
148
- [`&.${U.loading}`]: {
150
+ [`&.${W.loading}`]: {
149
151
  color: "transparent"
150
152
  }
151
- }))), co = W("span", {
153
+ }))), vo = j("span", {
152
154
  name: "MuiIconButton",
153
155
  slot: "LoadingIndicator"
154
156
  })(({
@@ -169,60 +171,60 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
169
171
  display: "flex"
170
172
  }
171
173
  }]
172
- })), j = /* @__PURE__ */ k.forwardRef(function(e, r) {
173
- const c = oo({
174
+ })), F = /* @__PURE__ */ O.forwardRef(function(e, a) {
175
+ const l = po({
174
176
  props: e,
175
177
  name: "MuiIconButton"
176
178
  }), {
177
- edge: g = !1,
178
- children: f,
179
- className: b,
180
- color: u = "default",
179
+ edge: u = !1,
180
+ children: b,
181
+ className: c,
182
+ color: m = "default",
181
183
  disabled: y = !1,
182
- disableFocusRipple: I = !1,
184
+ disableFocusRipple: v = !1,
183
185
  size: z = "medium",
184
- id: v,
185
- loading: s = null,
186
- loadingIndicator: R,
187
- ...l
188
- } = c, N = ao(v), B = R ?? /* @__PURE__ */ a(no, {
186
+ id: I,
187
+ loading: d = null,
188
+ loadingIndicator: L,
189
+ ...s
190
+ } = l, N = mo(I), B = L ?? /* @__PURE__ */ r(bo, {
189
191
  "aria-labelledby": N,
190
192
  color: "inherit",
191
193
  size: 16
192
194
  }), h = {
193
- ...c,
194
- edge: g,
195
- color: u,
195
+ ...l,
196
+ edge: u,
197
+ color: m,
196
198
  disabled: y,
197
- disableFocusRipple: I,
198
- loading: s,
199
+ disableFocusRipple: v,
200
+ loading: d,
199
201
  loadingIndicator: B,
200
202
  size: z
201
- }, d = lo(h);
202
- return /* @__PURE__ */ L(so, {
203
- id: s ? N : v,
204
- className: X(d.root, b),
203
+ }, p = Co(h);
204
+ return /* @__PURE__ */ S(yo, {
205
+ id: d ? N : I,
206
+ className: co(p.root, c),
205
207
  centerRipple: !0,
206
- focusRipple: !I,
207
- disabled: y || s,
208
- ref: r,
209
- ...l,
208
+ focusRipple: !v,
209
+ disabled: y || d,
210
+ ref: a,
211
+ ...s,
210
212
  ownerState: h,
211
- children: [typeof s == "boolean" && // use plain HTML span to minimize the runtime overhead
212
- /* @__PURE__ */ a("span", {
213
- className: d.loadingWrapper,
213
+ children: [typeof d == "boolean" && // use plain HTML span to minimize the runtime overhead
214
+ /* @__PURE__ */ r("span", {
215
+ className: p.loadingWrapper,
214
216
  style: {
215
217
  display: "contents"
216
218
  },
217
- children: /* @__PURE__ */ a(co, {
218
- className: d.loadingIndicator,
219
+ children: /* @__PURE__ */ r(vo, {
220
+ className: p.loadingIndicator,
219
221
  ownerState: h,
220
- children: s && B
222
+ children: d && B
221
223
  })
222
- }), f]
224
+ }), b]
223
225
  });
224
226
  });
225
- process.env.NODE_ENV !== "production" && (j.propTypes = {
227
+ process.env.NODE_ENV !== "production" && (F.propTypes = {
226
228
  // ┌────────────────────────────── Warning ──────────────────────────────┐
227
229
  // │ These PropTypes are generated from the TypeScript type definitions. │
228
230
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
@@ -230,7 +232,7 @@ process.env.NODE_ENV !== "production" && (j.propTypes = {
230
232
  /**
231
233
  * The icon to display.
232
234
  */
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(`
235
+ children: uo(t.node, (o) => O.Children.toArray(o.children).some((a) => /* @__PURE__ */ O.isValidElement(a) && a.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
236
  `)) : null),
235
237
  /**
236
238
  * Override or extend the styles applied to the component.
@@ -301,148 +303,158 @@ process.env.NODE_ENV !== "production" && (j.propTypes = {
301
303
  */
302
304
  sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
303
305
  });
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) => {
306
+ const Io = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.27623%200.391122C1.75553%20-0.129577%200.911316%20-0.129578%200.390616%200.391122C-0.130083%200.911821%20-0.130083%201.75604%200.390616%202.27674L6.04747%207.93359L0.390616%2013.5904C-0.130083%2014.1111%20-0.130083%2014.9554%200.390616%2015.4761C0.911316%2015.9968%201.75553%2015.9968%202.27623%2015.4761L7.93309%209.81921L13.5899%2015.4761C14.1106%2015.9968%2014.9549%2015.9968%2015.4756%2015.4761C15.9963%2014.9554%2015.9963%2014.1111%2015.4756%2013.5904L9.81871%207.93359L15.4756%202.27674C15.9963%201.75604%2015.9963%200.911822%2015.4756%200.391122C14.9549%20-0.129577%2014.1106%20-0.129578%2013.5899%200.391123L7.93309%206.04798L2.27623%200.391122Z'%20fill='%233AA8FF'/%3e%3c/svg%3e", _o = (o) => {
305
307
  const {
306
308
  onCloseDialogHandler: e,
307
- photoSources: r = [],
308
- photoCrops: c = [],
309
- onCropChange: g = () => {
309
+ photoSources: a = [],
310
+ photoCrops: l = [],
311
+ onCropChange: u = () => {
310
312
  },
311
- onPhotoLoad: f,
312
- imageRef: b,
313
- photoError: u,
313
+ onPhotoLoad: b,
314
+ imageRef: c,
315
+ photoError: m,
314
316
  onPhotoCrop: y,
315
- onNextPhoto: I,
317
+ onNextPhoto: v,
316
318
  onSkipCrop: z,
317
- onClearErrors: v,
318
- minDimension: s = Y,
319
- aspectRatio: R = q,
320
- locale: l = Z,
319
+ onClearErrors: I,
320
+ minDimension: d = ao,
321
+ aspectRatio: L = ro,
322
+ locale: s = eo,
321
323
  circular: N,
322
324
  keepSelection: B = !0,
323
325
  photoSourceLoading: h,
324
- className: d,
326
+ className: p,
325
327
  photoIndex: C,
326
- loadingValue: F,
327
- errors: x,
328
- ...T
329
- } = o, S = r.slice(C).length > 1;
330
- return h || !r.length && !x?.length ? /* @__PURE__ */ a(
331
- O,
328
+ loadingValue: $,
329
+ errors: R,
330
+ theme: T = to,
331
+ ...x
332
+ } = o, E = a.slice(C).length > 1, [V, _] = q(null), H = G(
333
+ (w) => {
334
+ c && (c.current = w), _(w);
335
+ },
336
+ [c]
337
+ ), { minWidth: K, minHeight: Y } = J(V, d);
338
+ return h || !a.length && !R?.length ? /* @__PURE__ */ r(
339
+ k,
332
340
  {
333
- className: i(n.dialog, d),
341
+ className: i(n.dialog, p, n[T]),
334
342
  onClose: e,
335
- ...T,
336
- children: /* @__PURE__ */ a(D, { className: i(n.content), children: /* @__PURE__ */ a(J, { value: F }) })
343
+ ...x,
344
+ children: /* @__PURE__ */ r(A, { className: i(n.content), children: /* @__PURE__ */ r(io, { value: $ }) })
337
345
  }
338
- ) : x?.length ? /* @__PURE__ */ a(
339
- O,
346
+ ) : R?.length ? /* @__PURE__ */ r(
347
+ k,
340
348
  {
341
- className: i(n.dialog, d),
349
+ className: i(n.dialog, p, n[T]),
342
350
  onClose: e,
343
- ...T,
344
- children: /* @__PURE__ */ a(
345
- V,
351
+ ...x,
352
+ children: /* @__PURE__ */ r(
353
+ X,
346
354
  {
347
- locale: l,
348
- photoSources: r,
349
- errors: x,
355
+ locale: s,
356
+ photoSources: a,
357
+ errors: R,
350
358
  onCloseDialogHandler: e,
351
- onClearErrors: v
359
+ onClearErrors: I
352
360
  }
353
361
  )
354
362
  }
355
- ) : /* @__PURE__ */ L(
356
- O,
363
+ ) : /* @__PURE__ */ S(
364
+ k,
357
365
  {
358
- className: i(n.dialog, d),
366
+ className: i(n.dialog, p, n[T]),
359
367
  onClose: e,
360
- ...T,
368
+ ...x,
361
369
  children: [
362
- /* @__PURE__ */ a(E, { className: i(n.topActions), children: /* @__PURE__ */ a(
363
- j,
370
+ /* @__PURE__ */ r(D, { className: i(n.topActions), children: /* @__PURE__ */ r(
371
+ F,
364
372
  {
365
373
  onClick: e,
366
374
  className: i(n.close),
367
- "aria-label": p[l].back,
368
- children: /* @__PURE__ */ a(
375
+ "aria-label": g[s].back,
376
+ children: /* @__PURE__ */ r(
369
377
  "img",
370
378
  {
371
379
  draggable: !1,
372
- width: w,
373
- height: w,
374
- src: po,
375
- alt: p[l].back
380
+ src: Io,
381
+ alt: g[s].back
376
382
  }
377
383
  )
378
384
  }
379
385
  ) }),
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: [
382
- S && /* @__PURE__ */ a("span", {}),
383
- !!r.length && /* @__PURE__ */ a(
384
- $,
386
+ /* @__PURE__ */ r(no, { className: i(n.title), children: g[s]["photo-crop"] }),
387
+ /* @__PURE__ */ S(A, { className: i(n.content, E && n.many), children: [
388
+ !!a.length && /* @__PURE__ */ r(
389
+ Q,
385
390
  {
386
391
  className: i(n.crop),
387
- crop: c[C],
392
+ crop: l[C],
388
393
  circularCrop: N,
389
394
  keepSelection: B,
390
- aspect: R,
391
- minWidth: s,
392
- minHeight: s,
393
- onChange: g,
394
- children: /* @__PURE__ */ a(
395
+ aspect: L,
396
+ minWidth: K,
397
+ minHeight: Y,
398
+ onChange: u,
399
+ children: /* @__PURE__ */ r(
395
400
  "img",
396
401
  {
397
- onLoad: f,
398
- src: r[C],
399
- ref: b,
400
- alt: p[l]["photo-crop"],
402
+ onLoad: b,
403
+ src: a[C],
404
+ ref: H,
405
+ alt: g[s]["photo-crop"],
401
406
  draggable: !1
402
407
  },
403
408
  C
404
409
  )
405
410
  }
406
411
  ),
407
- S && /* @__PURE__ */ a(H, { photoSources: r, photoIndex: C })
412
+ E && /* @__PURE__ */ r(
413
+ oo,
414
+ {
415
+ locale: s,
416
+ photoSources: a,
417
+ photoIndex: C
418
+ }
419
+ )
408
420
  ] }),
409
- u && /* @__PURE__ */ a(E, { className: i(n.dialogText), children: u }),
410
- /* @__PURE__ */ a(E, { className: i(n.botActions), children: S ? /* @__PURE__ */ L(_, { children: [
411
- /* @__PURE__ */ a(
421
+ m && /* @__PURE__ */ r(D, { className: i(n.dialogText), children: m }),
422
+ /* @__PURE__ */ r(D, { className: i(n.botActions), children: E ? /* @__PURE__ */ S(Z, { children: [
423
+ /* @__PURE__ */ r(
412
424
  P,
413
425
  {
414
426
  buttonSize: "small",
415
- buttonColor: "blue",
427
+ buttonColor: "red",
416
428
  buttonVariant: "outlined",
417
429
  buttonWeight: 500,
418
430
  className: i(n.button),
419
431
  onClick: z,
420
- children: p[l].skip
432
+ children: g[s].skip
421
433
  }
422
434
  ),
423
- /* @__PURE__ */ a(
435
+ /* @__PURE__ */ r(
424
436
  P,
425
437
  {
426
438
  buttonSize: "small",
427
439
  buttonColor: "blue",
428
- buttonVariant: "filled",
440
+ buttonVariant: "outlined",
429
441
  buttonWeight: 500,
430
442
  className: i(n.button),
431
- onClick: I,
432
- children: p[l].continue
443
+ onClick: v,
444
+ children: g[s].continue
433
445
  }
434
446
  )
435
- ] }) : /* @__PURE__ */ a(
447
+ ] }) : /* @__PURE__ */ r(
436
448
  P,
437
449
  {
438
450
  minWidth: "100%",
439
451
  buttonSize: "small",
440
452
  buttonColor: "blue",
441
- buttonVariant: "filled",
453
+ buttonVariant: "outlined",
442
454
  buttonWeight: 500,
443
455
  className: i(n.button),
444
456
  onClick: y,
445
- children: p[l].crop
457
+ children: g[s].crop
446
458
  }
447
459
  ) })
448
460
  ]
@@ -450,5 +462,5 @@ const po = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
450
462
  );
451
463
  };
452
464
  export {
453
- Po as UploadDialog
465
+ _o as UploadDialog
454
466
  };
@@ -0,0 +1,4 @@
1
+ export declare function useScaledMinDimension(el: HTMLImageElement | null, minDimension: number): {
2
+ minWidth: number;
3
+ minHeight: number;
4
+ };
@@ -0,0 +1,31 @@
1
+ import { useState as o, useEffect as s } from "react";
2
+ import { debounce as i } from "../../../../utils/debounce.js";
3
+ const f = 100;
4
+ function u(e, t) {
5
+ const { naturalWidth: d, naturalHeight: c, width: r, height: a } = e;
6
+ return !d || !c || !r || !a ? { minWidth: t, minHeight: t } : {
7
+ minWidth: Math.min(t * (r / d), r),
8
+ minHeight: Math.min(t * (a / c), a)
9
+ };
10
+ }
11
+ function v(e, t) {
12
+ const [d, c] = o({
13
+ minWidth: t,
14
+ minHeight: t
15
+ });
16
+ return s(() => {
17
+ if (!e) {
18
+ c({ minWidth: t, minHeight: t });
19
+ return;
20
+ }
21
+ const r = () => c(u(e, t)), a = i(([n]) => {
22
+ c(u(n.target, t));
23
+ }, f), h = new ResizeObserver(a);
24
+ return h.observe(e), e.addEventListener("load", r), r(), () => {
25
+ a.cancel(), h.disconnect(), e.removeEventListener("load", r);
26
+ };
27
+ }, [e, t]), d;
28
+ }
29
+ export {
30
+ v as useScaledMinDimension
31
+ };
@@ -25,7 +25,9 @@ const e = {
25
25
  aspect: "The aspect ratio of the cropped image must not be greater than 2",
26
26
  close: "Close",
27
27
  "not-uploaded": "Files were not uploaded",
28
- "some-not-uploaded": "Some files were not uploaded"
28
+ "some-not-uploaded": "Some files were not uploaded",
29
+ "photo-in-queue": "Photo in queue",
30
+ more: "more"
29
31
  },
30
32
  ru: {
31
33
  upload: "Загрузить файл",
@@ -53,7 +55,9 @@ const e = {
53
55
  aspect: "Соотношение сторон обрезаемого изображения не должно быть больше 2",
54
56
  close: "Закрыть",
55
57
  "not-uploaded": "Файлы не были загружены",
56
- "some-not-uploaded": "Некоторые файлы не были загружены"
58
+ "some-not-uploaded": "Некоторые файлы не были загружены",
59
+ "photo-in-queue": "Фотография в очереди",
60
+ more: "Еще"
57
61
  }
58
62
  };
59
63
  export {