@m4l/components 9.77.0 → 9.77.1-beta-update-switch-component-variable.0
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/components/extended/mui/Switch/Switch.d.ts +1 -1
- package/components/extended/mui/Switch/Switch.d.ts.map +1 -1
- package/components/extended/mui/Switch/Switch.js +145 -66
- package/components/extended/mui/Switch/Switch.styles.d.ts.map +1 -1
- package/components/extended/mui/Switch/Switch.styles.js +145 -53
- package/components/extended/mui/Switch/constants.d.ts +1 -1
- package/components/extended/mui/Switch/constants.d.ts.map +1 -1
- package/components/extended/mui/Switch/index.d.ts +1 -0
- package/components/extended/mui/Switch/index.d.ts.map +1 -1
- package/components/extended/mui/Switch/slots/SwitchEnum.d.ts +5 -0
- package/components/extended/mui/Switch/slots/SwitchEnum.d.ts.map +1 -1
- package/components/extended/mui/Switch/slots/SwitchEnum.js +2 -2
- package/components/extended/mui/Switch/slots/SwitchSlots.d.ts +19 -4
- package/components/extended/mui/Switch/slots/SwitchSlots.d.ts.map +1 -1
- package/components/extended/mui/Switch/slots/SwitchSlots.js +32 -11
- package/components/extended/mui/Switch/types.d.ts +37 -0
- package/components/extended/mui/Switch/types.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -2,7 +2,7 @@ import { SwitchProps } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Extended Switch component built on top of MUI Switch.
|
|
4
4
|
* Supports an optional inline label with configurable placement, error state, skeleton mode,
|
|
5
|
-
* and ownerState-driven styling.
|
|
5
|
+
* Presentation variants, optional icon/content slots, and ownerState-driven styling.
|
|
6
6
|
* @example
|
|
7
7
|
* ```tsx
|
|
8
8
|
* <Switch size="medium" label="Enable notifications" checked={true} />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Switch/Switch.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAoB,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Switch/Switch.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAoB,WAAW,EAAE,MAAM,SAAS,CAAC;AAiBxD;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,wHAuNlB,CAAC"}
|
|
@@ -1,82 +1,161 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useModuleSkeleton as
|
|
4
|
-
import { useComponentSize as
|
|
5
|
-
import { getComponentSlotRoot as
|
|
6
|
-
import { SWITCH_CLASSES as
|
|
7
|
-
import
|
|
8
|
-
import { getOptionLabelColor as
|
|
9
|
-
import { SwitchRootStyled as
|
|
10
|
-
const
|
|
11
|
-
(
|
|
1
|
+
import { jsx as e, jsxs as s, Fragment as h } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Y, useId as q } from "react";
|
|
3
|
+
import { useModuleSkeleton as G } from "@m4l/core";
|
|
4
|
+
import { useComponentSize as J } from "../../../../hooks/useComponentSize/index.js";
|
|
5
|
+
import { getComponentSlotRoot as Q } from "../../../../utils/getComponentSlotRoot.js";
|
|
6
|
+
import { SWITCH_CLASSES as g, SWITCH_KEY_COMPONENT as V } from "./constants.js";
|
|
7
|
+
import X from "clsx";
|
|
8
|
+
import { getOptionLabelColor as Z } from "../../../../utils/getOptionLabelColor.js";
|
|
9
|
+
import { MUISwitchStyled as ee, SwitchRootStyled as te, IconSurfaceStyled as oe, IconStyled as ne, ContentStyled as z, EndLabelStyled as ae, SkeletonStyled as l, LabelStyled as E, DescriptionStyled as le } from "./slots/SwitchSlots.js";
|
|
10
|
+
const ue = Y(
|
|
11
|
+
(T, L) => {
|
|
12
12
|
const {
|
|
13
|
-
className:
|
|
14
|
-
size:
|
|
15
|
-
disabled:
|
|
16
|
-
color:
|
|
17
|
-
error:
|
|
18
|
-
checked:
|
|
19
|
-
label:
|
|
20
|
-
labelPlacement:
|
|
21
|
-
onChange:
|
|
22
|
-
value:
|
|
23
|
-
id:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
j
|
|
13
|
+
className: P,
|
|
14
|
+
size: $ = "medium",
|
|
15
|
+
disabled: n,
|
|
16
|
+
color: B = "default",
|
|
17
|
+
error: p,
|
|
18
|
+
checked: u = !1,
|
|
19
|
+
label: c,
|
|
20
|
+
labelPlacement: b = "end",
|
|
21
|
+
onChange: R,
|
|
22
|
+
value: F,
|
|
23
|
+
id: D,
|
|
24
|
+
inputProps: M,
|
|
25
|
+
variant: w = "text",
|
|
26
|
+
groupPosition: O,
|
|
27
|
+
width: _ = "fit-content",
|
|
28
|
+
icon: y,
|
|
29
|
+
startText: f,
|
|
30
|
+
descriptionText: k,
|
|
31
|
+
endText: x,
|
|
32
|
+
...j
|
|
33
|
+
} = T, { currentSize: d } = J($), H = G(), W = Q(V), A = q(), o = D || A, v = f ?? c, m = !!y, a = !!k, S = !!x, r = !!(w !== "text" || m || f || a || S), i = r && !!v, I = n ? "text.secondary" : "text.primary", t = {
|
|
34
|
+
disabled: n,
|
|
35
|
+
color: B,
|
|
36
|
+
error: p,
|
|
37
|
+
size: d,
|
|
38
|
+
checked: u,
|
|
39
|
+
variant: w,
|
|
40
|
+
groupPosition: O,
|
|
41
|
+
width: _,
|
|
42
|
+
hasIcon: m,
|
|
43
|
+
hasStartText: i,
|
|
44
|
+
hasDescription: a,
|
|
45
|
+
hasEndText: S,
|
|
46
|
+
hasEnhancedLayout: r
|
|
47
|
+
}, C = c ? /* @__PURE__ */ e(
|
|
48
|
+
E,
|
|
33
49
|
{
|
|
34
|
-
id: `${
|
|
50
|
+
id: `${o}-label`,
|
|
35
51
|
component: "label",
|
|
36
|
-
htmlFor:
|
|
37
|
-
variant: "
|
|
38
|
-
color:
|
|
39
|
-
ownerState: { ...
|
|
40
|
-
size:
|
|
41
|
-
disabled: t,
|
|
52
|
+
htmlFor: o,
|
|
53
|
+
variant: "bodyStandard",
|
|
54
|
+
color: I,
|
|
55
|
+
ownerState: { ...t },
|
|
56
|
+
size: d,
|
|
42
57
|
ellipsis: !0,
|
|
43
|
-
children:
|
|
58
|
+
children: c
|
|
44
59
|
}
|
|
45
|
-
) : null
|
|
60
|
+
) : null, K = r ? /* @__PURE__ */ s(h, { children: [
|
|
61
|
+
i && /* @__PURE__ */ e(
|
|
62
|
+
E,
|
|
63
|
+
{
|
|
64
|
+
id: `${o}-label`,
|
|
65
|
+
component: "label",
|
|
66
|
+
htmlFor: o,
|
|
67
|
+
variant: "bodyStandard",
|
|
68
|
+
color: I,
|
|
69
|
+
ownerState: { ...t },
|
|
70
|
+
size: d,
|
|
71
|
+
children: v
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
a && /* @__PURE__ */ e(
|
|
75
|
+
le,
|
|
76
|
+
{
|
|
77
|
+
id: `${o}-description`,
|
|
78
|
+
component: "span",
|
|
79
|
+
variant: "microSlim",
|
|
80
|
+
fontFamily: "Inter",
|
|
81
|
+
color: n || w === "contained" ? "text.disabled" : "text.secondary",
|
|
82
|
+
ownerState: { ...t },
|
|
83
|
+
size: d,
|
|
84
|
+
disabled: n,
|
|
85
|
+
children: k
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
] }) : null, U = {
|
|
89
|
+
...p ? { "aria-invalid": "true" } : {},
|
|
90
|
+
...i ? { "aria-labelledby": `${o}-label` } : !r && c ? { "aria-labelledby": `${o}-label` } : {},
|
|
91
|
+
...a ? { "aria-describedby": `${o}-description` } : {},
|
|
92
|
+
...M
|
|
93
|
+
}, N = /* @__PURE__ */ e(
|
|
94
|
+
ee,
|
|
95
|
+
{
|
|
96
|
+
ref: L,
|
|
97
|
+
id: o,
|
|
98
|
+
ownerState: { ...t },
|
|
99
|
+
disableRipple: !0,
|
|
100
|
+
checked: u,
|
|
101
|
+
disabled: n,
|
|
102
|
+
inputProps: U,
|
|
103
|
+
value: F,
|
|
104
|
+
onChange: R,
|
|
105
|
+
...j
|
|
106
|
+
}
|
|
107
|
+
);
|
|
46
108
|
return /* @__PURE__ */ e(
|
|
47
|
-
|
|
109
|
+
te,
|
|
48
110
|
{
|
|
49
|
-
ownerState: { ...
|
|
50
|
-
className:
|
|
51
|
-
children:
|
|
52
|
-
/* @__PURE__ */ e(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
111
|
+
ownerState: { ...t },
|
|
112
|
+
className: X(P, W),
|
|
113
|
+
children: H ? r ? /* @__PURE__ */ s(h, { children: [
|
|
114
|
+
m && /* @__PURE__ */ e(l, { "data-testid": "switch-skeleton-icon", variant: "rounded", className: "switchSkeletonIcon" }),
|
|
115
|
+
(i || a) && /* @__PURE__ */ s(z, { ownerState: { ...t }, children: [
|
|
116
|
+
i && /* @__PURE__ */ e(l, { "data-testid": "switch-skeleton-label", variant: "rectangular", className: "switchSkeletonLabel" }),
|
|
117
|
+
a && /* @__PURE__ */ e(l, { "data-testid": "switch-skeleton-description", variant: "rectangular", className: "switchSkeletonDescription" })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ e(l, { "data-testid": "switch-skeleton", variant: "rounded", className: g.skeleton }),
|
|
120
|
+
S && /* @__PURE__ */ e(l, { "data-testid": "switch-skeleton-end-label", variant: "rectangular", className: "switchSkeletonEndLabel" })
|
|
121
|
+
] }) : /* @__PURE__ */ s(h, { children: [
|
|
122
|
+
/* @__PURE__ */ e(l, { "data-testid": "switch-skeleton", variant: "rounded", className: g.skeleton }),
|
|
123
|
+
c && /* @__PURE__ */ e(l, { "data-testid": "switch-skeleton-label", variant: "rectangular", className: "switchSkeletonLabel" })
|
|
124
|
+
] }) : r ? /* @__PURE__ */ s(h, { children: [
|
|
125
|
+
m && /* @__PURE__ */ e(oe, { ownerState: { ...t }, "data-testid": "switch-icon-surface", children: /* @__PURE__ */ e(
|
|
126
|
+
ne,
|
|
127
|
+
{
|
|
128
|
+
ownerState: { ...t },
|
|
129
|
+
src: y,
|
|
130
|
+
size: "small",
|
|
131
|
+
color: p ? "chips.error.contained.color" : "chips.default.contained.color",
|
|
132
|
+
disabled: n
|
|
133
|
+
}
|
|
134
|
+
) }),
|
|
135
|
+
(i || a) && /* @__PURE__ */ e(z, { ownerState: { ...t }, children: K }),
|
|
136
|
+
N,
|
|
137
|
+
S && /* @__PURE__ */ e(
|
|
138
|
+
ae,
|
|
58
139
|
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
disabled:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
...o && { "aria-labelledby": `${l}-label` }
|
|
68
|
-
},
|
|
69
|
-
value: k,
|
|
70
|
-
onChange: w,
|
|
71
|
-
...v
|
|
140
|
+
component: "span",
|
|
141
|
+
variant: "bodyStandard",
|
|
142
|
+
color: Z(u, n),
|
|
143
|
+
ownerState: { ...t },
|
|
144
|
+
size: d,
|
|
145
|
+
disabled: n,
|
|
146
|
+
ellipsis: !0,
|
|
147
|
+
children: x
|
|
72
148
|
}
|
|
73
|
-
)
|
|
74
|
-
|
|
149
|
+
)
|
|
150
|
+
] }) : /* @__PURE__ */ s(h, { children: [
|
|
151
|
+
b === "start" && C,
|
|
152
|
+
N,
|
|
153
|
+
b === "end" && C
|
|
75
154
|
] })
|
|
76
155
|
}
|
|
77
156
|
);
|
|
78
157
|
}
|
|
79
158
|
);
|
|
80
159
|
export {
|
|
81
|
-
|
|
160
|
+
ue as Switch
|
|
82
161
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.styles.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Switch/Switch.styles.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"Switch.styles.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Switch/Switch.styles.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,eAAO,MAAM,YAAY,EAAE,YAsQ1B,CAAC"}
|
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
import { SWITCH_CLASSES as
|
|
2
|
-
import { getSizeStyles as
|
|
3
|
-
const
|
|
1
|
+
import { SWITCH_CLASSES as s } from "./constants.js";
|
|
2
|
+
import { getSizeStyles as o } from "../../../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
|
+
const d = {
|
|
4
4
|
/** Root container styles: flex row, centered, with gap between thumb and label. */
|
|
5
|
-
root: ({ theme: a }) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
root: ({ theme: a, ownerState: i }) => {
|
|
6
|
+
const r = i?.variant || "text", e = !!i?.groupPosition;
|
|
7
|
+
return {
|
|
8
|
+
display: "flex",
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
justifyContent: i?.hasEnhancedLayout ? "center" : void 0,
|
|
11
|
+
outline: "none",
|
|
12
|
+
overflow: "visible",
|
|
13
|
+
boxSizing: "border-box",
|
|
14
|
+
gap: a.vars.size.baseSpacings["sp2-5"],
|
|
15
|
+
padding: a.vars.size.baseSpacings.sp2,
|
|
16
|
+
width: i?.width ?? "fit-content",
|
|
17
|
+
maxWidth: "100%",
|
|
18
|
+
minWidth: 0,
|
|
19
|
+
cursor: i?.disabled ? "default" : "pointer",
|
|
20
|
+
borderRadius: r === "text" || e ? a.vars.size.borderRadius.r1 : a.vars.size.borderRadius.r2,
|
|
21
|
+
...!e && r !== "text" && {
|
|
22
|
+
border: `1px solid ${a.vars.palette.border.disabled}`,
|
|
23
|
+
...r === "contained" && {
|
|
24
|
+
backgroundColor: a.vars.palette.default.enabledOpacity
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
...i?.groupPosition && {
|
|
28
|
+
...i.groupPosition !== "last" && i.groupPosition !== "only" && {
|
|
29
|
+
borderBottom: `1px solid ${a.vars.palette.border.disabled}`
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
},
|
|
15
34
|
/** MUI Switch element styles: track, thumb, hover/active/focus rings, and checked/disabled states. */
|
|
16
|
-
muiSwitch: ({ theme: a, ownerState:
|
|
17
|
-
const r =
|
|
35
|
+
muiSwitch: ({ theme: a, ownerState: i }) => {
|
|
36
|
+
const r = i?.error, e = i?.size || "medium", { height: t } = o(a, e, "action");
|
|
18
37
|
return {
|
|
19
38
|
overflow: "visible",
|
|
20
39
|
padding: 0,
|
|
21
40
|
// Root = track: w = action × 1.133 (27.2/24), h = action × 0.667 (16/24)
|
|
22
|
-
width: `calc(${
|
|
23
|
-
height: `calc(${
|
|
41
|
+
width: `calc(${t} * 1.133)`,
|
|
42
|
+
height: `calc(${t} * 0.667)`,
|
|
24
43
|
// Track — pill completa, llena el root
|
|
25
44
|
"& .MuiSwitch-track": {
|
|
26
45
|
width: "100%",
|
|
@@ -34,10 +53,10 @@ const s = {
|
|
|
34
53
|
// SwitchBase — action×action, centrado sobre track (overflow -0.167 × action = -4px)
|
|
35
54
|
"& .MuiSwitch-switchBase": {
|
|
36
55
|
padding: 0,
|
|
37
|
-
width:
|
|
38
|
-
height:
|
|
39
|
-
top: `calc(${
|
|
40
|
-
left: `calc(${
|
|
56
|
+
width: t,
|
|
57
|
+
height: t,
|
|
58
|
+
top: `calc(${t} * -0.167)`,
|
|
59
|
+
left: `calc(${t} * -0.167)`,
|
|
41
60
|
backgroundColor: "transparent",
|
|
42
61
|
// Hover — ring via box-shadow en el thumb (unchecked)
|
|
43
62
|
"&:hover .MuiSwitch-thumb": {
|
|
@@ -53,7 +72,7 @@ const s = {
|
|
|
53
72
|
},
|
|
54
73
|
// Checked: translateX 0.471 × action (11.3/24)
|
|
55
74
|
"&.Mui-checked": {
|
|
56
|
-
transform: `translateX(calc(${
|
|
75
|
+
transform: `translateX(calc(${t} * 0.471))`,
|
|
57
76
|
// Track — (primary/error)ownerstate/palettecolor/selectedopacity
|
|
58
77
|
"& + .MuiSwitch-track": {
|
|
59
78
|
backgroundColor: r ? a.vars.palette.error.selectedOpacity : a.vars.palette.primary.selectedOpacity,
|
|
@@ -73,67 +92,140 @@ const s = {
|
|
|
73
92
|
// Active checked
|
|
74
93
|
"&:active .MuiSwitch-thumb": {
|
|
75
94
|
boxShadow: `0px 0px 0px 6px ${r ? a.vars.palette.error.activeOpacity : a.vars.palette.primary.activeOpacity}, 0px 1px 4px 0px rgba(0, 0, 0, 0.15)`
|
|
76
|
-
},
|
|
77
|
-
// Disabled unchecked — track: default.enabledOpacity, thumb faded
|
|
78
|
-
"&.Mui-disabled + .MuiSwitch-track": {
|
|
79
|
-
backgroundColor: r ? a.vars.palette.error.enabledOpacity : a.vars.palette.default.enabledOpacity,
|
|
80
|
-
opacity: 1
|
|
81
|
-
},
|
|
82
|
-
"&.Mui-disabled .MuiSwitch-thumb": {
|
|
83
|
-
opacity: 0.38
|
|
84
|
-
},
|
|
85
|
-
// Disabled checked — track: primary.enabledOpacity (rgba(0,100,255,0.08))
|
|
86
|
-
"&.Mui-disabled.Mui-checked + .MuiSwitch-track": {
|
|
87
|
-
backgroundColor: r ? a.vars.palette.error.enabledOpacity : a.vars.palette.primary.enabledOpacity,
|
|
88
|
-
opacity: 1
|
|
89
|
-
},
|
|
90
|
-
"&.Mui-disabled.Mui-checked .MuiSwitch-thumb": {
|
|
91
|
-
backgroundColor: r ? a.vars.palette.error.enabled : a.vars.palette.primary.enabled,
|
|
92
|
-
opacity: 0.38
|
|
93
95
|
}
|
|
96
|
+
},
|
|
97
|
+
// Disabled unchecked — track: default.enabledOpacity, thumb faded.
|
|
98
|
+
"&.Mui-disabled + .MuiSwitch-track": {
|
|
99
|
+
backgroundColor: r ? a.vars.palette.error.enabledOpacity : a.vars.palette.default.enabledOpacity,
|
|
100
|
+
opacity: 1
|
|
101
|
+
},
|
|
102
|
+
"&.Mui-disabled .MuiSwitch-thumb": {
|
|
103
|
+
opacity: 0.38
|
|
104
|
+
},
|
|
105
|
+
// Disabled checked — track: primary.enabledOpacity (rgba(0,100,255,0.08)).
|
|
106
|
+
"&.Mui-disabled.Mui-checked + .MuiSwitch-track": {
|
|
107
|
+
backgroundColor: r ? a.vars.palette.error.enabledOpacity : a.vars.palette.primary.enabledOpacity,
|
|
108
|
+
opacity: 1
|
|
109
|
+
},
|
|
110
|
+
"&.Mui-disabled.Mui-checked .MuiSwitch-thumb": {
|
|
111
|
+
backgroundColor: r ? a.vars.palette.error.enabled : a.vars.palette.primary.enabled,
|
|
112
|
+
opacity: 0.38
|
|
94
113
|
}
|
|
95
114
|
},
|
|
96
115
|
// Thumb — Ellipse 3: 12.8px (action × 0.533), margin 5.6px (action × 0.233)
|
|
97
116
|
// unchecked: text.secondary token | checked: palette.primary.enabled (#0064FF)
|
|
98
117
|
// Posición unchecked: 1.6px desde borde track | checked: ~13px desde borde izq
|
|
99
118
|
"& .MuiSwitch-thumb": {
|
|
100
|
-
width: `calc(${
|
|
101
|
-
height: `calc(${
|
|
102
|
-
margin: `calc(${
|
|
119
|
+
width: `calc(${t} * 0.533)`,
|
|
120
|
+
height: `calc(${t} * 0.533)`,
|
|
121
|
+
margin: `calc(${t} * 0.233)`,
|
|
103
122
|
backgroundColor: a.vars.palette.text.secondary,
|
|
104
123
|
borderRadius: "50%",
|
|
105
124
|
boxShadow: "inset 0px 2.4px 3.2px 0px rgba(255, 255, 255, 0.16)",
|
|
106
125
|
filter: "drop-shadow(0px 1.6px 3.2px rgba(0, 0, 0, 0.16))"
|
|
107
126
|
},
|
|
108
|
-
...
|
|
127
|
+
...i?.disabled && {
|
|
109
128
|
pointerEvents: "none"
|
|
110
129
|
}
|
|
111
130
|
};
|
|
112
131
|
},
|
|
113
|
-
|
|
114
|
-
|
|
132
|
+
/** Content column used by the optional title and description. */
|
|
133
|
+
content: ({ theme: a }) => ({
|
|
134
|
+
display: "flex",
|
|
135
|
+
flex: "1 1 auto",
|
|
136
|
+
flexDirection: "column",
|
|
137
|
+
alignItems: "flex-start",
|
|
138
|
+
justifyContent: "center",
|
|
139
|
+
gap: a.vars.size.baseSpacings["sp0-5"],
|
|
140
|
+
minWidth: 0
|
|
141
|
+
}),
|
|
142
|
+
/** Icon surface matching the leading-icon treatment. */
|
|
143
|
+
iconSurface: ({ theme: a, ownerState: i }) => ({
|
|
144
|
+
display: "flex",
|
|
145
|
+
alignItems: "center",
|
|
146
|
+
justifyContent: "center",
|
|
147
|
+
flexShrink: 0,
|
|
148
|
+
width: a.vars.size.baseSpacings.sp6,
|
|
149
|
+
height: a.vars.size.baseSpacings.sp6,
|
|
150
|
+
padding: a.vars.size.baseSpacings.sp1,
|
|
151
|
+
borderRadius: a.vars.size.borderRadius.r2,
|
|
152
|
+
backgroundColor: i?.error ? a.vars.palette.chips.error.contained.backgroundColor : a.vars.palette.chips.default.contained.backgroundColor
|
|
153
|
+
}),
|
|
154
|
+
/** Leading icon sizing and disabled treatment. */
|
|
155
|
+
icon: ({ ownerState: a }) => ({
|
|
156
|
+
flexShrink: 0,
|
|
157
|
+
...a?.disabled && { opacity: 0.6 }
|
|
158
|
+
}),
|
|
159
|
+
/** Inline label styles for the legacy text presentation. */
|
|
160
|
+
label: ({ ownerState: a }) => ({
|
|
161
|
+
cursor: "inherit",
|
|
162
|
+
minWidth: 0,
|
|
163
|
+
...a?.hasEnhancedLayout && {
|
|
164
|
+
display: "-webkit-box",
|
|
165
|
+
WebkitBoxOrient: "vertical",
|
|
166
|
+
WebkitLineClamp: 3,
|
|
167
|
+
overflow: "hidden",
|
|
168
|
+
overflowWrap: "anywhere",
|
|
169
|
+
textOverflow: "ellipsis",
|
|
170
|
+
whiteSpace: "normal"
|
|
171
|
+
}
|
|
172
|
+
}),
|
|
173
|
+
/** Secondary copy shown below the Switch title. */
|
|
174
|
+
description: () => ({
|
|
175
|
+
cursor: "inherit",
|
|
176
|
+
display: "-webkit-box",
|
|
177
|
+
minWidth: 0,
|
|
178
|
+
maxWidth: "100%",
|
|
179
|
+
WebkitBoxOrient: "vertical",
|
|
180
|
+
WebkitLineClamp: 3,
|
|
181
|
+
overflow: "hidden",
|
|
182
|
+
overflowWrap: "anywhere",
|
|
183
|
+
textOverflow: "ellipsis",
|
|
184
|
+
whiteSpace: "normal",
|
|
185
|
+
wordBreak: "break-word"
|
|
186
|
+
}),
|
|
187
|
+
/** Optional value text shown after the switch control. */
|
|
188
|
+
endLabel: () => ({
|
|
189
|
+
cursor: "inherit",
|
|
190
|
+
flexShrink: 0,
|
|
191
|
+
whiteSpace: "nowrap"
|
|
115
192
|
}),
|
|
116
193
|
/** Skeleton loading state styles for the switch track and optional label. */
|
|
117
|
-
skeleton: ({ theme: a, ownerState:
|
|
118
|
-
const r =
|
|
194
|
+
skeleton: ({ theme: a, ownerState: i }) => {
|
|
195
|
+
const r = i?.size || "medium", { height: e } = o(a, r, "action");
|
|
119
196
|
return {
|
|
120
197
|
borderRadius: a.vars.size.borderRadius.r1,
|
|
121
198
|
backgroundColor: a.vars.palette?.skeleton.default,
|
|
122
199
|
// Label skeleton: ancho fijo aproximado al texto, alto = body typography
|
|
123
200
|
"&.switchSkeletonLabel": {
|
|
124
|
-
width: `calc(${
|
|
125
|
-
height: `calc(${
|
|
201
|
+
width: `calc(${e} * 2.5)`,
|
|
202
|
+
height: `calc(${e} * 0.467)`,
|
|
203
|
+
borderRadius: a.vars.size.borderRadius.r1
|
|
204
|
+
},
|
|
205
|
+
"&.switchSkeletonDescription": {
|
|
206
|
+
width: `calc(${e} * 3.75)`,
|
|
207
|
+
height: `calc(${e} * 0.4)`,
|
|
208
|
+
borderRadius: a.vars.size.borderRadius.r1
|
|
209
|
+
},
|
|
210
|
+
"&.switchSkeletonEndLabel": {
|
|
211
|
+
width: `calc(${e} * 1.5)`,
|
|
212
|
+
height: `calc(${e} * 0.467)`,
|
|
126
213
|
borderRadius: a.vars.size.borderRadius.r1
|
|
127
214
|
},
|
|
215
|
+
"&.switchSkeletonIcon": {
|
|
216
|
+
width: `calc(${e})`,
|
|
217
|
+
height: `calc(${e})`,
|
|
218
|
+
borderRadius: a.vars.size.borderRadius.r2
|
|
219
|
+
},
|
|
128
220
|
// Switch skeleton: mismas proporciones que el track real (action × 1.133 × 0.667)
|
|
129
|
-
[`&.${
|
|
130
|
-
width: `calc(${
|
|
131
|
-
height: `calc(${
|
|
221
|
+
[`&.${s.skeleton}`]: {
|
|
222
|
+
width: `calc(${e} * 1.133)`,
|
|
223
|
+
height: `calc(${e} * 0.667)`,
|
|
132
224
|
borderRadius: "80px"
|
|
133
225
|
}
|
|
134
226
|
};
|
|
135
227
|
}
|
|
136
228
|
};
|
|
137
229
|
export {
|
|
138
|
-
|
|
230
|
+
d as switchStyles
|
|
139
231
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const SWITCH_KEY_COMPONENT = "M4LSwitch";
|
|
2
|
-
export declare const SWITCH_CLASSES: Record<"root" | "skeleton" | "label" | "muiSwitch", string>;
|
|
2
|
+
export declare const SWITCH_CLASSES: Record<"root" | "content" | "skeleton" | "label" | "description" | "icon" | "muiSwitch" | "iconSurface" | "endLabel", string>;
|
|
3
3
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Switch/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAEhD,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Switch/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAEhD,eAAO,MAAM,cAAc,+HAAyD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Switch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Switch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,mBAAmB,SAAS,CAAC"}
|
|
@@ -2,6 +2,11 @@ export declare enum SwitchSlots {
|
|
|
2
2
|
root = "root",
|
|
3
3
|
muiSwitch = "muiSwitch",
|
|
4
4
|
label = "label",
|
|
5
|
+
content = "content",
|
|
6
|
+
iconSurface = "iconSurface",
|
|
7
|
+
icon = "icon",
|
|
8
|
+
description = "description",
|
|
9
|
+
endLabel = "endLabel",
|
|
5
10
|
skeleton = "skeleton"
|
|
6
11
|
}
|
|
7
12
|
//# sourceMappingURL=SwitchEnum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchEnum.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/extended/mui/Switch/slots/SwitchEnum.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,QAAQ,aAAa;CACtB"}
|
|
1
|
+
{"version":3,"file":"SwitchEnum.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/extended/mui/Switch/slots/SwitchEnum.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,IAAI,SAAS;IACb,WAAW,gBAAgB;IAC3B,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACtB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var n = /* @__PURE__ */ ((e) => (e.root = "root", e.muiSwitch = "muiSwitch", e.label = "label", e.content = "content", e.iconSurface = "iconSurface", e.icon = "icon", e.description = "description", e.endLabel = "endLabel", e.skeleton = "skeleton", e))(n || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
n as SwitchSlots
|
|
4
4
|
};
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
export declare const SwitchRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
2
|
-
ownerState?: (Partial<import('
|
|
2
|
+
ownerState?: (Partial<import('..').SwitchOwnerState> & Record<string, unknown>) | undefined;
|
|
3
3
|
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
4
4
|
export declare const MUISwitchStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').SwitchProps, keyof import('@mui/material').SwitchProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
5
|
-
ownerState?: (Partial<import('
|
|
5
|
+
ownerState?: (Partial<import('..').SwitchOwnerState> & Record<string, unknown>) | undefined;
|
|
6
6
|
}, {}, {}>;
|
|
7
7
|
export declare const LabelStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('@m4l/base').TypographyProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>, "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "color" | "columnGap" | "content" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "translate" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "classes" | "children" | "className" | "sx" | "p" | "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "component" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "size" | "variant" | "dataTestid" | "paragraph" | "disabled" | "skeletonWidth" | "ellipsis" | "align" | "gutterBottom" | "noWrap" | "variantMapping" | "skeletonRows" | "htmlFor" | keyof import('react').RefAttributes<HTMLSpanElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
8
|
-
ownerState?: (Partial<import('
|
|
8
|
+
ownerState?: (Partial<import('..').SwitchOwnerState> & Record<string, unknown>) | undefined;
|
|
9
|
+
}, {}, {}>;
|
|
10
|
+
export declare const ContentStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
11
|
+
ownerState?: (Partial<import('..').SwitchOwnerState> & Record<string, unknown>) | undefined;
|
|
12
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
13
|
+
export declare const IconSurfaceStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
14
|
+
ownerState?: (Partial<import('..').SwitchOwnerState> & Record<string, unknown>) | undefined;
|
|
15
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, keyof import('react').ClassAttributes<HTMLSpanElement> | keyof import('react').HTMLAttributes<HTMLSpanElement>>, {}>;
|
|
16
|
+
export declare const IconStyled: import('@emotion/styled').StyledComponent<Pick<import('@m4l/base').IconProps, "src" | "icon" | keyof import('@m4l/base').IconBaseProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
17
|
+
ownerState?: (Partial<import('..').SwitchOwnerState> & Record<string, unknown>) | undefined;
|
|
18
|
+
}, {}, {}>;
|
|
19
|
+
export declare const DescriptionStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('@m4l/base').TypographyProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>, "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "color" | "columnGap" | "content" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "translate" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "classes" | "children" | "className" | "sx" | "p" | "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "component" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "size" | "variant" | "dataTestid" | "paragraph" | "disabled" | "skeletonWidth" | "ellipsis" | "align" | "gutterBottom" | "noWrap" | "variantMapping" | "skeletonRows" | "htmlFor" | keyof import('react').RefAttributes<HTMLSpanElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
20
|
+
ownerState?: (Partial<import('..').SwitchOwnerState> & Record<string, unknown>) | undefined;
|
|
21
|
+
}, {}, {}>;
|
|
22
|
+
export declare const EndLabelStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('@m4l/base').TypographyProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>, "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "color" | "columnGap" | "content" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "translate" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "classes" | "children" | "className" | "sx" | "p" | "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "component" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "size" | "variant" | "dataTestid" | "paragraph" | "disabled" | "skeletonWidth" | "ellipsis" | "align" | "gutterBottom" | "noWrap" | "variantMapping" | "skeletonRows" | "htmlFor" | keyof import('react').RefAttributes<HTMLSpanElement>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
23
|
+
ownerState?: (Partial<import('..').SwitchOwnerState> & Record<string, unknown>) | undefined;
|
|
9
24
|
}, {}, {}>;
|
|
10
25
|
export declare const SkeletonStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').SkeletonOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "height" | "width" | "animation" | "classes" | "children" | "className" | "sx" | "style" | "variant">, "color" | "content" | "height" | "translate" | "width" | "animation" | "classes" | "children" | "className" | "sx" | "slot" | "style" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "variant"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
11
|
-
ownerState?: (Partial<import('
|
|
26
|
+
ownerState?: (Partial<import('..').SwitchOwnerState> & Record<string, unknown>) | undefined;
|
|
12
27
|
}, {}, {}>;
|
|
13
28
|
//# sourceMappingURL=SwitchSlots.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchSlots.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/extended/mui/Switch/slots/SwitchSlots.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwitchSlots.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/extended/mui/Switch/slots/SwitchSlots.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,gBAAgB;;6NAGR,CAAC;AAEtB,eAAO,MAAM,eAAe;;UAGF,CAAC;AAE3B,eAAO,MAAM,WAAW;;UAGF,CAAC;AAEvB,eAAO,MAAM,aAAa;;6NAGF,CAAC;AAEzB,eAAO,MAAM,iBAAiB;;iOAGF,CAAC;AAE7B,eAAO,MAAM,UAAU;;UAGF,CAAC;AAEtB,eAAO,MAAM,iBAAiB;;UAGF,CAAC;AAE7B,eAAO,MAAM,cAAc;;UAGF,CAAC;AAE1B,eAAO,MAAM,cAAc;;UAGF,CAAC"}
|
|
@@ -1,25 +1,46 @@
|
|
|
1
1
|
import { styled as t } from "@mui/material/styles";
|
|
2
|
-
import {
|
|
2
|
+
import { Icon as c } from "@m4l/base";
|
|
3
|
+
import { Switch as i, Skeleton as s } from "@mui/material";
|
|
3
4
|
import { SwitchSlots as o } from "./SwitchEnum.js";
|
|
4
5
|
import { SWITCH_KEY_COMPONENT as e } from "../constants.js";
|
|
5
|
-
import { switchStyles as
|
|
6
|
-
import { Typography as
|
|
7
|
-
const
|
|
6
|
+
import { switchStyles as n } from "../Switch.styles.js";
|
|
7
|
+
import { Typography as l } from "../../Typography/Typography.js";
|
|
8
|
+
const f = t("div", {
|
|
8
9
|
name: e,
|
|
9
10
|
slot: o.root
|
|
10
|
-
})(
|
|
11
|
+
})(n.root), h = t(i, {
|
|
11
12
|
name: e,
|
|
12
13
|
slot: o.muiSwitch
|
|
13
|
-
})(
|
|
14
|
+
})(n.muiSwitch), w = t(l, {
|
|
14
15
|
name: e,
|
|
15
16
|
slot: o.label
|
|
16
|
-
})(
|
|
17
|
+
})(n.label), b = t("div", {
|
|
18
|
+
name: e,
|
|
19
|
+
slot: o.content
|
|
20
|
+
})(n.content), u = t("span", {
|
|
21
|
+
name: e,
|
|
22
|
+
slot: o.iconSurface
|
|
23
|
+
})(n.iconSurface), I = t(c, {
|
|
24
|
+
name: e,
|
|
25
|
+
slot: o.icon
|
|
26
|
+
})(n.icon), k = t(l, {
|
|
27
|
+
name: e,
|
|
28
|
+
slot: o.description
|
|
29
|
+
})(n.description), L = t(l, {
|
|
30
|
+
name: e,
|
|
31
|
+
slot: o.endLabel
|
|
32
|
+
})(n.endLabel), C = t(s, {
|
|
17
33
|
name: e,
|
|
18
34
|
slot: o.skeleton
|
|
19
|
-
})(
|
|
35
|
+
})(n.skeleton);
|
|
20
36
|
export {
|
|
37
|
+
b as ContentStyled,
|
|
38
|
+
k as DescriptionStyled,
|
|
39
|
+
L as EndLabelStyled,
|
|
40
|
+
I as IconStyled,
|
|
41
|
+
u as IconSurfaceStyled,
|
|
21
42
|
w as LabelStyled,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
43
|
+
h as MUISwitchStyled,
|
|
44
|
+
C as SkeletonStyled,
|
|
45
|
+
f as SwitchRootStyled
|
|
25
46
|
};
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { SwitchProps as MUISwitchProps, Theme } from '@mui/material';
|
|
2
|
+
import { IconProps } from '@m4l/base';
|
|
2
3
|
import { ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
3
4
|
import { M4LOverridesStyleRules } from '../../../../@types/augmentations';
|
|
4
5
|
import { SwitchSlots } from './slots/SwitchEnum';
|
|
5
6
|
import { SWITCH_KEY_COMPONENT } from './constants';
|
|
7
|
+
/** Supported container presentations for the Switch component. */
|
|
8
|
+
export type SwitchVariant = 'text' | 'outlined' | 'contained';
|
|
9
|
+
/** Position of a Switch inside a visually grouped set of Switches. */
|
|
10
|
+
export type SwitchPosition = 'first' | 'middle' | 'last' | 'only';
|
|
11
|
+
/** Supported root width modes for the Switch component. */
|
|
12
|
+
export type SwitchWidth = 'fit-content' | '100%';
|
|
6
13
|
/** Props for the Switch component. */
|
|
7
14
|
export interface SwitchProps extends MUISwitchProps {
|
|
8
15
|
/** Optional label displayed inline next to the switch. */
|
|
@@ -15,6 +22,20 @@ export interface SwitchProps extends MUISwitchProps {
|
|
|
15
22
|
color?: Extract<ComponentPalletColor, 'default'>;
|
|
16
23
|
/** Indicates an error state. */
|
|
17
24
|
error?: boolean;
|
|
25
|
+
/** Container presentation. Defaults to the legacy text presentation. */
|
|
26
|
+
variant?: SwitchVariant;
|
|
27
|
+
/** Position inside a grouped set. Adds the shared border and vertical padding. */
|
|
28
|
+
groupPosition?: SwitchPosition;
|
|
29
|
+
/** Root width mode. Storybook labels `fit-content` as Fit Content and `100%` as Hug Content. */
|
|
30
|
+
width?: SwitchWidth;
|
|
31
|
+
/** Optional leading icon. Omit it to hide the icon surface. */
|
|
32
|
+
icon?: IconProps['src'];
|
|
33
|
+
/** Main title rendered before the switch in the enhanced layout. */
|
|
34
|
+
startText?: string;
|
|
35
|
+
/** Secondary description rendered below the title. */
|
|
36
|
+
descriptionText?: string;
|
|
37
|
+
/** Trailing value text rendered after the switch. */
|
|
38
|
+
endText?: string;
|
|
18
39
|
}
|
|
19
40
|
/** Internal owner state used by styled slots. */
|
|
20
41
|
export interface SwitchOwnerState {
|
|
@@ -28,6 +49,22 @@ export interface SwitchOwnerState {
|
|
|
28
49
|
color: Extract<ComponentPalletColor, 'default'>;
|
|
29
50
|
/** Whether the switch is in an error state. */
|
|
30
51
|
error?: boolean;
|
|
52
|
+
/** Container presentation. */
|
|
53
|
+
variant: SwitchVariant;
|
|
54
|
+
/** Position inside a grouped set. */
|
|
55
|
+
groupPosition?: SwitchPosition;
|
|
56
|
+
/** Root width mode. */
|
|
57
|
+
width: SwitchWidth;
|
|
58
|
+
/** Whether the enhanced layout renders an icon. */
|
|
59
|
+
hasIcon?: boolean;
|
|
60
|
+
/** Whether the enhanced layout renders a title. */
|
|
61
|
+
hasStartText?: boolean;
|
|
62
|
+
/** Whether the enhanced layout renders a description. */
|
|
63
|
+
hasDescription?: boolean;
|
|
64
|
+
/** Whether the enhanced layout renders trailing text. */
|
|
65
|
+
hasEndText?: boolean;
|
|
66
|
+
/** Whether the enhanced content layout is active. */
|
|
67
|
+
hasEnhancedLayout?: boolean;
|
|
31
68
|
}
|
|
32
69
|
/** Union of slot keys for the Switch component. */
|
|
33
70
|
export type SwitchSlotsType = keyof typeof SwitchSlots;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Switch/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,sCAAsC;AACtC,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,cAAc,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACjC,0BAA0B;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC1C,qBAAqB;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC;IACjD,gCAAgC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Switch/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,kEAAkE;AAClE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9D,sEAAsE;AACtE,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAElE,2DAA2D;AAC3D,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,MAAM,CAAC;AAEjD,sCAAsC;AACtC,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,cAAc,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACjC,0BAA0B;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC1C,qBAAqB;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC;IACjD,gCAAgC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wEAAwE;IACxE,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,kFAAkF;IAClF,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,gGAAgG;IAChG,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IACxB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,qCAAqC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0BAA0B;IAC1B,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;IACzC,qBAAqB;IACrB,KAAK,EAAE,OAAO,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC;IAChD,+CAA+C;IAC/C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,8BAA8B;IAC9B,OAAO,EAAE,aAAa,CAAC;IACvB,qCAAqC;IACrC,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,uBAAuB;IACvB,KAAK,EAAE,WAAW,CAAC;IACnB,mDAAmD;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mDAAmD;IACnD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yDAAyD;IACzD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,mDAAmD;AACnD,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,WAAW,CAAC;AAEvD,iDAAiD;AACjD,MAAM,MAAM,YAAY,GAAG,sBAAsB,CAC/C,eAAe,EACf,OAAO,oBAAoB,EAC3B,KAAK,CACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.77.0",
|
|
3
|
+
"version": "9.77.1-beta-update-switch-component-variable.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"@hookform/resolvers": "2.9.11",
|
|
54
54
|
"nprogress": "0.2.0",
|
|
55
55
|
"react-transition-group": "4.4.5",
|
|
56
|
-
"react-color": "2.19.3",
|
|
57
56
|
"@tanstack/react-virtual": "3.13.23",
|
|
57
|
+
"react-color": "2.19.3",
|
|
58
58
|
"react-rnd": "10.5.2",
|
|
59
59
|
"@mui/x-date-pickers": "6.20.2",
|
|
60
60
|
"react-dropzone": "14.4.1",
|
|
61
|
-
"react-spinners": "0.13.8",
|
|
62
61
|
"react-draggable": "4.5.0",
|
|
62
|
+
"react-spinners": "0.13.8",
|
|
63
63
|
"chart.js": "4.5.1",
|
|
64
64
|
"chartjs-chart-error-bars": "4.4.5",
|
|
65
65
|
"qrcode.react": "3.2.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"react-dnd": "16.0.1",
|
|
71
71
|
"react-dnd-html5-backend": "16.0.1",
|
|
72
72
|
"date-fns": "2.30.0",
|
|
73
|
-
"react-
|
|
74
|
-
"react-
|
|
73
|
+
"react-resizable": "3.1.3",
|
|
74
|
+
"react-window": "1.8.11"
|
|
75
75
|
}
|
|
76
76
|
}
|