@fangzsx/component-library 0.0.9 → 0.0.11
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.
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { ErrorOutline as C, CheckCircle as f, InfoOutlineRounded as g, WarningAmberRounded as x } from "@mui/icons-material";
|
|
3
|
+
import { Card as m, Box as e, Typography as t } from "@mui/material";
|
|
3
4
|
import { c as o } from "../../colors-BYtTt7gN.js";
|
|
4
|
-
const
|
|
5
|
-
warning: { titleColor: o.warning800, bgColor: o.warning50 },
|
|
6
|
-
info: { titleColor: o.primary800, bgColor: o.primary50 },
|
|
7
|
-
success: { titleColor: o.secondary800, bgColor: o.secondary50 },
|
|
8
|
-
error: { titleColor: o.destructive800, bgColor: o.destructive50 }
|
|
5
|
+
const b = {
|
|
6
|
+
warning: { titleColor: o.warning800, bgColor: o.warning50, icon: x, iconColor: "#f59e0b" },
|
|
7
|
+
info: { titleColor: o.primary800, bgColor: o.primary50, icon: g, iconColor: "#f59e0b" },
|
|
8
|
+
success: { titleColor: o.secondary800, bgColor: o.secondary50, icon: f, iconColor: "#10b981" },
|
|
9
|
+
error: { titleColor: o.destructive800, bgColor: o.destructive50, icon: C, iconColor: "#ef4444" }
|
|
9
10
|
};
|
|
10
|
-
function
|
|
11
|
-
const { type:
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
|
|
11
|
+
function I(c) {
|
|
12
|
+
const { type: l, title: s, description: d, withIcon: a } = c, r = b[l], p = r.icon;
|
|
13
|
+
return /* @__PURE__ */ n(
|
|
14
|
+
m,
|
|
14
15
|
{
|
|
15
16
|
sx: {
|
|
16
17
|
display: "flex",
|
|
17
|
-
backgroundColor:
|
|
18
|
+
backgroundColor: r.bgColor,
|
|
18
19
|
borderRadius: "5px",
|
|
19
20
|
py: 1.5,
|
|
20
21
|
px: 2,
|
|
21
22
|
boxShadow: 2
|
|
22
23
|
},
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
24
|
+
children: /* @__PURE__ */ i(e, { display: "flex", alignItems: "center", justifyContent: "center", gap: 2, children: [
|
|
25
|
+
a && /* @__PURE__ */ n(p, { sx: { color: r.iconColor, fontSize: "24px", display: { xs: "none", md: "block" } } }),
|
|
26
|
+
/* @__PURE__ */ i(e, { children: [
|
|
27
|
+
/* @__PURE__ */ n(t, { sx: { fontWeight: 700, fontSize: 16, color: r.titleColor, mb: 0.5 }, children: s }),
|
|
28
|
+
/* @__PURE__ */ n(t, { sx: { color: o.grey800, fontSize: "13px" }, children: d })
|
|
29
|
+
] })
|
|
30
|
+
] })
|
|
27
31
|
}
|
|
28
32
|
);
|
|
29
33
|
}
|
|
30
34
|
export {
|
|
31
|
-
|
|
35
|
+
I as FlatBanner
|
|
32
36
|
};
|
|
@@ -5,6 +5,7 @@ interface MediaCardWithActionProps {
|
|
|
5
5
|
description: string;
|
|
6
6
|
buttonLabel: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
action: () => void;
|
|
8
9
|
}
|
|
9
|
-
export declare function MediaCardWithAction({ image, imageAlt, title, description, buttonLabel, disabled }: MediaCardWithActionProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function MediaCardWithAction({ image, imageAlt, title, description, buttonLabel, disabled, action, }: MediaCardWithActionProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as p, jsxs as N } from "react/jsx-runtime";
|
|
2
|
-
import { B as
|
|
2
|
+
import { B as I } from "../../index-DGepNtNg.js";
|
|
3
3
|
import * as f from "react";
|
|
4
4
|
import { n as D, o as _, g as m, a as y, u as h, s as C, c as b, d as x, P as t, i as R, b as T, m as $, j as V } from "../../ButtonBase-CAtBagnK.js";
|
|
5
5
|
import { P as z } from "../../Paper-CAUsv8qs.js";
|
|
@@ -19,11 +19,11 @@ function H(o) {
|
|
|
19
19
|
...n
|
|
20
20
|
} = o, {
|
|
21
21
|
systemProps: r,
|
|
22
|
-
otherProps:
|
|
22
|
+
otherProps: c
|
|
23
23
|
} = F(n);
|
|
24
24
|
let a;
|
|
25
|
-
return Array.isArray(e) ? a = [r, ...e] : typeof e == "function" ? a = (...
|
|
26
|
-
const s = e(...
|
|
25
|
+
return Array.isArray(e) ? a = [r, ...e] : typeof e == "function" ? a = (...i) => {
|
|
26
|
+
const s = e(...i);
|
|
27
27
|
return D(s) ? {
|
|
28
28
|
...r,
|
|
29
29
|
...s
|
|
@@ -32,7 +32,7 @@ function H(o) {
|
|
|
32
32
|
...r,
|
|
33
33
|
...e
|
|
34
34
|
}, {
|
|
35
|
-
...
|
|
35
|
+
...c,
|
|
36
36
|
sx: a
|
|
37
37
|
};
|
|
38
38
|
}
|
|
@@ -60,19 +60,19 @@ const J = (o) => {
|
|
|
60
60
|
props: e,
|
|
61
61
|
name: "MuiCard"
|
|
62
62
|
}), {
|
|
63
|
-
className:
|
|
63
|
+
className: c,
|
|
64
64
|
raised: a = !1,
|
|
65
|
-
...
|
|
65
|
+
...i
|
|
66
66
|
} = r, s = {
|
|
67
67
|
...r,
|
|
68
68
|
raised: a
|
|
69
69
|
}, l = J(s);
|
|
70
70
|
return /* @__PURE__ */ p(q, {
|
|
71
|
-
className: b(l.root,
|
|
71
|
+
className: b(l.root, c),
|
|
72
72
|
elevation: a ? 8 : void 0,
|
|
73
73
|
ref: n,
|
|
74
74
|
ownerState: s,
|
|
75
|
-
...
|
|
75
|
+
...i
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
process.env.NODE_ENV !== "production" && (A.propTypes = {
|
|
@@ -142,18 +142,18 @@ const Q = (o) => {
|
|
|
142
142
|
props: e,
|
|
143
143
|
name: "MuiCardActions"
|
|
144
144
|
}), {
|
|
145
|
-
disableSpacing:
|
|
145
|
+
disableSpacing: c = !1,
|
|
146
146
|
className: a,
|
|
147
|
-
...
|
|
147
|
+
...i
|
|
148
148
|
} = r, s = {
|
|
149
149
|
...r,
|
|
150
|
-
disableSpacing:
|
|
150
|
+
disableSpacing: c
|
|
151
151
|
}, l = Q(s);
|
|
152
152
|
return /* @__PURE__ */ p(X, {
|
|
153
153
|
className: b(l.root, a),
|
|
154
154
|
ownerState: s,
|
|
155
155
|
ref: n,
|
|
156
|
-
...
|
|
156
|
+
...i
|
|
157
157
|
});
|
|
158
158
|
});
|
|
159
159
|
process.env.NODE_ENV !== "production" && (E.propTypes = {
|
|
@@ -207,19 +207,19 @@ const Z = (o) => {
|
|
|
207
207
|
props: e,
|
|
208
208
|
name: "MuiCardContent"
|
|
209
209
|
}), {
|
|
210
|
-
className:
|
|
210
|
+
className: c,
|
|
211
211
|
component: a = "div",
|
|
212
|
-
...
|
|
212
|
+
...i
|
|
213
213
|
} = r, s = {
|
|
214
214
|
...r,
|
|
215
215
|
component: a
|
|
216
216
|
}, l = Z(s);
|
|
217
217
|
return /* @__PURE__ */ p(tt, {
|
|
218
218
|
as: a,
|
|
219
|
-
className: b(l.root,
|
|
219
|
+
className: b(l.root, c),
|
|
220
220
|
ownerState: s,
|
|
221
221
|
ref: n,
|
|
222
|
-
...
|
|
222
|
+
...i
|
|
223
223
|
});
|
|
224
224
|
});
|
|
225
225
|
process.env.NODE_ENV !== "production" && (B.propTypes = {
|
|
@@ -270,9 +270,9 @@ const ot = (o) => {
|
|
|
270
270
|
ownerState: n
|
|
271
271
|
} = o, {
|
|
272
272
|
isMediaComponent: r,
|
|
273
|
-
isImageComponent:
|
|
273
|
+
isImageComponent: c
|
|
274
274
|
} = n;
|
|
275
|
-
return [e.root, r && e.media,
|
|
275
|
+
return [e.root, r && e.media, c && e.img];
|
|
276
276
|
}
|
|
277
277
|
})({
|
|
278
278
|
display: "block",
|
|
@@ -299,32 +299,32 @@ const ot = (o) => {
|
|
|
299
299
|
props: e,
|
|
300
300
|
name: "MuiCardMedia"
|
|
301
301
|
}), {
|
|
302
|
-
children:
|
|
302
|
+
children: c,
|
|
303
303
|
className: a,
|
|
304
|
-
component:
|
|
304
|
+
component: i = "div",
|
|
305
305
|
image: s,
|
|
306
306
|
src: l,
|
|
307
307
|
style: g,
|
|
308
308
|
...O
|
|
309
|
-
} = r, d = rt.includes(
|
|
309
|
+
} = r, d = rt.includes(i), v = !d && s ? {
|
|
310
310
|
backgroundImage: `url("${s}")`,
|
|
311
311
|
...g
|
|
312
312
|
} : g, u = {
|
|
313
313
|
...r,
|
|
314
|
-
component:
|
|
314
|
+
component: i,
|
|
315
315
|
isMediaComponent: d,
|
|
316
|
-
isImageComponent: st.includes(
|
|
316
|
+
isImageComponent: st.includes(i)
|
|
317
317
|
}, M = ot(u);
|
|
318
318
|
return /* @__PURE__ */ p(nt, {
|
|
319
319
|
className: b(M.root, a),
|
|
320
|
-
as:
|
|
320
|
+
as: i,
|
|
321
321
|
role: !d && s ? "img" : void 0,
|
|
322
322
|
ref: n,
|
|
323
323
|
style: v,
|
|
324
324
|
ownerState: u,
|
|
325
325
|
src: d ? s || l : void 0,
|
|
326
326
|
...O,
|
|
327
|
-
children:
|
|
327
|
+
children: c
|
|
328
328
|
});
|
|
329
329
|
});
|
|
330
330
|
process.env.NODE_ENV !== "production" && (U.propTypes = {
|
|
@@ -389,13 +389,13 @@ const it = {
|
|
|
389
389
|
align: e,
|
|
390
390
|
gutterBottom: n,
|
|
391
391
|
noWrap: r,
|
|
392
|
-
paragraph:
|
|
392
|
+
paragraph: c,
|
|
393
393
|
variant: a,
|
|
394
|
-
classes:
|
|
394
|
+
classes: i
|
|
395
395
|
} = o, s = {
|
|
396
|
-
root: ["root", a, o.align !== "inherit" && `align${T(e)}`, n && "gutterBottom", r && "noWrap",
|
|
396
|
+
root: ["root", a, o.align !== "inherit" && `align${T(e)}`, n && "gutterBottom", r && "noWrap", c && "paragraph"]
|
|
397
397
|
};
|
|
398
|
-
return x(s, at,
|
|
398
|
+
return x(s, at, i);
|
|
399
399
|
}, pt = C("span", {
|
|
400
400
|
name: "MuiTypography",
|
|
401
401
|
slot: "Root",
|
|
@@ -484,12 +484,12 @@ const it = {
|
|
|
484
484
|
}, S = /* @__PURE__ */ f.forwardRef(function(e, n) {
|
|
485
485
|
const {
|
|
486
486
|
color: r,
|
|
487
|
-
...
|
|
487
|
+
...c
|
|
488
488
|
} = h({
|
|
489
489
|
props: e,
|
|
490
490
|
name: "MuiTypography"
|
|
491
|
-
}), a = !it[r],
|
|
492
|
-
...
|
|
491
|
+
}), a = !it[r], i = ct({
|
|
492
|
+
...c,
|
|
493
493
|
...a && {
|
|
494
494
|
color: r
|
|
495
495
|
}
|
|
@@ -503,8 +503,8 @@ const it = {
|
|
|
503
503
|
variant: u = "body1",
|
|
504
504
|
variantMapping: M = P,
|
|
505
505
|
...j
|
|
506
|
-
} =
|
|
507
|
-
...
|
|
506
|
+
} = i, w = {
|
|
507
|
+
...i,
|
|
508
508
|
align: s,
|
|
509
509
|
color: r,
|
|
510
510
|
className: l,
|
|
@@ -514,11 +514,11 @@ const it = {
|
|
|
514
514
|
paragraph: v,
|
|
515
515
|
variant: u,
|
|
516
516
|
variantMapping: M
|
|
517
|
-
}, W = g || (v ? "p" : M[u] || P[u]) || "span",
|
|
517
|
+
}, W = g || (v ? "p" : M[u] || P[u]) || "span", k = lt(w);
|
|
518
518
|
return /* @__PURE__ */ p(pt, {
|
|
519
519
|
as: W,
|
|
520
520
|
ref: n,
|
|
521
|
-
className: b(
|
|
521
|
+
className: b(k.root, l),
|
|
522
522
|
...j,
|
|
523
523
|
ownerState: w,
|
|
524
524
|
style: {
|
|
@@ -620,8 +620,9 @@ function yt({
|
|
|
620
620
|
imageAlt: e = "Card image",
|
|
621
621
|
title: n,
|
|
622
622
|
description: r,
|
|
623
|
-
buttonLabel:
|
|
624
|
-
disabled: a
|
|
623
|
+
buttonLabel: c,
|
|
624
|
+
disabled: a,
|
|
625
|
+
action: i
|
|
625
626
|
}) {
|
|
626
627
|
return /* @__PURE__ */ N(A, { sx: { px: 4, py: 3, flex: 1 }, children: [
|
|
627
628
|
/* @__PURE__ */ p(
|
|
@@ -642,7 +643,7 @@ function yt({
|
|
|
642
643
|
/* @__PURE__ */ p(S, { gutterBottom: !0, variant: "h5", component: "div", sx: { textAlign: "left", fontWeight: 700 }, children: n }),
|
|
643
644
|
/* @__PURE__ */ p(S, { variant: "body2", sx: { color: "text.secondary", textAlign: "left" }, children: r })
|
|
644
645
|
] }),
|
|
645
|
-
/* @__PURE__ */ p(E, { sx: { padding: 0, pt: "24px", justifyContent: "flex-start" }, children: /* @__PURE__ */ p(
|
|
646
|
+
/* @__PURE__ */ p(E, { sx: { padding: 0, pt: "24px", justifyContent: "flex-start" }, children: /* @__PURE__ */ p(I, { size: "small", sx: { width: "100%", fontWeight: 600 }, disabled: a, onClick: i, children: c }) })
|
|
646
647
|
] });
|
|
647
648
|
}
|
|
648
649
|
export {
|