@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,145 @@
1
+ import { resolveOwnerStateSlotProps as e } from "../utils/slots.js";
2
+ import { actionHoverMedia as t, getFocusVisibleStyle as n, reducedMotionMedia as r } from "../theme/components/action-styles.js";
3
+ import { styled as i, useThemeProps as a } from "@mui/material/styles";
4
+ import * as o from "react";
5
+ import { createElement as s } from "react";
6
+ import { jsx as c } from "react/jsx-runtime";
7
+ import { mergeSlotProps as l, useControlled as u, useEventCallback as d, useForkRef as f } from "@mui/material/utils";
8
+ import p from "@mui/utils/appendOwnerState";
9
+ import { visuallyHidden as m } from "@mui/utils";
10
+ import h from "@mui/material/Box";
11
+ import g from "@mui/material/Badge";
12
+ import _ from "@mui/material/BottomNavigation";
13
+ import v, { bottomNavigationActionClasses as y } from "@mui/material/BottomNavigationAction";
14
+ //#region lib/s-mobile-dock/s-mobile-dock.tsx
15
+ var b = 416, x = 44, S = i(_, {
16
+ name: "SMobileDock",
17
+ slot: "Root",
18
+ shouldForwardProp: (e) => e !== "ownerState"
19
+ })(({ theme: e }) => ({
20
+ backgroundColor: (e.vars ?? e).palette.background.paper,
21
+ border: `1px solid ${(e.vars ?? e).palette.divider}`,
22
+ borderRadius: e.radius.full,
23
+ boxShadow: e.shadows[8],
24
+ gap: e.spacing(.5),
25
+ height: "auto",
26
+ justifyContent: "space-around",
27
+ marginInline: "auto",
28
+ maxWidth: `calc(100% - ${e.spacing(3)})`,
29
+ padding: e.spacing(.75),
30
+ paddingBottom: `calc(${e.spacing(.75)} + env(safe-area-inset-bottom))`,
31
+ width: b
32
+ })), C = i(v, {
33
+ name: "SMobileDock",
34
+ slot: "Action"
35
+ })(({ theme: e, ownerState: i }) => ({
36
+ borderRadius: e.radius.full,
37
+ color: (e.vars ?? e).palette.text.secondary,
38
+ gap: e.spacing(.5),
39
+ minHeight: x,
40
+ minWidth: x,
41
+ padding: e.spacing(.75, 1),
42
+ transition: e.transitions.create(["background-color", "color"], { duration: e.transitions.duration.shorter }),
43
+ [`& .${y.label}`]: {
44
+ fontSize: e.typography.body2.fontSize,
45
+ lineHeight: e.typography.body2.lineHeight,
46
+ [`&.${y.selected}`]: { fontSize: e.typography.body2.fontSize },
47
+ ...i.labelVisibility === "never" && m
48
+ },
49
+ [`&.${y.selected}`]: {
50
+ backgroundColor: e.alpha((e.vars ?? e).palette.primary.main, (e.vars ?? e).palette.action.selectedOpacity),
51
+ color: (e.vars ?? e).palette.primary.main
52
+ },
53
+ "&.Mui-disabled": { color: (e.vars ?? e).palette.action.disabled },
54
+ [`&.${y.selected}.Mui-disabled`]: { backgroundColor: (e.vars ?? e).palette.action.disabledBackground },
55
+ "&.Mui-focusVisible": n(e),
56
+ [t]: {
57
+ "&:hover": {
58
+ backgroundColor: (e.vars ?? e).palette.action.hover,
59
+ color: (e.vars ?? e).palette.text.primary
60
+ },
61
+ [`&.${y.selected}:hover`]: {
62
+ backgroundColor: e.alpha((e.vars ?? e).palette.primary.main, Math.min(e.palette.action.selectedOpacity + e.palette.action.hoverOpacity, 1)),
63
+ color: (e.vars ?? e).palette.primary.main
64
+ }
65
+ },
66
+ [r]: { transition: "none" }
67
+ })), w = i(h, {
68
+ name: "SMobileDock",
69
+ slot: "Icon"
70
+ })({
71
+ alignItems: "center",
72
+ display: "flex",
73
+ justifyContent: "center"
74
+ }), T = i(g, {
75
+ name: "SMobileDock",
76
+ slot: "Badge"
77
+ })({}), E = i("span", {
78
+ name: "SMobileDock",
79
+ slot: "Label"
80
+ })({});
81
+ function D(t, n) {
82
+ let r = a({
83
+ props: t,
84
+ name: "SMobileDock"
85
+ }), { defaultValue: i, items: o, labelVisibility: m = "always", linkComponent: h, onChange: g, slotProps: _, slots: v, value: y, ...b } = r, [x, D] = u({
86
+ controlled: y,
87
+ default: i ?? null,
88
+ name: "SMobileDock",
89
+ state: "value"
90
+ }), O = {
91
+ ...r,
92
+ labelVisibility: m,
93
+ value: x
94
+ }, k = v?.root ?? S, A = v?.action ?? C, j = v?.icon ?? w, M = v?.badge ?? T, N = v?.label ?? E, P = d((e, t) => {
95
+ D(t), g?.(e, t);
96
+ }), { ref: F, ...I } = p(k, l(e(_?.root, O), {
97
+ ...b,
98
+ onChange: P,
99
+ showLabels: !0,
100
+ value: x
101
+ }), O), L = f(n, F);
102
+ return /* @__PURE__ */ c(k, {
103
+ ...I,
104
+ ref: L,
105
+ component: "nav",
106
+ children: o.map((t) => {
107
+ let n = t.value === x, r = {
108
+ ...O,
109
+ item: t,
110
+ selected: n
111
+ }, i = t.component ?? (t.href == null ? "button" : h ?? "a"), a = p(A, l(e(_?.action, r), {
112
+ "aria-current": n ? "page" : void 0,
113
+ "aria-label": t.ariaLabel,
114
+ component: i,
115
+ disabled: t.disabled,
116
+ href: t.disabled ? void 0 : t.href,
117
+ nativeButton: i === "button",
118
+ onClick: t.onClick,
119
+ rel: t.rel,
120
+ target: t.target
121
+ }), r), o = p(j, e(_?.icon, r) ?? {}, r), u = p(M, e(_?.badge, r) ?? {}, r), d = p(N, e(_?.label, r) ?? {}, r);
122
+ return /* @__PURE__ */ s(A, {
123
+ ...a,
124
+ key: t.value,
125
+ icon: /* @__PURE__ */ c(j, {
126
+ ...o,
127
+ children: t.badge == null ? t.icon : /* @__PURE__ */ c(M, {
128
+ badgeContent: t.badge,
129
+ color: "error",
130
+ ...u,
131
+ children: t.icon
132
+ })
133
+ }),
134
+ label: t.label,
135
+ slotProps: { label: d },
136
+ slots: { label: N },
137
+ value: t.value
138
+ });
139
+ })
140
+ });
141
+ }
142
+ var O = o.forwardRef(D);
143
+ O.displayName = "SMobileDock";
144
+ //#endregion
145
+ export { O as SMobileDock, O as default };
@@ -1,3 +1,3 @@
1
- export { SNavItem, type SNavItemOwnerState, type SNavItemButtonProps, type SNavItemProps, type SNavItemSlotProps, type SNavItemSlots, } from './s-nav-item';
1
+ export { SNavItem, type SNavItemOwnerState, type SNavItemProps, type SNavItemRowProps, type SNavItemSlotProps, type SNavItemSlots, } from './s-nav-item';
2
2
  export { default } from './s-nav-item';
3
3
  export type {} from '../theme/component-augmentation';
@@ -1,4 +1,5 @@
1
- import { BoxProps, ListItemButtonProps, TypographyProps } from '@mui/material';
1
+ import { BoxProps, TypographyProps } from '@mui/material';
2
+ import { SListActionItemProps } from '../s-list-action-item/s-list-action-item';
2
3
  import { OwnerStateSlotProps as MuiOwnerStateSlotProps } from '../utils/slots';
3
4
  import * as React from 'react';
4
5
  export interface SNavItemOwnerState extends SNavItemProps {
@@ -6,39 +7,57 @@ export interface SNavItemOwnerState extends SNavItemProps {
6
7
  selected: boolean;
7
8
  }
8
9
  type OwnerStateSlotProps<Props> = MuiOwnerStateSlotProps<Props, SNavItemOwnerState>;
10
+ /** Row props, mirroring the primitive the nav item is built on. */
11
+ export type SNavItemRowProps = Omit<SListActionItemProps, 'label'>;
9
12
  export interface SNavItemSlots {
10
- action?: React.ElementType;
11
- button?: React.ElementType;
13
+ /** Leading icon container. */
12
14
  icon?: React.ElementType;
13
- primary?: React.ElementType;
15
+ /** Interactive row element. */
16
+ item?: React.ElementType;
17
+ /** Primary label element. */
18
+ label?: React.ElementType;
19
+ /** List item element wrapping the row. */
20
+ root?: React.ElementType;
21
+ /** Trailing content container. */
22
+ trailing?: React.ElementType;
14
23
  }
15
- export type SNavItemButtonProps = ListItemButtonProps & Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'rel' | 'target'>;
16
24
  export interface SNavItemSlotProps {
17
- action?: OwnerStateSlotProps<BoxProps>;
18
- button?: OwnerStateSlotProps<SNavItemButtonProps>;
25
+ /** Props or owner-state callback for the icon slot. */
19
26
  icon?: OwnerStateSlotProps<BoxProps>;
20
- primary?: OwnerStateSlotProps<TypographyProps>;
27
+ /** Props or owner-state callback for the row slot. */
28
+ item?: OwnerStateSlotProps<SNavItemRowProps>;
29
+ /** Props or owner-state callback for the label slot. */
30
+ label?: OwnerStateSlotProps<TypographyProps>;
31
+ /** Props or owner-state callback for the list item slot. */
32
+ root?: OwnerStateSlotProps<BoxProps<'li'>>;
33
+ /** Props or owner-state callback for the trailing slot. */
34
+ trailing?: OwnerStateSlotProps<BoxProps>;
21
35
  }
22
- /** Props for a semantic list item with a MUI ListItemButton action. */
36
+ /** Props for a semantic list item wrapping a navigation row. */
23
37
  export interface SNavItemProps extends Omit<BoxProps<'li'>, 'children' | 'component' | 'onClick'> {
24
- /** Optional trailing action content. */
25
- action?: React.ReactNode;
38
+ /**
39
+ * Content rendered under the row, inside the same list item — used for
40
+ * collapsible submenus. The row itself is described by the other props.
41
+ */
42
+ children?: React.ReactNode;
26
43
  /** Disables the navigation action. */
27
44
  disabled?: boolean;
28
- /** Link destination. When provided, the action renders as an anchor by default. */
45
+ /** Link destination. When provided, the row renders as an anchor by default. */
29
46
  href?: string;
30
47
  /** Optional leading icon. */
31
48
  icon?: React.ReactNode;
32
- /** Called when the item is activated. */
33
- onClick?: ListItemButtonProps['onClick'];
34
49
  /** Visible primary label. */
35
- primary: React.ReactNode;
36
- /** Selected navigation state, matching MUI ListItemButton. */
50
+ label: React.ReactNode;
51
+ /** Called when the row is activated. */
52
+ onClick?: React.MouseEventHandler<HTMLElement>;
53
+ /** Marks the row as the current navigation target. */
37
54
  selected?: boolean;
38
55
  /** Components used for internal structural slots. */
39
56
  slots?: SNavItemSlots;
40
57
  /** Props or owner-state callbacks for internal structural slots. */
41
58
  slotProps?: SNavItemSlotProps;
59
+ /** Optional trailing content, e.g. a count chip or an expand indicator. */
60
+ trailing?: React.ReactNode;
42
61
  }
43
62
  export declare const SNavItem: React.ForwardRefExoticComponent<Omit<SNavItemProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
44
63
  export default SNavItem;
@@ -1,87 +1,65 @@
1
1
  import { toSxArray as e } from "../utils/sx.js";
2
- import * as t from "react";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { Box as i, ListItemButton as a, Typography as o, styled as s, useThemeProps as c } from "@mui/material";
5
- import l from "@mui/utils/appendOwnerState";
2
+ import { resolveOwnerStateSlotProps as t } from "../utils/slots.js";
3
+ import { actionHoverMedia as n } from "../theme/components/action-styles.js";
4
+ import { SListActionItem as r } from "../s-list-action-item/s-list-action-item.js";
5
+ import * as i from "react";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
+ import { styled as s, useThemeProps as c } from "@mui/material";
8
+ import { mergeSlotProps as l, useForkRef as u } from "@mui/material/utils";
9
+ import d from "@mui/utils/appendOwnerState";
6
10
  //#region lib/s-nav-item/s-nav-item.tsx
7
- var u = s("li", {
11
+ var f = s("li", {
8
12
  name: "SNavItem",
9
13
  slot: "Root"
10
- })({});
11
- function d(e, t) {
12
- return typeof e == "function" ? e(t) : e;
13
- }
14
- var f = t.forwardRef(function(t, s) {
15
- let f = c({
16
- props: t,
14
+ })({
15
+ display: "block",
16
+ userSelect: "none"
17
+ }), p = s(r, {
18
+ name: "SNavItem",
19
+ slot: "Item",
20
+ shouldForwardProp: (e) => e !== "ownerState"
21
+ })(({ theme: e }) => ({
22
+ borderRadius: e.radius.md,
23
+ color: (e.vars ?? e).palette.text.secondary,
24
+ padding: e.spacing(1.5),
25
+ "&.Mui-selected": { color: (e.vars ?? e).palette.text.primary },
26
+ [n]: { "&:hover": { color: (e.vars ?? e).palette.text.primary } }
27
+ })), m = i.forwardRef(function(n, r) {
28
+ let i = c({
29
+ props: n,
17
30
  name: "SNavItem"
18
- }), { action: p, disabled: m = !1, href: h, icon: g, onClick: _, primary: v, selected: y = !1, slotProps: b, slots: x, sx: S, ...C } = f, w = {
19
- ...f,
31
+ }), { children: s, disabled: m = !1, href: h, icon: g, label: _, onClick: v, selected: y = !1, slotProps: b, slots: x, sx: S, trailing: C, ...w } = i, T = {
32
+ ...i,
20
33
  disabled: m,
21
34
  selected: y
22
- }, T = x?.button ?? a, E = x?.icon ?? i, D = x?.primary ?? o, O = x?.action ?? i, k = d(b?.button, w), A = d(b?.icon, w), j = d(b?.primary, w), M = d(b?.action, w), N = l(x?.button, k ?? {}, w), P = l(x?.icon, A ?? {}, w), F = l(x?.primary, j ?? {}, w), I = l(x?.action, M ?? {}, w), { onClick: L, sx: R, ...z } = N, { sx: B, ...V } = P, { sx: H, ...U } = I, W = L || _ ? (e) => {
23
- L?.(e), e.defaultPrevented || _?.(e);
24
- } : void 0;
25
- return /* @__PURE__ */ n(u, {
26
- ...C,
27
- ref: s,
28
- ownerState: w,
29
- sx: [{
30
- display: "block",
31
- userSelect: "none"
32
- }, ...e(S)],
33
- children: /* @__PURE__ */ r(T, {
34
- component: h ? "a" : "div",
35
- ...z,
36
- "aria-current": y ? "page" : void 0,
37
- disabled: m,
38
- href: m ? void 0 : h,
39
- onClick: W,
40
- selected: y,
41
- sx: [{
42
- borderRadius: 1,
43
- color: "text.secondary",
44
- gap: 1,
45
- justifyContent: "space-between",
46
- p: 1.5,
47
- whiteSpace: "nowrap",
48
- "&.Mui-selected": { color: "text.primary" },
49
- "&.Mui-disabled": { cursor: "not-allowed" },
50
- "@media (hover: hover) and (pointer: fine)": { "&:hover": { color: "text.primary" } }
51
- }, ...e(R)],
52
- children: [/* @__PURE__ */ r(i, {
53
- sx: {
54
- alignItems: "center",
55
- display: "flex",
56
- gap: 1,
57
- minWidth: 0
58
- },
59
- children: [g == null ? null : /* @__PURE__ */ n(E, {
60
- component: "span",
61
- ...V,
62
- sx: [{
63
- alignItems: "center",
64
- display: "flex",
65
- justifyContent: "center"
66
- }, ...e(B)],
67
- children: g
68
- }), /* @__PURE__ */ n(D, {
69
- component: "span",
70
- ...F,
71
- children: v
72
- })]
73
- }), p == null ? null : /* @__PURE__ */ n(O, {
74
- component: "span",
75
- ...U,
76
- sx: [{
77
- alignItems: "center",
78
- display: "flex"
79
- }, ...e(H)],
80
- children: p
81
- })]
82
- })
35
+ }, E = x?.root ?? f, D = x?.item ?? p, { ref: O, sx: k, ...A } = d(E, l(t(b?.root, T), w), T), j = u(O, r), M = d(D, l(t(b?.item, T), {
36
+ disabled: m,
37
+ href: h,
38
+ icon: g,
39
+ onClick: v,
40
+ selected: y,
41
+ slots: {
42
+ icon: x?.icon,
43
+ label: x?.label,
44
+ trailing: x?.trailing
45
+ },
46
+ slotProps: {
47
+ icon: b?.icon,
48
+ label: b?.label,
49
+ trailing: b?.trailing
50
+ },
51
+ trailing: C
52
+ }), T);
53
+ return /* @__PURE__ */ o(E, {
54
+ ...A,
55
+ ref: j,
56
+ sx: [...e(k), ...e(S)],
57
+ children: [/* @__PURE__ */ a(D, {
58
+ ...M,
59
+ label: _
60
+ }), s]
83
61
  });
84
62
  });
85
- f.displayName = "SNavItem";
63
+ m.displayName = "SNavItem";
86
64
  //#endregion
87
- export { f as SNavItem, f as default };
65
+ export { m as SNavItem, m as default };
@@ -1,17 +1,16 @@
1
1
  import { toSxArray as e } from "../utils/sx.js";
2
- import { SNavItem as t } from "../s-nav-item/s-nav-item.js";
3
- import { styled as n, useThemeProps as r } from "@mui/material/styles";
4
- import * as i from "react";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
+ import { reducedMotionMedia as t } from "../theme/components/action-styles.js";
3
+ import { SNavItem as n } from "../s-nav-item/s-nav-item.js";
4
+ import { styled as r, useThemeProps as i } from "@mui/material/styles";
5
+ import * as a from "react";
6
+ import { jsx as o } from "react/jsx-runtime";
6
7
  import s from "@mui/icons-material/ExpandMore";
7
- import c from "@mui/material/Typography";
8
- import l from "@mui/material/Stack";
9
- import u from "@mui/material/Box";
10
- import d from "@mui/material/Collapse";
11
- import f from "@mui/material/ListItemButton";
8
+ import c from "@mui/material/Stack";
9
+ import l from "@mui/material/Box";
10
+ import u from "@mui/material/Collapse";
12
11
  //#region lib/s-nav-items/s-nav-items.tsx
13
- var p = n(i.forwardRef(function(e, t) {
14
- return /* @__PURE__ */ a(l, {
12
+ var d = r(a.forwardRef(function(e, t) {
13
+ return /* @__PURE__ */ o(c, {
15
14
  component: "ul",
16
15
  ...e,
17
16
  ref: t
@@ -20,148 +19,105 @@ var p = n(i.forwardRef(function(e, t) {
20
19
  name: "SNavItems",
21
20
  slot: "Root"
22
21
  })({});
23
- function m(e, t) {
24
- return e.some((e) => e.href && (t === e.href || t.startsWith(e.href + "/")) ? !0 : e.items ? m(e.items, t) : !1);
22
+ function f(e, t) {
23
+ return e.some((e) => e.href && (t === e.href || t.startsWith(e.href + "/")) ? !0 : e.items ? f(e.items, t) : !1);
25
24
  }
26
- function h(e, t) {
25
+ function p(e, t) {
27
26
  return !!(e.href && (t === e.href || t.startsWith(e.href + "/")));
28
27
  }
29
- function g(e, t) {
28
+ function m(e, t) {
30
29
  let n = e.items ?? [];
31
30
  return {
32
- active: h(e, t),
33
- childActive: n.length > 0 && m(n, t)
31
+ active: p(e, t),
32
+ childActive: n.length > 0 && f(n, t)
34
33
  };
35
34
  }
36
- function _({ item: e, pathname: n, depth: r, linkComponent: l }) {
37
- let p = !!(e.items && e.items.length > 0), { active: m, childActive: h } = g(e, n), [_, y] = i.useState(e.defaultOpen ?? h);
38
- if (i.useEffect(() => {
39
- h && y(!0);
40
- }, [h]), !p) return /* @__PURE__ */ a(t, {
35
+ function h({ item: e, pathname: r, depth: i, linkComponent: c }) {
36
+ let d = !!(e.items && e.items.length > 0), { active: f, childActive: p } = m(e, r), [h, _] = a.useState(e.defaultOpen ?? p);
37
+ if (a.useEffect(() => {
38
+ p && _(!0);
39
+ }, [p]), !d) return /* @__PURE__ */ o(n, {
41
40
  disabled: e.disabled,
42
41
  href: e.href,
43
- icon: e.icon ? e.icon(m) : null,
44
- primary: e.title,
45
- selected: m,
46
- slotProps: { button: {
47
- component: e.component ?? l,
42
+ icon: e.icon ? e.icon(f) : null,
43
+ label: e.title,
44
+ selected: f,
45
+ slotProps: { item: {
46
+ component: e.component ?? c,
48
47
  rel: e.rel,
49
48
  target: e.target,
50
- sx: r > 0 ? { pl: `${(r - 1) * 12 + 12}px` } : void 0
49
+ sx: i > 0 ? { pl: `${(i - 1) * 12 + 12}px` } : void 0
51
50
  } }
52
51
  });
53
- let b = m || h;
54
- return /* @__PURE__ */ o(u, {
55
- component: "li",
56
- sx: {
57
- userSelect: "none",
58
- display: "block"
59
- },
60
- children: [/* @__PURE__ */ o(f, {
61
- onClick: () => y((e) => !e),
62
- disabled: e.disabled,
63
- selected: b,
64
- sx: {
65
- alignItems: "center",
66
- borderRadius: 1,
67
- color: b ? "text.primary" : "text.secondary",
68
- display: "flex",
69
- flex: "0 0 auto",
70
- gap: 1,
71
- justifyContent: "space-between",
72
- p: 1.5,
73
- pl: r > 0 ? `${r * 12 + 12}px` : "12px",
74
- whiteSpace: "nowrap",
75
- width: "100%",
76
- "&.Mui-disabled": {
77
- color: "text.disabled",
78
- cursor: "not-allowed"
79
- },
80
- "@media (hover: hover) and (pointer: fine)": { "&:hover": { ...!b && !e.disabled && {
81
- bgcolor: "action.hover",
82
- color: "text.primary"
83
- } } }
52
+ let v = f || p;
53
+ return /* @__PURE__ */ o(n, {
54
+ disabled: e.disabled,
55
+ icon: e.icon ? e.icon(v) : null,
56
+ label: e.title,
57
+ onClick: () => _((e) => !e),
58
+ selected: v,
59
+ slotProps: {
60
+ item: {
61
+ "aria-current": void 0,
62
+ "aria-expanded": h,
63
+ sx: { pl: i > 0 ? `${i * 12 + 12}px` : "12px" }
84
64
  },
85
- "aria-expanded": _,
86
- children: [/* @__PURE__ */ o(u, {
87
- sx: {
88
- alignItems: "center",
89
- display: "flex",
90
- gap: 1
91
- },
92
- children: [e.icon ? /* @__PURE__ */ a(u, {
93
- component: "span",
94
- sx: {
95
- display: "flex",
96
- alignItems: "center",
97
- justifyContent: "center"
98
- },
99
- children: e.icon(b)
100
- }) : null, /* @__PURE__ */ a(c, {
101
- component: "span",
102
- variant: "body1",
103
- children: e.title
104
- })]
105
- }), /* @__PURE__ */ a(u, {
106
- component: "span",
107
- sx: {
108
- display: "flex",
109
- alignItems: "center",
110
- color: "text.secondary",
111
- transition: "transform 200ms ease",
112
- transform: _ ? "rotate(0deg)" : "rotate(-90deg)"
113
- },
114
- children: /* @__PURE__ */ a(s, {})
115
- })]
116
- }), /* @__PURE__ */ a(d, {
117
- in: _,
65
+ trailing: { sx: {
66
+ transform: h ? "rotate(0deg)" : "rotate(-90deg)",
67
+ transition: (e) => e.transitions.create("transform", { duration: e.transitions.duration.shorter }),
68
+ [t]: { transition: "none" }
69
+ } }
70
+ },
71
+ trailing: /* @__PURE__ */ o(s, {}),
72
+ children: /* @__PURE__ */ o(u, {
73
+ in: h,
118
74
  timeout: 200,
119
75
  unmountOnExit: !0,
120
- children: /* @__PURE__ */ a(u, {
76
+ children: /* @__PURE__ */ o(l, {
121
77
  sx: {
122
- ml: r > 0 ? `${r * 16 + 12}px` : "12px",
78
+ ml: i > 0 ? `${i * 16 + 12}px` : "12px",
123
79
  mt: 1,
124
80
  mb: 1,
125
81
  pl: 1
126
82
  },
127
- children: /* @__PURE__ */ a(v, {
83
+ children: /* @__PURE__ */ o(g, {
128
84
  items: e.items,
129
- pathname: n,
130
- depth: r + 1,
131
- linkComponent: l
85
+ pathname: r,
86
+ depth: i + 1,
87
+ linkComponent: c
132
88
  })
133
89
  })
134
- })]
90
+ })
135
91
  });
136
92
  }
137
- _.displayName = "SNavGroupItem";
138
- var v = i.forwardRef(function(t, n) {
139
- let i = r({
93
+ h.displayName = "SNavGroupItem";
94
+ var g = a.forwardRef(function(t, n) {
95
+ let r = i({
140
96
  props: t,
141
97
  name: "SNavItems"
142
- }), { depth: o = 0, items: s, linkComponent: c, pathname: l = "", sx: u, ...d } = i, f = {
143
- ...i,
144
- depth: o,
98
+ }), { depth: a = 0, items: s, linkComponent: c, pathname: l = "", sx: u, ...f } = r, p = {
99
+ ...r,
100
+ depth: a,
145
101
  pathname: l
146
102
  };
147
- return /* @__PURE__ */ a(p, {
103
+ return /* @__PURE__ */ o(d, {
148
104
  spacing: 1,
149
- ...d,
105
+ ...f,
150
106
  ref: n,
151
- ownerState: f,
107
+ ownerState: p,
152
108
  sx: [{
153
109
  listStyle: "none",
154
110
  m: 0,
155
111
  p: 0
156
112
  }, ...e(u)],
157
- children: s.map((e) => /* @__PURE__ */ a(_, {
113
+ children: s.map((e) => /* @__PURE__ */ o(h, {
158
114
  item: e,
159
115
  pathname: l,
160
- depth: o,
116
+ depth: a,
161
117
  linkComponent: c
162
118
  }, e.key))
163
119
  });
164
120
  });
165
- v.displayName = "SNavItems";
121
+ g.displayName = "SNavItems";
166
122
  //#endregion
167
- export { _ as SNavGroupItem, v as SNavItems, v as default };
123
+ export { h as SNavGroupItem, g as SNavItems, g as default };
@@ -0,0 +1,3 @@
1
+ export { default, default as SNumberRange } from './s-number-range';
2
+ export type { SNumberRangeColor, SNumberRangeOwnerState, SNumberRangeProps, SNumberRangeSize, SNumberRangeSlotProps, SNumberRangeSlots, SNumberRangeValue, } from './s-number-range';
3
+ export type {} from '../theme/component-augmentation';
@@ -0,0 +1,2 @@
1
+ import { SNumberRange as e } from "./s-number-range.js";
2
+ export { e as SNumberRange, e as default };