@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,5 +1,5 @@
1
1
  import * as u from "react";
2
- import { f, h as a, i as m, j as l } from "./createTheme-D8R2Cz2N.js";
2
+ import { f, h as a, i as m, j as l } from "./createTheme-BoOmbNvy.js";
3
3
  function h(t) {
4
4
  return Object.keys(t).length === 0;
5
5
  }
@@ -44,6 +44,7 @@ function j(t) {
44
44
  };
45
45
  }
46
46
  export {
47
+ x as a,
47
48
  j as e,
48
49
  b as u
49
50
  };
@@ -1,8 +1,8 @@
1
1
  import "react";
2
2
  import { jsx as a } from "react/jsx-runtime";
3
- import { u as y, e as m } from "./extendSxProp-Cw_ym9sl.js";
4
- import { P as e, k as d, T as b } from "./createTheme-D8R2Cz2N.js";
5
- import { G as T, d as h } from "./chainPropTypes-DiJb1lGa.js";
3
+ import { u as y, e as m } from "./extendSxProp-BaUCVMKV.js";
4
+ import { P as e, k as d, T as b } from "./createTheme-BoOmbNvy.js";
5
+ import { G as T, d as h } from "./chainPropTypes-DgqFdXGi.js";
6
6
  function E(t) {
7
7
  return t == null || Object.keys(t).length === 0;
8
8
  }
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
  };
@@ -1,4 +1,4 @@
1
- import { p as s } from "./chainPropTypes-DiJb1lGa.js";
1
+ import { p as s } from "./chainPropTypes-DgqFdXGi.js";
2
2
  const l = {
3
3
  theme: void 0
4
4
  };
@@ -0,0 +1,60 @@
1
+ import * as u from "react";
2
+ import { u as l } from "./useEnhancedEffect-CJGo-L3B.js";
3
+ import { P as a } from "./createTheme-BoOmbNvy.js";
4
+ import { b as p } from "./chainPropTypes-DgqFdXGi.js";
5
+ function h(t) {
6
+ const e = u.useRef(t);
7
+ return l(() => {
8
+ e.current = t;
9
+ }), u.useRef((...c) => (
10
+ // @ts-expect-error hide `this`
11
+ (0, e.current)(...c)
12
+ )).current;
13
+ }
14
+ function C(...t) {
15
+ const e = u.useRef(void 0), c = u.useCallback((r) => {
16
+ const f = t.map((n) => {
17
+ if (n == null)
18
+ return null;
19
+ if (typeof n == "function") {
20
+ const i = n, o = i(r);
21
+ return typeof o == "function" ? o : () => {
22
+ i(null);
23
+ };
24
+ }
25
+ return n.current = r, () => {
26
+ n.current = null;
27
+ };
28
+ });
29
+ return () => {
30
+ f.forEach((n) => n?.());
31
+ };
32
+ }, t);
33
+ return u.useMemo(() => t.every((r) => r == null) ? null : (r) => {
34
+ e.current && (e.current(), e.current = void 0), r != null && (e.current = c(r));
35
+ }, t);
36
+ }
37
+ function s(t) {
38
+ const {
39
+ prototype: e = {}
40
+ } = t;
41
+ return !!e.isReactComponent;
42
+ }
43
+ function d(t, e, c, r, f) {
44
+ const n = t[e], i = f || e;
45
+ if (n == null || // When server-side rendering React doesn't warn either.
46
+ // This is not an accurate check for SSR.
47
+ // This is only in place for emotion compat.
48
+ // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
49
+ typeof window > "u")
50
+ return null;
51
+ let o;
52
+ return typeof n == "function" && !s(n) && (o = "Did you accidentally provide a plain function component instead?"), n === u.Fragment && (o = "Did you accidentally provide a React.Fragment instead?"), o !== void 0 ? new Error(`Invalid ${r} \`${i}\` supplied to \`${c}\`. Expected an element type that can hold a ref. ${o} For more information see https://v7.mui.com/r/caveat-with-refs-guide`) : null;
53
+ }
54
+ const E = p(a.elementType, d), T = a.oneOfType([a.func, a.object]);
55
+ export {
56
+ h as a,
57
+ E as e,
58
+ T as r,
59
+ C as u
60
+ };
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,34 @@
1
- import { jsx as s, jsxs as g, Fragment as x } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as h, Fragment as y } 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
4
  import { EN_LOCALE as S, DASH_SYMBOL as L } from "./constants.js";
5
- import { D as I, a as R, b as W } from "./DialogTitle-BtvmXSZP.js";
5
+ import './assets/inter.css';import './assets/upload-dialog-errors.css';/* empty css */
6
+ import { D as I, a as R, b as W } from "./DialogTitle-ByUfLB5M.js";
6
7
  import * as O from "react";
7
- import { g as V, a as B, c as $, P as r } from "./createTheme-D8R2Cz2N.js";
8
- import { m as C } from "./memoTheme-D5VCpQCz.js";
9
- import { u as z, c as E, s as w } from "./chainPropTypes-DiJb1lGa.js";
10
- import { Button as y } from "./components/button/button.js";
11
- import './assets/upload-dialog-errors.css';function M(e) {
8
+ import { g as V, a as k, c as B, P as r } from "./createTheme-BoOmbNvy.js";
9
+ import { m as C } from "./memoTheme-BYBJ2Fe6.js";
10
+ import { u as $, c as z, s as w } from "./chainPropTypes-DgqFdXGi.js";
11
+ import { Button as x } from "./components/button/button.js";
12
+ function E(e) {
12
13
  return V("MuiDivider", e);
13
14
  }
14
- B("MuiDivider", ["root", "absolute", "fullWidth", "inset", "middle", "flexItem", "light", "vertical", "withChildren", "withChildrenVertical", "textAlignRight", "textAlignLeft", "wrapper", "wrapperVertical"]);
15
- const U = (e) => {
15
+ k("MuiDivider", ["root", "absolute", "fullWidth", "inset", "middle", "flexItem", "light", "vertical", "withChildren", "withChildrenVertical", "textAlignRight", "textAlignLeft", "wrapper", "wrapperVertical"]);
16
+ const M = (e) => {
16
17
  const {
17
18
  absolute: t,
18
19
  children: o,
19
20
  classes: p,
20
- flexItem: h,
21
+ flexItem: g,
21
22
  light: i,
22
23
  orientation: n,
23
- textAlign: a,
24
- variant: l
24
+ textAlign: l,
25
+ variant: a
25
26
  } = 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"],
27
+ return z({
28
+ root: ["root", t && "absolute", a, i && "light", n === "vertical" && "vertical", g && "flexItem", o && "withChildren", o && n === "vertical" && "withChildrenVertical", l === "right" && n !== "vertical" && "textAlignRight", l === "left" && n !== "vertical" && "textAlignLeft"],
28
29
  wrapper: ["wrapper", n === "vertical" && "wrapperVertical"]
29
- }, M, p);
30
- }, j = w("div", {
30
+ }, E, p);
31
+ }, U = w("div", {
31
32
  name: "MuiDivider",
32
33
  slot: "Root",
33
34
  overridesResolver: (e, t) => {
@@ -168,7 +169,7 @@ const U = (e) => {
168
169
  }
169
170
  }
170
171
  }]
171
- }))), k = w("span", {
172
+ }))), j = w("span", {
172
173
  name: "MuiDivider",
173
174
  slot: "Wrapper",
174
175
  overridesResolver: (e, t) => {
@@ -193,50 +194,50 @@ const U = (e) => {
193
194
  paddingBottom: `calc(${e.spacing(1)} * 1.2)`
194
195
  }
195
196
  }]
196
- }))), v = /* @__PURE__ */ O.forwardRef(function(t, o) {
197
- const p = z({
197
+ }))), m = /* @__PURE__ */ O.forwardRef(function(t, o) {
198
+ const p = $({
198
199
  props: t,
199
200
  name: "MuiDivider"
200
201
  }), {
201
- absolute: h = !1,
202
+ absolute: g = !1,
202
203
  children: i,
203
204
  className: n,
204
- orientation: a = "horizontal",
205
- component: l = i || a === "vertical" ? "div" : "hr",
205
+ orientation: l = "horizontal",
206
+ component: a = i || l === "vertical" ? "div" : "hr",
206
207
  flexItem: b = !1,
207
208
  light: A = !1,
208
- role: m = l !== "hr" ? "separator" : void 0,
209
+ role: u = a !== "hr" ? "separator" : void 0,
209
210
  textAlign: D = "center",
210
211
  variant: N = "fullWidth",
211
212
  ...T
212
- } = p, u = {
213
+ } = p, v = {
213
214
  ...p,
214
- absolute: h,
215
- component: l,
215
+ absolute: g,
216
+ component: a,
216
217
  flexItem: b,
217
218
  light: A,
218
- orientation: a,
219
- role: m,
219
+ orientation: l,
220
+ role: u,
220
221
  textAlign: D,
221
222
  variant: N
222
- }, _ = U(u);
223
- return /* @__PURE__ */ s(j, {
224
- as: l,
225
- className: $(_.root, n),
226
- role: m,
223
+ }, _ = M(v);
224
+ return /* @__PURE__ */ s(U, {
225
+ as: a,
226
+ className: B(_.root, n),
227
+ role: u,
227
228
  ref: o,
228
- ownerState: u,
229
- "aria-orientation": m === "separator" && (l !== "hr" || a === "vertical") ? a : void 0,
229
+ ownerState: v,
230
+ "aria-orientation": u === "separator" && (a !== "hr" || l === "vertical") ? l : void 0,
230
231
  ...T,
231
- children: i ? /* @__PURE__ */ s(k, {
232
+ children: i ? /* @__PURE__ */ s(j, {
232
233
  className: _.wrapper,
233
- ownerState: u,
234
+ ownerState: v,
234
235
  children: i
235
236
  }) : null
236
237
  });
237
238
  });
238
- v && (v.muiSkipListHighlight = !0);
239
- process.env.NODE_ENV !== "production" && (v.propTypes = {
239
+ m && (m.muiSkipListHighlight = !0);
240
+ process.env.NODE_ENV !== "production" && (m.propTypes = {
240
241
  // ┌────────────────────────────── Warning ──────────────────────────────┐
241
242
  // │ These PropTypes are generated from the TypeScript type definitions. │
242
243
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
@@ -299,44 +300,45 @@ process.env.NODE_ENV !== "production" && (v.propTypes = {
299
300
  */
300
301
  variant: r.oneOfType([r.oneOf(["fullWidth", "inset", "middle"]), r.string])
301
302
  });
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 = {
303
+ const H = "_dialog_1y4gd_1", P = "_dark_1y4gd_4", F = "_errorContent_1y4gd_8", Y = "_errorItem_1y4gd_60", q = "_fileName_1y4gd_67", G = "_topActions_1y4gd_70", J = "_close_1y4gd_76", K = "_botActions_1y4gd_84", Q = "_button_1y4gd_90", X = "_title_1y4gd_95", Z = "_content_1y4gd_102", tt = "_many_1y4gd_124", et = "_crop_1y4gd_128", ot = "_dialogText_1y4gd_176", d = {
303
304
  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) => {
305
+ dark: P,
306
+ errorContent: F,
307
+ errorItem: Y,
308
+ fileName: q,
309
+ topActions: G,
310
+ close: J,
311
+ botActions: K,
312
+ button: Q,
313
+ title: X,
314
+ content: Z,
315
+ many: tt,
316
+ crop: et,
317
+ dialogText: ot
318
+ }, ht = (e) => {
317
319
  const {
318
320
  photoSources: t,
319
321
  errors: o = [],
320
322
  onCloseDialogHandler: p,
321
- onClearErrors: h,
323
+ onClearErrors: g,
322
324
  locale: i = S
323
325
  } = e;
324
- return /* @__PURE__ */ g(x, { children: [
326
+ return /* @__PURE__ */ h(y, { children: [
325
327
  /* @__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: [
328
+ /* @__PURE__ */ s(R, { className: c(d.errorContent), children: o.map(({ photoName: n, errorMessage: l }, a) => /* @__PURE__ */ h(y, { children: [
329
+ !!a && /* @__PURE__ */ s(m, {}),
330
+ /* @__PURE__ */ h("div", { className: c(d.errorItem), children: [
329
331
  /* @__PURE__ */ s("span", { className: c(d.fileName), children: n }),
330
332
  " ",
331
- ` ${L} ${a}`
333
+ ` ${L} ${l}`
332
334
  ] })
333
- ] }, l)) }),
334
- /* @__PURE__ */ g(W, { className: c(d.botActions), children: [
335
+ ] }, a)) }),
336
+ /* @__PURE__ */ h(W, { className: c(d.botActions), children: [
335
337
  /* @__PURE__ */ s(
336
- y,
338
+ x,
337
339
  {
338
340
  buttonSize: "small",
339
- buttonColor: "blue",
341
+ buttonColor: "red",
340
342
  buttonVariant: "outlined",
341
343
  buttonWeight: 500,
342
344
  onClick: p,
@@ -345,13 +347,13 @@ const H = "_dialog_1h5av_1", P = "_errorContent_1h5av_7", F = "_errorItem_1h5av_
345
347
  }
346
348
  ),
347
349
  !!t.length && /* @__PURE__ */ s(
348
- y,
350
+ x,
349
351
  {
350
352
  buttonSize: "small",
351
353
  buttonColor: "blue",
352
- buttonVariant: "filled",
354
+ buttonVariant: "outlined",
353
355
  buttonWeight: 500,
354
- onClick: h,
356
+ onClick: g,
355
357
  className: c(d.button),
356
358
  children: f[i].continue
357
359
  }
@@ -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,
365
+ ht as U,
364
366
  d as s
365
367
  };
@@ -0,0 +1,5 @@
1
+ import * as e from "react";
2
+ const f = typeof window < "u" ? e.useLayoutEffect : e.useEffect;
3
+ export {
4
+ f as u
5
+ };
@@ -0,0 +1,5 @@
1
+ type Debounced<T extends (...args: never[]) => unknown> = ((...args: Parameters<T>) => void) & {
2
+ cancel: () => void;
3
+ };
4
+ export declare const debounce: <T extends (...args: never[]) => unknown>(fn: T, wait: number) => Debounced<T>;
5
+ export {};
@@ -0,0 +1,12 @@
1
+ const d = (t, i) => {
2
+ let e;
3
+ const o = ((...c) => {
4
+ e !== void 0 && clearTimeout(e), e = setTimeout(() => t(...c), i);
5
+ });
6
+ return o.cancel = () => {
7
+ e !== void 0 && (clearTimeout(e), e = void 0);
8
+ }, o;
9
+ };
10
+ export {
11
+ d as debounce
12
+ };
@@ -0,0 +1 @@
1
+ export { debounce } from './debounce';
@@ -0,0 +1,4 @@
1
+ import { debounce as r } from "./debounce.js";
2
+ export {
3
+ r as debounce
4
+ };
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.2.0",
5
5
  "license": "UNLICENSED",
6
6
  "author": {
7
7
  "name": "Vladislav Knitrunov",
@@ -22,7 +22,15 @@
22
22
  "preview": "vite preview",
23
23
  "storybook": "storybook dev -p 6006",
24
24
  "build-storybook": "storybook build",
25
- "prepare": "husky"
25
+ "prepare": "husky",
26
+ "sync:setup": "node scripts/sync.cjs setup",
27
+ "sync:update": "node scripts/sync.cjs update",
28
+ "sync:pull:all": "node scripts/sync.cjs pull:all",
29
+ "sync:pull:existing": "node scripts/sync.cjs pull:existing",
30
+ "sync:pull:new": "node scripts/sync.cjs pull:new",
31
+ "sync:push:all": "node scripts/sync.cjs push:all",
32
+ "sync:push:new": "node scripts/sync.cjs push:new",
33
+ "sync:push:existing": "node scripts/sync.cjs push:existing"
26
34
  },
27
35
  "peerDependencies": {
28
36
  "@emotion/react": "11.14.0",
@@ -1,21 +0,0 @@
1
- import './assets/button.css';const t = "_button_fufd7_1", _ = "_startContent_fufd7_9", n = "_endContent_fufd7_12", e = "_link_fufd7_15", f = "_description_fufd7_24", s = "_text_fufd7_29", d = "_withDescription_fufd7_33", i = "_specific_fufd7_36", o = "_small_fufd7_46", c = "_filled_fufd7_51", l = "_white_fufd7_51", u = "_blue_fufd7_61", a = "_gray_fufd7_68", r = "_outlined_fufd7_72", p = "_disabled_fufd7_97", b = {
2
- button: t,
3
- startContent: _,
4
- endContent: n,
5
- link: e,
6
- description: f,
7
- text: s,
8
- withDescription: d,
9
- specific: i,
10
- default: "_default_fufd7_40",
11
- small: o,
12
- filled: c,
13
- white: l,
14
- blue: u,
15
- gray: a,
16
- outlined: r,
17
- disabled: p
18
- };
19
- export {
20
- b as s
21
- };