@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.
Files changed (102) hide show
  1. package/dist/s-animated-gradient-text/index.d.ts +2 -0
  2. package/dist/s-animated-gradient-text/index.js +2 -0
  3. package/dist/s-animated-gradient-text/s-animated-gradient-text.d.ts +64 -0
  4. package/dist/s-animated-gradient-text/s-animated-gradient-text.js +92 -0
  5. package/dist/s-announcement-bar/index.d.ts +2 -0
  6. package/dist/s-announcement-bar/index.js +2 -0
  7. package/dist/s-announcement-bar/s-announcement-bar.d.ts +113 -0
  8. package/dist/s-announcement-bar/s-announcement-bar.js +272 -0
  9. package/dist/s-carousel/s-carousel.d.ts +2 -0
  10. package/dist/s-carousel/s-carousel.js +52 -50
  11. package/dist/s-date-picker/s-date-picker.js +1 -1
  12. package/dist/s-datetime-picker/s-datetime-picker.js +1 -1
  13. package/dist/s-drawer/index.d.ts +3 -0
  14. package/dist/s-drawer/index.js +2 -0
  15. package/dist/s-drawer/s-drawer.d.ts +70 -0
  16. package/dist/s-drawer/s-drawer.js +139 -0
  17. package/dist/s-gradient-blob-pulse/index.d.ts +2 -0
  18. package/dist/s-gradient-blob-pulse/index.js +2 -0
  19. package/dist/s-gradient-blob-pulse/s-gradient-blob-pulse.d.ts +62 -0
  20. package/dist/s-gradient-blob-pulse/s-gradient-blob-pulse.js +236 -0
  21. package/dist/s-gradient-icon/index.d.ts +1 -1
  22. package/dist/s-gradient-icon/s-gradient-icon.d.ts +4 -4
  23. package/dist/s-gradient-icon/s-gradient-icon.js +2 -2
  24. package/dist/s-icon-button/s-icon-button.d.ts +6 -2
  25. package/dist/s-interactive-card/index.d.ts +3 -0
  26. package/dist/s-interactive-card/index.js +2 -0
  27. package/dist/s-interactive-card/s-interactive-card.d.ts +57 -0
  28. package/dist/s-interactive-card/s-interactive-card.js +150 -0
  29. package/dist/s-language-switcher/s-language-switcher.js +66 -71
  30. package/dist/s-list-action-item/index.d.ts +2 -0
  31. package/dist/s-list-action-item/index.js +2 -0
  32. package/dist/s-list-action-item/s-list-action-item.d.ts +89 -0
  33. package/dist/s-list-action-item/s-list-action-item.js +149 -0
  34. package/dist/s-mega-menu/index.d.ts +3 -0
  35. package/dist/s-mega-menu/index.js +2 -0
  36. package/dist/s-mega-menu/mega-menu-panel.d.ts +38 -0
  37. package/dist/s-mega-menu/mega-menu-panel.js +251 -0
  38. package/dist/s-mega-menu/mega-menu-slots.d.ts +65 -0
  39. package/dist/s-mega-menu/mega-menu-slots.js +232 -0
  40. package/dist/s-mega-menu/mega-menu-trigger.d.ts +35 -0
  41. package/dist/s-mega-menu/mega-menu-trigger.js +49 -0
  42. package/dist/s-mega-menu/s-mega-menu.d.ts +23 -0
  43. package/dist/s-mega-menu/s-mega-menu.js +225 -0
  44. package/dist/s-mega-menu/types.d.ts +188 -0
  45. package/dist/s-mega-menu/types.js +0 -0
  46. package/dist/s-mega-menu/utils.d.ts +51 -0
  47. package/dist/s-mega-menu/utils.js +51 -0
  48. package/dist/s-mobile-dock/index.d.ts +3 -0
  49. package/dist/s-mobile-dock/index.js +2 -0
  50. package/dist/s-mobile-dock/s-mobile-dock.d.ts +96 -0
  51. package/dist/s-mobile-dock/s-mobile-dock.js +145 -0
  52. package/dist/s-nav-item/index.d.ts +1 -1
  53. package/dist/s-nav-item/s-nav-item.d.ts +35 -16
  54. package/dist/s-nav-item/s-nav-item.js +55 -77
  55. package/dist/s-nav-items/s-nav-items.js +68 -112
  56. package/dist/s-number-range/index.d.ts +3 -0
  57. package/dist/s-number-range/index.js +2 -0
  58. package/dist/s-number-range/s-number-range.d.ts +109 -0
  59. package/dist/s-number-range/s-number-range.js +250 -0
  60. package/dist/s-popover/index.d.ts +5 -0
  61. package/dist/s-popover/index.js +3 -0
  62. package/dist/s-popover/placement.d.ts +14 -0
  63. package/dist/s-popover/placement.js +65 -0
  64. package/dist/s-popover/s-popover-content.d.ts +22 -0
  65. package/dist/s-popover/s-popover-content.js +21 -0
  66. package/dist/s-popover/s-popover.d.ts +59 -0
  67. package/dist/s-popover/s-popover.js +66 -0
  68. package/dist/s-product-card/index.d.ts +3 -0
  69. package/dist/s-product-card/index.js +2 -0
  70. package/dist/s-product-card/s-product-card.d.ts +216 -0
  71. package/dist/s-product-card/s-product-card.js +499 -0
  72. package/dist/s-product-gallery/index.d.ts +3 -0
  73. package/dist/s-product-gallery/index.js +2 -0
  74. package/dist/s-product-gallery/s-product-gallery.d.ts +116 -0
  75. package/dist/s-product-gallery/s-product-gallery.js +427 -0
  76. package/dist/s-scroll-to-top/s-scroll-to-top.d.ts +1 -1
  77. package/dist/s-segmented-control/index.d.ts +3 -0
  78. package/dist/s-segmented-control/index.js +2 -0
  79. package/dist/s-segmented-control/s-segmented-control.d.ts +94 -0
  80. package/dist/s-segmented-control/s-segmented-control.js +298 -0
  81. package/dist/s-stepper/index.d.ts +3 -0
  82. package/dist/s-stepper/index.js +2 -0
  83. package/dist/s-stepper/s-stepper.d.ts +90 -0
  84. package/dist/s-stepper/s-stepper.js +102 -0
  85. package/dist/s-swatch/index.d.ts +3 -0
  86. package/dist/s-swatch/index.js +2 -0
  87. package/dist/s-swatch/s-swatch.d.ts +235 -0
  88. package/dist/s-swatch/s-swatch.js +218 -0
  89. package/dist/s-text-editor/s-text-editor-toolbar.js +105 -108
  90. package/dist/s-tool-item/s-tool-item.d.ts +10 -6
  91. package/dist/s-tool-item/s-tool-item.js +12 -12
  92. package/dist/theme/component-augmentation.d.ts +65 -1
  93. package/dist/theme/components/drawer.d.ts +1 -0
  94. package/dist/theme/components/drawer.js +4 -1
  95. package/dist/theme/components/slider.js +18 -1
  96. package/dist/theme/components/step-connector.d.ts +0 -3
  97. package/dist/theme/components/step-connector.js +1 -6
  98. package/dist/theme/components/step-icon.d.ts +3 -12
  99. package/dist/theme/components/step-icon.js +3 -14
  100. package/package.json +7 -2
  101. package/dist/theme/components/components.d.ts +0 -2
  102. package/dist/theme/components/slider.d.ts +0 -34
@@ -0,0 +1,236 @@
1
+ import { toSxArray as e } from "../utils/sx.js";
2
+ import { resolveOwnerStateSlotProps as t } from "../utils/slots.js";
3
+ import * as n from "react";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import { Box as a, keyframes as o, styled as s, useThemeProps as c } from "@mui/material";
6
+ import { mergeSlotProps as l, useForkRef as u } from "@mui/material/utils";
7
+ import d from "@mui/utils/appendOwnerState";
8
+ //#region lib/s-gradient-blob-pulse/s-gradient-blob-pulse.tsx
9
+ var f = "--SGradientBlobPulse-blur", p = {
10
+ large: {
11
+ blobSizes: [
12
+ 260,
13
+ 200,
14
+ 140
15
+ ],
16
+ blur: 40
17
+ },
18
+ medium: {
19
+ blobSizes: [
20
+ 180,
21
+ 140,
22
+ 100
23
+ ],
24
+ blur: 28
25
+ },
26
+ small: {
27
+ blobSizes: [
28
+ 80,
29
+ 60,
30
+ 40
31
+ ],
32
+ blur: 14
33
+ }
34
+ }, m = 1.3, h = {
35
+ balanced: {
36
+ colorCore: "50%",
37
+ colorMid: "18%",
38
+ fadeEnd: "64%",
39
+ fadeMid: "34%",
40
+ opacities: [
41
+ .48,
42
+ .38,
43
+ .32
44
+ ],
45
+ sizeScale: 1
46
+ },
47
+ soft: {
48
+ colorCore: "34%",
49
+ colorMid: "10%",
50
+ fadeEnd: "52%",
51
+ fadeMid: "26%",
52
+ opacities: [
53
+ .28,
54
+ .22,
55
+ .18
56
+ ],
57
+ sizeScale: 1
58
+ },
59
+ vivid: {
60
+ colorCore: "68%",
61
+ colorMid: "30%",
62
+ fadeEnd: "74%",
63
+ fadeMid: "40%",
64
+ opacities: [
65
+ .62,
66
+ .52,
67
+ .44
68
+ ],
69
+ sizeScale: 1.08
70
+ }
71
+ }, g = [
72
+ {
73
+ colorDelay: 0,
74
+ pulseDelay: 0,
75
+ pulseDuration: 1
76
+ },
77
+ {
78
+ colorDelay: .625,
79
+ pulseDelay: -.1875,
80
+ pulseDuration: .875
81
+ },
82
+ {
83
+ colorDelay: 1.25,
84
+ pulseDelay: -.34375,
85
+ pulseDuration: 1.125
86
+ }
87
+ ], _ = 2.5, v = [
88
+ o`
89
+ 0%, 100% { transform: translate(-54%, -50%) scale(1); }
90
+ 50% { transform: translate(-47%, -55%) scale(1.22); }
91
+ `,
92
+ o`
93
+ 0%, 100% { transform: translate(-46%, -48%) scale(1); }
94
+ 50% { transform: translate(-53%, -43%) scale(1.16); }
95
+ `,
96
+ o`
97
+ 0%, 100% { transform: translate(-50%, -56%) scale(1); }
98
+ 50% { transform: translate(-43%, -49%) scale(1.25); }
99
+ `
100
+ ], y = o`
101
+ 0%, 100% { background-image: var(--SGradientBlobPulse-gradient-1); }
102
+ 25% { background-image: var(--SGradientBlobPulse-gradient-2); }
103
+ 50% { background-image: var(--SGradientBlobPulse-gradient-3); }
104
+ 75% { background-image: var(--SGradientBlobPulse-gradient-4); }
105
+ `, b = (e, t) => {
106
+ let n = (e.vars ?? e).palette, r = t.colors?.length ? t.colors : [
107
+ n.primary[300],
108
+ n.primary[600],
109
+ n.secondary[400],
110
+ n.secondary[600]
111
+ ];
112
+ return [
113
+ r[0],
114
+ r[1] ?? r[0],
115
+ r[2] ?? r[0],
116
+ r[3] ?? r[0]
117
+ ];
118
+ }, x = s(a, {
119
+ name: "SGradientBlobPulse",
120
+ slot: "Root",
121
+ shouldForwardProp: (e) => e !== "ownerState"
122
+ })(({ ownerState: e, theme: t }) => {
123
+ let n = p[e.size], r = h[e.variant], i = b(t, e), a = `${Math.round(n.blobSizes[0] * m)}px`, o = i.reduce((e, t, n) => ({
124
+ ...e,
125
+ [`--SGradientBlobPulse-gradient-${n + 1}`]: [
126
+ "radial-gradient(circle,",
127
+ `color-mix(in srgb, ${t} ${r.colorCore}, transparent) 0%,`,
128
+ `color-mix(in srgb, ${t} ${r.colorMid}, transparent) ${r.fadeMid},`,
129
+ `transparent ${r.fadeEnd})`
130
+ ].join(" ")
131
+ }), {}), s = i.reduce((e, t, n) => ({
132
+ ...e,
133
+ [`--SGradientBlobPulse-gradient-${n + 1}`]: `radial-gradient(circle, ${t} 0%, transparent ${r.fadeEnd})`
134
+ }), {}), c = n.blobSizes.reduce((e, t, n) => ({
135
+ ...e,
136
+ [`--SGradientBlobPulse-blobSize-${n + 1}`]: `${Math.round(t * r.sizeScale)}px`
137
+ }), {}), l = r.opacities.reduce((e, t, n) => ({
138
+ ...e,
139
+ [`--SGradientBlobPulse-opacity-${n + 1}`]: String(t)
140
+ }), {}), u = g.reduce((t, n, r) => ({
141
+ ...t,
142
+ [`--SGradientBlobPulse-colorDelay-${r + 1}`]: `${Math.round(e.animationDuration * n.colorDelay)}ms`,
143
+ [`--SGradientBlobPulse-pulseDelay-${r + 1}`]: `${Math.round(e.animationDuration * n.pulseDelay)}ms`,
144
+ [`--SGradientBlobPulse-pulseDuration-${r + 1}`]: `${Math.round(e.animationDuration * n.pulseDuration)}ms`
145
+ }), {});
146
+ return {
147
+ [f]: `${n.blur}px`,
148
+ "--SGradientBlobPulse-colorDuration": `${Math.round(e.animationDuration * _)}ms`,
149
+ ...o,
150
+ ...c,
151
+ ...l,
152
+ ...u,
153
+ alignItems: "center",
154
+ display: "inline-flex",
155
+ isolation: "isolate",
156
+ justifyContent: "center",
157
+ minHeight: a,
158
+ minWidth: a,
159
+ position: "relative",
160
+ "@supports not (color: color-mix(in srgb, red, blue))": s
161
+ };
162
+ }), S = s(a, {
163
+ name: "SGradientBlobPulse",
164
+ slot: "Blob",
165
+ shouldForwardProp: (e) => e !== "ownerState"
166
+ })(({ theme: e }) => ({
167
+ borderRadius: e.radius.full,
168
+ filter: `blur(var(${f}))`,
169
+ left: "50%",
170
+ mixBlendMode: "normal",
171
+ pointerEvents: "none",
172
+ position: "absolute",
173
+ top: "50%",
174
+ willChange: "transform",
175
+ zIndex: 0,
176
+ "@media (prefers-reduced-motion: reduce)": { animation: "none !important" },
177
+ ...e.applyStyles("dark", { mixBlendMode: "screen" }),
178
+ variants: [...v.map((t, n) => ({
179
+ props: ({ ownerState: e }) => e.index === n,
180
+ style: {
181
+ animation: [`${t} var(--SGradientBlobPulse-pulseDuration-${n + 1}) ${e.transitions.easing.easeInOut} infinite`, `${y} var(--SGradientBlobPulse-colorDuration) linear infinite`].join(", "),
182
+ animationDelay: `var(--SGradientBlobPulse-pulseDelay-${n + 1}), var(--SGradientBlobPulse-colorDelay-${n + 1})`,
183
+ backgroundImage: `var(--SGradientBlobPulse-gradient-${n + 1})`,
184
+ height: `var(--SGradientBlobPulse-blobSize-${n + 1})`,
185
+ opacity: `var(--SGradientBlobPulse-opacity-${n + 1})`,
186
+ width: `var(--SGradientBlobPulse-blobSize-${n + 1})`
187
+ }
188
+ })), {
189
+ props: ({ ownerState: e }) => e.paused,
190
+ style: { animationPlayState: "paused" }
191
+ }]
192
+ })), C = s(a, {
193
+ name: "SGradientBlobPulse",
194
+ slot: "Content",
195
+ shouldForwardProp: (e) => e !== "ownerState"
196
+ })({
197
+ position: "relative",
198
+ zIndex: 1
199
+ }), w = [
200
+ 0,
201
+ 1,
202
+ 2
203
+ ], T = n.forwardRef(function(n, a) {
204
+ let o = c({
205
+ props: n,
206
+ name: "SGradientBlobPulse"
207
+ }), { animationDuration: s = 3200, children: f, colors: p, paused: m = !1, size: h = "medium", slotProps: g, slots: _, sx: v, variant: y = "balanced", ...b } = o, T = {
208
+ ...o,
209
+ animationDuration: s,
210
+ colors: p,
211
+ paused: m,
212
+ size: h,
213
+ variant: y
214
+ }, E = _?.root ?? x, D = _?.blob ?? S, O = _?.content ?? C, { ref: k, sx: A, ...j } = d(E, l(t(g?.root, T), b), T), M = u(k, a), N = d(O, t(g?.content, T) ?? {}, T);
215
+ return /* @__PURE__ */ i(E, {
216
+ ...j,
217
+ ref: M,
218
+ sx: [...e(A), ...e(v)],
219
+ children: [w.map((e) => {
220
+ let n = {
221
+ ...T,
222
+ index: e
223
+ };
224
+ return /* @__PURE__ */ r(D, {
225
+ ...d(D, t(g?.blob, n) ?? {}, n),
226
+ "aria-hidden": !0
227
+ }, e);
228
+ }), /* @__PURE__ */ r(O, {
229
+ ...N,
230
+ children: f
231
+ })]
232
+ });
233
+ });
234
+ T.displayName = "SGradientBlobPulse";
235
+ //#endregion
236
+ export { T as SGradientBlobPulse, T as default };
@@ -1,3 +1,3 @@
1
1
  export { default, default as SGradientIcon } from './s-gradient-icon';
2
- export type { AnimationEasing, CustomGradient, GradientDirection, GradientRole, SGradientIconOwnerState, SGradientIconProps, } from './s-gradient-icon';
2
+ export type { AnimationEasing, CustomGradient, GradientRole, SGradientIconDirection, SGradientIconOwnerState, SGradientIconProps, } from './s-gradient-icon';
3
3
  export type {} from '../theme/component-augmentation';
@@ -6,7 +6,7 @@ type IconComponent = OverridableComponent<SvgIconTypeMap<object, 'svg'>> & {
6
6
  muiName: string;
7
7
  };
8
8
  /** Gradient direction options */
9
- export type GradientDirection = 'horizontal' | 'vertical' | 'diagonal' | 'radial';
9
+ export type SGradientIconDirection = 'horizontal' | 'vertical' | 'diagonal' | 'radial';
10
10
  /** Semantic gradient roles */
11
11
  export type GradientRole = 'brand-primary' | 'brand-subtle' | 'custom';
12
12
  /** Animation easing options */
@@ -23,7 +23,7 @@ export interface CustomGradient {
23
23
  middlePosition?: number;
24
24
  }
25
25
  /** Props interface for SGradientIcon component */
26
- export interface SGradientIconProps extends Omit<SvgIconProps, 'component'> {
26
+ export interface SGradientIconProps extends Omit<SvgIconProps, 'component' | 'direction'> {
27
27
  /** Whether the icon should show the gradient fill (hover state) */
28
28
  hovered?: boolean;
29
29
  /** The Material-UI icon component to render with gradient effect */
@@ -37,7 +37,7 @@ export interface SGradientIconProps extends Omit<SvgIconProps, 'component'> {
37
37
  /** Custom gradient colors when role is 'custom' */
38
38
  customGradient?: CustomGradient;
39
39
  /** Direction of the gradient (default: 'diagonal') */
40
- gradientDirection?: GradientDirection;
40
+ direction?: SGradientIconDirection;
41
41
  /** Animation duration in milliseconds (default: 300) */
42
42
  animationDuration?: number;
43
43
  /** Animation easing function (default: 'ease') */
@@ -56,7 +56,7 @@ export type SGradientIconOwnerState = SGradientIconProps & {
56
56
  animationDuration: number;
57
57
  animationEasing: AnimationEasing;
58
58
  autoHover: boolean;
59
- gradientDirection: GradientDirection;
59
+ direction: SGradientIconDirection;
60
60
  gradientRole: GradientRole;
61
61
  hovered: boolean;
62
62
  strokeWidth: number;
@@ -14,7 +14,7 @@ var l = o(t(({ IconComponent: e, ...t }, n) => /* @__PURE__ */ i(e, {
14
14
  let u = c({
15
15
  props: t,
16
16
  name: "SGradientIcon"
17
- }), { hovered: d = !1, IconComponent: f, sx: p, strokeWidth: m = 0, gradientRole: h = "brand-primary", customGradient: g, gradientDirection: _ = "diagonal", animationDuration: v = 300, animationEasing: y = "ease", autoHover: b = !1, gradientId: x, alwaysGradient: S = !1, fallbackColor: C, ...w } = u, T = s(), E = (T.vars ?? T).palette, D = n(), O = x ?? `gradient-${D}`, k = {
17
+ }), { hovered: d = !1, IconComponent: f, sx: p, strokeWidth: m = 0, gradientRole: h = "brand-primary", customGradient: g, direction: _ = "diagonal", animationDuration: v = 300, animationEasing: y = "ease", autoHover: b = !1, gradientId: x, alwaysGradient: S = !1, fallbackColor: C, ...w } = u, T = s(), E = (T.vars ?? T).palette, D = n(), O = x ?? `gradient-${D}`, k = {
18
18
  "brand-primary": {
19
19
  start: E.primary[400],
20
20
  end: E.primary[700]
@@ -63,7 +63,7 @@ var l = o(t(({ IconComponent: e, ...t }, n) => /* @__PURE__ */ i(e, {
63
63
  animationDuration: v,
64
64
  animationEasing: y,
65
65
  autoHover: b,
66
- gradientDirection: _,
66
+ direction: _,
67
67
  gradientRole: h,
68
68
  hovered: d,
69
69
  strokeWidth: m
@@ -17,8 +17,12 @@ export interface SIconButtonSlotProps {
17
17
  /** Props or an owner-state callback for the tooltip slot. */
18
18
  tooltip?: OwnerStateSlotProps<Omit<TooltipProps, 'children' | 'title'>>;
19
19
  }
20
- /** MUI IconButton with an optional tooltip slot. */
21
- export interface SIconButtonProps extends Omit<IconButtonProps, 'component'> {
20
+ /**
21
+ * MUI IconButton with an optional tooltip slot. Setting `href` makes the
22
+ * underlying ButtonBase render an anchor, so icon-only links keep the button
23
+ * hit target and hover state.
24
+ */
25
+ export interface SIconButtonProps extends Omit<IconButtonProps, 'component'>, Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'rel' | 'target'> {
22
26
  /** Components used for internal slots. */
23
27
  slots?: SIconButtonSlots;
24
28
  /** Props or owner-state callbacks for internal slots. */
@@ -0,0 +1,3 @@
1
+ export { default, default as SInteractiveCard } from './s-interactive-card';
2
+ export type { SInteractiveCardActionAreaProps, SInteractiveCardOwnerState, SInteractiveCardProps, SInteractiveCardSlotProps, SInteractiveCardSlots, } from './s-interactive-card';
3
+ export type {} from '../theme/component-augmentation';
@@ -0,0 +1,2 @@
1
+ import { SInteractiveCard as e } from "./s-interactive-card.js";
2
+ export { e as SInteractiveCard, e as default };
@@ -0,0 +1,57 @@
1
+ import { BoxProps, CardActionAreaProps, CardProps } from '@mui/material';
2
+ import { OwnerStateSlotProps as MuiOwnerStateSlotProps } from '../utils/slots';
3
+ import * as React from 'react';
4
+ export interface SInteractiveCardSlots {
5
+ /** Element wrapping the children when the card is clickable. */
6
+ actionArea?: React.ElementType;
7
+ /** Decorative layer rendered above the content. */
8
+ overlay?: React.ElementType;
9
+ /** Card surface element. */
10
+ root?: React.ElementType;
11
+ }
12
+ type OwnerStateSlotProps<Props> = MuiOwnerStateSlotProps<Props, SInteractiveCardOwnerState>;
13
+ /** Action area props, widened with the anchor attributes used when `href` is set. */
14
+ export type SInteractiveCardActionAreaProps = CardActionAreaProps & Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'rel' | 'target'>;
15
+ export interface SInteractiveCardSlotProps {
16
+ /** Props or owner-state callback for the action area slot. */
17
+ actionArea?: OwnerStateSlotProps<SInteractiveCardActionAreaProps>;
18
+ /** Props or owner-state callback for the overlay slot. */
19
+ overlay?: OwnerStateSlotProps<BoxProps>;
20
+ /** Props or owner-state callback for the root slot. */
21
+ root?: OwnerStateSlotProps<Omit<CardProps, 'children'>>;
22
+ }
23
+ /** Props for a card surface with a hover-lift and focus interaction language. */
24
+ export interface SInteractiveCardProps extends Omit<CardProps, 'children' | 'component' | 'onClick'> {
25
+ /**
26
+ * Card content. When `href` or `onClick` is provided, the content is wrapped
27
+ * in one `CardActionArea` and must not contain nested interactive controls.
28
+ */
29
+ children?: React.ReactNode;
30
+ /** Keeps the hover border feedback but removes the translate and scale. */
31
+ disableLift?: boolean;
32
+ /** Disables the primary action and all built-in interaction effects. */
33
+ disabled?: boolean;
34
+ /** Link destination. When set, the card action area renders with anchor semantics. */
35
+ href?: string;
36
+ /** Enables the surface lift, border and sheen effects without changing action semantics. */
37
+ interactive?: boolean;
38
+ /** Called when the card action area is activated. */
39
+ onClick?: React.MouseEventHandler<HTMLElement>;
40
+ /** Decorative content rendered in the overlay layer. Always `aria-hidden`. */
41
+ overlay?: React.ReactNode;
42
+ /** Sweeps a light sheen across the card on hover/focus. Disabled by default. */
43
+ sheen?: boolean;
44
+ /** Components used for internal structural slots. */
45
+ slots?: SInteractiveCardSlots;
46
+ /** Props or owner-state callbacks for internal structural slots. */
47
+ slotProps?: SInteractiveCardSlotProps;
48
+ }
49
+ export interface SInteractiveCardOwnerState extends Omit<SInteractiveCardProps, 'slotProps' | 'slots'> {
50
+ clickable: boolean;
51
+ disableLift: boolean;
52
+ disabled: boolean;
53
+ interactive: boolean;
54
+ sheen: boolean;
55
+ }
56
+ export declare const SInteractiveCard: React.ForwardRefExoticComponent<Omit<SInteractiveCardProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
57
+ export default SInteractiveCard;
@@ -0,0 +1,150 @@
1
+ import { toSxArray as e } from "../utils/sx.js";
2
+ import { resolveOwnerStateSlotProps as t } from "../utils/slots.js";
3
+ import { actionHoverMedia as n, getFocusVisibleStyle as r, reducedMotionMedia as i } from "../theme/components/action-styles.js";
4
+ import * as a from "react";
5
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ import { Box as c, Card as l, CardActionArea as u, keyframes as d, styled as f, useThemeProps as p } from "@mui/material";
7
+ import { mergeSlotProps as m, useEventCallback as h, useForkRef as g } from "@mui/material/utils";
8
+ import _ from "@mui/utils/appendOwnerState";
9
+ //#region lib/s-interactive-card/s-interactive-card.tsx
10
+ var v = "55%", y = "-18deg", b = "-140%", x = d`
11
+ from {
12
+ transform: translateX(${b}) skewX(${y});
13
+ }
14
+ to {
15
+ transform: translateX(${"260%"}) skewX(${y});
16
+ }
17
+ `, S = (e) => ({ [n]: { "&:hover": e } }), C = (e) => ({
18
+ ...S(e),
19
+ "&:has(.Mui-focusVisible)": e
20
+ }), w = f(l, {
21
+ name: "SInteractiveCard",
22
+ slot: "Root",
23
+ shouldForwardProp: (e) => e !== "ownerState"
24
+ })(({ theme: e }) => ({
25
+ borderRadius: e.radius.md,
26
+ overflow: "hidden",
27
+ position: "relative",
28
+ transition: e.transitions.create(["border-color", "transform"], {
29
+ duration: e.transitions.duration.complex,
30
+ easing: e.transitions.easing.easeOut
31
+ }),
32
+ zIndex: 0,
33
+ [i]: { transition: "none" },
34
+ variants: [
35
+ {
36
+ props: ({ ownerState: e }) => e.interactive && !e.disabled,
37
+ style: C({ borderColor: (e.vars ?? e).palette.primary.main })
38
+ },
39
+ {
40
+ props: ({ ownerState: e }) => e.interactive && !e.disabled && !e.disableLift,
41
+ style: {
42
+ ...S({ transform: `translateY(calc(${e.spacing(1.5)} * -1)) scale(1.02)` }),
43
+ [i]: S({ transform: "none" })
44
+ }
45
+ },
46
+ {
47
+ props: ({ ownerState: e }) => e.interactive && !e.disabled && e.sheen,
48
+ style: {
49
+ "&::after": {
50
+ backgroundImage: `linear-gradient(90deg, transparent, ${(e.vars ?? e).palette.whiteAlpha.light}, transparent)`,
51
+ content: "\"\"",
52
+ height: "100%",
53
+ insetBlockStart: 0,
54
+ insetInlineStart: 0,
55
+ pointerEvents: "none",
56
+ position: "absolute",
57
+ transform: `translateX(${b}) skewX(${y})`,
58
+ width: v,
59
+ willChange: "transform",
60
+ zIndex: 2
61
+ },
62
+ ...S({ "&::after": { animation: `${x} ${e.transitions.duration.complex}ms ${e.transitions.easing.easeOut} forwards` } }),
63
+ [i]: { "&::after": { content: "none" } }
64
+ }
65
+ },
66
+ {
67
+ props: ({ ownerState: e }) => e.disabled,
68
+ style: {
69
+ borderColor: (e.vars ?? e).palette.divider,
70
+ boxShadow: "none"
71
+ }
72
+ }
73
+ ]
74
+ })), T = f(u, {
75
+ name: "SInteractiveCard",
76
+ slot: "ActionArea",
77
+ shouldForwardProp: (e) => e !== "ownerState"
78
+ })(({ theme: e }) => ({
79
+ borderRadius: "inherit",
80
+ display: "block",
81
+ height: "100%",
82
+ textAlign: "inherit",
83
+ width: "100%",
84
+ "&.Mui-focusVisible": {
85
+ ...r(e),
86
+ outlineOffset: -2
87
+ }
88
+ })), E = f(c, {
89
+ name: "SInteractiveCard",
90
+ slot: "Overlay",
91
+ shouldForwardProp: (e) => e !== "ownerState"
92
+ })({
93
+ borderRadius: "inherit",
94
+ inset: 0,
95
+ overflow: "hidden",
96
+ pointerEvents: "none",
97
+ position: "absolute",
98
+ zIndex: 1
99
+ }), D = a.forwardRef(function(n, r) {
100
+ let i = p({
101
+ props: n,
102
+ name: "SInteractiveCard"
103
+ }), { "aria-describedby": a, "aria-label": c, "aria-labelledby": l, children: u, disableLift: d = !1, disabled: f = !1, href: v, interactive: y = !0, onClick: b, overlay: x, sheen: S = !1, slotProps: C, slots: D, sx: O, ...k } = i, A = v !== void 0 || b !== void 0, j = {
104
+ ...i,
105
+ clickable: A,
106
+ disableLift: d,
107
+ disabled: f,
108
+ interactive: y,
109
+ sheen: S
110
+ }, M = D?.root ?? w, N = D?.actionArea ?? T, P = D?.overlay ?? E, F = h((e) => {
111
+ if (f) {
112
+ e.preventDefault();
113
+ return;
114
+ }
115
+ b?.(e);
116
+ }), { ref: I, sx: L, ...R } = _(M, m(t(C?.root, j), {
117
+ ...k,
118
+ "aria-describedby": A ? void 0 : a,
119
+ "aria-label": A ? void 0 : c,
120
+ "aria-labelledby": A ? void 0 : l
121
+ }), j), z = g(I, r), B = m(t(C?.actionArea, j), {
122
+ "aria-describedby": a,
123
+ "aria-label": c,
124
+ "aria-labelledby": l,
125
+ onClick: F
126
+ }), V = _(N, {
127
+ ...B,
128
+ component: v === void 0 ? "button" : "a",
129
+ disabled: f || B.disabled,
130
+ href: v,
131
+ nativeButton: v === void 0,
132
+ type: v === void 0 ? "button" : void 0
133
+ }, j), H = _(P, t(C?.overlay, j) ?? {}, j);
134
+ return /* @__PURE__ */ s(M, {
135
+ ...R,
136
+ ref: z,
137
+ sx: [...e(L), ...e(O)],
138
+ children: [A ? /* @__PURE__ */ o(N, {
139
+ ...V,
140
+ children: u
141
+ }) : u, x == null ? null : /* @__PURE__ */ o(P, {
142
+ ...H,
143
+ "aria-hidden": !0,
144
+ children: x
145
+ })]
146
+ });
147
+ });
148
+ D.displayName = "SInteractiveCard";
149
+ //#endregion
150
+ export { D as SInteractiveCard, D as default };