@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,600 @@
1
+ import * as a from "react";
2
+ import { g as z, a as E, c as T, P as e } from "./generateUtilityClasses-BCID9NF1.js";
3
+ import { u as L, s as N, c as $, a as A, m as H, b as re } from "./useTimeout-BWi4JTOH.js";
4
+ import { F as oe, a as Q } from "./useSlot-S2pEBHE8.js";
5
+ import { jsx as O, jsxs as P } from "react/jsx-runtime";
6
+ function Ce(...r) {
7
+ return r.reduce((o, t) => t == null ? o : function(...s) {
8
+ o.apply(this, s), t.apply(this, s);
9
+ }, () => {
10
+ });
11
+ }
12
+ function R(r, o) {
13
+ return /* @__PURE__ */ a.isValidElement(r) && o.indexOf(
14
+ // For server components `muiName` is available in element.type._payload.value.muiName
15
+ // relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45
16
+ // eslint-disable-next-line no-underscore-dangle
17
+ r.type.muiName ?? r.type?._payload?.value?.muiName
18
+ ) !== -1;
19
+ }
20
+ function _(r) {
21
+ return r != null && !(Array.isArray(r) && r.length === 0);
22
+ }
23
+ function G(r, o = !1) {
24
+ return r && (_(r.value) && r.value !== "" || o && _(r.defaultValue) && r.defaultValue !== "");
25
+ }
26
+ function te(r) {
27
+ return r.startAdornment;
28
+ }
29
+ function se(r) {
30
+ return z("MuiFormControl", r);
31
+ }
32
+ E("MuiFormControl", ["root", "marginNone", "marginNormal", "marginDense", "fullWidth", "disabled"]);
33
+ const ne = (r) => {
34
+ const {
35
+ classes: o,
36
+ margin: t,
37
+ fullWidth: n
38
+ } = r, s = {
39
+ root: ["root", t !== "none" && `margin${T(t)}`, n && "fullWidth"]
40
+ };
41
+ return A(s, se, o);
42
+ }, le = N("div", {
43
+ name: "MuiFormControl",
44
+ slot: "Root",
45
+ overridesResolver: (r, o) => {
46
+ const {
47
+ ownerState: t
48
+ } = r;
49
+ return [o.root, o[`margin${T(t.margin)}`], t.fullWidth && o.fullWidth];
50
+ }
51
+ })({
52
+ display: "inline-flex",
53
+ flexDirection: "column",
54
+ position: "relative",
55
+ // Reset fieldset default style.
56
+ minWidth: 0,
57
+ padding: 0,
58
+ margin: 0,
59
+ border: 0,
60
+ verticalAlign: "top",
61
+ // Fix alignment issue on Safari.
62
+ variants: [{
63
+ props: {
64
+ margin: "normal"
65
+ },
66
+ style: {
67
+ marginTop: 16,
68
+ marginBottom: 8
69
+ }
70
+ }, {
71
+ props: {
72
+ margin: "dense"
73
+ },
74
+ style: {
75
+ marginTop: 8,
76
+ marginBottom: 4
77
+ }
78
+ }, {
79
+ props: {
80
+ fullWidth: !0
81
+ },
82
+ style: {
83
+ width: "100%"
84
+ }
85
+ }]
86
+ }), ie = /* @__PURE__ */ a.forwardRef(function(o, t) {
87
+ const n = L({
88
+ props: o,
89
+ name: "MuiFormControl"
90
+ }), {
91
+ children: s,
92
+ className: u,
93
+ color: d = "primary",
94
+ component: f = "div",
95
+ disabled: c = !1,
96
+ error: b = !1,
97
+ focused: C,
98
+ fullWidth: g = !1,
99
+ hiddenLabel: v = !1,
100
+ margin: h = "none",
101
+ required: y = !1,
102
+ size: i = "medium",
103
+ variant: l = "outlined",
104
+ ...p
105
+ } = n, S = {
106
+ ...n,
107
+ color: d,
108
+ component: f,
109
+ disabled: c,
110
+ error: b,
111
+ fullWidth: g,
112
+ hiddenLabel: v,
113
+ margin: h,
114
+ required: y,
115
+ size: i,
116
+ variant: l
117
+ }, Y = ne(S), [j, Z] = a.useState(() => {
118
+ let F = !1;
119
+ return s && a.Children.forEach(s, (m) => {
120
+ if (!R(m, ["Input", "Select"]))
121
+ return;
122
+ const I = R(m, ["Select"]) ? m.props.input : m;
123
+ I && te(I.props) && (F = !0);
124
+ }), F;
125
+ }), [U, V] = a.useState(() => {
126
+ let F = !1;
127
+ return s && a.Children.forEach(s, (m) => {
128
+ R(m, ["Input", "Select"]) && (G(m.props, !0) || G(m.props.inputProps, !0)) && (F = !0);
129
+ }), F;
130
+ }), [W, q] = a.useState(!1);
131
+ c && W && q(!1);
132
+ const k = C !== void 0 && !c ? C : W;
133
+ let w;
134
+ const M = a.useRef(!1);
135
+ process.env.NODE_ENV !== "production" && (w = () => (M.current && console.error(["MUI: There are multiple `InputBase` components inside a FormControl.", "This creates visual inconsistencies, only use one `InputBase`."].join(`
136
+ `)), M.current = !0, () => {
137
+ M.current = !1;
138
+ }));
139
+ const B = a.useCallback(() => {
140
+ V(!0);
141
+ }, []), D = a.useCallback(() => {
142
+ V(!1);
143
+ }, []), ee = a.useMemo(() => ({
144
+ adornedStart: j,
145
+ setAdornedStart: Z,
146
+ color: d,
147
+ disabled: c,
148
+ error: b,
149
+ filled: U,
150
+ focused: k,
151
+ fullWidth: g,
152
+ hiddenLabel: v,
153
+ size: i,
154
+ onBlur: () => {
155
+ q(!1);
156
+ },
157
+ onFocus: () => {
158
+ q(!0);
159
+ },
160
+ onEmpty: D,
161
+ onFilled: B,
162
+ registerEffect: w,
163
+ required: y,
164
+ variant: l
165
+ }), [j, d, c, b, U, k, g, v, w, D, B, y, i, l]);
166
+ return /* @__PURE__ */ O(oe.Provider, {
167
+ value: ee,
168
+ children: /* @__PURE__ */ O(le, {
169
+ as: f,
170
+ ownerState: S,
171
+ className: $(Y.root, u),
172
+ ref: t,
173
+ ...p,
174
+ children: s
175
+ })
176
+ });
177
+ });
178
+ process.env.NODE_ENV !== "production" && (ie.propTypes = {
179
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
180
+ // │ These PropTypes are generated from the TypeScript type definitions. │
181
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
182
+ // └─────────────────────────────────────────────────────────────────────┘
183
+ /**
184
+ * The content of the component.
185
+ */
186
+ children: e.node,
187
+ /**
188
+ * Override or extend the styles applied to the component.
189
+ */
190
+ classes: e.object,
191
+ /**
192
+ * @ignore
193
+ */
194
+ className: e.string,
195
+ /**
196
+ * The color of the component.
197
+ * It supports both default and custom theme colors, which can be added as shown in the
198
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
199
+ * @default 'primary'
200
+ */
201
+ color: e.oneOfType([e.oneOf(["primary", "secondary", "error", "info", "success", "warning"]), e.string]),
202
+ /**
203
+ * The component used for the root node.
204
+ * Either a string to use a HTML element or a component.
205
+ */
206
+ component: e.elementType,
207
+ /**
208
+ * If `true`, the label, input and helper text should be displayed in a disabled state.
209
+ * @default false
210
+ */
211
+ disabled: e.bool,
212
+ /**
213
+ * If `true`, the label is displayed in an error state.
214
+ * @default false
215
+ */
216
+ error: e.bool,
217
+ /**
218
+ * If `true`, the component is displayed in focused state.
219
+ */
220
+ focused: e.bool,
221
+ /**
222
+ * If `true`, the component will take up the full width of its container.
223
+ * @default false
224
+ */
225
+ fullWidth: e.bool,
226
+ /**
227
+ * If `true`, the label is hidden.
228
+ * This is used to increase density for a `FilledInput`.
229
+ * Be sure to add `aria-label` to the `input` element.
230
+ * @default false
231
+ */
232
+ hiddenLabel: e.bool,
233
+ /**
234
+ * If `dense` or `normal`, will adjust vertical spacing of this and contained components.
235
+ * @default 'none'
236
+ */
237
+ margin: e.oneOf(["dense", "none", "normal"]),
238
+ /**
239
+ * If `true`, the label will indicate that the `input` is required.
240
+ * @default false
241
+ */
242
+ required: e.bool,
243
+ /**
244
+ * The size of the component.
245
+ * @default 'medium'
246
+ */
247
+ size: e.oneOfType([e.oneOf(["medium", "small"]), e.string]),
248
+ /**
249
+ * The system prop that allows defining system overrides as well as additional CSS styles.
250
+ */
251
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
252
+ /**
253
+ * The variant to use.
254
+ * @default 'outlined'
255
+ */
256
+ variant: e.oneOf(["filled", "outlined", "standard"])
257
+ });
258
+ function X({
259
+ props: r,
260
+ states: o,
261
+ muiFormControl: t
262
+ }) {
263
+ return o.reduce((n, s) => (n[s] = r[s], t && typeof r[s] > "u" && (n[s] = t[s]), n), {});
264
+ }
265
+ function ae(r) {
266
+ return z("MuiFormHelperText", r);
267
+ }
268
+ const J = E("MuiFormHelperText", ["root", "error", "disabled", "sizeSmall", "sizeMedium", "contained", "focused", "filled", "required"]);
269
+ var K;
270
+ const de = (r) => {
271
+ const {
272
+ classes: o,
273
+ contained: t,
274
+ size: n,
275
+ disabled: s,
276
+ error: u,
277
+ filled: d,
278
+ focused: f,
279
+ required: c
280
+ } = r, b = {
281
+ root: ["root", s && "disabled", u && "error", n && `size${T(n)}`, t && "contained", f && "focused", d && "filled", c && "required"]
282
+ };
283
+ return A(b, ae, o);
284
+ }, ce = N("p", {
285
+ name: "MuiFormHelperText",
286
+ slot: "Root",
287
+ overridesResolver: (r, o) => {
288
+ const {
289
+ ownerState: t
290
+ } = r;
291
+ return [o.root, t.size && o[`size${T(t.size)}`], t.contained && o.contained, t.filled && o.filled];
292
+ }
293
+ })(H(({
294
+ theme: r
295
+ }) => ({
296
+ color: (r.vars || r).palette.text.secondary,
297
+ ...r.typography.caption,
298
+ textAlign: "left",
299
+ marginTop: 3,
300
+ marginRight: 0,
301
+ marginBottom: 0,
302
+ marginLeft: 0,
303
+ [`&.${J.disabled}`]: {
304
+ color: (r.vars || r).palette.text.disabled
305
+ },
306
+ [`&.${J.error}`]: {
307
+ color: (r.vars || r).palette.error.main
308
+ },
309
+ variants: [{
310
+ props: {
311
+ size: "small"
312
+ },
313
+ style: {
314
+ marginTop: 4
315
+ }
316
+ }, {
317
+ props: ({
318
+ ownerState: o
319
+ }) => o.contained,
320
+ style: {
321
+ marginLeft: 14,
322
+ marginRight: 14
323
+ }
324
+ }]
325
+ }))), ue = /* @__PURE__ */ a.forwardRef(function(o, t) {
326
+ const n = L({
327
+ props: o,
328
+ name: "MuiFormHelperText"
329
+ }), {
330
+ children: s,
331
+ className: u,
332
+ component: d = "p",
333
+ disabled: f,
334
+ error: c,
335
+ filled: b,
336
+ focused: C,
337
+ margin: g,
338
+ required: v,
339
+ variant: h,
340
+ ...y
341
+ } = n, i = Q(), l = X({
342
+ props: n,
343
+ muiFormControl: i,
344
+ states: ["variant", "size", "disabled", "error", "filled", "focused", "required"]
345
+ }), p = {
346
+ ...n,
347
+ component: d,
348
+ contained: l.variant === "filled" || l.variant === "outlined",
349
+ variant: l.variant,
350
+ size: l.size,
351
+ disabled: l.disabled,
352
+ error: l.error,
353
+ filled: l.filled,
354
+ focused: l.focused,
355
+ required: l.required
356
+ };
357
+ delete p.ownerState;
358
+ const S = de(p);
359
+ return /* @__PURE__ */ O(ce, {
360
+ as: d,
361
+ className: $(S.root, u),
362
+ ref: t,
363
+ ...y,
364
+ ownerState: p,
365
+ children: s === " " ? (
366
+ // notranslate needed while Google Translate will not fix zero-width space issue
367
+ K || (K = /* @__PURE__ */ O("span", {
368
+ className: "notranslate",
369
+ "aria-hidden": !0,
370
+ children: "​"
371
+ }))
372
+ ) : s
373
+ });
374
+ });
375
+ process.env.NODE_ENV !== "production" && (ue.propTypes = {
376
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
377
+ // │ These PropTypes are generated from the TypeScript type definitions. │
378
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
379
+ // └─────────────────────────────────────────────────────────────────────┘
380
+ /**
381
+ * The content of the component.
382
+ *
383
+ * If `' '` is provided, the component reserves one line height for displaying a future message.
384
+ */
385
+ children: e.node,
386
+ /**
387
+ * Override or extend the styles applied to the component.
388
+ */
389
+ classes: e.object,
390
+ /**
391
+ * @ignore
392
+ */
393
+ className: e.string,
394
+ /**
395
+ * The component used for the root node.
396
+ * Either a string to use a HTML element or a component.
397
+ */
398
+ component: e.elementType,
399
+ /**
400
+ * If `true`, the helper text should be displayed in a disabled state.
401
+ */
402
+ disabled: e.bool,
403
+ /**
404
+ * If `true`, helper text should be displayed in an error state.
405
+ */
406
+ error: e.bool,
407
+ /**
408
+ * If `true`, the helper text should use filled classes key.
409
+ */
410
+ filled: e.bool,
411
+ /**
412
+ * If `true`, the helper text should use focused classes key.
413
+ */
414
+ focused: e.bool,
415
+ /**
416
+ * If `dense`, will adjust vertical spacing. This is normally obtained via context from
417
+ * FormControl.
418
+ */
419
+ margin: e.oneOf(["dense"]),
420
+ /**
421
+ * If `true`, the helper text should use required classes key.
422
+ */
423
+ required: e.bool,
424
+ /**
425
+ * The system prop that allows defining system overrides as well as additional CSS styles.
426
+ */
427
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
428
+ /**
429
+ * The variant to use.
430
+ */
431
+ variant: e.oneOfType([e.oneOf(["filled", "outlined", "standard"]), e.string])
432
+ });
433
+ function fe(r) {
434
+ return z("MuiFormLabel", r);
435
+ }
436
+ const x = E("MuiFormLabel", ["root", "colorSecondary", "focused", "disabled", "error", "filled", "required", "asterisk"]), pe = (r) => {
437
+ const {
438
+ classes: o,
439
+ color: t,
440
+ focused: n,
441
+ disabled: s,
442
+ error: u,
443
+ filled: d,
444
+ required: f
445
+ } = r, c = {
446
+ root: ["root", `color${T(t)}`, s && "disabled", u && "error", d && "filled", n && "focused", f && "required"],
447
+ asterisk: ["asterisk", u && "error"]
448
+ };
449
+ return A(c, fe, o);
450
+ }, me = N("label", {
451
+ name: "MuiFormLabel",
452
+ slot: "Root",
453
+ overridesResolver: (r, o) => {
454
+ const {
455
+ ownerState: t
456
+ } = r;
457
+ return [o.root, t.color === "secondary" && o.colorSecondary, t.filled && o.filled];
458
+ }
459
+ })(H(({
460
+ theme: r
461
+ }) => ({
462
+ color: (r.vars || r).palette.text.secondary,
463
+ ...r.typography.body1,
464
+ lineHeight: "1.4375em",
465
+ padding: 0,
466
+ position: "relative",
467
+ variants: [...Object.entries(r.palette).filter(re()).map(([o]) => ({
468
+ props: {
469
+ color: o
470
+ },
471
+ style: {
472
+ [`&.${x.focused}`]: {
473
+ color: (r.vars || r).palette[o].main
474
+ }
475
+ }
476
+ })), {
477
+ props: {},
478
+ style: {
479
+ [`&.${x.disabled}`]: {
480
+ color: (r.vars || r).palette.text.disabled
481
+ },
482
+ [`&.${x.error}`]: {
483
+ color: (r.vars || r).palette.error.main
484
+ }
485
+ }
486
+ }]
487
+ }))), be = N("span", {
488
+ name: "MuiFormLabel",
489
+ slot: "Asterisk"
490
+ })(H(({
491
+ theme: r
492
+ }) => ({
493
+ [`&.${x.error}`]: {
494
+ color: (r.vars || r).palette.error.main
495
+ }
496
+ }))), ye = /* @__PURE__ */ a.forwardRef(function(o, t) {
497
+ const n = L({
498
+ props: o,
499
+ name: "MuiFormLabel"
500
+ }), {
501
+ children: s,
502
+ className: u,
503
+ color: d,
504
+ component: f = "label",
505
+ disabled: c,
506
+ error: b,
507
+ filled: C,
508
+ focused: g,
509
+ required: v,
510
+ ...h
511
+ } = n, y = Q(), i = X({
512
+ props: n,
513
+ muiFormControl: y,
514
+ states: ["color", "required", "focused", "disabled", "error", "filled"]
515
+ }), l = {
516
+ ...n,
517
+ color: i.color || "primary",
518
+ component: f,
519
+ disabled: i.disabled,
520
+ error: i.error,
521
+ filled: i.filled,
522
+ focused: i.focused,
523
+ required: i.required
524
+ }, p = pe(l);
525
+ return /* @__PURE__ */ P(me, {
526
+ as: f,
527
+ ownerState: l,
528
+ className: $(p.root, u),
529
+ ref: t,
530
+ ...h,
531
+ children: [s, i.required && /* @__PURE__ */ P(be, {
532
+ ownerState: l,
533
+ "aria-hidden": !0,
534
+ className: p.asterisk,
535
+ children: [" ", "*"]
536
+ })]
537
+ });
538
+ });
539
+ process.env.NODE_ENV !== "production" && (ye.propTypes = {
540
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
541
+ // │ These PropTypes are generated from the TypeScript type definitions. │
542
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
543
+ // └─────────────────────────────────────────────────────────────────────┘
544
+ /**
545
+ * The content of the component.
546
+ */
547
+ children: e.node,
548
+ /**
549
+ * Override or extend the styles applied to the component.
550
+ */
551
+ classes: e.object,
552
+ /**
553
+ * @ignore
554
+ */
555
+ className: e.string,
556
+ /**
557
+ * The color of the component.
558
+ * It supports both default and custom theme colors, which can be added as shown in the
559
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
560
+ */
561
+ color: e.oneOfType([e.oneOf(["error", "info", "primary", "secondary", "success", "warning"]), e.string]),
562
+ /**
563
+ * The component used for the root node.
564
+ * Either a string to use a HTML element or a component.
565
+ */
566
+ component: e.elementType,
567
+ /**
568
+ * If `true`, the label should be displayed in a disabled state.
569
+ */
570
+ disabled: e.bool,
571
+ /**
572
+ * If `true`, the label is displayed in an error state.
573
+ */
574
+ error: e.bool,
575
+ /**
576
+ * If `true`, the label should use filled classes key.
577
+ */
578
+ filled: e.bool,
579
+ /**
580
+ * If `true`, the input of this label is focused (used by `FormGroup` components).
581
+ */
582
+ focused: e.bool,
583
+ /**
584
+ * If `true`, the label will indicate that the `input` is required.
585
+ */
586
+ required: e.bool,
587
+ /**
588
+ * The system prop that allows defining system overrides as well as additional CSS styles.
589
+ */
590
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
591
+ });
592
+ export {
593
+ ie as F,
594
+ ye as a,
595
+ ue as b,
596
+ Ce as c,
597
+ x as d,
598
+ X as f,
599
+ G as i
600
+ };