@fangzsx/component-library 0.0.39 → 0.0.41
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/colors-BVcu3WVm.js +24 -0
- package/dist/components/AppBarPublic/index.js +1 -1
- package/dist/components/Banner/index.js +1 -1
- package/dist/components/Button/index.js +2 -2
- package/dist/components/CollapsibleSection/index.d.ts +32 -0
- package/dist/components/CollapsibleSection/index.js +90 -0
- package/dist/components/Dropdown/index.js +1 -1
- package/dist/components/FlatBanner/index.js +1 -1
- package/dist/components/ImageUpload/index.js +5 -5
- package/dist/components/MediaCardWithAction/index.js +1 -1
- package/dist/components/PromoCode/index.js +1 -1
- package/dist/{index-CdcRS0lC.js → index-D9x5yU0s.js} +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.js +31 -29
- package/package.json +1 -1
- package/dist/colors-CyChpKWu.js +0 -23
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const c = "#1D252D", n = "#404A58", s = "#566376", t = "#8996A9", o = "#C4CBD4", r = "#E6EAED", e = "#F4F7F9", E = "#053E72", F = "#0B6B9F", y = "#27A4E8", a = "#C8EDFE", i = "#E6F6FF", g = "#055C56", p = "#E6FEEE", m = "#8E3007", C = "#FFF9F0", D = "#800711", d = "#FFECEB", A = "#fff", B = {
|
|
2
|
+
grey800: c,
|
|
3
|
+
grey700: n,
|
|
4
|
+
grey600: s,
|
|
5
|
+
grey400: t,
|
|
6
|
+
grey200: o,
|
|
7
|
+
grey100: r,
|
|
8
|
+
grey50: e,
|
|
9
|
+
primary800: E,
|
|
10
|
+
primary700: F,
|
|
11
|
+
primary500: y,
|
|
12
|
+
primary100: a,
|
|
13
|
+
primary50: i,
|
|
14
|
+
secondary800: g,
|
|
15
|
+
secondary50: p,
|
|
16
|
+
warning800: m,
|
|
17
|
+
warning50: C,
|
|
18
|
+
destructive800: D,
|
|
19
|
+
destructive50: d,
|
|
20
|
+
white: A
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
B as c
|
|
24
|
+
};
|
|
@@ -3,7 +3,7 @@ import { c as E } from "../../createSvgIcon-C0YrvByi.js";
|
|
|
3
3
|
import { Stack as w, Popper as $, ClickAwayListener as D, Paper as U } from "@mui/material";
|
|
4
4
|
import * as C from "react";
|
|
5
5
|
import { useState as Z } from "react";
|
|
6
|
-
import { C as G, B as b } from "../../index-
|
|
6
|
+
import { C as G, B as b } from "../../index-D9x5yU0s.js";
|
|
7
7
|
import { g as V, a as A, c as l, P as r } from "../../generateUtilityClasses-BCID9NF1.js";
|
|
8
8
|
import { u as H, s as B, c as T, a as h, m as v } from "../../DefaultPropsProvider-DVX_ssOt.js";
|
|
9
9
|
import { c as I, a as F } from "../../useTimeout-UzNJH-cm.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { ErrorOutline as d, CheckCircle as a, InfoOutlined as m, WarningAmber as h } from "@mui/icons-material";
|
|
3
3
|
import { Card as g, Box as c, Typography as e } from "@mui/material";
|
|
4
|
-
import { c as n } from "../../colors-
|
|
4
|
+
import { c as n } from "../../colors-BVcu3WVm.js";
|
|
5
5
|
const y = {
|
|
6
6
|
warning: { icon: h, color: "#f59e0b" },
|
|
7
7
|
info: { icon: m, color: n.primary500 },
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface SectionAction {
|
|
4
|
+
/** Icon element to render */
|
|
5
|
+
icon: ReactNode;
|
|
6
|
+
/** Click handler */
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
/** Accessible label for the button */
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
/** Disable the action button */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface CollapsibleSectionProps {
|
|
14
|
+
title: string;
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
defaultExpanded?: boolean;
|
|
17
|
+
expanded?: boolean;
|
|
18
|
+
onChange?: (expanded: boolean) => void;
|
|
19
|
+
/** Optional icon displayed before the title */
|
|
20
|
+
icon?: ReactNode;
|
|
21
|
+
/** One or more action buttons rendered on the right side of the header */
|
|
22
|
+
actions?: SectionAction[];
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
sx?: object;
|
|
25
|
+
}
|
|
26
|
+
export interface LabelValueProps {
|
|
27
|
+
label: string;
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
gutterBottom?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare function LabelValue({ label, children, gutterBottom }: LabelValueProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function CollapsibleSection({ title, children, defaultExpanded, expanded: controlledExpanded, onChange, icon, actions, disabled, sx, }: CollapsibleSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as I } from "react";
|
|
3
|
+
import { Accordion as A, AccordionSummary as S, Box as d, Typography as s, IconButton as M, AccordionDetails as j } from "@mui/material";
|
|
4
|
+
import { c as k } from "../../createSvgIcon-C0YrvByi.js";
|
|
5
|
+
const w = k(/* @__PURE__ */ e("path", {
|
|
6
|
+
d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
7
|
+
}), "ExpandMore");
|
|
8
|
+
function L({ label: i, children: t, gutterBottom: a = !0 }) {
|
|
9
|
+
return /* @__PURE__ */ r(d, { sx: { mb: a ? 2.5 : 0 }, children: [
|
|
10
|
+
/* @__PURE__ */ e(s, { variant: "body2", fontWeight: 600, gutterBottom: !0, children: i }),
|
|
11
|
+
typeof t == "string" ? /* @__PURE__ */ e(s, { variant: "body2", color: "text.secondary", children: t }) : t
|
|
12
|
+
] });
|
|
13
|
+
}
|
|
14
|
+
function W({
|
|
15
|
+
title: i,
|
|
16
|
+
children: t,
|
|
17
|
+
defaultExpanded: a = !1,
|
|
18
|
+
expanded: c,
|
|
19
|
+
onChange: f,
|
|
20
|
+
icon: x,
|
|
21
|
+
actions: l,
|
|
22
|
+
disabled: m = !1,
|
|
23
|
+
sx: u
|
|
24
|
+
}) {
|
|
25
|
+
const [b, g] = I(a), p = c !== void 0, h = p ? c : b;
|
|
26
|
+
function y(n, o) {
|
|
27
|
+
p || g(o), f?.(o);
|
|
28
|
+
}
|
|
29
|
+
function v(n, o) {
|
|
30
|
+
n.stopPropagation(), o.onClick();
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ r(
|
|
33
|
+
A,
|
|
34
|
+
{
|
|
35
|
+
expanded: h,
|
|
36
|
+
onChange: y,
|
|
37
|
+
disabled: m,
|
|
38
|
+
disableGutters: !0,
|
|
39
|
+
elevation: 0,
|
|
40
|
+
sx: {
|
|
41
|
+
border: "1px solid",
|
|
42
|
+
borderColor: "divider",
|
|
43
|
+
borderRadius: 2,
|
|
44
|
+
"&::before": { display: "none" },
|
|
45
|
+
overflow: "hidden",
|
|
46
|
+
...u
|
|
47
|
+
},
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ r(
|
|
50
|
+
S,
|
|
51
|
+
{
|
|
52
|
+
expandIcon: /* @__PURE__ */ e(w, {}),
|
|
53
|
+
sx: {
|
|
54
|
+
flexDirection: "row-reverse",
|
|
55
|
+
gap: 1,
|
|
56
|
+
"& .MuiAccordionSummary-content": {
|
|
57
|
+
display: "flex",
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
justifyContent: "space-between",
|
|
60
|
+
my: 1
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ r(d, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
65
|
+
x,
|
|
66
|
+
/* @__PURE__ */ e(s, { variant: "subtitle1", fontWeight: 500, children: i })
|
|
67
|
+
] }),
|
|
68
|
+
l && l.length > 0 && /* @__PURE__ */ e(d, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: l.map((n, o) => /* @__PURE__ */ e(
|
|
69
|
+
M,
|
|
70
|
+
{
|
|
71
|
+
size: "small",
|
|
72
|
+
disabled: n.disabled,
|
|
73
|
+
onClick: (C) => v(C, n),
|
|
74
|
+
"aria-label": n.ariaLabel ?? `Action ${o + 1}`,
|
|
75
|
+
children: n.icon
|
|
76
|
+
},
|
|
77
|
+
o
|
|
78
|
+
)) })
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ e(j, { sx: { pt: 0, px: 4, pb: 3 }, children: t })
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
W as CollapsibleSection,
|
|
89
|
+
L as LabelValue
|
|
90
|
+
};
|
|
@@ -2,7 +2,7 @@ import { jsxs as d, jsx as r, Fragment as y } from "react/jsx-runtime";
|
|
|
2
2
|
import { ExpandMoreOutlined as C } from "@mui/icons-material";
|
|
3
3
|
import { Box as I, IconButton as v, Menu as M, MenuItem as k, ListItemIcon as w, ListItemText as j } from "@mui/material";
|
|
4
4
|
import { useState as B } from "react";
|
|
5
|
-
import { c as t } from "../../colors-
|
|
5
|
+
import { c as t } from "../../colors-BVcu3WVm.js";
|
|
6
6
|
function L({
|
|
7
7
|
items: h,
|
|
8
8
|
activeItemId: e,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { ErrorOutline as C, CheckCircle as f, InfoOutlineRounded as g, WarningAmberRounded as x } from "@mui/icons-material";
|
|
3
3
|
import { Card as m, Box as e, Typography as t } from "@mui/material";
|
|
4
|
-
import { c as o } from "../../colors-
|
|
4
|
+
import { c as o } from "../../colors-BVcu3WVm.js";
|
|
5
5
|
const b = {
|
|
6
6
|
warning: { titleColor: o.warning800, bgColor: o.warning50, icon: x, iconColor: "#f59e0b" },
|
|
7
7
|
info: { titleColor: o.primary800, bgColor: o.primary50, icon: g, iconColor: "#f59e0b" },
|
|
@@ -3,7 +3,7 @@ import { C as M } from "../../Close-pjIlDyCW.js";
|
|
|
3
3
|
import { c as P } from "../../createSvgIcon-C0YrvByi.js";
|
|
4
4
|
import { FormControl as T, FormLabel as U, Box as l, Stack as V, Typography as a, IconButton as E, FormHelperText as q } from "@mui/material";
|
|
5
5
|
import { useState as y, useRef as G, useCallback as J } from "react";
|
|
6
|
-
import { c as e } from "../../colors-
|
|
6
|
+
import { c as e } from "../../colors-BVcu3WVm.js";
|
|
7
7
|
const K = P(/* @__PURE__ */ o("path", {
|
|
8
8
|
d: "M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-4.86 8.86-3 3.87L9 13.14 6 17h12z"
|
|
9
9
|
}), "ImageOutlined");
|
|
@@ -25,7 +25,7 @@ function or({
|
|
|
25
25
|
disabled: n = !1,
|
|
26
26
|
onChange: p
|
|
27
27
|
}) {
|
|
28
|
-
const [k, h] = y(!1), [u,
|
|
28
|
+
const [k, h] = y(!1), [u, w] = y(null), [R, D] = y(""), d = G(null), C = m * 1024 * 1024, S = s.map((r) => `.${r}`).join(","), j = s.map(
|
|
29
29
|
(r) => `image/${r === "jpg" ? "jpeg" : r}`
|
|
30
30
|
), I = J(
|
|
31
31
|
function(r) {
|
|
@@ -40,7 +40,7 @@ function or({
|
|
|
40
40
|
}
|
|
41
41
|
const O = new FileReader();
|
|
42
42
|
O.onload = function(g) {
|
|
43
|
-
|
|
43
|
+
w(g.target?.result), D(r.name), p?.(r, "");
|
|
44
44
|
}, O.readAsDataURL(r);
|
|
45
45
|
},
|
|
46
46
|
[j, C, m, s, p]
|
|
@@ -61,7 +61,7 @@ function or({
|
|
|
61
61
|
I(r.target.files?.[0] ?? null);
|
|
62
62
|
}
|
|
63
63
|
function B(r) {
|
|
64
|
-
r.stopPropagation(),
|
|
64
|
+
r.stopPropagation(), w(null), D(""), p?.(null, ""), d.current && (d.current.value = "");
|
|
65
65
|
}
|
|
66
66
|
const f = !!v || x && !u, $ = v || (x && !u ? `${i} can't be empty` : ""), { baseName: A, extension: H } = Q(R);
|
|
67
67
|
return /* @__PURE__ */ t(T, { fullWidth: !0, error: f, disabled: n, children: [
|
|
@@ -96,7 +96,7 @@ function or({
|
|
|
96
96
|
p: u ? 1.5 : 4,
|
|
97
97
|
textAlign: "center",
|
|
98
98
|
cursor: n ? "default" : "pointer",
|
|
99
|
-
bgcolor: n ? "action.disabledBackground" : k ? e.primary500 : e.
|
|
99
|
+
bgcolor: n ? "action.disabledBackground" : k ? e.primary500 : e.white,
|
|
100
100
|
transition: "all 0.2s ease",
|
|
101
101
|
opacity: n ? 0.6 : 1,
|
|
102
102
|
"&:hover": n ? {} : {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as d, jsxs as x } from "react/jsx-runtime";
|
|
2
|
-
import { B as A } from "../../index-
|
|
2
|
+
import { B as A } from "../../index-D9x5yU0s.js";
|
|
3
3
|
import * as u from "react";
|
|
4
4
|
import { g as m, a as f, P as e } from "../../generateUtilityClasses-BCID9NF1.js";
|
|
5
5
|
import { u as C, s as g, c as y, a as b } from "../../DefaultPropsProvider-DVX_ssOt.js";
|
|
@@ -2,7 +2,7 @@ import { jsxs as B, jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { Close as D, LocalOffer as I } from "@mui/icons-material";
|
|
3
3
|
import { Box as c, Chip as S, IconButton as A, Typography as h, TextField as R, InputAdornment as T, CircularProgress as W, Button as k } from "@mui/material";
|
|
4
4
|
import { useState as w, useRef as O, useEffect as P, useCallback as n } from "react";
|
|
5
|
-
import { c as r } from "../../colors-
|
|
5
|
+
import { c as r } from "../../colors-BVcu3WVm.js";
|
|
6
6
|
function K({
|
|
7
7
|
value: e,
|
|
8
8
|
onChange: d,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as c, jsxs as U } from "react/jsx-runtime";
|
|
2
|
-
import { c as P } from "./colors-
|
|
2
|
+
import { c as P } from "./colors-BVcu3WVm.js";
|
|
3
3
|
import * as k from "react";
|
|
4
4
|
import { g as G, a as _, c as i, P as t } from "./generateUtilityClasses-BCID9NF1.js";
|
|
5
5
|
import { u as A, s as f, c as R, a as H, m as O, b as so, r as lo } from "./DefaultPropsProvider-DVX_ssOt.js";
|
package/dist/main.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { AppBarPublic } from './components/AppBarPublic';
|
|
|
2
2
|
export { Banner } from './components/Banner';
|
|
3
3
|
export { Button } from './components/Button';
|
|
4
4
|
export { CheckBox } from './components/Checkbox';
|
|
5
|
+
export { CollapsibleSection } from './components/CollapsibleSection';
|
|
5
6
|
export { ScrollableDialog as Dialog } from './components/Dialog';
|
|
6
7
|
export { CheckboxGroup } from './components/CheckboxGroup';
|
|
7
8
|
export { Dropdown } from './components/Dropdown';
|
package/dist/main.js
CHANGED
|
@@ -1,40 +1,42 @@
|
|
|
1
1
|
import { AppBarPublic as e } from "./components/AppBarPublic/index.js";
|
|
2
2
|
import { Banner as p } from "./components/Banner/index.js";
|
|
3
|
-
import { B as m } from "./index-
|
|
3
|
+
import { B as m } from "./index-D9x5yU0s.js";
|
|
4
4
|
import { CheckBox as a } from "./components/Checkbox/index.js";
|
|
5
|
+
import { CollapsibleSection as l } from "./components/CollapsibleSection/index.js";
|
|
5
6
|
import { ScrollableDialog as d } from "./components/Dialog/index.js";
|
|
6
|
-
import { CheckboxGroup as
|
|
7
|
-
import { Dropdown as
|
|
8
|
-
import { DropdownOptions as
|
|
9
|
-
import { FlatBanner as
|
|
10
|
-
import { ImageUpload as
|
|
11
|
-
import { Label as
|
|
12
|
-
import { LinearProgress as
|
|
13
|
-
import { MediaCardWithAction as
|
|
14
|
-
import { PhoneAndCountryDropdown as
|
|
15
|
-
import { PromoCode as
|
|
16
|
-
import { RadioButtonGroup as
|
|
17
|
-
import { Stepper as
|
|
18
|
-
import { Text as
|
|
19
|
-
import { TextFieldInput as
|
|
7
|
+
import { CheckboxGroup as B } from "./components/CheckboxGroup/index.js";
|
|
8
|
+
import { Dropdown as s } from "./components/Dropdown/index.js";
|
|
9
|
+
import { DropdownOptions as b } from "./components/DropdownOptions/index.js";
|
|
10
|
+
import { FlatBanner as g } from "./components/FlatBanner/index.js";
|
|
11
|
+
import { ImageUpload as P } from "./components/ImageUpload/index.js";
|
|
12
|
+
import { Label as A } from "./components/Label/index.js";
|
|
13
|
+
import { LinearProgress as k } from "./components/LinearProgress/index.js";
|
|
14
|
+
import { MediaCardWithAction as G } from "./components/MediaCardWithAction/index.js";
|
|
15
|
+
import { PhoneAndCountryDropdown as L } from "./components/PhoneAndCountryDropdown/index.js";
|
|
16
|
+
import { PromoCode as y } from "./components/PromoCode/index.js";
|
|
17
|
+
import { RadioButtonGroup as O } from "./components/RadioButtonGroup/index.js";
|
|
18
|
+
import { Stepper as U } from "./components/Stepper/index.js";
|
|
19
|
+
import { Text as j } from "./components/Text/index.js";
|
|
20
|
+
import { TextFieldInput as v } from "./components/TextFieldInput/index.js";
|
|
20
21
|
export {
|
|
21
22
|
e as AppBarPublic,
|
|
22
23
|
p as Banner,
|
|
23
24
|
m as Button,
|
|
24
25
|
a as CheckBox,
|
|
25
|
-
|
|
26
|
+
B as CheckboxGroup,
|
|
27
|
+
l as CollapsibleSection,
|
|
26
28
|
d as Dialog,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
s as Dropdown,
|
|
30
|
+
b as DropdownOptions,
|
|
31
|
+
g as FlatBanner,
|
|
32
|
+
P as ImageUpload,
|
|
33
|
+
A as Label,
|
|
34
|
+
k as LinearProgress,
|
|
35
|
+
G as MediaCardWithAction,
|
|
36
|
+
L as PhoneAndCountryDropdown,
|
|
37
|
+
y as PromoCode,
|
|
38
|
+
O as RadioButtonGroup,
|
|
39
|
+
U as Stepper,
|
|
40
|
+
j as Text,
|
|
41
|
+
v as TextFieldInput
|
|
40
42
|
};
|
package/package.json
CHANGED
package/dist/colors-CyChpKWu.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const c = "#1D252D", n = "#404A58", r = "#566376", s = "#8996A9", o = "#C4CBD4", t = "#E6EAED", E = "#F4F7F9", F = "#053E72", e = "#0B6B9F", y = "#27A4E8", a = "#C8EDFE", g = "#E6F6FF", i = "#055C56", p = "#E6FEEE", m = "#8E3007", C = "#FFF9F0", D = "#800711", d = "#FFECEB", A = {
|
|
2
|
-
grey800: c,
|
|
3
|
-
grey700: n,
|
|
4
|
-
grey600: r,
|
|
5
|
-
grey400: s,
|
|
6
|
-
grey200: o,
|
|
7
|
-
grey100: t,
|
|
8
|
-
grey50: E,
|
|
9
|
-
primary800: F,
|
|
10
|
-
primary700: e,
|
|
11
|
-
primary500: y,
|
|
12
|
-
primary100: a,
|
|
13
|
-
primary50: g,
|
|
14
|
-
secondary800: i,
|
|
15
|
-
secondary50: p,
|
|
16
|
-
warning800: m,
|
|
17
|
-
warning50: C,
|
|
18
|
-
destructive800: D,
|
|
19
|
-
destructive50: d
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
A as c
|
|
23
|
-
};
|