@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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { default, default as SAnimatedGradientText } from './s-animated-gradient-text';
|
|
2
|
+
export type { SAnimatedGradientTextDirection, SAnimatedGradientTextComponent, SAnimatedGradientTextOwnProps, SAnimatedGradientTextOwnerState, SAnimatedGradientTextProps, SAnimatedGradientTextSlotProps, SAnimatedGradientTextSlots, } from './s-animated-gradient-text';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { TypographyOwnProps, TypographyProps } from '@mui/material';
|
|
2
|
+
import { OwnerStateSlotProps } from '../utils/slots';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
/** Axis the gradient sweeps along. */
|
|
5
|
+
export type SAnimatedGradientTextDirection = 'diagonal' | 'horizontal' | 'vertical';
|
|
6
|
+
interface SAnimatedGradientTextBaseProps extends Omit<TypographyOwnProps, 'children' | 'color'> {
|
|
7
|
+
/** Reverses the sweep on alternate cycles instead of restarting it. */
|
|
8
|
+
alternate?: boolean;
|
|
9
|
+
/** Duration of one gradient sweep, in milliseconds. */
|
|
10
|
+
animationDuration?: number;
|
|
11
|
+
/** Text content painted with the animated gradient. */
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* At least two gradient stop colors, in order. The first stop is repeated at
|
|
15
|
+
* the end so a non-alternating loop wraps without a seam. Defaults to the theme
|
|
16
|
+
* primary and secondary semantic colors, so palette switches follow along.
|
|
17
|
+
*/
|
|
18
|
+
colors?: readonly [string, string, ...string[]];
|
|
19
|
+
/** Axis the gradient sweeps along. */
|
|
20
|
+
direction?: SAnimatedGradientTextDirection;
|
|
21
|
+
/** Freezes the sweep while a fine pointer is over the text. */
|
|
22
|
+
pauseOnHover?: boolean;
|
|
23
|
+
/** Freezes the sweep. */
|
|
24
|
+
paused?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface SAnimatedGradientTextOwnProps extends SAnimatedGradientTextBaseProps {
|
|
27
|
+
/** Components used for internal structural slots. */
|
|
28
|
+
slots?: SAnimatedGradientTextSlots;
|
|
29
|
+
/** Props or owner-state callbacks for internal structural slots. */
|
|
30
|
+
slotProps?: SAnimatedGradientTextSlotProps;
|
|
31
|
+
}
|
|
32
|
+
/** Props for <SAnimatedGradientText>. */
|
|
33
|
+
export type SAnimatedGradientTextProps = SAnimatedGradientTextOwnProps & Omit<TypographyProps, keyof SAnimatedGradientTextOwnProps | 'children' | 'color'> & {
|
|
34
|
+
/**
|
|
35
|
+
* The root element or component rendered by MUI Typography.
|
|
36
|
+
*
|
|
37
|
+
* The public component overload narrows its native props when this is set.
|
|
38
|
+
*/
|
|
39
|
+
component?: React.ElementType;
|
|
40
|
+
};
|
|
41
|
+
export interface SAnimatedGradientTextOwnerState extends SAnimatedGradientTextBaseProps {
|
|
42
|
+
alternate: boolean;
|
|
43
|
+
animationDuration: number;
|
|
44
|
+
direction: SAnimatedGradientTextDirection;
|
|
45
|
+
pauseOnHover: boolean;
|
|
46
|
+
paused: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface SAnimatedGradientTextSlots {
|
|
49
|
+
/** Component used for the root slot. */
|
|
50
|
+
root?: React.ElementType;
|
|
51
|
+
}
|
|
52
|
+
export interface SAnimatedGradientTextSlotProps {
|
|
53
|
+
/** Props or owner-state callback applied to the root slot. */
|
|
54
|
+
root?: OwnerStateSlotProps<Omit<TypographyProps, 'children' | 'color'>, SAnimatedGradientTextOwnerState>;
|
|
55
|
+
}
|
|
56
|
+
export interface SAnimatedGradientTextComponent {
|
|
57
|
+
<RootComponent extends React.ElementType = 'span'>(props: {
|
|
58
|
+
/** The root element or component rendered by MUI Typography. */
|
|
59
|
+
component?: RootComponent;
|
|
60
|
+
} & SAnimatedGradientTextOwnProps & Omit<React.ComponentPropsWithRef<NoInfer<RootComponent>>, keyof SAnimatedGradientTextOwnProps | 'children' | 'color' | 'component'>): React.JSX.Element | null;
|
|
61
|
+
displayName?: string;
|
|
62
|
+
}
|
|
63
|
+
export declare const SAnimatedGradientText: SAnimatedGradientTextComponent;
|
|
64
|
+
export default SAnimatedGradientText;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { resolveOwnerStateSlotProps as e } from "../utils/slots.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { Typography as r, keyframes as i, styled as a, useThemeProps as o } from "@mui/material";
|
|
5
|
+
import { mergeSlotProps as s, useForkRef as c } from "@mui/material/utils";
|
|
6
|
+
import l from "@mui/utils/appendOwnerState";
|
|
7
|
+
//#region lib/s-animated-gradient-text/s-animated-gradient-text.tsx
|
|
8
|
+
var u = i`
|
|
9
|
+
from { background-position: 0% 50%; }
|
|
10
|
+
to { background-position: 100% 50%; }
|
|
11
|
+
`, d = i`
|
|
12
|
+
from { background-position: 50% 0%; }
|
|
13
|
+
to { background-position: 50% 100%; }
|
|
14
|
+
`, f = {
|
|
15
|
+
diagonal: {
|
|
16
|
+
angle: "to bottom right",
|
|
17
|
+
backgroundSize: "300% 300%",
|
|
18
|
+
keyframe: i`
|
|
19
|
+
from { background-position: 0% 0%; }
|
|
20
|
+
to { background-position: 100% 100%; }
|
|
21
|
+
`
|
|
22
|
+
},
|
|
23
|
+
horizontal: {
|
|
24
|
+
angle: "to right",
|
|
25
|
+
backgroundSize: "300% 100%",
|
|
26
|
+
keyframe: u
|
|
27
|
+
},
|
|
28
|
+
vertical: {
|
|
29
|
+
angle: "to bottom",
|
|
30
|
+
backgroundSize: "100% 300%",
|
|
31
|
+
keyframe: d
|
|
32
|
+
}
|
|
33
|
+
}, p = 200 / 3, m = (e, t) => {
|
|
34
|
+
let n = (e.vars ?? e).palette, { angle: r, backgroundSize: i, keyframe: a } = f[t.direction], o = t.colors?.length ? t.colors : [n.primary.main, n.secondary.main], s = [...o, o[0]].map((e, t) => `${e} ${t / o.length * p}%`).join(", ");
|
|
35
|
+
return {
|
|
36
|
+
animation: `${a} ${t.animationDuration}ms linear infinite`,
|
|
37
|
+
animationDirection: t.alternate ? "alternate" : "normal",
|
|
38
|
+
backgroundImage: `repeating-linear-gradient(${r}, ${s})`,
|
|
39
|
+
backgroundRepeat: "no-repeat",
|
|
40
|
+
backgroundSize: i,
|
|
41
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
42
|
+
animation: "none",
|
|
43
|
+
backgroundPosition: "center"
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}, h = a(r, {
|
|
47
|
+
name: "SAnimatedGradientText",
|
|
48
|
+
slot: "Root",
|
|
49
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
50
|
+
})(({ ownerState: e, theme: t }) => ({
|
|
51
|
+
...m(t, e),
|
|
52
|
+
backgroundClip: "text",
|
|
53
|
+
color: "transparent",
|
|
54
|
+
display: "inline-block",
|
|
55
|
+
WebkitBackgroundClip: "text",
|
|
56
|
+
WebkitTextFillColor: "transparent",
|
|
57
|
+
"@media (forced-colors: active)": {
|
|
58
|
+
backgroundImage: "none",
|
|
59
|
+
color: "CanvasText",
|
|
60
|
+
WebkitTextFillColor: "revert"
|
|
61
|
+
},
|
|
62
|
+
variants: [{
|
|
63
|
+
props: ({ ownerState: e }) => e.paused,
|
|
64
|
+
style: { animationPlayState: "paused" }
|
|
65
|
+
}, {
|
|
66
|
+
props: ({ ownerState: e }) => e.pauseOnHover,
|
|
67
|
+
style: { "@media (hover: hover) and (pointer: fine)": { "&:hover": { animationPlayState: "paused" } } }
|
|
68
|
+
}]
|
|
69
|
+
}));
|
|
70
|
+
function g(t, r) {
|
|
71
|
+
let i = o({
|
|
72
|
+
props: t,
|
|
73
|
+
name: "SAnimatedGradientText"
|
|
74
|
+
}), { alternate: a = !0, animationDuration: u = 8e3, children: d, colors: f, direction: p = "horizontal", pauseOnHover: m = !1, paused: g = !1, slotProps: _, slots: v, ...y } = i, b = {
|
|
75
|
+
...i,
|
|
76
|
+
alternate: a,
|
|
77
|
+
animationDuration: u,
|
|
78
|
+
colors: f,
|
|
79
|
+
direction: p,
|
|
80
|
+
pauseOnHover: m,
|
|
81
|
+
paused: g
|
|
82
|
+
}, x = v?.root ?? h, { ref: S, ...C } = l(x, s(e(_?.root, b), y), b), w = c(S, r);
|
|
83
|
+
return /* @__PURE__ */ n(x, {
|
|
84
|
+
...C,
|
|
85
|
+
ref: w,
|
|
86
|
+
children: d
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
var _ = t.forwardRef(g);
|
|
90
|
+
_.displayName = "SAnimatedGradientText";
|
|
91
|
+
//#endregion
|
|
92
|
+
export { _ as SAnimatedGradientText, _ as default };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { BoxProps, ChipProps, ContainerProps, TypographyProps } from '@mui/material';
|
|
2
|
+
import { SIconButtonProps } from '../s-icon-button';
|
|
3
|
+
import { OwnerStateSlotProps as MuiOwnerStateSlotProps } from '../utils/slots';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
/** Background treatment of the bar. */
|
|
6
|
+
export type SAnnouncementBarVariant = 'announcement' | 'plain';
|
|
7
|
+
export interface SAnnouncementBarSlots {
|
|
8
|
+
/** Trailing cluster holding `actions`. */
|
|
9
|
+
actions?: React.ElementType;
|
|
10
|
+
/** Leading label chip. */
|
|
11
|
+
badge?: React.ElementType;
|
|
12
|
+
/** Width-constraining row inside the bar. */
|
|
13
|
+
container?: React.ElementType;
|
|
14
|
+
/** Button that dismisses the bar. */
|
|
15
|
+
dismissButton?: React.ElementType;
|
|
16
|
+
/** Button that toggles the collapsed action row on small screens. */
|
|
17
|
+
expandToggle?: React.ElementType;
|
|
18
|
+
/** Bloom layer anchored to the trailing side. */
|
|
19
|
+
glowEnd?: React.ElementType;
|
|
20
|
+
/** Bloom layer anchored to the leading side. */
|
|
21
|
+
glowStart?: React.ElementType;
|
|
22
|
+
/** Announcement message. */
|
|
23
|
+
message?: React.ElementType;
|
|
24
|
+
/** Full-bleed bar surface. */
|
|
25
|
+
root?: React.ElementType;
|
|
26
|
+
}
|
|
27
|
+
type OwnerStateSlotProps<Props> = MuiOwnerStateSlotProps<Props, SAnnouncementBarOwnerState>;
|
|
28
|
+
export interface SAnnouncementBarSlotProps {
|
|
29
|
+
/** Props or owner-state callback for the actions slot. */
|
|
30
|
+
actions?: OwnerStateSlotProps<Omit<BoxProps, 'children'>>;
|
|
31
|
+
/** Props or owner-state callback for the badge slot. */
|
|
32
|
+
badge?: OwnerStateSlotProps<Omit<ChipProps, 'children' | 'label'>>;
|
|
33
|
+
/** Props or owner-state callback for the container slot. */
|
|
34
|
+
container?: OwnerStateSlotProps<Omit<ContainerProps, 'children'>>;
|
|
35
|
+
/** Props or owner-state callback for the dismiss button slot. */
|
|
36
|
+
dismissButton?: OwnerStateSlotProps<Omit<SIconButtonProps, 'children'>>;
|
|
37
|
+
/** Props or owner-state callback for the expand toggle slot. */
|
|
38
|
+
expandToggle?: OwnerStateSlotProps<Omit<SIconButtonProps, 'children'>>;
|
|
39
|
+
/** Props or owner-state callback for the trailing glow slot. */
|
|
40
|
+
glowEnd?: OwnerStateSlotProps<Omit<BoxProps, 'children'>>;
|
|
41
|
+
/** Props or owner-state callback for the leading glow slot. */
|
|
42
|
+
glowStart?: OwnerStateSlotProps<Omit<BoxProps, 'children'>>;
|
|
43
|
+
/** Props or owner-state callback for the message slot. */
|
|
44
|
+
message?: OwnerStateSlotProps<Omit<TypographyProps, 'children'>>;
|
|
45
|
+
/** Props or owner-state callback for the root slot. */
|
|
46
|
+
root?: OwnerStateSlotProps<Omit<BoxProps, 'children'>>;
|
|
47
|
+
}
|
|
48
|
+
/** Props for a full-bleed announcement bar. */
|
|
49
|
+
export interface SAnnouncementBarProps extends Omit<BoxProps, 'children' | 'component' | 'title'> {
|
|
50
|
+
/** Trailing content — social links, a locale switcher, a call to action. */
|
|
51
|
+
actions?: React.ReactNode;
|
|
52
|
+
/** Duration of one gradient pan, in milliseconds. */
|
|
53
|
+
animationDuration?: number;
|
|
54
|
+
/** Leading label, rendered inside an `SChip`. */
|
|
55
|
+
badge?: React.ReactNode;
|
|
56
|
+
/** Announcement message. */
|
|
57
|
+
children?: React.ReactNode;
|
|
58
|
+
/** Accessible name of the expand toggle while the action row is open. */
|
|
59
|
+
collapseLabel?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Collapses `actions` behind a toggle below the `sm` breakpoint, so a long
|
|
62
|
+
* message and a wide action row never fight for the same line on mobile.
|
|
63
|
+
*/
|
|
64
|
+
collapsible?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Gradient stop colors of the `announcement` variant, in order. Defaults to
|
|
67
|
+
* the live brand and secondary ramps so a palette switch follows along.
|
|
68
|
+
*/
|
|
69
|
+
colors?: string[];
|
|
70
|
+
/** Initial expanded state of the collapsible action row. */
|
|
71
|
+
defaultExpanded?: boolean;
|
|
72
|
+
/** Initial visibility for uncontrolled dismissal. */
|
|
73
|
+
defaultOpen?: boolean;
|
|
74
|
+
/** Accessible name of the dismiss button. */
|
|
75
|
+
dismissLabel?: string;
|
|
76
|
+
/** Renders a dismiss button at the trailing end of the bar. */
|
|
77
|
+
dismissible?: boolean;
|
|
78
|
+
/** Expanded state of the collapsible action row for controlled usage. */
|
|
79
|
+
expanded?: boolean;
|
|
80
|
+
/** Accessible name of the expand toggle while the action row is closed. */
|
|
81
|
+
expandLabel?: string;
|
|
82
|
+
/** Called when the dismiss button is pressed. */
|
|
83
|
+
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
84
|
+
/** Called with the next expanded state when the toggle is pressed. */
|
|
85
|
+
onExpandedChange?: (event: React.MouseEvent<HTMLButtonElement>, expanded: boolean) => void;
|
|
86
|
+
/** Visibility for controlled dismissal. */
|
|
87
|
+
open?: boolean;
|
|
88
|
+
/** Freezes the gradient pan and the glow cycle. */
|
|
89
|
+
paused?: boolean;
|
|
90
|
+
/** Props or owner-state callbacks for internal structural slots. */
|
|
91
|
+
slotProps?: SAnnouncementBarSlotProps;
|
|
92
|
+
/** Components used for internal structural slots. */
|
|
93
|
+
slots?: SAnnouncementBarSlots;
|
|
94
|
+
/** Background treatment of the bar. */
|
|
95
|
+
variant?: SAnnouncementBarVariant;
|
|
96
|
+
}
|
|
97
|
+
export interface SAnnouncementBarOwnerState extends SAnnouncementBarProps {
|
|
98
|
+
animationDuration: number;
|
|
99
|
+
collapsible: boolean;
|
|
100
|
+
dismissible: boolean;
|
|
101
|
+
expanded: boolean;
|
|
102
|
+
open: boolean;
|
|
103
|
+
paused: boolean;
|
|
104
|
+
variant: SAnnouncementBarVariant;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Full-bleed announcement bar with a badge, a message, an action cluster and an
|
|
108
|
+
* optional dismiss control. The `announcement` variant paints an animated brand
|
|
109
|
+
* gradient with two drifting glow layers, all of which stop under
|
|
110
|
+
* `prefers-reduced-motion` or when `paused` is set.
|
|
111
|
+
*/
|
|
112
|
+
export declare const SAnnouncementBar: React.ForwardRefExoticComponent<Omit<SAnnouncementBarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
113
|
+
export default SAnnouncementBar;
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { toSxArray as e } from "../utils/sx.js";
|
|
2
|
+
import { resolveOwnerStateSlotProps as t } from "../utils/slots.js";
|
|
3
|
+
import { SIconButton as n } from "../s-icon-button/s-icon-button.js";
|
|
4
|
+
import { SChip as r } from "../s-chip/s-chip.js";
|
|
5
|
+
import * as i from "react";
|
|
6
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
import { Box as c, Container as l, Typography as u, keyframes as d, styled as f, useThemeProps as p } from "@mui/material";
|
|
8
|
+
import { mergeSlotProps as m, useControlled as h, useEventCallback as g, useForkRef as _ } from "@mui/material/utils";
|
|
9
|
+
import v from "@mui/utils/appendOwnerState";
|
|
10
|
+
import ee from "@mui/icons-material/Close";
|
|
11
|
+
import te from "@mui/icons-material/Add";
|
|
12
|
+
import y from "@mui/icons-material/Remove";
|
|
13
|
+
//#region lib/s-announcement-bar/s-announcement-bar.tsx
|
|
14
|
+
var b = "@media (prefers-reduced-motion: reduce)", x = "-45%", S = "blur(58px) saturate(105%)", C = "scale(1.14)", w = "blur(8px) saturate(115%)", T = "100% 100%, 220% 220%", E = "115deg", D = .34, O = "--SAnnouncementBar-scrimOpacity", k = .62, A = d`
|
|
15
|
+
0% { background-position: 0 0, 0% 50%; }
|
|
16
|
+
50% { background-position: 0 0, 100% 50%; }
|
|
17
|
+
100% { background-position: 0 0, 0% 50%; }
|
|
18
|
+
`, j = d`
|
|
19
|
+
0%, 28% { opacity: 0; }
|
|
20
|
+
33%, 61% { opacity: 0.36; }
|
|
21
|
+
66%, 100% { opacity: 0; }
|
|
22
|
+
`, M = d`
|
|
23
|
+
0%, 61% { opacity: 0; }
|
|
24
|
+
66%, 94% { opacity: 0.28; }
|
|
25
|
+
100% { opacity: 0; }
|
|
26
|
+
`, N = ({ ownerState: e }) => e.variant === "announcement", P = (e, t) => {
|
|
27
|
+
let n = (e.vars ?? e).palette;
|
|
28
|
+
return t.colors?.length ? t.colors : [
|
|
29
|
+
n.primary[900],
|
|
30
|
+
n.primary[600],
|
|
31
|
+
n.secondary[400],
|
|
32
|
+
n.secondary[200]
|
|
33
|
+
];
|
|
34
|
+
}, F = (e) => e.map((t, n) => `${t} ${n / Math.max(e.length - 1, 1) * 100}%`).join(", "), I = (e, t, n) => ({
|
|
35
|
+
animation: `${n} ${t.animationDuration}ms ${e.transitions.easing.easeInOut} infinite`,
|
|
36
|
+
filter: S,
|
|
37
|
+
inset: x,
|
|
38
|
+
opacity: 0,
|
|
39
|
+
pointerEvents: "none",
|
|
40
|
+
position: "absolute",
|
|
41
|
+
transform: C,
|
|
42
|
+
willChange: "opacity",
|
|
43
|
+
zIndex: 0,
|
|
44
|
+
[b]: {
|
|
45
|
+
animation: "none",
|
|
46
|
+
opacity: .3
|
|
47
|
+
}
|
|
48
|
+
}), ne = f(c, {
|
|
49
|
+
name: "SAnnouncementBar",
|
|
50
|
+
slot: "Root",
|
|
51
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
52
|
+
})(({ ownerState: e, theme: t }) => {
|
|
53
|
+
let n = (t.vars ?? t).palette, r = `rgba(${n.background.paperChannel} / var(${O}))`;
|
|
54
|
+
return {
|
|
55
|
+
...t.typography.body2,
|
|
56
|
+
minHeight: t.spacing(5),
|
|
57
|
+
overflow: "hidden",
|
|
58
|
+
position: "relative",
|
|
59
|
+
width: "100%",
|
|
60
|
+
variants: [
|
|
61
|
+
{
|
|
62
|
+
props: ({ ownerState: e }) => e.variant === "plain",
|
|
63
|
+
style: {
|
|
64
|
+
backgroundColor: n.background.paper,
|
|
65
|
+
borderBottom: `1px solid ${n.divider}`,
|
|
66
|
+
color: n.text.primary
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
props: N,
|
|
71
|
+
style: {
|
|
72
|
+
[O]: k,
|
|
73
|
+
animation: `${A} ${e.animationDuration}ms ${t.transitions.easing.easeInOut} infinite`,
|
|
74
|
+
backdropFilter: w,
|
|
75
|
+
backgroundImage: `linear-gradient(${r}, ${r}), linear-gradient(${E}, ${F(P(t, e))})`,
|
|
76
|
+
backgroundSize: T,
|
|
77
|
+
borderBottom: `1px solid rgba(${n.primary.mainChannel} / ${D})`,
|
|
78
|
+
boxShadow: t.shadows[1],
|
|
79
|
+
color: n.text.primary,
|
|
80
|
+
isolation: "isolate",
|
|
81
|
+
[b]: {
|
|
82
|
+
animation: "none",
|
|
83
|
+
backgroundPosition: "0 0, 50% 50%"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
props: ({ ownerState: e }) => e.paused,
|
|
89
|
+
style: { "&, & > *": { animationPlayState: "paused" } }
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
};
|
|
93
|
+
}), re = f(c, {
|
|
94
|
+
name: "SAnnouncementBar",
|
|
95
|
+
slot: "GlowStart",
|
|
96
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
97
|
+
})(({ ownerState: e, theme: t }) => {
|
|
98
|
+
let n = P(t, e);
|
|
99
|
+
return {
|
|
100
|
+
...I(t, e, j),
|
|
101
|
+
backgroundImage: `radial-gradient(circle at 18% 50%, ${n[n.length - 1]} 0%, ${n[Math.max(n.length - 2, 0)]} 36%, transparent 70%)`
|
|
102
|
+
};
|
|
103
|
+
}), ie = f(c, {
|
|
104
|
+
name: "SAnnouncementBar",
|
|
105
|
+
slot: "GlowEnd",
|
|
106
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
107
|
+
})(({ ownerState: e, theme: t }) => {
|
|
108
|
+
let n = P(t, e);
|
|
109
|
+
return {
|
|
110
|
+
...I(t, e, M),
|
|
111
|
+
backgroundImage: `radial-gradient(circle at 82% 50%, ${n[Math.min(1, n.length - 1)]} 0%, ${n[0]} 38%, transparent 72%)`
|
|
112
|
+
};
|
|
113
|
+
}), ae = f(l, {
|
|
114
|
+
name: "SAnnouncementBar",
|
|
115
|
+
slot: "Container",
|
|
116
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
117
|
+
})(({ theme: e }) => ({
|
|
118
|
+
alignItems: "center",
|
|
119
|
+
display: "flex",
|
|
120
|
+
flexWrap: "wrap",
|
|
121
|
+
gap: e.spacing(1),
|
|
122
|
+
minHeight: e.spacing(5),
|
|
123
|
+
paddingBlock: e.spacing(.5),
|
|
124
|
+
position: "relative",
|
|
125
|
+
zIndex: 1
|
|
126
|
+
})), oe = f(r, {
|
|
127
|
+
name: "SAnnouncementBar",
|
|
128
|
+
slot: "Badge",
|
|
129
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
130
|
+
})(({ theme: e }) => ({
|
|
131
|
+
flexShrink: 0,
|
|
132
|
+
height: e.spacing(3),
|
|
133
|
+
variants: [{ props: N }]
|
|
134
|
+
})), se = f(u, {
|
|
135
|
+
name: "SAnnouncementBar",
|
|
136
|
+
slot: "Message",
|
|
137
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
138
|
+
})({
|
|
139
|
+
flex: "1 1 auto",
|
|
140
|
+
minWidth: 0
|
|
141
|
+
}), ce = f(c, {
|
|
142
|
+
name: "SAnnouncementBar",
|
|
143
|
+
slot: "Actions",
|
|
144
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
145
|
+
})(({ theme: e }) => ({
|
|
146
|
+
alignItems: "center",
|
|
147
|
+
color: "inherit",
|
|
148
|
+
display: "flex",
|
|
149
|
+
flexShrink: 0,
|
|
150
|
+
gap: e.spacing(1.5),
|
|
151
|
+
marginInlineStart: "auto",
|
|
152
|
+
"& a": { color: "inherit" },
|
|
153
|
+
variants: [{
|
|
154
|
+
props: ({ ownerState: e }) => e.collapsible,
|
|
155
|
+
style: { [e.breakpoints.down("sm")]: { display: "none" } }
|
|
156
|
+
}, {
|
|
157
|
+
props: ({ ownerState: e }) => e.collapsible && e.expanded,
|
|
158
|
+
style: { [e.breakpoints.down("sm")]: {
|
|
159
|
+
display: "flex",
|
|
160
|
+
flexBasis: "100%",
|
|
161
|
+
marginInlineStart: 0,
|
|
162
|
+
order: 4
|
|
163
|
+
} }
|
|
164
|
+
}]
|
|
165
|
+
})), le = f(n, {
|
|
166
|
+
name: "SAnnouncementBar",
|
|
167
|
+
slot: "ExpandToggle",
|
|
168
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
169
|
+
})(({ theme: e }) => ({
|
|
170
|
+
display: "none",
|
|
171
|
+
flexShrink: 0,
|
|
172
|
+
order: 2,
|
|
173
|
+
[e.breakpoints.down("sm")]: { display: "inline-flex" }
|
|
174
|
+
})), ue = f(n, {
|
|
175
|
+
name: "SAnnouncementBar",
|
|
176
|
+
slot: "DismissButton",
|
|
177
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
178
|
+
})({
|
|
179
|
+
flexShrink: 0,
|
|
180
|
+
order: 3
|
|
181
|
+
}), L = i.forwardRef(function(n, r) {
|
|
182
|
+
let c = p({
|
|
183
|
+
props: n,
|
|
184
|
+
name: "SAnnouncementBar"
|
|
185
|
+
}), { actions: l, animationDuration: u = 7e3, badge: d, children: f, collapseLabel: b = "Hide announcement details", collapsible: x = !1, colors: S, defaultExpanded: C = !1, defaultOpen: w = !0, dismissLabel: T = "Dismiss announcement", dismissible: E = !1, expandLabel: D = "Show announcement details", expanded: O, onClose: k, onExpandedChange: A, open: j, paused: M = !1, slotProps: N, slots: P, sx: F, variant: I = "plain", ...L } = c, [R, z] = h({
|
|
186
|
+
controlled: O,
|
|
187
|
+
default: C,
|
|
188
|
+
name: "SAnnouncementBar",
|
|
189
|
+
state: "expanded"
|
|
190
|
+
}), [B, V] = h({
|
|
191
|
+
controlled: j,
|
|
192
|
+
default: w,
|
|
193
|
+
name: "SAnnouncementBar",
|
|
194
|
+
state: "open"
|
|
195
|
+
}), H = {
|
|
196
|
+
...c,
|
|
197
|
+
animationDuration: u,
|
|
198
|
+
collapsible: x,
|
|
199
|
+
colors: S,
|
|
200
|
+
dismissible: E,
|
|
201
|
+
expanded: R,
|
|
202
|
+
open: B,
|
|
203
|
+
paused: M,
|
|
204
|
+
variant: I
|
|
205
|
+
}, U = P?.root ?? ne, W = P?.glowStart ?? re, G = P?.glowEnd ?? ie, K = P?.container ?? ae, q = P?.badge ?? oe, J = P?.message ?? se, Y = P?.actions ?? ce, X = P?.expandToggle ?? le, Z = P?.dismissButton ?? ue, Q = `${i.useId()}-actions`, de = g((e) => {
|
|
206
|
+
let t = !R;
|
|
207
|
+
z(t), A?.(e, t);
|
|
208
|
+
}), fe = g((e) => {
|
|
209
|
+
V(!1), k?.(e);
|
|
210
|
+
}), { ref: pe, sx: me, ...he } = v(U, m(t(N?.root, H), {
|
|
211
|
+
...L,
|
|
212
|
+
"aria-label": L["aria-label"] ?? "Announcement",
|
|
213
|
+
role: "region"
|
|
214
|
+
}), H), ge = _(pe, r), $ = v(W, t(N?.glowStart, H) ?? {}, H), _e = v(G, t(N?.glowEnd, H) ?? {}, H), ve = v(K, t(N?.container, H) ?? {}, H), ye = v(q, m(t(N?.badge, H), {
|
|
215
|
+
color: "error",
|
|
216
|
+
size: "small"
|
|
217
|
+
}), H), be = v(J, m(t(N?.message, H), {
|
|
218
|
+
component: "span",
|
|
219
|
+
variant: "body2"
|
|
220
|
+
}), H), xe = v(Y, m(t(N?.actions, H), { id: Q }), H), Se = v(X, m(t(N?.expandToggle, H), {
|
|
221
|
+
"aria-controls": Q,
|
|
222
|
+
"aria-expanded": R,
|
|
223
|
+
"aria-label": R ? b : D,
|
|
224
|
+
color: "inherit",
|
|
225
|
+
onClick: de,
|
|
226
|
+
size: "small"
|
|
227
|
+
}), H), Ce = v(Z, m(t(N?.dismissButton, H), {
|
|
228
|
+
"aria-label": T,
|
|
229
|
+
color: "inherit",
|
|
230
|
+
onClick: fe,
|
|
231
|
+
size: "small"
|
|
232
|
+
}), H);
|
|
233
|
+
return B ? /* @__PURE__ */ s(U, {
|
|
234
|
+
...he,
|
|
235
|
+
ref: ge,
|
|
236
|
+
sx: [...e(me), ...e(F)],
|
|
237
|
+
children: [I === "announcement" ? /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(W, {
|
|
238
|
+
...$,
|
|
239
|
+
"aria-hidden": !0
|
|
240
|
+
}), /* @__PURE__ */ o(G, {
|
|
241
|
+
..._e,
|
|
242
|
+
"aria-hidden": !0
|
|
243
|
+
})] }) : null, /* @__PURE__ */ s(K, {
|
|
244
|
+
...ve,
|
|
245
|
+
children: [
|
|
246
|
+
d == null ? null : /* @__PURE__ */ o(q, {
|
|
247
|
+
...ye,
|
|
248
|
+
label: d
|
|
249
|
+
}),
|
|
250
|
+
f == null ? null : /* @__PURE__ */ o(J, {
|
|
251
|
+
...be,
|
|
252
|
+
children: f
|
|
253
|
+
}),
|
|
254
|
+
l == null ? null : /* @__PURE__ */ o(Y, {
|
|
255
|
+
...xe,
|
|
256
|
+
children: l
|
|
257
|
+
}),
|
|
258
|
+
x && l != null ? /* @__PURE__ */ o(X, {
|
|
259
|
+
...Se,
|
|
260
|
+
children: o(R ? y : te, {})
|
|
261
|
+
}) : null,
|
|
262
|
+
E ? /* @__PURE__ */ o(Z, {
|
|
263
|
+
...Ce,
|
|
264
|
+
children: /* @__PURE__ */ o(ee, {})
|
|
265
|
+
}) : null
|
|
266
|
+
]
|
|
267
|
+
})]
|
|
268
|
+
}) : null;
|
|
269
|
+
});
|
|
270
|
+
L.displayName = "SAnnouncementBar";
|
|
271
|
+
//#endregion
|
|
272
|
+
export { L as SAnnouncementBar, L as default };
|
|
@@ -17,6 +17,8 @@ export interface SCarouselSlotProps {
|
|
|
17
17
|
dots?: Omit<BoxProps<'ul'>, 'ref'>;
|
|
18
18
|
nextButton?: SIconButtonProps;
|
|
19
19
|
previousButton?: SIconButtonProps;
|
|
20
|
+
/** Props for the Embla overflow viewport. */
|
|
21
|
+
viewport?: Omit<BoxProps<'div'>, 'children' | 'ref'>;
|
|
20
22
|
}
|
|
21
23
|
export interface SCarouselProps extends Omit<BoxProps, 'children' | 'component'> {
|
|
22
24
|
/** Carousel slides. */
|