@hai-dev/ui-kit 1.0.5 → 1.0.6

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 (39) hide show
  1. package/dist/Box-CiYPzbPd.js +56 -0
  2. package/dist/{Button-DDlVTM6i.js → Button-chJUX25I.js} +26 -24
  3. package/dist/ButtonBase-DZwhOh56.js +966 -0
  4. package/dist/{CircularProgress-CscJm1An.js → CircularProgress-BCrSQadM.js} +113 -105
  5. package/dist/{DialogTitle-KN1sayHD.js → DialogTitle-BUcXvkzd.js} +638 -884
  6. package/dist/Typography-BmYEfS8y.js +257 -0
  7. package/dist/assets/circular-progress-loader.css +1 -0
  8. package/dist/chainPropTypes-HYSaT0L0.js +387 -0
  9. package/dist/components/button/button.js +1 -1
  10. package/dist/components/circular-progress-loader/circular-progress-loader.d.ts +3 -0
  11. package/dist/components/circular-progress-loader/circular-progress-loader.js +44 -0
  12. package/dist/components/circular-progress-loader/circular-progress-loader.stories.d.ts +7 -0
  13. package/dist/components/circular-progress-loader/constants.d.ts +2 -0
  14. package/dist/components/circular-progress-loader/constants.js +5 -0
  15. package/dist/components/circular-progress-loader/index.d.ts +1 -0
  16. package/dist/components/circular-progress-loader/index.js +4 -0
  17. package/dist/components/circular-progress-loader/types.d.ts +6 -0
  18. package/dist/components/circular-progress-loader/types.js +1 -0
  19. package/dist/components/index.d.ts +1 -0
  20. package/dist/components/index.js +6 -4
  21. package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +30 -29
  22. package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +22 -73
  23. package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +1 -1
  24. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +13 -11
  25. package/dist/constants.d.ts +1 -0
  26. package/dist/constants.js +2 -1
  27. package/dist/{createTheme-DSHGFfg6.js → createTheme-BfVKUMHQ.js} +10 -10
  28. package/dist/decorators/centered-decorator.d.ts +3 -0
  29. package/dist/decorators/centered-decorator.js +16 -0
  30. package/dist/decorators/index.d.ts +1 -0
  31. package/dist/decorators/index.js +4 -0
  32. package/dist/decorators/types.d.ts +4 -0
  33. package/dist/decorators/types.js +1 -0
  34. package/dist/{extendSxProp-CzeED7BH.js → extendSxProp-bpz0eCso.js} +3 -3
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.js +16 -14
  37. package/dist/useId-CK6Kn3Tn.js +21 -0
  38. package/package.json +8 -8
  39. package/dist/ButtonBase-CXGZ-DBC.js +0 -1346
@@ -1,54 +1,37 @@
1
- import * as u from "react";
2
- import { g as N, a as U, b as E, e as f, P as t } from "./createTheme-DSHGFfg6.js";
3
- import { p as V, u as j, s as k, c as z, d as D, k as I, b as F } from "./ButtonBase-CXGZ-DBC.js";
4
- import { jsx as y } from "react/jsx-runtime";
5
- let x = 0;
6
- function A(e) {
7
- const [r, s] = u.useState(e), o = e || r;
8
- return u.useEffect(() => {
9
- r == null && (x += 1, s(`mui-${x}`));
10
- }, [r]), o;
11
- }
12
- const G = {
13
- ...u
14
- }, w = G.useId;
15
- function se(e) {
16
- if (w !== void 0) {
17
- const r = w();
18
- return e ?? r;
19
- }
20
- return A(e);
21
- }
22
- const $ = {
1
+ import * as N from "react";
2
+ import { d as R, g as j, c as U, e as f, P as t } from "./createTheme-BfVKUMHQ.js";
3
+ import { p as V, u as z, s as m, c as E, b as T, k as $, d as I } from "./chainPropTypes-HYSaT0L0.js";
4
+ import { jsx as y, jsxs as F } from "react/jsx-runtime";
5
+ const w = {
23
6
  theme: void 0
24
7
  };
25
- function K(e) {
26
- let r, s;
8
+ function A(e) {
9
+ let r, a;
27
10
  return function(i) {
28
- let a = r;
29
- return (a === void 0 || i.theme !== s) && ($.theme = i.theme, a = V(e($)), r = a, s = i.theme), a;
11
+ let o = r;
12
+ return (o === void 0 || i.theme !== a) && (w.theme = i.theme, o = V(e(w)), r = o, a = i.theme), o;
30
13
  };
31
14
  }
32
- const M = K;
33
- function _(e) {
15
+ const v = A;
16
+ function K(e) {
34
17
  return typeof e.main == "string";
35
18
  }
36
- function B(e, r = []) {
37
- if (!_(e))
19
+ function W(e, r = []) {
20
+ if (!K(e))
38
21
  return !1;
39
- for (const s of r)
40
- if (!e.hasOwnProperty(s) || typeof e[s] != "string")
22
+ for (const a of r)
23
+ if (!e.hasOwnProperty(a) || typeof e[a] != "string")
41
24
  return !1;
42
25
  return !0;
43
26
  }
44
- function W(e = []) {
45
- return ([, r]) => r && B(r, e);
27
+ function _(e = []) {
28
+ return ([, r]) => r && W(r, e);
46
29
  }
47
- function Y(e) {
48
- return N("MuiCircularProgress", e);
30
+ function B(e) {
31
+ return R("MuiCircularProgress", e);
49
32
  }
50
- U("MuiCircularProgress", ["root", "determinate", "indeterminate", "colorPrimary", "colorSecondary", "svg", "circle", "circleDeterminate", "circleIndeterminate", "circleDisableShrink"]);
51
- const n = 44, g = I`
33
+ j("MuiCircularProgress", ["root", "determinate", "indeterminate", "colorPrimary", "colorSecondary", "svg", "track", "circle", "circleDeterminate", "circleIndeterminate", "circleDisableShrink"]);
34
+ const s = 44, k = $`
52
35
  0% {
53
36
  transform: rotate(0deg);
54
37
  }
@@ -56,7 +39,7 @@ const n = 44, g = I`
56
39
  100% {
57
40
  transform: rotate(360deg);
58
41
  }
59
- `, v = I`
42
+ `, g = $`
60
43
  0% {
61
44
  stroke-dasharray: 1px, 200px;
62
45
  stroke-dashoffset: 0;
@@ -71,32 +54,33 @@ const n = 44, g = I`
71
54
  stroke-dasharray: 1px, 200px;
72
55
  stroke-dashoffset: -126px;
73
56
  }
74
- `, Z = typeof g != "string" ? D`
75
- animation: ${g} 1.4s linear infinite;
76
- ` : null, q = typeof v != "string" ? D`
77
- animation: ${v} 1.4s ease-in-out infinite;
78
- ` : null, H = (e) => {
57
+ `, G = typeof k != "string" ? T`
58
+ animation: ${k} 1.4s linear infinite;
59
+ ` : null, Y = typeof g != "string" ? T`
60
+ animation: ${g} 1.4s ease-in-out infinite;
61
+ ` : null, Z = (e) => {
79
62
  const {
80
63
  classes: r,
81
- variant: s,
82
- color: o,
64
+ variant: a,
65
+ color: c,
83
66
  disableShrink: i
84
- } = e, a = {
85
- root: ["root", s, `color${f(o)}`],
67
+ } = e, o = {
68
+ root: ["root", a, `color${f(c)}`],
86
69
  svg: ["svg"],
87
- circle: ["circle", `circle${f(s)}`, i && "circleDisableShrink"]
70
+ track: ["track"],
71
+ circle: ["circle", `circle${f(a)}`, i && "circleDisableShrink"]
88
72
  };
89
- return z(a, Y, r);
90
- }, J = k("span", {
73
+ return E(o, B, r);
74
+ }, q = m("span", {
91
75
  name: "MuiCircularProgress",
92
76
  slot: "Root",
93
77
  overridesResolver: (e, r) => {
94
78
  const {
95
- ownerState: s
79
+ ownerState: a
96
80
  } = e;
97
- return [r.root, r[s.variant], r[`color${f(s.color)}`]];
81
+ return [r.root, r[a.variant], r[`color${f(a.color)}`]];
98
82
  }
99
- })(M(({
83
+ })(v(({
100
84
  theme: e
101
85
  }) => ({
102
86
  display: "inline-block",
@@ -111,10 +95,10 @@ const n = 44, g = I`
111
95
  props: {
112
96
  variant: "indeterminate"
113
97
  },
114
- style: Z || {
115
- animation: `${g} 1.4s linear infinite`
98
+ style: G || {
99
+ animation: `${k} 1.4s linear infinite`
116
100
  }
117
- }, ...Object.entries(e.palette).filter(W()).map(([r]) => ({
101
+ }, ...Object.entries(e.palette).filter(_()).map(([r]) => ({
118
102
  props: {
119
103
  color: r
120
104
  },
@@ -122,22 +106,22 @@ const n = 44, g = I`
122
106
  color: (e.vars || e).palette[r].main
123
107
  }
124
108
  }))]
125
- }))), L = k("svg", {
109
+ }))), H = m("svg", {
126
110
  name: "MuiCircularProgress",
127
111
  slot: "Svg"
128
112
  })({
129
113
  display: "block"
130
114
  // Keeps the progress centered
131
- }), Q = k("circle", {
115
+ }), J = m("circle", {
132
116
  name: "MuiCircularProgress",
133
117
  slot: "Circle",
134
118
  overridesResolver: (e, r) => {
135
119
  const {
136
- ownerState: s
120
+ ownerState: a
137
121
  } = e;
138
- return [r.circle, r[`circle${f(s.variant)}`], s.disableShrink && r.circleDisableShrink];
122
+ return [r.circle, r[`circle${f(a.variant)}`], a.disableShrink && r.circleDisableShrink];
139
123
  }
140
- })(M(({
124
+ })(v(({
141
125
  theme: e
142
126
  }) => ({
143
127
  stroke: "currentColor",
@@ -162,69 +146,88 @@ const n = 44, g = I`
162
146
  props: ({
163
147
  ownerState: r
164
148
  }) => r.variant === "indeterminate" && !r.disableShrink,
165
- style: q || {
149
+ style: Y || {
166
150
  // At runtime for Pigment CSS, `bufferAnimation` will be null and the generated keyframe will be used.
167
- animation: `${v} 1.4s ease-in-out infinite`
151
+ animation: `${g} 1.4s ease-in-out infinite`
168
152
  }
169
153
  }]
170
- }))), X = /* @__PURE__ */ u.forwardRef(function(r, s) {
171
- const o = j({
154
+ }))), L = m("circle", {
155
+ name: "MuiCircularProgress",
156
+ slot: "Track"
157
+ })(v(({
158
+ theme: e
159
+ }) => ({
160
+ stroke: "currentColor",
161
+ opacity: (e.vars || e).palette.action.activatedOpacity
162
+ }))), Q = /* @__PURE__ */ N.forwardRef(function(r, a) {
163
+ const c = z({
172
164
  props: r,
173
165
  name: "MuiCircularProgress"
174
166
  }), {
175
167
  className: i,
176
- color: a = "primary",
177
- disableShrink: T = !1,
178
- size: m = 40,
179
- style: R,
180
- thickness: c = 3.6,
168
+ color: o = "primary",
169
+ disableShrink: M = !1,
170
+ enableTrackSlot: S = !1,
171
+ size: p = 40,
172
+ style: D,
173
+ thickness: n = 3.6,
181
174
  value: d = 0,
182
175
  variant: b = "indeterminate",
183
176
  ...O
184
- } = o, l = {
185
- ...o,
186
- color: a,
187
- disableShrink: T,
188
- size: m,
189
- thickness: c,
177
+ } = c, l = {
178
+ ...c,
179
+ color: o,
180
+ disableShrink: M,
181
+ size: p,
182
+ thickness: n,
190
183
  value: d,
191
- variant: b
192
- }, p = H(l), h = {}, S = {}, C = {};
184
+ variant: b,
185
+ enableTrackSlot: S
186
+ }, u = Z(l), h = {}, C = {}, P = {};
193
187
  if (b === "determinate") {
194
- const P = 2 * Math.PI * ((n - c) / 2);
195
- h.strokeDasharray = P.toFixed(3), C["aria-valuenow"] = Math.round(d), h.strokeDashoffset = `${((100 - d) / 100 * P).toFixed(3)}px`, S.transform = "rotate(-90deg)";
188
+ const x = 2 * Math.PI * ((s - n) / 2);
189
+ h.strokeDasharray = x.toFixed(3), P["aria-valuenow"] = Math.round(d), h.strokeDashoffset = `${((100 - d) / 100 * x).toFixed(3)}px`, C.transform = "rotate(-90deg)";
196
190
  }
197
- return /* @__PURE__ */ y(J, {
198
- className: E(p.root, i),
191
+ return /* @__PURE__ */ y(q, {
192
+ className: U(u.root, i),
199
193
  style: {
200
- width: m,
201
- height: m,
202
- ...S,
203
- ...R
194
+ width: p,
195
+ height: p,
196
+ ...C,
197
+ ...D
204
198
  },
205
199
  ownerState: l,
206
- ref: s,
200
+ ref: a,
207
201
  role: "progressbar",
208
- ...C,
202
+ ...P,
209
203
  ...O,
210
- children: /* @__PURE__ */ y(L, {
211
- className: p.svg,
204
+ children: /* @__PURE__ */ F(H, {
205
+ className: u.svg,
212
206
  ownerState: l,
213
- viewBox: `${n / 2} ${n / 2} ${n} ${n}`,
214
- children: /* @__PURE__ */ y(Q, {
215
- className: p.circle,
207
+ viewBox: `${s / 2} ${s / 2} ${s} ${s}`,
208
+ children: [S ? /* @__PURE__ */ y(L, {
209
+ className: u.track,
210
+ ownerState: l,
211
+ cx: s,
212
+ cy: s,
213
+ r: (s - n) / 2,
214
+ fill: "none",
215
+ strokeWidth: n,
216
+ "aria-hidden": "true"
217
+ }) : null, /* @__PURE__ */ y(J, {
218
+ className: u.circle,
216
219
  style: h,
217
220
  ownerState: l,
218
- cx: n,
219
- cy: n,
220
- r: (n - c) / 2,
221
+ cx: s,
222
+ cy: s,
223
+ r: (s - n) / 2,
221
224
  fill: "none",
222
- strokeWidth: c
223
- })
225
+ strokeWidth: n
226
+ })]
224
227
  })
225
228
  });
226
229
  });
227
- process.env.NODE_ENV !== "production" && (X.propTypes = {
230
+ process.env.NODE_ENV !== "production" && (Q.propTypes = {
228
231
  // ┌────────────────────────────── Warning ──────────────────────────────┐
229
232
  // │ These PropTypes are generated from the TypeScript type definitions. │
230
233
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
@@ -249,7 +252,13 @@ process.env.NODE_ENV !== "production" && (X.propTypes = {
249
252
  * This only works if variant is `indeterminate`.
250
253
  * @default false
251
254
  */
252
- disableShrink: F(t.bool, (e) => e.disableShrink && e.variant && e.variant !== "indeterminate" ? new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect.") : null),
255
+ disableShrink: I(t.bool, (e) => e.disableShrink && e.variant && e.variant !== "indeterminate" ? new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect.") : null),
256
+ /**
257
+ * If `true`, a track circle slot is mounted to show a subtle background for the progress.
258
+ * The `size` and `thickness` apply to the track slot to be consistent with the progress circle.
259
+ * @default false
260
+ */
261
+ enableTrackSlot: t.bool,
253
262
  /**
254
263
  * The size of the component.
255
264
  * If using a number, the pixel unit is assumed.
@@ -284,8 +293,7 @@ process.env.NODE_ENV !== "production" && (X.propTypes = {
284
293
  variant: t.oneOf(["determinate", "indeterminate"])
285
294
  });
286
295
  export {
287
- X as C,
288
- W as c,
289
- M as m,
290
- se as u
296
+ Q as C,
297
+ _ as c,
298
+ v as m
291
299
  };