@fangzsx/component-library 0.0.14 → 0.0.16

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 (27) hide show
  1. package/dist/{ButtonBase-qMhxbNdC.js → ButtonBase-DxZEqM87.js} +15 -14
  2. package/dist/{FormLabel-DKoCtSGZ.js → FormLabel-DLyFlUyL.js} +7 -6
  3. package/dist/{Paper-DyRh03We.js → Paper-DZg6u5tT.js} +50 -77
  4. package/dist/{SwitchBase-DStPyUhD.js → SwitchBase-BPRcMkqu.js} +23 -21
  5. package/dist/{Typography-B0rSrz7H.js → Typography-DMROEdKW.js} +5 -4
  6. package/dist/components/AppBarPublic/index.js +8 -7
  7. package/dist/components/Button/index.js +1 -1
  8. package/dist/components/Checkbox/index.js +23 -22
  9. package/dist/components/CheckboxGroup/index.js +47 -34
  10. package/dist/components/MediaCardWithAction/index.js +7 -6
  11. package/dist/components/RadioButtonGroup/index.js +20 -18
  12. package/dist/components/Stepper/index.d.ts +11 -0
  13. package/dist/components/Stepper/index.js +607 -0
  14. package/dist/components/TextFieldInput/index.js +503 -482
  15. package/dist/{createSvgIcon-Dj0SJuc1.js → createSvgIcon-ChKzptBc.js} +2 -1
  16. package/dist/{index-o1i1vy-V.js → index-1CH5DDiw.js} +1 -1
  17. package/dist/{index-CoBGCD2e.js → index-B08hLYdM.js} +24 -23
  18. package/dist/integerPropType-BihGt2aU.js +31 -0
  19. package/dist/main.d.ts +1 -0
  20. package/dist/main.js +7 -5
  21. package/dist/{mergeSlotProps-C-n2ing7.js → mergeSlotProps-CADAqXOb.js} +1 -1
  22. package/dist/{useTimeout-BWi4JTOH.js → useForkRef-gLJikozA.js} +170 -277
  23. package/dist/useFormControl-BGLuGvqS.js +38 -0
  24. package/dist/useSlot-jPRhj-MO.js +125 -0
  25. package/dist/useTimeout-DmOXPFt0.js +111 -0
  26. package/package.json +1 -1
  27. package/dist/useSlot-S2pEBHE8.js +0 -161
@@ -1,44 +1,57 @@
1
- import { jsxs as I, jsx as l } from "react/jsx-runtime";
2
- import { FormControl as E, FormGroup as G, FormControlLabel as L, Checkbox as O, FormHelperText as i } from "@mui/material";
3
- import { useState as m } from "react";
4
- function w({
5
- options: a,
6
- required: h = !1,
7
- minChecked: t,
1
+ import { jsxs as $, jsx as l } from "react/jsx-runtime";
2
+ import { FormControl as x, FormGroup as G, FormControlLabel as I, Checkbox as B, FormHelperText as f } from "@mui/material";
3
+ import { useState as d } from "react";
4
+ function P({
5
+ options: s,
6
+ required: b = !1,
7
+ minChecked: o,
8
8
  maxChecked: r,
9
9
  errorMessage: c,
10
- helperText: u,
11
- onChange: f,
12
- sx: b
10
+ helperText: m,
11
+ onChange: i,
12
+ sx: p
13
13
  }) {
14
- const [n, p] = m(
15
- a.reduce((e, o) => ({
14
+ const [a, h] = d(
15
+ s.reduce((e, t) => ({
16
16
  ...e,
17
- [o.name]: o.defaultChecked || !1
17
+ [t.name]: t.defaultChecked || !1
18
18
  }), {})
19
- ), [g, v] = m(!1), F = (e) => {
20
- v(!0);
21
- const o = {
22
- ...n,
19
+ ), [g, F] = d(!1), v = (e) => {
20
+ F(!0);
21
+ const t = {
22
+ ...a,
23
23
  [e.target.name]: e.target.checked
24
24
  };
25
- p(o);
26
- const $ = Object.keys(o).filter(
27
- (x) => o[x]
25
+ h(t);
26
+ const L = Object.keys(t).filter(
27
+ (M) => t[M]
28
28
  );
29
- f && f($);
30
- }, s = Object.values(n).filter(Boolean).length, d = g && (t !== void 0 && s < t || r !== void 0 && s > r), j = () => c || (t !== void 0 && s < t ? `Please select at least ${t} option${t > 1 ? "s" : ""}` : r !== void 0 && s > r ? `Please select no more than ${r} option${r > 1 ? "s" : ""}` : "");
31
- return /* @__PURE__ */ I(
32
- E,
29
+ i && i(L);
30
+ }, n = Object.values(a).filter(Boolean).length, u = g && (o !== void 0 && n < o || r !== void 0 && n > r), j = () => c || (o !== void 0 && n < o ? `Please select at least ${o} option${o > 1 ? "s" : ""}` : r !== void 0 && n > r ? `Please select no more than ${r} option${r > 1 ? "s" : ""}` : "");
31
+ return /* @__PURE__ */ $(
32
+ x,
33
33
  {
34
- required: h,
35
- error: d,
34
+ required: b,
35
+ error: u,
36
36
  component: "fieldset",
37
- sx: { m: 3, ...b },
37
+ sx: {
38
+ m: 0,
39
+ "& .MuiFormGroup-root": {
40
+ gap: 1
41
+ },
42
+ "& .MuiFormControlLabel-root": {
43
+ marginTop: "0 !important",
44
+ marginBottom: "0 !important"
45
+ },
46
+ "& .MuiFormControlLabel-label": {
47
+ margin: "0 !important"
48
+ },
49
+ ...p
50
+ },
38
51
  variant: "standard",
39
52
  children: [
40
- /* @__PURE__ */ l(G, { children: a.map((e) => /* @__PURE__ */ l(
41
- L,
53
+ /* @__PURE__ */ l(G, { children: s.map((e) => /* @__PURE__ */ l(
54
+ I,
42
55
  {
43
56
  sx: {
44
57
  color: "#404A58",
@@ -47,10 +60,10 @@ function w({
47
60
  }
48
61
  },
49
62
  control: /* @__PURE__ */ l(
50
- O,
63
+ B,
51
64
  {
52
- checked: n[e.name] || !1,
53
- onChange: F,
65
+ checked: a[e.name] || !1,
66
+ onChange: v,
54
67
  name: e.name
55
68
  }
56
69
  ),
@@ -58,11 +71,11 @@ function w({
58
71
  },
59
72
  e.name
60
73
  )) }),
61
- d ? /* @__PURE__ */ l(i, { children: j() }) : u ? /* @__PURE__ */ l(i, { children: u }) : null
74
+ u ? /* @__PURE__ */ l(f, { children: j() }) : m ? /* @__PURE__ */ l(f, { children: m }) : null
62
75
  ]
63
76
  }
64
77
  );
65
78
  }
66
79
  export {
67
- w as CheckboxGroup
80
+ P as CheckboxGroup
68
81
  };
@@ -1,10 +1,11 @@
1
1
  import { jsx as d, jsxs as x } from "react/jsx-runtime";
2
- import { B as A } from "../../index-CoBGCD2e.js";
2
+ import { B as A } from "../../index-B08hLYdM.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
- import { u as C, s as g, c as y, a as b, f as N } from "../../useTimeout-BWi4JTOH.js";
6
- import { P as U } from "../../Paper-DyRh03We.js";
7
- import { T as v } from "../../Typography-B0rSrz7H.js";
5
+ import { u as C, s as g, c as y, a as b } from "../../useForkRef-gLJikozA.js";
6
+ import { P as U } from "../../Paper-DZg6u5tT.js";
7
+ import { a as N } from "../../useTimeout-DmOXPFt0.js";
8
+ import { T as v } from "../../Typography-DMROEdKW.js";
8
9
  function I(o) {
9
10
  return m("MuiCard", o);
10
11
  }
@@ -336,7 +337,7 @@ process.env.NODE_ENV !== "production" && (T.propTypes = {
336
337
  */
337
338
  sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
338
339
  });
339
- function Z({
340
+ function ee({
340
341
  image: o,
341
342
  imageAlt: t = "Card image",
342
343
  title: s,
@@ -368,5 +369,5 @@ function Z({
368
369
  ] });
369
370
  }
370
371
  export {
371
- Z as MediaCardWithAction
372
+ ee as MediaCardWithAction
372
373
  };
@@ -1,14 +1,16 @@
1
1
  import { jsx as l, jsxs as I } from "react/jsx-runtime";
2
2
  import * as u from "react";
3
3
  import { useState as Z } from "react";
4
- import { f as X, c as lo, F as io, a as co, b as po } from "../../FormLabel-DKoCtSGZ.js";
4
+ import { f as X, c as lo, F as io, a as co, b as po } from "../../FormLabel-DLyFlUyL.js";
5
5
  import { a as $, g as B, c as M, P as o } from "../../generateUtilityClasses-BCID9NF1.js";
6
- import { u as _, c as G, s as N, a as L, m as V, d as Y, r as oo, b as J, h as uo } from "../../useTimeout-BWi4JTOH.js";
7
- import { a as A, b as eo, u as fo } from "../../useSlot-S2pEBHE8.js";
6
+ import { u as _, c as G, s as N, a as L, m as V, r as Y, b as uo } from "../../useForkRef-gLJikozA.js";
7
+ import { a as A, u as fo } from "../../useFormControl-BGLuGvqS.js";
8
8
  import { u as mo } from "../../useId-CK6Kn3Tn.js";
9
- import { T as K } from "../../Typography-B0rSrz7H.js";
10
- import { S as bo } from "../../SwitchBase-DStPyUhD.js";
11
- import { c as ro } from "../../createSvgIcon-Dj0SJuc1.js";
9
+ import { u as oo } from "../../useSlot-jPRhj-MO.js";
10
+ import { T as J } from "../../Typography-DMROEdKW.js";
11
+ import { r as eo, c as K } from "../../useTimeout-DmOXPFt0.js";
12
+ import { S as bo } from "../../SwitchBase-BPRcMkqu.js";
13
+ import { c as ro } from "../../createSvgIcon-ChKzptBc.js";
12
14
  function yo(e) {
13
15
  return B("MuiFormControlLabel", e);
14
16
  }
@@ -140,13 +142,13 @@ const E = $("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlaceme
140
142
  ...p,
141
143
  ...F
142
144
  }
143
- }, [U, z] = eo("typography", {
144
- elementType: K,
145
+ }, [U, z] = oo("typography", {
146
+ elementType: J,
145
147
  externalForwardedProps: q,
146
148
  ownerState: v
147
149
  });
148
150
  let C = h;
149
- return C != null && C.type !== K && !m && (C = /* @__PURE__ */ l(U, {
151
+ return C != null && C.type !== J && !m && (C = /* @__PURE__ */ l(U, {
150
152
  component: "span",
151
153
  ...z,
152
154
  className: G(T.label, z?.className),
@@ -206,7 +208,7 @@ process.env.NODE_ENV !== "production" && (to.propTypes = {
206
208
  /**
207
209
  * Pass a ref to the `input` element.
208
210
  */
209
- inputRef: Y,
211
+ inputRef: eo,
210
212
  /**
211
213
  * A text or an element to be used in an enclosing label element.
212
214
  */
@@ -260,7 +262,7 @@ const Ro = ro(/* @__PURE__ */ l("path", {
260
262
  d: "M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"
261
263
  }), "RadioButtonChecked"), Po = N("span", {
262
264
  name: "MuiRadioButtonIcon",
263
- shouldForwardProp: oo
265
+ shouldForwardProp: Y
264
266
  })({
265
267
  position: "relative",
266
268
  display: "flex"
@@ -353,7 +355,7 @@ const Q = $("MuiRadio", ["root", "checked", "disabled", "colorPrimary", "colorSe
353
355
  ...L(a, To, r)
354
356
  };
355
357
  }, No = N(bo, {
356
- shouldForwardProp: (e) => oo(e) || e === "classes",
358
+ shouldForwardProp: (e) => Y(e) || e === "classes",
357
359
  name: "MuiRadio",
358
360
  slot: "Root",
359
361
  overridesResolver: (e, r) => {
@@ -380,7 +382,7 @@ const Q = $("MuiRadio", ["root", "checked", "disabled", "colorPrimary", "colorSe
380
382
  backgroundColor: e.alpha((e.vars || e).palette.action.active, (e.vars || e).palette.action.hoverOpacity)
381
383
  }
382
384
  }
383
- }, ...Object.entries(e.palette).filter(J()).map(([r]) => ({
385
+ }, ...Object.entries(e.palette).filter(K()).map(([r]) => ({
384
386
  props: {
385
387
  color: r,
386
388
  disabled: !1,
@@ -391,7 +393,7 @@ const Q = $("MuiRadio", ["root", "checked", "disabled", "colorPrimary", "colorSe
391
393
  backgroundColor: e.alpha((e.vars || e).palette[r].main, (e.vars || e).palette.action.hoverOpacity)
392
394
  }
393
395
  }
394
- })), ...Object.entries(e.palette).filter(J()).map(([r]) => ({
396
+ })), ...Object.entries(e.palette).filter(K()).map(([r]) => ({
395
397
  props: {
396
398
  color: r,
397
399
  disabled: !1
@@ -454,7 +456,7 @@ const Oo = /* @__PURE__ */ l(H, {
454
456
  const D = lo(m, g && g.onChange);
455
457
  let v = d;
456
458
  g && (typeof O > "u" && (O = xo(g.value, s.value)), typeof v > "u" && (v = g.name));
457
- const T = w.input ?? b, [q, U] = eo("root", {
459
+ const T = w.input ?? b, [q, U] = oo("root", {
458
460
  ref: t,
459
461
  elementType: No,
460
462
  className: G(j.root, h),
@@ -550,7 +552,7 @@ process.env.NODE_ENV !== "production" && (so.propTypes = {
550
552
  * Pass a ref to the `input` element.
551
553
  * @deprecated Use `slotProps.input.ref` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
552
554
  */
553
- inputRef: Y,
555
+ inputRef: eo,
554
556
  /**
555
557
  * Name attribute of the `input` element.
556
558
  */
@@ -773,7 +775,7 @@ process.env.NODE_ENV !== "production" && (no.propTypes = {
773
775
  */
774
776
  value: o.any
775
777
  });
776
- function Wo({
778
+ function Jo({
777
779
  label: e,
778
780
  options: r,
779
781
  defaultValue: t,
@@ -832,5 +834,5 @@ function Wo({
832
834
  );
833
835
  }
834
836
  export {
835
- Wo as RadioButtonGroup
837
+ Jo as RadioButtonGroup
836
838
  };
@@ -0,0 +1,11 @@
1
+ interface StepConfig {
2
+ label: string;
3
+ }
4
+ interface HorizontalLinearStepperProps {
5
+ steps: StepConfig[];
6
+ activeStep?: number;
7
+ sx?: any;
8
+ stepperSx?: any;
9
+ }
10
+ export declare function Stepper({ steps, activeStep, sx, stepperSx }: HorizontalLinearStepperProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};