@fangzsx/component-library 0.0.7 → 0.0.8
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/ButtonBase-CAtBagnK.js +4293 -0
- package/dist/Paper-CAUsv8qs.js +183 -0
- package/dist/colors-BYtTt7gN.js +18 -0
- package/dist/colors.json.d.ts +65 -2
- package/dist/components/AppBarPublic/index.js +245 -375
- package/dist/components/Banner/index.d.ts +10 -0
- package/dist/components/Banner/index.js +37 -0
- package/dist/components/Button/index.d.ts +5 -1
- package/dist/components/Button/index.js +3 -2
- package/dist/components/Checkbox/index.d.ts +3 -0
- package/dist/components/Checkbox/index.js +783 -0
- package/dist/components/FlatBanner/index.d.ts +9 -0
- package/dist/components/FlatBanner/index.js +32 -0
- package/dist/components/MediaCardWithAction/index.d.ts +10 -0
- package/dist/components/MediaCardWithAction/index.js +650 -0
- package/dist/createSvgIcon-DAI5icic.js +242 -0
- package/dist/index-DGepNtNg.js +971 -0
- package/dist/main.d.ts +4 -0
- package/dist/main.js +16 -8
- package/package.json +5 -3
- package/dist/index-DP5i7LPc.js +0 -5416
|
@@ -0,0 +1,783 @@
|
|
|
1
|
+
import { jsxs as ae, jsx as k } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { c as I, g as q, a as D, p as ie, s as j, b as B, d as L, B as le, k as _, P as o, q as de, u as ue, m as pe, j as V } from "../../ButtonBase-CAtBagnK.js";
|
|
4
|
+
import { c as $ } from "../../createSvgIcon-DAI5icic.js";
|
|
5
|
+
function fe(e) {
|
|
6
|
+
const {
|
|
7
|
+
controlled: t,
|
|
8
|
+
default: n,
|
|
9
|
+
name: s,
|
|
10
|
+
state: c = "value"
|
|
11
|
+
} = e, {
|
|
12
|
+
current: a
|
|
13
|
+
} = f.useRef(t !== void 0), [u, r] = f.useState(n), i = a ? t : u;
|
|
14
|
+
if (process.env.NODE_ENV !== "production") {
|
|
15
|
+
f.useEffect(() => {
|
|
16
|
+
a !== (t !== void 0) && console.error([`MUI: A component is changing the ${a ? "" : "un"}controlled ${c} state of ${s} to be ${a ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${s} 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(`
|
|
17
|
+
`));
|
|
18
|
+
}, [c, s, t]);
|
|
19
|
+
const {
|
|
20
|
+
current: d
|
|
21
|
+
} = f.useRef(n);
|
|
22
|
+
f.useEffect(() => {
|
|
23
|
+
!a && JSON.stringify(n) !== JSON.stringify(d) && console.error([`MUI: A component is changing the default ${c} state of an uncontrolled ${s} after being initialized. To suppress this warning opt to use a controlled ${s}.`].join(`
|
|
24
|
+
`));
|
|
25
|
+
}, [JSON.stringify(n)]);
|
|
26
|
+
}
|
|
27
|
+
const l = f.useCallback((d) => {
|
|
28
|
+
a || r(d);
|
|
29
|
+
}, []);
|
|
30
|
+
return [i, l];
|
|
31
|
+
}
|
|
32
|
+
function me(e, t) {
|
|
33
|
+
const n = e.charCodeAt(2);
|
|
34
|
+
return e[0] === "o" && e[1] === "n" && n >= 65 && n <= 90 && typeof t == "function";
|
|
35
|
+
}
|
|
36
|
+
function he(e, t) {
|
|
37
|
+
if (!e)
|
|
38
|
+
return t;
|
|
39
|
+
function n(u, r) {
|
|
40
|
+
const i = {};
|
|
41
|
+
return Object.keys(r).forEach((l) => {
|
|
42
|
+
me(l, r[l]) && typeof u[l] == "function" && (i[l] = (...d) => {
|
|
43
|
+
u[l](...d), r[l](...d);
|
|
44
|
+
});
|
|
45
|
+
}), i;
|
|
46
|
+
}
|
|
47
|
+
if (typeof e == "function" || typeof t == "function")
|
|
48
|
+
return (u) => {
|
|
49
|
+
const r = typeof t == "function" ? t(u) : t, i = typeof e == "function" ? e({
|
|
50
|
+
...u,
|
|
51
|
+
...r
|
|
52
|
+
}) : e, l = I(u?.className, r?.className, i?.className), d = n(i, r);
|
|
53
|
+
return {
|
|
54
|
+
...r,
|
|
55
|
+
...i,
|
|
56
|
+
...d,
|
|
57
|
+
...!!l && {
|
|
58
|
+
className: l
|
|
59
|
+
},
|
|
60
|
+
...r?.style && i?.style && {
|
|
61
|
+
style: {
|
|
62
|
+
...r.style,
|
|
63
|
+
...i.style
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
...r?.sx && i?.sx && {
|
|
67
|
+
sx: [...Array.isArray(r.sx) ? r.sx : [r.sx], ...Array.isArray(i.sx) ? i.sx : [i.sx]]
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
const s = t, c = n(e, s), a = I(s?.className, e?.className);
|
|
72
|
+
return {
|
|
73
|
+
...t,
|
|
74
|
+
...e,
|
|
75
|
+
...c,
|
|
76
|
+
...!!a && {
|
|
77
|
+
className: a
|
|
78
|
+
},
|
|
79
|
+
...s?.style && e?.style && {
|
|
80
|
+
style: {
|
|
81
|
+
...s.style,
|
|
82
|
+
...e.style
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
...s?.sx && e?.sx && {
|
|
86
|
+
sx: [...Array.isArray(s.sx) ? s.sx : [s.sx], ...Array.isArray(e.sx) ? e.sx : [e.sx]]
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const J = /* @__PURE__ */ f.createContext(void 0);
|
|
91
|
+
process.env.NODE_ENV !== "production" && (J.displayName = "FormControlContext");
|
|
92
|
+
function ye() {
|
|
93
|
+
return f.useContext(J);
|
|
94
|
+
}
|
|
95
|
+
function be(e) {
|
|
96
|
+
return q("PrivateSwitchBase", e);
|
|
97
|
+
}
|
|
98
|
+
D("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
|
|
99
|
+
function ge(e) {
|
|
100
|
+
return typeof e == "string";
|
|
101
|
+
}
|
|
102
|
+
function Ce(e, t, n) {
|
|
103
|
+
return e === void 0 || ge(e) ? t : {
|
|
104
|
+
...t,
|
|
105
|
+
ownerState: {
|
|
106
|
+
...t.ownerState,
|
|
107
|
+
...n
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function xe(e, t, n) {
|
|
112
|
+
return typeof e == "function" ? e(t, n) : e;
|
|
113
|
+
}
|
|
114
|
+
function ke(e, t = []) {
|
|
115
|
+
if (e === void 0)
|
|
116
|
+
return {};
|
|
117
|
+
const n = {};
|
|
118
|
+
return Object.keys(e).filter((s) => s.match(/^on[A-Z]/) && typeof e[s] == "function" && !t.includes(s)).forEach((s) => {
|
|
119
|
+
n[s] = e[s];
|
|
120
|
+
}), n;
|
|
121
|
+
}
|
|
122
|
+
function U(e) {
|
|
123
|
+
if (e === void 0)
|
|
124
|
+
return {};
|
|
125
|
+
const t = {};
|
|
126
|
+
return Object.keys(e).filter((n) => !(n.match(/^on[A-Z]/) && typeof e[n] == "function")).forEach((n) => {
|
|
127
|
+
t[n] = e[n];
|
|
128
|
+
}), t;
|
|
129
|
+
}
|
|
130
|
+
function ve(e) {
|
|
131
|
+
const {
|
|
132
|
+
getSlotProps: t,
|
|
133
|
+
additionalProps: n,
|
|
134
|
+
externalSlotProps: s,
|
|
135
|
+
externalForwardedProps: c,
|
|
136
|
+
className: a
|
|
137
|
+
} = e;
|
|
138
|
+
if (!t) {
|
|
139
|
+
const y = I(n?.className, a, c?.className, s?.className), b = {
|
|
140
|
+
...n?.style,
|
|
141
|
+
...c?.style,
|
|
142
|
+
...s?.style
|
|
143
|
+
}, m = {
|
|
144
|
+
...n,
|
|
145
|
+
...c,
|
|
146
|
+
...s
|
|
147
|
+
};
|
|
148
|
+
return y.length > 0 && (m.className = y), Object.keys(b).length > 0 && (m.style = b), {
|
|
149
|
+
props: m,
|
|
150
|
+
internalRef: void 0
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
const u = ke({
|
|
154
|
+
...c,
|
|
155
|
+
...s
|
|
156
|
+
}), r = U(s), i = U(c), l = t(u), d = I(l?.className, n?.className, a, c?.className, s?.className), g = {
|
|
157
|
+
...l?.style,
|
|
158
|
+
...n?.style,
|
|
159
|
+
...c?.style,
|
|
160
|
+
...s?.style
|
|
161
|
+
}, C = {
|
|
162
|
+
...l,
|
|
163
|
+
...n,
|
|
164
|
+
...i,
|
|
165
|
+
...r
|
|
166
|
+
};
|
|
167
|
+
return d.length > 0 && (C.className = d), Object.keys(g).length > 0 && (C.style = g), {
|
|
168
|
+
props: C,
|
|
169
|
+
internalRef: l.ref
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function E(e, t) {
|
|
173
|
+
const {
|
|
174
|
+
className: n,
|
|
175
|
+
elementType: s,
|
|
176
|
+
ownerState: c,
|
|
177
|
+
externalForwardedProps: a,
|
|
178
|
+
internalForwardedProps: u,
|
|
179
|
+
shouldForwardComponentProp: r = !1,
|
|
180
|
+
...i
|
|
181
|
+
} = t, {
|
|
182
|
+
component: l,
|
|
183
|
+
slots: d = {
|
|
184
|
+
[e]: void 0
|
|
185
|
+
},
|
|
186
|
+
slotProps: g = {
|
|
187
|
+
[e]: void 0
|
|
188
|
+
},
|
|
189
|
+
...C
|
|
190
|
+
} = a, y = d[e] || s, b = xe(g[e], c), {
|
|
191
|
+
props: {
|
|
192
|
+
component: m,
|
|
193
|
+
...P
|
|
194
|
+
},
|
|
195
|
+
internalRef: w
|
|
196
|
+
} = ve({
|
|
197
|
+
className: n,
|
|
198
|
+
...i,
|
|
199
|
+
externalForwardedProps: e === "root" ? C : void 0,
|
|
200
|
+
externalSlotProps: b
|
|
201
|
+
}), v = ie(w, b?.ref, t.ref), x = e === "root" ? m || l : m, O = Ce(y, {
|
|
202
|
+
...e === "root" && !l && !d[e] && u,
|
|
203
|
+
...e !== "root" && !d[e] && u,
|
|
204
|
+
...P,
|
|
205
|
+
...x && !r && {
|
|
206
|
+
as: x
|
|
207
|
+
},
|
|
208
|
+
...x && r && {
|
|
209
|
+
component: x
|
|
210
|
+
},
|
|
211
|
+
ref: v
|
|
212
|
+
}, c);
|
|
213
|
+
return [y, O];
|
|
214
|
+
}
|
|
215
|
+
const Ne = (e) => {
|
|
216
|
+
const {
|
|
217
|
+
classes: t,
|
|
218
|
+
checked: n,
|
|
219
|
+
disabled: s,
|
|
220
|
+
edge: c
|
|
221
|
+
} = e, a = {
|
|
222
|
+
root: ["root", n && "checked", s && "disabled", c && `edge${B(c)}`],
|
|
223
|
+
input: ["input"]
|
|
224
|
+
};
|
|
225
|
+
return L(a, be, t);
|
|
226
|
+
}, Pe = j(le, {
|
|
227
|
+
name: "MuiSwitchBase"
|
|
228
|
+
})({
|
|
229
|
+
padding: 9,
|
|
230
|
+
borderRadius: "50%",
|
|
231
|
+
variants: [{
|
|
232
|
+
props: {
|
|
233
|
+
edge: "start",
|
|
234
|
+
size: "small"
|
|
235
|
+
},
|
|
236
|
+
style: {
|
|
237
|
+
marginLeft: -3
|
|
238
|
+
}
|
|
239
|
+
}, {
|
|
240
|
+
props: ({
|
|
241
|
+
edge: e,
|
|
242
|
+
ownerState: t
|
|
243
|
+
}) => e === "start" && t.size !== "small",
|
|
244
|
+
style: {
|
|
245
|
+
marginLeft: -12
|
|
246
|
+
}
|
|
247
|
+
}, {
|
|
248
|
+
props: {
|
|
249
|
+
edge: "end",
|
|
250
|
+
size: "small"
|
|
251
|
+
},
|
|
252
|
+
style: {
|
|
253
|
+
marginRight: -3
|
|
254
|
+
}
|
|
255
|
+
}, {
|
|
256
|
+
props: ({
|
|
257
|
+
edge: e,
|
|
258
|
+
ownerState: t
|
|
259
|
+
}) => e === "end" && t.size !== "small",
|
|
260
|
+
style: {
|
|
261
|
+
marginRight: -12
|
|
262
|
+
}
|
|
263
|
+
}]
|
|
264
|
+
}), we = j("input", {
|
|
265
|
+
name: "MuiSwitchBase",
|
|
266
|
+
shouldForwardProp: _
|
|
267
|
+
})({
|
|
268
|
+
cursor: "inherit",
|
|
269
|
+
position: "absolute",
|
|
270
|
+
opacity: 0,
|
|
271
|
+
width: "100%",
|
|
272
|
+
height: "100%",
|
|
273
|
+
top: 0,
|
|
274
|
+
left: 0,
|
|
275
|
+
margin: 0,
|
|
276
|
+
padding: 0,
|
|
277
|
+
zIndex: 1
|
|
278
|
+
}), W = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
279
|
+
const {
|
|
280
|
+
autoFocus: s,
|
|
281
|
+
checked: c,
|
|
282
|
+
checkedIcon: a,
|
|
283
|
+
defaultChecked: u,
|
|
284
|
+
disabled: r,
|
|
285
|
+
disableFocusRipple: i = !1,
|
|
286
|
+
edge: l = !1,
|
|
287
|
+
icon: d,
|
|
288
|
+
id: g,
|
|
289
|
+
inputProps: C,
|
|
290
|
+
inputRef: y,
|
|
291
|
+
name: b,
|
|
292
|
+
onBlur: m,
|
|
293
|
+
onChange: P,
|
|
294
|
+
onFocus: w,
|
|
295
|
+
readOnly: v,
|
|
296
|
+
required: x = !1,
|
|
297
|
+
tabIndex: O,
|
|
298
|
+
type: R,
|
|
299
|
+
value: S,
|
|
300
|
+
slots: G = {},
|
|
301
|
+
slotProps: K = {},
|
|
302
|
+
...Q
|
|
303
|
+
} = t, [A, X] = fe({
|
|
304
|
+
controlled: c,
|
|
305
|
+
default: !!u,
|
|
306
|
+
name: "SwitchBase",
|
|
307
|
+
state: "checked"
|
|
308
|
+
}), N = ye(), Y = (p) => {
|
|
309
|
+
w && w(p), N && N.onFocus && N.onFocus(p);
|
|
310
|
+
}, ee = (p) => {
|
|
311
|
+
m && m(p), N && N.onBlur && N.onBlur(p);
|
|
312
|
+
}, oe = (p) => {
|
|
313
|
+
if (p.nativeEvent.defaultPrevented || v)
|
|
314
|
+
return;
|
|
315
|
+
const h = p.target.checked;
|
|
316
|
+
X(h), P && P(p, h);
|
|
317
|
+
};
|
|
318
|
+
let F = r;
|
|
319
|
+
N && typeof F > "u" && (F = N.disabled);
|
|
320
|
+
const te = R === "checkbox" || R === "radio", T = {
|
|
321
|
+
...t,
|
|
322
|
+
checked: A,
|
|
323
|
+
disabled: F,
|
|
324
|
+
disableFocusRipple: i,
|
|
325
|
+
edge: l
|
|
326
|
+
}, H = Ne(T), M = {
|
|
327
|
+
slots: G,
|
|
328
|
+
slotProps: {
|
|
329
|
+
input: C,
|
|
330
|
+
...K
|
|
331
|
+
}
|
|
332
|
+
}, [ne, se] = E("root", {
|
|
333
|
+
ref: n,
|
|
334
|
+
elementType: Pe,
|
|
335
|
+
className: H.root,
|
|
336
|
+
shouldForwardComponentProp: !0,
|
|
337
|
+
externalForwardedProps: {
|
|
338
|
+
...M,
|
|
339
|
+
component: "span",
|
|
340
|
+
...Q
|
|
341
|
+
},
|
|
342
|
+
getSlotProps: (p) => ({
|
|
343
|
+
...p,
|
|
344
|
+
onFocus: (h) => {
|
|
345
|
+
p.onFocus?.(h), Y(h);
|
|
346
|
+
},
|
|
347
|
+
onBlur: (h) => {
|
|
348
|
+
p.onBlur?.(h), ee(h);
|
|
349
|
+
}
|
|
350
|
+
}),
|
|
351
|
+
ownerState: T,
|
|
352
|
+
additionalProps: {
|
|
353
|
+
centerRipple: !0,
|
|
354
|
+
focusRipple: !i,
|
|
355
|
+
disabled: F,
|
|
356
|
+
role: void 0,
|
|
357
|
+
tabIndex: null
|
|
358
|
+
}
|
|
359
|
+
}), [re, ce] = E("input", {
|
|
360
|
+
ref: y,
|
|
361
|
+
elementType: we,
|
|
362
|
+
className: H.input,
|
|
363
|
+
externalForwardedProps: M,
|
|
364
|
+
getSlotProps: (p) => ({
|
|
365
|
+
...p,
|
|
366
|
+
onChange: (h) => {
|
|
367
|
+
p.onChange?.(h), oe(h);
|
|
368
|
+
}
|
|
369
|
+
}),
|
|
370
|
+
ownerState: T,
|
|
371
|
+
additionalProps: {
|
|
372
|
+
autoFocus: s,
|
|
373
|
+
checked: c,
|
|
374
|
+
defaultChecked: u,
|
|
375
|
+
disabled: F,
|
|
376
|
+
id: te ? g : void 0,
|
|
377
|
+
name: b,
|
|
378
|
+
readOnly: v,
|
|
379
|
+
required: x,
|
|
380
|
+
tabIndex: O,
|
|
381
|
+
type: R,
|
|
382
|
+
...R === "checkbox" && S === void 0 ? {} : {
|
|
383
|
+
value: S
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
return /* @__PURE__ */ ae(ne, {
|
|
388
|
+
...se,
|
|
389
|
+
children: [/* @__PURE__ */ k(re, {
|
|
390
|
+
...ce
|
|
391
|
+
}), A ? a : d]
|
|
392
|
+
});
|
|
393
|
+
});
|
|
394
|
+
process.env.NODE_ENV !== "production" && (W.propTypes = {
|
|
395
|
+
/**
|
|
396
|
+
* If `true`, the `input` element is focused during the first mount.
|
|
397
|
+
*/
|
|
398
|
+
autoFocus: o.bool,
|
|
399
|
+
/**
|
|
400
|
+
* If `true`, the component is checked.
|
|
401
|
+
*/
|
|
402
|
+
checked: o.bool,
|
|
403
|
+
/**
|
|
404
|
+
* The icon to display when the component is checked.
|
|
405
|
+
*/
|
|
406
|
+
checkedIcon: o.node.isRequired,
|
|
407
|
+
/**
|
|
408
|
+
* Override or extend the styles applied to the component.
|
|
409
|
+
*/
|
|
410
|
+
classes: o.object,
|
|
411
|
+
/**
|
|
412
|
+
* @ignore
|
|
413
|
+
*/
|
|
414
|
+
className: o.string,
|
|
415
|
+
/**
|
|
416
|
+
* @ignore
|
|
417
|
+
*/
|
|
418
|
+
defaultChecked: o.bool,
|
|
419
|
+
/**
|
|
420
|
+
* If `true`, the component is disabled.
|
|
421
|
+
*/
|
|
422
|
+
disabled: o.bool,
|
|
423
|
+
/**
|
|
424
|
+
* If `true`, the keyboard focus ripple is disabled.
|
|
425
|
+
* @default false
|
|
426
|
+
*/
|
|
427
|
+
disableFocusRipple: o.bool,
|
|
428
|
+
/**
|
|
429
|
+
* If given, uses a negative margin to counteract the padding on one
|
|
430
|
+
* side (this is often helpful for aligning the left or right
|
|
431
|
+
* side of the icon with content above or below, without ruining the border
|
|
432
|
+
* size and shape).
|
|
433
|
+
* @default false
|
|
434
|
+
*/
|
|
435
|
+
edge: o.oneOf(["end", "start", !1]),
|
|
436
|
+
/**
|
|
437
|
+
* The icon to display when the component is unchecked.
|
|
438
|
+
*/
|
|
439
|
+
icon: o.node.isRequired,
|
|
440
|
+
/**
|
|
441
|
+
* The id of the `input` element.
|
|
442
|
+
*/
|
|
443
|
+
id: o.string,
|
|
444
|
+
/**
|
|
445
|
+
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#attributes) applied to the `input` element.
|
|
446
|
+
*/
|
|
447
|
+
inputProps: o.object,
|
|
448
|
+
/**
|
|
449
|
+
* Pass a ref to the `input` element.
|
|
450
|
+
*/
|
|
451
|
+
inputRef: de,
|
|
452
|
+
/*
|
|
453
|
+
* @ignore
|
|
454
|
+
*/
|
|
455
|
+
name: o.string,
|
|
456
|
+
/**
|
|
457
|
+
* @ignore
|
|
458
|
+
*/
|
|
459
|
+
onBlur: o.func,
|
|
460
|
+
/**
|
|
461
|
+
* Callback fired when the state is changed.
|
|
462
|
+
*
|
|
463
|
+
* @param {object} event The event source of the callback.
|
|
464
|
+
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
|
465
|
+
*/
|
|
466
|
+
onChange: o.func,
|
|
467
|
+
/**
|
|
468
|
+
* @ignore
|
|
469
|
+
*/
|
|
470
|
+
onFocus: o.func,
|
|
471
|
+
/**
|
|
472
|
+
* It prevents the user from changing the value of the field
|
|
473
|
+
* (not from interacting with the field).
|
|
474
|
+
*/
|
|
475
|
+
readOnly: o.bool,
|
|
476
|
+
/**
|
|
477
|
+
* If `true`, the `input` element is required.
|
|
478
|
+
*/
|
|
479
|
+
required: o.bool,
|
|
480
|
+
/**
|
|
481
|
+
* The props used for each slot inside.
|
|
482
|
+
* @default {}
|
|
483
|
+
*/
|
|
484
|
+
slotProps: o.shape({
|
|
485
|
+
input: o.oneOfType([o.func, o.object]),
|
|
486
|
+
root: o.oneOfType([o.func, o.object])
|
|
487
|
+
}),
|
|
488
|
+
/**
|
|
489
|
+
* The components used for each slot inside.
|
|
490
|
+
* @default {}
|
|
491
|
+
*/
|
|
492
|
+
slots: o.shape({
|
|
493
|
+
input: o.elementType,
|
|
494
|
+
root: o.elementType
|
|
495
|
+
}),
|
|
496
|
+
/**
|
|
497
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
498
|
+
*/
|
|
499
|
+
sx: o.object,
|
|
500
|
+
/**
|
|
501
|
+
* @ignore
|
|
502
|
+
*/
|
|
503
|
+
tabIndex: o.oneOfType([o.number, o.string]),
|
|
504
|
+
/**
|
|
505
|
+
* The input component prop `type`.
|
|
506
|
+
*/
|
|
507
|
+
type: o.string.isRequired,
|
|
508
|
+
/**
|
|
509
|
+
* The value of the component.
|
|
510
|
+
*/
|
|
511
|
+
value: o.any
|
|
512
|
+
});
|
|
513
|
+
const Oe = $(/* @__PURE__ */ k("path", {
|
|
514
|
+
d: "M19 5v14H5V5h14m0-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-2z"
|
|
515
|
+
}), "CheckBoxOutlineBlank"), Re = $(/* @__PURE__ */ k("path", {
|
|
516
|
+
d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
|
517
|
+
}), "CheckBox"), Fe = $(/* @__PURE__ */ k("path", {
|
|
518
|
+
d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"
|
|
519
|
+
}), "IndeterminateCheckBox");
|
|
520
|
+
function Ie(e) {
|
|
521
|
+
return q("MuiCheckbox", e);
|
|
522
|
+
}
|
|
523
|
+
const z = D("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "colorPrimary", "colorSecondary", "sizeSmall", "sizeMedium"]), Be = (e) => {
|
|
524
|
+
const {
|
|
525
|
+
classes: t,
|
|
526
|
+
indeterminate: n,
|
|
527
|
+
color: s,
|
|
528
|
+
size: c
|
|
529
|
+
} = e, a = {
|
|
530
|
+
root: ["root", n && "indeterminate", `color${B(s)}`, `size${B(c)}`]
|
|
531
|
+
}, u = L(a, Ie, t);
|
|
532
|
+
return {
|
|
533
|
+
...t,
|
|
534
|
+
// forward the disabled and checked classes to the SwitchBase
|
|
535
|
+
...u
|
|
536
|
+
};
|
|
537
|
+
}, Se = j(W, {
|
|
538
|
+
shouldForwardProp: (e) => _(e) || e === "classes",
|
|
539
|
+
name: "MuiCheckbox",
|
|
540
|
+
slot: "Root",
|
|
541
|
+
overridesResolver: (e, t) => {
|
|
542
|
+
const {
|
|
543
|
+
ownerState: n
|
|
544
|
+
} = e;
|
|
545
|
+
return [t.root, n.indeterminate && t.indeterminate, t[`size${B(n.size)}`], n.color !== "default" && t[`color${B(n.color)}`]];
|
|
546
|
+
}
|
|
547
|
+
})(pe(({
|
|
548
|
+
theme: e
|
|
549
|
+
}) => ({
|
|
550
|
+
color: (e.vars || e).palette.text.secondary,
|
|
551
|
+
variants: [{
|
|
552
|
+
props: {
|
|
553
|
+
color: "default",
|
|
554
|
+
disableRipple: !1
|
|
555
|
+
},
|
|
556
|
+
style: {
|
|
557
|
+
"&:hover": {
|
|
558
|
+
backgroundColor: e.alpha((e.vars || e).palette.action.active, (e.vars || e).palette.action.hoverOpacity)
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}, ...Object.entries(e.palette).filter(V()).map(([t]) => ({
|
|
562
|
+
props: {
|
|
563
|
+
color: t,
|
|
564
|
+
disableRipple: !1
|
|
565
|
+
},
|
|
566
|
+
style: {
|
|
567
|
+
"&:hover": {
|
|
568
|
+
backgroundColor: e.alpha((e.vars || e).palette[t].main, (e.vars || e).palette.action.hoverOpacity)
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
})), ...Object.entries(e.palette).filter(V()).map(([t]) => ({
|
|
572
|
+
props: {
|
|
573
|
+
color: t
|
|
574
|
+
},
|
|
575
|
+
style: {
|
|
576
|
+
[`&.${z.checked}, &.${z.indeterminate}`]: {
|
|
577
|
+
color: (e.vars || e).palette[t].main
|
|
578
|
+
},
|
|
579
|
+
[`&.${z.disabled}`]: {
|
|
580
|
+
color: (e.vars || e).palette.action.disabled
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
})), {
|
|
584
|
+
// Should be last to override other colors
|
|
585
|
+
props: {
|
|
586
|
+
disableRipple: !1
|
|
587
|
+
},
|
|
588
|
+
style: {
|
|
589
|
+
// Reset on touch devices, it doesn't add specificity
|
|
590
|
+
"&:hover": {
|
|
591
|
+
"@media (hover: none)": {
|
|
592
|
+
backgroundColor: "transparent"
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}]
|
|
597
|
+
}))), Te = /* @__PURE__ */ k(Re, {}), ze = /* @__PURE__ */ k(Oe, {}), Ee = /* @__PURE__ */ k(Fe, {}), Z = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
598
|
+
const s = ue({
|
|
599
|
+
props: t,
|
|
600
|
+
name: "MuiCheckbox"
|
|
601
|
+
}), {
|
|
602
|
+
checkedIcon: c = Te,
|
|
603
|
+
color: a = "primary",
|
|
604
|
+
icon: u = ze,
|
|
605
|
+
indeterminate: r = !1,
|
|
606
|
+
indeterminateIcon: i = Ee,
|
|
607
|
+
inputProps: l,
|
|
608
|
+
size: d = "medium",
|
|
609
|
+
disableRipple: g = !1,
|
|
610
|
+
className: C,
|
|
611
|
+
slots: y = {},
|
|
612
|
+
slotProps: b = {},
|
|
613
|
+
...m
|
|
614
|
+
} = s, P = r ? i : u, w = r ? i : c, v = {
|
|
615
|
+
...s,
|
|
616
|
+
disableRipple: g,
|
|
617
|
+
color: a,
|
|
618
|
+
indeterminate: r,
|
|
619
|
+
size: d
|
|
620
|
+
}, x = Be(v), O = b.input ?? l, [R, S] = E("root", {
|
|
621
|
+
ref: n,
|
|
622
|
+
elementType: Se,
|
|
623
|
+
className: I(x.root, C),
|
|
624
|
+
shouldForwardComponentProp: !0,
|
|
625
|
+
externalForwardedProps: {
|
|
626
|
+
slots: y,
|
|
627
|
+
slotProps: b,
|
|
628
|
+
...m
|
|
629
|
+
},
|
|
630
|
+
ownerState: v,
|
|
631
|
+
additionalProps: {
|
|
632
|
+
type: "checkbox",
|
|
633
|
+
icon: /* @__PURE__ */ f.cloneElement(P, {
|
|
634
|
+
fontSize: P.props.fontSize ?? d
|
|
635
|
+
}),
|
|
636
|
+
checkedIcon: /* @__PURE__ */ f.cloneElement(w, {
|
|
637
|
+
fontSize: w.props.fontSize ?? d
|
|
638
|
+
}),
|
|
639
|
+
disableRipple: g,
|
|
640
|
+
slots: y,
|
|
641
|
+
slotProps: {
|
|
642
|
+
input: he(typeof O == "function" ? O(v) : O, {
|
|
643
|
+
"data-indeterminate": r
|
|
644
|
+
})
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
return /* @__PURE__ */ k(R, {
|
|
649
|
+
...S,
|
|
650
|
+
classes: x
|
|
651
|
+
});
|
|
652
|
+
});
|
|
653
|
+
process.env.NODE_ENV !== "production" && (Z.propTypes = {
|
|
654
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
655
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
656
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
657
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
658
|
+
/**
|
|
659
|
+
* If `true`, the component is checked.
|
|
660
|
+
*/
|
|
661
|
+
checked: o.bool,
|
|
662
|
+
/**
|
|
663
|
+
* The icon to display when the component is checked.
|
|
664
|
+
* @default <CheckBoxIcon />
|
|
665
|
+
*/
|
|
666
|
+
checkedIcon: o.node,
|
|
667
|
+
/**
|
|
668
|
+
* Override or extend the styles applied to the component.
|
|
669
|
+
*/
|
|
670
|
+
classes: o.object,
|
|
671
|
+
/**
|
|
672
|
+
* @ignore
|
|
673
|
+
*/
|
|
674
|
+
className: o.string,
|
|
675
|
+
/**
|
|
676
|
+
* The color of the component.
|
|
677
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
678
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
679
|
+
* @default 'primary'
|
|
680
|
+
*/
|
|
681
|
+
color: o.oneOfType([o.oneOf(["default", "primary", "secondary", "error", "info", "success", "warning"]), o.string]),
|
|
682
|
+
/**
|
|
683
|
+
* The default checked state. Use when the component is not controlled.
|
|
684
|
+
*/
|
|
685
|
+
defaultChecked: o.bool,
|
|
686
|
+
/**
|
|
687
|
+
* If `true`, the component is disabled.
|
|
688
|
+
* @default false
|
|
689
|
+
*/
|
|
690
|
+
disabled: o.bool,
|
|
691
|
+
/**
|
|
692
|
+
* If `true`, the ripple effect is disabled.
|
|
693
|
+
* @default false
|
|
694
|
+
*/
|
|
695
|
+
disableRipple: o.bool,
|
|
696
|
+
/**
|
|
697
|
+
* The icon to display when the component is unchecked.
|
|
698
|
+
* @default <CheckBoxOutlineBlankIcon />
|
|
699
|
+
*/
|
|
700
|
+
icon: o.node,
|
|
701
|
+
/**
|
|
702
|
+
* The id of the `input` element.
|
|
703
|
+
*/
|
|
704
|
+
id: o.string,
|
|
705
|
+
/**
|
|
706
|
+
* If `true`, the component appears indeterminate.
|
|
707
|
+
* This does not set the native input element to indeterminate due
|
|
708
|
+
* to inconsistent behavior across browsers.
|
|
709
|
+
* However, we set a `data-indeterminate` attribute on the `input`.
|
|
710
|
+
* @default false
|
|
711
|
+
*/
|
|
712
|
+
indeterminate: o.bool,
|
|
713
|
+
/**
|
|
714
|
+
* The icon to display when the component is indeterminate.
|
|
715
|
+
* @default <IndeterminateCheckBoxIcon />
|
|
716
|
+
*/
|
|
717
|
+
indeterminateIcon: o.node,
|
|
718
|
+
/**
|
|
719
|
+
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#attributes) applied to the `input` element.
|
|
720
|
+
* @deprecated Use `slotProps.input` 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.
|
|
721
|
+
*/
|
|
722
|
+
inputProps: o.object,
|
|
723
|
+
/**
|
|
724
|
+
* Callback fired when the state is changed.
|
|
725
|
+
*
|
|
726
|
+
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
727
|
+
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
|
728
|
+
*/
|
|
729
|
+
onChange: o.func,
|
|
730
|
+
/**
|
|
731
|
+
* If `true`, the `input` element is required.
|
|
732
|
+
* @default false
|
|
733
|
+
*/
|
|
734
|
+
required: o.bool,
|
|
735
|
+
/**
|
|
736
|
+
* The size of the component.
|
|
737
|
+
* `small` is equivalent to the dense checkbox styling.
|
|
738
|
+
* @default 'medium'
|
|
739
|
+
*/
|
|
740
|
+
size: o.oneOfType([o.oneOf(["medium", "small"]), o.string]),
|
|
741
|
+
/**
|
|
742
|
+
* The props used for each slot inside.
|
|
743
|
+
* @default {}
|
|
744
|
+
*/
|
|
745
|
+
slotProps: o.shape({
|
|
746
|
+
input: o.oneOfType([o.func, o.object]),
|
|
747
|
+
root: o.oneOfType([o.func, o.object])
|
|
748
|
+
}),
|
|
749
|
+
/**
|
|
750
|
+
* The components used for each slot inside.
|
|
751
|
+
* @default {}
|
|
752
|
+
*/
|
|
753
|
+
slots: o.shape({
|
|
754
|
+
input: o.elementType,
|
|
755
|
+
root: o.elementType
|
|
756
|
+
}),
|
|
757
|
+
/**
|
|
758
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
759
|
+
*/
|
|
760
|
+
sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
|
|
761
|
+
/**
|
|
762
|
+
* The value of the component. The DOM API casts this to a string.
|
|
763
|
+
* The browser uses "on" as the default value.
|
|
764
|
+
*/
|
|
765
|
+
value: o.any
|
|
766
|
+
});
|
|
767
|
+
function He(e) {
|
|
768
|
+
const { className: t, sx: n, disabled: s, color: c = "blue", ...a } = e;
|
|
769
|
+
return /* @__PURE__ */ k(
|
|
770
|
+
Z,
|
|
771
|
+
{
|
|
772
|
+
className: t,
|
|
773
|
+
disabled: s,
|
|
774
|
+
...a,
|
|
775
|
+
sx: {
|
|
776
|
+
...n
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
);
|
|
780
|
+
}
|
|
781
|
+
export {
|
|
782
|
+
He as CheckBox
|
|
783
|
+
};
|