@hai-dev/ui-kit 1.2.0 → 1.2.2

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 (46) hide show
  1. package/dist/assets/button.css +1 -1
  2. package/dist/assets/circular-progress-loader.css +1 -1
  3. package/dist/assets/code-input.css +1 -1
  4. package/dist/assets/error-upload-dialog.css +1 -1
  5. package/dist/assets/upload-dialog-errors.css +1 -1
  6. package/dist/button.module-BnTmlu-U.js +40 -0
  7. package/dist/components/button/button-content.js +8 -8
  8. package/dist/components/button/button.js +21 -22
  9. package/dist/components/button/utils/get-button-classnames.js +10 -10
  10. package/dist/components/circular-progress-loader/circular-progress-loader.js +25 -28
  11. package/dist/components/code-input/code-input.js +114 -915
  12. package/dist/components/code-input/types.d.ts +1 -0
  13. package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +26 -94
  14. package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +38 -120
  15. package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +16 -16
  16. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.js +4 -5
  17. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +111 -403
  18. package/dist/components/photo-crop-uploader/photo-crop-uploader.js +12 -12
  19. package/dist/components/photo-crop-uploader/utils/draw-cropped-image.js +8 -8
  20. package/dist/components/photo-crop-uploader/utils/get-cropped-source.js +10 -10
  21. package/dist/components/photo-crop-uploader/utils/get-default-cropped-photo.js +10 -10
  22. package/dist/components/photo-crop-uploader/utils/get-photo-crop.js +18 -18
  23. package/dist/upload-dialog-errors-B7V0G-Ey.js +71 -0
  24. package/package.json +1 -1
  25. package/dist/Box-BgNAyP2L.js +0 -56
  26. package/dist/Button-DTV8ztWw.js +0 -660
  27. package/dist/ButtonBase-C4krg_zd.js +0 -913
  28. package/dist/CircularProgress-BoaEg4rF.js +0 -274
  29. package/dist/Dialog-BK9lMUKV.js +0 -2632
  30. package/dist/DialogTitle-ByUfLB5M.js +0 -254
  31. package/dist/Typography-BMyz0ZCh.js +0 -255
  32. package/dist/assets/inter.css +0 -1
  33. package/dist/button.module-C0UNQnBk.js +0 -40
  34. package/dist/chainPropTypes-DgqFdXGi.js +0 -532
  35. package/dist/createSimplePaletteValueFilter-B7--0ryQ.js +0 -17
  36. package/dist/createTheme-BoOmbNvy.js +0 -4119
  37. package/dist/extendSxProp-BaUCVMKV.js +0 -50
  38. package/dist/index-CcueJ2sD.js +0 -432
  39. package/dist/index-YnD2EP-S.js +0 -43
  40. package/dist/index-h5oTv8GF.js +0 -91
  41. package/dist/isHostComponent-Dm_U9uOy.js +0 -14
  42. package/dist/memoTheme-BYBJ2Fe6.js +0 -15
  43. package/dist/refType-CsohaiiT.js +0 -60
  44. package/dist/upload-dialog-errors-CCRxzIZp.js +0 -367
  45. package/dist/useEnhancedEffect-CJGo-L3B.js +0 -5
  46. package/dist/useId-CK6Kn3Tn.js +0 -21
@@ -8,4 +8,5 @@ export type CodeInputProps = {
8
8
  className?: string;
9
9
  autoFocus?: boolean;
10
10
  locale?: Locale;
11
+ isPatient?: boolean;
11
12
  };
@@ -1,103 +1,35 @@
1
- import { jsx as e, jsxs as f } from "react/jsx-runtime";
2
- import { c as p } from "../../../../index-YnD2EP-S.js";
3
- import { localizedText as d } from "../../locale.js";
4
- import { EN_LOCALE as T, DARK_THEME as u } from "../../../../constants.js";
5
- import '../../../../assets/inter.css';import '../../../../assets/error-upload-dialog.css';/* empty css */
6
- import { D as x } from "../../../../Dialog-BK9lMUKV.js";
7
- import { D as C, a as D, b as y } from "../../../../DialogTitle-ByUfLB5M.js";
8
- import * as h from "react";
9
- import { g as E, a as _, c as N, P as o } from "../../../../createTheme-BoOmbNvy.js";
10
- import { u as w, c as b, s as P, r as j } from "../../../../chainPropTypes-DgqFdXGi.js";
11
- import { T as k } from "../../../../Typography-BMyz0ZCh.js";
12
- import { B as M } from "../../../../Button-DTV8ztWw.js";
13
- function O(t) {
14
- return E("MuiDialogContentText", t);
15
- }
16
- _("MuiDialogContentText", ["root"]);
17
- const R = (t) => {
1
+ import { jsxs as g, jsx as o } from "react/jsx-runtime";
2
+ import { Dialog as m, DialogTitle as E, DialogContent as _, DialogContentText as x, DialogActions as p, Button as h } from "@mui/material";
3
+ import t from "classnames";
4
+ import { localizedText as a } from "../../locale.js";
5
+ import { EN_LOCALE as D, DARK_THEME as T } from "../../../../constants.js";
6
+ import '../../../../assets/error-upload-dialog.css';const C = "_dialog_1l401_1", f = "_dark_1l401_5", k = "_dialogErrorText_1l401_9", r = {
7
+ dialog: C,
8
+ dark: f,
9
+ dialogErrorText: k
10
+ }, b = (e) => {
18
11
  const {
19
- classes: r
20
- } = t, s = b({
21
- root: ["root"]
22
- }, O, r);
23
- return {
24
- ...r,
25
- // forward classes to the Typography
26
- ...s
27
- };
28
- }, U = P(k, {
29
- shouldForwardProp: (t) => j(t) || t === "classes",
30
- name: "MuiDialogContentText",
31
- slot: "Root"
32
- })({}), g = /* @__PURE__ */ h.forwardRef(function(r, a) {
33
- const s = w({
34
- props: r,
35
- name: "MuiDialogContentText"
36
- }), {
37
- children: c,
38
- className: n,
39
- ...l
40
- } = s, m = R(l);
41
- return /* @__PURE__ */ e(U, {
42
- component: "p",
43
- variant: "body1",
44
- color: "textSecondary",
45
- ref: a,
46
- ownerState: l,
47
- className: N(m.root, n),
48
- ...s,
49
- classes: m
50
- });
51
- });
52
- process.env.NODE_ENV !== "production" && (g.propTypes = {
53
- // ┌────────────────────────────── Warning ──────────────────────────────┐
54
- // │ These PropTypes are generated from the TypeScript type definitions. │
55
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
56
- // └─────────────────────────────────────────────────────────────────────┘
57
- /**
58
- * The content of the component.
59
- */
60
- children: o.node,
61
- /**
62
- * Override or extend the styles applied to the component.
63
- */
64
- classes: o.object,
65
- /**
66
- * @ignore
67
- */
68
- className: o.string,
69
- /**
70
- * The system prop that allows defining system overrides as well as additional CSS styles.
71
- */
72
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
73
- });
74
- const S = "_dialog_gmwe9_1", v = "_dark_gmwe9_4", A = "_dialogErrorText_gmwe9_8", i = {
75
- dialog: S,
76
- dark: v,
77
- dialogErrorText: A
78
- }, Q = (t) => {
79
- const {
80
- photoError: r,
81
- onCloseErrorDialog: a,
82
- locale: s = T,
83
- theme: c = u,
84
- className: n,
85
- ...l
86
- } = t;
87
- return /* @__PURE__ */ f(
88
- x,
12
+ photoError: n,
13
+ onCloseErrorDialog: l,
14
+ locale: i = D,
15
+ theme: c = T,
16
+ className: s,
17
+ ...d
18
+ } = e;
19
+ return /* @__PURE__ */ g(
20
+ m,
89
21
  {
90
- className: p(i.dialog, n, i[c]),
91
- onClose: a,
92
- ...l,
22
+ className: t(r.dialog, s, r[c]),
23
+ onClose: l,
24
+ ...d,
93
25
  children: [
94
- /* @__PURE__ */ e(C, { children: d[s].error }),
95
- /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(g, { className: p(i.dialogErrorText), children: r }) }),
96
- /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(M, { onClick: a, children: d[s].back }) })
26
+ /* @__PURE__ */ o(E, { children: a[i].error }),
27
+ /* @__PURE__ */ o(_, { children: /* @__PURE__ */ o(x, { className: t(r.dialogErrorText), children: n }) }),
28
+ /* @__PURE__ */ o(p, { children: /* @__PURE__ */ o(h, { onClick: l, children: a[i].back }) })
97
29
  ]
98
30
  }
99
31
  );
100
32
  };
101
33
  export {
102
- Q as ErrorUploadDialog
34
+ b as ErrorUploadDialog
103
35
  };
@@ -1,140 +1,58 @@
1
- import { jsxs as T, jsx as g } from "react/jsx-runtime";
2
- import * as f from "react";
3
- import { useState as N } from "react";
4
- import { c as E } from "../../../../index-YnD2EP-S.js";
5
- import { useContainerSize as P } from "./use-container-size.js";
6
- import { EN_LOCALE as w } from "../../../../constants.js";
7
- import { FALLBACK_MAX_ITEMS as Q, MOBILE_MIN_GAP as b, MOBILE_ITEM_SIZE as O, DESKTOP_MIN_GAP as U, DESKTOP_ITEM_SIZE as j } from "./constants.js";
8
- import { localizedText as x } from "../../locale.js";
9
- import { r as D, T as A } from "../../../../createTheme-BoOmbNvy.js";
10
- import { a as C } from "../../../../extendSxProp-BaUCVMKV.js";
11
- import { u as k } from "../../../../useEnhancedEffect-CJGo-L3B.js";
12
- import { B as y } from "../../../../Box-BgNAyP2L.js";
13
- import '../../../../assets/photo-list.css';function B(t) {
14
- const {
15
- theme: o,
16
- name: e,
17
- props: n
18
- } = t;
19
- return !o || !o.components || !o.components[e] || !o.components[e].defaultProps ? n : D(o.components[e].defaultProps, n);
20
- }
21
- function $(t, o, e, n, a) {
22
- const [s, m] = f.useState(() => a && e ? e(t).matches : n ? n(t).matches : o);
23
- return k(() => {
24
- if (!e)
25
- return;
26
- const i = e(t), c = () => {
27
- m(i.matches);
28
- };
29
- return c(), i.addEventListener("change", c), () => {
30
- i.removeEventListener("change", c);
31
- };
32
- }, [t, e]), s;
33
- }
34
- const K = {
35
- ...f
36
- }, v = K.useSyncExternalStore;
37
- function R(t, o, e, n, a) {
38
- const s = f.useCallback(() => o, [o]), m = f.useMemo(() => {
39
- if (a && e)
40
- return () => e(t).matches;
41
- if (n !== null) {
42
- const {
43
- matches: u
44
- } = n(t);
45
- return () => u;
46
- }
47
- return s;
48
- }, [s, t, n, a, e]), [i, c] = f.useMemo(() => {
49
- if (e === null)
50
- return [s, () => () => {
51
- }];
52
- const u = e(t);
53
- return [() => u.matches, (r) => (u.addEventListener("change", r), () => {
54
- u.removeEventListener("change", r);
55
- })];
56
- }, [s, e, t]);
57
- return v(c, i, m);
58
- }
59
- function S(t = {}) {
60
- const {
61
- themeId: o
62
- } = t;
63
- return function(n, a = {}) {
64
- let s = C();
65
- s && o && (s = s[o] || s);
66
- const m = typeof window < "u" && typeof window.matchMedia < "u", {
67
- defaultMatches: i = !1,
68
- matchMedia: c = m ? window.matchMedia : null,
69
- ssrMatchMedia: _ = null,
70
- noSsr: u = !1
71
- } = B({
72
- name: "MuiUseMediaQuery",
73
- props: a,
74
- theme: s
75
- });
76
- process.env.NODE_ENV !== "production" && typeof n == "function" && s === null && console.error(["MUI: The `query` argument provided is invalid.", "You are providing a function without a theme in the context.", "One of the parent elements needs to use a ThemeProvider."].join(`
77
- `));
78
- let r = typeof n == "function" ? n(s) : n;
79
- r = r.replace(/^@media( ?)/m, ""), r.includes("print") && console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.", "Using the print media query to modify print styles can lead to unexpected results.", "Consider using the `displayPrint` field in the `sx` prop instead.", "More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
80
- `));
81
- const h = (v !== void 0 ? R : $)(r, i, c, _, u);
82
- return process.env.NODE_ENV !== "production" && f.useDebugValue({
83
- query: r,
84
- match: h
85
- }), h;
86
- };
87
- }
88
- S();
89
- const V = S({
90
- themeId: A
91
- }), z = "_photoList_1j5k1_1", X = "_item_1j5k1_7", Y = "_image_1j5k1_21", l = {
92
- photoList: z,
93
- item: X,
94
- image: Y
1
+ import { jsxs as N, jsx as a } from "react/jsx-runtime";
2
+ import { useState as T } from "react";
3
+ import { useMediaQuery as d, Box as u } from "@mui/material";
4
+ import e from "classnames";
5
+ import { useContainerSize as S } from "./use-container-size.js";
6
+ import { EN_LOCALE as A } from "../../../../constants.js";
7
+ import { FALLBACK_MAX_ITEMS as P, MOBILE_MIN_GAP as j, MOBILE_ITEM_SIZE as O, DESKTOP_MIN_GAP as B, DESKTOP_ITEM_SIZE as C } from "./constants.js";
8
+ import { localizedText as _ } from "../../locale.js";
9
+ import '../../../../assets/photo-list.css';const $ = "_photoList_1j5k1_1", b = "_item_1j5k1_7", k = "_image_1j5k1_21", t = {
10
+ photoList: $,
11
+ item: b,
12
+ image: k
95
13
  };
96
- function L(t, o, e) {
97
- return t <= 0 ? Q : Math.max(1, Math.floor((t + e) / (o + e)));
14
+ function M(s, c, i) {
15
+ return s <= 0 ? P : Math.max(1, Math.floor((s + i) / (c + i)));
98
16
  }
99
- const se = (t) => {
100
- const { photoSources: o, photoIndex: e, locale: n, className: a, ...s } = t, [m, i] = N(null), { width: c, height: _ } = P(m), r = V("(max-width: 768px)") ? L(c, O, b) : L(_, j, U), d = o.slice(e), h = x[n]["photo-in-queue"], I = (p) => n === w ? `${p} ${x[n].more}` : `${x[n].more} ${p}`;
101
- return d.length > r ? /* @__PURE__ */ T(
102
- y,
17
+ const q = (s) => {
18
+ const { photoSources: c, photoIndex: i, locale: r, className: h, ...p } = s, [x, E] = T(null), { width: I, height: L } = S(x), n = d("(max-width: 768px)") ? M(I, O, j) : M(L, C, B), m = c.slice(i), f = _[r]["photo-in-queue"], g = (o) => r === A ? `${o} ${_[r].more}` : `${_[r].more} ${o}`;
19
+ return m.length > n ? /* @__PURE__ */ N(
20
+ u,
103
21
  {
104
- ref: i,
105
- className: E(l.photoList, a),
106
- ...s,
22
+ ref: E,
23
+ className: e(t.photoList, h),
24
+ ...p,
107
25
  children: [
108
- d.slice(0, r - 1).map((p, M) => /* @__PURE__ */ g(
26
+ m.slice(0, n - 1).map((o, l) => /* @__PURE__ */ a(
109
27
  "img",
110
28
  {
111
- className: E(l.item, l.image),
112
- src: p,
113
- alt: h
29
+ className: e(t.item, t.image),
30
+ src: o,
31
+ alt: f
114
32
  },
115
- M
33
+ l
116
34
  )),
117
- /* @__PURE__ */ g("div", { className: E(l.item), children: I(d.length - r + 1) })
35
+ /* @__PURE__ */ a("div", { className: e(t.item), children: g(m.length - n + 1) })
118
36
  ]
119
37
  }
120
- ) : /* @__PURE__ */ g(
121
- y,
38
+ ) : /* @__PURE__ */ a(
39
+ u,
122
40
  {
123
- ref: i,
124
- className: E(l.photoList, a),
125
- ...s,
126
- children: d.map((p, M) => /* @__PURE__ */ g(
41
+ ref: E,
42
+ className: e(t.photoList, h),
43
+ ...p,
44
+ children: m.map((o, l) => /* @__PURE__ */ a(
127
45
  "img",
128
46
  {
129
- className: E(l.item, l.image),
130
- src: p,
131
- alt: h
47
+ className: e(t.item, t.image),
48
+ src: o,
49
+ alt: f
132
50
  },
133
- M
51
+ l
134
52
  ))
135
53
  }
136
54
  );
137
55
  };
138
56
  export {
139
- se as PhotoList
57
+ q as PhotoList
140
58
  };
@@ -1,11 +1,11 @@
1
1
  import { jsx as r, jsxs as E, Fragment as k } from "react/jsx-runtime";
2
2
  import { useState as R, useRef as W } from "react";
3
- import { c as n } from "../../../../index-YnD2EP-S.js";
3
+ import { Button as y } from "@mui/material";
4
+ import n from "classnames";
4
5
  import { localizedText as T } from "../../locale.js";
5
- import { EN_LOCALE as y } from "../../../../constants.js";
6
- import { SUPPORTED_IMAGE_EXTENSIONS as M, MP4_VIDEO_EXT as j, WEBM_VIDEO_EXT as H } from "../../constants.js";
7
- import { UPLOAD_BUTTON_WIDTH_DEFAULT as X, UPLOAD_BUTTON_TAB_INDEX as F, UPLOAD_BUTTON_IMAGE_SIZE as x } from "./constants.js";
8
- import { B as z } from "../../../../Button-DTV8ztWw.js";
6
+ import { EN_LOCALE as M } from "../../../../constants.js";
7
+ import { SUPPORTED_IMAGE_EXTENSIONS as j, MP4_VIDEO_EXT as H, WEBM_VIDEO_EXT as X } from "../../constants.js";
8
+ import { UPLOAD_BUTTON_WIDTH_DEFAULT as F, UPLOAD_BUTTON_TAB_INDEX as z, UPLOAD_BUTTON_IMAGE_SIZE as x } from "./constants.js";
9
9
  import '../../../../assets/upload-button.css';const Y = "data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%201024%201024'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23000000'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cpath%20fill='%23ffffff'%20d='M544%20864V672h128L512%20480%20352%20672h128v192H320v-1.6c-5.376.32-10.496%201.6-16%201.6A240%20240%200%200%201%2064%20624c0-123.136%2093.12-223.488%20212.608-237.248A239.808%20239.808%200%200%201%20512%20192a239.872%20239.872%200%200%201%20235.456%20194.752c119.488%2013.76%20212.48%20114.112%20212.48%20237.248a240%20240%200%200%201-240%20240c-5.376%200-10.56-1.28-16-1.6v1.6H544z'/%3e%3c/g%3e%3c/svg%3e", Z = "_dragDropWrapper_cgx9x_1", q = "_input_cgx9x_4", a = {
10
10
  dragDropWrapper: Z,
11
11
  input: q
@@ -16,9 +16,9 @@ import '../../../../assets/upload-button.css';const Y = "data:image/svg+xml,%3c!
16
16
  children: C,
17
17
  className: p,
18
18
  onChange: c,
19
- locale: d = y,
20
- width: I = X,
21
- allowedExtensions: g = M,
19
+ locale: d = M,
20
+ width: I = F,
21
+ allowedExtensions: g = j,
22
22
  onDragOver: N = () => {
23
23
  },
24
24
  onDragLeave: P = () => {
@@ -32,16 +32,16 @@ import '../../../../assets/upload-button.css';const Y = "data:image/svg+xml,%3c!
32
32
  fromSources: t,
33
33
  withVideoUploaded: U = !1,
34
34
  ...u
35
- } = w, [B, s] = R(!1), l = W(null), h = U ? [...g, j, H] : g, D = (e) => {
35
+ } = w, [V, s] = R(!1), l = W(null), h = U ? [...g, H, X] : g, D = (e) => {
36
36
  o || e && e.length > 0 && c && c({
37
37
  target: {
38
38
  files: e,
39
39
  value: ""
40
40
  }
41
41
  });
42
- }, V = (e) => {
43
- t?.length || (e.preventDefault(), e.stopPropagation(), N(e), o || s(!0));
44
42
  }, A = (e) => {
43
+ t?.length || (e.preventDefault(), e.stopPropagation(), N(e), o || s(!0));
44
+ }, B = (e) => {
45
45
  t?.length || (e.preventDefault(), e.stopPropagation(), P(e), s(!1));
46
46
  }, G = (e) => {
47
47
  if (t?.length || (e.preventDefault(), e.stopPropagation(), S(e), s(!1), o)) return;
@@ -58,8 +58,8 @@ import '../../../../assets/upload-button.css';const Y = "data:image/svg+xml,%3c!
58
58
  "div",
59
59
  {
60
60
  className: n(a.dragDropWrapper),
61
- onDragOver: V,
62
- onDragLeave: A,
61
+ onDragOver: A,
62
+ onDragLeave: B,
63
63
  onDrop: G,
64
64
  onClick: b,
65
65
  children: i ? /* @__PURE__ */ E(k, { children: [
@@ -78,7 +78,7 @@ import '../../../../assets/upload-button.css';const Y = "data:image/svg+xml,%3c!
78
78
  }
79
79
  )
80
80
  ] }) : /* @__PURE__ */ E(
81
- z,
81
+ y,
82
82
  {
83
83
  component: "label",
84
84
  sx: {
@@ -87,7 +87,7 @@ import '../../../../assets/upload-button.css';const Y = "data:image/svg+xml,%3c!
87
87
  role: "none",
88
88
  variant: "contained",
89
89
  disabled: o,
90
- tabIndex: F,
90
+ tabIndex: z,
91
91
  className: n(a.uploadButton, O),
92
92
  startIcon: /* @__PURE__ */ r(
93
93
  "img",
@@ -99,7 +99,7 @@ import '../../../../assets/upload-button.css';const Y = "data:image/svg+xml,%3c!
99
99
  }
100
100
  ),
101
101
  children: [
102
- B ? T[d].drop : C,
102
+ V ? T[d].drop : C,
103
103
  /* @__PURE__ */ r(
104
104
  "input",
105
105
  {
@@ -1,11 +1,10 @@
1
1
  import "react/jsx-runtime";
2
- import "../../../../index-YnD2EP-S.js";
2
+ import "@mui/material";
3
+ import "classnames";
3
4
  import "../../locale.js";
4
5
  import "../../../../constants.js";
5
- import '../../../../assets/inter.css';/* empty css */
6
- import { U } from "../../../../upload-dialog-errors-CCRxzIZp.js";
7
- import "../../../../DialogTitle-ByUfLB5M.js";
6
+ import { U as s } from "../../../../upload-dialog-errors-B7V0G-Ey.js";
8
7
  import "../../../button/button.js";
9
8
  export {
10
- U as UploadDialogErrors
9
+ s as UploadDialogErrors
11
10
  };