@hai-dev/ui-kit 1.1.12 → 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 (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 +22 -21
  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-CCRxzIZp.js} +53 -53
  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,65 +1,72 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { c as U } from "../../index-YnD2EP-S.js";
3
3
  import { ButtonContent as a } from "./button-content.js";
4
- import { BUTTON_COLOR_GRAY as h, BUTTON_SIZE_DEFAULT as I, BUTTON_VARIANT_OUTLINED as x, MIN_WIDTH_DEFAULT as C, BUTTON_WEIGHT_MEDIUM as E } from "./constants.js";
5
- import { s as A } from "../../button.module-BZPPmSAS.js";
6
- import { B as D } from "../../ButtonBase-CSWuFxUv.js";
4
+ import { BUTTON_COLOR_GRAY as x, BUTTON_SIZE_DEFAULT as I, BUTTON_VARIANT_OUTLINED as g, MIN_WIDTH_DEFAULT as C, BUTTON_WEIGHT_MEDIUM as E } from "./constants.js";
5
+ import '../../assets/inter.css';/* empty css */
6
+ import { s as A } from "../../button.module-C0UNQnBk.js";
7
+ import { B as D } from "../../ButtonBase-C4krg_zd.js";
7
8
  import { getButtonClassnames as L } from "./utils/get-button-classnames.js";
8
- const F = (m) => {
9
+ const V = (m) => {
9
10
  const {
10
- buttonColor: l = h,
11
- buttonSize: c = I,
12
- buttonVariant: T = x,
13
- isLink: u,
11
+ buttonColor: c = x,
12
+ buttonSize: l = I,
13
+ buttonVariant: T = g,
14
+ isLink: f,
14
15
  href: o,
15
- description: n,
16
- className: B,
17
- children: s,
18
- minWidth: f = C,
19
- sx: p,
20
- buttonWeight: N = E,
16
+ description: e,
17
+ className: p,
18
+ children: n,
19
+ minWidth: u = C,
20
+ sx: B,
21
+ buttonWeight: _ = E,
21
22
  startContent: r,
22
- endContent: i,
23
- disabled: e,
24
- buttonSlots: _,
23
+ endContent: s,
24
+ disabled: i,
25
+ noTextTransform: d,
26
+ leftSide: N,
27
+ uppercase: h,
28
+ prefetch: W,
25
29
  ...b
26
- } = m, d = Object.assign({}, p, {
27
- minWidth: f,
28
- fontWeight: N
29
- }), O = _?.link;
30
+ } = m, O = Object.assign({}, B, {
31
+ minWidth: u,
32
+ fontWeight: _
33
+ });
30
34
  return /* @__PURE__ */ t(
31
35
  D,
32
36
  {
33
37
  className: L({
34
- className: B,
35
- buttonColor: l,
36
- buttonSize: c,
38
+ className: p,
39
+ buttonColor: c,
40
+ buttonSize: l,
37
41
  buttonVariant: T,
38
- disabled: e
42
+ disabled: i,
43
+ noTextTransform: d,
44
+ leftSide: N,
45
+ uppercase: h
39
46
  }),
40
- sx: d,
41
- disabled: e,
47
+ sx: O,
48
+ disabled: i,
42
49
  ...b,
43
- children: u && o ? O || /* @__PURE__ */ t("a", { className: U(A.link), href: o, children: /* @__PURE__ */ t(
50
+ children: f && o ? /* @__PURE__ */ t("a", { className: U(A.link), href: o, draggable: !1, children: /* @__PURE__ */ t(
44
51
  a,
45
52
  {
46
- description: n,
53
+ description: e,
47
54
  startContent: r,
48
- endContent: i,
49
- children: s
55
+ endContent: s,
56
+ children: n
50
57
  }
51
58
  ) }) : /* @__PURE__ */ t(
52
59
  a,
53
60
  {
54
- description: n,
61
+ description: e,
55
62
  startContent: r,
56
- endContent: i,
57
- children: s
63
+ endContent: s,
64
+ children: n
58
65
  }
59
66
  )
60
67
  }
61
68
  );
62
69
  };
63
70
  export {
64
- F as Button
71
+ V as Button
65
72
  };
@@ -1,11 +1,28 @@
1
1
  export declare const BUTTON_COLOR_WHITE = "white";
2
2
  export declare const BUTTON_COLOR_BLUE = "blue";
3
+ export declare const BUTTON_COLOR_RED = "red";
3
4
  export declare const BUTTON_COLOR_GRAY = "gray";
5
+ export declare const BUTTON_COLOR_DARK_GRAY = "darkGray";
6
+ export declare const BUTTON_COLOR_LIGHT_GRAY = "lightGray";
7
+ export declare const BUTTON_COLOR_DARK = "dark";
8
+ export declare const BUTTON_COLOR_DARK_BLUE = "darkBlue";
9
+ export declare const BUTTON_COLOR_DARKER_BLUE = "darkerBlue";
10
+ export declare const BUTTON_COLOR_GREEN = "green";
11
+ export declare const BUTTON_COLOR_DARKER_LIGHT_GREEN = "lightGreen";
12
+ export declare const BUTTON_COLOR_DARKER_LIGHT_RED = "lightRed";
13
+ export declare const BUTTON_COLOR_ORANGE = "orange";
14
+ export declare const BUTTON_COLOR_DARK_ORANGE = "darkOrange";
4
15
  export declare const BUTTON_VARIANT_FILLED = "filled";
5
16
  export declare const BUTTON_VARIANT_OUTLINED = "outlined";
6
17
  export declare const BUTTON_VARIANT_TEXT = "text";
7
18
  export declare const BUTTON_SIZE_DEFAULT = "default";
19
+ export declare const BUTTON_SIZE_MEDIUM = "medium";
20
+ export declare const BUTTON_SIZE_SMALL_MEDIUM = "smallMedium";
8
21
  export declare const BUTTON_SIZE_SMALL = "small";
22
+ export declare const BUTTON_SIZE_SMALLER = "smaller";
23
+ export declare const BUTTON_SIZE_SMALLEST = "smallest";
24
+ export declare const BUTTON_SIZE_TINY = "tiny";
25
+ export declare const BUTTON_WEIGHT_NORMAL = 400;
9
26
  export declare const BUTTON_WEIGHT_MEDIUM = 500;
10
27
  export declare const BUTTON_WEIGHT_SEMI_BOLD = 600;
11
28
  export declare const BUTTON_WEIGHT_BOLD = 700;
@@ -1,15 +1,32 @@
1
- const T = "white", _ = "blue", O = "gray", t = "filled", N = "outlined", U = "text", I = "default", o = "small", B = 500, E = 600, n = 700, s = 240;
1
+ const T = "white", _ = "blue", O = "red", t = "gray", N = "darkGray", R = "lightGray", E = "dark", U = "darkBlue", L = "darkerBlue", n = "green", B = "lightGreen", s = "lightRed", o = "orange", c = "darkOrange", I = "filled", A = "outlined", e = "text", D = "default", l = "medium", G = "smallMedium", r = "small", a = "smaller", C = "smallest", M = "tiny", S = 400, d = 500, i = 600, H = 700, g = 240;
2
2
  export {
3
3
  _ as BUTTON_COLOR_BLUE,
4
- O as BUTTON_COLOR_GRAY,
4
+ E as BUTTON_COLOR_DARK,
5
+ L as BUTTON_COLOR_DARKER_BLUE,
6
+ B as BUTTON_COLOR_DARKER_LIGHT_GREEN,
7
+ s as BUTTON_COLOR_DARKER_LIGHT_RED,
8
+ U as BUTTON_COLOR_DARK_BLUE,
9
+ N as BUTTON_COLOR_DARK_GRAY,
10
+ c as BUTTON_COLOR_DARK_ORANGE,
11
+ t as BUTTON_COLOR_GRAY,
12
+ n as BUTTON_COLOR_GREEN,
13
+ R as BUTTON_COLOR_LIGHT_GRAY,
14
+ o as BUTTON_COLOR_ORANGE,
15
+ O as BUTTON_COLOR_RED,
5
16
  T as BUTTON_COLOR_WHITE,
6
- I as BUTTON_SIZE_DEFAULT,
7
- o as BUTTON_SIZE_SMALL,
8
- t as BUTTON_VARIANT_FILLED,
9
- N as BUTTON_VARIANT_OUTLINED,
10
- U as BUTTON_VARIANT_TEXT,
11
- n as BUTTON_WEIGHT_BOLD,
12
- B as BUTTON_WEIGHT_MEDIUM,
13
- E as BUTTON_WEIGHT_SEMI_BOLD,
14
- s as MIN_WIDTH_DEFAULT
17
+ D as BUTTON_SIZE_DEFAULT,
18
+ l as BUTTON_SIZE_MEDIUM,
19
+ r as BUTTON_SIZE_SMALL,
20
+ a as BUTTON_SIZE_SMALLER,
21
+ C as BUTTON_SIZE_SMALLEST,
22
+ G as BUTTON_SIZE_SMALL_MEDIUM,
23
+ M as BUTTON_SIZE_TINY,
24
+ I as BUTTON_VARIANT_FILLED,
25
+ A as BUTTON_VARIANT_OUTLINED,
26
+ e as BUTTON_VARIANT_TEXT,
27
+ H as BUTTON_WEIGHT_BOLD,
28
+ d as BUTTON_WEIGHT_MEDIUM,
29
+ S as BUTTON_WEIGHT_NORMAL,
30
+ i as BUTTON_WEIGHT_SEMI_BOLD,
31
+ g as MIN_WIDTH_DEFAULT
15
32
  };
@@ -1,14 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ButtonBaseProps } from '@mui/material';
3
- import { BUTTON_COLOR_BLUE, BUTTON_COLOR_GRAY, BUTTON_COLOR_WHITE, BUTTON_SIZE_DEFAULT, BUTTON_SIZE_SMALL, BUTTON_VARIANT_FILLED, BUTTON_VARIANT_OUTLINED, BUTTON_VARIANT_TEXT, BUTTON_WEIGHT_BOLD, BUTTON_WEIGHT_MEDIUM, BUTTON_WEIGHT_SEMI_BOLD } from './constants';
4
- export type ButtonColor = typeof BUTTON_COLOR_BLUE | typeof BUTTON_COLOR_WHITE | typeof BUTTON_COLOR_GRAY;
3
+ import { BUTTON_COLOR_BLUE, BUTTON_COLOR_DARK, BUTTON_COLOR_DARK_BLUE, BUTTON_COLOR_DARKER_BLUE, BUTTON_COLOR_GRAY, BUTTON_COLOR_LIGHT_GRAY, BUTTON_COLOR_RED, BUTTON_COLOR_WHITE, BUTTON_SIZE_DEFAULT, BUTTON_SIZE_MEDIUM, BUTTON_SIZE_SMALL, BUTTON_SIZE_SMALLER, BUTTON_VARIANT_FILLED, BUTTON_VARIANT_OUTLINED, BUTTON_VARIANT_TEXT, BUTTON_WEIGHT_BOLD, BUTTON_WEIGHT_MEDIUM, BUTTON_WEIGHT_NORMAL, BUTTON_WEIGHT_SEMI_BOLD, BUTTON_COLOR_DARKER_LIGHT_GREEN, BUTTON_COLOR_DARKER_LIGHT_RED, BUTTON_COLOR_ORANGE, BUTTON_SIZE_SMALLEST, BUTTON_COLOR_DARK_ORANGE, BUTTON_COLOR_DARK_GRAY, BUTTON_COLOR_GREEN, BUTTON_SIZE_SMALL_MEDIUM, BUTTON_SIZE_TINY } from './constants';
4
+ export type ButtonColor = typeof BUTTON_COLOR_BLUE | typeof BUTTON_COLOR_WHITE | typeof BUTTON_COLOR_GRAY | typeof BUTTON_COLOR_LIGHT_GRAY | typeof BUTTON_COLOR_RED | typeof BUTTON_COLOR_DARK | typeof BUTTON_COLOR_DARK_BLUE | typeof BUTTON_COLOR_DARKER_BLUE | typeof BUTTON_COLOR_DARKER_LIGHT_GREEN | typeof BUTTON_COLOR_GREEN | typeof BUTTON_COLOR_DARKER_LIGHT_RED | typeof BUTTON_COLOR_ORANGE | typeof BUTTON_COLOR_DARK_ORANGE | typeof BUTTON_COLOR_DARK_GRAY;
5
5
  export type ButtonVariant = typeof BUTTON_VARIANT_OUTLINED | typeof BUTTON_VARIANT_FILLED | typeof BUTTON_VARIANT_TEXT;
6
- export type ButtonWeight = typeof BUTTON_WEIGHT_MEDIUM | typeof BUTTON_WEIGHT_SEMI_BOLD | typeof BUTTON_WEIGHT_BOLD;
7
- export type ButtonSize = typeof BUTTON_SIZE_DEFAULT | typeof BUTTON_SIZE_SMALL;
6
+ export type ButtonWeight = typeof BUTTON_WEIGHT_NORMAL | typeof BUTTON_WEIGHT_MEDIUM | typeof BUTTON_WEIGHT_SEMI_BOLD | typeof BUTTON_WEIGHT_BOLD;
7
+ export type ButtonSize = typeof BUTTON_SIZE_DEFAULT | typeof BUTTON_SIZE_SMALL | typeof BUTTON_SIZE_SMALLER | typeof BUTTON_SIZE_SMALL_MEDIUM | typeof BUTTON_SIZE_MEDIUM | typeof BUTTON_SIZE_SMALLEST | typeof BUTTON_SIZE_TINY;
8
8
  export type ButtonWidth = number | string;
9
- export type ButtonSlots = {
10
- link?: ReactNode;
11
- };
12
9
  export type ButtonCustomProps = {
13
10
  buttonColor?: ButtonColor;
14
11
  buttonVariant?: ButtonVariant;
@@ -20,7 +17,10 @@ export type ButtonCustomProps = {
20
17
  minWidth?: ButtonWidth;
21
18
  startContent?: ReactNode;
22
19
  endContent?: ReactNode;
23
- buttonSlots?: ButtonSlots;
20
+ noTextTransform?: boolean;
21
+ leftSide?: boolean;
22
+ uppercase?: boolean;
23
+ prefetch?: boolean;
24
24
  };
25
25
  export type ButtonProps = ButtonBaseProps & ButtonCustomProps;
26
26
  export type GetButtonClassnamesParams = {
@@ -29,6 +29,9 @@ export type GetButtonClassnamesParams = {
29
29
  buttonVariant: ButtonVariant;
30
30
  buttonSize: ButtonSize;
31
31
  disabled?: boolean;
32
+ noTextTransform?: boolean;
33
+ leftSide?: boolean;
34
+ uppercase?: boolean;
32
35
  };
33
36
  export type ButtonContentProps = {
34
37
  children: ReactNode;
@@ -1,2 +1,8 @@
1
1
  import { GetButtonClassnamesParams } from '../types';
2
+ /**
3
+ * Возвращает классы для компонента кнопки в виде строки
4
+ *
5
+ * @param {GetButtonClassnamesParams} params
6
+ * @returns {string} - Классы в виде строки
7
+ */
2
8
  export declare const getButtonClassnames: (params: GetButtonClassnamesParams) => string;
@@ -1,17 +1,29 @@
1
- import { c as i } from "../../../index-YnD2EP-S.js";
2
- import { s as t } from "../../../button.module-BZPPmSAS.js";
3
- const l = (s) => {
4
- const { className: o, buttonColor: a, buttonSize: e, buttonVariant: n, disabled: r } = s;
5
- return i(
1
+ import { c as m } from "../../../index-YnD2EP-S.js";
2
+ import { s as t } from "../../../button.module-C0UNQnBk.js";
3
+ const f = (e) => {
4
+ const {
5
+ className: s,
6
+ buttonColor: o,
7
+ buttonSize: r,
8
+ buttonVariant: a,
9
+ disabled: n,
10
+ noTextTransform: i,
11
+ leftSide: c,
12
+ uppercase: l
13
+ } = e;
14
+ return m(
6
15
  t.button,
7
16
  t.specific,
17
+ t[o],
18
+ t[r],
8
19
  t[a],
9
- t[e],
10
- t[n],
11
- r && t.disabled,
12
- o
20
+ n && t.disabled,
21
+ i && t.noTextTransform,
22
+ c && t.leftSide,
23
+ l && t.uppercase,
24
+ s
13
25
  );
14
26
  };
15
27
  export {
16
- l as getButtonClassnames
28
+ f as getButtonClassnames
17
29
  };
@@ -1,42 +1,43 @@
1
- import { jsxs as _, jsx as e } from "react/jsx-runtime";
2
- import { c as m } from "../../index-YnD2EP-S.js";
1
+ import { jsxs as _, jsx as o } from "react/jsx-runtime";
2
+ import { c as p } from "../../index-YnD2EP-S.js";
3
3
  import { PERCENT_SYMBOL as T } from "../../constants.js";
4
4
  import { CIRCULAR_PROGRESS_DEFAULT_VALUE as R, PROGRESS_VARIANT_DETERMINATE as a, CIRCULAR_PROGRESS_DEFAULT_SIZE as C } from "./constants.js";
5
- import { B as l } from "../../Box-TrgOqpYk.js";
6
- import { C as E } from "../../CircularProgress-sPARyPfh.js";
7
- import { T as g } from "../../Typography-Bjd6ZHeX.js";
8
- import '../../assets/circular-progress-loader.css';const L = "_circularProgressLoader_knl3p_1", P = "_progress_knl3p_5", b = "_labelContainer_knl3p_8", d = "_labelText_knl3p_18", r = {
5
+ import '../../assets/inter.css';import '../../assets/circular-progress-loader.css';/* empty css */
6
+ import { B as l } from "../../Box-BgNAyP2L.js";
7
+ import { C as E } from "../../CircularProgress-BoaEg4rF.js";
8
+ import { T as g } from "../../Typography-BMyz0ZCh.js";
9
+ const L = "_circularProgressLoader_kv5ml_1", P = "_progress_kv5ml_5", b = "_labelContainer_kv5ml_8", d = "_labelText_kv5ml_18", r = {
9
10
  circularProgressLoader: L,
10
11
  progress: P,
11
12
  labelContainer: b,
12
13
  labelText: d
13
14
  }, k = (t) => {
14
15
  const {
15
- value: o = R,
16
+ value: e = R,
16
17
  variant: s = a,
17
18
  size: c = C,
18
19
  className: n,
19
20
  ...i
20
- } = t, p = `${Math.round(o)}${T}`;
21
+ } = t, m = `${Math.round(e)}${T}`;
21
22
  return /* @__PURE__ */ _(l, { className: r.circularProgressLoader, children: [
22
- /* @__PURE__ */ e(
23
+ /* @__PURE__ */ o(
23
24
  E,
24
25
  {
25
- className: m(r.progress, n),
26
+ className: p(r.progress, n),
26
27
  enableTrackSlot: !0,
27
28
  variant: s,
28
- value: o,
29
+ value: e,
29
30
  size: c,
30
31
  ...i
31
32
  }
32
33
  ),
33
- s === a && /* @__PURE__ */ e(l, { className: r.labelContainer, children: /* @__PURE__ */ e(
34
+ s === a && /* @__PURE__ */ o(l, { className: r.labelContainer, children: /* @__PURE__ */ o(
34
35
  g,
35
36
  {
36
37
  className: r.labelText,
37
38
  variant: "caption",
38
39
  component: "div",
39
- children: p
40
+ children: m
40
41
  }
41
42
  ) })
42
43
  ] });