@solostylist/ui-kit 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{gradients-90SYkAC0.js → gradients-DSnBONEQ.js} +1 -1
- package/dist/main.js +1 -1
- package/dist/palettes/index.js +1 -1
- package/dist/{palettes-Dw3PEYF5.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-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 +184 -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-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-icon-button/s-icon-button.js +15 -16
- 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-label/s-label.js +26 -27
- package/dist/s-language-switcher/index.js +2 -2
- package/dist/s-language-switcher/s-language-switcher.js +150 -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-localization-provider/index.js +1 -1
- package/dist/s-localization-provider/s-localization-provider.js +12 -2
- package/dist/s-nav-item/s-nav-item.js +16 -16
- package/dist/s-nav-items/index.js +2 -2
- package/dist/s-nav-items/s-nav-items.js +167 -2
- package/dist/s-no-ssr/index.js +1 -1
- package/dist/s-no-ssr/s-no-ssr.js +5 -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-quantity-input/index.js +1 -1
- package/dist/s-quantity-input/s-quantity-input.js +246 -2
- 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-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 +16 -17
- 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-stripe/s-stripe.js +11 -12
- package/dist/s-stripe/stripe-input.js +3 -2
- 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 +216 -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/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-Dt_DT9b5.js → theme-primitives-CRfnMsNy.js} +108 -109
- package/dist/utils/dayjs.js +9 -146
- package/package.json +1 -1
- package/dist/Add-COc9VdNg.js +0 -6
- package/dist/ArrowUpward-D88i2k4q.js +0 -6
- package/dist/Box-9oeZgA1U.js +0 -46
- package/dist/Button-DgIFcM44.js +0 -534
- package/dist/ButtonBase-DxKtpFYs.js +0 -747
- package/dist/Checkbox-BoZu9z2l.js +0 -152
- package/dist/ChevronRight-BxsM4W78.js +0 -6
- package/dist/Close-o4HFfK0I.js +0 -6
- package/dist/Collapse-zgIFP5Sj.js +0 -266
- package/dist/ContentCopy-5unyTYXy.js +0 -6
- package/dist/DefaultPropsProvider-ebWx4_5E.js +0 -128
- package/dist/DialogContent-CAry6lVf.js +0 -450
- package/dist/Download-DtvoRwpl.js +0 -6
- package/dist/ExpandMore-Ba5bg6s-.js +0 -6
- package/dist/Favorite-B_GsElm0.js +0 -6
- package/dist/FormControl-BxmM9UP6.js +0 -221
- package/dist/FormControlLabel-DzgppcC_.js +0 -173
- package/dist/Grow-zRRuwUl-.js +0 -121
- package/dist/InfoOutlined-VC7X46pc.js +0 -6
- package/dist/List-CnGIAXAS.js +0 -103
- package/dist/ListContext-B1HQt3OD.js +0 -6
- package/dist/Menu-C4Zabc9U.js +0 -504
- package/dist/MenuItem-rXJfQzDC.js +0 -223
- package/dist/MenuList-DDV8J-yd.js +0 -407
- package/dist/Modal-jAiibALV.js +0 -707
- package/dist/Paper-ixxCeml9.js +0 -115
- package/dist/Popper-CVYyMS3c.js +0 -1350
- package/dist/Portal-AnyvFRC4.js +0 -53
- package/dist/RtlProvider-B7uVJXUY.js +0 -19
- package/dist/Skeleton-iZFynl7z.js +0 -220
- package/dist/Stack-UMc4dV4G.js +0 -158
- package/dist/SwitchBase-D7zqrstO.js +0 -198
- package/dist/Tooltip-DbCd6rgF.js +0 -447
- package/dist/Typography-yXjc7kVP.js +0 -168
- package/dist/UnfoldMoreRounded-DsN0HVDV.js +0 -6
- package/dist/appendOwnerState-CELpvdMz.js +0 -17
- package/dist/assets/stripe-input.css +0 -1
- package/dist/autocomplete-B_4y84Ba.js +0 -43
- package/dist/avatar-BHuZu3DN.js +0 -10
- package/dist/buttonBaseClasses-BvBqFLb_.js +0 -13
- package/dist/capitalize-CccCFNpQ.js +0 -5
- package/dist/checkbox-BKMZEVU5.js +0 -88
- package/dist/checkboxClasses-CEsqS4sc.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-WOhYaq1E.js +0 -16
- package/dist/createSimplePaletteValueFilter-C1gWywW_.js +0 -14
- package/dist/createSvgIcon-B0SZlJF1.js +0 -155
- package/dist/createTheme-xB2Em0Na.js +0 -1869
- package/dist/defaultTheme-BaGcIzCh.js +0 -210
- package/dist/elementAcceptingRef-DhkNAkFH.js +0 -472
- package/dist/exactProp-C_IsucXf.js +0 -13
- package/dist/field-label-styles-BOyhp6gw.js +0 -50
- package/dist/formLabelClasses-B0Fa-86T.js +0 -18
- package/dist/generateUtilityClass-PAIOm1jC.js +0 -34
- package/dist/generateUtilityClasses-DvX505Gy.js +0 -10
- package/dist/iconButtonClasses-CkciZuIe.js +0 -27
- package/dist/inputAdornmentClasses-D5yYK5bM.js +0 -19
- package/dist/inputBaseClasses-DuWQGq8Z.js +0 -25
- package/dist/integerPropType-Disnft4a.js +0 -27
- package/dist/isEventHandler-8dPdzK9U.js +0 -7
- package/dist/isFocusVisible-Y7157FQS.js +0 -35
- package/dist/isLayoutSupported-Ceir7nyK.js +0 -21
- package/dist/listItemButtonClasses-DbL-aTVf.js +0 -18
- package/dist/memoTheme-qFyKAk7y.js +0 -15
- package/dist/mergeSlotProps-xl1-PgWL.js +0 -45
- package/dist/monthCalendarClasses-BYVHyEfI.js +0 -14
- package/dist/objectWithoutPropertiesLoose-Cpds-4w8.js +0 -23
- package/dist/outlinedInputClasses-DECY98u0.js +0 -17
- package/dist/pickersCalendarHeaderClasses-CIj0gBye.js +0 -12
- package/dist/prop-types-BzYPyWN7.js +0 -516
- package/dist/resolveProps-7jIA45vn.js +0 -30
- package/dist/s-accordion-B8nlrdFc.js +0 -487
- package/dist/s-carousel-Dnjke4JQ.js +0 -1353
- package/dist/s-chat-input-DCS0mJE4.js +0 -419
- package/dist/s-chat-message-9oollJJq.js +0 -315
- package/dist/s-chips-WqGdqHW9.js +0 -176
- package/dist/s-code-block-DzGoGg5e.js +0 -658
- package/dist/s-comment-message-C6kfgRjv.js +0 -191
- package/dist/s-data-table-B1TGVupB.js +0 -805
- package/dist/s-date-picker-BpX4HmBp.js +0 -656
- package/dist/s-datetime-picker-ByzW44E0.js +0 -3878
- package/dist/s-dialog-BLiyjLkx.js +0 -123
- package/dist/s-file-dropzone-CVQpYRdY.js +0 -422
- package/dist/s-image-viewer-DNIEYdtL.js +0 -269
- package/dist/s-language-switcher-D-1nywT3.js +0 -251
- package/dist/s-link-CAMTGfd9.js +0 -234
- package/dist/s-localization-provider-Xw3NO2uP.js +0 -519
- package/dist/s-nav-items-BUp7DddG.js +0 -327
- package/dist/s-no-ssr-D8tPdDfh.js +0 -25
- package/dist/s-pagination-Dt8Pk5Tp.js +0 -606
- package/dist/s-quantity-input-mYCixlJc.js +0 -246
- package/dist/s-review-DSXXtWlL.js +0 -272
- package/dist/s-select-dwY2DYa9.js +0 -204
- package/dist/s-snackbar-message-3Z6VySlB.js +0 -808
- package/dist/s-switch-B8bZAzLh.js +0 -307
- package/dist/s-text-editor-toolbar-D-XgFQix.js +0 -2121
- package/dist/s-text-field-BM4qk0mf.js +0 -51
- package/dist/s-theme-switch-BLMz1_m2.js +0 -60
- package/dist/s-tip-ty41ePQm.js +0 -62
- package/dist/selectClasses-DoUlWfzV.js +0 -22
- package/dist/styled-Bog8QCl3.js +0 -163
- package/dist/svgIconClasses-C8D4AsMj.js +0 -20
- package/dist/switchClasses-eiq1bkQN.js +0 -23
- package/dist/theme-demo-components-section-gtIYRngY.js +0 -267
- package/dist/toggle-button-Cxi5CfXC.js +0 -104
- package/dist/tool-bar-action-buttons-Dt-pV3GA.js +0 -54
- package/dist/tool-bar-image-input-BXlll_hV.js +0 -148
- package/dist/typographyClasses-BLM3NmYd.js +0 -31
- package/dist/useControlled-BeB0W_Ui.js +0 -5
- package/dist/useControlled-C4QJnpiR.js +0 -29
- package/dist/useEnhancedEffect-Bc3gBClC.js +0 -5
- package/dist/useEnhancedEffect-DFq_FMGX.js +0 -5
- package/dist/useEventCallback-CVqMfiG_.js +0 -14
- package/dist/useForkRef-CKneCEtr.js +0 -29
- package/dist/useFormControl-iWLrn7Ek.js +0 -18
- package/dist/useMobilePicker-C4UQFvkj.js +0 -7580
- package/dist/useSlot-iIu8ek6E.js +0 -83
- package/dist/useTheme-BIWMbX3i.js +0 -9
- package/dist/useThemeProps-BI9yq95N.js +0 -19
- package/dist/useThemeProps-Cr28OQu3.js +0 -13
- package/dist/utils-oJyTAkZY.js +0 -214
- package/dist/warning-CNkSZkq6.js +0 -98
- package/dist/yearCalendarClasses-CuAQumpz.js +0 -14
- /package/dist/{colors-DKqWMRgW.js → colors-CNjL5fhq.js} +0 -0
- /package/dist/{s-brand-logo-jtAJZQIv.js → s-brand-logo-CErW9Slg.js} +0 -0
- /package/dist/{utils-DaSrTYUS.js → utils-CMeAWSRO.js} +0 -0
|
@@ -1,2 +1,201 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { staticFieldLabelStyles as e } from "../theme/components/field-label-styles.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { Box as i, FormControl as a, FormHelperText as o, InputAdornment as s, InputLabel as c, ListSubheader as l, MenuItem as u, Select as ee, TextField as d, styled as f, useThemeProps as te } from "@mui/material";
|
|
5
|
+
import { mergeSlotProps as p } from "@mui/material/utils";
|
|
6
|
+
import ne from "@mui/icons-material/Search";
|
|
7
|
+
//#region lib/s-select/s-select.tsx
|
|
8
|
+
function m(e) {
|
|
9
|
+
return typeof e == "string" || typeof e == "number";
|
|
10
|
+
}
|
|
11
|
+
function h(e, t) {
|
|
12
|
+
return m(e) ? String(e) : String(e[t]);
|
|
13
|
+
}
|
|
14
|
+
function re(e, t) {
|
|
15
|
+
return m(e) ? e : e[t];
|
|
16
|
+
}
|
|
17
|
+
function g(e) {
|
|
18
|
+
return /* @__PURE__ */ n(i, {
|
|
19
|
+
component: "span",
|
|
20
|
+
sx: { color: "text.secondary" },
|
|
21
|
+
children: e
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function _(e, t, n) {
|
|
25
|
+
return e.find((e) => n(e) === t);
|
|
26
|
+
}
|
|
27
|
+
function ie(e, t, n, r, i, a) {
|
|
28
|
+
if (e == null || e === "") return g(r);
|
|
29
|
+
if (t) return String(e);
|
|
30
|
+
let o = _(n, e, a);
|
|
31
|
+
return o ? i(o) : "";
|
|
32
|
+
}
|
|
33
|
+
function ae(e, t, n, r, i, a) {
|
|
34
|
+
return e.length === 0 ? g(r) : t ? e.map(String).join(", ") : e.map((e) => {
|
|
35
|
+
let t = _(n, e, a);
|
|
36
|
+
return t ? i(t) : "";
|
|
37
|
+
}).filter(Boolean).join(", ");
|
|
38
|
+
}
|
|
39
|
+
function oe(e, t, n, r) {
|
|
40
|
+
if (!t || !n) return e;
|
|
41
|
+
let i = n.toLowerCase();
|
|
42
|
+
return e.filter((e) => r(e).toLowerCase().includes(i));
|
|
43
|
+
}
|
|
44
|
+
function v(e, t) {
|
|
45
|
+
return e.reduce((e, n) => {
|
|
46
|
+
let r = String(t(n));
|
|
47
|
+
return e.set(r, (e.get(r) ?? 0) + 1), e;
|
|
48
|
+
}, /* @__PURE__ */ new Map());
|
|
49
|
+
}
|
|
50
|
+
function y(e, t, n, r, i) {
|
|
51
|
+
let a = i?.(e, t);
|
|
52
|
+
if (a !== void 0) return a;
|
|
53
|
+
let o = String(r(e));
|
|
54
|
+
return (n.get(o) ?? 0) > 1 ? `${o}-${t}` : o;
|
|
55
|
+
}
|
|
56
|
+
function b(e, t, r, i, a) {
|
|
57
|
+
let o = v(e, t);
|
|
58
|
+
return e.map((e, s) => {
|
|
59
|
+
let c = t(e), l = y(e, s, o, t, a);
|
|
60
|
+
return /* @__PURE__ */ n(u, {
|
|
61
|
+
disabled: e?.disabled ?? !1,
|
|
62
|
+
value: c,
|
|
63
|
+
children: i ? i(e) : r(e)
|
|
64
|
+
}, l);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function x(e) {
|
|
68
|
+
if (e) return {
|
|
69
|
+
autoFocus: !1,
|
|
70
|
+
slotProps: { paper: { onKeyDown: (e) => {
|
|
71
|
+
e.key !== "Escape" && e.stopPropagation();
|
|
72
|
+
} } }
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function se(e, t) {
|
|
76
|
+
let n = x(e);
|
|
77
|
+
if (!n) return t;
|
|
78
|
+
if (!t) return n;
|
|
79
|
+
let { slotProps: r, slots: i, ...a } = n, { slotProps: o, slots: s, ...c } = t;
|
|
80
|
+
return {
|
|
81
|
+
...a,
|
|
82
|
+
...c,
|
|
83
|
+
slots: {
|
|
84
|
+
...i,
|
|
85
|
+
...s
|
|
86
|
+
},
|
|
87
|
+
slotProps: {
|
|
88
|
+
...r,
|
|
89
|
+
...o,
|
|
90
|
+
paper: p(o?.paper, r?.paper ?? {})
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
var S = f(a, {
|
|
95
|
+
name: "SSelect",
|
|
96
|
+
slot: "Root",
|
|
97
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
98
|
+
})({ ...e });
|
|
99
|
+
function C(e, a) {
|
|
100
|
+
let f = te({
|
|
101
|
+
props: e,
|
|
102
|
+
name: "SSelect"
|
|
103
|
+
}), { options: p = [], getOptionKey: m, optionLabel: g = "name", optionValue: _ = "id", placeholder: v, label: y = "", error: x = !1, helperText: C, required: w = !1, simple: T = !1, searchable: E = !1, searchPlaceholder: ce = "", noResultsText: le = "No results found", renderOption: D, className: O, color: k = "primary", defaultValue: A, disabled: j = !1, displayEmpty: M = !0, fullWidth: N = !0, id: ue, inputProps: P, labelId: F, margin: I = "none", MenuProps: L, onChange: R, onClose: z, onOpen: B, open: V, renderValue: H, size: U = "medium", sx: de, variant: W = "outlined", ...G } = f, [K, q] = t.useState(""), fe = t.useId(), J = ue ?? fe, Y = F ?? `${J}-label`, X = C ? `${J}-helper-text` : void 0, pe = [P?.["aria-describedby"], X].filter(Boolean).join(" ") || void 0, me = G.value === void 0 ? A ?? (G.multiple ? [] : "") : void 0, he = {
|
|
104
|
+
...f,
|
|
105
|
+
color: k,
|
|
106
|
+
disabled: j,
|
|
107
|
+
displayEmpty: M,
|
|
108
|
+
error: x,
|
|
109
|
+
fullWidth: N,
|
|
110
|
+
margin: I,
|
|
111
|
+
required: w,
|
|
112
|
+
searchable: E,
|
|
113
|
+
size: U,
|
|
114
|
+
variant: W
|
|
115
|
+
}, Z = (e) => h(e, g), Q = (e) => re(e, _), $ = oe(p, E, K, Z), ge = (e) => {
|
|
116
|
+
z?.(e), E && q("");
|
|
117
|
+
}, _e = (e) => G.multiple ? ae(Array.isArray(e) ? e : [], T, p, v, Z, Q) : ie(e, T, p, v, Z, Q), ve = () => E ? $.length > 0 ? b($, Q, Z, D, m) : K ? /* @__PURE__ */ n(u, {
|
|
118
|
+
disabled: !0,
|
|
119
|
+
children: /* @__PURE__ */ n(i, {
|
|
120
|
+
sx: {
|
|
121
|
+
color: "text.secondary",
|
|
122
|
+
textAlign: "center",
|
|
123
|
+
width: "100%"
|
|
124
|
+
},
|
|
125
|
+
children: le
|
|
126
|
+
})
|
|
127
|
+
}) : b(p, Q, Z, D, m) : b(p, Q, Z, D, m), ye = se(E, L);
|
|
128
|
+
return /* @__PURE__ */ r(S, {
|
|
129
|
+
className: O,
|
|
130
|
+
color: k,
|
|
131
|
+
disabled: j,
|
|
132
|
+
error: x,
|
|
133
|
+
fullWidth: N,
|
|
134
|
+
margin: I,
|
|
135
|
+
ownerState: he,
|
|
136
|
+
ref: a,
|
|
137
|
+
required: w,
|
|
138
|
+
size: U,
|
|
139
|
+
sx: de,
|
|
140
|
+
variant: W,
|
|
141
|
+
children: [
|
|
142
|
+
y ? /* @__PURE__ */ n(c, {
|
|
143
|
+
id: Y,
|
|
144
|
+
shrink: !!v || M && !!H || void 0,
|
|
145
|
+
children: y
|
|
146
|
+
}) : null,
|
|
147
|
+
/* @__PURE__ */ r(ee, {
|
|
148
|
+
...G,
|
|
149
|
+
defaultValue: me,
|
|
150
|
+
id: J,
|
|
151
|
+
label: y,
|
|
152
|
+
labelId: y ? Y : F,
|
|
153
|
+
displayEmpty: M,
|
|
154
|
+
inputProps: {
|
|
155
|
+
...P,
|
|
156
|
+
"aria-describedby": pe
|
|
157
|
+
},
|
|
158
|
+
open: V,
|
|
159
|
+
onOpen: B,
|
|
160
|
+
onClose: ge,
|
|
161
|
+
MenuProps: ye,
|
|
162
|
+
onChange: R,
|
|
163
|
+
renderValue: H ?? _e,
|
|
164
|
+
variant: W,
|
|
165
|
+
children: [E && /* @__PURE__ */ n(l, {
|
|
166
|
+
sx: {
|
|
167
|
+
px: 2,
|
|
168
|
+
py: 1,
|
|
169
|
+
position: "sticky",
|
|
170
|
+
top: 0,
|
|
171
|
+
bgcolor: "background.paper",
|
|
172
|
+
zIndex: 1
|
|
173
|
+
},
|
|
174
|
+
children: /* @__PURE__ */ n(d, {
|
|
175
|
+
fullWidth: !0,
|
|
176
|
+
autoFocus: !0,
|
|
177
|
+
placeholder: ce,
|
|
178
|
+
value: K,
|
|
179
|
+
onChange: (e) => q(e.target.value),
|
|
180
|
+
onKeyDown: (e) => {
|
|
181
|
+
e.key !== "Escape" && e.stopPropagation();
|
|
182
|
+
},
|
|
183
|
+
onClick: (e) => e.stopPropagation(),
|
|
184
|
+
slotProps: { input: { startAdornment: /* @__PURE__ */ n(s, {
|
|
185
|
+
position: "start",
|
|
186
|
+
children: /* @__PURE__ */ n(ne, {})
|
|
187
|
+
}) } }
|
|
188
|
+
})
|
|
189
|
+
}), ve()]
|
|
190
|
+
}),
|
|
191
|
+
C ? /* @__PURE__ */ n(o, {
|
|
192
|
+
id: X,
|
|
193
|
+
children: C
|
|
194
|
+
}) : null
|
|
195
|
+
]
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
var w = t.forwardRef(C);
|
|
199
|
+
w.displayName = "SSelect";
|
|
200
|
+
//#endregion
|
|
201
|
+
export { w as SSelect, w as default };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { resolveOwnerStateSlotProps as e } from "../utils/slots.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import { createElement as s } from "react";
|
|
9
|
-
import { jsx as c } from "react/jsx-runtime";
|
|
10
|
-
import { Box as l, Collapse as u, FormControlLabel as d, Radio as f, RadioGroup as p, formControlLabelClasses as m, styled as h, useThemeProps as g } from "@mui/material";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { createElement as n } from "react";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { Box as i, Collapse as a, FormControlLabel as o, Radio as s, RadioGroup as c, formControlLabelClasses as l, styled as u, useThemeProps as d } from "@mui/material";
|
|
6
|
+
import { mergeSlotProps as f, useControlled as p, useEventCallback as m, useForkRef as h } from "@mui/material/utils";
|
|
7
|
+
import g from "@mui/utils/appendOwnerState";
|
|
11
8
|
import { visuallyHidden as _ } from "@mui/utils";
|
|
12
9
|
//#region lib/s-select-list/s-select-list.tsx
|
|
13
10
|
var v = [
|
|
@@ -30,11 +27,11 @@ function x(e, t) {
|
|
|
30
27
|
delete n[e];
|
|
31
28
|
}), n;
|
|
32
29
|
}
|
|
33
|
-
var S =
|
|
30
|
+
var S = u(c, {
|
|
34
31
|
name: "SSelectList",
|
|
35
32
|
slot: "Root",
|
|
36
33
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
37
|
-
})(({ theme: e }) => ({ gap: e.spacing(1) })), C =
|
|
34
|
+
})(({ theme: e }) => ({ gap: e.spacing(1) })), C = u(i, {
|
|
38
35
|
name: "SSelectList",
|
|
39
36
|
slot: "Option",
|
|
40
37
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
@@ -48,7 +45,7 @@ var S = h(p, {
|
|
|
48
45
|
width: 0
|
|
49
46
|
}
|
|
50
47
|
}]
|
|
51
|
-
}), w =
|
|
48
|
+
}), w = u(o, {
|
|
52
49
|
name: "SSelectList",
|
|
53
50
|
slot: "Item",
|
|
54
51
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
@@ -60,7 +57,7 @@ var S = h(p, {
|
|
|
60
57
|
margin: 0,
|
|
61
58
|
padding: e.spacing(1, 2),
|
|
62
59
|
width: "100%",
|
|
63
|
-
[`&.${
|
|
60
|
+
[`&.${l.disabled}`]: { color: (e.vars ?? e).palette.text.disabled },
|
|
64
61
|
variants: [{
|
|
65
62
|
props: ({ ownerState: e }) => e.selected,
|
|
66
63
|
style: { borderColor: (e.vars ?? e).palette.primary.dark }
|
|
@@ -71,7 +68,7 @@ var S = h(p, {
|
|
|
71
68
|
outlineOffset: 2
|
|
72
69
|
} }
|
|
73
70
|
}]
|
|
74
|
-
})), T =
|
|
71
|
+
})), T = u("span", {
|
|
75
72
|
name: "SSelectList",
|
|
76
73
|
slot: "Label",
|
|
77
74
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
@@ -79,18 +76,18 @@ var S = h(p, {
|
|
|
79
76
|
display: "block",
|
|
80
77
|
flex: 1,
|
|
81
78
|
minWidth: 0
|
|
82
|
-
}), E =
|
|
79
|
+
}), E = u(s, {
|
|
83
80
|
name: "SSelectList",
|
|
84
81
|
slot: "Radio",
|
|
85
82
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
86
83
|
})({ variants: [{
|
|
87
84
|
props: ({ ownerState: e }) => !e.showRadio,
|
|
88
85
|
style: b
|
|
89
|
-
}] }), D =
|
|
86
|
+
}] }), D = u(a, {
|
|
90
87
|
name: "SSelectList",
|
|
91
88
|
slot: "Transition",
|
|
92
89
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
93
|
-
})({}), O =
|
|
90
|
+
})({}), O = u(i, {
|
|
94
91
|
name: "SSelectList",
|
|
95
92
|
slot: "Details",
|
|
96
93
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
@@ -99,64 +96,64 @@ var S = h(p, {
|
|
|
99
96
|
marginTop: e.spacing(1),
|
|
100
97
|
width: "100%"
|
|
101
98
|
}));
|
|
102
|
-
function k(
|
|
103
|
-
let
|
|
104
|
-
props:
|
|
99
|
+
function k(t, i) {
|
|
100
|
+
let a = d({
|
|
101
|
+
props: t,
|
|
105
102
|
name: "SSelectList"
|
|
106
|
-
}), { defaultValue:
|
|
103
|
+
}), { defaultValue: o, items: s, onChange: c, renderBelow: l, renderItem: u, showRadio: _ = !0, slotProps: b, slots: k, value: A, ...j } = a, [M, N] = p({
|
|
107
104
|
controlled: A,
|
|
108
|
-
default:
|
|
105
|
+
default: o ?? "",
|
|
109
106
|
name: "SSelectList",
|
|
110
107
|
state: "value"
|
|
111
108
|
}), P = {
|
|
112
|
-
...
|
|
109
|
+
...a,
|
|
113
110
|
showRadio: _,
|
|
114
111
|
value: M
|
|
115
|
-
}, F = k?.root ?? S, I = k?.option ?? C, L = k?.item ?? w, R = k?.label ?? T, z = k?.radio ?? E, B = k?.transition ?? D, V = k?.details ?? O, H =
|
|
116
|
-
N(t),
|
|
117
|
-
}), { ref: U, ...W } =
|
|
112
|
+
}, F = k?.root ?? S, I = k?.option ?? C, L = k?.item ?? w, R = k?.label ?? T, z = k?.radio ?? E, B = k?.transition ?? D, V = k?.details ?? O, H = m((e, t) => {
|
|
113
|
+
N(t), c?.(e, t);
|
|
114
|
+
}), { ref: U, ...W } = g(F, f(e(b?.root, P), {
|
|
118
115
|
...j,
|
|
119
116
|
onChange: H,
|
|
120
117
|
value: M
|
|
121
|
-
}), P), G =
|
|
122
|
-
return /* @__PURE__ */
|
|
118
|
+
}), P), G = h(U, i);
|
|
119
|
+
return /* @__PURE__ */ r(F, {
|
|
123
120
|
...W,
|
|
124
121
|
ref: G,
|
|
125
|
-
children:
|
|
126
|
-
let
|
|
122
|
+
children: s.map((t) => {
|
|
123
|
+
let i = t.id === M, a = {
|
|
127
124
|
...P,
|
|
128
125
|
item: t,
|
|
129
|
-
selected:
|
|
130
|
-
}, o = e(b?.option,
|
|
126
|
+
selected: i
|
|
127
|
+
}, o = e(b?.option, a), s = e(b?.item, a), c = e(b?.label, a), d = e(b?.radio, a), p = e(b?.transition, a) ?? {}, m = g(I, o ?? {}, a), h = g(L, x(f(s, {
|
|
131
128
|
disableTypography: !0,
|
|
132
129
|
labelPlacement: "start"
|
|
133
|
-
}), v),
|
|
134
|
-
return /* @__PURE__ */
|
|
135
|
-
...
|
|
130
|
+
}), v), a), _ = g(R, c ?? {}, a), S = g(z, x(d, y), a);
|
|
131
|
+
return /* @__PURE__ */ n(I, {
|
|
132
|
+
...m,
|
|
136
133
|
key: t.id
|
|
137
|
-
}, /* @__PURE__ */
|
|
138
|
-
...
|
|
139
|
-
control: /* @__PURE__ */
|
|
140
|
-
label: /* @__PURE__ */
|
|
134
|
+
}, /* @__PURE__ */ r(L, {
|
|
135
|
+
...h,
|
|
136
|
+
control: /* @__PURE__ */ r(z, { ...S }),
|
|
137
|
+
label: /* @__PURE__ */ r(R, {
|
|
141
138
|
..._,
|
|
142
|
-
children:
|
|
139
|
+
children: u(t, i)
|
|
143
140
|
}),
|
|
144
141
|
value: t.id
|
|
145
|
-
}),
|
|
146
|
-
...
|
|
147
|
-
...
|
|
148
|
-
unmountOnExit:
|
|
149
|
-
},
|
|
150
|
-
in:
|
|
151
|
-
children: /* @__PURE__ */
|
|
152
|
-
...
|
|
153
|
-
children:
|
|
142
|
+
}), l ? /* @__PURE__ */ r(B, {
|
|
143
|
+
...g(B, {
|
|
144
|
+
...p,
|
|
145
|
+
unmountOnExit: p.unmountOnExit ?? !0
|
|
146
|
+
}, a),
|
|
147
|
+
in: i,
|
|
148
|
+
children: /* @__PURE__ */ r(V, {
|
|
149
|
+
...g(V, e(b?.details, a) ?? {}, a),
|
|
150
|
+
children: l(t)
|
|
154
151
|
})
|
|
155
152
|
}) : null);
|
|
156
153
|
})
|
|
157
154
|
});
|
|
158
155
|
}
|
|
159
|
-
var A =
|
|
156
|
+
var A = t.forwardRef(k);
|
|
160
157
|
A.displayName = "SSelectList";
|
|
161
158
|
//#endregion
|
|
162
159
|
export { A as SSelectList, A as default };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
1
|
+
import { styled as e, useThemeProps as t } from "@mui/material/styles";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import i from "@mui/material/Skeleton";
|
|
6
5
|
//#region lib/s-skeleton/s-skeleton.tsx
|
|
7
6
|
var a = {
|
|
8
7
|
avatar: {
|
|
@@ -25,41 +24,41 @@ var a = {
|
|
|
25
24
|
variant: "rounded",
|
|
26
25
|
width: 32
|
|
27
26
|
}
|
|
28
|
-
}, o = e(
|
|
27
|
+
}, o = e(i, {
|
|
29
28
|
name: "SSkeleton",
|
|
30
29
|
slot: "Root"
|
|
31
30
|
})(({ ownerState: e, theme: t }) => ({
|
|
32
31
|
...e.preset === "checkbox" && { borderRadius: t.radius.sm },
|
|
33
32
|
...e.variant === "text" && e.fontSize != null && { fontSize: e.fontSize }
|
|
34
|
-
})), s =
|
|
35
|
-
let
|
|
33
|
+
})), s = n.forwardRef(function(e, n) {
|
|
34
|
+
let i = t({
|
|
36
35
|
props: e,
|
|
37
36
|
name: "SSkeleton"
|
|
38
37
|
});
|
|
39
|
-
if (
|
|
40
|
-
let { preset: e, ...
|
|
41
|
-
animation:
|
|
38
|
+
if (i.preset) {
|
|
39
|
+
let { preset: e, ...t } = i, s = a[e], c = {
|
|
40
|
+
animation: t.animation,
|
|
42
41
|
preset: e,
|
|
43
42
|
variant: s.variant
|
|
44
43
|
};
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
...
|
|
44
|
+
return /* @__PURE__ */ r(o, {
|
|
45
|
+
...t,
|
|
47
46
|
height: s.height,
|
|
48
47
|
ownerState: c,
|
|
49
|
-
ref:
|
|
48
|
+
ref: n,
|
|
50
49
|
variant: s.variant,
|
|
51
50
|
width: s.width
|
|
52
51
|
});
|
|
53
52
|
}
|
|
54
|
-
let { fontSize: s, variant: c = "text", ...l } =
|
|
53
|
+
let { fontSize: s, variant: c = "text", ...l } = i, u = {
|
|
55
54
|
animation: l.animation,
|
|
56
55
|
fontSize: s,
|
|
57
56
|
variant: c
|
|
58
57
|
};
|
|
59
|
-
return /* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */ r(o, {
|
|
60
59
|
...l,
|
|
61
60
|
ownerState: u,
|
|
62
|
-
ref:
|
|
61
|
+
ref: n,
|
|
63
62
|
variant: c
|
|
64
63
|
});
|
|
65
64
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { SSnackbarMessage as e, SnackbarMessageProvider as t, useSnackbarMessage as n } from "./s-snackbar-message.js";
|
|
2
|
+
export { e as SSnackbarMessage, e as default, t as SnackbarMessageProvider, n as useSnackbarMessage };
|
|
@@ -1,2 +1,89 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { toSxArray as e } from "../utils/sx.js";
|
|
2
|
+
import { styled as t, useThemeProps as n } from "@mui/material/styles";
|
|
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 s from "@mui/utils/appendOwnerState";
|
|
7
|
+
import c from "@mui/material/Alert";
|
|
8
|
+
import l from "@mui/material/Snackbar";
|
|
9
|
+
//#region lib/s-snackbar-message/s-snackbar-message.tsx
|
|
10
|
+
var u = t(l, {
|
|
11
|
+
name: "SSnackbarMessage",
|
|
12
|
+
slot: "Root",
|
|
13
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
14
|
+
})({});
|
|
15
|
+
function d(e, t) {
|
|
16
|
+
return typeof e == "function" ? e(t) : e;
|
|
17
|
+
}
|
|
18
|
+
var f = r.forwardRef(function(t, r) {
|
|
19
|
+
let i = n({
|
|
20
|
+
props: t,
|
|
21
|
+
name: "SSnackbarMessage"
|
|
22
|
+
}), { anchorOrigin: o = {
|
|
23
|
+
vertical: "top",
|
|
24
|
+
horizontal: "center"
|
|
25
|
+
}, autoHideDuration: l = 1e4, message: f, onClose: p, onCloseButtonClick: m, open: h = !1, severity: g = "info", slotProps: _, slots: v, ...y } = i, b = {
|
|
26
|
+
...i,
|
|
27
|
+
open: h,
|
|
28
|
+
severity: g
|
|
29
|
+
}, { alert: x, ...S } = v ?? {}, { alert: C, ...w } = _ ?? {}, T = x ?? c, { onClose: E, sx: D, ...O } = d(C, b) ?? {}, k = s(x, O, b), A = (e) => {
|
|
30
|
+
m?.(e), !e.defaultPrevented && E?.(e);
|
|
31
|
+
};
|
|
32
|
+
return /* @__PURE__ */ a(u, {
|
|
33
|
+
...y,
|
|
34
|
+
anchorOrigin: o,
|
|
35
|
+
autoHideDuration: l,
|
|
36
|
+
onClose: p,
|
|
37
|
+
open: h,
|
|
38
|
+
ownerState: b,
|
|
39
|
+
ref: r,
|
|
40
|
+
slots: S,
|
|
41
|
+
slotProps: w,
|
|
42
|
+
children: /* @__PURE__ */ a(T, {
|
|
43
|
+
...k,
|
|
44
|
+
onClose: m || E ? A : void 0,
|
|
45
|
+
severity: g,
|
|
46
|
+
sx: [{
|
|
47
|
+
width: "100%",
|
|
48
|
+
"& .MuiAlert-action": { justifyContent: "center" }
|
|
49
|
+
}, ...e(D)],
|
|
50
|
+
children: f
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
f.displayName = "SSnackbarMessage";
|
|
55
|
+
var p = r.createContext(null);
|
|
56
|
+
function m({ children: e }) {
|
|
57
|
+
let [t, n] = r.useState(null), [a, s] = r.useState(0), c = r.useCallback(() => n(null), []), l = r.useCallback((e) => {
|
|
58
|
+
s((e) => e + 1), n(e);
|
|
59
|
+
}, []), u = r.useMemo(() => ({
|
|
60
|
+
closeSnackbar: c,
|
|
61
|
+
open: t != null,
|
|
62
|
+
showSnackbar: l
|
|
63
|
+
}), [
|
|
64
|
+
c,
|
|
65
|
+
t,
|
|
66
|
+
l
|
|
67
|
+
]), { onClose: d, onCloseButtonClick: m, ...h } = t ?? {}, g = h, _ = r.useCallback((e, t) => {
|
|
68
|
+
d?.(e, t), e?.defaultPrevented || c();
|
|
69
|
+
}, [c, d]), v = r.useCallback((e) => {
|
|
70
|
+
m?.(e), e.defaultPrevented || c();
|
|
71
|
+
}, [c, m]);
|
|
72
|
+
return /* @__PURE__ */ o(p.Provider, {
|
|
73
|
+
value: u,
|
|
74
|
+
children: [t ? /* @__PURE__ */ i(f, {
|
|
75
|
+
...g,
|
|
76
|
+
key: a,
|
|
77
|
+
open: !0,
|
|
78
|
+
onClose: _,
|
|
79
|
+
onCloseButtonClick: v
|
|
80
|
+
}) : null, e]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function h() {
|
|
84
|
+
let e = r.useContext(p);
|
|
85
|
+
if (!e) throw Error("useSnackbarMessage must be used within a SnackbarMessageProvider");
|
|
86
|
+
return e;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { f as SSnackbarMessage, f as default, m as SnackbarMessageProvider, h as useSnackbarMessage };
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { isValidCanvasColor as e, resolveCanvasColor as t } from "../utils/canvas-color.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { styled as i, useColorScheme as a, useMediaQuery as o, useTheme as s, useThemeProps as c } from "@mui/material";
|
|
5
|
+
import { useForkRef as l } from "@mui/material/utils";
|
|
6
6
|
//#region lib/s-spotlight-cursor/s-spotlight-cursor.tsx
|
|
7
|
-
var u = 200, d = .15, f = .1, p = .01, m = ({ brightness:
|
|
8
|
-
let u =
|
|
9
|
-
return
|
|
10
|
-
let
|
|
11
|
-
if (!
|
|
12
|
-
let a =
|
|
7
|
+
var u = 200, d = .15, f = .1, p = .01, m = ({ brightness: r, color: i, colorScheme: a, followSpeed: o, radius: s, reducedMotion: c, theme: l }) => {
|
|
8
|
+
let u = n.useRef(null);
|
|
9
|
+
return n.useEffect(() => {
|
|
10
|
+
let n = u.current;
|
|
11
|
+
if (!n) return;
|
|
12
|
+
let a = n.getContext("2d");
|
|
13
13
|
if (!a) return;
|
|
14
|
-
let d = null, f = 0, p = 0, m = null, h = null, g = null, _ = null, v =
|
|
14
|
+
let d = null, f = 0, p = 0, m = null, h = null, g = null, _ = null, v = n.parentElement ?? n, y = (l.vars ?? l).palette.primary.main, b = t(i, n, l), x = t(y, n), S = e(a, b) ? b : e(a, x) ? x : "#000000", C = () => {
|
|
15
15
|
if (d = null, a.clearRect(0, 0, f, p), m == null || h == null) return;
|
|
16
16
|
g == null || _ == null || c ? (g = m, _ = h) : (g += (m - g) * o, _ += (h - _) * o);
|
|
17
17
|
let e = a.createRadialGradient(g, _, 0, g, _, s);
|
|
18
|
-
e.addColorStop(0, S), e.addColorStop(1, "transparent"), a.save(), a.globalAlpha =
|
|
19
|
-
let t = Math.abs(m - g),
|
|
20
|
-
!c && (t > .1 ||
|
|
18
|
+
e.addColorStop(0, S), e.addColorStop(1, "transparent"), a.save(), a.globalAlpha = r, a.fillStyle = e, a.fillRect(0, 0, f, p), a.restore();
|
|
19
|
+
let t = Math.abs(m - g), n = Math.abs(h - _);
|
|
20
|
+
!c && (t > .1 || n > .1) && (d = requestAnimationFrame(C));
|
|
21
21
|
}, w = () => {
|
|
22
22
|
d ??= requestAnimationFrame(C);
|
|
23
23
|
}, T = () => {
|
|
24
|
-
let e =
|
|
24
|
+
let e = n.getBoundingClientRect();
|
|
25
25
|
if (e.width === 0 || e.height === 0) return;
|
|
26
26
|
let t = window.devicePixelRatio || 1;
|
|
27
|
-
f = e.width, p = e.height,
|
|
27
|
+
f = e.width, p = e.height, n.width = Math.max(1, Math.round(f * t)), n.height = Math.max(1, Math.round(p * t)), a.setTransform(t, 0, 0, t, 0, 0), w();
|
|
28
28
|
}, E = (e) => {
|
|
29
|
-
let t =
|
|
30
|
-
if (
|
|
29
|
+
let t = n.getBoundingClientRect(), r = e.clientX - t.left, i = e.clientY - t.top;
|
|
30
|
+
if (r < 0 || r > t.width || i < 0 || i > t.height) {
|
|
31
31
|
m = null, h = null, g = null, _ = null, w();
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
m =
|
|
34
|
+
m = r, h = i, g ??= r, _ ??= i, w();
|
|
35
35
|
}, D = () => {
|
|
36
36
|
m = null, h = null, g = null, _ = null, w();
|
|
37
37
|
};
|
|
38
38
|
T();
|
|
39
39
|
let O = new ResizeObserver(T);
|
|
40
|
-
return O.observe(
|
|
40
|
+
return O.observe(n), v.addEventListener("pointermove", E, { passive: !0 }), v.addEventListener("pointerleave", D), () => {
|
|
41
41
|
O.disconnect(), v.removeEventListener("pointermove", E), v.removeEventListener("pointerleave", D), d != null && cancelAnimationFrame(d);
|
|
42
42
|
};
|
|
43
43
|
}, [
|
|
44
|
-
|
|
44
|
+
r,
|
|
45
45
|
i,
|
|
46
46
|
a,
|
|
47
47
|
o,
|
|
@@ -49,7 +49,7 @@ var u = 200, d = .15, f = .1, p = .01, m = ({ brightness: n, color: i, colorSche
|
|
|
49
49
|
c,
|
|
50
50
|
l
|
|
51
51
|
]), u;
|
|
52
|
-
}, h =
|
|
52
|
+
}, h = i("canvas", {
|
|
53
53
|
name: "SSpotlightCursor",
|
|
54
54
|
slot: "Root"
|
|
55
55
|
})({
|
|
@@ -60,18 +60,18 @@ var u = 200, d = .15, f = .1, p = .01, m = ({ brightness: n, color: i, colorSche
|
|
|
60
60
|
zIndex: 0,
|
|
61
61
|
width: "100%",
|
|
62
62
|
height: "100%"
|
|
63
|
-
}), g =
|
|
64
|
-
let
|
|
63
|
+
}), g = n.forwardRef(function(e, t) {
|
|
64
|
+
let n = c({
|
|
65
65
|
props: e,
|
|
66
66
|
name: "SSpotlightCursor"
|
|
67
|
-
}),
|
|
67
|
+
}), i = s(), { mode: g, systemMode: _ } = a(), { brightness: v = d, color: y = "primary", followSpeed: b = f, radius: x = u, ...S } = n, C = Number.isFinite(v) ? Math.min(1, Math.max(0, v)) : d, w = Number.isFinite(b) ? Math.min(1, Math.max(p, b)) : f, T = Number.isFinite(x) && x > 0 ? x : u, E = o("(prefers-reduced-motion: reduce)", { noSsr: !0 }), D = l(m({
|
|
68
68
|
brightness: C,
|
|
69
69
|
color: y,
|
|
70
70
|
colorScheme: g === "system" ? _ : g,
|
|
71
71
|
followSpeed: w,
|
|
72
72
|
radius: T,
|
|
73
73
|
reducedMotion: E,
|
|
74
|
-
theme:
|
|
74
|
+
theme: i
|
|
75
75
|
}), t), O = {
|
|
76
76
|
brightness: C,
|
|
77
77
|
color: y,
|
|
@@ -79,7 +79,7 @@ var u = 200, d = .15, f = .1, p = .01, m = ({ brightness: n, color: i, colorSche
|
|
|
79
79
|
radius: T,
|
|
80
80
|
reducedMotion: E
|
|
81
81
|
};
|
|
82
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ r(h, {
|
|
83
83
|
...S,
|
|
84
84
|
"aria-hidden": "true",
|
|
85
85
|
ownerState: O,
|