@hai-dev/ui-kit 1.0.5 → 1.0.7

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 (55) hide show
  1. package/dist/Box-D8oKffw9.js +57 -0
  2. package/dist/{Button-DDlVTM6i.js → Button-BBF8hp7e.js} +30 -27
  3. package/dist/ButtonBase-T2KH9jsD.js +966 -0
  4. package/dist/CircularProgress-BQQkuSse.js +273 -0
  5. package/dist/{DialogTitle-KN1sayHD.js → Dialog-B97c7WYP.js} +910 -1401
  6. package/dist/DialogTitle-Du4tqTs0.js +254 -0
  7. package/dist/Typography-r_TXEM1e.js +257 -0
  8. package/dist/assets/circular-progress-loader.css +1 -0
  9. package/dist/assets/upload-dialog-errors.css +1 -0
  10. package/dist/assets/upload-dialog.css +1 -1
  11. package/dist/chainPropTypes-KIxDwPzf.js +387 -0
  12. package/dist/components/button/button.js +1 -1
  13. package/dist/components/circular-progress-loader/circular-progress-loader.d.ts +3 -0
  14. package/dist/components/circular-progress-loader/circular-progress-loader.js +44 -0
  15. package/dist/components/circular-progress-loader/circular-progress-loader.stories.d.ts +7 -0
  16. package/dist/components/circular-progress-loader/constants.d.ts +2 -0
  17. package/dist/components/circular-progress-loader/constants.js +5 -0
  18. package/dist/components/circular-progress-loader/index.d.ts +1 -0
  19. package/dist/components/circular-progress-loader/index.js +4 -0
  20. package/dist/components/circular-progress-loader/types.d.ts +6 -0
  21. package/dist/components/circular-progress-loader/types.js +1 -0
  22. package/dist/components/index.d.ts +1 -0
  23. package/dist/components/index.js +6 -4
  24. package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +41 -39
  25. package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +22 -73
  26. package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +17 -17
  27. package/dist/components/photo-crop-uploader/components/upload-dialog/types.d.ts +12 -1
  28. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.d.ts +3 -0
  29. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.js +10 -0
  30. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +152 -127
  31. package/dist/components/photo-crop-uploader/constants.d.ts +3 -0
  32. package/dist/components/photo-crop-uploader/constants.js +35 -32
  33. package/dist/components/photo-crop-uploader/locale.js +8 -2
  34. package/dist/components/photo-crop-uploader/photo-crop-uploader.js +169 -145
  35. package/dist/components/photo-crop-uploader/types.d.ts +4 -0
  36. package/dist/constants.d.ts +2 -0
  37. package/dist/constants.js +3 -1
  38. package/dist/createSimplePaletteValueFilter-nb0wSOzC.js +30 -0
  39. package/dist/{createTheme-DSHGFfg6.js → createTheme-RvzX1VSA.js} +4 -4
  40. package/dist/decorators/centered-decorator.d.ts +3 -0
  41. package/dist/decorators/centered-decorator.js +16 -0
  42. package/dist/decorators/index.d.ts +1 -0
  43. package/dist/decorators/index.js +4 -0
  44. package/dist/decorators/types.d.ts +4 -0
  45. package/dist/decorators/types.js +1 -0
  46. package/dist/extendSxProp-BW9e6LtL.js +36 -0
  47. package/dist/index.d.ts +1 -1
  48. package/dist/index.js +16 -14
  49. package/dist/upload-dialog-errors-ku54UrUb.js +365 -0
  50. package/dist/useId-CK6Kn3Tn.js +21 -0
  51. package/dist/useTheme-CsjkCBFJ.js +16 -0
  52. package/package.json +8 -8
  53. package/dist/ButtonBase-CXGZ-DBC.js +0 -1346
  54. package/dist/CircularProgress-CscJm1An.js +0 -291
  55. package/dist/extendSxProp-CzeED7BH.js +0 -49
@@ -0,0 +1,254 @@
1
+ import * as p from "react";
2
+ import { g as d, a as g, c as u, P as o } from "./createTheme-RvzX1VSA.js";
3
+ import { jsx as f } from "react/jsx-runtime";
4
+ import { u as m, s as D, c as v } from "./chainPropTypes-KIxDwPzf.js";
5
+ import { m as b } from "./createSimplePaletteValueFilter-nb0wSOzC.js";
6
+ import { T as x } from "./Typography-r_TXEM1e.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 v({
19
+ root: ["root", !e && "spacing"]
20
+ }, C, s);
21
+ }, O = D("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 v({
105
+ root: ["root", e && "dividers"]
106
+ }, w, s);
107
+ }, h = D("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 v({
194
+ root: ["root"]
195
+ }, M, s);
196
+ }, U = D(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
+ };
@@ -0,0 +1,257 @@
1
+ import * as O from "react";
2
+ import { g as j, a as S, c as B, b as c, P as e } from "./createTheme-RvzX1VSA.js";
3
+ import { jsx as P } from "react/jsx-runtime";
4
+ import { e as w } from "./extendSxProp-BW9e6LtL.js";
5
+ import { m as C, c as W } from "./createSimplePaletteValueFilter-nb0wSOzC.js";
6
+ import { u as M, s as R, c as N } from "./chainPropTypes-KIxDwPzf.js";
7
+ function D() {
8
+ return w;
9
+ }
10
+ function U(o) {
11
+ return j("MuiTypography", o);
12
+ }
13
+ S("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
14
+ const $ = {
15
+ primary: !0,
16
+ secondary: !0,
17
+ error: !0,
18
+ info: !0,
19
+ success: !0,
20
+ warning: !0,
21
+ textPrimary: !0,
22
+ textSecondary: !0,
23
+ textDisabled: !0
24
+ }, A = D(), E = (o) => {
25
+ const {
26
+ align: t,
27
+ gutterBottom: r,
28
+ noWrap: a,
29
+ paragraph: p,
30
+ variant: s,
31
+ classes: i
32
+ } = o, n = {
33
+ root: ["root", s, o.align !== "inherit" && `align${c(t)}`, r && "gutterBottom", a && "noWrap", p && "paragraph"]
34
+ };
35
+ return N(n, U, i);
36
+ }, V = R("span", {
37
+ name: "MuiTypography",
38
+ slot: "Root",
39
+ overridesResolver: (o, t) => {
40
+ const {
41
+ ownerState: r
42
+ } = o;
43
+ return [t.root, r.variant && t[r.variant], r.align !== "inherit" && t[`align${c(r.align)}`], r.noWrap && t.noWrap, r.gutterBottom && t.gutterBottom, r.paragraph && t.paragraph];
44
+ }
45
+ })(C(({
46
+ theme: o
47
+ }) => ({
48
+ margin: 0,
49
+ variants: [{
50
+ props: {
51
+ variant: "inherit"
52
+ },
53
+ style: {
54
+ // Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
55
+ font: "inherit",
56
+ lineHeight: "inherit",
57
+ letterSpacing: "inherit"
58
+ }
59
+ }, ...Object.entries(o.typography).filter(([t, r]) => t !== "inherit" && r && typeof r == "object").map(([t, r]) => ({
60
+ props: {
61
+ variant: t
62
+ },
63
+ style: r
64
+ })), ...Object.entries(o.palette).filter(W()).map(([t]) => ({
65
+ props: {
66
+ color: t
67
+ },
68
+ style: {
69
+ color: (o.vars || o).palette[t].main
70
+ }
71
+ })), ...Object.entries(o.palette?.text || {}).filter(([, t]) => typeof t == "string").map(([t]) => ({
72
+ props: {
73
+ color: `text${c(t)}`
74
+ },
75
+ style: {
76
+ color: (o.vars || o).palette.text[t]
77
+ }
78
+ })), {
79
+ props: ({
80
+ ownerState: t
81
+ }) => t.align !== "inherit",
82
+ style: {
83
+ textAlign: "var(--Typography-textAlign)"
84
+ }
85
+ }, {
86
+ props: ({
87
+ ownerState: t
88
+ }) => t.noWrap,
89
+ style: {
90
+ overflow: "hidden",
91
+ textOverflow: "ellipsis",
92
+ whiteSpace: "nowrap"
93
+ }
94
+ }, {
95
+ props: ({
96
+ ownerState: t
97
+ }) => t.gutterBottom,
98
+ style: {
99
+ marginBottom: "0.35em"
100
+ }
101
+ }, {
102
+ props: ({
103
+ ownerState: t
104
+ }) => t.paragraph,
105
+ style: {
106
+ marginBottom: 16
107
+ }
108
+ }]
109
+ }))), b = {
110
+ h1: "h1",
111
+ h2: "h2",
112
+ h3: "h3",
113
+ h4: "h4",
114
+ h5: "h5",
115
+ h6: "h6",
116
+ subtitle1: "h6",
117
+ subtitle2: "h6",
118
+ body1: "p",
119
+ body2: "p",
120
+ inherit: "p"
121
+ }, _ = /* @__PURE__ */ O.forwardRef(function(t, r) {
122
+ const {
123
+ color: a,
124
+ ...p
125
+ } = M({
126
+ props: t,
127
+ name: "MuiTypography"
128
+ }), s = !$[a], i = A({
129
+ ...p,
130
+ ...s && {
131
+ color: a
132
+ }
133
+ }), {
134
+ align: n = "inherit",
135
+ className: g,
136
+ component: h,
137
+ gutterBottom: d = !1,
138
+ noWrap: x = !1,
139
+ paragraph: y = !1,
140
+ variant: l = "body1",
141
+ variantMapping: u = b,
142
+ ...m
143
+ } = i, f = {
144
+ ...i,
145
+ align: n,
146
+ color: a,
147
+ className: g,
148
+ component: h,
149
+ gutterBottom: d,
150
+ noWrap: x,
151
+ paragraph: y,
152
+ variant: l,
153
+ variantMapping: u
154
+ }, v = h || (y ? "p" : u[l] || b[l]) || "span", T = E(f);
155
+ return /* @__PURE__ */ P(V, {
156
+ as: v,
157
+ ref: r,
158
+ className: B(T.root, g),
159
+ ...m,
160
+ ownerState: f,
161
+ style: {
162
+ ...n !== "inherit" && {
163
+ "--Typography-textAlign": n
164
+ },
165
+ ...m.style
166
+ }
167
+ });
168
+ });
169
+ process.env.NODE_ENV !== "production" && (_.propTypes = {
170
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
171
+ // │ These PropTypes are generated from the TypeScript type definitions. │
172
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
173
+ // └─────────────────────────────────────────────────────────────────────┘
174
+ /**
175
+ * Set the text-align on the component.
176
+ * @default 'inherit'
177
+ */
178
+ align: e.oneOf(["center", "inherit", "justify", "left", "right"]),
179
+ /**
180
+ * The content of the component.
181
+ */
182
+ children: e.node,
183
+ /**
184
+ * Override or extend the styles applied to the component.
185
+ */
186
+ classes: e.object,
187
+ /**
188
+ * @ignore
189
+ */
190
+ className: e.string,
191
+ /**
192
+ * The color of the component.
193
+ * It supports both default and custom theme colors, which can be added as shown in the
194
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
195
+ */
196
+ color: e.oneOfType([e.oneOf(["primary", "secondary", "success", "error", "info", "warning", "textPrimary", "textSecondary", "textDisabled"]), e.string]),
197
+ /**
198
+ * The component used for the root node.
199
+ * Either a string to use a HTML element or a component.
200
+ */
201
+ component: e.elementType,
202
+ /**
203
+ * If `true`, the text will have a bottom margin.
204
+ * @default false
205
+ */
206
+ gutterBottom: e.bool,
207
+ /**
208
+ * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
209
+ *
210
+ * Note that text overflow can only happen with block or inline-block level elements
211
+ * (the element needs to have a width in order to overflow).
212
+ * @default false
213
+ */
214
+ noWrap: e.bool,
215
+ /**
216
+ * If `true`, the element will be a paragraph element.
217
+ * @default false
218
+ * @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.
219
+ */
220
+ paragraph: e.bool,
221
+ /**
222
+ * @ignore
223
+ */
224
+ style: e.object,
225
+ /**
226
+ * The system prop that allows defining system overrides as well as additional CSS styles.
227
+ */
228
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
229
+ /**
230
+ * Applies the theme typography styles.
231
+ * @default 'body1'
232
+ */
233
+ variant: e.oneOfType([e.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2"]), e.string]),
234
+ /**
235
+ * The component maps the variant prop to a range of different HTML element types.
236
+ * For instance, subtitle1 to `<h6>`.
237
+ * If you wish to change that mapping, you can provide your own.
238
+ * Alternatively, you can use the `component` prop.
239
+ * @default {
240
+ * h1: 'h1',
241
+ * h2: 'h2',
242
+ * h3: 'h3',
243
+ * h4: 'h4',
244
+ * h5: 'h5',
245
+ * h6: 'h6',
246
+ * subtitle1: 'h6',
247
+ * subtitle2: 'h6',
248
+ * body1: 'p',
249
+ * body2: 'p',
250
+ * inherit: 'p',
251
+ * }
252
+ */
253
+ variantMapping: e.object
254
+ });
255
+ export {
256
+ _ as T
257
+ };