@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.
- package/dist/Box-CiYPzbPd.js +56 -0
- package/dist/{Button-DDlVTM6i.js → Button-chJUX25I.js} +26 -24
- package/dist/ButtonBase-DZwhOh56.js +966 -0
- package/dist/{CircularProgress-CscJm1An.js → CircularProgress-BCrSQadM.js} +113 -105
- package/dist/{DialogTitle-KN1sayHD.js → DialogTitle-BUcXvkzd.js} +638 -884
- package/dist/Typography-BmYEfS8y.js +257 -0
- package/dist/assets/circular-progress-loader.css +1 -0
- package/dist/chainPropTypes-HYSaT0L0.js +387 -0
- package/dist/components/button/button.js +1 -1
- package/dist/components/circular-progress-loader/circular-progress-loader.d.ts +3 -0
- package/dist/components/circular-progress-loader/circular-progress-loader.js +44 -0
- package/dist/components/circular-progress-loader/circular-progress-loader.stories.d.ts +7 -0
- package/dist/components/circular-progress-loader/constants.d.ts +2 -0
- package/dist/components/circular-progress-loader/constants.js +5 -0
- package/dist/components/circular-progress-loader/index.d.ts +1 -0
- package/dist/components/circular-progress-loader/index.js +4 -0
- package/dist/components/circular-progress-loader/types.d.ts +6 -0
- package/dist/components/circular-progress-loader/types.js +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +6 -4
- package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +30 -29
- package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +22 -73
- package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +1 -1
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +13 -11
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -1
- package/dist/{createTheme-DSHGFfg6.js → createTheme-BfVKUMHQ.js} +10 -10
- package/dist/decorators/centered-decorator.d.ts +3 -0
- package/dist/decorators/centered-decorator.js +16 -0
- package/dist/decorators/index.d.ts +1 -0
- package/dist/decorators/index.js +4 -0
- package/dist/decorators/types.d.ts +4 -0
- package/dist/decorators/types.js +1 -0
- package/dist/{extendSxProp-CzeED7BH.js → extendSxProp-bpz0eCso.js} +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -14
- package/dist/useId-CK6Kn3Tn.js +21 -0
- package/package.json +8 -8
- package/dist/ButtonBase-CXGZ-DBC.js +0 -1346
|
@@ -1,54 +1,37 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import { p as V, u as
|
|
4
|
-
import { jsx as y } from "react/jsx-runtime";
|
|
5
|
-
|
|
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
|
|
26
|
-
let r,
|
|
8
|
+
function A(e) {
|
|
9
|
+
let r, a;
|
|
27
10
|
return function(i) {
|
|
28
|
-
let
|
|
29
|
-
return (
|
|
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
|
|
33
|
-
function
|
|
15
|
+
const v = A;
|
|
16
|
+
function K(e) {
|
|
34
17
|
return typeof e.main == "string";
|
|
35
18
|
}
|
|
36
|
-
function
|
|
37
|
-
if (!
|
|
19
|
+
function W(e, r = []) {
|
|
20
|
+
if (!K(e))
|
|
38
21
|
return !1;
|
|
39
|
-
for (const
|
|
40
|
-
if (!e.hasOwnProperty(
|
|
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
|
|
45
|
-
return ([, r]) => r &&
|
|
27
|
+
function _(e = []) {
|
|
28
|
+
return ([, r]) => r && W(r, e);
|
|
46
29
|
}
|
|
47
|
-
function
|
|
48
|
-
return
|
|
30
|
+
function B(e) {
|
|
31
|
+
return R("MuiCircularProgress", e);
|
|
49
32
|
}
|
|
50
|
-
|
|
51
|
-
const
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
75
|
-
animation: ${
|
|
76
|
-
` : null,
|
|
77
|
-
animation: ${
|
|
78
|
-
` : null,
|
|
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:
|
|
82
|
-
color:
|
|
64
|
+
variant: a,
|
|
65
|
+
color: c,
|
|
83
66
|
disableShrink: i
|
|
84
|
-
} = e,
|
|
85
|
-
root: ["root",
|
|
67
|
+
} = e, o = {
|
|
68
|
+
root: ["root", a, `color${f(c)}`],
|
|
86
69
|
svg: ["svg"],
|
|
87
|
-
|
|
70
|
+
track: ["track"],
|
|
71
|
+
circle: ["circle", `circle${f(a)}`, i && "circleDisableShrink"]
|
|
88
72
|
};
|
|
89
|
-
return
|
|
90
|
-
},
|
|
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:
|
|
79
|
+
ownerState: a
|
|
96
80
|
} = e;
|
|
97
|
-
return [r.root, r[
|
|
81
|
+
return [r.root, r[a.variant], r[`color${f(a.color)}`]];
|
|
98
82
|
}
|
|
99
|
-
})(
|
|
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:
|
|
115
|
-
animation: `${
|
|
98
|
+
style: G || {
|
|
99
|
+
animation: `${k} 1.4s linear infinite`
|
|
116
100
|
}
|
|
117
|
-
}, ...Object.entries(e.palette).filter(
|
|
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
|
-
}))),
|
|
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
|
-
}),
|
|
115
|
+
}), J = m("circle", {
|
|
132
116
|
name: "MuiCircularProgress",
|
|
133
117
|
slot: "Circle",
|
|
134
118
|
overridesResolver: (e, r) => {
|
|
135
119
|
const {
|
|
136
|
-
ownerState:
|
|
120
|
+
ownerState: a
|
|
137
121
|
} = e;
|
|
138
|
-
return [r.circle, r[`circle${f(
|
|
122
|
+
return [r.circle, r[`circle${f(a.variant)}`], a.disableShrink && r.circleDisableShrink];
|
|
139
123
|
}
|
|
140
|
-
})(
|
|
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:
|
|
149
|
+
style: Y || {
|
|
166
150
|
// At runtime for Pigment CSS, `bufferAnimation` will be null and the generated keyframe will be used.
|
|
167
|
-
animation: `${
|
|
151
|
+
animation: `${g} 1.4s ease-in-out infinite`
|
|
168
152
|
}
|
|
169
153
|
}]
|
|
170
|
-
}))),
|
|
171
|
-
|
|
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:
|
|
177
|
-
disableShrink:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
} =
|
|
185
|
-
...
|
|
186
|
-
color:
|
|
187
|
-
disableShrink:
|
|
188
|
-
size:
|
|
189
|
-
thickness:
|
|
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
|
-
|
|
184
|
+
variant: b,
|
|
185
|
+
enableTrackSlot: S
|
|
186
|
+
}, u = Z(l), h = {}, C = {}, P = {};
|
|
193
187
|
if (b === "determinate") {
|
|
194
|
-
const
|
|
195
|
-
h.strokeDasharray =
|
|
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(
|
|
198
|
-
className:
|
|
191
|
+
return /* @__PURE__ */ y(q, {
|
|
192
|
+
className: U(u.root, i),
|
|
199
193
|
style: {
|
|
200
|
-
width:
|
|
201
|
-
height:
|
|
202
|
-
...
|
|
203
|
-
...
|
|
194
|
+
width: p,
|
|
195
|
+
height: p,
|
|
196
|
+
...C,
|
|
197
|
+
...D
|
|
204
198
|
},
|
|
205
199
|
ownerState: l,
|
|
206
|
-
ref:
|
|
200
|
+
ref: a,
|
|
207
201
|
role: "progressbar",
|
|
208
|
-
...
|
|
202
|
+
...P,
|
|
209
203
|
...O,
|
|
210
|
-
children: /* @__PURE__ */
|
|
211
|
-
className:
|
|
204
|
+
children: /* @__PURE__ */ F(H, {
|
|
205
|
+
className: u.svg,
|
|
212
206
|
ownerState: l,
|
|
213
|
-
viewBox: `${
|
|
214
|
-
children: /* @__PURE__ */ y(
|
|
215
|
-
className:
|
|
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:
|
|
219
|
-
cy:
|
|
220
|
-
r: (
|
|
221
|
+
cx: s,
|
|
222
|
+
cy: s,
|
|
223
|
+
r: (s - n) / 2,
|
|
221
224
|
fill: "none",
|
|
222
|
-
strokeWidth:
|
|
223
|
-
})
|
|
225
|
+
strokeWidth: n
|
|
226
|
+
})]
|
|
224
227
|
})
|
|
225
228
|
});
|
|
226
229
|
});
|
|
227
|
-
process.env.NODE_ENV !== "production" && (
|
|
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:
|
|
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
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
se as u
|
|
296
|
+
Q as C,
|
|
297
|
+
_ as c,
|
|
298
|
+
v as m
|
|
291
299
|
};
|