kdpa-components 0.0.11 → 0.0.12

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.
@@ -1,9 +1,1127 @@
1
- import { K as c, a as d, b as m } from "../../KdpaAccordions-0a0aa0f8.js";
2
- import "../../ButtonBase-5ef58bca.js";
3
- import "react";
4
- import "react-dom";
1
+ import { P as e, _ as Ne, a as W, T as ue, g as Q, b as Y, s as N, c as p, u as Z, d as Se, e as Ae, j as h, f as P, h as De, i as ee, k as Oe, l as we, m as $e, r as Me, B as je } from "../../ButtonBase-5ef58bca.js";
2
+ import * as u from "react";
3
+ import X from "react";
4
+ import K from "react-dom";
5
+ function Ie({
6
+ controlled: t,
7
+ default: n,
8
+ name: i,
9
+ state: s = "value"
10
+ }) {
11
+ const {
12
+ current: r
13
+ } = u.useRef(t !== void 0), [o, a] = u.useState(n), c = r ? t : o;
14
+ if (process.env.NODE_ENV !== "production") {
15
+ u.useEffect(() => {
16
+ r !== (t !== void 0) && console.error([`MUI: A component is changing the ${r ? "" : "un"}controlled ${s} state of ${i} to be ${r ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${i} 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
+ }, [s, i, t]);
19
+ const {
20
+ current: f
21
+ } = u.useRef(n);
22
+ u.useEffect(() => {
23
+ !r && f !== n && console.error([`MUI: A component is changing the default ${s} state of an uncontrolled ${i} after being initialized. To suppress this warning opt to use a controlled ${i}.`].join(`
24
+ `));
25
+ }, [JSON.stringify(n)]);
26
+ }
27
+ const l = u.useCallback((f) => {
28
+ r || a(f);
29
+ }, []);
30
+ return [c, l];
31
+ }
32
+ const de = {
33
+ disabled: !1
34
+ };
35
+ var ke = process.env.NODE_ENV !== "production" ? e.oneOfType([e.number, e.shape({
36
+ enter: e.number,
37
+ exit: e.number,
38
+ appear: e.number
39
+ }).isRequired]) : null;
40
+ process.env.NODE_ENV !== "production" && e.oneOfType([e.string, e.shape({
41
+ enter: e.string,
42
+ exit: e.string,
43
+ active: e.string
44
+ }), e.shape({
45
+ enter: e.string,
46
+ enterDone: e.string,
47
+ enterActive: e.string,
48
+ exit: e.string,
49
+ exitDone: e.string,
50
+ exitActive: e.string
51
+ })]);
52
+ var Ue = function(n) {
53
+ return n.scrollTop;
54
+ }, L = "unmounted", $ = "exited", M = "entering", U = "entered", re = "exiting", T = /* @__PURE__ */ function(t) {
55
+ Ne(n, t);
56
+ function n(s, r) {
57
+ var o;
58
+ o = t.call(this, s, r) || this;
59
+ var a = r, c = a && !a.isMounting ? s.enter : s.appear, l;
60
+ return o.appearStatus = null, s.in ? c ? (l = $, o.appearStatus = M) : l = U : s.unmountOnExit || s.mountOnEnter ? l = L : l = $, o.state = {
61
+ status: l
62
+ }, o.nextCallback = null, o;
63
+ }
64
+ n.getDerivedStateFromProps = function(r, o) {
65
+ var a = r.in;
66
+ return a && o.status === L ? {
67
+ status: $
68
+ } : null;
69
+ };
70
+ var i = n.prototype;
71
+ return i.componentDidMount = function() {
72
+ this.updateStatus(!0, this.appearStatus);
73
+ }, i.componentDidUpdate = function(r) {
74
+ var o = null;
75
+ if (r !== this.props) {
76
+ var a = this.state.status;
77
+ this.props.in ? a !== M && a !== U && (o = M) : (a === M || a === U) && (o = re);
78
+ }
79
+ this.updateStatus(!1, o);
80
+ }, i.componentWillUnmount = function() {
81
+ this.cancelNextCallback();
82
+ }, i.getTimeouts = function() {
83
+ var r = this.props.timeout, o, a, c;
84
+ return o = a = c = r, r != null && typeof r != "number" && (o = r.exit, a = r.enter, c = r.appear !== void 0 ? r.appear : a), {
85
+ exit: o,
86
+ enter: a,
87
+ appear: c
88
+ };
89
+ }, i.updateStatus = function(r, o) {
90
+ if (r === void 0 && (r = !1), o !== null)
91
+ if (this.cancelNextCallback(), o === M) {
92
+ if (this.props.unmountOnExit || this.props.mountOnEnter) {
93
+ var a = this.props.nodeRef ? this.props.nodeRef.current : K.findDOMNode(this);
94
+ a && Ue(a);
95
+ }
96
+ this.performEnter(r);
97
+ } else
98
+ this.performExit();
99
+ else
100
+ this.props.unmountOnExit && this.state.status === $ && this.setState({
101
+ status: L
102
+ });
103
+ }, i.performEnter = function(r) {
104
+ var o = this, a = this.props.enter, c = this.context ? this.context.isMounting : r, l = this.props.nodeRef ? [c] : [K.findDOMNode(this), c], f = l[0], m = l[1], g = this.getTimeouts(), v = c ? g.appear : g.enter;
105
+ if (!r && !a || de.disabled) {
106
+ this.safeSetState({
107
+ status: U
108
+ }, function() {
109
+ o.props.onEntered(f);
110
+ });
111
+ return;
112
+ }
113
+ this.props.onEnter(f, m), this.safeSetState({
114
+ status: M
115
+ }, function() {
116
+ o.props.onEntering(f, m), o.onTransitionEnd(v, function() {
117
+ o.safeSetState({
118
+ status: U
119
+ }, function() {
120
+ o.props.onEntered(f, m);
121
+ });
122
+ });
123
+ });
124
+ }, i.performExit = function() {
125
+ var r = this, o = this.props.exit, a = this.getTimeouts(), c = this.props.nodeRef ? void 0 : K.findDOMNode(this);
126
+ if (!o || de.disabled) {
127
+ this.safeSetState({
128
+ status: $
129
+ }, function() {
130
+ r.props.onExited(c);
131
+ });
132
+ return;
133
+ }
134
+ this.props.onExit(c), this.safeSetState({
135
+ status: re
136
+ }, function() {
137
+ r.props.onExiting(c), r.onTransitionEnd(a.exit, function() {
138
+ r.safeSetState({
139
+ status: $
140
+ }, function() {
141
+ r.props.onExited(c);
142
+ });
143
+ });
144
+ });
145
+ }, i.cancelNextCallback = function() {
146
+ this.nextCallback !== null && (this.nextCallback.cancel(), this.nextCallback = null);
147
+ }, i.safeSetState = function(r, o) {
148
+ o = this.setNextCallback(o), this.setState(r, o);
149
+ }, i.setNextCallback = function(r) {
150
+ var o = this, a = !0;
151
+ return this.nextCallback = function(c) {
152
+ a && (a = !1, o.nextCallback = null, r(c));
153
+ }, this.nextCallback.cancel = function() {
154
+ a = !1;
155
+ }, this.nextCallback;
156
+ }, i.onTransitionEnd = function(r, o) {
157
+ this.setNextCallback(o);
158
+ var a = this.props.nodeRef ? this.props.nodeRef.current : K.findDOMNode(this), c = r == null && !this.props.addEndListener;
159
+ if (!a || c) {
160
+ setTimeout(this.nextCallback, 0);
161
+ return;
162
+ }
163
+ if (this.props.addEndListener) {
164
+ var l = this.props.nodeRef ? [this.nextCallback] : [a, this.nextCallback], f = l[0], m = l[1];
165
+ this.props.addEndListener(f, m);
166
+ }
167
+ r != null && setTimeout(this.nextCallback, r);
168
+ }, i.render = function() {
169
+ var r = this.state.status;
170
+ if (r === L)
171
+ return null;
172
+ var o = this.props, a = o.children;
173
+ o.in, o.mountOnEnter, o.unmountOnExit, o.appear, o.enter, o.exit, o.timeout, o.addEndListener, o.onEnter, o.onEntering, o.onEntered, o.onExit, o.onExiting, o.onExited, o.nodeRef;
174
+ var c = W(o, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
175
+ return (
176
+ // allows for nested Transitions
177
+ /* @__PURE__ */ X.createElement(ue.Provider, {
178
+ value: null
179
+ }, typeof a == "function" ? a(r, c) : X.cloneElement(X.Children.only(a), c))
180
+ );
181
+ }, n;
182
+ }(X.Component);
183
+ T.contextType = ue;
184
+ T.propTypes = process.env.NODE_ENV !== "production" ? {
185
+ /**
186
+ * A React reference to DOM element that need to transition:
187
+ * https://stackoverflow.com/a/51127130/4671932
188
+ *
189
+ * - When `nodeRef` prop is used, `node` is not passed to callback functions
190
+ * (e.g. `onEnter`) because user already has direct access to the node.
191
+ * - When changing `key` prop of `Transition` in a `TransitionGroup` a new
192
+ * `nodeRef` need to be provided to `Transition` with changed `key` prop
193
+ * (see
194
+ * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
195
+ */
196
+ nodeRef: e.shape({
197
+ current: typeof Element > "u" ? e.any : function(t, n, i, s, r, o) {
198
+ var a = t[n];
199
+ return e.instanceOf(a && "ownerDocument" in a ? a.ownerDocument.defaultView.Element : Element)(t, n, i, s, r, o);
200
+ }
201
+ }),
202
+ /**
203
+ * A `function` child can be used instead of a React element. This function is
204
+ * called with the current transition status (`'entering'`, `'entered'`,
205
+ * `'exiting'`, `'exited'`), which can be used to apply context
206
+ * specific props to a component.
207
+ *
208
+ * ```jsx
209
+ * <Transition in={this.state.in} timeout={150}>
210
+ * {state => (
211
+ * <MyComponent className={`fade fade-${state}`} />
212
+ * )}
213
+ * </Transition>
214
+ * ```
215
+ */
216
+ children: e.oneOfType([e.func.isRequired, e.element.isRequired]).isRequired,
217
+ /**
218
+ * Show the component; triggers the enter or exit states
219
+ */
220
+ in: e.bool,
221
+ /**
222
+ * By default the child component is mounted immediately along with
223
+ * the parent `Transition` component. If you want to "lazy mount" the component on the
224
+ * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
225
+ * mounted, even on "exited", unless you also specify `unmountOnExit`.
226
+ */
227
+ mountOnEnter: e.bool,
228
+ /**
229
+ * By default the child component stays mounted after it reaches the `'exited'` state.
230
+ * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
231
+ */
232
+ unmountOnExit: e.bool,
233
+ /**
234
+ * By default the child component does not perform the enter transition when
235
+ * it first mounts, regardless of the value of `in`. If you want this
236
+ * behavior, set both `appear` and `in` to `true`.
237
+ *
238
+ * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
239
+ * > only adds an additional enter transition. However, in the
240
+ * > `<CSSTransition>` component that first enter transition does result in
241
+ * > additional `.appear-*` classes, that way you can choose to style it
242
+ * > differently.
243
+ */
244
+ appear: e.bool,
245
+ /**
246
+ * Enable or disable enter transitions.
247
+ */
248
+ enter: e.bool,
249
+ /**
250
+ * Enable or disable exit transitions.
251
+ */
252
+ exit: e.bool,
253
+ /**
254
+ * The duration of the transition, in milliseconds.
255
+ * Required unless `addEndListener` is provided.
256
+ *
257
+ * You may specify a single timeout for all transitions:
258
+ *
259
+ * ```jsx
260
+ * timeout={500}
261
+ * ```
262
+ *
263
+ * or individually:
264
+ *
265
+ * ```jsx
266
+ * timeout={{
267
+ * appear: 500,
268
+ * enter: 300,
269
+ * exit: 500,
270
+ * }}
271
+ * ```
272
+ *
273
+ * - `appear` defaults to the value of `enter`
274
+ * - `enter` defaults to `0`
275
+ * - `exit` defaults to `0`
276
+ *
277
+ * @type {number | { enter?: number, exit?: number, appear?: number }}
278
+ */
279
+ timeout: function(n) {
280
+ var i = ke;
281
+ n.addEndListener || (i = i.isRequired);
282
+ for (var s = arguments.length, r = new Array(s > 1 ? s - 1 : 0), o = 1; o < s; o++)
283
+ r[o - 1] = arguments[o];
284
+ return i.apply(void 0, [n].concat(r));
285
+ },
286
+ /**
287
+ * Add a custom transition end trigger. Called with the transitioning
288
+ * DOM node and a `done` callback. Allows for more fine grained transition end
289
+ * logic. Timeouts are still used as a fallback if provided.
290
+ *
291
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
292
+ *
293
+ * ```jsx
294
+ * addEndListener={(node, done) => {
295
+ * // use the css transitionend event to mark the finish of a transition
296
+ * node.addEventListener('transitionend', done, false);
297
+ * }}
298
+ * ```
299
+ */
300
+ addEndListener: e.func,
301
+ /**
302
+ * Callback fired before the "entering" status is applied. An extra parameter
303
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
304
+ *
305
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
306
+ *
307
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
308
+ */
309
+ onEnter: e.func,
310
+ /**
311
+ * Callback fired after the "entering" status is applied. An extra parameter
312
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
313
+ *
314
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
315
+ *
316
+ * @type Function(node: HtmlElement, isAppearing: bool)
317
+ */
318
+ onEntering: e.func,
319
+ /**
320
+ * Callback fired after the "entered" status is applied. An extra parameter
321
+ * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
322
+ *
323
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
324
+ *
325
+ * @type Function(node: HtmlElement, isAppearing: bool) -> void
326
+ */
327
+ onEntered: e.func,
328
+ /**
329
+ * Callback fired before the "exiting" status is applied.
330
+ *
331
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
332
+ *
333
+ * @type Function(node: HtmlElement) -> void
334
+ */
335
+ onExit: e.func,
336
+ /**
337
+ * Callback fired after the "exiting" status is applied.
338
+ *
339
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed.
340
+ *
341
+ * @type Function(node: HtmlElement) -> void
342
+ */
343
+ onExiting: e.func,
344
+ /**
345
+ * Callback fired after the "exited" status is applied.
346
+ *
347
+ * **Note**: when `nodeRef` prop is passed, `node` is not passed
348
+ *
349
+ * @type Function(node: HtmlElement) -> void
350
+ */
351
+ onExited: e.func
352
+ } : {};
353
+ function k() {
354
+ }
355
+ T.defaultProps = {
356
+ in: !1,
357
+ mountOnEnter: !1,
358
+ unmountOnExit: !1,
359
+ appear: !1,
360
+ enter: !0,
361
+ exit: !0,
362
+ onEnter: k,
363
+ onEntering: k,
364
+ onEntered: k,
365
+ onExit: k,
366
+ onExiting: k,
367
+ onExited: k
368
+ };
369
+ T.UNMOUNTED = L;
370
+ T.EXITED = $;
371
+ T.ENTERING = M;
372
+ T.ENTERED = U;
373
+ T.EXITING = re;
374
+ const Ve = T;
375
+ function le(t, n) {
376
+ var i, s;
377
+ const {
378
+ timeout: r,
379
+ easing: o,
380
+ style: a = {}
381
+ } = t;
382
+ return {
383
+ duration: (i = a.transitionDuration) != null ? i : typeof r == "number" ? r : r[n.mode] || 0,
384
+ easing: (s = a.transitionTimingFunction) != null ? s : typeof o == "object" ? o[n.mode] : o,
385
+ delay: a.transitionDelay
386
+ };
387
+ }
388
+ function ze(t) {
389
+ return Q("MuiCollapse", t);
390
+ }
391
+ Y("MuiCollapse", ["root", "horizontal", "vertical", "entered", "hidden", "wrapper", "wrapperInner"]);
392
+ const _e = ["addEndListener", "children", "className", "collapsedSize", "component", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "orientation", "style", "timeout", "TransitionComponent"], Ge = (t) => {
393
+ const {
394
+ orientation: n,
395
+ classes: i
396
+ } = t, s = {
397
+ root: ["root", `${n}`],
398
+ entered: ["entered"],
399
+ hidden: ["hidden"],
400
+ wrapper: ["wrapper", `${n}`],
401
+ wrapperInner: ["wrapperInner", `${n}`]
402
+ };
403
+ return ee(s, ze, i);
404
+ }, Le = N("div", {
405
+ name: "MuiCollapse",
406
+ slot: "Root",
407
+ overridesResolver: (t, n) => {
408
+ const {
409
+ ownerState: i
410
+ } = t;
411
+ return [n.root, n[i.orientation], i.state === "entered" && n.entered, i.state === "exited" && !i.in && i.collapsedSize === "0px" && n.hidden];
412
+ }
413
+ })(({
414
+ theme: t,
415
+ ownerState: n
416
+ }) => p({
417
+ height: 0,
418
+ overflow: "hidden",
419
+ transition: t.transitions.create("height")
420
+ }, n.orientation === "horizontal" && {
421
+ height: "auto",
422
+ width: 0,
423
+ transition: t.transitions.create("width")
424
+ }, n.state === "entered" && p({
425
+ height: "auto",
426
+ overflow: "visible"
427
+ }, n.orientation === "horizontal" && {
428
+ width: "auto"
429
+ }), n.state === "exited" && !n.in && n.collapsedSize === "0px" && {
430
+ visibility: "hidden"
431
+ })), Pe = N("div", {
432
+ name: "MuiCollapse",
433
+ slot: "Wrapper",
434
+ overridesResolver: (t, n) => n.wrapper
435
+ })(({
436
+ ownerState: t
437
+ }) => p({
438
+ // Hack to get children with a negative margin to not falsify the height computation.
439
+ display: "flex",
440
+ width: "100%"
441
+ }, t.orientation === "horizontal" && {
442
+ width: "auto",
443
+ height: "100%"
444
+ })), We = N("div", {
445
+ name: "MuiCollapse",
446
+ slot: "WrapperInner",
447
+ overridesResolver: (t, n) => n.wrapperInner
448
+ })(({
449
+ ownerState: t
450
+ }) => p({
451
+ width: "100%"
452
+ }, t.orientation === "horizontal" && {
453
+ width: "auto",
454
+ height: "100%"
455
+ })), ie = /* @__PURE__ */ u.forwardRef(function(n, i) {
456
+ const s = Z({
457
+ props: n,
458
+ name: "MuiCollapse"
459
+ }), {
460
+ addEndListener: r,
461
+ children: o,
462
+ className: a,
463
+ collapsedSize: c = "0px",
464
+ component: l,
465
+ easing: f,
466
+ in: m,
467
+ onEnter: g,
468
+ onEntered: v,
469
+ onEntering: S,
470
+ onExit: j,
471
+ onExited: x,
472
+ onExiting: b,
473
+ orientation: R = "vertical",
474
+ style: A,
475
+ timeout: y = Oe.standard,
476
+ // eslint-disable-next-line react/prop-types
477
+ TransitionComponent: te = Ve
478
+ } = s, q = W(s, _e), D = p({}, s, {
479
+ orientation: R,
480
+ collapsedSize: c
481
+ }), O = Ge(D), se = Se(), ae = u.useRef(), w = u.useRef(null), ne = u.useRef(), F = typeof c == "number" ? `${c}px` : c, z = R === "horizontal", _ = z ? "width" : "height";
482
+ u.useEffect(() => () => {
483
+ clearTimeout(ae.current);
484
+ }, []);
485
+ const B = u.useRef(null), Ee = Ae(i, B), I = (d) => (E) => {
486
+ if (d) {
487
+ const C = B.current;
488
+ E === void 0 ? d(C) : d(C, E);
489
+ }
490
+ }, oe = () => w.current ? w.current[z ? "clientWidth" : "clientHeight"] : 0, ge = I((d, E) => {
491
+ w.current && z && (w.current.style.position = "absolute"), d.style[_] = F, g && g(d, E);
492
+ }), be = I((d, E) => {
493
+ const C = oe();
494
+ w.current && z && (w.current.style.position = "");
495
+ const {
496
+ duration: G,
497
+ easing: H
498
+ } = le({
499
+ style: A,
500
+ timeout: y,
501
+ easing: f
502
+ }, {
503
+ mode: "enter"
504
+ });
505
+ if (y === "auto") {
506
+ const ce = se.transitions.getAutoHeightDuration(C);
507
+ d.style.transitionDuration = `${ce}ms`, ne.current = ce;
508
+ } else
509
+ d.style.transitionDuration = typeof G == "string" ? G : `${G}ms`;
510
+ d.style[_] = `${C}px`, d.style.transitionTimingFunction = H, S && S(d, E);
511
+ }), ve = I((d, E) => {
512
+ d.style[_] = "auto", v && v(d, E);
513
+ }), ye = I((d) => {
514
+ d.style[_] = `${oe()}px`, j && j(d);
515
+ }), Ce = I(x), Te = I((d) => {
516
+ const E = oe(), {
517
+ duration: C,
518
+ easing: G
519
+ } = le({
520
+ style: A,
521
+ timeout: y,
522
+ easing: f
523
+ }, {
524
+ mode: "exit"
525
+ });
526
+ if (y === "auto") {
527
+ const H = se.transitions.getAutoHeightDuration(E);
528
+ d.style.transitionDuration = `${H}ms`, ne.current = H;
529
+ } else
530
+ d.style.transitionDuration = typeof C == "string" ? C : `${C}ms`;
531
+ d.style[_] = F, d.style.transitionTimingFunction = G, b && b(d);
532
+ }), Re = (d) => {
533
+ y === "auto" && (ae.current = setTimeout(d, ne.current || 0)), r && r(B.current, d);
534
+ };
535
+ return /* @__PURE__ */ h.jsx(te, p({
536
+ in: m,
537
+ onEnter: ge,
538
+ onEntered: ve,
539
+ onEntering: be,
540
+ onExit: ye,
541
+ onExited: Ce,
542
+ onExiting: Te,
543
+ addEndListener: Re,
544
+ nodeRef: B,
545
+ timeout: y === "auto" ? null : y
546
+ }, q, {
547
+ children: (d, E) => /* @__PURE__ */ h.jsx(Le, p({
548
+ as: l,
549
+ className: P(O.root, a, {
550
+ entered: O.entered,
551
+ exited: !m && F === "0px" && O.hidden
552
+ }[d]),
553
+ style: p({
554
+ [z ? "minWidth" : "minHeight"]: F
555
+ }, A),
556
+ ownerState: p({}, D, {
557
+ state: d
558
+ }),
559
+ ref: Ee
560
+ }, E, {
561
+ children: /* @__PURE__ */ h.jsx(Pe, {
562
+ ownerState: p({}, D, {
563
+ state: d
564
+ }),
565
+ className: O.wrapper,
566
+ ref: w,
567
+ children: /* @__PURE__ */ h.jsx(We, {
568
+ ownerState: p({}, D, {
569
+ state: d
570
+ }),
571
+ className: O.wrapperInner,
572
+ children: o
573
+ })
574
+ })
575
+ }))
576
+ }));
577
+ });
578
+ process.env.NODE_ENV !== "production" && (ie.propTypes = {
579
+ // ----------------------------- Warning --------------------------------
580
+ // | These PropTypes are generated from the TypeScript type definitions |
581
+ // | To update them edit the d.ts file and run "yarn proptypes" |
582
+ // ----------------------------------------------------------------------
583
+ /**
584
+ * Add a custom transition end trigger. Called with the transitioning DOM
585
+ * node and a done callback. Allows for more fine grained transition end
586
+ * logic. Note: Timeouts are still used as a fallback if provided.
587
+ */
588
+ addEndListener: e.func,
589
+ /**
590
+ * The content node to be collapsed.
591
+ */
592
+ children: e.node,
593
+ /**
594
+ * Override or extend the styles applied to the component.
595
+ */
596
+ classes: e.object,
597
+ /**
598
+ * @ignore
599
+ */
600
+ className: e.string,
601
+ /**
602
+ * The width (horizontal) or height (vertical) of the container when collapsed.
603
+ * @default '0px'
604
+ */
605
+ collapsedSize: e.oneOfType([e.number, e.string]),
606
+ /**
607
+ * The component used for the root node.
608
+ * Either a string to use a HTML element or a component.
609
+ */
610
+ component: De,
611
+ /**
612
+ * The transition timing function.
613
+ * You may specify a single easing or a object containing enter and exit values.
614
+ */
615
+ easing: e.oneOfType([e.shape({
616
+ enter: e.string,
617
+ exit: e.string
618
+ }), e.string]),
619
+ /**
620
+ * If `true`, the component will transition in.
621
+ */
622
+ in: e.bool,
623
+ /**
624
+ * @ignore
625
+ */
626
+ onEnter: e.func,
627
+ /**
628
+ * @ignore
629
+ */
630
+ onEntered: e.func,
631
+ /**
632
+ * @ignore
633
+ */
634
+ onEntering: e.func,
635
+ /**
636
+ * @ignore
637
+ */
638
+ onExit: e.func,
639
+ /**
640
+ * @ignore
641
+ */
642
+ onExited: e.func,
643
+ /**
644
+ * @ignore
645
+ */
646
+ onExiting: e.func,
647
+ /**
648
+ * The transition orientation.
649
+ * @default 'vertical'
650
+ */
651
+ orientation: e.oneOf(["horizontal", "vertical"]),
652
+ /**
653
+ * @ignore
654
+ */
655
+ style: e.object,
656
+ /**
657
+ * The system prop that allows defining system overrides as well as additional CSS styles.
658
+ */
659
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
660
+ /**
661
+ * The duration for the transition, in milliseconds.
662
+ * You may specify a single timeout for all transitions, or individually with an object.
663
+ *
664
+ * Set to 'auto' to automatically calculate transition time based on height.
665
+ * @default duration.standard
666
+ */
667
+ timeout: e.oneOfType([e.oneOf(["auto"]), e.number, e.shape({
668
+ appear: e.number,
669
+ enter: e.number,
670
+ exit: e.number
671
+ })])
672
+ });
673
+ ie.muiSupportAuto = !0;
674
+ const qe = ie, pe = /* @__PURE__ */ u.createContext({});
675
+ process.env.NODE_ENV !== "production" && (pe.displayName = "AccordionContext");
676
+ const fe = pe;
677
+ function Fe(t) {
678
+ return Q("MuiAccordion", t);
679
+ }
680
+ const Be = Y("MuiAccordion", ["root", "rounded", "expanded", "disabled", "gutters", "region"]), J = Be, He = ["children", "className", "defaultExpanded", "disabled", "disableGutters", "expanded", "onChange", "square", "TransitionComponent", "TransitionProps"], Xe = (t) => {
681
+ const {
682
+ classes: n,
683
+ square: i,
684
+ expanded: s,
685
+ disabled: r,
686
+ disableGutters: o
687
+ } = t;
688
+ return ee({
689
+ root: ["root", !i && "rounded", s && "expanded", r && "disabled", !o && "gutters"],
690
+ region: ["region"]
691
+ }, Fe, n);
692
+ }, Ke = N(we, {
693
+ name: "MuiAccordion",
694
+ slot: "Root",
695
+ overridesResolver: (t, n) => {
696
+ const {
697
+ ownerState: i
698
+ } = t;
699
+ return [{
700
+ [`& .${J.region}`]: n.region
701
+ }, n.root, !i.square && n.rounded, !i.disableGutters && n.gutters];
702
+ }
703
+ })(({
704
+ theme: t
705
+ }) => {
706
+ const n = {
707
+ duration: t.transitions.duration.shortest
708
+ };
709
+ return {
710
+ position: "relative",
711
+ transition: t.transitions.create(["margin"], n),
712
+ overflowAnchor: "none",
713
+ // Keep the same scrolling position
714
+ "&:before": {
715
+ position: "absolute",
716
+ left: 0,
717
+ top: -1,
718
+ right: 0,
719
+ height: 1,
720
+ content: '""',
721
+ opacity: 1,
722
+ backgroundColor: (t.vars || t).palette.divider,
723
+ transition: t.transitions.create(["opacity", "background-color"], n)
724
+ },
725
+ "&:first-of-type": {
726
+ "&:before": {
727
+ display: "none"
728
+ }
729
+ },
730
+ [`&.${J.expanded}`]: {
731
+ "&:before": {
732
+ opacity: 0
733
+ },
734
+ "&:first-of-type": {
735
+ marginTop: 0
736
+ },
737
+ "&:last-of-type": {
738
+ marginBottom: 0
739
+ },
740
+ "& + &": {
741
+ "&:before": {
742
+ display: "none"
743
+ }
744
+ }
745
+ },
746
+ [`&.${J.disabled}`]: {
747
+ backgroundColor: (t.vars || t).palette.action.disabledBackground
748
+ }
749
+ };
750
+ }, ({
751
+ theme: t,
752
+ ownerState: n
753
+ }) => p({}, !n.square && {
754
+ borderRadius: 0,
755
+ "&:first-of-type": {
756
+ borderTopLeftRadius: (t.vars || t).shape.borderRadius,
757
+ borderTopRightRadius: (t.vars || t).shape.borderRadius
758
+ },
759
+ "&:last-of-type": {
760
+ borderBottomLeftRadius: (t.vars || t).shape.borderRadius,
761
+ borderBottomRightRadius: (t.vars || t).shape.borderRadius,
762
+ // Fix a rendering issue on Edge
763
+ "@supports (-ms-ime-align: auto)": {
764
+ borderBottomLeftRadius: 0,
765
+ borderBottomRightRadius: 0
766
+ }
767
+ }
768
+ }, !n.disableGutters && {
769
+ [`&.${J.expanded}`]: {
770
+ margin: "16px 0"
771
+ }
772
+ })), me = /* @__PURE__ */ u.forwardRef(function(n, i) {
773
+ const s = Z({
774
+ props: n,
775
+ name: "MuiAccordion"
776
+ }), {
777
+ children: r,
778
+ className: o,
779
+ defaultExpanded: a = !1,
780
+ disabled: c = !1,
781
+ disableGutters: l = !1,
782
+ expanded: f,
783
+ onChange: m,
784
+ square: g = !1,
785
+ TransitionComponent: v = qe,
786
+ TransitionProps: S
787
+ } = s, j = W(s, He), [x, b] = Ie({
788
+ controlled: f,
789
+ default: a,
790
+ name: "Accordion",
791
+ state: "expanded"
792
+ }), R = u.useCallback((O) => {
793
+ b(!x), m && m(O, !x);
794
+ }, [x, m, b]), [A, ...y] = u.Children.toArray(r), te = u.useMemo(() => ({
795
+ expanded: x,
796
+ disabled: c,
797
+ disableGutters: l,
798
+ toggle: R
799
+ }), [x, c, l, R]), q = p({}, s, {
800
+ square: g,
801
+ disabled: c,
802
+ disableGutters: l,
803
+ expanded: x
804
+ }), D = Xe(q);
805
+ return /* @__PURE__ */ h.jsxs(Ke, p({
806
+ className: P(D.root, o),
807
+ ref: i,
808
+ ownerState: q,
809
+ square: g
810
+ }, j, {
811
+ children: [/* @__PURE__ */ h.jsx(fe.Provider, {
812
+ value: te,
813
+ children: A
814
+ }), /* @__PURE__ */ h.jsx(v, p({
815
+ in: x,
816
+ timeout: "auto"
817
+ }, S, {
818
+ children: /* @__PURE__ */ h.jsx("div", {
819
+ "aria-labelledby": A.props.id,
820
+ id: A.props["aria-controls"],
821
+ role: "region",
822
+ className: D.region,
823
+ children: y
824
+ })
825
+ }))]
826
+ }));
827
+ });
828
+ process.env.NODE_ENV !== "production" && (me.propTypes = {
829
+ // ----------------------------- Warning --------------------------------
830
+ // | These PropTypes are generated from the TypeScript type definitions |
831
+ // | To update them edit the d.ts file and run "yarn proptypes" |
832
+ // ----------------------------------------------------------------------
833
+ /**
834
+ * The content of the component.
835
+ */
836
+ children: $e(e.node.isRequired, (t) => {
837
+ const n = u.Children.toArray(t.children)[0];
838
+ return Me.isFragment(n) ? new Error("MUI: The Accordion doesn't accept a Fragment as a child. Consider providing an array instead.") : /* @__PURE__ */ u.isValidElement(n) ? null : new Error("MUI: Expected the first child of Accordion to be a valid element.");
839
+ }),
840
+ /**
841
+ * Override or extend the styles applied to the component.
842
+ */
843
+ classes: e.object,
844
+ /**
845
+ * @ignore
846
+ */
847
+ className: e.string,
848
+ /**
849
+ * If `true`, expands the accordion by default.
850
+ * @default false
851
+ */
852
+ defaultExpanded: e.bool,
853
+ /**
854
+ * If `true`, the component is disabled.
855
+ * @default false
856
+ */
857
+ disabled: e.bool,
858
+ /**
859
+ * If `true`, it removes the margin between two expanded accordion items and the increase of height.
860
+ * @default false
861
+ */
862
+ disableGutters: e.bool,
863
+ /**
864
+ * If `true`, expands the accordion, otherwise collapse it.
865
+ * Setting this prop enables control over the accordion.
866
+ */
867
+ expanded: e.bool,
868
+ /**
869
+ * Callback fired when the expand/collapse state is changed.
870
+ *
871
+ * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
872
+ * @param {boolean} expanded The `expanded` state of the accordion.
873
+ */
874
+ onChange: e.func,
875
+ /**
876
+ * If `true`, rounded corners are disabled.
877
+ * @default false
878
+ */
879
+ square: e.bool,
880
+ /**
881
+ * The system prop that allows defining system overrides as well as additional CSS styles.
882
+ */
883
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
884
+ /**
885
+ * The component used for the transition.
886
+ * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
887
+ * @default Collapse
888
+ */
889
+ TransitionComponent: e.elementType,
890
+ /**
891
+ * Props applied to the transition element.
892
+ * By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition/) component.
893
+ */
894
+ TransitionProps: e.object
895
+ });
896
+ const Je = me;
897
+ function Qe(t) {
898
+ return Q("MuiAccordionSummary", t);
899
+ }
900
+ const Ye = Y("MuiAccordionSummary", ["root", "expanded", "focusVisible", "disabled", "gutters", "contentGutters", "content", "expandIconWrapper"]), V = Ye, Ze = ["children", "className", "expandIcon", "focusVisibleClassName", "onClick"], et = (t) => {
901
+ const {
902
+ classes: n,
903
+ expanded: i,
904
+ disabled: s,
905
+ disableGutters: r
906
+ } = t;
907
+ return ee({
908
+ root: ["root", i && "expanded", s && "disabled", !r && "gutters"],
909
+ focusVisible: ["focusVisible"],
910
+ content: ["content", i && "expanded", !r && "contentGutters"],
911
+ expandIconWrapper: ["expandIconWrapper", i && "expanded"]
912
+ }, Qe, n);
913
+ }, tt = N(je, {
914
+ name: "MuiAccordionSummary",
915
+ slot: "Root",
916
+ overridesResolver: (t, n) => n.root
917
+ })(({
918
+ theme: t,
919
+ ownerState: n
920
+ }) => {
921
+ const i = {
922
+ duration: t.transitions.duration.shortest
923
+ };
924
+ return p({
925
+ display: "flex",
926
+ minHeight: 48,
927
+ padding: t.spacing(0, 2),
928
+ transition: t.transitions.create(["min-height", "background-color"], i),
929
+ [`&.${V.focusVisible}`]: {
930
+ backgroundColor: (t.vars || t).palette.action.focus
931
+ },
932
+ [`&.${V.disabled}`]: {
933
+ opacity: (t.vars || t).palette.action.disabledOpacity
934
+ },
935
+ [`&:hover:not(.${V.disabled})`]: {
936
+ cursor: "pointer"
937
+ }
938
+ }, !n.disableGutters && {
939
+ [`&.${V.expanded}`]: {
940
+ minHeight: 64
941
+ }
942
+ });
943
+ }), nt = N("div", {
944
+ name: "MuiAccordionSummary",
945
+ slot: "Content",
946
+ overridesResolver: (t, n) => n.content
947
+ })(({
948
+ theme: t,
949
+ ownerState: n
950
+ }) => p({
951
+ display: "flex",
952
+ flexGrow: 1,
953
+ margin: "12px 0"
954
+ }, !n.disableGutters && {
955
+ transition: t.transitions.create(["margin"], {
956
+ duration: t.transitions.duration.shortest
957
+ }),
958
+ [`&.${V.expanded}`]: {
959
+ margin: "20px 0"
960
+ }
961
+ })), ot = N("div", {
962
+ name: "MuiAccordionSummary",
963
+ slot: "ExpandIconWrapper",
964
+ overridesResolver: (t, n) => n.expandIconWrapper
965
+ })(({
966
+ theme: t
967
+ }) => ({
968
+ display: "flex",
969
+ color: (t.vars || t).palette.action.active,
970
+ transform: "rotate(0deg)",
971
+ transition: t.transitions.create("transform", {
972
+ duration: t.transitions.duration.shortest
973
+ }),
974
+ [`&.${V.expanded}`]: {
975
+ transform: "rotate(180deg)"
976
+ }
977
+ })), he = /* @__PURE__ */ u.forwardRef(function(n, i) {
978
+ const s = Z({
979
+ props: n,
980
+ name: "MuiAccordionSummary"
981
+ }), {
982
+ children: r,
983
+ className: o,
984
+ expandIcon: a,
985
+ focusVisibleClassName: c,
986
+ onClick: l
987
+ } = s, f = W(s, Ze), {
988
+ disabled: m = !1,
989
+ disableGutters: g,
990
+ expanded: v,
991
+ toggle: S
992
+ } = u.useContext(fe), j = (R) => {
993
+ S && S(R), l && l(R);
994
+ }, x = p({}, s, {
995
+ expanded: v,
996
+ disabled: m,
997
+ disableGutters: g
998
+ }), b = et(x);
999
+ return /* @__PURE__ */ h.jsxs(tt, p({
1000
+ focusRipple: !1,
1001
+ disableRipple: !0,
1002
+ disabled: m,
1003
+ component: "div",
1004
+ "aria-expanded": v,
1005
+ className: P(b.root, o),
1006
+ focusVisibleClassName: P(b.focusVisible, c),
1007
+ onClick: j,
1008
+ ref: i,
1009
+ ownerState: x
1010
+ }, f, {
1011
+ children: [/* @__PURE__ */ h.jsx(nt, {
1012
+ className: b.content,
1013
+ ownerState: x,
1014
+ children: r
1015
+ }), a && /* @__PURE__ */ h.jsx(ot, {
1016
+ className: b.expandIconWrapper,
1017
+ ownerState: x,
1018
+ children: a
1019
+ })]
1020
+ }));
1021
+ });
1022
+ process.env.NODE_ENV !== "production" && (he.propTypes = {
1023
+ // ----------------------------- Warning --------------------------------
1024
+ // | These PropTypes are generated from the TypeScript type definitions |
1025
+ // | To update them edit the d.ts file and run "yarn proptypes" |
1026
+ // ----------------------------------------------------------------------
1027
+ /**
1028
+ * The content of the component.
1029
+ */
1030
+ children: e.node,
1031
+ /**
1032
+ * Override or extend the styles applied to the component.
1033
+ */
1034
+ classes: e.object,
1035
+ /**
1036
+ * @ignore
1037
+ */
1038
+ className: e.string,
1039
+ /**
1040
+ * The icon to display as the expand indicator.
1041
+ */
1042
+ expandIcon: e.node,
1043
+ /**
1044
+ * This prop can help identify which element has keyboard focus.
1045
+ * The class name will be applied when the element gains the focus through keyboard interaction.
1046
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
1047
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
1048
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
1049
+ * if needed.
1050
+ */
1051
+ focusVisibleClassName: e.string,
1052
+ /**
1053
+ * @ignore
1054
+ */
1055
+ onClick: e.func,
1056
+ /**
1057
+ * The system prop that allows defining system overrides as well as additional CSS styles.
1058
+ */
1059
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
1060
+ });
1061
+ const rt = he;
1062
+ function it(t) {
1063
+ return Q("MuiAccordionDetails", t);
1064
+ }
1065
+ Y("MuiAccordionDetails", ["root"]);
1066
+ const st = ["className"], at = (t) => {
1067
+ const {
1068
+ classes: n
1069
+ } = t;
1070
+ return ee({
1071
+ root: ["root"]
1072
+ }, it, n);
1073
+ }, ct = N("div", {
1074
+ name: "MuiAccordionDetails",
1075
+ slot: "Root",
1076
+ overridesResolver: (t, n) => n.root
1077
+ })(({
1078
+ theme: t
1079
+ }) => ({
1080
+ padding: t.spacing(1, 2, 2)
1081
+ })), xe = /* @__PURE__ */ u.forwardRef(function(n, i) {
1082
+ const s = Z({
1083
+ props: n,
1084
+ name: "MuiAccordionDetails"
1085
+ }), {
1086
+ className: r
1087
+ } = s, o = W(s, st), a = s, c = at(a);
1088
+ return /* @__PURE__ */ h.jsx(ct, p({
1089
+ className: P(c.root, r),
1090
+ ref: i,
1091
+ ownerState: a
1092
+ }, o));
1093
+ });
1094
+ process.env.NODE_ENV !== "production" && (xe.propTypes = {
1095
+ // ----------------------------- Warning --------------------------------
1096
+ // | These PropTypes are generated from the TypeScript type definitions |
1097
+ // | To update them edit the d.ts file and run "yarn proptypes" |
1098
+ // ----------------------------------------------------------------------
1099
+ /**
1100
+ * The content of the component.
1101
+ */
1102
+ children: e.node,
1103
+ /**
1104
+ * Override or extend the styles applied to the component.
1105
+ */
1106
+ classes: e.object,
1107
+ /**
1108
+ * @ignore
1109
+ */
1110
+ className: e.string,
1111
+ /**
1112
+ * The system prop that allows defining system overrides as well as additional CSS styles.
1113
+ */
1114
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
1115
+ });
1116
+ const dt = xe, ft = ({ children: t, ...n }) => /* @__PURE__ */ h.jsx(Je, { ...n, children: t }), mt = ({
1117
+ children: t,
1118
+ ...n
1119
+ }) => /* @__PURE__ */ h.jsx(rt, { "aria-controls": "panel1a-content", ...n, children: t }), ht = ({
1120
+ children: t,
1121
+ ...n
1122
+ }) => /* @__PURE__ */ h.jsx(dt, { ...n, children: t });
5
1123
  export {
6
- c as KdpaAccordion,
7
- d as KdpaAccordionDetails,
8
- m as KdpaAccordionSummary
1124
+ ft as KdpaAccordion,
1125
+ ht as KdpaAccordionDetails,
1126
+ mt as KdpaAccordionSummary
9
1127
  };