@fangzsx/component-library 0.0.11 → 0.0.13

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 (35) hide show
  1. package/dist/Box-DPlM16yK.js +30 -0
  2. package/dist/ButtonBase-qMhxbNdC.js +878 -0
  3. package/dist/FormLabel-DKoCtSGZ.js +600 -0
  4. package/dist/{Paper-CAUsv8qs.js → Paper-DyRh03We.js} +54 -51
  5. package/dist/SwitchBase-DStPyUhD.js +311 -0
  6. package/dist/Typography-B0rSrz7H.js +253 -0
  7. package/dist/components/AppBarPublic/index.js +83 -105
  8. package/dist/components/Button/index.js +1 -1
  9. package/dist/components/Checkbox/index.js +103 -607
  10. package/dist/components/CheckboxGroup/index.d.ts +17 -0
  11. package/dist/components/CheckboxGroup/index.js +68 -0
  12. package/dist/components/Dropdown/index.d.ts +22 -0
  13. package/dist/components/Dropdown/index.js +120 -0
  14. package/dist/components/LinearProgress/index.d.ts +3 -0
  15. package/dist/components/LinearProgress/index.js +19 -0
  16. package/dist/components/MediaCardWithAction/index.js +157 -436
  17. package/dist/components/RadioButtonGroup/index.d.ts +17 -0
  18. package/dist/components/RadioButtonGroup/index.js +836 -0
  19. package/dist/components/TextFieldInput/index.d.ts +15 -0
  20. package/dist/components/TextFieldInput/index.js +6578 -0
  21. package/dist/{createSvgIcon-DAI5icic.js → createSvgIcon-Dj0SJuc1.js} +8 -7
  22. package/dist/generateUtilityClasses-BCID9NF1.js +2806 -0
  23. package/dist/{index-DGepNtNg.js → index-CoBGCD2e.js} +143 -158
  24. package/dist/index-o1i1vy-V.js +73 -0
  25. package/dist/main.d.ts +5 -1
  26. package/dist/main.js +21 -13
  27. package/dist/mergeSlotProps-C-n2ing7.js +62 -0
  28. package/dist/useId-CK6Kn3Tn.js +21 -0
  29. package/dist/useSlot-S2pEBHE8.js +161 -0
  30. package/dist/useTimeout-BWi4JTOH.js +635 -0
  31. package/package.json +1 -1
  32. package/dist/ButtonBase-CAtBagnK.js +0 -4293
  33. package/dist/assets/index2.css +0 -1
  34. package/dist/components/Input/index.d.ts +0 -1
  35. package/dist/components/Input/index.js +0 -11
@@ -0,0 +1,73 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { GlobalStyles as c } from "@mui/system";
3
+ import { i as m, d as y, T as p, P as o } from "./generateUtilityClasses-BCID9NF1.js";
4
+ import { e as x } from "./useTimeout-BWi4JTOH.js";
5
+ const P = (e) => {
6
+ const r = {
7
+ systemProps: {},
8
+ otherProps: {}
9
+ }, s = e?.theme?.unstable_sxConfig ?? y;
10
+ return Object.keys(e).forEach((t) => {
11
+ s[t] ? r.systemProps[t] = e[t] : r.otherProps[t] = e[t];
12
+ }), r;
13
+ };
14
+ function b(e) {
15
+ const {
16
+ sx: r,
17
+ ...s
18
+ } = e, {
19
+ systemProps: t,
20
+ otherProps: f
21
+ } = P(s);
22
+ let n;
23
+ return Array.isArray(r) ? n = [t, ...r] : typeof r == "function" ? n = (...u) => {
24
+ const i = r(...u);
25
+ return m(i) ? {
26
+ ...t,
27
+ ...i
28
+ } : t;
29
+ } : n = {
30
+ ...t,
31
+ ...r
32
+ }, {
33
+ ...f,
34
+ sx: n
35
+ };
36
+ }
37
+ function a(e) {
38
+ return /* @__PURE__ */ l(c, {
39
+ ...e,
40
+ defaultTheme: x,
41
+ themeId: p
42
+ });
43
+ }
44
+ process.env.NODE_ENV !== "production" && (a.propTypes = {
45
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
46
+ // │ These PropTypes are generated from the TypeScript type definitions. │
47
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
48
+ // └─────────────────────────────────────────────────────────────────────┘
49
+ /**
50
+ * The styles you want to apply globally.
51
+ */
52
+ styles: o.oneOfType([o.array, o.func, o.number, o.object, o.string, o.bool])
53
+ });
54
+ function g(e) {
55
+ return function(s) {
56
+ return (
57
+ // Pigment CSS `globalCss` support callback with theme inside an object but `GlobalStyles` support theme as a callback value.
58
+ /* @__PURE__ */ l(a, {
59
+ styles: typeof e == "function" ? (t) => e({
60
+ theme: t,
61
+ ...s
62
+ }) : e
63
+ })
64
+ );
65
+ };
66
+ }
67
+ function E() {
68
+ return b;
69
+ }
70
+ export {
71
+ g,
72
+ E as i
73
+ };
package/dist/main.d.ts CHANGED
@@ -2,8 +2,12 @@ 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 { CheckboxGroup } from './components/CheckboxGroup';
6
+ export { Dropdown } from './components/Dropdown';
5
7
  export { FlatBanner } from './components/FlatBanner';
6
- export { Input } from './components/Input';
7
8
  export { Label } from './components/Label';
9
+ export { LinearProgress } from './components/LinearProgress';
8
10
  export { MediaCardWithAction } from './components/MediaCardWithAction';
11
+ export { RadioButtonGroup } from './components/RadioButtonGroup';
9
12
  export { Text } from './components/Text';
13
+ export { TextFieldInput } from './components/TextFieldInput';
package/dist/main.js CHANGED
@@ -1,20 +1,28 @@
1
- import { AppBarPublic as t } from "./components/AppBarPublic/index.js";
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 f } from "./index-DGepNtNg.js";
3
+ import { B as f } from "./index-CoBGCD2e.js";
4
4
  import { CheckBox as a } from "./components/Checkbox/index.js";
5
- import { FlatBanner as B } from "./components/FlatBanner/index.js";
6
- import { Input as c } from "./components/Input/index.js";
7
- import { Label as u } from "./components/Label/index.js";
8
- import { MediaCardWithAction as d } from "./components/MediaCardWithAction/index.js";
9
- import { Text as A } from "./components/Text/index.js";
5
+ import { CheckboxGroup as i } from "./components/CheckboxGroup/index.js";
6
+ import { Dropdown as u } from "./components/Dropdown/index.js";
7
+ import { FlatBanner as c } from "./components/FlatBanner/index.js";
8
+ import { Label as b } from "./components/Label/index.js";
9
+ import { LinearProgress as s } from "./components/LinearProgress/index.js";
10
+ import { MediaCardWithAction as k } from "./components/MediaCardWithAction/index.js";
11
+ import { RadioButtonGroup as F } from "./components/RadioButtonGroup/index.js";
12
+ import { Text as L } from "./components/Text/index.js";
13
+ import { TextFieldInput as T } from "./components/TextFieldInput/index.js";
10
14
  export {
11
- t as AppBarPublic,
15
+ e as AppBarPublic,
12
16
  p as Banner,
13
17
  f as Button,
14
18
  a as CheckBox,
15
- B as FlatBanner,
16
- c as Input,
17
- u as Label,
18
- d as MediaCardWithAction,
19
- A as Text
19
+ i as CheckboxGroup,
20
+ u as Dropdown,
21
+ c as FlatBanner,
22
+ b as Label,
23
+ s as LinearProgress,
24
+ k as MediaCardWithAction,
25
+ F as RadioButtonGroup,
26
+ L as Text,
27
+ T as TextFieldInput
20
28
  };
@@ -0,0 +1,62 @@
1
+ import { c as t } from "./useTimeout-BWi4JTOH.js";
2
+ function x(s, i) {
3
+ const a = s.charCodeAt(2);
4
+ return s[0] === "o" && s[1] === "n" && a >= 65 && a <= 90 && typeof i == "function";
5
+ }
6
+ function N(s, i) {
7
+ if (!s)
8
+ return i;
9
+ function a(m, c) {
10
+ const n = {};
11
+ return Object.keys(c).forEach((y) => {
12
+ x(y, c[y]) && typeof m[y] == "function" && (n[y] = (...A) => {
13
+ m[y](...A), c[y](...A);
14
+ });
15
+ }), n;
16
+ }
17
+ if (typeof s == "function" || typeof i == "function")
18
+ return (m) => {
19
+ const c = typeof i == "function" ? i(m) : i, n = typeof s == "function" ? s({
20
+ ...m,
21
+ ...c
22
+ }) : s, y = t(m?.className, c?.className, n?.className), A = a(n, c);
23
+ return {
24
+ ...c,
25
+ ...n,
26
+ ...A,
27
+ ...!!y && {
28
+ className: y
29
+ },
30
+ ...c?.style && n?.style && {
31
+ style: {
32
+ ...c.style,
33
+ ...n.style
34
+ }
35
+ },
36
+ ...c?.sx && n?.sx && {
37
+ sx: [...Array.isArray(c.sx) ? c.sx : [c.sx], ...Array.isArray(n.sx) ? n.sx : [n.sx]]
38
+ }
39
+ };
40
+ };
41
+ const f = i, u = a(s, f), r = t(f?.className, s?.className);
42
+ return {
43
+ ...i,
44
+ ...s,
45
+ ...u,
46
+ ...!!r && {
47
+ className: r
48
+ },
49
+ ...f?.style && s?.style && {
50
+ style: {
51
+ ...f.style,
52
+ ...s.style
53
+ }
54
+ },
55
+ ...f?.sx && s?.sx && {
56
+ sx: [...Array.isArray(f.sx) ? f.sx : [f.sx], ...Array.isArray(s.sx) ? s.sx : [s.sx]]
57
+ }
58
+ };
59
+ }
60
+ export {
61
+ N as m
62
+ };
@@ -0,0 +1,21 @@
1
+ import * as u from "react";
2
+ let n = 0;
3
+ function o(t) {
4
+ const [e, a] = u.useState(t), c = t || e;
5
+ return u.useEffect(() => {
6
+ e == null && (n += 1, a(`mui-${n}`));
7
+ }, [e]), c;
8
+ }
9
+ const f = {
10
+ ...u
11
+ }, s = f.useId;
12
+ function l(t) {
13
+ if (s !== void 0) {
14
+ const e = s();
15
+ return t ?? e;
16
+ }
17
+ return o(t);
18
+ }
19
+ export {
20
+ l as u
21
+ };
@@ -0,0 +1,161 @@
1
+ import * as i from "react";
2
+ import { c as C, h as x } from "./useTimeout-BWi4JTOH.js";
3
+ function V(e) {
4
+ const {
5
+ controlled: o,
6
+ default: t,
7
+ name: n,
8
+ state: s = "value"
9
+ } = e, {
10
+ current: r
11
+ } = i.useRef(o !== void 0), [c, f] = i.useState(t), d = r ? o : c;
12
+ if (process.env.NODE_ENV !== "production") {
13
+ i.useEffect(() => {
14
+ r !== (o !== void 0) && console.error([`MUI: A component is changing the ${r ? "" : "un"}controlled ${s} state of ${n} to be ${r ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
15
+ `));
16
+ }, [s, n, o]);
17
+ const {
18
+ current: l
19
+ } = i.useRef(t);
20
+ i.useEffect(() => {
21
+ !r && JSON.stringify(t) !== JSON.stringify(l) && console.error([`MUI: A component is changing the default ${s} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
22
+ `));
23
+ }, [JSON.stringify(t)]);
24
+ }
25
+ const a = i.useCallback((l) => {
26
+ r || f(l);
27
+ }, []);
28
+ return [d, a];
29
+ }
30
+ const S = /* @__PURE__ */ i.createContext(void 0);
31
+ process.env.NODE_ENV !== "production" && (S.displayName = "FormControlContext");
32
+ function b() {
33
+ return i.useContext(S);
34
+ }
35
+ function F(e) {
36
+ return typeof e == "string";
37
+ }
38
+ function O(e, o, t) {
39
+ return e === void 0 || F(e) ? o : {
40
+ ...o,
41
+ ownerState: {
42
+ ...o.ownerState,
43
+ ...t
44
+ }
45
+ };
46
+ }
47
+ function $(e, o, t) {
48
+ return typeof e == "function" ? e(o, t) : e;
49
+ }
50
+ function R(e, o = []) {
51
+ if (e === void 0)
52
+ return {};
53
+ const t = {};
54
+ return Object.keys(e).filter((n) => n.match(/^on[A-Z]/) && typeof e[n] == "function" && !o.includes(n)).forEach((n) => {
55
+ t[n] = e[n];
56
+ }), t;
57
+ }
58
+ function N(e) {
59
+ if (e === void 0)
60
+ return {};
61
+ const o = {};
62
+ return Object.keys(e).filter((t) => !(t.match(/^on[A-Z]/) && typeof e[t] == "function")).forEach((t) => {
63
+ o[t] = e[t];
64
+ }), o;
65
+ }
66
+ function k(e) {
67
+ const {
68
+ getSlotProps: o,
69
+ additionalProps: t,
70
+ externalSlotProps: n,
71
+ externalForwardedProps: s,
72
+ className: r
73
+ } = e;
74
+ if (!o) {
75
+ const m = C(t?.className, r, s?.className, n?.className), h = {
76
+ ...t?.style,
77
+ ...s?.style,
78
+ ...n?.style
79
+ }, u = {
80
+ ...t,
81
+ ...s,
82
+ ...n
83
+ };
84
+ return m.length > 0 && (u.className = m), Object.keys(h).length > 0 && (u.style = h), {
85
+ props: u,
86
+ internalRef: void 0
87
+ };
88
+ }
89
+ const c = R({
90
+ ...s,
91
+ ...n
92
+ }), f = N(n), d = N(s), a = o(c), l = C(a?.className, t?.className, r, s?.className, n?.className), y = {
93
+ ...a?.style,
94
+ ...t?.style,
95
+ ...s?.style,
96
+ ...n?.style
97
+ }, p = {
98
+ ...a,
99
+ ...t,
100
+ ...d,
101
+ ...f
102
+ };
103
+ return l.length > 0 && (p.className = l), Object.keys(y).length > 0 && (p.style = y), {
104
+ props: p,
105
+ internalRef: a.ref
106
+ };
107
+ }
108
+ function A(e, o) {
109
+ const {
110
+ className: t,
111
+ elementType: n,
112
+ ownerState: s,
113
+ externalForwardedProps: r,
114
+ internalForwardedProps: c,
115
+ shouldForwardComponentProp: f = !1,
116
+ ...d
117
+ } = o, {
118
+ component: a,
119
+ slots: l = {
120
+ [e]: void 0
121
+ },
122
+ slotProps: y = {
123
+ [e]: void 0
124
+ },
125
+ ...p
126
+ } = r, m = l[e] || n, h = $(y[e], s), {
127
+ props: {
128
+ component: u,
129
+ ...P
130
+ },
131
+ internalRef: v
132
+ } = k({
133
+ className: t,
134
+ ...d,
135
+ externalForwardedProps: e === "root" ? p : void 0,
136
+ externalSlotProps: h
137
+ }), E = x(v, h?.ref, o.ref), g = e === "root" ? u || a : u, w = O(m, {
138
+ ...e === "root" && !a && !l[e] && c,
139
+ ...e !== "root" && !l[e] && c,
140
+ ...P,
141
+ ...g && !f && {
142
+ as: g
143
+ },
144
+ ...g && f && {
145
+ component: g
146
+ },
147
+ ref: E
148
+ }, s);
149
+ return [m, w];
150
+ }
151
+ export {
152
+ S as F,
153
+ b as a,
154
+ A as b,
155
+ O as c,
156
+ R as e,
157
+ F as i,
158
+ k as m,
159
+ $ as r,
160
+ V as u
161
+ };