@hai-dev/ui-kit 1.2.1 → 1.2.3

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/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 +129 -912
  12. package/dist/components/code-input/constants.d.ts +1 -0
  13. package/dist/components/code-input/constants.js +9 -8
  14. package/dist/components/code-input/types.d.ts +1 -0
  15. package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +46 -94
  16. package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +38 -120
  17. package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +16 -16
  18. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.js +4 -4
  19. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +113 -404
  20. package/dist/components/photo-crop-uploader/constants.d.ts +2 -2
  21. package/dist/components/photo-crop-uploader/constants.js +1 -1
  22. package/dist/components/photo-crop-uploader/errors/photo-size.error.d.ts +1 -1
  23. package/dist/components/photo-crop-uploader/errors/photo-size.error.js +17 -12
  24. package/dist/components/photo-crop-uploader/locale.js +2 -2
  25. package/dist/components/photo-crop-uploader/photo-crop-uploader.js +45 -38
  26. package/dist/components/photo-crop-uploader/utils/draw-cropped-image.js +8 -8
  27. package/dist/components/photo-crop-uploader/utils/get-cropped-source.js +10 -10
  28. package/dist/components/photo-crop-uploader/utils/get-default-cropped-photo.js +10 -10
  29. package/dist/components/photo-crop-uploader/utils/get-photo-crop.js +18 -18
  30. package/dist/components/photo-crop-uploader/utils/read-photo.d.ts +1 -1
  31. package/dist/components/photo-crop-uploader/utils/read-photo.js +39 -39
  32. package/dist/raw-cross-BhC4FBfp.js +4 -0
  33. package/dist/upload-dialog-errors-BIwMA_MN.js +89 -0
  34. package/package.json +1 -1
  35. package/dist/Box-BgNAyP2L.js +0 -56
  36. package/dist/Button-DTV8ztWw.js +0 -660
  37. package/dist/ButtonBase-C4krg_zd.js +0 -913
  38. package/dist/CircularProgress-BoaEg4rF.js +0 -274
  39. package/dist/Dialog-BK9lMUKV.js +0 -2632
  40. package/dist/DialogTitle-ByUfLB5M.js +0 -254
  41. package/dist/Typography-BMyz0ZCh.js +0 -255
  42. package/dist/assets/inter.css +0 -1
  43. package/dist/button.module-C0UNQnBk.js +0 -40
  44. package/dist/chainPropTypes-DgqFdXGi.js +0 -532
  45. package/dist/createSimplePaletteValueFilter-B7--0ryQ.js +0 -17
  46. package/dist/createTheme-BoOmbNvy.js +0 -4119
  47. package/dist/extendSxProp-BaUCVMKV.js +0 -50
  48. package/dist/index-CcueJ2sD.js +0 -432
  49. package/dist/index-YnD2EP-S.js +0 -43
  50. package/dist/index-h5oTv8GF.js +0 -91
  51. package/dist/isHostComponent-Dm_U9uOy.js +0 -14
  52. package/dist/memoTheme-BYBJ2Fe6.js +0 -15
  53. package/dist/refType-CsohaiiT.js +0 -60
  54. package/dist/upload-dialog-errors-BwQsTOc3.js +0 -367
  55. package/dist/useEnhancedEffect-CJGo-L3B.js +0 -5
  56. package/dist/useId-CK6Kn3Tn.js +0 -21
@@ -1,254 +0,0 @@
1
- import * as p from "react";
2
- import { g as d, a as g, c as u, P as o } from "./createTheme-BoOmbNvy.js";
3
- import { jsx as f } from "react/jsx-runtime";
4
- import { u as m, c as D, s as v } from "./chainPropTypes-DgqFdXGi.js";
5
- import { m as b } from "./memoTheme-BYBJ2Fe6.js";
6
- import { T as x } from "./Typography-BMyz0ZCh.js";
7
- const y = /* @__PURE__ */ p.createContext({});
8
- process.env.NODE_ENV !== "production" && (y.displayName = "DialogContext");
9
- function C(t) {
10
- return d("MuiDialogActions", t);
11
- }
12
- g("MuiDialogActions", ["root", "spacing"]);
13
- const N = (t) => {
14
- const {
15
- classes: s,
16
- disableSpacing: e
17
- } = t;
18
- return D({
19
- root: ["root", !e && "spacing"]
20
- }, C, s);
21
- }, O = v("div", {
22
- name: "MuiDialogActions",
23
- slot: "Root",
24
- overridesResolver: (t, s) => {
25
- const {
26
- ownerState: e
27
- } = t;
28
- return [s.root, !e.disableSpacing && s.spacing];
29
- }
30
- })({
31
- display: "flex",
32
- alignItems: "center",
33
- padding: 8,
34
- justifyContent: "flex-end",
35
- flex: "0 0 auto",
36
- variants: [{
37
- props: ({
38
- ownerState: t
39
- }) => !t.disableSpacing,
40
- style: {
41
- "& > :not(style) ~ :not(style)": {
42
- marginLeft: 8
43
- }
44
- }
45
- }]
46
- }), S = /* @__PURE__ */ p.forwardRef(function(s, e) {
47
- const i = m({
48
- props: s,
49
- name: "MuiDialogActions"
50
- }), {
51
- className: r,
52
- disableSpacing: a = !1,
53
- ...l
54
- } = i, n = {
55
- ...i,
56
- disableSpacing: a
57
- }, c = N(n);
58
- return /* @__PURE__ */ f(O, {
59
- className: u(c.root, r),
60
- ownerState: n,
61
- ref: e,
62
- ...l
63
- });
64
- });
65
- process.env.NODE_ENV !== "production" && (S.propTypes = {
66
- // ┌────────────────────────────── Warning ──────────────────────────────┐
67
- // │ These PropTypes are generated from the TypeScript type definitions. │
68
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
69
- // └─────────────────────────────────────────────────────────────────────┘
70
- /**
71
- * The content of the component.
72
- */
73
- children: o.node,
74
- /**
75
- * Override or extend the styles applied to the component.
76
- */
77
- classes: o.object,
78
- /**
79
- * @ignore
80
- */
81
- className: o.string,
82
- /**
83
- * If `true`, the actions do not have additional margin.
84
- * @default false
85
- */
86
- disableSpacing: o.bool,
87
- /**
88
- * The system prop that allows defining system overrides as well as additional CSS styles.
89
- */
90
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
91
- });
92
- function w(t) {
93
- return d("MuiDialogContent", t);
94
- }
95
- g("MuiDialogContent", ["root", "dividers"]);
96
- function M(t) {
97
- return d("MuiDialogTitle", t);
98
- }
99
- const R = g("MuiDialogTitle", ["root"]), j = (t) => {
100
- const {
101
- classes: s,
102
- dividers: e
103
- } = t;
104
- return D({
105
- root: ["root", e && "dividers"]
106
- }, w, s);
107
- }, h = v("div", {
108
- name: "MuiDialogContent",
109
- slot: "Root",
110
- overridesResolver: (t, s) => {
111
- const {
112
- ownerState: e
113
- } = t;
114
- return [s.root, e.dividers && s.dividers];
115
- }
116
- })(b(({
117
- theme: t
118
- }) => ({
119
- flex: "1 1 auto",
120
- // Add iOS momentum scrolling for iOS < 13.0
121
- WebkitOverflowScrolling: "touch",
122
- overflowY: "auto",
123
- padding: "20px 24px",
124
- variants: [{
125
- props: ({
126
- ownerState: s
127
- }) => s.dividers,
128
- style: {
129
- padding: "16px 24px",
130
- borderTop: `1px solid ${(t.vars || t).palette.divider}`,
131
- borderBottom: `1px solid ${(t.vars || t).palette.divider}`
132
- }
133
- }, {
134
- props: ({
135
- ownerState: s
136
- }) => !s.dividers,
137
- style: {
138
- [`.${R.root} + &`]: {
139
- paddingTop: 0
140
- }
141
- }
142
- }]
143
- }))), A = /* @__PURE__ */ p.forwardRef(function(s, e) {
144
- const i = m({
145
- props: s,
146
- name: "MuiDialogContent"
147
- }), {
148
- className: r,
149
- dividers: a = !1,
150
- ...l
151
- } = i, n = {
152
- ...i,
153
- dividers: a
154
- }, c = j(n);
155
- return /* @__PURE__ */ f(h, {
156
- className: u(c.root, r),
157
- ownerState: n,
158
- ref: e,
159
- ...l
160
- });
161
- });
162
- process.env.NODE_ENV !== "production" && (A.propTypes = {
163
- // ┌────────────────────────────── Warning ──────────────────────────────┐
164
- // │ These PropTypes are generated from the TypeScript type definitions. │
165
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
166
- // └─────────────────────────────────────────────────────────────────────┘
167
- /**
168
- * The content of the component.
169
- */
170
- children: o.node,
171
- /**
172
- * Override or extend the styles applied to the component.
173
- */
174
- classes: o.object,
175
- /**
176
- * @ignore
177
- */
178
- className: o.string,
179
- /**
180
- * Display the top and bottom dividers.
181
- * @default false
182
- */
183
- dividers: o.bool,
184
- /**
185
- * The system prop that allows defining system overrides as well as additional CSS styles.
186
- */
187
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
188
- });
189
- const E = (t) => {
190
- const {
191
- classes: s
192
- } = t;
193
- return D({
194
- root: ["root"]
195
- }, M, s);
196
- }, U = v(x, {
197
- name: "MuiDialogTitle",
198
- slot: "Root"
199
- })({
200
- padding: "16px 24px",
201
- flex: "0 0 auto"
202
- }), $ = /* @__PURE__ */ p.forwardRef(function(s, e) {
203
- const i = m({
204
- props: s,
205
- name: "MuiDialogTitle"
206
- }), {
207
- className: r,
208
- id: a,
209
- ...l
210
- } = i, n = i, c = E(n), {
211
- titleId: T = a
212
- } = p.useContext(y);
213
- return /* @__PURE__ */ f(U, {
214
- component: "h2",
215
- className: u(c.root, r),
216
- ownerState: n,
217
- ref: e,
218
- variant: "h6",
219
- id: a ?? T,
220
- ...l
221
- });
222
- });
223
- process.env.NODE_ENV !== "production" && ($.propTypes = {
224
- // ┌────────────────────────────── Warning ──────────────────────────────┐
225
- // │ These PropTypes are generated from the TypeScript type definitions. │
226
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
227
- // └─────────────────────────────────────────────────────────────────────┘
228
- /**
229
- * The content of the component.
230
- */
231
- children: o.node,
232
- /**
233
- * Override or extend the styles applied to the component.
234
- */
235
- classes: o.object,
236
- /**
237
- * @ignore
238
- */
239
- className: o.string,
240
- /**
241
- * @ignore
242
- */
243
- id: o.string,
244
- /**
245
- * The system prop that allows defining system overrides as well as additional CSS styles.
246
- */
247
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
248
- });
249
- export {
250
- $ as D,
251
- A as a,
252
- S as b,
253
- y as c
254
- };
@@ -1,255 +0,0 @@
1
- import * as O from "react";
2
- import { g as j, a as B, c as S, b as c, P as r } from "./createTheme-BoOmbNvy.js";
3
- import { i as w } from "./index-h5oTv8GF.js";
4
- import { m as C } from "./memoTheme-BYBJ2Fe6.js";
5
- import { c as P } from "./createSimplePaletteValueFilter-B7--0ryQ.js";
6
- import { jsx as W } from "react/jsx-runtime";
7
- import { u as M, c as R, s as N } from "./chainPropTypes-DgqFdXGi.js";
8
- function D(o) {
9
- return j("MuiTypography", o);
10
- }
11
- B("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
12
- const U = {
13
- primary: !0,
14
- secondary: !0,
15
- error: !0,
16
- info: !0,
17
- success: !0,
18
- warning: !0,
19
- textPrimary: !0,
20
- textSecondary: !0,
21
- textDisabled: !0
22
- }, A = w(), E = (o) => {
23
- const {
24
- align: t,
25
- gutterBottom: e,
26
- noWrap: a,
27
- paragraph: p,
28
- variant: s,
29
- classes: i
30
- } = o, n = {
31
- root: ["root", s, o.align !== "inherit" && `align${c(t)}`, e && "gutterBottom", a && "noWrap", p && "paragraph"]
32
- };
33
- return R(n, D, i);
34
- }, V = N("span", {
35
- name: "MuiTypography",
36
- slot: "Root",
37
- overridesResolver: (o, t) => {
38
- const {
39
- ownerState: e
40
- } = o;
41
- return [t.root, e.variant && t[e.variant], e.align !== "inherit" && t[`align${c(e.align)}`], e.noWrap && t.noWrap, e.gutterBottom && t.gutterBottom, e.paragraph && t.paragraph];
42
- }
43
- })(C(({
44
- theme: o
45
- }) => ({
46
- margin: 0,
47
- variants: [{
48
- props: {
49
- variant: "inherit"
50
- },
51
- style: {
52
- // Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
53
- font: "inherit",
54
- lineHeight: "inherit",
55
- letterSpacing: "inherit"
56
- }
57
- }, ...Object.entries(o.typography).filter(([t, e]) => t !== "inherit" && e && typeof e == "object").map(([t, e]) => ({
58
- props: {
59
- variant: t
60
- },
61
- style: e
62
- })), ...Object.entries(o.palette).filter(P()).map(([t]) => ({
63
- props: {
64
- color: t
65
- },
66
- style: {
67
- color: (o.vars || o).palette[t].main
68
- }
69
- })), ...Object.entries(o.palette?.text || {}).filter(([, t]) => typeof t == "string").map(([t]) => ({
70
- props: {
71
- color: `text${c(t)}`
72
- },
73
- style: {
74
- color: (o.vars || o).palette.text[t]
75
- }
76
- })), {
77
- props: ({
78
- ownerState: t
79
- }) => t.align !== "inherit",
80
- style: {
81
- textAlign: "var(--Typography-textAlign)"
82
- }
83
- }, {
84
- props: ({
85
- ownerState: t
86
- }) => t.noWrap,
87
- style: {
88
- overflow: "hidden",
89
- textOverflow: "ellipsis",
90
- whiteSpace: "nowrap"
91
- }
92
- }, {
93
- props: ({
94
- ownerState: t
95
- }) => t.gutterBottom,
96
- style: {
97
- marginBottom: "0.35em"
98
- }
99
- }, {
100
- props: ({
101
- ownerState: t
102
- }) => t.paragraph,
103
- style: {
104
- marginBottom: 16
105
- }
106
- }]
107
- }))), b = {
108
- h1: "h1",
109
- h2: "h2",
110
- h3: "h3",
111
- h4: "h4",
112
- h5: "h5",
113
- h6: "h6",
114
- subtitle1: "h6",
115
- subtitle2: "h6",
116
- body1: "p",
117
- body2: "p",
118
- inherit: "p"
119
- }, $ = /* @__PURE__ */ O.forwardRef(function(t, e) {
120
- const {
121
- color: a,
122
- ...p
123
- } = M({
124
- props: t,
125
- name: "MuiTypography"
126
- }), s = !U[a], i = A({
127
- ...p,
128
- ...s && {
129
- color: a
130
- }
131
- }), {
132
- align: n = "inherit",
133
- className: g,
134
- component: h,
135
- gutterBottom: d = !1,
136
- noWrap: x = !1,
137
- paragraph: y = !1,
138
- variant: l = "body1",
139
- variantMapping: u = b,
140
- ...m
141
- } = i, f = {
142
- ...i,
143
- align: n,
144
- color: a,
145
- className: g,
146
- component: h,
147
- gutterBottom: d,
148
- noWrap: x,
149
- paragraph: y,
150
- variant: l,
151
- variantMapping: u
152
- }, v = h || (y ? "p" : u[l] || b[l]) || "span", T = E(f);
153
- return /* @__PURE__ */ W(V, {
154
- as: v,
155
- ref: e,
156
- className: S(T.root, g),
157
- ...m,
158
- ownerState: f,
159
- style: {
160
- ...n !== "inherit" && {
161
- "--Typography-textAlign": n
162
- },
163
- ...m.style
164
- }
165
- });
166
- });
167
- process.env.NODE_ENV !== "production" && ($.propTypes = {
168
- // ┌────────────────────────────── Warning ──────────────────────────────┐
169
- // │ These PropTypes are generated from the TypeScript type definitions. │
170
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
171
- // └─────────────────────────────────────────────────────────────────────┘
172
- /**
173
- * Set the text-align on the component.
174
- * @default 'inherit'
175
- */
176
- align: r.oneOf(["center", "inherit", "justify", "left", "right"]),
177
- /**
178
- * The content of the component.
179
- */
180
- children: r.node,
181
- /**
182
- * Override or extend the styles applied to the component.
183
- */
184
- classes: r.object,
185
- /**
186
- * @ignore
187
- */
188
- className: r.string,
189
- /**
190
- * The color of the component.
191
- * It supports both default and custom theme colors, which can be added as shown in the
192
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
193
- */
194
- color: r.oneOfType([r.oneOf(["primary", "secondary", "success", "error", "info", "warning", "textPrimary", "textSecondary", "textDisabled"]), r.string]),
195
- /**
196
- * The component used for the root node.
197
- * Either a string to use a HTML element or a component.
198
- */
199
- component: r.elementType,
200
- /**
201
- * If `true`, the text will have a bottom margin.
202
- * @default false
203
- */
204
- gutterBottom: r.bool,
205
- /**
206
- * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
207
- *
208
- * Note that text overflow can only happen with block or inline-block level elements
209
- * (the element needs to have a width in order to overflow).
210
- * @default false
211
- */
212
- noWrap: r.bool,
213
- /**
214
- * If `true`, the element will be a paragraph element.
215
- * @default false
216
- * @deprecated Use the `component` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
217
- */
218
- paragraph: r.bool,
219
- /**
220
- * @ignore
221
- */
222
- style: r.object,
223
- /**
224
- * The system prop that allows defining system overrides as well as additional CSS styles.
225
- */
226
- sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
227
- /**
228
- * Applies the theme typography styles.
229
- * @default 'body1'
230
- */
231
- variant: r.oneOfType([r.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2"]), r.string]),
232
- /**
233
- * The component maps the variant prop to a range of different HTML element types.
234
- * For instance, subtitle1 to `<h6>`.
235
- * If you wish to change that mapping, you can provide your own.
236
- * Alternatively, you can use the `component` prop.
237
- * @default {
238
- * h1: 'h1',
239
- * h2: 'h2',
240
- * h3: 'h3',
241
- * h4: 'h4',
242
- * h5: 'h5',
243
- * h6: 'h6',
244
- * subtitle1: 'h6',
245
- * subtitle2: 'h6',
246
- * body1: 'p',
247
- * body2: 'p',
248
- * inherit: 'p',
249
- * }
250
- */
251
- variantMapping: r.object
252
- });
253
- export {
254
- $ as T
255
- };