@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,20 +1,19 @@
|
|
|
1
1
|
import { resolveOwnerStateSlotProps as e } from "../utils/slots.js";
|
|
2
|
-
import { t } from "../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { Box as c, ButtonBase as l, styled as u, useThemeProps as d } from "@mui/material";
|
|
2
|
+
import { getFocusVisibleStyle as t } from "../theme/components/action-styles.js";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { Box as a, ButtonBase as o, styled as s, useThemeProps as c } from "@mui/material";
|
|
6
|
+
import { mergeSlotProps as l, useForkRef as u } from "@mui/material/utils";
|
|
7
|
+
import d from "@mui/utils/appendOwnerState";
|
|
9
8
|
//#region lib/s-swatch/s-swatch.tsx
|
|
10
9
|
var f = {
|
|
11
10
|
small: 22,
|
|
12
11
|
medium: 32,
|
|
13
12
|
large: 44
|
|
14
|
-
}, p = 24, m = 44, h = "@media (pointer: coarse)", g = 45, _ = (e) => Math.max(1, typeof e == "number" ? e : f[e]), v = ({ ownerState: e, theme:
|
|
13
|
+
}, p = 24, m = 44, h = "@media (pointer: coarse)", g = 45, _ = (e) => Math.max(1, typeof e == "number" ? e : f[e]), v = ({ ownerState: e, theme: n }) => ({
|
|
15
14
|
alignItems: "center",
|
|
16
15
|
backgroundColor: "transparent",
|
|
17
|
-
borderRadius:
|
|
16
|
+
borderRadius: n.radius.sm,
|
|
18
17
|
boxSizing: "border-box",
|
|
19
18
|
cursor: e.interactive ? "pointer" : "default",
|
|
20
19
|
display: "inline-flex",
|
|
@@ -23,7 +22,7 @@ var f = {
|
|
|
23
22
|
justifyContent: "center",
|
|
24
23
|
padding: 0,
|
|
25
24
|
position: "relative",
|
|
26
|
-
transition:
|
|
25
|
+
transition: n.transitions.create("opacity", { duration: n.transitions.duration.shorter }),
|
|
27
26
|
width: e.controlSize,
|
|
28
27
|
...e.interactive ? {
|
|
29
28
|
"& .MuiTouchRipple-root": {
|
|
@@ -35,7 +34,7 @@ var f = {
|
|
|
35
34
|
zIndex: 1
|
|
36
35
|
},
|
|
37
36
|
"&.Mui-focusVisible::after": {
|
|
38
|
-
...
|
|
37
|
+
...t(n),
|
|
39
38
|
borderRadius: "inherit",
|
|
40
39
|
content: "\"\"",
|
|
41
40
|
height: e.swatchSize,
|
|
@@ -56,21 +55,21 @@ var f = {
|
|
|
56
55
|
} : void 0,
|
|
57
56
|
variants: [{
|
|
58
57
|
props: ({ ownerState: e }) => e.shape === "circle",
|
|
59
|
-
style: { borderRadius:
|
|
58
|
+
style: { borderRadius: n.radius.full }
|
|
60
59
|
}, {
|
|
61
60
|
props: ({ ownerState: e }) => e.disabled,
|
|
62
|
-
style: { opacity: (
|
|
61
|
+
style: { opacity: (n.vars ?? n).palette.action.disabledOpacity }
|
|
63
62
|
}],
|
|
64
63
|
"@media (prefers-reduced-motion: reduce)": { transition: "none" }
|
|
65
|
-
}), y =
|
|
64
|
+
}), y = s(o, {
|
|
66
65
|
name: "SSwatch",
|
|
67
66
|
slot: "Root",
|
|
68
67
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
69
|
-
})(v), b =
|
|
68
|
+
})(v), b = s(a, {
|
|
70
69
|
name: "SSwatch",
|
|
71
70
|
slot: "Root",
|
|
72
71
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
73
|
-
})(v), x =
|
|
72
|
+
})(v), x = s(a, {
|
|
74
73
|
name: "SSwatch",
|
|
75
74
|
slot: "Swatch",
|
|
76
75
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
@@ -113,7 +112,7 @@ var f = {
|
|
|
113
112
|
}
|
|
114
113
|
],
|
|
115
114
|
"@media (prefers-reduced-motion: reduce)": { transition: "none" }
|
|
116
|
-
})), S =
|
|
115
|
+
})), S = s(a, {
|
|
117
116
|
name: "SSwatch",
|
|
118
117
|
slot: "Image",
|
|
119
118
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
@@ -126,7 +125,7 @@ var f = {
|
|
|
126
125
|
objectPosition: "center",
|
|
127
126
|
position: "absolute",
|
|
128
127
|
width: "100%"
|
|
129
|
-
}), C =
|
|
128
|
+
}), C = s(a, {
|
|
130
129
|
name: "SSwatch",
|
|
131
130
|
slot: "Indicator",
|
|
132
131
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
@@ -142,7 +141,7 @@ var f = {
|
|
|
142
141
|
transform: "translate(-50%, -50%)",
|
|
143
142
|
width: Math.max(6, Math.round(e.swatchSize * .3)),
|
|
144
143
|
zIndex: 3
|
|
145
|
-
})), w =
|
|
144
|
+
})), w = s(a, {
|
|
146
145
|
name: "SSwatch",
|
|
147
146
|
slot: "Strikethrough",
|
|
148
147
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
@@ -158,12 +157,12 @@ var f = {
|
|
|
158
157
|
transformOrigin: "center",
|
|
159
158
|
width: "141.421%",
|
|
160
159
|
zIndex: 2
|
|
161
|
-
})), T =
|
|
162
|
-
let
|
|
163
|
-
props:
|
|
160
|
+
})), T = n.forwardRef(function(t, n) {
|
|
161
|
+
let a = c({
|
|
162
|
+
props: t,
|
|
164
163
|
name: "SSwatch"
|
|
165
|
-
}), { "aria-label":
|
|
166
|
-
...
|
|
164
|
+
}), { "aria-label": o, "aria-labelledby": s, color: f, colorSecondary: h, disabled: v = !1, image: T, interactive: E = !0, label: D, selected: O = !1, shape: k = "square", size: A = "medium", slotProps: j, slots: M, unavailable: N = !1, unavailableText: P = "Unavailable", value: F, ...I } = a, L = _(A), R = E ? Math.max(L, p) : L, z = {
|
|
165
|
+
...a,
|
|
167
166
|
coarseControlSize: E ? Math.max(L, m) : L,
|
|
168
167
|
controlSize: R,
|
|
169
168
|
disabled: v,
|
|
@@ -173,23 +172,23 @@ var f = {
|
|
|
173
172
|
size: A,
|
|
174
173
|
swatchSize: L,
|
|
175
174
|
unavailable: N
|
|
176
|
-
}, B = M?.root ?? (E ? y : b), V = M?.swatch ?? x, H = M?.image ?? S, U = M?.indicator ?? C, W = M?.strikethrough ?? w, G = [
|
|
175
|
+
}, B = M?.root ?? (E ? y : b), V = M?.swatch ?? x, H = M?.image ?? S, U = M?.indicator ?? C, W = M?.strikethrough ?? w, G = [o ?? D ?? F, N ? P : void 0].filter(Boolean).join(", "), { ref: K, ...q } = d(B, l(e(j?.root, z), E ? {
|
|
177
176
|
...I,
|
|
178
|
-
"aria-label":
|
|
179
|
-
"aria-labelledby":
|
|
177
|
+
"aria-label": s ? void 0 : G || void 0,
|
|
178
|
+
"aria-labelledby": s,
|
|
180
179
|
"aria-pressed": O,
|
|
181
180
|
disabled: v
|
|
182
181
|
} : {
|
|
183
182
|
component: "span",
|
|
184
183
|
role: "img",
|
|
185
184
|
...I,
|
|
186
|
-
"aria-label":
|
|
187
|
-
"aria-labelledby":
|
|
188
|
-
}), z), J =
|
|
189
|
-
return /* @__PURE__ */
|
|
185
|
+
"aria-label": s ? void 0 : G || void 0,
|
|
186
|
+
"aria-labelledby": s
|
|
187
|
+
}), z), J = u(K, n), { style: Y, ...X } = e(j?.swatch, z) ?? {}, Z = d(V, X, z), Q = d(H, e(j?.image, z) ?? {}, z), $ = d(U, e(j?.indicator, z) ?? {}, z), ee = d(W, e(j?.strikethrough, z) ?? {}, z);
|
|
188
|
+
return /* @__PURE__ */ i(B, {
|
|
190
189
|
...q,
|
|
191
190
|
ref: J,
|
|
192
|
-
children: [/* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ i(V, {
|
|
193
192
|
component: "span",
|
|
194
193
|
...Z,
|
|
195
194
|
style: {
|
|
@@ -197,17 +196,17 @@ var f = {
|
|
|
197
196
|
backgroundImage: h ? `linear-gradient(${180 - g}deg, ${f} 0 50%, ${h} 50% 100%)` : void 0,
|
|
198
197
|
...Y
|
|
199
198
|
},
|
|
200
|
-
children: [T ? /* @__PURE__ */
|
|
199
|
+
children: [T ? /* @__PURE__ */ r(H, {
|
|
201
200
|
alt: "",
|
|
202
201
|
component: "img",
|
|
203
202
|
...Q,
|
|
204
203
|
src: T
|
|
205
|
-
}) : null, N ? /* @__PURE__ */
|
|
204
|
+
}) : null, N ? /* @__PURE__ */ r(W, {
|
|
206
205
|
"aria-hidden": !0,
|
|
207
206
|
component: "span",
|
|
208
207
|
...ee
|
|
209
208
|
}) : null]
|
|
210
|
-
}), O ? /* @__PURE__ */
|
|
209
|
+
}), O ? /* @__PURE__ */ r(U, {
|
|
211
210
|
"aria-hidden": !0,
|
|
212
211
|
component: "span",
|
|
213
212
|
...$
|
package/dist/s-switch/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SSwitch as e } from "./s-switch.js";
|
|
2
2
|
export { e as SSwitch, e as default };
|
|
@@ -1,2 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { styled as e, useThemeProps as t } from "@mui/material/styles";
|
|
2
|
+
import n from "@mui/material/Switch";
|
|
3
|
+
import * as r from "react";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
import a from "@mui/utils/appendOwnerState";
|
|
6
|
+
import o, { formControlLabelClasses as s } from "@mui/material/FormControlLabel";
|
|
7
|
+
//#region lib/s-switch/s-switch.tsx
|
|
8
|
+
var c = e(o, {
|
|
9
|
+
name: "SSwitch",
|
|
10
|
+
slot: "Root",
|
|
11
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
12
|
+
})(({ theme: e }) => ({
|
|
13
|
+
display: "flex",
|
|
14
|
+
justifyContent: "space-between",
|
|
15
|
+
margin: 0,
|
|
16
|
+
userSelect: "none",
|
|
17
|
+
[`&&.${s.disabled}`]: { cursor: "not-allowed" },
|
|
18
|
+
[`&& .${s.label}.${s.disabled}`]: { color: (e.vars ?? e).palette.text.disabled }
|
|
19
|
+
}));
|
|
20
|
+
function l(e, t) {
|
|
21
|
+
return typeof e == "function" ? e(t) : e;
|
|
22
|
+
}
|
|
23
|
+
var u = r.forwardRef(function(e, r) {
|
|
24
|
+
let o = t({
|
|
25
|
+
props: e,
|
|
26
|
+
name: "SSwitch"
|
|
27
|
+
}), { disabled: s = !1, label: u, labelPlacement: d = "start", required: f = !1, slotProps: p, slots: m, ...h } = o, g = {
|
|
28
|
+
...o,
|
|
29
|
+
disabled: s,
|
|
30
|
+
labelPlacement: d,
|
|
31
|
+
required: f
|
|
32
|
+
}, _ = m?.control ?? n, v = l(p?.control, g), y = a(m?.control, v ?? {}, g);
|
|
33
|
+
return /* @__PURE__ */ i(c, {
|
|
34
|
+
...h,
|
|
35
|
+
control: /* @__PURE__ */ i(_, { ...y }),
|
|
36
|
+
disabled: s,
|
|
37
|
+
label: u,
|
|
38
|
+
labelPlacement: d,
|
|
39
|
+
ownerState: g,
|
|
40
|
+
ref: r,
|
|
41
|
+
required: f,
|
|
42
|
+
slots: m?.typography ? { typography: m.typography } : void 0,
|
|
43
|
+
slotProps: p?.typography ? { typography: p.typography } : void 0
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
u.displayName = "SSwitch";
|
|
47
|
+
//#endregion
|
|
48
|
+
export { u as SSwitch, u as default };
|
package/dist/s-tabs/s-tabs.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { toSxArray as e } from "../utils/sx.js";
|
|
2
|
-
import { t } from "
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
-
import { Box as d, Tab as f, Tabs as p, styled as m, useThemeProps as h } from "@mui/material";
|
|
2
|
+
import { getTabId as t, getTabPanelId as n } from "./tab-ids.js";
|
|
3
|
+
import * as r from "react";
|
|
4
|
+
import { createElement as i } from "react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { Box as s, Tab as c, Tabs as l, styled as u, useThemeProps as d } from "@mui/material";
|
|
7
|
+
import { mergeSlotProps as f, useControlled as p, useForkRef as m } from "@mui/material/utils";
|
|
8
|
+
import h from "@mui/utils/appendOwnerState";
|
|
11
9
|
//#region lib/s-tabs/s-tabs.tsx
|
|
12
|
-
var g =
|
|
10
|
+
var g = u(s, {
|
|
13
11
|
name: "STabs",
|
|
14
12
|
slot: "Root",
|
|
15
13
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
@@ -20,61 +18,61 @@ function _(e, t) {
|
|
|
20
18
|
function v(e, t) {
|
|
21
19
|
return e.value ?? t;
|
|
22
20
|
}
|
|
23
|
-
var y =
|
|
24
|
-
let b =
|
|
25
|
-
props:
|
|
21
|
+
var y = r.forwardRef(function(u, y) {
|
|
22
|
+
let b = d({
|
|
23
|
+
props: u,
|
|
26
24
|
name: "STabs"
|
|
27
|
-
}), { children: x, defaultValue:
|
|
28
|
-
controlled:
|
|
29
|
-
default:
|
|
25
|
+
}), { children: x, defaultValue: ee, id: S, onChange: C, orientation: w = "horizontal", slotProps: T, slots: E, sx: D, tabs: O, value: k, ...A } = b, j = r.useId(), M = S ?? j, N = O[0]?.value ?? 0, [P, F] = p({
|
|
26
|
+
controlled: k,
|
|
27
|
+
default: ee ?? N,
|
|
30
28
|
name: "STabs",
|
|
31
29
|
state: "value"
|
|
32
|
-
}),
|
|
30
|
+
}), I = O.findIndex((e, t) => (e.value ?? t) === P), L = I >= 0 ? O[I]?.value ?? I : !1, R = {
|
|
33
31
|
...b,
|
|
34
|
-
activeIndex:
|
|
35
|
-
orientation:
|
|
36
|
-
value:
|
|
37
|
-
},
|
|
38
|
-
|
|
32
|
+
activeIndex: I,
|
|
33
|
+
orientation: w,
|
|
34
|
+
value: P
|
|
35
|
+
}, z = E?.root ?? g, B = E?.list ?? l, V = E?.tab ?? c, H = E?.panel ?? s, U = _(T?.root, R), W = _(T?.list, R), G = _(T?.panel, R), { sx: K, ...q } = U ?? {}, { sx: J, ...Y } = G ?? {}, { ref: X, ...Z } = h(z, q, R), Q = m(X, y), $ = h(E?.list, W ?? {}, R), te = h(E?.panel, Y, R), ne = (e, t) => {
|
|
36
|
+
F(t), C?.(e, t);
|
|
39
37
|
};
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
...
|
|
42
|
-
...
|
|
43
|
-
ref:
|
|
44
|
-
id:
|
|
38
|
+
return /* @__PURE__ */ o(z, {
|
|
39
|
+
...A,
|
|
40
|
+
...Z,
|
|
41
|
+
ref: Q,
|
|
42
|
+
id: M,
|
|
45
43
|
sx: [
|
|
46
|
-
{ display:
|
|
47
|
-
...e(
|
|
48
|
-
...e(
|
|
44
|
+
{ display: w === "vertical" ? "flex" : "block" },
|
|
45
|
+
...e(D),
|
|
46
|
+
...e(K)
|
|
49
47
|
],
|
|
50
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ a(B, {
|
|
51
49
|
"aria-label": "Tabs",
|
|
52
|
-
|
|
53
|
-
value:
|
|
54
|
-
orientation:
|
|
50
|
+
...$,
|
|
51
|
+
value: P,
|
|
52
|
+
orientation: w,
|
|
55
53
|
onChange: ne,
|
|
56
|
-
children:
|
|
57
|
-
let
|
|
58
|
-
...
|
|
59
|
-
index:
|
|
54
|
+
children: O.map((e, r) => {
|
|
55
|
+
let a = e.value ?? r, o = {
|
|
56
|
+
...R,
|
|
57
|
+
index: r,
|
|
60
58
|
item: e
|
|
61
|
-
},
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
...
|
|
64
|
-
key: v(e,
|
|
65
|
-
id:
|
|
66
|
-
"aria-controls":
|
|
59
|
+
}, s = f(_(T?.tab, o), e);
|
|
60
|
+
return /* @__PURE__ */ i(V, {
|
|
61
|
+
...h(E?.tab, s, o),
|
|
62
|
+
key: v(e, r),
|
|
63
|
+
id: t(M, a),
|
|
64
|
+
"aria-controls": n(M, a),
|
|
67
65
|
label: e.label,
|
|
68
|
-
value:
|
|
66
|
+
value: a
|
|
69
67
|
});
|
|
70
68
|
})
|
|
71
|
-
}), x &&
|
|
69
|
+
}), x && L !== !1 ? /* @__PURE__ */ a(H, {
|
|
72
70
|
...te,
|
|
73
71
|
role: "tabpanel",
|
|
74
|
-
id:
|
|
75
|
-
"aria-labelledby":
|
|
76
|
-
sx: [{ p: 2 }, ...e(
|
|
77
|
-
children:
|
|
72
|
+
id: n(M, L),
|
|
73
|
+
"aria-labelledby": t(M, L),
|
|
74
|
+
sx: [{ p: 2 }, ...e(J)],
|
|
75
|
+
children: r.Children.toArray(x)[I]
|
|
78
76
|
}) : null]
|
|
79
77
|
});
|
|
80
78
|
});
|
|
@@ -1,2 +1,213 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { toSxArray as e } from "../utils/sx.js";
|
|
2
|
+
import { STextField as t } from "../s-text-field/s-text-field.js";
|
|
3
|
+
import { SPopover as n } from "../s-popover/s-popover.js";
|
|
4
|
+
import { SPopoverContent as r } from "../s-popover/s-popover-content.js";
|
|
5
|
+
import i from "@mui/material/IconButton";
|
|
6
|
+
import * as a from "react";
|
|
7
|
+
import o from "@mui/material/Select";
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
import { MenuItem as l, styled as u, useThemeProps as d } from "@mui/material";
|
|
10
|
+
import f from "@mui/material/Stack";
|
|
11
|
+
import p from "@mui/icons-material/Code";
|
|
12
|
+
import m from "@mui/icons-material/FormatBold";
|
|
13
|
+
import h from "@mui/icons-material/FormatItalic";
|
|
14
|
+
import g from "@mui/icons-material/FormatListBulleted";
|
|
15
|
+
import _ from "@mui/icons-material/FormatListNumbered";
|
|
16
|
+
import v from "@mui/icons-material/Link";
|
|
17
|
+
import y from "@mui/icons-material/StrikethroughS";
|
|
18
|
+
import b from "@mui/material/FormControl";
|
|
19
|
+
//#region lib/s-text-editor/s-text-editor-toolbar.tsx
|
|
20
|
+
var x = u(f, {
|
|
21
|
+
name: "STextEditorToolbar",
|
|
22
|
+
slot: "Root"
|
|
23
|
+
})({}), S = a.forwardRef(function(i, u) {
|
|
24
|
+
let S = d({
|
|
25
|
+
props: i,
|
|
26
|
+
name: "STextEditorToolbar"
|
|
27
|
+
}), { className: T, disabled: E = !1, editor: D, spacing: O = 1, sx: k, ...A } = S, j = {
|
|
28
|
+
...S,
|
|
29
|
+
disabled: E,
|
|
30
|
+
editorReady: D != null
|
|
31
|
+
}, [M, N] = a.useState(!1), [P, F] = a.useState(null), [I, L] = a.useState("");
|
|
32
|
+
return a.useEffect(() => {
|
|
33
|
+
E && (N(!1), F(null), L(""));
|
|
34
|
+
}, [E]), /* @__PURE__ */ c(a.Fragment, { children: [/* @__PURE__ */ s(x, {
|
|
35
|
+
...A,
|
|
36
|
+
className: ["tiptap-toolbar", T].filter(Boolean).join(" "),
|
|
37
|
+
ownerState: j,
|
|
38
|
+
ref: u,
|
|
39
|
+
spacing: O,
|
|
40
|
+
"aria-disabled": E || void 0,
|
|
41
|
+
sx: [{
|
|
42
|
+
borderBottom: "1px solid",
|
|
43
|
+
borderColor: "divider",
|
|
44
|
+
p: "8px",
|
|
45
|
+
minHeight: "57px"
|
|
46
|
+
}, ...e(k)],
|
|
47
|
+
children: D ? /* @__PURE__ */ c(f, {
|
|
48
|
+
direction: "row",
|
|
49
|
+
spacing: .5,
|
|
50
|
+
sx: {
|
|
51
|
+
alignItems: "center",
|
|
52
|
+
flexWrap: "wrap"
|
|
53
|
+
},
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ c(o, {
|
|
56
|
+
disabled: E,
|
|
57
|
+
inputProps: { "aria-label": "Text format" },
|
|
58
|
+
onChange: (e) => {
|
|
59
|
+
let t = e.target.value;
|
|
60
|
+
if (t) {
|
|
61
|
+
if (t === "p") {
|
|
62
|
+
D.chain().focus().setParagraph().run();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (t.startsWith("h")) {
|
|
66
|
+
let e = parseInt(t.replace("h", ""));
|
|
67
|
+
!isNaN(e) && e >= 1 && e <= 6 && D.chain().focus().setHeading({ level: e }).run();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
value: C(D),
|
|
72
|
+
children: [/* @__PURE__ */ s(l, {
|
|
73
|
+
disabled: E || !D.can().chain().focus().setParagraph().run(),
|
|
74
|
+
value: "p",
|
|
75
|
+
children: "Paragraph"
|
|
76
|
+
}), [
|
|
77
|
+
1,
|
|
78
|
+
2,
|
|
79
|
+
3,
|
|
80
|
+
4,
|
|
81
|
+
5,
|
|
82
|
+
6
|
|
83
|
+
].map((e) => /* @__PURE__ */ c(l, {
|
|
84
|
+
disabled: E || !D.can().chain().focus().setHeading({ level: e }).run(),
|
|
85
|
+
value: `h${e}`,
|
|
86
|
+
children: ["Heading ", e]
|
|
87
|
+
}, e))]
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ s(w, {
|
|
90
|
+
active: D.isActive("bold"),
|
|
91
|
+
disabled: E || !D.can().chain().focus().toggleBold().run(),
|
|
92
|
+
label: "Bold",
|
|
93
|
+
onClick: () => {
|
|
94
|
+
D.chain().focus().toggleBold().run();
|
|
95
|
+
},
|
|
96
|
+
children: /* @__PURE__ */ s(m, {})
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ s(w, {
|
|
99
|
+
active: D.isActive("italic"),
|
|
100
|
+
disabled: E || !D.can().chain().focus().toggleItalic().run(),
|
|
101
|
+
label: "Italic",
|
|
102
|
+
onClick: () => {
|
|
103
|
+
D.chain().focus().toggleItalic().run();
|
|
104
|
+
},
|
|
105
|
+
children: /* @__PURE__ */ s(h, {})
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ s(w, {
|
|
108
|
+
active: D.isActive("strike"),
|
|
109
|
+
disabled: E || !D.can().chain().focus().toggleStrike().run(),
|
|
110
|
+
label: "Strikethrough",
|
|
111
|
+
onClick: () => {
|
|
112
|
+
D.chain().focus().toggleStrike().run();
|
|
113
|
+
},
|
|
114
|
+
children: /* @__PURE__ */ s(y, {})
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ s(w, {
|
|
117
|
+
active: D.isActive("codeBlock"),
|
|
118
|
+
disabled: E || !D.can().chain().focus().toggleCodeBlock().run(),
|
|
119
|
+
label: "Code block",
|
|
120
|
+
onClick: () => {
|
|
121
|
+
D.chain().focus().toggleCodeBlock().run();
|
|
122
|
+
},
|
|
123
|
+
children: /* @__PURE__ */ s(p, {})
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ s(w, {
|
|
126
|
+
active: D.isActive("bulletList"),
|
|
127
|
+
disabled: E || !D.can().chain().focus().toggleBulletList().run(),
|
|
128
|
+
label: "Bulleted list",
|
|
129
|
+
onClick: () => {
|
|
130
|
+
D.chain().focus().toggleBulletList().run();
|
|
131
|
+
},
|
|
132
|
+
children: /* @__PURE__ */ s(g, {})
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ s(w, {
|
|
135
|
+
active: D.isActive("orderedList"),
|
|
136
|
+
disabled: E || !D.can().chain().focus().toggleOrderedList().run(),
|
|
137
|
+
label: "Numbered list",
|
|
138
|
+
onClick: () => {
|
|
139
|
+
D.chain().focus().toggleOrderedList().run();
|
|
140
|
+
},
|
|
141
|
+
children: /* @__PURE__ */ s(_, {})
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ s(w, {
|
|
144
|
+
disabled: E,
|
|
145
|
+
label: "Set link",
|
|
146
|
+
onClick: (e) => {
|
|
147
|
+
L(D.getAttributes("link").href ?? ""), F(e.currentTarget), N(!0);
|
|
148
|
+
},
|
|
149
|
+
children: /* @__PURE__ */ s(v, {})
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ s(w, {
|
|
152
|
+
active: D.isActive("link"),
|
|
153
|
+
disabled: E || !D.can().chain().focus().unsetLink().run(),
|
|
154
|
+
label: "Remove link",
|
|
155
|
+
onClick: () => {
|
|
156
|
+
D.chain().focus().unsetLink().run();
|
|
157
|
+
},
|
|
158
|
+
children: /* @__PURE__ */ s(v, {})
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
}) : null
|
|
162
|
+
}), /* @__PURE__ */ s(n, {
|
|
163
|
+
anchorEl: P,
|
|
164
|
+
placement: "bottom-start",
|
|
165
|
+
onClose: () => {
|
|
166
|
+
N(!1), F(null), L("");
|
|
167
|
+
},
|
|
168
|
+
open: !E && M,
|
|
169
|
+
children: /* @__PURE__ */ s(r, { children: /* @__PURE__ */ s(b, { children: /* @__PURE__ */ s(t, {
|
|
170
|
+
name: "url",
|
|
171
|
+
label: "URL",
|
|
172
|
+
onChange: (e) => {
|
|
173
|
+
L(e.target.value);
|
|
174
|
+
},
|
|
175
|
+
onKeyUp: (e) => {
|
|
176
|
+
if (e.key === "Enter") {
|
|
177
|
+
if (I === "") {
|
|
178
|
+
D?.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
D?.chain().focus().setLink({ href: I }).run(), N(!1), F(null), L("");
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
value: I
|
|
185
|
+
}) }) })
|
|
186
|
+
})] });
|
|
187
|
+
});
|
|
188
|
+
S.displayName = "STextEditorToolbar";
|
|
189
|
+
function C(e) {
|
|
190
|
+
if (e.isActive("paragraph")) return "p";
|
|
191
|
+
for (let t of [
|
|
192
|
+
1,
|
|
193
|
+
2,
|
|
194
|
+
3,
|
|
195
|
+
4,
|
|
196
|
+
5,
|
|
197
|
+
6
|
|
198
|
+
]) if (e.isActive("heading", { level: t })) return `h${t}`;
|
|
199
|
+
return "p";
|
|
200
|
+
}
|
|
201
|
+
var w = a.forwardRef(function({ active: e, children: t, disabled: n, label: r, onClick: a }, o) {
|
|
202
|
+
return /* @__PURE__ */ s(i, {
|
|
203
|
+
"aria-label": r,
|
|
204
|
+
"aria-pressed": e,
|
|
205
|
+
color: e ? "primary" : "inherit",
|
|
206
|
+
disabled: n,
|
|
207
|
+
onClick: a,
|
|
208
|
+
ref: o,
|
|
209
|
+
children: t
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
//#endregion
|
|
213
|
+
export { S as STextEditorToolbar };
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
1
|
+
import { toSxArray as e } from "../utils/sx.js";
|
|
2
|
+
import { tint as t } from "../theme/utils.js";
|
|
3
|
+
import { STextEditorToolbar as n } from "./s-text-editor-toolbar.js";
|
|
4
|
+
import { styled as r, useThemeProps as i } from "@mui/material/styles";
|
|
5
|
+
import * as a from "react";
|
|
6
|
+
import { forwardRef as o } from "react";
|
|
7
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
import l from "@mui/material/Box";
|
|
10
9
|
import { Placeholder as u } from "@tiptap/extension-placeholder";
|
|
11
10
|
import { EditorContent as d, useEditor as f } from "@tiptap/react";
|
|
12
11
|
import { StarterKit as p } from "@tiptap/starter-kit";
|
|
13
12
|
//#region lib/s-text-editor/s-text-editor.tsx
|
|
14
|
-
var m =
|
|
13
|
+
var m = r(l, {
|
|
15
14
|
name: "STextEditor",
|
|
16
15
|
slot: "Root",
|
|
17
16
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
18
|
-
})({}), h =
|
|
19
|
-
let
|
|
20
|
-
props:
|
|
17
|
+
})({}), h = o((r, o) => {
|
|
18
|
+
let l = i({
|
|
19
|
+
props: r,
|
|
21
20
|
name: "STextEditor"
|
|
22
|
-
}), { content: h, editable: g = !0, hideToolbar: _ = !1, onUpdate: v = () => {}, placeholder: y, sx: b, ...x } =
|
|
23
|
-
...
|
|
21
|
+
}), { content: h, editable: g = !0, hideToolbar: _ = !1, onUpdate: v = () => {}, placeholder: y, sx: b, ...x } = l, S = {
|
|
22
|
+
...l,
|
|
24
23
|
editable: g,
|
|
25
24
|
hideToolbar: _
|
|
26
|
-
}, C =
|
|
25
|
+
}, C = a.useRef(y);
|
|
27
26
|
C.current = y;
|
|
28
27
|
let w = f({
|
|
29
|
-
extensions:
|
|
28
|
+
extensions: a.useMemo(() => [p.configure({ link: {
|
|
30
29
|
openOnClick: !1,
|
|
31
30
|
autolink: !0
|
|
32
31
|
} }), u.configure({
|
|
@@ -38,15 +37,15 @@ var m = t(e, {
|
|
|
38
37
|
onUpdate: v,
|
|
39
38
|
parseOptions: { preserveWhitespace: "full" }
|
|
40
39
|
});
|
|
41
|
-
return
|
|
40
|
+
return a.useEffect(() => {
|
|
42
41
|
!w || w.isDestroyed || w.setEditable(g);
|
|
43
|
-
}, [g, w]),
|
|
42
|
+
}, [g, w]), a.useEffect(() => {
|
|
44
43
|
!w || w.isDestroyed || w.view.dispatch(w.state.tr);
|
|
45
|
-
}, [w, y]),
|
|
44
|
+
}, [w, y]), a.useEffect(() => {
|
|
46
45
|
!w || w.isDestroyed || w.getHTML() !== h && w.commands.setContent(h);
|
|
47
|
-
}, [h, w]), /* @__PURE__ */
|
|
46
|
+
}, [h, w]), /* @__PURE__ */ c(m, {
|
|
48
47
|
...x,
|
|
49
|
-
ref:
|
|
48
|
+
ref: o,
|
|
50
49
|
ownerState: S,
|
|
51
50
|
sx: [(e) => ({
|
|
52
51
|
display: "flex",
|
|
@@ -58,7 +57,7 @@ var m = t(e, {
|
|
|
58
57
|
...g ? {
|
|
59
58
|
"&:hover": { borderColor: (e.vars ?? e).palette.grey[500] },
|
|
60
59
|
"&:focus-within": {
|
|
61
|
-
outline: `3px solid ${
|
|
60
|
+
outline: `3px solid ${t((e.vars ?? e).palette.primary[500], 50)}`,
|
|
62
61
|
borderColor: (e.vars ?? e).palette.primary[400]
|
|
63
62
|
}
|
|
64
63
|
} : {},
|
|
@@ -88,11 +87,11 @@ var m = t(e, {
|
|
|
88
87
|
pointerEvents: "none"
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
|
-
}), ...
|
|
92
|
-
children: [_ ? null : /* @__PURE__ */
|
|
90
|
+
}), ...e(b)],
|
|
91
|
+
children: [_ ? null : /* @__PURE__ */ s(n, {
|
|
93
92
|
disabled: !g,
|
|
94
93
|
editor: w
|
|
95
|
-
}), /* @__PURE__ */
|
|
94
|
+
}), /* @__PURE__ */ s(d, {
|
|
96
95
|
className: "tiptap-container",
|
|
97
96
|
editor: w
|
|
98
97
|
})]
|