UNPKG

@cgi-learning-hub/ui

Version:

@cgi-learning-hub/ui is an open-source React component library that implements UI for HUB's features

912 lines (911 loc) 29.9 kB
import * as u from "react"; import { Y as fe, G as de, F as me, H as he } from "./generateUtilityClasses-B_xKAflz.js"; import { P as e } from "./index-B9vkf41S.js"; import { u as ke } from "./index-Ba4TEBpP.js"; import { s as G, u as be, c as ye, r as xe } from "./DefaultPropsProvider-BrmlvPWg.js"; import { u as B } from "./useSlot-BSkdRaZr.js"; import { jsx as A } from "react/jsx-runtime"; import { u as De } from "./useSlotProps-CWTjRiRv.js"; import { i as Ne } from "./isHostComponent-kiaBvYVo.js"; import { P as Fe } from "./Paper-CZXfHfN_.js"; import { o as ee } from "./ownerDocument-CUrv0DIK.js"; import { o as oe } from "./ownerWindow-niciwP7I.js"; import { d as Ie } from "./debounce-46wSf_lW.js"; import { G as je } from "./Grow-CeGwnQpw.js"; import { m as Le } from "./mergeSlotProps-DVtjofCS.js"; import { b as ze, M as Ke } from "./Modal-DtjScKxh.js"; import { i as He } from "./integerPropType-BihGt2aU.js"; import { c as Ue } from "./chainPropTypes-D9lkm76m.js"; import { r as Ve } from "./refType-8hihVLUh.js"; import { e as Ae } from "./elementTypeAcceptingRef-vRb2iI4O.js"; import { H as te } from "./Portal-PkRJuFYN.js"; import { u as _e } from "./useEventCallback-Y2KwRxBw.js"; import { u as We } from "./useForkRef-u29GSuCu.js"; import { L as qe } from "./List-CmJ1jCss.js"; function Z(o, t, n) { return o === t ? o.firstChild : t && t.nextElementSibling ? t.nextElementSibling : n ? null : o.firstChild; } function le(o, t, n) { return o === t ? n ? o.firstChild : o.lastChild : t && t.previousElementSibling ? t.previousElementSibling : n ? null : o.lastChild; } function ge(o, t) { if (t === void 0) return !0; let n = o.innerText; return n === void 0 && (n = o.textContent), n = n.trim().toLowerCase(), n.length === 0 ? !1 : t.repeating ? n[0] === t.keys[0] : n.startsWith(t.keys.join("")); } function q(o, t, n, k, E, y) { let g = !1, m = E(o, t, t ? n : !1); for (; m; ) { if (m === o.firstChild) { if (g) return !1; g = !0; } const b = k ? !1 : m.disabled || m.getAttribute("aria-disabled") === "true"; if (!m.hasAttribute("tabindex") || !ge(m, y) || b) m = E(o, m, n); else return m.focus(), !0; } return !1; } const Pe = /* @__PURE__ */ u.forwardRef(function(t, n) { const { // private // eslint-disable-next-line react/prop-types actions: k, autoFocus: E = !1, autoFocusItem: y = !1, children: g, className: m, disabledItemsFocusable: b = !1, disableListWrap: R = !1, onKeyDown: x, variant: L = "selectedMenu", ...K } = t, a = u.useRef(null), P = u.useRef({ keys: [], repeating: !0, previousKeyMatched: !0, lastTime: null }); _e(() => { E && a.current.focus(); }, [E]), u.useImperativeHandle(k, () => ({ adjustStyleForScrollbar: (r, { direction: l }) => { const p = !a.current.style.width; if (r.clientHeight < a.current.clientHeight && p) { const O = `${ze(oe(r))}px`; a.current.style[l === "rtl" ? "paddingLeft" : "paddingRight"] = O, a.current.style.width = `calc(100% + ${O})`; } return a.current; } }), []); const H = (r) => { const l = a.current, p = r.key; if (r.ctrlKey || r.metaKey || r.altKey) { x && x(r); return; } const D = ee(l).activeElement; if (p === "ArrowDown") r.preventDefault(), q(l, D, R, b, Z); else if (p === "ArrowUp") r.preventDefault(), q(l, D, R, b, le); else if (p === "Home") r.preventDefault(), q(l, null, R, b, Z); else if (p === "End") r.preventDefault(), q(l, null, R, b, le); else if (p.length === 1) { const c = P.current, C = p.toLowerCase(), z = performance.now(); c.keys.length > 0 && (z - c.lastTime > 500 ? (c.keys = [], c.repeating = !0, c.previousKeyMatched = !0) : c.repeating && C !== c.keys[0] && (c.repeating = !1)), c.lastTime = z, c.keys.push(C); const N = D && !c.repeating && ge(D, c); c.previousKeyMatched && (N || q(l, D, !1, b, Z, c)) ? r.preventDefault() : c.previousKeyMatched = !1; } x && x(r); }, F = We(a, n); let i = -1; u.Children.forEach(g, (r, l) => { if (!/* @__PURE__ */ u.isValidElement(r)) { i === l && (i += 1, i >= g.length && (i = -1)); return; } process.env.NODE_ENV !== "production" && fe.isFragment(r) && console.error(["MUI: The Menu component doesn't accept a Fragment as a child.", "Consider providing an array instead."].join(` `)), r.props.disabled || (L === "selectedMenu" && r.props.selected || i === -1) && (i = l), i === l && (r.props.disabled || r.props.muiSkipListHighlight || r.type.muiSkipListHighlight) && (i += 1, i >= g.length && (i = -1)); }); const v = u.Children.map(g, (r, l) => { if (l === i) { const p = {}; return y && (p.autoFocus = !0), r.props.tabIndex === void 0 && L === "selectedMenu" && (p.tabIndex = 0), /* @__PURE__ */ u.cloneElement(r, p); } return r; }); return /* @__PURE__ */ A(qe, { role: "menu", ref: F, className: m, onKeyDown: H, tabIndex: E ? 0 : -1, ...K, children: v }); }); process.env.NODE_ENV !== "production" && (Pe.propTypes = { // ┌────────────────────────────── Warning ──────────────────────────────┐ // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ /** * If `true`, will focus the `[role="menu"]` container and move into tab order. * @default false */ autoFocus: e.bool, /** * If `true`, will focus the first menuitem if `variant="menu"` or selected item * if `variant="selectedMenu"`. * @default false */ autoFocusItem: e.bool, /** * MenuList contents, normally `MenuItem`s. */ children: e.node, /** * @ignore */ className: e.string, /** * If `true`, will allow focus on disabled items. * @default false */ disabledItemsFocusable: e.bool, /** * If `true`, the menu items will not wrap focus. * @default false */ disableListWrap: e.bool, /** * @ignore */ onKeyDown: e.func, /** * The variant to use. Use `menu` to prevent selected items from impacting the initial focus * and the vertical alignment relative to the anchor element. * @default 'selectedMenu' */ variant: e.oneOf(["menu", "selectedMenu"]) }); function $e(o) { return de("MuiPopover", o); } me("MuiPopover", ["root", "paper"]); function pe(o, t) { let n = 0; return typeof t == "number" ? n = t : t === "center" ? n = o.height / 2 : t === "bottom" && (n = o.height), n; } function ce(o, t) { let n = 0; return typeof t == "number" ? n = t : t === "center" ? n = o.width / 2 : t === "right" && (n = o.width), n; } function ue(o) { return [o.horizontal, o.vertical].map((t) => typeof t == "number" ? `${t}px` : t).join(" "); } function $(o) { return typeof o == "function" ? o() : o; } const Be = (o) => { const { classes: t } = o; return ye({ root: ["root"], paper: ["paper"] }, $e, t); }, Ge = G(Ke, { name: "MuiPopover", slot: "Root" })({}), Te = G(Fe, { name: "MuiPopover", slot: "Paper" })({ position: "absolute", overflowY: "auto", overflowX: "hidden", // So we see the popover when it's empty. // It's most likely on issue on userland. minWidth: 16, minHeight: 16, maxWidth: "calc(100% - 32px)", maxHeight: "calc(100% - 32px)", // We disable the focus ring for mouse, touch and keyboard users. outline: 0 }), ve = /* @__PURE__ */ u.forwardRef(function(t, n) { const k = be({ props: t, name: "MuiPopover" }), { action: E, anchorEl: y, anchorOrigin: g = { vertical: "top", horizontal: "left" }, anchorPosition: m, anchorReference: b = "anchorEl", children: R, className: x, container: L, elevation: K = 8, marginThreshold: a = 16, open: P, PaperProps: H = {}, // TODO: remove in v7 slots: F = {}, slotProps: i = {}, transformOrigin: v = { vertical: "top", horizontal: "left" }, TransitionComponent: r, // TODO: remove in v7 transitionDuration: l = "auto", TransitionProps: p = {}, // TODO: remove in v7 disableScrollLock: O = !1, ...D } = k, c = u.useRef(), C = { ...k, anchorOrigin: g, anchorReference: b, elevation: K, marginThreshold: a, transformOrigin: v, TransitionComponent: r, transitionDuration: l, TransitionProps: p }, z = Be(C), N = u.useCallback(() => { if (b === "anchorPosition") return process.env.NODE_ENV !== "production" && (m || console.error('MUI: You need to provide a `anchorPosition` prop when using <Popover anchorReference="anchorPosition" />.')), m; const s = $(y), d = s && s.nodeType === 1 ? s : ee(c.current).body, h = d.getBoundingClientRect(); if (process.env.NODE_ENV !== "production") { const S = d.getBoundingClientRect(); process.env.NODE_ENV !== "test" && S.top === 0 && S.left === 0 && S.right === 0 && S.bottom === 0 && console.warn(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join(` `)); } return { top: h.top + pe(h, g.vertical), left: h.left + ce(h, g.horizontal) }; }, [y, g.horizontal, g.vertical, m, b]), I = u.useCallback((s) => ({ vertical: pe(s, v.vertical), horizontal: ce(s, v.horizontal) }), [v.horizontal, v.vertical]), Y = u.useCallback((s) => { const d = { width: s.offsetWidth, height: s.offsetHeight }, h = I(d); if (b === "none") return { top: null, left: null, transformOrigin: ue(h) }; const S = N(); let U = S.top - h.vertical, V = S.left - h.horizontal; const re = U + d.height, se = V + d.width, ie = oe($(y)), W = ie.innerHeight - a, ae = ie.innerWidth - a; if (a !== null && U < a) { const w = U - a; U -= w, h.vertical += w; } else if (a !== null && re > W) { const w = re - W; U -= w, h.vertical += w; } if (process.env.NODE_ENV !== "production" && d.height > W && d.height && W && console.error(["MUI: The popover component is too tall.", `Some part of it can not be seen on the screen (${d.height - W}px).`, "Please consider adding a `max-height` to improve the user-experience."].join(` `)), a !== null && V < a) { const w = V - a; V -= w, h.horizontal += w; } else if (se > ae) { const w = se - ae; V -= w, h.horizontal += w; } return { top: `${Math.round(U)}px`, left: `${Math.round(V)}px`, transformOrigin: ue(h) }; }, [y, b, N, I, a]), [J, X] = u.useState(P), M = u.useCallback(() => { const s = c.current; if (!s) return; const d = Y(s); d.top !== null && s.style.setProperty("top", d.top), d.left !== null && (s.style.left = d.left), s.style.transformOrigin = d.transformOrigin, X(!0); }, [Y]); u.useEffect(() => (O && window.addEventListener("scroll", M), () => window.removeEventListener("scroll", M)), [y, O, M]); const Q = () => { M(); }, j = () => { X(!1); }; u.useEffect(() => { P && M(); }), u.useImperativeHandle(E, () => P ? { updatePosition: () => { M(); } } : null, [P, M]), u.useEffect(() => { if (!P) return; const s = Ie(() => { M(); }), d = oe($(y)); return d.addEventListener("resize", s), () => { s.clear(), d.removeEventListener("resize", s); }; }, [y, P, M]); let f = l; const T = { slots: { transition: r, ...F }, slotProps: { transition: p, paper: H, ...i } }, [_, Ee] = B("transition", { elementType: je, externalForwardedProps: T, ownerState: C, getSlotProps: (s) => ({ ...s, onEntering: (d, h) => { var S; (S = s.onEntering) == null || S.call(s, d, h), Q(); }, onExited: (d) => { var h; (h = s.onExited) == null || h.call(s, d), j(); } }), additionalProps: { appear: !0, in: P } }); l === "auto" && !_.muiSupportAuto && (f = void 0); const Oe = L || (y ? ee($(y)).body : void 0), [ne, { slots: Me, slotProps: we, ...Re }] = B("root", { ref: n, elementType: Ge, externalForwardedProps: { ...T, ...D }, shouldForwardComponentProp: !0, additionalProps: { slots: { backdrop: F.backdrop }, slotProps: { backdrop: Le(typeof i.backdrop == "function" ? i.backdrop(C) : i.backdrop, { invisible: !0 }) }, container: Oe, open: P }, ownerState: C, className: he(z.root, x) }), [Ce, Se] = B("paper", { ref: c, className: z.paper, elementType: Te, externalForwardedProps: T, shouldForwardComponentProp: !0, additionalProps: { elevation: K, style: J ? void 0 : { opacity: 0 } }, ownerState: C }); return /* @__PURE__ */ A(ne, { ...Re, ...!Ne(ne) && { slots: Me, slotProps: we, disableScrollLock: O }, children: /* @__PURE__ */ A(_, { ...Ee, timeout: f, children: /* @__PURE__ */ A(Ce, { ...Se, children: R }) }) }); }); process.env.NODE_ENV !== "production" && (ve.propTypes = { // ┌────────────────────────────── Warning ──────────────────────────────┐ // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ /** * A ref for imperative actions. * It currently only supports updatePosition() action. */ action: Ve, /** * An HTML element, [PopoverVirtualElement](https://mui.com/material-ui/react-popover/#virtual-element), * or a function that returns either. * It's used to set the position of the popover. */ anchorEl: Ue(e.oneOfType([te, e.func]), (o) => { if (o.open && (!o.anchorReference || o.anchorReference === "anchorEl")) { const t = $(o.anchorEl); if (t && t.nodeType === 1) { const n = t.getBoundingClientRect(); if (process.env.NODE_ENV !== "test" && n.top === 0 && n.left === 0 && n.right === 0 && n.bottom === 0) return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join(` `)); } else return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", `It should be an Element or PopoverVirtualElement instance but it's \`${t}\` instead.`].join(` `)); } return null; }), /** * This is the point on the anchor where the popover's * `anchorEl` will attach to. This is not used when the * anchorReference is 'anchorPosition'. * * Options: * vertical: [top, center, bottom]; * horizontal: [left, center, right]. * @default { * vertical: 'top', * horizontal: 'left', * } */ anchorOrigin: e.shape({ horizontal: e.oneOfType([e.oneOf(["center", "left", "right"]), e.number]).isRequired, vertical: e.oneOfType([e.oneOf(["bottom", "center", "top"]), e.number]).isRequired }), /** * This is the position that may be used to set the position of the popover. * The coordinates are relative to the application's client area. */ anchorPosition: e.shape({ left: e.number.isRequired, top: e.number.isRequired }), /** * This determines which anchor prop to refer to when setting * the position of the popover. * @default 'anchorEl' */ anchorReference: e.oneOf(["anchorEl", "anchorPosition", "none"]), /** * A backdrop component. This prop enables custom backdrop rendering. * @deprecated Use `slots.backdrop` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details. * @default styled(Backdrop, { * name: 'MuiModal', * slot: 'Backdrop', * overridesResolver: (props, styles) => { * return styles.backdrop; * }, * })({ * zIndex: -1, * }) */ BackdropComponent: e.elementType, /** * Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element. * @deprecated Use `slotProps.backdrop` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details. */ BackdropProps: e.object, /** * The content of the component. */ children: e.node, /** * Override or extend the styles applied to the component. */ classes: e.object, /** * @ignore */ className: e.string, /** * An HTML element, component instance, or function that returns either. * The `container` will passed to the Modal component. * * By default, it uses the body of the anchorEl's top-level document object, * so it's simply `document.body` most of the time. */ container: e.oneOfType([te, e.func]), /** * Disable the scroll lock behavior. * @default false */ disableScrollLock: e.bool, /** * The elevation of the popover. * @default 8 */ elevation: He, /** * Specifies how close to the edge of the window the popover can appear. * If null, the popover will not be constrained by the window. * @default 16 */ marginThreshold: e.number, /** * Callback fired when the component requests to be closed. * The `reason` parameter can optionally be used to control the response to `onClose`. */ onClose: e.func, /** * If `true`, the component is shown. */ open: e.bool.isRequired, /** * Props applied to the [`Paper`](https://mui.com/material-ui/api/paper/) element. * * This prop is an alias for `slotProps.paper` and will be overriden by it if both are used. * @deprecated Use `slotProps.paper` instead. * * @default {} */ PaperProps: e.shape({ component: Ae }), /** * The props used for each slot inside. * @default {} */ slotProps: e.shape({ backdrop: e.oneOfType([e.func, e.object]), paper: e.oneOfType([e.func, e.object]), root: e.oneOfType([e.func, e.object]), transition: e.oneOfType([e.func, e.object]) }), /** * The components used for each slot inside. * @default {} */ slots: e.shape({ backdrop: e.elementType, paper: e.elementType, root: e.elementType, transition: e.elementType }), /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]), /** * This is the point on the popover which * will attach to the anchor's origin. * * Options: * vertical: [top, center, bottom, x(px)]; * horizontal: [left, center, right, x(px)]. * @default { * vertical: 'top', * horizontal: 'left', * } */ transformOrigin: e.shape({ horizontal: e.oneOfType([e.oneOf(["center", "left", "right"]), e.number]).isRequired, vertical: e.oneOfType([e.oneOf(["bottom", "center", "top"]), e.number]).isRequired }), /** * The component used for the transition. * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component. * @deprecated use the `slots.transition` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details. * @default Grow */ TransitionComponent: e.elementType, /** * Set to 'auto' to automatically calculate transition time based on height. * @default 'auto' */ transitionDuration: e.oneOfType([e.oneOf(["auto"]), e.number, e.shape({ appear: e.number, enter: e.number, exit: e.number })]), /** * Props applied to the transition element. * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component. * @deprecated use the `slotProps.transition` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details. * @default {} */ TransitionProps: e.object }); function Ye(o) { return de("MuiMenu", o); } const Co = me("MuiMenu", ["root", "paper", "list"]), Xe = { vertical: "top", horizontal: "right" }, Je = { vertical: "top", horizontal: "left" }, Qe = (o) => { const { classes: t } = o; return ye({ root: ["root"], paper: ["paper"], list: ["list"] }, Ye, t); }, Ze = G(ve, { shouldForwardProp: (o) => xe(o) || o === "classes", name: "MuiMenu", slot: "Root" })({}), eo = G(Te, { name: "MuiMenu", slot: "Paper" })({ // specZ: The maximum height of a simple menu should be one or more rows less than the view // height. This ensures a tappable area outside of the simple menu with which to dismiss // the menu. maxHeight: "calc(100% - 96px)", // Add iOS momentum scrolling for iOS < 13.0 WebkitOverflowScrolling: "touch" }), oo = G(Pe, { name: "MuiMenu", slot: "List" })({ // We disable the focus ring for mouse, touch and keyboard users. outline: 0 }), to = /* @__PURE__ */ u.forwardRef(function(t, n) { const k = be({ props: t, name: "MuiMenu" }), { autoFocus: E = !0, children: y, className: g, disableAutoFocusItem: m = !1, MenuListProps: b = {}, onClose: R, open: x, PaperProps: L = {}, PopoverClasses: K, transitionDuration: a = "auto", TransitionProps: { onEntering: P, ...H } = {}, variant: F = "selectedMenu", slots: i = {}, slotProps: v = {}, ...r } = k, l = ke(), p = { ...k, autoFocus: E, disableAutoFocusItem: m, MenuListProps: b, onEntering: P, PaperProps: L, transitionDuration: a, TransitionProps: H, variant: F }, O = Qe(p), D = E && !m && x, c = u.useRef(null), C = (f, T) => { c.current && c.current.adjustStyleForScrollbar(f, { direction: l ? "rtl" : "ltr" }), P && P(f, T); }, z = (f) => { f.key === "Tab" && (f.preventDefault(), R && R(f, "tabKeyDown")); }; let N = -1; u.Children.map(y, (f, T) => { /* @__PURE__ */ u.isValidElement(f) && (process.env.NODE_ENV !== "production" && fe.isFragment(f) && console.error(["MUI: The Menu component doesn't accept a Fragment as a child.", "Consider providing an array instead."].join(` `)), f.props.disabled || (F === "selectedMenu" && f.props.selected || N === -1) && (N = T)); }); const I = { slots: i, slotProps: { list: b, transition: H, paper: L, ...v } }, Y = De({ elementType: i.root, externalSlotProps: v.root, ownerState: p, className: [O.root, g] }), [J, X] = B("paper", { className: O.paper, elementType: eo, externalForwardedProps: I, shouldForwardComponentProp: !0, ownerState: p }), [M, Q] = B("list", { className: he(O.list, b.className), elementType: oo, shouldForwardComponentProp: !0, externalForwardedProps: I, getSlotProps: (f) => ({ ...f, onKeyDown: (T) => { var _; z(T), (_ = f.onKeyDown) == null || _.call(f, T); } }), ownerState: p }), j = typeof I.slotProps.transition == "function" ? I.slotProps.transition(p) : I.slotProps.transition; return /* @__PURE__ */ A(Ze, { onClose: R, anchorOrigin: { vertical: "bottom", horizontal: l ? "right" : "left" }, transformOrigin: l ? Xe : Je, slots: { root: i.root, paper: J, backdrop: i.backdrop, ...i.transition && { // TODO: pass `slots.transition` directly once `TransitionComponent` is removed from Popover transition: i.transition } }, slotProps: { root: Y, paper: X, backdrop: typeof v.backdrop == "function" ? v.backdrop(p) : v.backdrop, transition: { ...j, onEntering: (...f) => { var T; C(...f), (T = j == null ? void 0 : j.onEntering) == null || T.call(j, ...f); } } }, open: x, ref: n, transitionDuration: a, ownerState: p, ...r, classes: K, children: /* @__PURE__ */ A(M, { actions: c, autoFocus: E && (N === -1 || m), autoFocusItem: D, variant: F, ...Q, children: y }) }); }); process.env.NODE_ENV !== "production" && (to.propTypes = { // ┌────────────────────────────── Warning ──────────────────────────────┐ // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ /** * An HTML element, or a function that returns one. * It's used to set the position of the menu. */ anchorEl: e.oneOfType([te, e.func]), /** * If `true` (Default) will focus the `[role="menu"]` if no focusable child is found. Disabled * children are not focusable. If you set this prop to `false` focus will be placed * on the parent modal container. This has severe accessibility implications * and should only be considered if you manage focus otherwise. * @default true */ autoFocus: e.bool, /** * Menu contents, normally `MenuItem`s. */ children: e.node, /** * Override or extend the styles applied to the component. */ classes: e.object, /** * @ignore */ className: e.string, /** * When opening the menu will not focus the active item but the `[role="menu"]` * unless `autoFocus` is also set to `false`. Not using the default means not * following WAI-ARIA authoring practices. Please be considerate about possible * accessibility implications. * @default false */ disableAutoFocusItem: e.bool, /** * Props applied to the [`MenuList`](https://mui.com/material-ui/api/menu-list/) element. * @deprecated use the `slotProps.list` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details. * @default {} */ MenuListProps: e.object, /** * Callback fired when the component requests to be closed. * * @param {object} event The event source of the callback. * @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`, `"tabKeyDown"`. */ onClose: e.func, /** * If `true`, the component is shown. */ open: e.bool.isRequired, /** * @ignore */ PaperProps: e.object, /** * `classes` prop applied to the [`Popover`](https://mui.com/material-ui/api/popover/) element. */ PopoverClasses: e.object, /** * The props used for each slot inside. * @default {} */ slotProps: e.shape({ backdrop: e.oneOfType([e.func, e.object]), list: e.oneOfType([e.func, e.object]), paper: e.oneOfType([e.func, e.object]), root: e.oneOfType([e.func, e.object]), transition: e.oneOfType([e.func, e.object]) }), /** * The components used for each slot inside. * @default {} */ slots: e.shape({ backdrop: e.elementType, list: e.elementType, paper: e.elementType, root: e.elementType, transition: e.elementType }), /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]), /** * The length of the transition in `ms`, or 'auto' * @default 'auto' */ transitionDuration: e.oneOfType([e.oneOf(["auto"]), e.number, e.shape({ appear: e.number, enter: e.number, exit: e.number })]), /** * Props applied to the transition element. * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component. * @deprecated use the `slotProps.transition` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details. * @default {} */ TransitionProps: e.object, /** * The variant to use. Use `menu` to prevent selected items from impacting the initial focus. * @default 'selectedMenu' */ variant: e.oneOf(["menu", "selectedMenu"]) }); export { to as M, Ye as g, Co as m };