@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
@@ -1,60 +0,0 @@
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
- };
@@ -1,367 +0,0 @@
1
- import { jsx as s, jsxs as h, Fragment as y } from "react/jsx-runtime";
2
- import { c } from "./index-YnD2EP-S.js";
3
- import { localizedText as f } from "./components/photo-crop-uploader/locale.js";
4
- import { EN_LOCALE as S, DASH_SYMBOL as L } from "./constants.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";
7
- import * as O from "react";
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) {
13
- return V("MuiDivider", e);
14
- }
15
- k("MuiDivider", ["root", "absolute", "fullWidth", "inset", "middle", "flexItem", "light", "vertical", "withChildren", "withChildrenVertical", "textAlignRight", "textAlignLeft", "wrapper", "wrapperVertical"]);
16
- const M = (e) => {
17
- const {
18
- absolute: t,
19
- children: o,
20
- classes: p,
21
- flexItem: g,
22
- light: i,
23
- orientation: n,
24
- textAlign: l,
25
- variant: a
26
- } = e;
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"],
29
- wrapper: ["wrapper", n === "vertical" && "wrapperVertical"]
30
- }, E, p);
31
- }, U = w("div", {
32
- name: "MuiDivider",
33
- slot: "Root",
34
- overridesResolver: (e, t) => {
35
- const {
36
- ownerState: o
37
- } = e;
38
- return [t.root, o.absolute && t.absolute, t[o.variant], o.light && t.light, o.orientation === "vertical" && t.vertical, o.flexItem && t.flexItem, o.children && t.withChildren, o.children && o.orientation === "vertical" && t.withChildrenVertical, o.textAlign === "right" && o.orientation !== "vertical" && t.textAlignRight, o.textAlign === "left" && o.orientation !== "vertical" && t.textAlignLeft];
39
- }
40
- })(C(({
41
- theme: e
42
- }) => ({
43
- margin: 0,
44
- // Reset browser default style.
45
- flexShrink: 0,
46
- borderWidth: 0,
47
- borderStyle: "solid",
48
- borderColor: (e.vars || e).palette.divider,
49
- borderBottomWidth: "thin",
50
- variants: [{
51
- props: {
52
- absolute: !0
53
- },
54
- style: {
55
- position: "absolute",
56
- bottom: 0,
57
- left: 0,
58
- width: "100%"
59
- }
60
- }, {
61
- props: {
62
- light: !0
63
- },
64
- style: {
65
- borderColor: e.alpha((e.vars || e).palette.divider, 0.08)
66
- }
67
- }, {
68
- props: {
69
- variant: "inset"
70
- },
71
- style: {
72
- marginLeft: 72
73
- }
74
- }, {
75
- props: {
76
- variant: "middle",
77
- orientation: "horizontal"
78
- },
79
- style: {
80
- marginLeft: e.spacing(2),
81
- marginRight: e.spacing(2)
82
- }
83
- }, {
84
- props: {
85
- variant: "middle",
86
- orientation: "vertical"
87
- },
88
- style: {
89
- marginTop: e.spacing(1),
90
- marginBottom: e.spacing(1)
91
- }
92
- }, {
93
- props: {
94
- orientation: "vertical"
95
- },
96
- style: {
97
- height: "100%",
98
- borderBottomWidth: 0,
99
- borderRightWidth: "thin"
100
- }
101
- }, {
102
- props: {
103
- flexItem: !0
104
- },
105
- style: {
106
- alignSelf: "stretch",
107
- height: "auto"
108
- }
109
- }, {
110
- props: ({
111
- ownerState: t
112
- }) => !!t.children,
113
- style: {
114
- display: "flex",
115
- textAlign: "center",
116
- border: 0,
117
- borderTopStyle: "solid",
118
- borderLeftStyle: "solid",
119
- "&::before, &::after": {
120
- content: '""',
121
- alignSelf: "center"
122
- }
123
- }
124
- }, {
125
- props: ({
126
- ownerState: t
127
- }) => t.children && t.orientation !== "vertical",
128
- style: {
129
- "&::before, &::after": {
130
- width: "100%",
131
- borderTop: `thin solid ${(e.vars || e).palette.divider}`,
132
- borderTopStyle: "inherit"
133
- }
134
- }
135
- }, {
136
- props: ({
137
- ownerState: t
138
- }) => t.orientation === "vertical" && t.children,
139
- style: {
140
- flexDirection: "column",
141
- "&::before, &::after": {
142
- height: "100%",
143
- borderLeft: `thin solid ${(e.vars || e).palette.divider}`,
144
- borderLeftStyle: "inherit"
145
- }
146
- }
147
- }, {
148
- props: ({
149
- ownerState: t
150
- }) => t.textAlign === "right" && t.orientation !== "vertical",
151
- style: {
152
- "&::before": {
153
- width: "90%"
154
- },
155
- "&::after": {
156
- width: "10%"
157
- }
158
- }
159
- }, {
160
- props: ({
161
- ownerState: t
162
- }) => t.textAlign === "left" && t.orientation !== "vertical",
163
- style: {
164
- "&::before": {
165
- width: "10%"
166
- },
167
- "&::after": {
168
- width: "90%"
169
- }
170
- }
171
- }]
172
- }))), j = w("span", {
173
- name: "MuiDivider",
174
- slot: "Wrapper",
175
- overridesResolver: (e, t) => {
176
- const {
177
- ownerState: o
178
- } = e;
179
- return [t.wrapper, o.orientation === "vertical" && t.wrapperVertical];
180
- }
181
- })(C(({
182
- theme: e
183
- }) => ({
184
- display: "inline-block",
185
- paddingLeft: `calc(${e.spacing(1)} * 1.2)`,
186
- paddingRight: `calc(${e.spacing(1)} * 1.2)`,
187
- whiteSpace: "nowrap",
188
- variants: [{
189
- props: {
190
- orientation: "vertical"
191
- },
192
- style: {
193
- paddingTop: `calc(${e.spacing(1)} * 1.2)`,
194
- paddingBottom: `calc(${e.spacing(1)} * 1.2)`
195
- }
196
- }]
197
- }))), m = /* @__PURE__ */ O.forwardRef(function(t, o) {
198
- const p = $({
199
- props: t,
200
- name: "MuiDivider"
201
- }), {
202
- absolute: g = !1,
203
- children: i,
204
- className: n,
205
- orientation: l = "horizontal",
206
- component: a = i || l === "vertical" ? "div" : "hr",
207
- flexItem: b = !1,
208
- light: A = !1,
209
- role: u = a !== "hr" ? "separator" : void 0,
210
- textAlign: D = "center",
211
- variant: N = "fullWidth",
212
- ...T
213
- } = p, v = {
214
- ...p,
215
- absolute: g,
216
- component: a,
217
- flexItem: b,
218
- light: A,
219
- orientation: l,
220
- role: u,
221
- textAlign: D,
222
- variant: N
223
- }, _ = M(v);
224
- return /* @__PURE__ */ s(U, {
225
- as: a,
226
- className: B(_.root, n),
227
- role: u,
228
- ref: o,
229
- ownerState: v,
230
- "aria-orientation": u === "separator" && (a !== "hr" || l === "vertical") ? l : void 0,
231
- ...T,
232
- children: i ? /* @__PURE__ */ s(j, {
233
- className: _.wrapper,
234
- ownerState: v,
235
- children: i
236
- }) : null
237
- });
238
- });
239
- m && (m.muiSkipListHighlight = !0);
240
- process.env.NODE_ENV !== "production" && (m.propTypes = {
241
- // ┌────────────────────────────── Warning ──────────────────────────────┐
242
- // │ These PropTypes are generated from the TypeScript type definitions. │
243
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
244
- // └─────────────────────────────────────────────────────────────────────┘
245
- /**
246
- * Absolutely position the element.
247
- * @default false
248
- */
249
- absolute: r.bool,
250
- /**
251
- * The content of the component.
252
- */
253
- children: r.node,
254
- /**
255
- * Override or extend the styles applied to the component.
256
- */
257
- classes: r.object,
258
- /**
259
- * @ignore
260
- */
261
- className: r.string,
262
- /**
263
- * The component used for the root node.
264
- * Either a string to use a HTML element or a component.
265
- */
266
- component: r.elementType,
267
- /**
268
- * If `true`, a vertical divider will have the correct height when used in flex container.
269
- * (By default, a vertical divider will have a calculated height of `0px` if it is the child of a flex container.)
270
- * @default false
271
- */
272
- flexItem: r.bool,
273
- /**
274
- * If `true`, the divider will have a lighter color.
275
- * @default false
276
- * @deprecated Use <Divider sx={{ opacity: 0.6 }} /> (or any opacity or color) instead. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
277
- */
278
- light: r.bool,
279
- /**
280
- * The component orientation.
281
- * @default 'horizontal'
282
- */
283
- orientation: r.oneOf(["horizontal", "vertical"]),
284
- /**
285
- * @ignore
286
- */
287
- role: r.string,
288
- /**
289
- * The system prop that allows defining system overrides as well as additional CSS styles.
290
- */
291
- sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
292
- /**
293
- * The text alignment.
294
- * @default 'center'
295
- */
296
- textAlign: r.oneOf(["center", "left", "right"]),
297
- /**
298
- * The variant to use.
299
- * @default 'fullWidth'
300
- */
301
- variant: r.oneOfType([r.oneOf(["fullWidth", "inset", "middle"]), r.string])
302
- });
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 = {
304
- dialog: H,
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) => {
319
- const {
320
- photoSources: t,
321
- errors: o = [],
322
- onCloseDialogHandler: p,
323
- onClearErrors: g,
324
- locale: i = S
325
- } = e;
326
- return /* @__PURE__ */ h(y, { children: [
327
- /* @__PURE__ */ s(I, { className: c(d.title), children: t.length ? f[i]["some-not-uploaded"] : f[i]["not-uploaded"] }),
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: [
331
- /* @__PURE__ */ s("span", { className: c(d.fileName), children: n }),
332
- " ",
333
- ` ${L} ${l}`
334
- ] })
335
- ] }, a)) }),
336
- /* @__PURE__ */ h(W, { className: c(d.botActions), children: [
337
- /* @__PURE__ */ s(
338
- x,
339
- {
340
- buttonSize: "small",
341
- buttonColor: "red",
342
- buttonVariant: "outlined",
343
- buttonWeight: 500,
344
- onClick: p,
345
- className: c(d.button),
346
- children: f[i].close
347
- }
348
- ),
349
- !!t.length && /* @__PURE__ */ s(
350
- x,
351
- {
352
- buttonSize: "small",
353
- buttonColor: "blue",
354
- buttonVariant: "outlined",
355
- buttonWeight: 500,
356
- onClick: g,
357
- className: c(d.button),
358
- children: f[i].continue
359
- }
360
- )
361
- ] })
362
- ] });
363
- };
364
- export {
365
- ht as U,
366
- d as s
367
- };
@@ -1,5 +0,0 @@
1
- import * as e from "react";
2
- const f = typeof window < "u" ? e.useLayoutEffect : e.useEffect;
3
- export {
4
- f as u
5
- };
@@ -1,21 +0,0 @@
1
- import * as u from "react";
2
- let n = 0;
3
- function o(t) {
4
- const [e, a] = u.useState(t), c = t || e;
5
- return u.useEffect(() => {
6
- e == null && (n += 1, a(`mui-${n}`));
7
- }, [e]), c;
8
- }
9
- const f = {
10
- ...u
11
- }, s = f.useId;
12
- function l(t) {
13
- if (s !== void 0) {
14
- const e = s();
15
- return t ?? e;
16
- }
17
- return o(t);
18
- }
19
- export {
20
- l as u
21
- };