@notificationapi/react 0.0.37 → 1.0.1

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 (72) hide show
  1. package/dist/assets/Badge.js +456 -0
  2. package/dist/assets/Box.js +57 -0
  3. package/dist/assets/ButtonBase.js +1224 -0
  4. package/dist/assets/DefaultPropsProvider.js +4368 -0
  5. package/dist/assets/Divider.js +343 -0
  6. package/dist/assets/IconButton.js +225 -0
  7. package/dist/assets/Inbox.js +3051 -0
  8. package/dist/assets/InboxHeader.js +2338 -0
  9. package/dist/assets/Notification.js +5349 -7150
  10. package/dist/assets/NotificationPreferencesPopup.js +1694 -0
  11. package/dist/assets/Paper.js +154 -0
  12. package/dist/assets/Popover.js +451 -0
  13. package/dist/assets/Portal.js +110 -0
  14. package/dist/assets/PreferenceInput.js +1545 -1366
  15. package/dist/assets/Typography.js +292 -0
  16. package/dist/assets/WebPushOptInMessage.js +794 -407
  17. package/dist/assets/channelUtils.js +33 -65
  18. package/dist/assets/createSimplePaletteValueFilter.js +17 -0
  19. package/dist/assets/createSvgIcon.js +248 -0
  20. package/dist/assets/integerPropType.js +31 -0
  21. package/dist/assets/resolveComponentProps.js +93 -0
  22. package/dist/assets/style.css +1 -0
  23. package/dist/assets/useSlotProps.js +24 -0
  24. package/dist/assets/useTheme.js +10 -0
  25. package/dist/assets/useTheme2.js +16 -0
  26. package/dist/assets/utils.js +743 -0
  27. package/dist/components/Notifications/DefaultEmpty.d.ts +3 -0
  28. package/dist/components/Notifications/DefaultEmpty.js +7 -0
  29. package/dist/components/Notifications/Inbox.d.ts +4 -4
  30. package/dist/components/Notifications/Inbox.js +9 -6450
  31. package/dist/components/Notifications/InboxHeader.d.ts +1 -1
  32. package/dist/components/Notifications/InboxHeader.js +7 -53
  33. package/dist/components/Notifications/Notification.d.ts +3 -4
  34. package/dist/components/Notifications/Notification.js +6 -5
  35. package/dist/components/Notifications/NotificationCounter.js +16 -6
  36. package/dist/components/Notifications/NotificationFeed.d.ts +1 -2
  37. package/dist/components/Notifications/NotificationFeed.js +41 -38
  38. package/dist/components/Notifications/NotificationLauncher.d.ts +1 -0
  39. package/dist/components/Notifications/NotificationLauncher.js +100 -114
  40. package/dist/components/Notifications/NotificationPopup.d.ts +3 -4
  41. package/dist/components/Notifications/NotificationPopup.js +86 -88
  42. package/dist/components/Notifications/UnreadBadge.d.ts +7 -4
  43. package/dist/components/Notifications/UnreadBadge.js +28 -20
  44. package/dist/components/Notifications/interface.d.ts +0 -4
  45. package/dist/components/Notifications/interface.js +4 -5
  46. package/dist/components/Preferences/NotificationPreferencesInline.js +14 -14
  47. package/dist/components/Preferences/NotificationPreferencesPopup.js +7 -2068
  48. package/dist/components/Preferences/PreferenceInput.js +4 -3
  49. package/dist/components/Preferences/Preferences.js +1042 -547
  50. package/dist/components/Preferences/channelUtils.js +3 -4
  51. package/dist/components/Preferences/index.js +1 -1
  52. package/dist/components/Provider/context.d.ts +27 -0
  53. package/dist/components/Provider/context.js +7 -0
  54. package/dist/components/Provider/index.d.ts +2 -25
  55. package/dist/components/Provider/index.js +22 -24
  56. package/dist/components/WebPush/WebPushOptInMessage.js +3 -4
  57. package/dist/main.d.ts +1 -0
  58. package/dist/main.js +4 -4
  59. package/package.json +14 -12
  60. package/dist/assets/AntdIcon.js +0 -200
  61. package/dist/assets/CloseOutlined.js +0 -13
  62. package/dist/assets/PurePanel.js +0 -59
  63. package/dist/assets/RightOutlined.js +0 -13
  64. package/dist/assets/button.js +0 -1660
  65. package/dist/assets/colors.js +0 -36
  66. package/dist/assets/compact-item.js +0 -860
  67. package/dist/assets/index.js +0 -271
  68. package/dist/assets/index2.js +0 -647
  69. package/dist/assets/index3.js +0 -7527
  70. package/dist/assets/pickAttrs.js +0 -42
  71. package/dist/assets/presets.js +0 -810
  72. package/dist/assets/reactNode.js +0 -20821
@@ -1,585 +1,1080 @@
1
- import { jsxs as re, Fragment as V, jsx as z } from "react/jsx-runtime";
2
- import { NotificationAPIContext as le } from "../Provider/index.js";
3
- import * as M from "react";
4
- import h, { useContext as se } from "react";
5
- import { P as W } from "../../assets/PreferenceInput.js";
6
- import { R as ce } from "../../assets/RightOutlined.js";
7
- import { f as J, c as D, b as K, e as Q, a as T, w as de, d as ue } from "../../assets/presets.js";
8
- import { e as fe, d as me, f as Y, a as Z, g as ve, m as pe, u as R, r as ge, h as Ce, c as X } from "../../assets/reactNode.js";
9
- import { t as ee, u as be, a as ye, o as q } from "../../assets/compact-item.js";
10
- import { K as F, e as he } from "../../assets/index3.js";
11
- import { p as xe } from "../../assets/pickAttrs.js";
12
- var ne = /* @__PURE__ */ h.forwardRef(function(e, n) {
13
- var a = e.prefixCls, t = e.forceRender, o = e.className, c = e.style, v = e.children, l = e.isActive, u = e.role, i = e.classNames, C = e.styles, f = h.useState(l || t), d = J(f, 2), r = d[0], g = d[1];
14
- return h.useEffect(function() {
15
- (t || l) && g(!0);
16
- }, [t, l]), r ? /* @__PURE__ */ h.createElement("div", {
17
- ref: n,
18
- className: D("".concat(a, "-content"), K(K({}, "".concat(a, "-content-active"), l), "".concat(a, "-content-inactive"), !l), o),
19
- style: c,
20
- role: u
21
- }, /* @__PURE__ */ h.createElement("div", {
22
- className: D("".concat(a, "-content-box"), i == null ? void 0 : i.body),
23
- style: C == null ? void 0 : C.body
24
- }, v)) : null;
25
- });
26
- ne.displayName = "PanelContent";
27
- var Ie = ["showArrow", "headerClass", "isActive", "onItemClick", "forceRender", "className", "classNames", "styles", "prefixCls", "collapsible", "accordion", "panelKey", "extra", "header", "expandIcon", "openMotion", "destroyInactivePanel", "children"], ae = /* @__PURE__ */ h.forwardRef(function(e, n) {
28
- var a = e.showArrow, t = a === void 0 ? !0 : a, o = e.headerClass, c = e.isActive, v = e.onItemClick, l = e.forceRender, u = e.className, i = e.classNames, C = i === void 0 ? {} : i, f = e.styles, d = f === void 0 ? {} : f, r = e.prefixCls, g = e.collapsible, x = e.accordion, s = e.panelKey, b = e.extra, $ = e.header, N = e.expandIcon, p = e.openMotion, S = e.destroyInactivePanel, y = e.children, E = Q(e, Ie), P = g === "disabled", w = g === "header", A = g === "icon", m = b != null && typeof b != "boolean", I = function() {
29
- v == null || v(s);
30
- }, O = function(B) {
31
- (B.key === "Enter" || B.keyCode === F.ENTER || B.which === F.ENTER) && I();
32
- }, _ = typeof N == "function" ? N(e) : /* @__PURE__ */ h.createElement("i", {
33
- className: "arrow"
34
- });
35
- _ && (_ = /* @__PURE__ */ h.createElement("div", {
36
- className: "".concat(r, "-expand-icon"),
37
- onClick: ["header", "icon"].includes(g) ? I : void 0
38
- }, _));
39
- var H = D(K(K(K({}, "".concat(r, "-item"), !0), "".concat(r, "-item-active"), c), "".concat(r, "-item-disabled"), P), u), G = D(o, K(K(K({}, "".concat(r, "-header"), !0), "".concat(r, "-header-collapsible-only"), w), "".concat(r, "-icon-collapsible-only"), A), C.header), k = {
40
- className: G,
41
- "aria-expanded": c,
42
- "aria-disabled": P,
43
- onKeyDown: O,
44
- style: d.header
45
- };
46
- return !w && !A && (k.onClick = I, k.role = x ? "tab" : "button", k.tabIndex = P ? -1 : 0), /* @__PURE__ */ h.createElement("div", T({}, E, {
47
- ref: n,
48
- className: H
49
- }), /* @__PURE__ */ h.createElement("div", k, t && _, /* @__PURE__ */ h.createElement("span", {
50
- className: "".concat(r, "-header-text"),
51
- onClick: g === "header" ? I : void 0
52
- }, $), m && /* @__PURE__ */ h.createElement("div", {
53
- className: "".concat(r, "-extra")
54
- }, b)), /* @__PURE__ */ h.createElement(fe, T({
55
- visible: c,
56
- leavedClassName: "".concat(r, "-content-hidden")
57
- }, p, {
58
- forceRender: l,
59
- removeOnLeave: S
60
- }), function(j, B) {
61
- var oe = j.className, ie = j.style;
62
- return /* @__PURE__ */ h.createElement(ne, {
63
- ref: B,
64
- prefixCls: r,
65
- className: oe,
66
- classNames: C,
67
- style: ie,
68
- styles: d,
69
- isActive: c,
70
- forceRender: l,
71
- role: x ? "tabpanel" : void 0
72
- }, y);
73
- }));
74
- }), $e = ["children", "label", "key", "collapsible", "onItemClick", "destroyInactivePanel"], Ne = function(n, a) {
75
- var t = a.prefixCls, o = a.accordion, c = a.collapsible, v = a.destroyInactivePanel, l = a.onItemClick, u = a.activeKey, i = a.openMotion, C = a.expandIcon;
76
- return n.map(function(f, d) {
77
- var r = f.children, g = f.label, x = f.key, s = f.collapsible, b = f.onItemClick, $ = f.destroyInactivePanel, N = Q(f, $e), p = String(x ?? d), S = s ?? c, y = $ ?? v, E = function(A) {
78
- S !== "disabled" && (l(A), b == null || b(A));
79
- }, P = !1;
80
- return o ? P = u[0] === p : P = u.indexOf(p) > -1, /* @__PURE__ */ h.createElement(ae, T({}, N, {
81
- prefixCls: t,
82
- key: p,
83
- panelKey: p,
84
- isActive: P,
85
- accordion: o,
86
- openMotion: i,
87
- expandIcon: C,
88
- header: g,
89
- collapsible: S,
90
- onItemClick: E,
91
- destroyInactivePanel: y
92
- }), r);
93
- });
94
- }, Pe = function(n, a, t) {
95
- if (!n) return null;
96
- var o = t.prefixCls, c = t.accordion, v = t.collapsible, l = t.destroyInactivePanel, u = t.onItemClick, i = t.activeKey, C = t.openMotion, f = t.expandIcon, d = n.key || String(a), r = n.props, g = r.header, x = r.headerClass, s = r.destroyInactivePanel, b = r.collapsible, $ = r.onItemClick, N = !1;
97
- c ? N = i[0] === d : N = i.indexOf(d) > -1;
98
- var p = b ?? v, S = function(P) {
99
- p !== "disabled" && (u(P), $ == null || $(P));
100
- }, y = {
101
- key: d,
102
- panelKey: d,
103
- header: g,
104
- headerClass: x,
105
- isActive: N,
106
- prefixCls: o,
107
- destroyInactivePanel: s ?? l,
108
- openMotion: C,
109
- accordion: c,
110
- children: n.props.children,
111
- onItemClick: S,
112
- expandIcon: f,
113
- collapsible: p
114
- };
115
- return typeof n.type == "string" ? n : (Object.keys(y).forEach(function(E) {
116
- typeof y[E] > "u" && delete y[E];
117
- }), /* @__PURE__ */ h.cloneElement(n, y));
118
- };
119
- function we(e, n, a) {
120
- return Array.isArray(e) ? Ne(e, a) : ee(n).map(function(t, o) {
121
- return Pe(t, o, a);
122
- });
123
- }
124
- function Se(e) {
125
- var n = e;
126
- if (!Array.isArray(n)) {
127
- var a = ue(n);
128
- n = a === "number" || a === "string" ? [n] : [];
1
+ import { jsx as m, jsxs as G, Fragment as Ce } from "react/jsx-runtime";
2
+ import * as C from "react";
3
+ import { useContext as Re } from "react";
4
+ import { NotificationAPIContext as xe } from "../Provider/context.js";
5
+ import { P as ce } from "../../assets/PreferenceInput.js";
6
+ import { g as X, a as Z, s as w, m as $, u as J, c as k, P as t, f as K, x as Se } from "../../assets/DefaultPropsProvider.js";
7
+ import { d as ve, e as Ae, u as le, c as _e, B as Pe } from "../../assets/ButtonBase.js";
8
+ import { P as we } from "../../assets/Paper.js";
9
+ import { u as Ne } from "../../assets/Divider.js";
10
+ import { u as Ie } from "../../assets/useTheme.js";
11
+ import { T as $e, g as de } from "../../assets/utils.js";
12
+ import { u as Me } from "../../assets/resolveComponentProps.js";
13
+ import { c as Oe } from "../../assets/createSvgIcon.js";
14
+ import { T as ue } from "../../assets/Typography.js";
15
+ import { B as De } from "../../assets/Box.js";
16
+ var te = { exports: {} }, l = {};
17
+ /**
18
+ * @license React
19
+ * react-is.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */
26
+ var pe;
27
+ function Fe() {
28
+ if (pe) return l;
29
+ pe = 1;
30
+ var o = Symbol.for("react.transitional.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), p = Symbol.for("react.consumer"), f = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), a = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), x = Symbol.for("react.client.reference");
31
+ function g(e) {
32
+ if (typeof e == "object" && e !== null) {
33
+ var h = e.$$typeof;
34
+ switch (h) {
35
+ case o:
36
+ switch (e = e.type, e) {
37
+ case n:
38
+ case c:
39
+ case s:
40
+ case E:
41
+ case a:
42
+ return e;
43
+ default:
44
+ switch (e = e && e.$$typeof, e) {
45
+ case f:
46
+ case u:
47
+ case T:
48
+ case y:
49
+ return e;
50
+ case p:
51
+ return e;
52
+ default:
53
+ return h;
54
+ }
55
+ }
56
+ case r:
57
+ return h;
58
+ }
59
+ }
129
60
  }
130
- return n.map(function(t) {
131
- return String(t);
132
- });
61
+ return l.ContextConsumer = p, l.ContextProvider = f, l.Element = o, l.ForwardRef = u, l.Fragment = n, l.Lazy = T, l.Memo = y, l.Portal = r, l.Profiler = c, l.StrictMode = s, l.Suspense = E, l.SuspenseList = a, l.isContextConsumer = function(e) {
62
+ return g(e) === p;
63
+ }, l.isContextProvider = function(e) {
64
+ return g(e) === f;
65
+ }, l.isElement = function(e) {
66
+ return typeof e == "object" && e !== null && e.$$typeof === o;
67
+ }, l.isForwardRef = function(e) {
68
+ return g(e) === u;
69
+ }, l.isFragment = function(e) {
70
+ return g(e) === n;
71
+ }, l.isLazy = function(e) {
72
+ return g(e) === T;
73
+ }, l.isMemo = function(e) {
74
+ return g(e) === y;
75
+ }, l.isPortal = function(e) {
76
+ return g(e) === r;
77
+ }, l.isProfiler = function(e) {
78
+ return g(e) === c;
79
+ }, l.isStrictMode = function(e) {
80
+ return g(e) === s;
81
+ }, l.isSuspense = function(e) {
82
+ return g(e) === E;
83
+ }, l.isSuspenseList = function(e) {
84
+ return g(e) === a;
85
+ }, l.isValidElementType = function(e) {
86
+ return typeof e == "string" || typeof e == "function" || e === n || e === c || e === s || e === E || e === a || e === b || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === y || e.$$typeof === f || e.$$typeof === p || e.$$typeof === u || e.$$typeof === x || e.getModuleId !== void 0);
87
+ }, l.typeOf = g, l;
88
+ }
89
+ var d = {};
90
+ /**
91
+ * @license React
92
+ * react-is.development.js
93
+ *
94
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
95
+ *
96
+ * This source code is licensed under the MIT license found in the
97
+ * LICENSE file in the root directory of this source tree.
98
+ */
99
+ var fe;
100
+ function Le() {
101
+ return fe || (fe = 1, process.env.NODE_ENV !== "production" && function() {
102
+ function o(e) {
103
+ if (typeof e == "object" && e !== null) {
104
+ var h = e.$$typeof;
105
+ switch (h) {
106
+ case r:
107
+ switch (e = e.type, e) {
108
+ case s:
109
+ case p:
110
+ case c:
111
+ case a:
112
+ case y:
113
+ return e;
114
+ default:
115
+ switch (e = e && e.$$typeof, e) {
116
+ case u:
117
+ case E:
118
+ case b:
119
+ case T:
120
+ return e;
121
+ case f:
122
+ return e;
123
+ default:
124
+ return h;
125
+ }
126
+ }
127
+ case n:
128
+ return h;
129
+ }
130
+ }
131
+ }
132
+ var r = Symbol.for("react.transitional.element"), n = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), f = Symbol.for("react.consumer"), u = Symbol.for("react.context"), E = Symbol.for("react.forward_ref"), a = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), g = Symbol.for("react.client.reference");
133
+ d.ContextConsumer = f, d.ContextProvider = u, d.Element = r, d.ForwardRef = E, d.Fragment = s, d.Lazy = b, d.Memo = T, d.Portal = n, d.Profiler = p, d.StrictMode = c, d.Suspense = a, d.SuspenseList = y, d.isContextConsumer = function(e) {
134
+ return o(e) === f;
135
+ }, d.isContextProvider = function(e) {
136
+ return o(e) === u;
137
+ }, d.isElement = function(e) {
138
+ return typeof e == "object" && e !== null && e.$$typeof === r;
139
+ }, d.isForwardRef = function(e) {
140
+ return o(e) === E;
141
+ }, d.isFragment = function(e) {
142
+ return o(e) === s;
143
+ }, d.isLazy = function(e) {
144
+ return o(e) === b;
145
+ }, d.isMemo = function(e) {
146
+ return o(e) === T;
147
+ }, d.isPortal = function(e) {
148
+ return o(e) === n;
149
+ }, d.isProfiler = function(e) {
150
+ return o(e) === p;
151
+ }, d.isStrictMode = function(e) {
152
+ return o(e) === c;
153
+ }, d.isSuspense = function(e) {
154
+ return o(e) === a;
155
+ }, d.isSuspenseList = function(e) {
156
+ return o(e) === y;
157
+ }, d.isValidElementType = function(e) {
158
+ return typeof e == "string" || typeof e == "function" || e === s || e === p || e === c || e === a || e === y || e === x || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === T || e.$$typeof === u || e.$$typeof === f || e.$$typeof === E || e.$$typeof === g || e.getModuleId !== void 0);
159
+ }, d.typeOf = o;
160
+ }()), d;
133
161
  }
134
- var Ee = /* @__PURE__ */ h.forwardRef(function(e, n) {
135
- var a = e.prefixCls, t = a === void 0 ? "rc-collapse" : a, o = e.destroyInactivePanel, c = o === void 0 ? !1 : o, v = e.style, l = e.accordion, u = e.className, i = e.children, C = e.collapsible, f = e.openMotion, d = e.expandIcon, r = e.activeKey, g = e.defaultActiveKey, x = e.onChange, s = e.items, b = D(t, u), $ = be([], {
136
- value: r,
137
- onChange: function(w) {
138
- return x == null ? void 0 : x(w);
162
+ process.env.NODE_ENV === "production" ? te.exports = Fe() : te.exports = Le();
163
+ var Ye = te.exports;
164
+ function ze(o) {
165
+ return Z("MuiCollapse", o);
166
+ }
167
+ X("MuiCollapse", ["root", "horizontal", "vertical", "entered", "hidden", "wrapper", "wrapperInner"]);
168
+ const Ve = (o) => {
169
+ const {
170
+ orientation: r,
171
+ classes: n
172
+ } = o, s = {
173
+ root: ["root", `${r}`],
174
+ entered: ["entered"],
175
+ hidden: ["hidden"],
176
+ wrapper: ["wrapper", `${r}`],
177
+ wrapperInner: ["wrapperInner", `${r}`]
178
+ };
179
+ return K(s, ze, n);
180
+ }, Ue = w("div", {
181
+ name: "MuiCollapse",
182
+ slot: "Root",
183
+ overridesResolver: (o, r) => {
184
+ const {
185
+ ownerState: n
186
+ } = o;
187
+ return [r.root, r[n.orientation], n.state === "entered" && r.entered, n.state === "exited" && !n.in && n.collapsedSize === "0px" && r.hidden];
188
+ }
189
+ })($(({
190
+ theme: o
191
+ }) => ({
192
+ height: 0,
193
+ overflow: "hidden",
194
+ transition: o.transitions.create("height"),
195
+ variants: [{
196
+ props: {
197
+ orientation: "horizontal"
139
198
  },
140
- defaultValue: g,
141
- postState: Se
142
- }), N = J($, 2), p = N[0], S = N[1], y = function(w) {
143
- return S(function() {
144
- if (l)
145
- return p[0] === w ? [] : [w];
146
- var A = p.indexOf(w), m = A > -1;
147
- return m ? p.filter(function(I) {
148
- return I !== w;
149
- }) : [].concat(me(p), [w]);
199
+ style: {
200
+ height: "auto",
201
+ width: 0,
202
+ transition: o.transitions.create("width")
203
+ }
204
+ }, {
205
+ props: {
206
+ state: "entered"
207
+ },
208
+ style: {
209
+ height: "auto",
210
+ overflow: "visible"
211
+ }
212
+ }, {
213
+ props: {
214
+ state: "entered",
215
+ orientation: "horizontal"
216
+ },
217
+ style: {
218
+ width: "auto"
219
+ }
220
+ }, {
221
+ props: ({
222
+ ownerState: r
223
+ }) => r.state === "exited" && !r.in && r.collapsedSize === "0px",
224
+ style: {
225
+ visibility: "hidden"
226
+ }
227
+ }]
228
+ }))), We = w("div", {
229
+ name: "MuiCollapse",
230
+ slot: "Wrapper",
231
+ overridesResolver: (o, r) => r.wrapper
232
+ })({
233
+ // Hack to get children with a negative margin to not falsify the height computation.
234
+ display: "flex",
235
+ width: "100%",
236
+ variants: [{
237
+ props: {
238
+ orientation: "horizontal"
239
+ },
240
+ style: {
241
+ width: "auto",
242
+ height: "100%"
243
+ }
244
+ }]
245
+ }), Ge = w("div", {
246
+ name: "MuiCollapse",
247
+ slot: "WrapperInner",
248
+ overridesResolver: (o, r) => r.wrapperInner
249
+ })({
250
+ width: "100%",
251
+ variants: [{
252
+ props: {
253
+ orientation: "horizontal"
254
+ },
255
+ style: {
256
+ width: "auto",
257
+ height: "100%"
258
+ }
259
+ }]
260
+ }), H = /* @__PURE__ */ C.forwardRef(function(r, n) {
261
+ const s = J({
262
+ props: r,
263
+ name: "MuiCollapse"
264
+ }), {
265
+ addEndListener: c,
266
+ children: p,
267
+ className: f,
268
+ collapsedSize: u = "0px",
269
+ component: E,
270
+ easing: a,
271
+ in: y,
272
+ onEnter: T,
273
+ onEntered: b,
274
+ onEntering: x,
275
+ onExit: g,
276
+ onExited: e,
277
+ onExiting: h,
278
+ orientation: R = "vertical",
279
+ style: M,
280
+ timeout: A = Se.standard,
281
+ // eslint-disable-next-line react/prop-types
282
+ TransitionComponent: U = $e,
283
+ ...Q
284
+ } = s, O = {
285
+ ...s,
286
+ orientation: R,
287
+ collapsedSize: u
288
+ }, _ = Ve(O), D = Ie(), j = ve(), P = C.useRef(null), F = C.useRef(), L = typeof u == "number" ? `${u}px` : u, N = R === "horizontal", I = N ? "width" : "height", Y = C.useRef(null), ee = Me(n, Y), z = (i) => (S) => {
289
+ if (i) {
290
+ const v = Y.current;
291
+ S === void 0 ? i(v) : i(v, S);
292
+ }
293
+ }, oe = () => P.current ? P.current[N ? "clientWidth" : "clientHeight"] : 0, Ee = z((i, S) => {
294
+ P.current && N && (P.current.style.position = "absolute"), i.style[I] = L, T && T(i, S);
295
+ }), ye = z((i, S) => {
296
+ const v = oe();
297
+ P.current && N && (P.current.style.position = "");
298
+ const {
299
+ duration: W,
300
+ easing: B
301
+ } = de({
302
+ style: M,
303
+ timeout: A,
304
+ easing: a
305
+ }, {
306
+ mode: "enter"
150
307
  });
151
- };
152
- de(!i, "[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");
153
- var E = we(s, i, {
154
- prefixCls: t,
155
- accordion: l,
156
- openMotion: f,
157
- expandIcon: d,
158
- collapsible: C,
159
- destroyInactivePanel: c,
160
- onItemClick: y,
161
- activeKey: p
308
+ if (A === "auto") {
309
+ const ae = D.transitions.getAutoHeightDuration(v);
310
+ i.style.transitionDuration = `${ae}ms`, F.current = ae;
311
+ } else
312
+ i.style.transitionDuration = typeof W == "string" ? W : `${W}ms`;
313
+ i.style[I] = `${v}px`, i.style.transitionTimingFunction = B, x && x(i, S);
314
+ }), ge = z((i, S) => {
315
+ i.style[I] = "auto", b && b(i, S);
316
+ }), Te = z((i) => {
317
+ i.style[I] = `${oe()}px`, g && g(i);
318
+ }), he = z(e), be = z((i) => {
319
+ const S = oe(), {
320
+ duration: v,
321
+ easing: W
322
+ } = de({
323
+ style: M,
324
+ timeout: A,
325
+ easing: a
326
+ }, {
327
+ mode: "exit"
328
+ });
329
+ if (A === "auto") {
330
+ const B = D.transitions.getAutoHeightDuration(S);
331
+ i.style.transitionDuration = `${B}ms`, F.current = B;
332
+ } else
333
+ i.style.transitionDuration = typeof v == "string" ? v : `${v}ms`;
334
+ i.style[I] = L, i.style.transitionTimingFunction = W, h && h(i);
335
+ });
336
+ return /* @__PURE__ */ m(U, {
337
+ in: y,
338
+ onEnter: Ee,
339
+ onEntered: ge,
340
+ onEntering: ye,
341
+ onExit: Te,
342
+ onExited: he,
343
+ onExiting: be,
344
+ addEndListener: (i) => {
345
+ A === "auto" && j.start(F.current || 0, i), c && c(Y.current, i);
346
+ },
347
+ nodeRef: Y,
348
+ timeout: A === "auto" ? null : A,
349
+ ...Q,
350
+ children: (i, {
351
+ ownerState: S,
352
+ ...v
353
+ }) => /* @__PURE__ */ m(Ue, {
354
+ as: E,
355
+ className: k(_.root, f, {
356
+ entered: _.entered,
357
+ exited: !y && L === "0px" && _.hidden
358
+ }[i]),
359
+ style: {
360
+ [N ? "minWidth" : "minHeight"]: L,
361
+ ...M
362
+ },
363
+ ref: ee,
364
+ ownerState: {
365
+ ...O,
366
+ state: i
367
+ },
368
+ ...v,
369
+ children: /* @__PURE__ */ m(We, {
370
+ ownerState: {
371
+ ...O,
372
+ state: i
373
+ },
374
+ className: _.wrapper,
375
+ ref: P,
376
+ children: /* @__PURE__ */ m(Ge, {
377
+ ownerState: {
378
+ ...O,
379
+ state: i
380
+ },
381
+ className: _.wrapperInner,
382
+ children: p
383
+ })
384
+ })
385
+ })
162
386
  });
163
- return /* @__PURE__ */ h.createElement("div", T({
164
- ref: n,
165
- className: b,
166
- style: v,
167
- role: l ? "tablist" : void 0
168
- }, xe(e, {
169
- aria: !0,
170
- data: !0
171
- })), E);
172
387
  });
173
- const L = Object.assign(Ee, {
388
+ process.env.NODE_ENV !== "production" && (H.propTypes = {
389
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
390
+ // │ These PropTypes are generated from the TypeScript type definitions. │
391
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
392
+ // └─────────────────────────────────────────────────────────────────────┘
393
+ /**
394
+ * Add a custom transition end trigger. Called with the transitioning DOM
395
+ * node and a done callback. Allows for more fine grained transition end
396
+ * logic. Note: Timeouts are still used as a fallback if provided.
397
+ */
398
+ addEndListener: t.func,
399
+ /**
400
+ * The content node to be collapsed.
401
+ */
402
+ children: t.node,
403
+ /**
404
+ * Override or extend the styles applied to the component.
405
+ */
406
+ classes: t.object,
407
+ /**
408
+ * @ignore
409
+ */
410
+ className: t.string,
411
+ /**
412
+ * The width (horizontal) or height (vertical) of the container when collapsed.
413
+ * @default '0px'
414
+ */
415
+ collapsedSize: t.oneOfType([t.number, t.string]),
416
+ /**
417
+ * The component used for the root node.
418
+ * Either a string to use a HTML element or a component.
419
+ */
420
+ component: Ae,
421
+ /**
422
+ * The transition timing function.
423
+ * You may specify a single easing or a object containing enter and exit values.
424
+ */
425
+ easing: t.oneOfType([t.shape({
426
+ enter: t.string,
427
+ exit: t.string
428
+ }), t.string]),
429
+ /**
430
+ * If `true`, the component will transition in.
431
+ */
432
+ in: t.bool,
433
+ /**
434
+ * @ignore
435
+ */
436
+ onEnter: t.func,
437
+ /**
438
+ * @ignore
439
+ */
440
+ onEntered: t.func,
441
+ /**
442
+ * @ignore
443
+ */
444
+ onEntering: t.func,
445
+ /**
446
+ * @ignore
447
+ */
448
+ onExit: t.func,
449
+ /**
450
+ * @ignore
451
+ */
452
+ onExited: t.func,
453
+ /**
454
+ * @ignore
455
+ */
456
+ onExiting: t.func,
457
+ /**
458
+ * The transition orientation.
459
+ * @default 'vertical'
460
+ */
461
+ orientation: t.oneOf(["horizontal", "vertical"]),
174
462
  /**
175
- * @deprecated use `items` instead, will be removed in `v4.0.0`
463
+ * @ignore
176
464
  */
177
- Panel: ae
465
+ style: t.object,
466
+ /**
467
+ * The system prop that allows defining system overrides as well as additional CSS styles.
468
+ */
469
+ sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
470
+ /**
471
+ * The duration for the transition, in milliseconds.
472
+ * You may specify a single timeout for all transitions, or individually with an object.
473
+ *
474
+ * Set to 'auto' to automatically calculate transition time based on height.
475
+ * @default duration.standard
476
+ */
477
+ timeout: t.oneOfType([t.oneOf(["auto"]), t.number, t.shape({
478
+ appear: t.number,
479
+ enter: t.number,
480
+ exit: t.number
481
+ })])
178
482
  });
179
- L.Panel;
180
- const Ae = /* @__PURE__ */ M.forwardRef((e, n) => {
181
- process.env.NODE_ENV !== "production" && Y("Collapse.Panel").deprecated(!("disabled" in e), "disabled", 'collapsible="disabled"');
483
+ H && (H.muiSupportAuto = !0);
484
+ const se = /* @__PURE__ */ C.createContext({});
485
+ process.env.NODE_ENV !== "production" && (se.displayName = "AccordionContext");
486
+ function ke(o) {
487
+ return Z("MuiAccordion", o);
488
+ }
489
+ const q = X("MuiAccordion", ["root", "heading", "rounded", "expanded", "disabled", "gutters", "region"]), Be = (o) => {
182
490
  const {
183
- getPrefixCls: a
184
- } = M.useContext(Z), {
185
- prefixCls: t,
186
- className: o,
187
- showArrow: c = !0
188
- } = e, v = a("collapse", t), l = D({
189
- [`${v}-no-arrow`]: !c
190
- }, o);
191
- return /* @__PURE__ */ M.createElement(L.Panel, Object.assign({
192
- ref: n
193
- }, e, {
194
- prefixCls: v,
195
- className: l
196
- }));
197
- }), Me = (e) => ({
198
- [e.componentCls]: {
199
- // For common/openAnimation
200
- [`${e.antCls}-motion-collapse-legacy`]: {
201
- overflow: "hidden",
202
- "&-active": {
203
- transition: `height ${e.motionDurationMid} ${e.motionEaseInOut},
204
- opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`
205
- }
206
- },
207
- [`${e.antCls}-motion-collapse`]: {
208
- overflow: "hidden",
209
- transition: `height ${e.motionDurationMid} ${e.motionEaseInOut},
210
- opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`
211
- }
491
+ classes: r,
492
+ square: n,
493
+ expanded: s,
494
+ disabled: c,
495
+ disableGutters: p
496
+ } = o;
497
+ return K({
498
+ root: ["root", !n && "rounded", s && "expanded", c && "disabled", !p && "gutters"],
499
+ heading: ["heading"],
500
+ region: ["region"]
501
+ }, ke, r);
502
+ }, qe = w(we, {
503
+ name: "MuiAccordion",
504
+ slot: "Root",
505
+ overridesResolver: (o, r) => {
506
+ const {
507
+ ownerState: n
508
+ } = o;
509
+ return [{
510
+ [`& .${q.region}`]: r.region
511
+ }, r.root, !n.square && r.rounded, !n.disableGutters && r.gutters];
212
512
  }
213
- }), Oe = (e) => {
214
- const {
215
- componentCls: n,
216
- contentBg: a,
217
- padding: t,
218
- headerBg: o,
219
- headerPadding: c,
220
- collapseHeaderPaddingSM: v,
221
- collapseHeaderPaddingLG: l,
222
- collapsePanelBorderRadius: u,
223
- lineWidth: i,
224
- lineType: C,
225
- colorBorder: f,
226
- colorText: d,
227
- colorTextHeading: r,
228
- colorTextDisabled: g,
229
- fontSizeLG: x,
230
- lineHeight: s,
231
- lineHeightLG: b,
232
- marginSM: $,
233
- paddingSM: N,
234
- paddingLG: p,
235
- paddingXS: S,
236
- motionDurationSlow: y,
237
- fontSizeIcon: E,
238
- contentPadding: P,
239
- fontHeight: w,
240
- fontHeightLG: A
241
- } = e, m = `${R(i)} ${C} ${f}`;
513
+ })($(({
514
+ theme: o
515
+ }) => {
516
+ const r = {
517
+ duration: o.transitions.duration.shortest
518
+ };
242
519
  return {
243
- [n]: Object.assign(Object.assign({}, ge(e)), {
244
- backgroundColor: o,
245
- border: m,
246
- borderRadius: u,
247
- "&-rtl": {
248
- direction: "rtl"
249
- },
250
- [`& > ${n}-item`]: {
251
- borderBottom: m,
252
- "&:last-child": {
253
- [`
254
- &,
255
- & > ${n}-header`]: {
256
- borderRadius: `0 0 ${R(u)} ${R(u)}`
257
- }
258
- },
259
- [`> ${n}-header`]: {
260
- position: "relative",
261
- // Compatible with old version of antd, should remove in next version
262
- display: "flex",
263
- flexWrap: "nowrap",
264
- alignItems: "flex-start",
265
- padding: c,
266
- color: r,
267
- lineHeight: s,
268
- cursor: "pointer",
269
- transition: `all ${y}, visibility 0s`,
270
- [`> ${n}-header-text`]: {
271
- flex: "auto"
272
- },
273
- "&:focus": {
274
- outline: "none"
275
- },
276
- // >>>>> Arrow
277
- [`${n}-expand-icon`]: {
278
- height: w,
279
- display: "flex",
280
- alignItems: "center",
281
- paddingInlineEnd: $
282
- },
283
- [`${n}-arrow`]: Object.assign(Object.assign({}, Ce()), {
284
- fontSize: E,
285
- // when `transform: rotate()` is applied to icon's root element
286
- transition: `transform ${y}`,
287
- // when `transform: rotate()` is applied to icon's child element
288
- svg: {
289
- transition: `transform ${y}`
290
- }
291
- }),
292
- // >>>>> Text
293
- [`${n}-header-text`]: {
294
- marginInlineEnd: "auto"
295
- }
296
- },
297
- [`${n}-icon-collapsible-only`]: {
298
- cursor: "unset",
299
- [`${n}-expand-icon`]: {
300
- cursor: "pointer"
301
- }
302
- }
303
- },
304
- [`${n}-content`]: {
305
- color: d,
306
- backgroundColor: a,
307
- borderTop: m,
308
- [`& > ${n}-content-box`]: {
309
- padding: P
310
- },
311
- "&-hidden": {
312
- display: "none"
313
- }
314
- },
315
- "&-small": {
316
- [`> ${n}-item`]: {
317
- [`> ${n}-header`]: {
318
- padding: v,
319
- paddingInlineStart: S,
320
- [`> ${n}-expand-icon`]: {
321
- // Arrow offset
322
- marginInlineStart: e.calc(N).sub(S).equal()
323
- }
324
- },
325
- [`> ${n}-content > ${n}-content-box`]: {
326
- padding: N
327
- }
328
- }
329
- },
330
- "&-large": {
331
- [`> ${n}-item`]: {
332
- fontSize: x,
333
- lineHeight: b,
334
- [`> ${n}-header`]: {
335
- padding: l,
336
- paddingInlineStart: t,
337
- [`> ${n}-expand-icon`]: {
338
- height: A,
339
- // Arrow offset
340
- marginInlineStart: e.calc(p).sub(t).equal()
341
- }
342
- },
343
- [`> ${n}-content > ${n}-content-box`]: {
344
- padding: p
345
- }
346
- }
520
+ position: "relative",
521
+ transition: o.transitions.create(["margin"], r),
522
+ overflowAnchor: "none",
523
+ // Keep the same scrolling position
524
+ "&::before": {
525
+ position: "absolute",
526
+ left: 0,
527
+ top: -1,
528
+ right: 0,
529
+ height: 1,
530
+ content: '""',
531
+ opacity: 1,
532
+ backgroundColor: (o.vars || o).palette.divider,
533
+ transition: o.transitions.create(["opacity", "background-color"], r)
534
+ },
535
+ "&:first-of-type": {
536
+ "&::before": {
537
+ display: "none"
538
+ }
539
+ },
540
+ [`&.${q.expanded}`]: {
541
+ "&::before": {
542
+ opacity: 0
347
543
  },
348
- [`${n}-item:last-child`]: {
349
- borderBottom: 0,
350
- [`> ${n}-content`]: {
351
- borderRadius: `0 0 ${R(u)} ${R(u)}`
352
- }
544
+ "&:first-of-type": {
545
+ marginTop: 0
353
546
  },
354
- [`& ${n}-item-disabled > ${n}-header`]: {
355
- "\n &,\n & > .arrow\n ": {
356
- color: g,
357
- cursor: "not-allowed"
358
- }
547
+ "&:last-of-type": {
548
+ marginBottom: 0
359
549
  },
360
- // ========================== Icon Position ==========================
361
- [`&${n}-icon-position-end`]: {
362
- [`& > ${n}-item`]: {
363
- [`> ${n}-header`]: {
364
- [`${n}-expand-icon`]: {
365
- order: 1,
366
- paddingInlineEnd: 0,
367
- paddingInlineStart: $
368
- }
369
- }
550
+ "& + &": {
551
+ "&::before": {
552
+ display: "none"
370
553
  }
371
554
  }
372
- })
373
- };
374
- }, Re = (e) => {
375
- const {
376
- componentCls: n
377
- } = e, a = `> ${n}-item > ${n}-header ${n}-arrow`;
378
- return {
379
- [`${n}-rtl`]: {
380
- [a]: {
381
- transform: "rotate(180deg)"
382
- }
555
+ },
556
+ [`&.${q.disabled}`]: {
557
+ backgroundColor: (o.vars || o).palette.action.disabledBackground
383
558
  }
384
559
  };
385
- }, _e = (e) => {
386
- const {
387
- componentCls: n,
388
- headerBg: a,
389
- paddingXXS: t,
390
- colorBorder: o
391
- } = e;
392
- return {
393
- [`${n}-borderless`]: {
394
- backgroundColor: a,
395
- border: 0,
396
- [`> ${n}-item`]: {
397
- borderBottom: `1px solid ${o}`
398
- },
399
- [`
400
- > ${n}-item:last-child,
401
- > ${n}-item:last-child ${n}-header
402
- `]: {
403
- borderRadius: 0
560
+ }), $(({
561
+ theme: o
562
+ }) => ({
563
+ variants: [{
564
+ props: (r) => !r.square,
565
+ style: {
566
+ borderRadius: 0,
567
+ "&:first-of-type": {
568
+ borderTopLeftRadius: (o.vars || o).shape.borderRadius,
569
+ borderTopRightRadius: (o.vars || o).shape.borderRadius
404
570
  },
405
- [`> ${n}-item:last-child`]: {
406
- borderBottom: 0
407
- },
408
- [`> ${n}-item > ${n}-content`]: {
409
- backgroundColor: "transparent",
410
- borderTop: 0
411
- },
412
- [`> ${n}-item > ${n}-content > ${n}-content-box`]: {
413
- paddingTop: t
571
+ "&:last-of-type": {
572
+ borderBottomLeftRadius: (o.vars || o).shape.borderRadius,
573
+ borderBottomRightRadius: (o.vars || o).shape.borderRadius,
574
+ // Fix a rendering issue on Edge
575
+ "@supports (-ms-ime-align: auto)": {
576
+ borderBottomLeftRadius: 0,
577
+ borderBottomRightRadius: 0
578
+ }
414
579
  }
415
580
  }
416
- };
417
- }, ke = (e) => {
581
+ }, {
582
+ props: (r) => !r.disableGutters,
583
+ style: {
584
+ [`&.${q.expanded}`]: {
585
+ margin: "16px 0"
586
+ }
587
+ }
588
+ }]
589
+ }))), He = w("h3", {
590
+ name: "MuiAccordion",
591
+ slot: "Heading",
592
+ overridesResolver: (o, r) => r.heading
593
+ })({
594
+ all: "unset"
595
+ }), re = /* @__PURE__ */ C.forwardRef(function(r, n) {
596
+ const s = J({
597
+ props: r,
598
+ name: "MuiAccordion"
599
+ }), {
600
+ children: c,
601
+ className: p,
602
+ defaultExpanded: f = !1,
603
+ disabled: u = !1,
604
+ disableGutters: E = !1,
605
+ expanded: a,
606
+ onChange: y,
607
+ square: T = !1,
608
+ slots: b = {},
609
+ slotProps: x = {},
610
+ TransitionComponent: g,
611
+ TransitionProps: e,
612
+ ...h
613
+ } = s, [R, M] = Ne({
614
+ controlled: a,
615
+ default: f,
616
+ name: "Accordion",
617
+ state: "expanded"
618
+ }), A = C.useCallback((ee) => {
619
+ M(!R), y && y(ee, !R);
620
+ }, [R, y, M]), [U, ...Q] = C.Children.toArray(c), O = C.useMemo(() => ({
621
+ expanded: R,
622
+ disabled: u,
623
+ disableGutters: E,
624
+ toggle: A
625
+ }), [R, u, E, A]), _ = {
626
+ ...s,
627
+ square: T,
628
+ disabled: u,
629
+ disableGutters: E,
630
+ expanded: R
631
+ }, D = Be(_), j = {
632
+ transition: g,
633
+ ...b
634
+ }, P = {
635
+ transition: e,
636
+ ...x
637
+ }, F = {
638
+ slots: j,
639
+ slotProps: P
640
+ }, [L, N] = le("heading", {
641
+ elementType: He,
642
+ externalForwardedProps: F,
643
+ className: D.heading,
644
+ ownerState: _
645
+ }), [I, Y] = le("transition", {
646
+ elementType: H,
647
+ externalForwardedProps: F,
648
+ ownerState: _
649
+ });
650
+ return /* @__PURE__ */ G(qe, {
651
+ className: k(D.root, p),
652
+ ref: n,
653
+ ownerState: _,
654
+ square: T,
655
+ ...h,
656
+ children: [/* @__PURE__ */ m(L, {
657
+ ...N,
658
+ children: /* @__PURE__ */ m(se.Provider, {
659
+ value: O,
660
+ children: U
661
+ })
662
+ }), /* @__PURE__ */ m(I, {
663
+ in: R,
664
+ timeout: "auto",
665
+ ...Y,
666
+ children: /* @__PURE__ */ m("div", {
667
+ "aria-labelledby": U.props.id,
668
+ id: U.props["aria-controls"],
669
+ role: "region",
670
+ className: D.region,
671
+ children: Q
672
+ })
673
+ })]
674
+ });
675
+ });
676
+ process.env.NODE_ENV !== "production" && (re.propTypes = {
677
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
678
+ // │ These PropTypes are generated from the TypeScript type definitions. │
679
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
680
+ // └─────────────────────────────────────────────────────────────────────┘
681
+ /**
682
+ * The content of the component.
683
+ */
684
+ children: _e(t.node.isRequired, (o) => {
685
+ const r = C.Children.toArray(o.children)[0];
686
+ return Ye.isFragment(r) ? new Error("MUI: The Accordion doesn't accept a Fragment as a child. Consider providing an array instead.") : /* @__PURE__ */ C.isValidElement(r) ? null : new Error("MUI: Expected the first child of Accordion to be a valid element.");
687
+ }),
688
+ /**
689
+ * Override or extend the styles applied to the component.
690
+ */
691
+ classes: t.object,
692
+ /**
693
+ * @ignore
694
+ */
695
+ className: t.string,
696
+ /**
697
+ * If `true`, expands the accordion by default.
698
+ * @default false
699
+ */
700
+ defaultExpanded: t.bool,
701
+ /**
702
+ * If `true`, the component is disabled.
703
+ * @default false
704
+ */
705
+ disabled: t.bool,
706
+ /**
707
+ * If `true`, it removes the margin between two expanded accordion items and the increase of height.
708
+ * @default false
709
+ */
710
+ disableGutters: t.bool,
711
+ /**
712
+ * If `true`, expands the accordion, otherwise collapse it.
713
+ * Setting this prop enables control over the accordion.
714
+ */
715
+ expanded: t.bool,
716
+ /**
717
+ * Callback fired when the expand/collapse state is changed.
718
+ *
719
+ * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
720
+ * @param {boolean} expanded The `expanded` state of the accordion.
721
+ */
722
+ onChange: t.func,
723
+ /**
724
+ * The props used for each slot inside.
725
+ * @default {}
726
+ */
727
+ slotProps: t.shape({
728
+ heading: t.oneOfType([t.func, t.object]),
729
+ transition: t.oneOfType([t.func, t.object])
730
+ }),
731
+ /**
732
+ * The components used for each slot inside.
733
+ * @default {}
734
+ */
735
+ slots: t.shape({
736
+ heading: t.elementType,
737
+ transition: t.elementType
738
+ }),
739
+ /**
740
+ * If `true`, rounded corners are disabled.
741
+ * @default false
742
+ */
743
+ square: t.bool,
744
+ /**
745
+ * The system prop that allows defining system overrides as well as additional CSS styles.
746
+ */
747
+ sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
748
+ /**
749
+ * The component used for the transition.
750
+ * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
751
+ * @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
752
+ */
753
+ TransitionComponent: t.elementType,
754
+ /**
755
+ * Props applied to the transition element.
756
+ * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
757
+ * @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
758
+ */
759
+ TransitionProps: t.object
760
+ });
761
+ function Xe(o) {
762
+ return Z("MuiAccordionDetails", o);
763
+ }
764
+ X("MuiAccordionDetails", ["root"]);
765
+ const Ze = (o) => {
766
+ const {
767
+ classes: r
768
+ } = o;
769
+ return K({
770
+ root: ["root"]
771
+ }, Xe, r);
772
+ }, Je = w("div", {
773
+ name: "MuiAccordionDetails",
774
+ slot: "Root",
775
+ overridesResolver: (o, r) => r.root
776
+ })($(({
777
+ theme: o
778
+ }) => ({
779
+ padding: o.spacing(1, 2, 2)
780
+ }))), ne = /* @__PURE__ */ C.forwardRef(function(r, n) {
781
+ const s = J({
782
+ props: r,
783
+ name: "MuiAccordionDetails"
784
+ }), {
785
+ className: c,
786
+ ...p
787
+ } = s, f = s, u = Ze(f);
788
+ return /* @__PURE__ */ m(Je, {
789
+ className: k(u.root, c),
790
+ ref: n,
791
+ ownerState: f,
792
+ ...p
793
+ });
794
+ });
795
+ process.env.NODE_ENV !== "production" && (ne.propTypes = {
796
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
797
+ // │ These PropTypes are generated from the TypeScript type definitions. │
798
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
799
+ // └─────────────────────────────────────────────────────────────────────┘
800
+ /**
801
+ * The content of the component.
802
+ */
803
+ children: t.node,
804
+ /**
805
+ * Override or extend the styles applied to the component.
806
+ */
807
+ classes: t.object,
808
+ /**
809
+ * @ignore
810
+ */
811
+ className: t.string,
812
+ /**
813
+ * The system prop that allows defining system overrides as well as additional CSS styles.
814
+ */
815
+ sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
816
+ });
817
+ function Ke(o) {
818
+ return Z("MuiAccordionSummary", o);
819
+ }
820
+ const V = X("MuiAccordionSummary", ["root", "expanded", "focusVisible", "disabled", "gutters", "contentGutters", "content", "expandIconWrapper"]), Qe = (o) => {
418
821
  const {
419
- componentCls: n,
420
- paddingSM: a
421
- } = e;
822
+ classes: r,
823
+ expanded: n,
824
+ disabled: s,
825
+ disableGutters: c
826
+ } = o;
827
+ return K({
828
+ root: ["root", n && "expanded", s && "disabled", !c && "gutters"],
829
+ focusVisible: ["focusVisible"],
830
+ content: ["content", n && "expanded", !c && "contentGutters"],
831
+ expandIconWrapper: ["expandIconWrapper", n && "expanded"]
832
+ }, Ke, r);
833
+ }, je = w(Pe, {
834
+ name: "MuiAccordionSummary",
835
+ slot: "Root",
836
+ overridesResolver: (o, r) => r.root
837
+ })($(({
838
+ theme: o
839
+ }) => {
840
+ const r = {
841
+ duration: o.transitions.duration.shortest
842
+ };
422
843
  return {
423
- [`${n}-ghost`]: {
424
- backgroundColor: "transparent",
425
- border: 0,
426
- [`> ${n}-item`]: {
427
- borderBottom: 0,
428
- [`> ${n}-content`]: {
429
- backgroundColor: "transparent",
430
- border: 0,
431
- [`> ${n}-content-box`]: {
432
- paddingBlock: a
433
- }
844
+ display: "flex",
845
+ width: "100%",
846
+ minHeight: 48,
847
+ padding: o.spacing(0, 2),
848
+ transition: o.transitions.create(["min-height", "background-color"], r),
849
+ [`&.${V.focusVisible}`]: {
850
+ backgroundColor: (o.vars || o).palette.action.focus
851
+ },
852
+ [`&.${V.disabled}`]: {
853
+ opacity: (o.vars || o).palette.action.disabledOpacity
854
+ },
855
+ [`&:hover:not(.${V.disabled})`]: {
856
+ cursor: "pointer"
857
+ },
858
+ variants: [{
859
+ props: (n) => !n.disableGutters,
860
+ style: {
861
+ [`&.${V.expanded}`]: {
862
+ minHeight: 64
434
863
  }
435
864
  }
436
- }
865
+ }]
437
866
  };
438
- }, Ke = (e) => ({
439
- headerPadding: `${e.paddingSM}px ${e.padding}px`,
440
- headerBg: e.colorFillAlter,
441
- contentPadding: `${e.padding}px 16px`,
442
- // Fixed Value
443
- contentBg: e.colorBgContainer
444
- }), De = ve("Collapse", (e) => {
445
- const n = pe(e, {
446
- collapseHeaderPaddingSM: `${R(e.paddingXS)} ${R(e.paddingSM)}`,
447
- collapseHeaderPaddingLG: `${R(e.padding)} ${R(e.paddingLG)}`,
448
- collapsePanelBorderRadius: e.borderRadiusLG
449
- });
450
- return [Oe(n), _e(n), ke(n), Re(n), Me(n)];
451
- }, Ke), te = /* @__PURE__ */ M.forwardRef((e, n) => {
452
- const {
453
- getPrefixCls: a,
454
- direction: t,
455
- collapse: o
456
- } = M.useContext(Z), {
457
- prefixCls: c,
458
- className: v,
459
- rootClassName: l,
460
- style: u,
461
- bordered: i = !0,
462
- ghost: C,
463
- size: f,
464
- expandIconPosition: d = "start",
465
- children: r,
466
- expandIcon: g
467
- } = e, x = ye((m) => {
468
- var I;
469
- return (I = f ?? m) !== null && I !== void 0 ? I : "middle";
470
- }), s = a("collapse", c), b = a(), [$, N, p] = De(s);
471
- if (process.env.NODE_ENV !== "production") {
472
- const m = Y("Collapse");
473
- process.env.NODE_ENV !== "production" && m(d !== "left" && d !== "right", "deprecated", "`expandIconPosition` with `left` or `right` is deprecated. Please use `start` or `end` instead.");
474
- }
475
- const S = M.useMemo(() => d === "left" ? "start" : d === "right" ? "end" : d, [d]), y = g ?? (o == null ? void 0 : o.expandIcon), E = M.useCallback(function() {
476
- let m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
477
- const I = typeof y == "function" ? y(m) : /* @__PURE__ */ M.createElement(ce, {
478
- rotate: m.isActive ? 90 : void 0,
479
- "aria-label": m.isActive ? "expanded" : "collapsed"
480
- });
481
- return X(I, () => {
482
- var O;
483
- return {
484
- className: D((O = I == null ? void 0 : I.props) === null || O === void 0 ? void 0 : O.className, `${s}-arrow`)
485
- };
486
- });
487
- }, [y, s]), P = D(`${s}-icon-position-${S}`, {
488
- [`${s}-borderless`]: !i,
489
- [`${s}-rtl`]: t === "rtl",
490
- [`${s}-ghost`]: !!C,
491
- [`${s}-${x}`]: x !== "middle"
492
- }, o == null ? void 0 : o.className, v, l, N, p), w = Object.assign(Object.assign({}, he(b)), {
493
- motionAppear: !1,
494
- leavedClassName: `${s}-content-hidden`
495
- }), A = M.useMemo(() => r ? ee(r).map((m, I) => {
496
- var O, _;
497
- if (!((O = m.props) === null || O === void 0) && O.disabled) {
498
- const H = (_ = m.key) !== null && _ !== void 0 ? _ : String(I), {
499
- disabled: G,
500
- collapsible: k
501
- } = m.props, j = Object.assign(Object.assign({}, q(m.props, ["disabled"])), {
502
- key: H,
503
- collapsible: k ?? (G ? "disabled" : void 0)
504
- });
505
- return X(m, j);
867
+ })), eo = w("span", {
868
+ name: "MuiAccordionSummary",
869
+ slot: "Content",
870
+ overridesResolver: (o, r) => r.content
871
+ })($(({
872
+ theme: o
873
+ }) => ({
874
+ display: "flex",
875
+ textAlign: "start",
876
+ flexGrow: 1,
877
+ margin: "12px 0",
878
+ variants: [{
879
+ props: (r) => !r.disableGutters,
880
+ style: {
881
+ transition: o.transitions.create(["margin"], {
882
+ duration: o.transitions.duration.shortest
883
+ }),
884
+ [`&.${V.expanded}`]: {
885
+ margin: "20px 0"
886
+ }
506
887
  }
507
- return m;
508
- }) : null, [r]);
509
- return $(
510
- // @ts-ignore
511
- /* @__PURE__ */ M.createElement(L, Object.assign({
512
- ref: n,
513
- openMotion: w
514
- }, q(e, ["rootClassName"]), {
515
- expandIcon: E,
516
- prefixCls: s,
517
- className: P,
518
- style: Object.assign(Object.assign({}, o == null ? void 0 : o.style), u)
519
- }), A)
520
- );
888
+ }]
889
+ }))), oo = w("span", {
890
+ name: "MuiAccordionSummary",
891
+ slot: "ExpandIconWrapper",
892
+ overridesResolver: (o, r) => r.expandIconWrapper
893
+ })($(({
894
+ theme: o
895
+ }) => ({
896
+ display: "flex",
897
+ color: (o.vars || o).palette.action.active,
898
+ transform: "rotate(0deg)",
899
+ transition: o.transitions.create("transform", {
900
+ duration: o.transitions.duration.shortest
901
+ }),
902
+ [`&.${V.expanded}`]: {
903
+ transform: "rotate(180deg)"
904
+ }
905
+ }))), ie = /* @__PURE__ */ C.forwardRef(function(r, n) {
906
+ const s = J({
907
+ props: r,
908
+ name: "MuiAccordionSummary"
909
+ }), {
910
+ children: c,
911
+ className: p,
912
+ expandIcon: f,
913
+ focusVisibleClassName: u,
914
+ onClick: E,
915
+ ...a
916
+ } = s, {
917
+ disabled: y = !1,
918
+ disableGutters: T,
919
+ expanded: b,
920
+ toggle: x
921
+ } = C.useContext(se), g = (R) => {
922
+ x && x(R), E && E(R);
923
+ }, e = {
924
+ ...s,
925
+ expanded: b,
926
+ disabled: y,
927
+ disableGutters: T
928
+ }, h = Qe(e);
929
+ return /* @__PURE__ */ G(je, {
930
+ focusRipple: !1,
931
+ disableRipple: !0,
932
+ disabled: y,
933
+ "aria-expanded": b,
934
+ className: k(h.root, p),
935
+ focusVisibleClassName: k(h.focusVisible, u),
936
+ onClick: g,
937
+ ref: n,
938
+ ownerState: e,
939
+ ...a,
940
+ children: [/* @__PURE__ */ m(eo, {
941
+ className: h.content,
942
+ ownerState: e,
943
+ children: c
944
+ }), f && /* @__PURE__ */ m(oo, {
945
+ className: h.expandIconWrapper,
946
+ ownerState: e,
947
+ children: f
948
+ })]
949
+ });
521
950
  });
522
- process.env.NODE_ENV !== "production" && (te.displayName = "Collapse");
523
- const U = Object.assign(te, {
524
- Panel: Ae
951
+ process.env.NODE_ENV !== "production" && (ie.propTypes = {
952
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
953
+ // │ These PropTypes are generated from the TypeScript type definitions. │
954
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
955
+ // └─────────────────────────────────────────────────────────────────────┘
956
+ /**
957
+ * The content of the component.
958
+ */
959
+ children: t.node,
960
+ /**
961
+ * Override or extend the styles applied to the component.
962
+ */
963
+ classes: t.object,
964
+ /**
965
+ * @ignore
966
+ */
967
+ className: t.string,
968
+ /**
969
+ * The icon to display as the expand indicator.
970
+ */
971
+ expandIcon: t.node,
972
+ /**
973
+ * This prop can help identify which element has keyboard focus.
974
+ * The class name will be applied when the element gains the focus through keyboard interaction.
975
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
976
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
977
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
978
+ * if needed.
979
+ */
980
+ focusVisibleClassName: t.string,
981
+ /**
982
+ * @ignore
983
+ */
984
+ onClick: t.func,
985
+ /**
986
+ * The system prop that allows defining system overrides as well as additional CSS styles.
987
+ */
988
+ sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
525
989
  });
526
- function qe() {
527
- const e = se(le);
528
- if (!e || !e.preferences)
990
+ const me = Oe(/* @__PURE__ */ m("path", {
991
+ d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
992
+ }), "ExpandMore");
993
+ function To() {
994
+ const o = Re(xe);
995
+ if (!o || !o.preferences)
529
996
  return null;
530
- const n = e.preferences.notifications.sort((a, t) => a.title.localeCompare(t.title)).map((a) => {
531
- var v, l, u;
532
- const t = (v = e.preferences) == null ? void 0 : v.preferences.filter(
533
- (i) => i.notificationId === a.notificationId && !i.subNotificationId
534
- ), o = (l = e.preferences) == null ? void 0 : l.preferences.filter(
535
- (i) => i.notificationId === a.notificationId && i.subNotificationId
536
- ), c = (u = e.preferences) == null ? void 0 : u.subNotifications.filter(
537
- (i) => o == null ? void 0 : o.find(
538
- (C) => C.subNotificationId === i.subNotificationId
997
+ const r = o.preferences.notifications.sort((n, s) => n.title.localeCompare(s.title)).map((n) => {
998
+ var f, u, E;
999
+ const s = (f = o.preferences) == null ? void 0 : f.preferences.filter(
1000
+ (a) => a.notificationId === n.notificationId && !a.subNotificationId
1001
+ ), c = (u = o.preferences) == null ? void 0 : u.preferences.filter(
1002
+ (a) => a.notificationId === n.notificationId && a.subNotificationId
1003
+ ), p = (E = o.preferences) == null ? void 0 : E.subNotifications.filter(
1004
+ (a) => c == null ? void 0 : c.find(
1005
+ (y) => y.subNotificationId === a.subNotificationId
539
1006
  )
540
1007
  );
541
- return {
542
- label: a.title,
543
- key: a.notificationId,
544
- children: /* @__PURE__ */ re(V, { children: [
545
- /* @__PURE__ */ z(
546
- W,
547
- {
548
- notification: a,
549
- preferences: t || [],
550
- updateDelivery: e.updateDelivery
551
- },
552
- a.notificationId
553
- ),
554
- c == null ? void 0 : c.map((i) => /* @__PURE__ */ z(
555
- U,
556
- {
557
- bordered: !1,
558
- items: [
1008
+ return /* @__PURE__ */ G(
1009
+ re,
1010
+ {
1011
+ style: {
1012
+ marginBottom: 0,
1013
+ marginTop: 0
1014
+ },
1015
+ children: [
1016
+ /* @__PURE__ */ m(
1017
+ ie,
1018
+ {
1019
+ expandIcon: /* @__PURE__ */ m(me, {}),
1020
+ style: {
1021
+ backgroundColor: "#f0f0f0",
1022
+ flexDirection: "row-reverse",
1023
+ gap: 16
1024
+ },
1025
+ children: /* @__PURE__ */ m(ue, { variant: "body1", children: n.title })
1026
+ }
1027
+ ),
1028
+ /* @__PURE__ */ m(ne, { children: /* @__PURE__ */ G(Ce, { children: [
1029
+ /* @__PURE__ */ m(
1030
+ ce,
559
1031
  {
560
- label: i.title,
561
- key: i.subNotificationId,
562
- children: /* @__PURE__ */ z(
563
- W,
564
- {
565
- notification: a,
566
- preferences: o || [],
567
- updateDelivery: e.updateDelivery,
568
- subNotificationId: i.subNotificationId
569
- },
570
- i.subNotificationId
571
- )
572
- }
573
- ],
574
- defaultActiveKey: []
575
- },
576
- i.subNotificationId
577
- ))
578
- ] })
579
- };
1032
+ notification: n,
1033
+ preferences: s || [],
1034
+ updateDelivery: o.updateDelivery
1035
+ },
1036
+ n.notificationId
1037
+ ),
1038
+ p == null ? void 0 : p.map((a) => /* @__PURE__ */ G(
1039
+ re,
1040
+ {
1041
+ style: {
1042
+ marginTop: 12
1043
+ },
1044
+ children: [
1045
+ /* @__PURE__ */ m(
1046
+ ie,
1047
+ {
1048
+ expandIcon: /* @__PURE__ */ m(me, {}),
1049
+ style: {
1050
+ flexDirection: "row-reverse",
1051
+ gap: 16
1052
+ },
1053
+ children: /* @__PURE__ */ m(ue, { variant: "body1", children: a.title })
1054
+ }
1055
+ ),
1056
+ /* @__PURE__ */ m(ne, { children: /* @__PURE__ */ m(
1057
+ ce,
1058
+ {
1059
+ notification: n,
1060
+ preferences: c || [],
1061
+ updateDelivery: o.updateDelivery,
1062
+ subNotificationId: a.subNotificationId
1063
+ },
1064
+ a.subNotificationId
1065
+ ) })
1066
+ ]
1067
+ },
1068
+ `${a.notificationId}-${a.subNotificationId}`
1069
+ ))
1070
+ ] }) })
1071
+ ]
1072
+ },
1073
+ n.notificationId
1074
+ );
580
1075
  });
581
- return /* @__PURE__ */ z(V, { children: /* @__PURE__ */ z(U, { items: n, defaultActiveKey: [] }) });
1076
+ return /* @__PURE__ */ m(De, { sx: { borderRadius: 2, overflow: "hidden" }, children: r });
582
1077
  }
583
1078
  export {
584
- qe as Preferences
1079
+ To as Preferences
585
1080
  };