@hai-dev/ui-kit 1.1.12 → 1.2.1

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 (56) 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 +39 -38
  28. package/dist/components/photo-crop-uploader/components/photo-list/constants.d.ts +5 -1
  29. package/dist/components/photo-crop-uploader/components/photo-list/constants.js +6 -2
  30. package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +136 -33
  31. package/dist/components/photo-crop-uploader/components/photo-list/types.d.ts +2 -0
  32. package/dist/components/photo-crop-uploader/components/photo-list/use-container-size.d.ts +4 -0
  33. package/dist/components/photo-crop-uploader/components/photo-list/use-container-size.js +22 -0
  34. package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +1 -1
  35. package/dist/components/photo-crop-uploader/components/upload-dialog/constants.d.ts +1 -1
  36. package/dist/components/photo-crop-uploader/components/upload-dialog/constants.js +1 -1
  37. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.js +4 -3
  38. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +156 -145
  39. package/dist/components/photo-crop-uploader/components/upload-dialog/use-scaled-min-dimension.d.ts +4 -0
  40. package/dist/components/photo-crop-uploader/components/upload-dialog/use-scaled-min-dimension.js +31 -0
  41. package/dist/components/photo-crop-uploader/locale.js +6 -2
  42. package/dist/{createTheme-D8R2Cz2N.js → createTheme-BoOmbNvy.js} +426 -390
  43. package/dist/{extendSxProp-Cw_ym9sl.js → extendSxProp-BaUCVMKV.js} +2 -1
  44. package/dist/{index-CL3JU48X.js → index-h5oTv8GF.js} +3 -3
  45. package/dist/{memoTheme-D5VCpQCz.js → memoTheme-BYBJ2Fe6.js} +1 -1
  46. package/dist/refType-CsohaiiT.js +60 -0
  47. package/dist/{upload-dialog-errors-DHl0bh1n.js → upload-dialog-errors-BwQsTOc3.js} +46 -46
  48. package/dist/useEnhancedEffect-CJGo-L3B.js +5 -0
  49. package/dist/utils/debounce.d.ts +5 -0
  50. package/dist/utils/debounce.js +12 -0
  51. package/dist/utils/index.d.ts +1 -0
  52. package/dist/utils/index.js +4 -0
  53. package/package.json +10 -2
  54. package/dist/button.module-BZPPmSAS.js +0 -21
  55. package/dist/chainPropTypes-DiJb1lGa.js +0 -568
  56. package/dist/refType-CUEs_vK5.js +0 -61
@@ -1,49 +1,51 @@
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";
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 H } from "../../../../upload-dialog-errors-DHl0bh1n.js";
6
- import { PhotoList as Z } from "../photo-list/photo-list.js";
7
- import { localizedText as p } from "../../locale.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
- import { D as O } from "../../../../Dialog-Cf0d7zi7.js";
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";
7
+ import { s as n, U as X } from "../../../../upload-dialog-errors-BwQsTOc3.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";
16
18
  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);
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";
23
+ import { Button as P } from "../../../button/button.js";
24
+ function ho(o) {
25
+ return so("MuiIconButton", o);
24
26
  }
25
- const W = oo("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge", "loading", "loadingIndicator", "loadingWrapper"]), co = (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 ao(u, so, e);
39
- }, po = _(io, {
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
50
  })(M(({
49
51
  theme: o
@@ -148,7 +150,7 @@ const W = oo("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary
148
150
  [`&.${W.loading}`]: {
149
151
  color: "transparent"
150
152
  }
151
- }))), go = _("span", {
153
+ }))), vo = j("span", {
152
154
  name: "MuiIconButton",
153
155
  slot: "LoadingIndicator"
154
156
  })(({
@@ -169,60 +171,60 @@ const W = oo("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary
169
171
  display: "flex"
170
172
  }
171
173
  }]
172
- })), j = /* @__PURE__ */ w.forwardRef(function(e, r) {
173
- const c = to({
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 = no(v), B = R ?? /* @__PURE__ */ a(lo, {
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 = co(h);
202
- return /* @__PURE__ */ L(po, {
203
- id: s ? N : v,
204
- className: eo(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(go, {
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: 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(`
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,149 +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 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) => {
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 = q,
319
- aspectRatio: R = G,
320
- locale: l = K,
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: T,
328
- theme: x = Y,
329
- ...E
330
- } = o, S = r.slice(C).length > 1;
331
- return h || !r.length && !T?.length ? /* @__PURE__ */ a(
332
- 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,
333
340
  {
334
- className: i(n.dialog, d, n[x]),
341
+ className: i(n.dialog, p, n[T]),
335
342
  onClose: e,
336
- ...E,
337
- children: /* @__PURE__ */ a(A, { className: i(n.content), children: /* @__PURE__ */ a(Q, { value: F }) })
343
+ ...x,
344
+ children: /* @__PURE__ */ r(A, { className: i(n.content), children: /* @__PURE__ */ r(io, { value: $ }) })
338
345
  }
339
- ) : T?.length ? /* @__PURE__ */ a(
340
- O,
346
+ ) : R?.length ? /* @__PURE__ */ r(
347
+ k,
341
348
  {
342
- className: i(n.dialog, d, n[x]),
349
+ className: i(n.dialog, p, n[T]),
343
350
  onClose: e,
344
- ...E,
345
- children: /* @__PURE__ */ a(
346
- H,
351
+ ...x,
352
+ children: /* @__PURE__ */ r(
353
+ X,
347
354
  {
348
- locale: l,
349
- photoSources: r,
350
- errors: T,
355
+ locale: s,
356
+ photoSources: a,
357
+ errors: R,
351
358
  onCloseDialogHandler: e,
352
- onClearErrors: v
359
+ onClearErrors: I
353
360
  }
354
361
  )
355
362
  }
356
- ) : /* @__PURE__ */ L(
357
- O,
363
+ ) : /* @__PURE__ */ S(
364
+ k,
358
365
  {
359
- className: i(n.dialog, d, n[x]),
366
+ className: i(n.dialog, p, n[T]),
360
367
  onClose: e,
361
- ...E,
368
+ ...x,
362
369
  children: [
363
- /* @__PURE__ */ a(P, { className: i(n.topActions), children: /* @__PURE__ */ a(
364
- j,
370
+ /* @__PURE__ */ r(D, { className: i(n.topActions), children: /* @__PURE__ */ r(
371
+ F,
365
372
  {
366
373
  onClick: e,
367
374
  className: i(n.close),
368
- "aria-label": p[l].back,
369
- children: /* @__PURE__ */ a(
375
+ "aria-label": g[s].back,
376
+ children: /* @__PURE__ */ r(
370
377
  "img",
371
378
  {
372
379
  draggable: !1,
373
- width: D,
374
- height: D,
375
- src: uo,
376
- alt: p[l].back
380
+ src: Io,
381
+ alt: g[s].back
377
382
  }
378
383
  )
379
384
  }
380
385
  ) }),
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: [
383
- S && /* @__PURE__ */ a("span", {}),
384
- !!r.length && /* @__PURE__ */ a(
385
- V,
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,
386
390
  {
387
391
  className: i(n.crop),
388
- crop: c[C],
392
+ crop: l[C],
389
393
  circularCrop: N,
390
394
  keepSelection: B,
391
- aspect: R,
392
- minWidth: s,
393
- minHeight: s,
394
- onChange: g,
395
- children: /* @__PURE__ */ a(
395
+ aspect: L,
396
+ minWidth: K,
397
+ minHeight: Y,
398
+ onChange: u,
399
+ children: /* @__PURE__ */ r(
396
400
  "img",
397
401
  {
398
- onLoad: f,
399
- src: r[C],
400
- ref: b,
401
- alt: p[l]["photo-crop"],
402
+ onLoad: b,
403
+ src: a[C],
404
+ ref: H,
405
+ alt: g[s]["photo-crop"],
402
406
  draggable: !1
403
407
  },
404
408
  C
405
409
  )
406
410
  }
407
411
  ),
408
- S && /* @__PURE__ */ a(Z, { photoSources: r, photoIndex: C })
412
+ E && /* @__PURE__ */ r(
413
+ oo,
414
+ {
415
+ locale: s,
416
+ photoSources: a,
417
+ photoIndex: C
418
+ }
419
+ )
409
420
  ] }),
410
- u && /* @__PURE__ */ a(P, { className: i(n.dialogText), children: u }),
411
- /* @__PURE__ */ a(P, { className: i(n.botActions), children: S ? /* @__PURE__ */ L($, { children: [
412
- /* @__PURE__ */ a(
413
- k,
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(
424
+ P,
414
425
  {
415
426
  buttonSize: "small",
416
- buttonColor: "blue",
427
+ buttonColor: "red",
417
428
  buttonVariant: "outlined",
418
429
  buttonWeight: 500,
419
430
  className: i(n.button),
420
431
  onClick: z,
421
- children: p[l].skip
432
+ children: g[s].skip
422
433
  }
423
434
  ),
424
- /* @__PURE__ */ a(
425
- k,
435
+ /* @__PURE__ */ r(
436
+ P,
426
437
  {
427
438
  buttonSize: "small",
428
439
  buttonColor: "blue",
429
- buttonVariant: "filled",
440
+ buttonVariant: "outlined",
430
441
  buttonWeight: 500,
431
442
  className: i(n.button),
432
- onClick: I,
433
- children: p[l].continue
443
+ onClick: v,
444
+ children: g[s].continue
434
445
  }
435
446
  )
436
- ] }) : /* @__PURE__ */ a(
437
- k,
447
+ ] }) : /* @__PURE__ */ r(
448
+ P,
438
449
  {
439
450
  minWidth: "100%",
440
451
  buttonSize: "small",
441
452
  buttonColor: "blue",
442
- buttonVariant: "filled",
453
+ buttonVariant: "outlined",
443
454
  buttonWeight: 500,
444
455
  className: i(n.button),
445
456
  onClick: y,
446
- children: p[l].crop
457
+ children: g[s].crop
447
458
  }
448
459
  ) })
449
460
  ]
@@ -451,5 +462,5 @@ const uo = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
451
462
  );
452
463
  };
453
464
  export {
454
- wo as UploadDialog
465
+ _o as UploadDialog
455
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 {