@solostylist/ui-kit 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{gradients-mQAYCK0_.js → gradients-DSnBONEQ.js} +1 -1
- package/dist/main.js +1 -1
- package/dist/palettes/index.js +1 -1
- package/dist/{palettes-B1FcGUYs.js → palettes-CJLuEy1m.js} +163 -163
- package/dist/s-accordion/index.js +1 -1
- package/dist/s-accordion/s-accordion.js +70 -2
- package/dist/s-action-overlay/s-action-overlay.js +21 -21
- package/dist/s-animated-gradient-text/s-animated-gradient-text.js +18 -19
- package/dist/s-announcement-bar/s-announcement-bar.js +50 -53
- package/dist/s-autocomplete/s-autocomplete.js +1 -1
- package/dist/s-avatar/s-avatar.js +17 -17
- package/dist/s-blur-text/s-blur-text.js +16 -16
- package/dist/s-brand-logo/index.js +1 -1
- package/dist/s-brand-logo/s-brand-logo.js +1 -1
- package/dist/s-breadcrumbs/s-breadcrumbs.js +19 -19
- package/dist/s-carousel/index.js +1 -1
- package/dist/s-carousel/s-carousel.js +186 -2
- package/dist/s-category-card/s-category-card.js +22 -22
- package/dist/s-chat-input/index.js +1 -1
- package/dist/s-chat-input/s-chat-input.js +398 -2
- package/dist/s-chat-message/index.js +1 -1
- package/dist/s-chat-message/s-chat-message.js +314 -2
- package/dist/s-checkbox/s-checkbox.js +18 -19
- package/dist/s-chips/index.js +1 -1
- package/dist/s-chips/s-chips.js +174 -2
- package/dist/s-code-block/index.js +1 -1
- package/dist/s-code-block/s-code-block.js +103 -2
- package/dist/s-comment-message/index.js +1 -1
- package/dist/s-comment-message/s-comment-message.js +189 -2
- package/dist/s-copyable-text/s-copyable-text.js +18 -18
- package/dist/s-countdown/s-count-box.js +18 -18
- package/dist/s-data-table/index.js +1 -1
- package/dist/s-data-table/s-data-table.js +213 -2
- package/dist/s-date-picker/index.js +1 -1
- package/dist/s-date-picker/s-date-picker.js +106 -2
- package/dist/s-datetime-picker/index.js +1 -1
- package/dist/s-datetime-picker/s-datetime-picker.js +108 -2
- package/dist/s-dialog/index.js +1 -1
- package/dist/s-dialog/s-dialog.js +80 -2
- package/dist/s-dialog-confirm/s-dialog-confirm.js +32 -33
- package/dist/s-dialog-message/s-dialog-message.js +31 -32
- package/dist/s-drawer/index.js +1 -1
- package/dist/s-drawer/s-drawer.js +139 -2
- package/dist/s-empty/s-empty.js +13 -14
- package/dist/s-file-dropzone/index.js +1 -1
- package/dist/s-file-dropzone/s-file-dropzone.js +219 -2
- package/dist/s-file-icon/s-file-icon.js +87 -88
- package/dist/s-flex-box/s-flex-box.js +11 -12
- package/dist/s-form/s-form.js +15 -15
- package/dist/s-gallery/s-gallery.js +1 -1
- package/dist/s-glow-button/s-glow-button.js +9 -10
- package/dist/s-gradient-blob-pulse/s-gradient-blob-pulse.js +23 -24
- package/dist/s-icon-button/s-icon-button.js +13 -14
- package/dist/s-image-comparison/s-image-comparison.js +29 -31
- package/dist/s-image-viewer/image-viewer-thumbnail-dock.js +1 -1
- package/dist/s-image-viewer/index.js +3 -3
- package/dist/s-image-viewer/s-image-viewer.js +266 -2
- package/dist/s-image-viewer/use-image-viewer-navigation.js +7 -7
- package/dist/s-interactive-card/s-interactive-card.js +39 -41
- package/dist/s-label/s-label.js +25 -26
- package/dist/s-language-switcher/index.js +2 -2
- package/dist/s-language-switcher/s-language-switcher.js +145 -2
- package/dist/s-lazy-image/s-lazy-image.js +17 -18
- package/dist/s-link/index.js +1 -1
- package/dist/s-link/s-link.js +5 -2
- package/dist/s-list-action-item/s-list-action-item.js +38 -39
- package/dist/s-localization-provider/index.js +1 -1
- package/dist/s-localization-provider/s-localization-provider.js +12 -2
- package/dist/s-mega-menu/mega-menu-panel.js +132 -134
- package/dist/s-mega-menu/mega-menu-trigger.js +49 -2
- package/dist/s-mega-menu/s-mega-menu.js +80 -83
- package/dist/s-mobile-dock/index.js +1 -1
- package/dist/s-mobile-dock/s-mobile-dock.js +145 -2
- package/dist/s-nav-item/s-nav-item.js +19 -20
- package/dist/s-nav-items/s-nav-items.js +51 -52
- package/dist/s-no-ssr/index.js +1 -1
- package/dist/s-no-ssr/s-no-ssr.js +5 -2
- package/dist/s-number-range/index.js +1 -1
- package/dist/s-number-range/s-number-range.js +250 -2
- package/dist/s-pagination/index.js +1 -1
- package/dist/s-pagination/s-pagination.js +85 -2
- package/dist/s-pixel-reveal/s-pixel-reveal.js +20 -20
- package/dist/s-popover/s-popover-content.js +11 -12
- package/dist/s-popover/s-popover.js +22 -24
- package/dist/s-product-card/s-product-card.js +177 -180
- package/dist/s-product-gallery/index.js +1 -1
- package/dist/s-product-gallery/s-product-gallery.js +427 -2
- package/dist/s-quantity-input/s-quantity-input.js +24 -24
- package/dist/s-review/index.js +1 -1
- package/dist/s-review/s-review.js +272 -2
- package/dist/s-scroll-reveal/s-scroll-reveal.js +7 -8
- package/dist/s-scroll-to-top/s-scroll-to-top.js +27 -28
- package/dist/s-scroll-velocity/scroll-velocity-row.js +29 -29
- package/dist/s-segmented-control/s-segmented-control.js +64 -68
- package/dist/s-select/index.js +1 -1
- package/dist/s-select/s-select.js +201 -2
- package/dist/s-select-list/s-select-list.js +47 -50
- package/dist/s-skeleton/s-skeleton.js +12 -13
- package/dist/s-snackbar-message/index.js +2 -2
- package/dist/s-snackbar-message/s-snackbar-message.js +89 -2
- package/dist/s-spotlight-cursor/s-spotlight-cursor.js +27 -27
- package/dist/s-status-illustration/s-status-illustration.js +74 -74
- package/dist/s-stepper/index.js +1 -1
- package/dist/s-stepper/s-stepper.js +102 -2
- package/dist/s-stripe/s-stripe.js +11 -12
- package/dist/s-stripe/stripe-input.js +3 -2
- package/dist/s-swatch/s-swatch.js +34 -35
- package/dist/s-switch/index.js +1 -1
- package/dist/s-switch/s-switch.js +48 -2
- package/dist/s-tabs/s-tabs.js +48 -50
- package/dist/s-text-editor/index.js +1 -1
- package/dist/s-text-editor/s-text-editor-toolbar.js +213 -2
- package/dist/s-text-editor/s-text-editor.js +25 -26
- package/dist/s-text-field/index.js +1 -1
- package/dist/s-text-field/s-text-field.js +52 -2
- package/dist/s-text-shimmer/s-text-shimmer.js +1 -3
- package/dist/s-text-truncation/s-text-truncation.js +20 -20
- package/dist/s-theme-demo/s-theme-demo.js +8 -8
- package/dist/s-theme-demo/theme-demo-color-palette-section.js +1 -1
- package/dist/s-theme-demo/theme-demo-color-ramps-section.js +1 -1
- package/dist/s-theme-demo/theme-demo-components-section.js +265 -2
- package/dist/s-theme-demo/theme-demo-typography-section.js +10 -10
- package/dist/s-theme-provider/s-theme-provider.js +1 -1
- package/dist/s-theme-switch/index.js +1 -1
- package/dist/s-theme-switch/s-theme-switch.js +60 -2
- package/dist/s-tip/index.js +1 -1
- package/dist/s-tip/s-tip.js +61 -2
- package/dist/s-tool-bar/s-tool-bar.js +28 -28
- package/dist/s-tool-bar/tool-bar-action-buttons.js +55 -2
- package/dist/s-tool-bar/tool-bar-image-input.js +148 -2
- package/dist/s-tool-bar/tool-bar-inputs.js +55 -55
- package/dist/s-tool-item/s-tool-item.js +22 -22
- package/dist/s-two-pane-layout/s-two-pane-layout.js +32 -32
- package/dist/s-zoom-image/s-zoom-image.js +18 -19
- package/dist/theme/components/autocomplete.js +43 -2
- package/dist/theme/components/avatar.js +9 -2
- package/dist/theme/components/card.js +3 -3
- package/dist/theme/components/checkbox.js +90 -2
- package/dist/theme/components/chip.js +3 -3
- package/dist/theme/components/components.js +20 -20
- package/dist/theme/components/date-calendar.js +1 -0
- package/dist/theme/components/day-calendar.js +1 -0
- package/dist/theme/components/drawer.js +1 -1
- package/dist/theme/components/field-label-styles.js +19 -2
- package/dist/theme/components/form-label.js +1 -1
- package/dist/theme/components/list-item-button.js +1 -1
- package/dist/theme/components/list-item.js +7 -7
- package/dist/theme/components/month-calendar.js +14 -13
- package/dist/theme/components/multi-section-digital-clock-section.js +1 -0
- package/dist/theme/components/outlined-input.js +6 -6
- package/dist/theme/components/picker-day.js +1 -0
- package/dist/theme/components/pickers-arrow-switcher.js +1 -0
- package/dist/theme/components/pickers-calendar-header.js +3 -2
- package/dist/theme/components/select.js +6 -6
- package/dist/theme/components/switch.js +1 -1
- package/dist/theme/components/table-pagination.js +1 -1
- package/dist/theme/components/toggle-button.js +93 -2
- package/dist/theme/components/year-calendar.js +14 -13
- package/dist/theme/theme-primitives.js +2 -2
- package/dist/{theme-primitives-CXtaMdVj.js → theme-primitives-CRfnMsNy.js} +108 -109
- package/dist/utils/dayjs.js +9 -146
- package/package.json +8 -3
- package/dist/Add-CEnTWsXs.js +0 -6
- package/dist/ArrowUpward-udL1ltj2.js +0 -6
- package/dist/Box-9oeZgA1U.js +0 -46
- package/dist/Button-DaLr1m20.js +0 -534
- package/dist/ButtonBase-DovDC6-1.js +0 -700
- package/dist/Checkbox-C-Xjbzzh.js +0 -152
- package/dist/ChevronRight-DsPfsFKB.js +0 -6
- package/dist/Close-CIYOM-Sc.js +0 -6
- package/dist/Collapse-DPUr1cbP.js +0 -266
- package/dist/ContentCopy-Hlh3azVb.js +0 -6
- package/dist/DefaultPropsProvider-ebWx4_5E.js +0 -128
- package/dist/DialogContent-b3xbJVC6.js +0 -450
- package/dist/Download-D9PkFi7a.js +0 -6
- package/dist/ExpandMore-sOgvEha9.js +0 -6
- package/dist/Favorite-BP343hjM.js +0 -6
- package/dist/FavoriteBorder-D15j9xEL.js +0 -6
- package/dist/FormControl-DwMfZCiz.js +0 -215
- package/dist/FormControlLabel-Ihga1FTB.js +0 -173
- package/dist/Grow-BQR7x52V.js +0 -121
- package/dist/IconButton-CE-4GamO.js +0 -448
- package/dist/InfoOutlined-lpvhO6P8.js +0 -6
- package/dist/List-RNcZhRdr.js +0 -105
- package/dist/Menu-CnyB4SDS.js +0 -180
- package/dist/MenuItem-Ck30dBOR.js +0 -224
- package/dist/MenuList-Cc98uWXq.js +0 -160
- package/dist/Modal-CD2EBfU8.js +0 -702
- package/dist/Paper-_3qggtBp.js +0 -115
- package/dist/Popover-BFdKSYI5.js +0 -340
- package/dist/Popper-DYNAMSDd.js +0 -1351
- package/dist/Portal-i_wgIe9-.js +0 -49
- package/dist/Remove-DDEn8ek8.js +0 -6
- package/dist/RtlProvider-B7uVJXUY.js +0 -19
- package/dist/Skeleton-iZFynl7z.js +0 -220
- package/dist/Stack-C0LGzM4c.js +0 -158
- package/dist/SwitchBase-CjWtDdmE.js +0 -198
- package/dist/Tooltip-B1sn94L0.js +0 -448
- package/dist/Typography-_P0svrkO.js +0 -168
- package/dist/UnfoldMoreRounded-CuCrdxoy.js +0 -6
- package/dist/appendOwnerState-CFQTq3pb.js +0 -17
- package/dist/assets/stripe-input.css +0 -1
- package/dist/autocomplete-BgARERpp.js +0 -43
- package/dist/avatar-XNOdbbRz.js +0 -10
- package/dist/buttonBaseClasses-B90LjsNK.js +0 -13
- package/dist/capitalize-C0baBJCm.js +0 -5
- package/dist/chainPropTypes-CkMRtDjQ.js +0 -8
- package/dist/checkbox-D1U_JKqs.js +0 -88
- package/dist/checkboxClasses-B1up2lUn.js +0 -18
- package/dist/chunk-C_CI6nMA.js +0 -13
- package/dist/clsx-DGZSe4Nt.js +0 -16
- package/dist/colorManipulator-DmUjcif3.js +0 -129
- package/dist/contains-DnqPQsQU.js +0 -16
- package/dist/createSimplePaletteValueFilter-DFvyXHoZ.js +0 -14
- package/dist/createSvgIcon-3y-gS0r1.js +0 -155
- package/dist/createTheme-xB2Em0Na.js +0 -1869
- package/dist/defaultTheme-BaGcIzCh.js +0 -210
- package/dist/elementAcceptingRef-pKEY6jPR.js +0 -25
- package/dist/elementTypeAcceptingRef-xl_04Y5-.js +0 -19
- package/dist/exactProp-C_IsucXf.js +0 -13
- package/dist/extends-DXMyyJCW.js +0 -12
- package/dist/field-label-styles-4praXMaE.js +0 -50
- package/dist/formLabelClasses-AuZHWfTs.js +0 -18
- package/dist/generateUtilityClass-PAIOm1jC.js +0 -34
- package/dist/generateUtilityClasses-DvX505Gy.js +0 -10
- package/dist/getActiveElement-BfBkhgy6.js +0 -8
- package/dist/iconButtonClasses-CVVRFXRo.js +0 -27
- package/dist/inputAdornmentClasses-BbB8s-Z4.js +0 -19
- package/dist/inputBaseClasses-Ce_jjdp9.js +0 -25
- package/dist/integerPropType-CCkQD1JY.js +0 -27
- package/dist/isEventHandler-QShLXBxE.js +0 -7
- package/dist/isFocusVisible-4OIE8TST.js +0 -11
- package/dist/isLayoutSupported-Btg2X3QE.js +0 -6
- package/dist/isMuiElement-CPjhi284.js +0 -10
- package/dist/mega-menu-trigger-BcOo8I5_.js +0 -53
- package/dist/memoTheme-qFyKAk7y.js +0 -15
- package/dist/mergeSlotProps-DC8r4QzS.js +0 -45
- package/dist/monthCalendarClasses-b964KRbc.js +0 -14
- package/dist/objectWithoutPropertiesLoose-q4Zwd1RV.js +0 -12
- package/dist/outlinedInputClasses-ci1zDasn.js +0 -17
- package/dist/ownerDocument-CJjQZweZ.js +0 -6
- package/dist/ownerDocument-pYjJiXem.js +0 -5
- package/dist/ownerWindow-SSeeoqPT.js +0 -18
- package/dist/pickersCalendarHeaderClasses-BAiPN_oY.js +0 -12
- package/dist/prop-types-BzYPyWN7.js +0 -516
- package/dist/refType-j5S9pc_e.js +0 -6
- package/dist/resolveProps-7jIA45vn.js +0 -30
- package/dist/s-accordion-1oLxQhod.js +0 -487
- package/dist/s-carousel-CAyAl3ka.js +0 -1355
- package/dist/s-chat-input-T3gyan60.js +0 -419
- package/dist/s-chat-message-NFTpNgt5.js +0 -315
- package/dist/s-chips-Dqq1fgz-.js +0 -176
- package/dist/s-code-block-DyDtctGG.js +0 -658
- package/dist/s-comment-message-DpCVBKiE.js +0 -192
- package/dist/s-data-table-D4V58HFR.js +0 -805
- package/dist/s-date-picker-BFIQOA8C.js +0 -657
- package/dist/s-datetime-picker-zfg7BEOW.js +0 -3886
- package/dist/s-dialog-BNlXsVVP.js +0 -123
- package/dist/s-drawer-4h5ZyoM8.js +0 -562
- package/dist/s-file-dropzone-Cfzv1Cm8.js +0 -422
- package/dist/s-image-viewer-CjK67-rs.js +0 -269
- package/dist/s-language-switcher-PaMgHWc2.js +0 -246
- package/dist/s-link-Db1aabHh.js +0 -235
- package/dist/s-localization-provider-CeyB_SGz.js +0 -519
- package/dist/s-mobile-dock-8F3UWAb8.js +0 -615
- package/dist/s-no-ssr-DH57_uP_.js +0 -25
- package/dist/s-number-range-Low5QjuD.js +0 -253
- package/dist/s-pagination-s46hBifh.js +0 -606
- package/dist/s-product-gallery-Dj9eGg5i.js +0 -430
- package/dist/s-review--Q2C0ngO.js +0 -272
- package/dist/s-select-CtVKEOZ5.js +0 -204
- package/dist/s-snackbar-message-DsfJlDYd.js +0 -810
- package/dist/s-stepper-BtODHVro.js +0 -892
- package/dist/s-switch-BCeBoxWf.js +0 -307
- package/dist/s-text-editor-toolbar-D5eQ-jCs.js +0 -2124
- package/dist/s-text-field-HYyDf1Jo.js +0 -51
- package/dist/s-theme-switch-BFWpADh3.js +0 -60
- package/dist/s-tip-jbL7vtoU.js +0 -62
- package/dist/selectClasses-CPxME5jE.js +0 -22
- package/dist/setRef-BWPyWnrr.js +0 -6
- package/dist/styled-Bog8QCl3.js +0 -163
- package/dist/svgIconClasses-1kWGzgux.js +0 -20
- package/dist/switchClasses-BtweO7PC.js +0 -23
- package/dist/theme-demo-components-section-C7l_2KAo.js +0 -267
- package/dist/toggle-button-BsGb-tOr.js +0 -104
- package/dist/tool-bar-action-buttons-v1koaasr.js +0 -54
- package/dist/tool-bar-image-input-DtXTyEe1.js +0 -148
- package/dist/typographyClasses-BH_-zLwg.js +0 -31
- package/dist/unsupportedProp-whMV_uOi.js +0 -11
- package/dist/useControlled-DqNPBJNp.js +0 -5
- package/dist/useControlled-uxVKygk1.js +0 -29
- package/dist/useEnhancedEffect-DFq_FMGX.js +0 -5
- package/dist/useEnhancedEffect-dBFfkm1e.js +0 -5
- package/dist/useEventCallback-DGCsaRIu.js +0 -5
- package/dist/useEventCallback-DhCPBxRG.js +0 -11
- package/dist/useForkRef-BuNFTXxE.js +0 -29
- package/dist/useFormControl-gXwNeUM1.js +0 -18
- package/dist/useMobilePicker-CdrT935R.js +0 -7584
- package/dist/useRovingTabIndex-DPlW997R.js +0 -242
- package/dist/useSlot-BG8ReOxN.js +0 -83
- package/dist/useSlotProps-BOO3qaI9.js +0 -16
- package/dist/useTheme-BIWMbX3i.js +0 -9
- package/dist/useThemeProps-Dw9dmKyT.js +0 -29
- package/dist/useTimeout-CoK-Khfm.js +0 -49
- package/dist/utils-Bfqbev5I.js +0 -248
- package/dist/warning-D5YhCbje.js +0 -99
- package/dist/yearCalendarClasses-D9k_KT38.js +0 -14
- /package/dist/{colors-Bik9qOU9.js → colors-CNjL5fhq.js} +0 -0
- /package/dist/{s-brand-logo-D7Jovf5K.js → s-brand-logo-CErW9Slg.js} +0 -0
- /package/dist/{utils-DOY6v6ln.js → utils-CMeAWSRO.js} +0 -0
|
@@ -1,67 +1,64 @@
|
|
|
1
1
|
import { toSxArray as e } from "../utils/sx.js";
|
|
2
2
|
import { resolveOwnerStateSlotProps as t } from "../utils/slots.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import * as l from "react";
|
|
13
|
-
import { jsx as u, jsxs as ae } from "react/jsx-runtime";
|
|
14
|
-
import { useMediaQuery as oe, useThemeProps as se } from "@mui/material";
|
|
3
|
+
import { contains as n, focusAdjacentTrigger as r, getFirstRow as i } from "./utils.js";
|
|
4
|
+
import { SMegaMenuPopover as a, SMegaMenuRoot as ee } from "./mega-menu-slots.js";
|
|
5
|
+
import { MegaMenuPanelContent as te } from "./mega-menu-panel.js";
|
|
6
|
+
import { MegaMenuTriggerButton as ne } from "./mega-menu-trigger.js";
|
|
7
|
+
import * as o from "react";
|
|
8
|
+
import { jsx as s, jsxs as re } from "react/jsx-runtime";
|
|
9
|
+
import { useMediaQuery as ie, useThemeProps as ae } from "@mui/material";
|
|
10
|
+
import { mergeSlotProps as c, useControlled as oe, useEventCallback as l, useForkRef as u } from "@mui/material/utils";
|
|
11
|
+
import d from "@mui/utils/appendOwnerState";
|
|
15
12
|
//#region lib/s-mega-menu/s-mega-menu.tsx
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
return e.href === t || !!e.children?.some((e) =>
|
|
13
|
+
var se = 0;
|
|
14
|
+
function f(e, t) {
|
|
15
|
+
return e.href === t || !!e.children?.some((e) => f(e, t));
|
|
19
16
|
}
|
|
20
|
-
function
|
|
21
|
-
let { activeHref:
|
|
22
|
-
props:
|
|
17
|
+
function p(p, m) {
|
|
18
|
+
let { activeHref: h, closeDelay: g = se, defaultOpenId: _ = null, getIsActive: v, items: y, keepMounted: b = !1, layout: x = "auto", linkComponent: S, onOpenChange: C, openDelay: w = 0, openId: ce, renderItem: le, renderTrigger: ue, slotProps: T, slots: E, sx: de, ...fe } = ae({
|
|
19
|
+
props: p,
|
|
23
20
|
name: "SMegaMenu"
|
|
24
|
-
}), [D, O] =
|
|
25
|
-
controlled:
|
|
26
|
-
default:
|
|
21
|
+
}), [D, O] = oe({
|
|
22
|
+
controlled: ce,
|
|
23
|
+
default: _,
|
|
27
24
|
name: "SMegaMenu",
|
|
28
25
|
state: "openId"
|
|
29
|
-
}), [k, A] =
|
|
26
|
+
}), [k, A] = o.useState(null), pe = ie("(prefers-reduced-motion: reduce)", { noSsr: !0 }), j = o.useId(), M = `${j}-panel`, N = o.useRef(null), P = o.useRef(/* @__PURE__ */ new Map()), F = o.useRef(void 0), I = o.useRef(void 0), L = o.useRef(!1), R = o.useRef(0), me = u(N, m), [z, he] = o.useState(_);
|
|
30
27
|
D != null && D !== z && he(D);
|
|
31
|
-
let B =
|
|
32
|
-
activeHref:
|
|
33
|
-
closeDelay:
|
|
34
|
-
items:
|
|
35
|
-
keepMounted:
|
|
36
|
-
layout:
|
|
37
|
-
openDelay:
|
|
28
|
+
let B = y.find((e) => e.id === (D ?? z)) ?? null, V = B ? y.indexOf(B) : -1, ge = V >= 0 ? `${j}-trigger-${V}` : void 0, H = !!(D == null ? null : B)?.children?.length && k != null, U = {
|
|
29
|
+
activeHref: h,
|
|
30
|
+
closeDelay: g,
|
|
31
|
+
items: y,
|
|
32
|
+
keepMounted: b,
|
|
33
|
+
layout: x,
|
|
34
|
+
openDelay: w,
|
|
38
35
|
openId: D ?? null
|
|
39
36
|
};
|
|
40
|
-
|
|
41
|
-
let W =
|
|
37
|
+
o.useEffect(() => {}, [y, x]);
|
|
38
|
+
let W = o.useCallback(() => typeof document > "u" ? null : document.getElementById(M), [M]), G = o.useCallback(() => {
|
|
42
39
|
F.current &&= (clearTimeout(F.current), void 0), I.current &&= (clearTimeout(I.current), void 0);
|
|
43
40
|
}, []);
|
|
44
|
-
|
|
45
|
-
let K =
|
|
46
|
-
G(), !(e.disabled || D === e.id) && (L.current = i, A(t), O(e.id),
|
|
47
|
-
}), J =
|
|
48
|
-
G(), D != null && (t && P.current.get(D)?.focus(), L.current = !1, O(null),
|
|
49
|
-
}), Y =
|
|
41
|
+
o.useEffect(() => G, [G]);
|
|
42
|
+
let K = l((e) => v ? v(e) : !!(h && f(e, h))), q = l((e, t, n, r, i = !1) => {
|
|
43
|
+
G(), !(e.disabled || D === e.id) && (L.current = i, A(t), O(e.id), C?.(n, e.id, e, r));
|
|
44
|
+
}), J = l(({ event: e, focusTrigger: t = !1, reason: n }) => {
|
|
45
|
+
G(), D != null && (t && P.current.get(D)?.focus(), L.current = !1, O(null), C?.(e, null, null, n));
|
|
46
|
+
}), Y = l((e) => {
|
|
50
47
|
G(), I.current = setTimeout(() => J({
|
|
51
48
|
event: e,
|
|
52
49
|
reason: "pointerLeave"
|
|
53
|
-
}),
|
|
50
|
+
}), g);
|
|
54
51
|
});
|
|
55
|
-
|
|
52
|
+
o.useEffect(() => {
|
|
56
53
|
if (D == null) return;
|
|
57
54
|
let e = P.current.get(D);
|
|
58
55
|
e && e !== k && A(e);
|
|
59
|
-
}, [k, D]),
|
|
60
|
-
H && L.current && (L.current = !1,
|
|
61
|
-
}, [W, H]),
|
|
56
|
+
}, [k, D]), o.useEffect(() => {
|
|
57
|
+
H && L.current && (L.current = !1, i(W())?.focus());
|
|
58
|
+
}, [W, H]), o.useEffect(() => {
|
|
62
59
|
if (!H) return;
|
|
63
60
|
let e = (e) => {
|
|
64
|
-
|
|
61
|
+
n(W(), e.target) || n(N.current, e.target) || J({
|
|
65
62
|
event: e,
|
|
66
63
|
reason: "outsidePress"
|
|
67
64
|
});
|
|
@@ -72,25 +69,25 @@ function f(f, p) {
|
|
|
72
69
|
W,
|
|
73
70
|
H
|
|
74
71
|
]);
|
|
75
|
-
let _e =
|
|
72
|
+
let _e = o.useCallback((e, t) => {
|
|
76
73
|
t ? P.current.set(e, t) : P.current.delete(e);
|
|
77
|
-
}, []), X =
|
|
74
|
+
}, []), X = l((e) => {
|
|
78
75
|
let t = e.relatedTarget;
|
|
79
|
-
!t ||
|
|
76
|
+
!t || n(N.current, t) || n(W(), t) || J({
|
|
80
77
|
event: e,
|
|
81
78
|
reason: "blur"
|
|
82
79
|
});
|
|
83
|
-
}), ve =
|
|
80
|
+
}), ve = l((e, t) => {
|
|
84
81
|
if (e.disabled || t.pointerType === "touch" || Date.now() < R.current || !e.children?.length) return;
|
|
85
82
|
let n = t.currentTarget, r = t.nativeEvent;
|
|
86
|
-
if (G(),
|
|
87
|
-
F.current = setTimeout(() => q(e, n, r, "triggerHover"),
|
|
83
|
+
if (G(), w > 0 && D == null) {
|
|
84
|
+
F.current = setTimeout(() => q(e, n, r, "triggerHover"), w);
|
|
88
85
|
return;
|
|
89
86
|
}
|
|
90
87
|
q(e, n, t, "triggerHover");
|
|
91
|
-
}), ye =
|
|
88
|
+
}), ye = l((e) => {
|
|
92
89
|
Date.now() >= R.current && (R.current = 0), e.pointerType !== "touch" && Y(e.nativeEvent);
|
|
93
|
-
}), be =
|
|
90
|
+
}), be = l((e, t) => {
|
|
94
91
|
let n = !!e.children?.length;
|
|
95
92
|
if (n && D !== e.id) {
|
|
96
93
|
q(e, t.currentTarget, t, "triggerClick");
|
|
@@ -107,23 +104,23 @@ function f(f, p) {
|
|
|
107
104
|
event: t,
|
|
108
105
|
reason: "itemClick"
|
|
109
106
|
});
|
|
110
|
-
}), xe =
|
|
107
|
+
}), xe = l((e, t) => {
|
|
111
108
|
D != null && D !== e.id && J({
|
|
112
109
|
event: t,
|
|
113
110
|
reason: "triggerFocus"
|
|
114
111
|
});
|
|
115
|
-
}), Se =
|
|
116
|
-
let n = t.currentTarget,
|
|
112
|
+
}), Se = l((e, t) => {
|
|
113
|
+
let n = t.currentTarget, a = !!e.children?.length;
|
|
117
114
|
switch (t.key) {
|
|
118
115
|
case "ArrowDown":
|
|
119
|
-
if (!
|
|
120
|
-
t.preventDefault(), D === e.id ?
|
|
116
|
+
if (!a) break;
|
|
117
|
+
t.preventDefault(), D === e.id ? i(W())?.focus() : q(e, n, t, "triggerKeyDown", !0);
|
|
121
118
|
break;
|
|
122
119
|
case "ArrowRight":
|
|
123
|
-
t.preventDefault(),
|
|
120
|
+
t.preventDefault(), r(N.current, n, 1);
|
|
124
121
|
break;
|
|
125
122
|
case "ArrowLeft":
|
|
126
|
-
t.preventDefault(),
|
|
123
|
+
t.preventDefault(), r(N.current, n, -1);
|
|
127
124
|
break;
|
|
128
125
|
case "Escape":
|
|
129
126
|
D != null && (t.preventDefault(), J({
|
|
@@ -133,11 +130,11 @@ function f(f, p) {
|
|
|
133
130
|
break;
|
|
134
131
|
default: break;
|
|
135
132
|
}
|
|
136
|
-
}), Ce =
|
|
133
|
+
}), Ce = l((e) => {
|
|
137
134
|
e.pointerType !== "touch" && G();
|
|
138
|
-
}), we =
|
|
135
|
+
}), we = l((e) => {
|
|
139
136
|
e.pointerType !== "touch" && Y(e.nativeEvent);
|
|
140
|
-
}), Z =
|
|
137
|
+
}), Z = l((e) => {
|
|
141
138
|
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), J({
|
|
142
139
|
event: e,
|
|
143
140
|
focusTrigger: !0,
|
|
@@ -146,16 +143,16 @@ function f(f, p) {
|
|
|
146
143
|
}), Te = {
|
|
147
144
|
closeMenu: J,
|
|
148
145
|
getIsActive: K,
|
|
149
|
-
keepMounted:
|
|
150
|
-
linkComponent:
|
|
146
|
+
keepMounted: b,
|
|
147
|
+
linkComponent: S,
|
|
151
148
|
ownerState: U,
|
|
152
|
-
renderItem:
|
|
153
|
-
slotProps:
|
|
154
|
-
slots:
|
|
155
|
-
}, Q =
|
|
156
|
-
...
|
|
149
|
+
renderItem: le,
|
|
150
|
+
slotProps: T,
|
|
151
|
+
slots: E
|
|
152
|
+
}, Q = E?.root ?? ee, $ = E?.popover ?? a, { ref: Ee, sx: De, ...Oe } = d(Q, c(t(T?.root, U), {
|
|
153
|
+
...fe,
|
|
157
154
|
onBlurCapture: X
|
|
158
|
-
}), U), ke =
|
|
155
|
+
}), U), ke = u(Ee, me), { slotProps: Ae, sx: je, ...Me } = t(T?.popover, U) ?? {}, Ne = c(Ae?.paper, {
|
|
159
156
|
"aria-labelledby": ge,
|
|
160
157
|
id: M,
|
|
161
158
|
onBlurCapture: X,
|
|
@@ -171,14 +168,14 @@ function f(f, p) {
|
|
|
171
168
|
})],
|
|
172
169
|
role: "region",
|
|
173
170
|
tabIndex: -1
|
|
174
|
-
}), Pe =
|
|
171
|
+
}), Pe = d($, c(Me, {
|
|
175
172
|
anchorEl: k,
|
|
176
173
|
disableAutoFocus: !0,
|
|
177
174
|
disableEnforceFocus: !0,
|
|
178
175
|
disableRestoreFocus: !0,
|
|
179
176
|
disableScrollLock: !0,
|
|
180
177
|
hideBackdrop: !0,
|
|
181
|
-
keepMounted:
|
|
178
|
+
keepMounted: b,
|
|
182
179
|
onClose: (e, t) => J({
|
|
183
180
|
event: e,
|
|
184
181
|
focusTrigger: t === "escapeKeyDown",
|
|
@@ -187,15 +184,15 @@ function f(f, p) {
|
|
|
187
184
|
placement: "bottom-start",
|
|
188
185
|
transitionDuration: pe ? 0 : void 0
|
|
189
186
|
}), U);
|
|
190
|
-
return /* @__PURE__ */
|
|
187
|
+
return /* @__PURE__ */ re(Q, {
|
|
191
188
|
...Oe,
|
|
192
189
|
ref: ke,
|
|
193
|
-
sx: [...e(De), ...e(
|
|
194
|
-
children: [
|
|
190
|
+
sx: [...e(De), ...e(de)],
|
|
191
|
+
children: [y.map((e, t) => /* @__PURE__ */ s(ne, {
|
|
195
192
|
active: K(e),
|
|
196
193
|
hasPanel: !!e.children?.length,
|
|
197
194
|
item: e,
|
|
198
|
-
linkComponent:
|
|
195
|
+
linkComponent: S,
|
|
199
196
|
onClick: (t) => be(e, t),
|
|
200
197
|
onFocus: (t) => xe(e, t),
|
|
201
198
|
onKeyDown: (t) => Se(e, t),
|
|
@@ -205,16 +202,16 @@ function f(f, p) {
|
|
|
205
202
|
ownerState: U,
|
|
206
203
|
panelId: M,
|
|
207
204
|
registerRef: _e,
|
|
208
|
-
renderTrigger:
|
|
209
|
-
slotProps:
|
|
210
|
-
slots:
|
|
205
|
+
renderTrigger: ue,
|
|
206
|
+
slotProps: T,
|
|
207
|
+
slots: E,
|
|
211
208
|
triggerId: `${j}-trigger-${t}`
|
|
212
|
-
}, e.id)), /* @__PURE__ */
|
|
209
|
+
}, e.id)), /* @__PURE__ */ s($, {
|
|
213
210
|
...Pe,
|
|
214
211
|
open: H,
|
|
215
212
|
slotProps: { paper: Ne },
|
|
216
213
|
sx: [...e(je)],
|
|
217
|
-
children: B?.children?.length ? /* @__PURE__ */
|
|
214
|
+
children: B?.children?.length ? /* @__PURE__ */ s(te, {
|
|
218
215
|
ctx: Te,
|
|
219
216
|
depth: 0,
|
|
220
217
|
items: B.children
|
|
@@ -222,7 +219,7 @@ function f(f, p) {
|
|
|
222
219
|
})]
|
|
223
220
|
});
|
|
224
221
|
}
|
|
225
|
-
var
|
|
226
|
-
|
|
222
|
+
var m = o.forwardRef(p);
|
|
223
|
+
m.displayName = "SMegaMenu";
|
|
227
224
|
//#endregion
|
|
228
|
-
export {
|
|
225
|
+
export { m as SMegaMenu, m as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SMobileDock as e } from "./s-mobile-dock.js";
|
|
2
2
|
export { e as SMobileDock, e as default };
|
|
@@ -1,2 +1,145 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { resolveOwnerStateSlotProps as e } from "../utils/slots.js";
|
|
2
|
+
import { actionHoverMedia as t, getFocusVisibleStyle as n, reducedMotionMedia as r } from "../theme/components/action-styles.js";
|
|
3
|
+
import { styled as i, useThemeProps as a } from "@mui/material/styles";
|
|
4
|
+
import * as o from "react";
|
|
5
|
+
import { createElement as s } from "react";
|
|
6
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
7
|
+
import { mergeSlotProps as l, useControlled as u, useEventCallback as d, useForkRef as f } from "@mui/material/utils";
|
|
8
|
+
import p from "@mui/utils/appendOwnerState";
|
|
9
|
+
import { visuallyHidden as m } from "@mui/utils";
|
|
10
|
+
import h from "@mui/material/Box";
|
|
11
|
+
import g from "@mui/material/Badge";
|
|
12
|
+
import _ from "@mui/material/BottomNavigation";
|
|
13
|
+
import v, { bottomNavigationActionClasses as y } from "@mui/material/BottomNavigationAction";
|
|
14
|
+
//#region lib/s-mobile-dock/s-mobile-dock.tsx
|
|
15
|
+
var b = 416, x = 44, S = i(_, {
|
|
16
|
+
name: "SMobileDock",
|
|
17
|
+
slot: "Root",
|
|
18
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
19
|
+
})(({ theme: e }) => ({
|
|
20
|
+
backgroundColor: (e.vars ?? e).palette.background.paper,
|
|
21
|
+
border: `1px solid ${(e.vars ?? e).palette.divider}`,
|
|
22
|
+
borderRadius: e.radius.full,
|
|
23
|
+
boxShadow: e.shadows[8],
|
|
24
|
+
gap: e.spacing(.5),
|
|
25
|
+
height: "auto",
|
|
26
|
+
justifyContent: "space-around",
|
|
27
|
+
marginInline: "auto",
|
|
28
|
+
maxWidth: `calc(100% - ${e.spacing(3)})`,
|
|
29
|
+
padding: e.spacing(.75),
|
|
30
|
+
paddingBottom: `calc(${e.spacing(.75)} + env(safe-area-inset-bottom))`,
|
|
31
|
+
width: b
|
|
32
|
+
})), C = i(v, {
|
|
33
|
+
name: "SMobileDock",
|
|
34
|
+
slot: "Action"
|
|
35
|
+
})(({ theme: e, ownerState: i }) => ({
|
|
36
|
+
borderRadius: e.radius.full,
|
|
37
|
+
color: (e.vars ?? e).palette.text.secondary,
|
|
38
|
+
gap: e.spacing(.5),
|
|
39
|
+
minHeight: x,
|
|
40
|
+
minWidth: x,
|
|
41
|
+
padding: e.spacing(.75, 1),
|
|
42
|
+
transition: e.transitions.create(["background-color", "color"], { duration: e.transitions.duration.shorter }),
|
|
43
|
+
[`& .${y.label}`]: {
|
|
44
|
+
fontSize: e.typography.body2.fontSize,
|
|
45
|
+
lineHeight: e.typography.body2.lineHeight,
|
|
46
|
+
[`&.${y.selected}`]: { fontSize: e.typography.body2.fontSize },
|
|
47
|
+
...i.labelVisibility === "never" && m
|
|
48
|
+
},
|
|
49
|
+
[`&.${y.selected}`]: {
|
|
50
|
+
backgroundColor: e.alpha((e.vars ?? e).palette.primary.main, (e.vars ?? e).palette.action.selectedOpacity),
|
|
51
|
+
color: (e.vars ?? e).palette.primary.main
|
|
52
|
+
},
|
|
53
|
+
"&.Mui-disabled": { color: (e.vars ?? e).palette.action.disabled },
|
|
54
|
+
[`&.${y.selected}.Mui-disabled`]: { backgroundColor: (e.vars ?? e).palette.action.disabledBackground },
|
|
55
|
+
"&.Mui-focusVisible": n(e),
|
|
56
|
+
[t]: {
|
|
57
|
+
"&:hover": {
|
|
58
|
+
backgroundColor: (e.vars ?? e).palette.action.hover,
|
|
59
|
+
color: (e.vars ?? e).palette.text.primary
|
|
60
|
+
},
|
|
61
|
+
[`&.${y.selected}:hover`]: {
|
|
62
|
+
backgroundColor: e.alpha((e.vars ?? e).palette.primary.main, Math.min(e.palette.action.selectedOpacity + e.palette.action.hoverOpacity, 1)),
|
|
63
|
+
color: (e.vars ?? e).palette.primary.main
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
[r]: { transition: "none" }
|
|
67
|
+
})), w = i(h, {
|
|
68
|
+
name: "SMobileDock",
|
|
69
|
+
slot: "Icon"
|
|
70
|
+
})({
|
|
71
|
+
alignItems: "center",
|
|
72
|
+
display: "flex",
|
|
73
|
+
justifyContent: "center"
|
|
74
|
+
}), T = i(g, {
|
|
75
|
+
name: "SMobileDock",
|
|
76
|
+
slot: "Badge"
|
|
77
|
+
})({}), E = i("span", {
|
|
78
|
+
name: "SMobileDock",
|
|
79
|
+
slot: "Label"
|
|
80
|
+
})({});
|
|
81
|
+
function D(t, n) {
|
|
82
|
+
let r = a({
|
|
83
|
+
props: t,
|
|
84
|
+
name: "SMobileDock"
|
|
85
|
+
}), { defaultValue: i, items: o, labelVisibility: m = "always", linkComponent: h, onChange: g, slotProps: _, slots: v, value: y, ...b } = r, [x, D] = u({
|
|
86
|
+
controlled: y,
|
|
87
|
+
default: i ?? null,
|
|
88
|
+
name: "SMobileDock",
|
|
89
|
+
state: "value"
|
|
90
|
+
}), O = {
|
|
91
|
+
...r,
|
|
92
|
+
labelVisibility: m,
|
|
93
|
+
value: x
|
|
94
|
+
}, k = v?.root ?? S, A = v?.action ?? C, j = v?.icon ?? w, M = v?.badge ?? T, N = v?.label ?? E, P = d((e, t) => {
|
|
95
|
+
D(t), g?.(e, t);
|
|
96
|
+
}), { ref: F, ...I } = p(k, l(e(_?.root, O), {
|
|
97
|
+
...b,
|
|
98
|
+
onChange: P,
|
|
99
|
+
showLabels: !0,
|
|
100
|
+
value: x
|
|
101
|
+
}), O), L = f(n, F);
|
|
102
|
+
return /* @__PURE__ */ c(k, {
|
|
103
|
+
...I,
|
|
104
|
+
ref: L,
|
|
105
|
+
component: "nav",
|
|
106
|
+
children: o.map((t) => {
|
|
107
|
+
let n = t.value === x, r = {
|
|
108
|
+
...O,
|
|
109
|
+
item: t,
|
|
110
|
+
selected: n
|
|
111
|
+
}, i = t.component ?? (t.href == null ? "button" : h ?? "a"), a = p(A, l(e(_?.action, r), {
|
|
112
|
+
"aria-current": n ? "page" : void 0,
|
|
113
|
+
"aria-label": t.ariaLabel,
|
|
114
|
+
component: i,
|
|
115
|
+
disabled: t.disabled,
|
|
116
|
+
href: t.disabled ? void 0 : t.href,
|
|
117
|
+
nativeButton: i === "button",
|
|
118
|
+
onClick: t.onClick,
|
|
119
|
+
rel: t.rel,
|
|
120
|
+
target: t.target
|
|
121
|
+
}), r), o = p(j, e(_?.icon, r) ?? {}, r), u = p(M, e(_?.badge, r) ?? {}, r), d = p(N, e(_?.label, r) ?? {}, r);
|
|
122
|
+
return /* @__PURE__ */ s(A, {
|
|
123
|
+
...a,
|
|
124
|
+
key: t.value,
|
|
125
|
+
icon: /* @__PURE__ */ c(j, {
|
|
126
|
+
...o,
|
|
127
|
+
children: t.badge == null ? t.icon : /* @__PURE__ */ c(M, {
|
|
128
|
+
badgeContent: t.badge,
|
|
129
|
+
color: "error",
|
|
130
|
+
...u,
|
|
131
|
+
children: t.icon
|
|
132
|
+
})
|
|
133
|
+
}),
|
|
134
|
+
label: t.label,
|
|
135
|
+
slotProps: { label: d },
|
|
136
|
+
slots: { label: N },
|
|
137
|
+
value: t.value
|
|
138
|
+
});
|
|
139
|
+
})
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
var O = o.forwardRef(D);
|
|
143
|
+
O.displayName = "SMobileDock";
|
|
144
|
+
//#endregion
|
|
145
|
+
export { O as SMobileDock, O as default };
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { toSxArray as e } from "../utils/sx.js";
|
|
2
2
|
import { resolveOwnerStateSlotProps as t } from "../utils/slots.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { styled as u, useThemeProps as d } from "@mui/material";
|
|
3
|
+
import { actionHoverMedia as n } from "../theme/components/action-styles.js";
|
|
4
|
+
import { SListActionItem as r } from "../s-list-action-item/s-list-action-item.js";
|
|
5
|
+
import * as i from "react";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { styled as s, useThemeProps as c } from "@mui/material";
|
|
8
|
+
import { mergeSlotProps as l, useForkRef as u } from "@mui/material/utils";
|
|
9
|
+
import d from "@mui/utils/appendOwnerState";
|
|
11
10
|
//#region lib/s-nav-item/s-nav-item.tsx
|
|
12
|
-
var f =
|
|
11
|
+
var f = s("li", {
|
|
13
12
|
name: "SNavItem",
|
|
14
13
|
slot: "Root"
|
|
15
14
|
})({
|
|
16
15
|
display: "block",
|
|
17
16
|
userSelect: "none"
|
|
18
|
-
}), p =
|
|
17
|
+
}), p = s(r, {
|
|
19
18
|
name: "SNavItem",
|
|
20
19
|
slot: "Item",
|
|
21
20
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
@@ -24,16 +23,16 @@ var f = u("li", {
|
|
|
24
23
|
color: (e.vars ?? e).palette.text.secondary,
|
|
25
24
|
padding: e.spacing(1.5),
|
|
26
25
|
"&.Mui-selected": { color: (e.vars ?? e).palette.text.primary },
|
|
27
|
-
[
|
|
28
|
-
})), m =
|
|
29
|
-
let
|
|
30
|
-
props:
|
|
26
|
+
[n]: { "&:hover": { color: (e.vars ?? e).palette.text.primary } }
|
|
27
|
+
})), m = i.forwardRef(function(n, r) {
|
|
28
|
+
let i = c({
|
|
29
|
+
props: n,
|
|
31
30
|
name: "SNavItem"
|
|
32
|
-
}), { children:
|
|
33
|
-
...
|
|
31
|
+
}), { children: s, disabled: m = !1, href: h, icon: g, label: _, onClick: v, selected: y = !1, slotProps: b, slots: x, sx: S, trailing: C, ...w } = i, T = {
|
|
32
|
+
...i,
|
|
34
33
|
disabled: m,
|
|
35
34
|
selected: y
|
|
36
|
-
}, E = x?.root ?? f, D = x?.item ?? p, { ref: O, sx: k, ...A } =
|
|
35
|
+
}, E = x?.root ?? f, D = x?.item ?? p, { ref: O, sx: k, ...A } = d(E, l(t(b?.root, T), w), T), j = u(O, r), M = d(D, l(t(b?.item, T), {
|
|
37
36
|
disabled: m,
|
|
38
37
|
href: h,
|
|
39
38
|
icon: g,
|
|
@@ -51,14 +50,14 @@ var f = u("li", {
|
|
|
51
50
|
},
|
|
52
51
|
trailing: C
|
|
53
52
|
}), T);
|
|
54
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ o(E, {
|
|
55
54
|
...A,
|
|
56
55
|
ref: j,
|
|
57
56
|
sx: [...e(k), ...e(S)],
|
|
58
|
-
children: [/* @__PURE__ */
|
|
57
|
+
children: [/* @__PURE__ */ a(D, {
|
|
59
58
|
...M,
|
|
60
59
|
label: _
|
|
61
|
-
}),
|
|
60
|
+
}), s]
|
|
62
61
|
});
|
|
63
62
|
});
|
|
64
63
|
m.displayName = "SNavItem";
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { jsx as u } from "react/jsx-runtime";
|
|
1
|
+
import { toSxArray as e } from "../utils/sx.js";
|
|
2
|
+
import { reducedMotionMedia as t } from "../theme/components/action-styles.js";
|
|
3
|
+
import { SNavItem as n } from "../s-nav-item/s-nav-item.js";
|
|
4
|
+
import { styled as r, useThemeProps as i } from "@mui/material/styles";
|
|
5
|
+
import * as a from "react";
|
|
6
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
+
import s from "@mui/icons-material/ExpandMore";
|
|
8
|
+
import c from "@mui/material/Stack";
|
|
9
|
+
import l from "@mui/material/Box";
|
|
10
|
+
import u from "@mui/material/Collapse";
|
|
12
11
|
//#region lib/s-nav-items/s-nav-items.tsx
|
|
13
|
-
var d =
|
|
14
|
-
return /* @__PURE__ */
|
|
12
|
+
var d = r(a.forwardRef(function(e, t) {
|
|
13
|
+
return /* @__PURE__ */ o(c, {
|
|
15
14
|
component: "ul",
|
|
16
15
|
...e,
|
|
17
16
|
ref: t
|
|
@@ -33,89 +32,89 @@ function m(e, t) {
|
|
|
33
32
|
childActive: n.length > 0 && f(n, t)
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
|
-
function h({ item:
|
|
37
|
-
let d = !!(
|
|
38
|
-
if (
|
|
35
|
+
function h({ item: e, pathname: r, depth: i, linkComponent: c }) {
|
|
36
|
+
let d = !!(e.items && e.items.length > 0), { active: f, childActive: p } = m(e, r), [h, _] = a.useState(e.defaultOpen ?? p);
|
|
37
|
+
if (a.useEffect(() => {
|
|
39
38
|
p && _(!0);
|
|
40
|
-
}, [p]), !d) return /* @__PURE__ */
|
|
41
|
-
disabled:
|
|
42
|
-
href:
|
|
43
|
-
icon:
|
|
44
|
-
label:
|
|
39
|
+
}, [p]), !d) return /* @__PURE__ */ o(n, {
|
|
40
|
+
disabled: e.disabled,
|
|
41
|
+
href: e.href,
|
|
42
|
+
icon: e.icon ? e.icon(f) : null,
|
|
43
|
+
label: e.title,
|
|
45
44
|
selected: f,
|
|
46
45
|
slotProps: { item: {
|
|
47
|
-
component:
|
|
48
|
-
rel:
|
|
49
|
-
target:
|
|
50
|
-
sx:
|
|
46
|
+
component: e.component ?? c,
|
|
47
|
+
rel: e.rel,
|
|
48
|
+
target: e.target,
|
|
49
|
+
sx: i > 0 ? { pl: `${(i - 1) * 12 + 12}px` } : void 0
|
|
51
50
|
} }
|
|
52
51
|
});
|
|
53
52
|
let v = f || p;
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
disabled:
|
|
56
|
-
icon:
|
|
57
|
-
label:
|
|
53
|
+
return /* @__PURE__ */ o(n, {
|
|
54
|
+
disabled: e.disabled,
|
|
55
|
+
icon: e.icon ? e.icon(v) : null,
|
|
56
|
+
label: e.title,
|
|
58
57
|
onClick: () => _((e) => !e),
|
|
59
58
|
selected: v,
|
|
60
59
|
slotProps: {
|
|
61
60
|
item: {
|
|
62
61
|
"aria-current": void 0,
|
|
63
62
|
"aria-expanded": h,
|
|
64
|
-
sx: { pl:
|
|
63
|
+
sx: { pl: i > 0 ? `${i * 12 + 12}px` : "12px" }
|
|
65
64
|
},
|
|
66
65
|
trailing: { sx: {
|
|
67
66
|
transform: h ? "rotate(0deg)" : "rotate(-90deg)",
|
|
68
67
|
transition: (e) => e.transitions.create("transform", { duration: e.transitions.duration.shorter }),
|
|
69
|
-
[
|
|
68
|
+
[t]: { transition: "none" }
|
|
70
69
|
} }
|
|
71
70
|
},
|
|
72
|
-
trailing: /* @__PURE__ */
|
|
73
|
-
children: /* @__PURE__ */ u
|
|
71
|
+
trailing: /* @__PURE__ */ o(s, {}),
|
|
72
|
+
children: /* @__PURE__ */ o(u, {
|
|
74
73
|
in: h,
|
|
75
74
|
timeout: 200,
|
|
76
75
|
unmountOnExit: !0,
|
|
77
|
-
children: /* @__PURE__ */
|
|
76
|
+
children: /* @__PURE__ */ o(l, {
|
|
78
77
|
sx: {
|
|
79
|
-
ml:
|
|
78
|
+
ml: i > 0 ? `${i * 16 + 12}px` : "12px",
|
|
80
79
|
mt: 1,
|
|
81
80
|
mb: 1,
|
|
82
81
|
pl: 1
|
|
83
82
|
},
|
|
84
|
-
children: /* @__PURE__ */
|
|
85
|
-
items:
|
|
86
|
-
pathname:
|
|
87
|
-
depth:
|
|
88
|
-
linkComponent:
|
|
83
|
+
children: /* @__PURE__ */ o(g, {
|
|
84
|
+
items: e.items,
|
|
85
|
+
pathname: r,
|
|
86
|
+
depth: i + 1,
|
|
87
|
+
linkComponent: c
|
|
89
88
|
})
|
|
90
89
|
})
|
|
91
90
|
})
|
|
92
91
|
});
|
|
93
92
|
}
|
|
94
93
|
h.displayName = "SNavGroupItem";
|
|
95
|
-
var g =
|
|
96
|
-
let
|
|
97
|
-
props:
|
|
94
|
+
var g = a.forwardRef(function(t, n) {
|
|
95
|
+
let r = i({
|
|
96
|
+
props: t,
|
|
98
97
|
name: "SNavItems"
|
|
99
|
-
}), { depth: a = 0, items:
|
|
100
|
-
...
|
|
98
|
+
}), { depth: a = 0, items: s, linkComponent: c, pathname: l = "", sx: u, ...f } = r, p = {
|
|
99
|
+
...r,
|
|
101
100
|
depth: a,
|
|
102
|
-
pathname:
|
|
101
|
+
pathname: l
|
|
103
102
|
};
|
|
104
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ o(d, {
|
|
105
104
|
spacing: 1,
|
|
106
105
|
...f,
|
|
107
|
-
ref:
|
|
106
|
+
ref: n,
|
|
108
107
|
ownerState: p,
|
|
109
108
|
sx: [{
|
|
110
109
|
listStyle: "none",
|
|
111
110
|
m: 0,
|
|
112
111
|
p: 0
|
|
113
|
-
}, ...
|
|
114
|
-
children:
|
|
112
|
+
}, ...e(u)],
|
|
113
|
+
children: s.map((e) => /* @__PURE__ */ o(h, {
|
|
115
114
|
item: e,
|
|
116
|
-
pathname:
|
|
115
|
+
pathname: l,
|
|
117
116
|
depth: a,
|
|
118
|
-
linkComponent:
|
|
117
|
+
linkComponent: c
|
|
119
118
|
}, e.key))
|
|
120
119
|
});
|
|
121
120
|
});
|