@solostylist/ui-kit 2.0.1 → 2.0.3
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/s-animated-gradient-text/index.d.ts +2 -0
- package/dist/s-animated-gradient-text/index.js +2 -0
- package/dist/s-animated-gradient-text/s-animated-gradient-text.d.ts +64 -0
- package/dist/s-animated-gradient-text/s-animated-gradient-text.js +92 -0
- package/dist/s-announcement-bar/index.d.ts +2 -0
- package/dist/s-announcement-bar/index.js +2 -0
- package/dist/s-announcement-bar/s-announcement-bar.d.ts +113 -0
- package/dist/s-announcement-bar/s-announcement-bar.js +272 -0
- package/dist/s-carousel/s-carousel.d.ts +2 -0
- package/dist/s-carousel/s-carousel.js +52 -50
- package/dist/s-date-picker/s-date-picker.js +1 -1
- package/dist/s-datetime-picker/s-datetime-picker.js +1 -1
- package/dist/s-drawer/index.d.ts +3 -0
- package/dist/s-drawer/index.js +2 -0
- package/dist/s-drawer/s-drawer.d.ts +70 -0
- package/dist/s-drawer/s-drawer.js +139 -0
- package/dist/s-gradient-blob-pulse/index.d.ts +2 -0
- package/dist/s-gradient-blob-pulse/index.js +2 -0
- package/dist/s-gradient-blob-pulse/s-gradient-blob-pulse.d.ts +62 -0
- package/dist/s-gradient-blob-pulse/s-gradient-blob-pulse.js +236 -0
- package/dist/s-gradient-icon/index.d.ts +1 -1
- package/dist/s-gradient-icon/s-gradient-icon.d.ts +4 -4
- package/dist/s-gradient-icon/s-gradient-icon.js +2 -2
- package/dist/s-icon-button/s-icon-button.d.ts +6 -2
- package/dist/s-interactive-card/index.d.ts +3 -0
- package/dist/s-interactive-card/index.js +2 -0
- package/dist/s-interactive-card/s-interactive-card.d.ts +57 -0
- package/dist/s-interactive-card/s-interactive-card.js +150 -0
- package/dist/s-language-switcher/s-language-switcher.js +66 -71
- package/dist/s-list-action-item/index.d.ts +2 -0
- package/dist/s-list-action-item/index.js +2 -0
- package/dist/s-list-action-item/s-list-action-item.d.ts +89 -0
- package/dist/s-list-action-item/s-list-action-item.js +149 -0
- package/dist/s-mega-menu/index.d.ts +3 -0
- package/dist/s-mega-menu/index.js +2 -0
- package/dist/s-mega-menu/mega-menu-panel.d.ts +38 -0
- package/dist/s-mega-menu/mega-menu-panel.js +251 -0
- package/dist/s-mega-menu/mega-menu-slots.d.ts +65 -0
- package/dist/s-mega-menu/mega-menu-slots.js +232 -0
- package/dist/s-mega-menu/mega-menu-trigger.d.ts +35 -0
- package/dist/s-mega-menu/mega-menu-trigger.js +49 -0
- package/dist/s-mega-menu/s-mega-menu.d.ts +23 -0
- package/dist/s-mega-menu/s-mega-menu.js +225 -0
- package/dist/s-mega-menu/types.d.ts +188 -0
- package/dist/s-mega-menu/types.js +0 -0
- package/dist/s-mega-menu/utils.d.ts +51 -0
- package/dist/s-mega-menu/utils.js +51 -0
- package/dist/s-mobile-dock/index.d.ts +3 -0
- package/dist/s-mobile-dock/index.js +2 -0
- package/dist/s-mobile-dock/s-mobile-dock.d.ts +96 -0
- package/dist/s-mobile-dock/s-mobile-dock.js +145 -0
- package/dist/s-nav-item/index.d.ts +1 -1
- package/dist/s-nav-item/s-nav-item.d.ts +35 -16
- package/dist/s-nav-item/s-nav-item.js +55 -77
- package/dist/s-nav-items/s-nav-items.js +68 -112
- package/dist/s-number-range/index.d.ts +3 -0
- package/dist/s-number-range/index.js +2 -0
- package/dist/s-number-range/s-number-range.d.ts +109 -0
- package/dist/s-number-range/s-number-range.js +250 -0
- package/dist/s-popover/index.d.ts +5 -0
- package/dist/s-popover/index.js +3 -0
- package/dist/s-popover/placement.d.ts +14 -0
- package/dist/s-popover/placement.js +65 -0
- package/dist/s-popover/s-popover-content.d.ts +22 -0
- package/dist/s-popover/s-popover-content.js +21 -0
- package/dist/s-popover/s-popover.d.ts +59 -0
- package/dist/s-popover/s-popover.js +66 -0
- package/dist/s-product-card/index.d.ts +3 -0
- package/dist/s-product-card/index.js +2 -0
- package/dist/s-product-card/s-product-card.d.ts +216 -0
- package/dist/s-product-card/s-product-card.js +499 -0
- package/dist/s-product-gallery/index.d.ts +3 -0
- package/dist/s-product-gallery/index.js +2 -0
- package/dist/s-product-gallery/s-product-gallery.d.ts +116 -0
- package/dist/s-product-gallery/s-product-gallery.js +427 -0
- package/dist/s-scroll-to-top/s-scroll-to-top.d.ts +1 -1
- package/dist/s-segmented-control/index.d.ts +3 -0
- package/dist/s-segmented-control/index.js +2 -0
- package/dist/s-segmented-control/s-segmented-control.d.ts +94 -0
- package/dist/s-segmented-control/s-segmented-control.js +298 -0
- package/dist/s-stepper/index.d.ts +3 -0
- package/dist/s-stepper/index.js +2 -0
- package/dist/s-stepper/s-stepper.d.ts +90 -0
- package/dist/s-stepper/s-stepper.js +102 -0
- package/dist/s-swatch/index.d.ts +3 -0
- package/dist/s-swatch/index.js +2 -0
- package/dist/s-swatch/s-swatch.d.ts +235 -0
- package/dist/s-swatch/s-swatch.js +218 -0
- package/dist/s-text-editor/s-text-editor-toolbar.js +105 -108
- package/dist/s-tool-item/s-tool-item.d.ts +10 -6
- package/dist/s-tool-item/s-tool-item.js +12 -12
- package/dist/theme/component-augmentation.d.ts +65 -1
- package/dist/theme/components/drawer.d.ts +1 -0
- package/dist/theme/components/drawer.js +4 -1
- package/dist/theme/components/slider.js +18 -1
- package/dist/theme/components/step-connector.d.ts +0 -3
- package/dist/theme/components/step-connector.js +1 -6
- package/dist/theme/components/step-icon.d.ts +3 -12
- package/dist/theme/components/step-icon.js +3 -14
- package/package.json +7 -2
- package/dist/theme/components/components.d.ts +0 -2
- package/dist/theme/components/slider.d.ts +0 -34
|
@@ -4,11 +4,11 @@ import * as n from "react";
|
|
|
4
4
|
import { Children as r, forwardRef as i, useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
|
|
5
5
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
6
6
|
import { ArrowBackIosNew as f, ArrowForwardIos as p } from "@mui/icons-material";
|
|
7
|
-
import { Box as m, styled as h, useTheme as g, useThemeProps as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
7
|
+
import { Box as m, styled as h, useTheme as g, useThemeProps as _ } from "@mui/material";
|
|
8
|
+
import v from "embla-carousel-autoplay";
|
|
9
|
+
import y from "embla-carousel-react";
|
|
10
10
|
//#region lib/s-carousel/s-carousel.tsx
|
|
11
|
-
var
|
|
11
|
+
var b = h(m, {
|
|
12
12
|
name: "SCarousel",
|
|
13
13
|
slot: "Root"
|
|
14
14
|
})({
|
|
@@ -32,18 +32,18 @@ var y = h(m, {
|
|
|
32
32
|
opacity: 1,
|
|
33
33
|
pointerEvents: "auto"
|
|
34
34
|
}
|
|
35
|
-
}),
|
|
35
|
+
}), x = h("div", { shouldForwardProp: (e) => e !== "centerPadding" && e !== "sx" })(({ centerPadding: e }) => ({
|
|
36
36
|
overflow: "hidden",
|
|
37
37
|
...e && { padding: `0 ${e}` }
|
|
38
|
-
})),
|
|
38
|
+
})), ee = h("div")({
|
|
39
39
|
display: "flex",
|
|
40
40
|
touchAction: "pan-y pinch-zoom"
|
|
41
|
-
}),
|
|
41
|
+
}), te = h("div", { shouldForwardProp: (e) => e !== "slidesToShow" && e !== "spaceBetween" })(({ slidesToShow: e, spaceBetween: t }) => ({
|
|
42
42
|
flex: `0 0 calc(100% / ${e})`,
|
|
43
43
|
minWidth: 0,
|
|
44
44
|
paddingInline: `${t / 2}px`,
|
|
45
45
|
boxSizing: "border-box"
|
|
46
|
-
})),
|
|
46
|
+
})), ne = h("ul")(({ theme: e }) => ({
|
|
47
47
|
gap: 6,
|
|
48
48
|
zIndex: 1,
|
|
49
49
|
margin: 0,
|
|
@@ -64,7 +64,7 @@ var y = h(m, {
|
|
|
64
64
|
"&.active span": { opacity: 1 },
|
|
65
65
|
"&.active": { width: 18 }
|
|
66
66
|
}
|
|
67
|
-
})),
|
|
67
|
+
})), re = h("span", { shouldForwardProp: (e) => e !== "dotColor" })(({ dotColor: e, theme: t }) => ({
|
|
68
68
|
width: "100%",
|
|
69
69
|
height: "100%",
|
|
70
70
|
borderRadius: t.radius.full,
|
|
@@ -73,10 +73,10 @@ var y = h(m, {
|
|
|
73
73
|
backgroundColor: e ?? (t.vars ?? t).palette.primary.main,
|
|
74
74
|
opacity: .35
|
|
75
75
|
}));
|
|
76
|
-
function
|
|
76
|
+
function ie(e, t) {
|
|
77
77
|
return typeof e == "string" || typeof e == "number" ? e : e && typeof e == "object" && "key" in e && e.key != null ? e.key : `slide-${t + 1}`;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function ae(e, t) {
|
|
80
80
|
let [n, r] = c(e);
|
|
81
81
|
return o(() => {
|
|
82
82
|
function n() {
|
|
@@ -95,84 +95,86 @@ function x(e, t) {
|
|
|
95
95
|
}, [e, t]), n;
|
|
96
96
|
}
|
|
97
97
|
var S = i(function(i, h) {
|
|
98
|
-
let S =
|
|
98
|
+
let S = _({
|
|
99
99
|
props: i,
|
|
100
100
|
name: "SCarousel"
|
|
101
|
-
}), { apiRef: C, children: w, dotColor: T, dots: E = !1, arrows: D = !0, slidesToShow: O = 4, spaceBetween: k = 4, autoplay: A = !1, autoplaySpeed: j = 3e3, infinite: M = !0, speed: N = 500, centerMode: P = !1, centerPadding: F = "60px", responsive: I, slotProps: L, sx:
|
|
101
|
+
}), { apiRef: C, children: w, dotColor: T, dots: E = !1, arrows: D = !0, slidesToShow: O = 4, spaceBetween: k = 4, autoplay: A = !1, autoplaySpeed: j = 3e3, infinite: M = !0, speed: N = 500, centerMode: P = !1, centerPadding: F = "60px", responsive: I, slotProps: L, sx: oe, ...R } = S, z = g(), B = ae(O, I), V = s(() => A ? [v({
|
|
102
102
|
delay: j,
|
|
103
103
|
stopOnInteraction: !1
|
|
104
|
-
})] : [], [A, j]), [
|
|
104
|
+
})] : [], [A, j]), [H, U] = y({
|
|
105
105
|
loop: M,
|
|
106
106
|
duration: Math.round(N / 20),
|
|
107
107
|
align: P ? "center" : "start",
|
|
108
|
-
direction:
|
|
108
|
+
direction: z.direction === "rtl" ? "rtl" : "ltr",
|
|
109
109
|
slidesToScroll: 1
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
}, [
|
|
110
|
+
}, V), [W, G] = c([]), [K, q] = c(0), [se, ce] = c(!1), [le, ue] = c(!1), J = a(() => {
|
|
111
|
+
U && (G(U.scrollSnapList()), q(U.selectedScrollSnap()), ce(U.canScrollPrev()), ue(U.canScrollNext()));
|
|
112
|
+
}, [U]);
|
|
113
113
|
o(() => {
|
|
114
|
-
if (
|
|
115
|
-
|
|
114
|
+
if (U) return J(), U.on("select", J), U.on("reInit", J), () => {
|
|
115
|
+
U.off("select", J), U.off("reInit", J);
|
|
116
116
|
};
|
|
117
|
-
}, [
|
|
118
|
-
let
|
|
117
|
+
}, [U, J]), n.useImperativeHandle(C, () => U ?? null, [U]);
|
|
118
|
+
let Y = r.toArray(w), X = L?.previousButton, Z = L?.nextButton, Q = L?.dots, $ = L?.viewport, de = {
|
|
119
119
|
...S,
|
|
120
|
-
activeSlidesToShow:
|
|
121
|
-
selectedIndex:
|
|
120
|
+
activeSlidesToShow: B,
|
|
121
|
+
selectedIndex: K
|
|
122
122
|
};
|
|
123
|
-
return /* @__PURE__ */ d(
|
|
124
|
-
...
|
|
125
|
-
ownerState:
|
|
123
|
+
return /* @__PURE__ */ d(b, {
|
|
124
|
+
...R,
|
|
125
|
+
ownerState: de,
|
|
126
126
|
ref: h,
|
|
127
|
-
sx:
|
|
127
|
+
sx: oe,
|
|
128
128
|
children: [
|
|
129
|
-
/* @__PURE__ */ u(
|
|
130
|
-
|
|
129
|
+
/* @__PURE__ */ u(x, {
|
|
130
|
+
...$,
|
|
131
131
|
centerPadding: P ? F : void 0,
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
ref: H,
|
|
133
|
+
sx: e($?.sx),
|
|
134
|
+
children: /* @__PURE__ */ u(ee, { children: Y.map((e, t) => /* @__PURE__ */ u(te, {
|
|
135
|
+
slidesToShow: B,
|
|
134
136
|
spaceBetween: k,
|
|
135
137
|
children: e
|
|
136
|
-
},
|
|
138
|
+
}, ie(e, t))) })
|
|
137
139
|
}),
|
|
138
140
|
D && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(t, {
|
|
139
141
|
"aria-label": "Previous slide",
|
|
140
|
-
...
|
|
141
|
-
className: ["carousel-arrow prev",
|
|
142
|
+
...X,
|
|
143
|
+
className: ["carousel-arrow prev", X?.className].filter(Boolean).join(" "),
|
|
142
144
|
onClick: (e) => {
|
|
143
|
-
|
|
145
|
+
X?.onClick?.(e), e.defaultPrevented || U?.scrollPrev();
|
|
144
146
|
},
|
|
145
|
-
disabled:
|
|
146
|
-
sx: e(
|
|
147
|
+
disabled: X?.disabled || !M && !se,
|
|
148
|
+
sx: e(X?.sx),
|
|
147
149
|
children: /* @__PURE__ */ u(f, {})
|
|
148
150
|
}), /* @__PURE__ */ u(t, {
|
|
149
151
|
"aria-label": "Next slide",
|
|
150
|
-
...
|
|
151
|
-
className: ["carousel-arrow next",
|
|
152
|
+
...Z,
|
|
153
|
+
className: ["carousel-arrow next", Z?.className].filter(Boolean).join(" "),
|
|
152
154
|
onClick: (e) => {
|
|
153
|
-
|
|
155
|
+
Z?.onClick?.(e), e.defaultPrevented || U?.scrollNext();
|
|
154
156
|
},
|
|
155
|
-
disabled:
|
|
156
|
-
sx: e(
|
|
157
|
+
disabled: Z?.disabled || !M && !le,
|
|
158
|
+
sx: e(Z?.sx),
|
|
157
159
|
children: /* @__PURE__ */ u(p, {})
|
|
158
160
|
})] }),
|
|
159
|
-
E &&
|
|
160
|
-
|
|
161
|
-
sx: [{ mt: 4 }, ...e(
|
|
162
|
-
children:
|
|
161
|
+
E && W.length > 0 && /* @__PURE__ */ u(ne, {
|
|
162
|
+
...Q,
|
|
163
|
+
sx: [{ mt: 4 }, ...e(Q?.sx)],
|
|
164
|
+
children: W.map((e, n) => /* @__PURE__ */ u(m, {
|
|
163
165
|
component: "li",
|
|
164
|
-
className: n ===
|
|
166
|
+
className: n === K ? "active" : "",
|
|
165
167
|
sx: { display: "flex" },
|
|
166
168
|
children: /* @__PURE__ */ u(t, {
|
|
167
169
|
"aria-label": `Go to slide ${n + 1}`,
|
|
168
|
-
onClick: () =>
|
|
170
|
+
onClick: () => U?.scrollTo(n),
|
|
169
171
|
sx: {
|
|
170
172
|
width: "100%",
|
|
171
173
|
height: "100%",
|
|
172
174
|
minWidth: 0,
|
|
173
175
|
p: 0
|
|
174
176
|
},
|
|
175
|
-
children: /* @__PURE__ */ u(
|
|
177
|
+
children: /* @__PURE__ */ u(re, { dotColor: T })
|
|
176
178
|
})
|
|
177
179
|
}, e))
|
|
178
180
|
})
|
|
@@ -92,7 +92,7 @@ var d = [
|
|
|
92
92
|
p: "0 !important"
|
|
93
93
|
},
|
|
94
94
|
"& .MuiPickersOutlinedInput-notchedOutline": { border: "none !important" },
|
|
95
|
-
"& .MuiPickersInputBase-
|
|
95
|
+
"& .MuiPickersInputBase-sectionsContainer:not(:has(.MuiPickersInputBase-sectionContent[aria-valuenow]))": {
|
|
96
96
|
opacity: 1,
|
|
97
97
|
color: (S.vars ?? S).palette.text.secondary
|
|
98
98
|
}
|
|
@@ -94,7 +94,7 @@ var d = [
|
|
|
94
94
|
p: "0 !important"
|
|
95
95
|
},
|
|
96
96
|
"& .MuiPickersOutlinedInput-notchedOutline": { border: "none !important" },
|
|
97
|
-
"& .MuiPickersInputBase-
|
|
97
|
+
"& .MuiPickersInputBase-sectionsContainer:not(:has(.MuiPickersInputBase-sectionContent[aria-valuenow]))": {
|
|
98
98
|
opacity: 1,
|
|
99
99
|
color: (S.vars ?? S).palette.text.secondary
|
|
100
100
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { BoxProps } from '@mui/material/Box';
|
|
2
|
+
import { DrawerProps, DrawerSlots } from '@mui/material/Drawer';
|
|
3
|
+
import { ModalProps } from '@mui/material/Modal';
|
|
4
|
+
import { PaperProps } from '@mui/material/Paper';
|
|
5
|
+
import { TypographyProps } from '@mui/material/Typography';
|
|
6
|
+
import { ResponsiveStyleValue } from '@mui/system';
|
|
7
|
+
import { SIconButtonProps } from '../s-icon-button/s-icon-button';
|
|
8
|
+
import { SOverlayScrollbarProps } from '../s-overlay-scrollbar/s-overlay-scrollbar';
|
|
9
|
+
import { OwnerStateSlotProps as MuiOwnerStateSlotProps } from '../utils/slots';
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
/** Responsive width value, mirroring what `sx` accepts. */
|
|
12
|
+
export type SDrawerWidth = ResponsiveStyleValue<number | string>;
|
|
13
|
+
type ModalCloseEvent = Parameters<NonNullable<ModalProps['onClose']>>[0];
|
|
14
|
+
/** Why the drawer asked to close. Extends MUI's Modal reasons with the header close button. */
|
|
15
|
+
export type SDrawerCloseReason = 'backdropClick' | 'closeButtonClick' | 'escapeKeyDown';
|
|
16
|
+
/** Props for a MUI Drawer with a fixed header and an independently scrolling body. */
|
|
17
|
+
export interface SDrawerProps extends Omit<DrawerProps, 'children' | 'onClose' | 'slotProps' | 'slots' | 'title'> {
|
|
18
|
+
/** Body content; scrolls independently from the header. */
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
/** Accessible label for the close button — the injection point for translated copy. */
|
|
21
|
+
closeLabel?: string;
|
|
22
|
+
/** Content rendered beside the title, before the close button. */
|
|
23
|
+
headerActions?: React.ReactNode;
|
|
24
|
+
/** Called when the drawer requests to be closed, including from the header close button. */
|
|
25
|
+
onClose?: {
|
|
26
|
+
bivarianceHack(event: ModalCloseEvent, reason: SDrawerCloseReason): void;
|
|
27
|
+
}['bivarianceHack'];
|
|
28
|
+
/** Shows the header close button. Defaults to whether `onClose` is provided. */
|
|
29
|
+
showCloseButton?: boolean;
|
|
30
|
+
/** Components used for internal structural slots and for the MUI Drawer slots. */
|
|
31
|
+
slots?: SDrawerSlots;
|
|
32
|
+
/** Props or owner-state callbacks for internal structural slots and for the MUI Drawer slots. */
|
|
33
|
+
slotProps?: SDrawerSlotProps;
|
|
34
|
+
/** Header title content. */
|
|
35
|
+
title?: React.ReactNode;
|
|
36
|
+
/** Paper width; accepts responsive values. Defaults to `{ xs: '100vw', sm: 360 }` for side anchors and `'100%'` for top/bottom. */
|
|
37
|
+
width?: SDrawerWidth;
|
|
38
|
+
}
|
|
39
|
+
export interface SDrawerOwnerState extends Omit<SDrawerProps, 'slotProps' | 'slots'> {
|
|
40
|
+
anchor: NonNullable<DrawerProps['anchor']>;
|
|
41
|
+
closeLabel: string;
|
|
42
|
+
hasHeader: boolean;
|
|
43
|
+
hasHeaderActions: boolean;
|
|
44
|
+
hasTitle: boolean;
|
|
45
|
+
open: boolean;
|
|
46
|
+
showCloseButton: boolean;
|
|
47
|
+
}
|
|
48
|
+
type OwnerStateSlotProps<Props> = MuiOwnerStateSlotProps<Props, SDrawerOwnerState>;
|
|
49
|
+
type SDrawerRootSlotProps = Omit<DrawerProps, 'anchor' | 'children' | 'onClose' | 'open' | 'slotProps' | 'slots' | 'title' | 'variant'>;
|
|
50
|
+
export interface SDrawerSlots extends Partial<Pick<DrawerSlots, 'backdrop' | 'docked' | 'paper' | 'transition'>> {
|
|
51
|
+
/** Scrolling body wrapper. Custom component slots must consume or filter `ownerState`. */
|
|
52
|
+
body?: React.ElementType;
|
|
53
|
+
closeButton?: React.ElementType;
|
|
54
|
+
header?: React.ElementType;
|
|
55
|
+
headerActions?: React.ElementType;
|
|
56
|
+
/** Drawer wrapper, defaults to the themed MUI Drawer. */
|
|
57
|
+
root?: React.ElementType;
|
|
58
|
+
title?: React.ElementType;
|
|
59
|
+
}
|
|
60
|
+
export type SDrawerSlotProps = Omit<NonNullable<DrawerProps['slotProps']>, 'paper' | 'root'> & {
|
|
61
|
+
body?: OwnerStateSlotProps<Omit<SOverlayScrollbarProps, 'children'>>;
|
|
62
|
+
closeButton?: OwnerStateSlotProps<Omit<SIconButtonProps, 'children'>>;
|
|
63
|
+
header?: OwnerStateSlotProps<Omit<BoxProps, 'children'>>;
|
|
64
|
+
headerActions?: OwnerStateSlotProps<Omit<BoxProps, 'children'>>;
|
|
65
|
+
paper?: OwnerStateSlotProps<Omit<PaperProps, 'children'>>;
|
|
66
|
+
root?: OwnerStateSlotProps<SDrawerRootSlotProps>;
|
|
67
|
+
title?: OwnerStateSlotProps<Omit<TypographyProps, 'children'>>;
|
|
68
|
+
};
|
|
69
|
+
export declare const SDrawer: React.ForwardRefExoticComponent<Omit<SDrawerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
70
|
+
export default SDrawer;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { toSxArray as e } from "../utils/sx.js";
|
|
2
|
+
import { resolveOwnerStateSlotProps as t } from "../utils/slots.js";
|
|
3
|
+
import { SOverlayScrollbar as n } from "../s-overlay-scrollbar/s-overlay-scrollbar.js";
|
|
4
|
+
import { SIconButton as r } from "../s-icon-button/s-icon-button.js";
|
|
5
|
+
import { styled as i, useThemeProps as a } from "@mui/material/styles";
|
|
6
|
+
import * as o from "react";
|
|
7
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
import l from "@mui/material/Typography";
|
|
9
|
+
import { mergeSlotProps as u, useEventCallback as d, useForkRef as f } from "@mui/material/utils";
|
|
10
|
+
import p from "@mui/utils/appendOwnerState";
|
|
11
|
+
import m from "@mui/icons-material/Close";
|
|
12
|
+
import h from "@mui/material/Box";
|
|
13
|
+
import g from "@mui/material/Drawer";
|
|
14
|
+
//#region lib/s-drawer/s-drawer.tsx
|
|
15
|
+
var _ = {
|
|
16
|
+
xs: "100vw",
|
|
17
|
+
sm: 360
|
|
18
|
+
};
|
|
19
|
+
function v(e) {
|
|
20
|
+
return e == null || typeof e == "boolean" || typeof e == "string" && e.trim() === "" ? !1 : o.isValidElement(e) && e.type === o.Fragment ? v(e.props.children) : Array.isArray(e) ? e.some(v) : !0;
|
|
21
|
+
}
|
|
22
|
+
var ee = i(g, {
|
|
23
|
+
name: "SDrawer",
|
|
24
|
+
slot: "Root",
|
|
25
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
26
|
+
})({}), te = i(h, {
|
|
27
|
+
name: "SDrawer",
|
|
28
|
+
slot: "Header",
|
|
29
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
30
|
+
})(({ theme: e }) => ({
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
boxShadow: `inset 0 -1px 0 ${(e.vars ?? e).palette.divider}`,
|
|
33
|
+
display: "flex",
|
|
34
|
+
flexShrink: 0,
|
|
35
|
+
gap: e.spacing(2),
|
|
36
|
+
justifyContent: "space-between",
|
|
37
|
+
minHeight: e.spacing(7),
|
|
38
|
+
padding: e.spacing(1.5, 2),
|
|
39
|
+
variants: [{
|
|
40
|
+
props: ({ ownerState: e }) => !e.hasTitle,
|
|
41
|
+
style: { justifyContent: "flex-end" }
|
|
42
|
+
}]
|
|
43
|
+
})), y = i(l, {
|
|
44
|
+
name: "SDrawer",
|
|
45
|
+
slot: "Title",
|
|
46
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
47
|
+
})({
|
|
48
|
+
flex: "1 1 auto",
|
|
49
|
+
minWidth: 0
|
|
50
|
+
}), b = i(h, {
|
|
51
|
+
name: "SDrawer",
|
|
52
|
+
slot: "HeaderActions",
|
|
53
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
54
|
+
})(({ theme: e }) => ({
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
display: "flex",
|
|
57
|
+
flexShrink: 0,
|
|
58
|
+
gap: e.spacing(1)
|
|
59
|
+
})), x = i(r, {
|
|
60
|
+
name: "SDrawer",
|
|
61
|
+
slot: "CloseButton",
|
|
62
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
63
|
+
})({ flexShrink: 0 }), S = i(n, {
|
|
64
|
+
name: "SDrawer",
|
|
65
|
+
slot: "Body",
|
|
66
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
67
|
+
})(({ theme: e }) => ({
|
|
68
|
+
flex: "1 1 auto",
|
|
69
|
+
minHeight: 0,
|
|
70
|
+
padding: e.spacing(2)
|
|
71
|
+
})), C = o.forwardRef(function(n, r) {
|
|
72
|
+
let i = a({
|
|
73
|
+
props: n,
|
|
74
|
+
name: "SDrawer"
|
|
75
|
+
}), { anchor: l = "right", "aria-describedby": h, "aria-label": g, "aria-labelledby": C, children: w, closeLabel: T = "Close drawer", headerActions: E, onClose: D, open: O = !1, showCloseButton: k, slotProps: A, slots: j, sx: M, title: N, variant: P = "temporary", width: ne, ...re } = i, F = o.useId(), I = l === "top" || l === "bottom", L = ne ?? (I ? "100%" : _), R = v(N), z = v(E), B = k ?? D != null, V = R || z || B, H = {
|
|
76
|
+
...i,
|
|
77
|
+
anchor: l,
|
|
78
|
+
closeLabel: T,
|
|
79
|
+
hasHeader: V,
|
|
80
|
+
hasHeaderActions: z,
|
|
81
|
+
hasTitle: R,
|
|
82
|
+
open: O,
|
|
83
|
+
showCloseButton: B,
|
|
84
|
+
variant: P,
|
|
85
|
+
width: L
|
|
86
|
+
}, { body: U = S, closeButton: W = x, header: G = te, headerActions: K = b, root: q = ee, title: J = y, ...Y } = j ?? {}, { body: ie, closeButton: ae, header: oe, headerActions: se, paper: ce, root: le, title: ue, ...de } = A ?? {}, fe = d((e) => {
|
|
87
|
+
D?.(e, "closeButtonClick");
|
|
88
|
+
}), pe = p(G, t(oe, H) ?? {}, H), X = p(J, t(ue, H) ?? {}, H), me = p(K, t(se, H) ?? {}, H), he = p(W, u(t(ae, H), {
|
|
89
|
+
"aria-label": T,
|
|
90
|
+
onClick: fe
|
|
91
|
+
}), H), ge = p(U, t(ie, H) ?? {}, H), { ref: _e, sx: Z, ...ve } = p(q, u(t(le, H), re), H), ye = f(_e, r), Q = X.id ?? (R ? F : void 0), $ = t(ce, H), be = g != null || C != null || $?.["aria-label"] != null || $?.["aria-labelledby"] != null, xe = u($, {
|
|
92
|
+
"aria-describedby": h,
|
|
93
|
+
"aria-label": g,
|
|
94
|
+
"aria-labelledby": C ?? (be ? void 0 : Q),
|
|
95
|
+
sx: [{
|
|
96
|
+
boxSizing: "border-box",
|
|
97
|
+
display: "flex",
|
|
98
|
+
flexDirection: "column",
|
|
99
|
+
width: L,
|
|
100
|
+
...I ? { maxHeight: "100%" } : { height: "100%" }
|
|
101
|
+
}]
|
|
102
|
+
});
|
|
103
|
+
return /* @__PURE__ */ c(q, {
|
|
104
|
+
...ve,
|
|
105
|
+
ref: ye,
|
|
106
|
+
anchor: l,
|
|
107
|
+
onClose: D,
|
|
108
|
+
open: O,
|
|
109
|
+
slotProps: {
|
|
110
|
+
...de,
|
|
111
|
+
paper: xe
|
|
112
|
+
},
|
|
113
|
+
slots: Y,
|
|
114
|
+
sx: [...e(M), ...e(Z)],
|
|
115
|
+
variant: P,
|
|
116
|
+
children: [V ? /* @__PURE__ */ c(G, {
|
|
117
|
+
...pe,
|
|
118
|
+
children: [R ? /* @__PURE__ */ s(J, {
|
|
119
|
+
noWrap: !0,
|
|
120
|
+
variant: "h6",
|
|
121
|
+
...X,
|
|
122
|
+
id: Q,
|
|
123
|
+
children: N
|
|
124
|
+
}) : null, z || B ? /* @__PURE__ */ c(K, {
|
|
125
|
+
...me,
|
|
126
|
+
children: [E, B ? /* @__PURE__ */ s(W, {
|
|
127
|
+
...he,
|
|
128
|
+
children: /* @__PURE__ */ s(m, {})
|
|
129
|
+
}) : null]
|
|
130
|
+
}) : null]
|
|
131
|
+
}) : null, /* @__PURE__ */ s(U, {
|
|
132
|
+
...ge,
|
|
133
|
+
children: w
|
|
134
|
+
})]
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
C.displayName = "SDrawer";
|
|
138
|
+
//#endregion
|
|
139
|
+
export { C as SDrawer, C as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { default, default as SGradientBlobPulse } from './s-gradient-blob-pulse';
|
|
2
|
+
export type { SGradientBlobPulseBlobOwnerState, SGradientBlobPulseOwnerState, SGradientBlobPulseProps, SGradientBlobPulseSize, SGradientBlobPulseSlotProps, SGradientBlobPulseSlots, SGradientBlobPulseVariant, } from './s-gradient-blob-pulse';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { BoxProps } from '@mui/material';
|
|
2
|
+
import { OwnerStateSlotProps } from '../utils/slots';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
/** Overall footprint of the blob field: blob diameters, blur and minimum size. */
|
|
5
|
+
export type SGradientBlobPulseSize = 'large' | 'medium' | 'small';
|
|
6
|
+
/** Intensity of the blob fill, from a faint wash to a saturated glow. */
|
|
7
|
+
export type SGradientBlobPulseVariant = 'balanced' | 'soft' | 'vivid';
|
|
8
|
+
/** Props for <SGradientBlobPulse>. */
|
|
9
|
+
export interface SGradientBlobPulseProps extends Omit<BoxProps, 'children' | 'component'> {
|
|
10
|
+
/** Duration of one blob pulse, in milliseconds. The color cycle scales with it. */
|
|
11
|
+
animationDuration?: number;
|
|
12
|
+
/** Content rendered above the animated backdrop. */
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Up to four colors the blobs cycle through. Shorter arrays are padded by
|
|
16
|
+
* repeating the first color. Defaults to the theme brand and secondary ramps,
|
|
17
|
+
* so palette switches follow along.
|
|
18
|
+
*/
|
|
19
|
+
colors?: string[];
|
|
20
|
+
/** Freezes the pulse and the color cycle. */
|
|
21
|
+
paused?: boolean;
|
|
22
|
+
/** Overall footprint of the blob field: blob diameters, blur and minimum size. */
|
|
23
|
+
size?: SGradientBlobPulseSize;
|
|
24
|
+
/** Props or owner-state callbacks for internal structural slots. */
|
|
25
|
+
slotProps?: SGradientBlobPulseSlotProps;
|
|
26
|
+
/** Components used for internal structural slots. */
|
|
27
|
+
slots?: SGradientBlobPulseSlots;
|
|
28
|
+
/** Intensity of the blob fill, from a faint wash to a saturated glow. */
|
|
29
|
+
variant?: SGradientBlobPulseVariant;
|
|
30
|
+
}
|
|
31
|
+
export interface SGradientBlobPulseOwnerState extends SGradientBlobPulseProps {
|
|
32
|
+
animationDuration: number;
|
|
33
|
+
paused: boolean;
|
|
34
|
+
size: SGradientBlobPulseSize;
|
|
35
|
+
variant: SGradientBlobPulseVariant;
|
|
36
|
+
}
|
|
37
|
+
/** Owner state handed to the `blob` slot, identifying which of the three blobs it is. */
|
|
38
|
+
export interface SGradientBlobPulseBlobOwnerState extends SGradientBlobPulseOwnerState {
|
|
39
|
+
index: 0 | 1 | 2;
|
|
40
|
+
}
|
|
41
|
+
export interface SGradientBlobPulseSlots {
|
|
42
|
+
/** One of the three animated blobs. */
|
|
43
|
+
blob?: React.ElementType;
|
|
44
|
+
/** Wraps `children` above the blob field. */
|
|
45
|
+
content?: React.ElementType;
|
|
46
|
+
root?: React.ElementType;
|
|
47
|
+
}
|
|
48
|
+
export interface SGradientBlobPulseSlotProps {
|
|
49
|
+
blob?: OwnerStateSlotProps<Omit<BoxProps, 'children'>, SGradientBlobPulseBlobOwnerState>;
|
|
50
|
+
content?: OwnerStateSlotProps<Omit<BoxProps, 'children'>, SGradientBlobPulseOwnerState>;
|
|
51
|
+
root?: OwnerStateSlotProps<Omit<BoxProps, 'children'>, SGradientBlobPulseOwnerState>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Three drifting, color-cycling gradient blobs behind arbitrary content —
|
|
55
|
+
* an ambient backdrop for hero panels, cards and empty states.
|
|
56
|
+
*
|
|
57
|
+
* The field keeps a minimum footprint from `size` so the blobs stay inside it,
|
|
58
|
+
* while their blur halo bleeds past the edge; contain it with `overflow` from
|
|
59
|
+
* `sx`, and retune the radius with the `--SGradientBlobPulse-blur` variable.
|
|
60
|
+
*/
|
|
61
|
+
export declare const SGradientBlobPulse: React.ForwardRefExoticComponent<Omit<SGradientBlobPulseProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
62
|
+
export default SGradientBlobPulse;
|