@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,273 @@
1
+ import * as O from "react";
2
+ import { g as N, a as j, c as R, b as l, P as e } from "./createTheme-RvzX1VSA.js";
3
+ import { m as g, c as U } from "./createSimplePaletteValueFilter-nb0wSOzC.js";
4
+ import { jsx as y, jsxs as E } from "react/jsx-runtime";
5
+ import { u as I, s as p, c as z, a as w, k as T, b as F } from "./chainPropTypes-KIxDwPzf.js";
6
+ function V(r) {
7
+ return N("MuiCircularProgress", r);
8
+ }
9
+ j("MuiCircularProgress", ["root", "determinate", "indeterminate", "colorPrimary", "colorSecondary", "svg", "track", "circle", "circleDeterminate", "circleIndeterminate", "circleDisableShrink"]);
10
+ const a = 44, k = T`
11
+ 0% {
12
+ transform: rotate(0deg);
13
+ }
14
+
15
+ 100% {
16
+ transform: rotate(360deg);
17
+ }
18
+ `, v = T`
19
+ 0% {
20
+ stroke-dasharray: 1px, 200px;
21
+ stroke-dashoffset: 0;
22
+ }
23
+
24
+ 50% {
25
+ stroke-dasharray: 100px, 200px;
26
+ stroke-dashoffset: -15px;
27
+ }
28
+
29
+ 100% {
30
+ stroke-dasharray: 1px, 200px;
31
+ stroke-dashoffset: -126px;
32
+ }
33
+ `, A = typeof k != "string" ? w`
34
+ animation: ${k} 1.4s linear infinite;
35
+ ` : null, K = typeof v != "string" ? w`
36
+ animation: ${v} 1.4s ease-in-out infinite;
37
+ ` : null, W = (r) => {
38
+ const {
39
+ classes: t,
40
+ variant: s,
41
+ color: n,
42
+ disableShrink: m
43
+ } = r, u = {
44
+ root: ["root", s, `color${l(n)}`],
45
+ svg: ["svg"],
46
+ track: ["track"],
47
+ circle: ["circle", `circle${l(s)}`, m && "circleDisableShrink"]
48
+ };
49
+ return z(u, V, t);
50
+ }, B = p("span", {
51
+ name: "MuiCircularProgress",
52
+ slot: "Root",
53
+ overridesResolver: (r, t) => {
54
+ const {
55
+ ownerState: s
56
+ } = r;
57
+ return [t.root, t[s.variant], t[`color${l(s.color)}`]];
58
+ }
59
+ })(g(({
60
+ theme: r
61
+ }) => ({
62
+ display: "inline-block",
63
+ variants: [{
64
+ props: {
65
+ variant: "determinate"
66
+ },
67
+ style: {
68
+ transition: r.transitions.create("transform")
69
+ }
70
+ }, {
71
+ props: {
72
+ variant: "indeterminate"
73
+ },
74
+ style: A || {
75
+ animation: `${k} 1.4s linear infinite`
76
+ }
77
+ }, ...Object.entries(r.palette).filter(U()).map(([t]) => ({
78
+ props: {
79
+ color: t
80
+ },
81
+ style: {
82
+ color: (r.vars || r).palette[t].main
83
+ }
84
+ }))]
85
+ }))), G = p("svg", {
86
+ name: "MuiCircularProgress",
87
+ slot: "Svg"
88
+ })({
89
+ display: "block"
90
+ // Keeps the progress centered
91
+ }), Y = p("circle", {
92
+ name: "MuiCircularProgress",
93
+ slot: "Circle",
94
+ overridesResolver: (r, t) => {
95
+ const {
96
+ ownerState: s
97
+ } = r;
98
+ return [t.circle, t[`circle${l(s.variant)}`], s.disableShrink && t.circleDisableShrink];
99
+ }
100
+ })(g(({
101
+ theme: r
102
+ }) => ({
103
+ stroke: "currentColor",
104
+ variants: [{
105
+ props: {
106
+ variant: "determinate"
107
+ },
108
+ style: {
109
+ transition: r.transitions.create("stroke-dashoffset")
110
+ }
111
+ }, {
112
+ props: {
113
+ variant: "indeterminate"
114
+ },
115
+ style: {
116
+ // Some default value that looks fine waiting for the animation to kicks in.
117
+ strokeDasharray: "80px, 200px",
118
+ strokeDashoffset: 0
119
+ // Add the unit to fix a Edge 16 and below bug.
120
+ }
121
+ }, {
122
+ props: ({
123
+ ownerState: t
124
+ }) => t.variant === "indeterminate" && !t.disableShrink,
125
+ style: K || {
126
+ // At runtime for Pigment CSS, `bufferAnimation` will be null and the generated keyframe will be used.
127
+ animation: `${v} 1.4s ease-in-out infinite`
128
+ }
129
+ }]
130
+ }))), Z = p("circle", {
131
+ name: "MuiCircularProgress",
132
+ slot: "Track"
133
+ })(g(({
134
+ theme: r
135
+ }) => ({
136
+ stroke: "currentColor",
137
+ opacity: (r.vars || r).palette.action.activatedOpacity
138
+ }))), _ = /* @__PURE__ */ O.forwardRef(function(t, s) {
139
+ const n = I({
140
+ props: t,
141
+ name: "MuiCircularProgress"
142
+ }), {
143
+ className: m,
144
+ color: u = "primary",
145
+ disableShrink: $ = !1,
146
+ enableTrackSlot: b = !1,
147
+ size: f = 40,
148
+ style: D,
149
+ thickness: o = 3.6,
150
+ value: d = 0,
151
+ variant: S = "indeterminate",
152
+ ...M
153
+ } = n, i = {
154
+ ...n,
155
+ color: u,
156
+ disableShrink: $,
157
+ size: f,
158
+ thickness: o,
159
+ value: d,
160
+ variant: S,
161
+ enableTrackSlot: b
162
+ }, c = W(i), h = {}, C = {}, P = {};
163
+ if (S === "determinate") {
164
+ const x = 2 * Math.PI * ((a - o) / 2);
165
+ h.strokeDasharray = x.toFixed(3), P["aria-valuenow"] = Math.round(d), h.strokeDashoffset = `${((100 - d) / 100 * x).toFixed(3)}px`, C.transform = "rotate(-90deg)";
166
+ }
167
+ return /* @__PURE__ */ y(B, {
168
+ className: R(c.root, m),
169
+ style: {
170
+ width: f,
171
+ height: f,
172
+ ...C,
173
+ ...D
174
+ },
175
+ ownerState: i,
176
+ ref: s,
177
+ role: "progressbar",
178
+ ...P,
179
+ ...M,
180
+ children: /* @__PURE__ */ E(G, {
181
+ className: c.svg,
182
+ ownerState: i,
183
+ viewBox: `${a / 2} ${a / 2} ${a} ${a}`,
184
+ children: [b ? /* @__PURE__ */ y(Z, {
185
+ className: c.track,
186
+ ownerState: i,
187
+ cx: a,
188
+ cy: a,
189
+ r: (a - o) / 2,
190
+ fill: "none",
191
+ strokeWidth: o,
192
+ "aria-hidden": "true"
193
+ }) : null, /* @__PURE__ */ y(Y, {
194
+ className: c.circle,
195
+ style: h,
196
+ ownerState: i,
197
+ cx: a,
198
+ cy: a,
199
+ r: (a - o) / 2,
200
+ fill: "none",
201
+ strokeWidth: o
202
+ })]
203
+ })
204
+ });
205
+ });
206
+ process.env.NODE_ENV !== "production" && (_.propTypes = {
207
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
208
+ // │ These PropTypes are generated from the TypeScript type definitions. │
209
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
210
+ // └─────────────────────────────────────────────────────────────────────┘
211
+ /**
212
+ * Override or extend the styles applied to the component.
213
+ */
214
+ classes: e.object,
215
+ /**
216
+ * @ignore
217
+ */
218
+ className: e.string,
219
+ /**
220
+ * The color of the component.
221
+ * It supports both default and custom theme colors, which can be added as shown in the
222
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
223
+ * @default 'primary'
224
+ */
225
+ color: e.oneOfType([e.oneOf(["inherit", "primary", "secondary", "error", "info", "success", "warning"]), e.string]),
226
+ /**
227
+ * If `true`, the shrink animation is disabled.
228
+ * This only works if variant is `indeterminate`.
229
+ * @default false
230
+ */
231
+ disableShrink: F(e.bool, (r) => r.disableShrink && r.variant && r.variant !== "indeterminate" ? new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect.") : null),
232
+ /**
233
+ * If `true`, a track circle slot is mounted to show a subtle background for the progress.
234
+ * The `size` and `thickness` apply to the track slot to be consistent with the progress circle.
235
+ * @default false
236
+ */
237
+ enableTrackSlot: e.bool,
238
+ /**
239
+ * The size of the component.
240
+ * If using a number, the pixel unit is assumed.
241
+ * If using a string, you need to provide the CSS unit, for example '3rem'.
242
+ * @default 40
243
+ */
244
+ size: e.oneOfType([e.number, e.string]),
245
+ /**
246
+ * @ignore
247
+ */
248
+ style: e.object,
249
+ /**
250
+ * The system prop that allows defining system overrides as well as additional CSS styles.
251
+ */
252
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
253
+ /**
254
+ * The thickness of the circle.
255
+ * @default 3.6
256
+ */
257
+ thickness: e.number,
258
+ /**
259
+ * The value of the progress indicator for the determinate variant.
260
+ * Value between 0 and 100.
261
+ * @default 0
262
+ */
263
+ value: e.number,
264
+ /**
265
+ * The variant to use.
266
+ * Use indeterminate when there is no progress value.
267
+ * @default 'indeterminate'
268
+ */
269
+ variant: e.oneOf(["determinate", "indeterminate"])
270
+ });
271
+ export {
272
+ _ as C
273
+ };