@m4l/components 9.67.2 → 9.68.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/Stepper/Stepper.styles.d.ts.map +1 -1
- package/components/Stepper/Stepper.styles.js +201 -122
- package/components/Stepper/store/StepperContext/index.d.ts.map +1 -1
- package/components/Stepper/store/StepperContext/index.js +52 -52
- package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.d.ts +3 -0
- package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.d.ts.map +1 -1
- package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.js +58 -53
- package/components/Stepper/subcomponents/StepArea/index.d.ts.map +1 -1
- package/components/Stepper/subcomponents/StepArea/index.js +44 -37
- package/components/Stepper/subcomponents/StepArea/subcomponents/Inidicator/index.d.ts.map +1 -1
- package/components/Stepper/subcomponents/StepArea/subcomponents/Inidicator/index.js +68 -51
- package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.js +5 -5
- package/components/WindowBase/WindowBase.styles.d.ts.map +1 -1
- package/components/WindowBase/WindowBase.styles.js +42 -37
- package/components/WindowBase/subcomponents/Header/HeaderWindowBase.d.ts.map +1 -1
- package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +58 -58
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/Stepper/Stepper.styles.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Stepper.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/Stepper/Stepper.styles.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqB,aAAa,EAAE,MAAM,SAAS,CAAC;AAqB3D,eAAO,MAAM,aAAa,EAAE,aA6jB3B,CAAC"}
|
|
@@ -1,52 +1,66 @@
|
|
|
1
|
-
import { getSizeStyles as
|
|
2
|
-
const
|
|
1
|
+
import { getSizeStyles as x } from "../../utils/getSizeStyles/getSizeStyles.js";
|
|
2
|
+
const k = (e, i) => {
|
|
3
|
+
const s = i?.originalStepIndex, t = typeof s == "number" && i?.stepValidationStatus?.[s] === !1, r = i?.indicatorType === "number" && !t ? "base" : "case";
|
|
4
|
+
return e.vars.size.desktop[i?.size || "medium"][r];
|
|
5
|
+
}, z = {
|
|
3
6
|
/**
|
|
4
7
|
*
|
|
5
8
|
* Estilos para el contenedor principal del Stepper.
|
|
6
9
|
*/
|
|
7
|
-
stepperRoot: ({ theme:
|
|
10
|
+
stepperRoot: ({ theme: e }) => ({
|
|
8
11
|
display: "flex",
|
|
9
12
|
flexDirection: "column",
|
|
10
13
|
justifyContent: "flex-start",
|
|
11
|
-
background:
|
|
14
|
+
background: e.vars.palette.background.default,
|
|
12
15
|
width: "100%",
|
|
13
16
|
height: "100%",
|
|
14
|
-
borderRadius:
|
|
17
|
+
borderRadius: e.vars.size.borderRadius.r1
|
|
15
18
|
}),
|
|
16
19
|
/**
|
|
17
20
|
* Estilos para la sección que contiene los pasos del Stepper.
|
|
18
21
|
*/
|
|
19
|
-
contentSection: ({ theme:
|
|
22
|
+
contentSection: ({ theme: e, ownerState: i }) => ({
|
|
20
23
|
display: "flex",
|
|
21
24
|
flex: 1,
|
|
22
25
|
height: "100%",
|
|
23
26
|
overflow: "hidden",
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
...i?.orientation === "vertical" || e.generalSettings.isMobile ? {
|
|
28
|
+
gap: e.vars.size.baseSpacings.sp6,
|
|
26
29
|
flexDirection: "column"
|
|
27
30
|
} : {
|
|
31
|
+
gap: e.vars.size.baseSpacings.sp5,
|
|
28
32
|
flexDirection: "row"
|
|
29
33
|
}
|
|
30
34
|
}),
|
|
31
35
|
/**
|
|
32
36
|
* Estilos para el contenido del paso dentro del Stepper.
|
|
33
37
|
*/
|
|
34
|
-
stepContent: ({ ownerState:
|
|
38
|
+
stepContent: ({ ownerState: e }) => ({
|
|
35
39
|
height: "100%",
|
|
36
|
-
display:
|
|
40
|
+
display: e?.isStepVisible ? "flex" : "none",
|
|
37
41
|
flexDirection: "column"
|
|
38
42
|
}),
|
|
39
43
|
/**
|
|
40
44
|
* Estilos para la sección que contiene los botones de acción del Stepper.
|
|
41
45
|
*/
|
|
42
|
-
stepArea: ({ theme:
|
|
43
|
-
...
|
|
46
|
+
stepArea: ({ theme: e, ownerState: i }) => ({
|
|
47
|
+
...i?.orientation === "vertical" || e.generalSettings.isMobile ? {
|
|
44
48
|
display: "flex",
|
|
45
49
|
alignItems: "start",
|
|
46
50
|
width: "100%",
|
|
47
51
|
overflowX: "auto",
|
|
48
52
|
overflowY: "hidden"
|
|
49
53
|
} : {
|
|
54
|
+
display: "flex",
|
|
55
|
+
flexDirection: "column",
|
|
56
|
+
// The whole distance between two steps lives here, not in a padding of each step.
|
|
57
|
+
gap: e.vars.size.baseSpacings.sp5,
|
|
58
|
+
padding: e.vars.size.baseSpacings.sp3,
|
|
59
|
+
boxSizing: "border-box",
|
|
60
|
+
borderRadius: e.vars.size.borderRadius.r2,
|
|
61
|
+
background: e.vars.palette.background.base,
|
|
62
|
+
alignSelf: "flex-start",
|
|
63
|
+
maxHeight: "100%",
|
|
50
64
|
maxWidth: "116px",
|
|
51
65
|
overflowY: "auto"
|
|
52
66
|
}
|
|
@@ -54,48 +68,98 @@ const c = {
|
|
|
54
68
|
/**
|
|
55
69
|
* Estilos para el área de contenido del Stepper.
|
|
56
70
|
*/
|
|
57
|
-
contentArea: ({ theme:
|
|
71
|
+
contentArea: ({ theme: e, ownerState: i }) => ({
|
|
58
72
|
flex: 1,
|
|
59
73
|
display: "flex",
|
|
60
74
|
flexDirection: "column",
|
|
61
75
|
overflowY: "auto",
|
|
62
|
-
...
|
|
76
|
+
...i?.orientation === "vertical" || e.generalSettings.isMobile ? {
|
|
63
77
|
// borderTop: '1px solid',
|
|
64
|
-
gap:
|
|
78
|
+
gap: e.vars.size.baseSpacings.sp4
|
|
65
79
|
// paddingTop: theme.vars.size.baseSpacings.sp8,
|
|
66
80
|
} : {
|
|
67
|
-
gap:
|
|
68
|
-
|
|
69
|
-
paddingLeft: i.vars.size.baseSpacings.sp8
|
|
70
|
-
},
|
|
71
|
-
borderColor: i.vars.palette?.border.disabled
|
|
81
|
+
gap: e.vars.size.baseSpacings.sp6
|
|
82
|
+
}
|
|
72
83
|
}),
|
|
73
84
|
/**
|
|
74
85
|
* Estilos para cada paso del Stepper.
|
|
75
86
|
*/
|
|
76
|
-
step: ({ theme:
|
|
77
|
-
const
|
|
87
|
+
step: ({ theme: e, ownerState: i }) => {
|
|
88
|
+
const s = i?.currentStep ?? 0, t = i?.step ?? 0, r = i?.totalSteps ?? 0, a = s > t, n = t === r - 1, o = typeof i?.originalStepIndex == "number" ? i.originalStepIndex : t, l = i?.orientation === "vertical" && !e.generalSettings.isMobile, d = i?.orientation !== "vertical" && !e.generalSettings.isMobile, c = k(e, i), g = i?.indicatorType === "dot", v = `calc(${c} / 2)`, p = e.vars.size.desktop[i?.size || "medium"].case, b = `calc(${e.vars.size.baseSpacings["sp0-5"]} + ${p} / 2)`, y = g ? "50%" : `calc(50% + ${v})`, f = e.vars.size.desktop[i?.size || "medium"].case, u = d && !!i?.visibleTitle;
|
|
78
89
|
return {
|
|
79
90
|
cursor: "pointer",
|
|
80
|
-
display:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
display: i?.isStepVisible ? u || l ? "grid" : "flex" : "none",
|
|
92
|
+
...u && {
|
|
93
|
+
gridTemplateColumns: `${f} minmax(0, 1fr)`
|
|
94
|
+
},
|
|
95
|
+
...l && {
|
|
96
|
+
gridTemplateColumns: "minmax(0, 1fr)",
|
|
97
|
+
gridTemplateRows: `${p} auto`,
|
|
98
|
+
justifyItems: "center"
|
|
99
|
+
},
|
|
100
|
+
flexDirection: i?.orientation === "vertical" || e.generalSettings.isMobile ? "column" : "row",
|
|
101
|
+
alignItems: d ? "flex-start" : "center",
|
|
102
|
+
justifyContent: i?.visibleTitle ? i?.orientation === "vertical" || e.generalSettings.isMobile ? "space-between" : "flex-start" : "center",
|
|
103
|
+
gap: l ? 0 : i?.orientation === "vertical" || e.generalSettings.isMobile ? e.vars.size.baseSpacings.sp1 : e.vars.size.baseSpacings.sp2,
|
|
85
104
|
width: "100%",
|
|
86
|
-
...(
|
|
87
|
-
minWidth:
|
|
105
|
+
...(i?.orientation === "vertical" || e.generalSettings.isMobile) && {
|
|
106
|
+
minWidth: e.vars.size.baseSpacings.sp10
|
|
107
|
+
},
|
|
108
|
+
height: "auto",
|
|
109
|
+
...l && {
|
|
110
|
+
paddingBlock: e.vars.size.baseSpacings["sp0-5"]
|
|
88
111
|
},
|
|
89
|
-
height: e?.orientation === "vertical" || i.generalSettings.isMobile ? "auto" : i.vars.size.baseSpacings.sp13,
|
|
90
112
|
position: "relative",
|
|
91
|
-
|
|
113
|
+
...l && {
|
|
114
|
+
...t > 0 && {
|
|
115
|
+
"&::before": {
|
|
116
|
+
content: '""',
|
|
117
|
+
position: "absolute",
|
|
118
|
+
top: b,
|
|
119
|
+
left: 0,
|
|
120
|
+
right: y,
|
|
121
|
+
// Width from the stroke token; only the style and the color change.
|
|
122
|
+
borderTop: e.vars.size.borderStroke.container,
|
|
123
|
+
borderTopStyle: s >= o ? "solid" : "dashed",
|
|
124
|
+
borderTopColor: s >= o ? e.vars.palette.primary.enabled : e.vars.palette.border.secondary
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
...!n && {
|
|
128
|
+
"&::after": {
|
|
129
|
+
content: '""',
|
|
130
|
+
position: "absolute",
|
|
131
|
+
top: b,
|
|
132
|
+
right: 0,
|
|
133
|
+
left: y,
|
|
134
|
+
// Right half: solid once the current step is past this one.
|
|
135
|
+
borderTop: e.vars.size.borderStroke.container,
|
|
136
|
+
borderTopStyle: s > o ? "solid" : "dashed",
|
|
137
|
+
borderTopColor: s > o ? e.vars.palette.primary.enabled : e.vars.palette.border.secondary
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
// The side-list connector is drawn by the step, not by the indicator: a fixed-height line hanging from the
|
|
142
|
+
// indicator cannot follow titles of different heights. It runs from the bottom of this indicator to the top
|
|
143
|
+
// of the next one (center to center for dots, see above); the negative bottom absorbs the gap of the list.
|
|
144
|
+
...d && !n && {
|
|
92
145
|
"&::after": {
|
|
93
146
|
content: '""',
|
|
94
147
|
position: "absolute",
|
|
95
|
-
top:
|
|
148
|
+
top: g ? v : c,
|
|
149
|
+
bottom: g ? `calc(-1 * (${e.vars.size.baseSpacings.sp5} + ${f} / 2))` : `calc(-1 * ${e.vars.size.baseSpacings.sp5})`,
|
|
150
|
+
left: u ? `calc(${f} / 2)` : "50%",
|
|
151
|
+
transform: "translateX(-50%)",
|
|
152
|
+
borderLeft: `1px ${s > o ? "solid" : "dashed"} ${s > o ? e.vars.palette.primary.activeOpacity : e.vars.palette.default.activeOpacity}`
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
...!n && e.generalSettings.isMobile && {
|
|
156
|
+
"&::after": {
|
|
157
|
+
content: '""',
|
|
158
|
+
position: "absolute",
|
|
159
|
+
top: "10px",
|
|
96
160
|
// Ajustado para coincidir con el centro del indicador cuando alignItems es start
|
|
97
161
|
height: "1px",
|
|
98
|
-
borderTop: `1px ${a ? "solid" : "dashed"} ${a ?
|
|
162
|
+
borderTop: `1px ${a ? "solid" : "dashed"} ${a ? e.vars.palette.primary.enabled : e.vars.palette.border.default}`,
|
|
99
163
|
left: "50%",
|
|
100
164
|
width: "100%"
|
|
101
165
|
}
|
|
@@ -105,36 +169,50 @@ const c = {
|
|
|
105
169
|
/**
|
|
106
170
|
* Estilos para el nombre del paso dentro del Stepper.
|
|
107
171
|
*/
|
|
108
|
-
stepName: ({ theme:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
172
|
+
stepName: ({ theme: e, ownerState: i }) => {
|
|
173
|
+
const s = i?.orientation === "vertical" && !e.generalSettings.isMobile, t = i?.orientation !== "vertical" && !e.generalSettings.isMobile, r = i?.currentStep ?? 0, a = i?.originalStepIndex, n = typeof a == "number" && r > a, o = typeof a == "number" && r === a;
|
|
174
|
+
return {
|
|
175
|
+
...i?.orientation !== "vertical" && !e.generalSettings.isMobile && {
|
|
176
|
+
maxWidth: "120px",
|
|
177
|
+
width: "100%"
|
|
178
|
+
},
|
|
179
|
+
...s && {
|
|
180
|
+
maxWidth: `calc(${e.vars.size.baseSpacings.sp10} * 3)`,
|
|
181
|
+
// 120px = 3 × sp10
|
|
182
|
+
width: "100%",
|
|
183
|
+
minHeight: e.vars.size.baseSpacings.sp5
|
|
184
|
+
},
|
|
185
|
+
// Side list: the title box is as tall as the marker and centers its text, so a two-line title overflows evenly
|
|
186
|
+
// above and below it. The marker ends up centered on the text block and every step keeps the same pitch.
|
|
187
|
+
...t && {
|
|
188
|
+
height: k(e, i),
|
|
189
|
+
alignItems: "center"
|
|
190
|
+
},
|
|
191
|
+
...e.generalSettings.isMobile && {
|
|
192
|
+
maxWidth: "120px",
|
|
193
|
+
width: "100%",
|
|
194
|
+
marginTop: e.vars.size.baseSpacings.sp1
|
|
195
|
+
},
|
|
196
|
+
alignContent: "center",
|
|
197
|
+
cursor: "pointer",
|
|
198
|
+
...e.generalSettings.isMobile ? {
|
|
199
|
+
display: "none"
|
|
200
|
+
} : {
|
|
201
|
+
display: i?.visibleTitle ? t ? "flex" : "block" : "none"
|
|
202
|
+
},
|
|
203
|
+
flex: 1,
|
|
204
|
+
minWidth: 0,
|
|
205
|
+
order: 1,
|
|
206
|
+
"&.M4LTypography-root": {
|
|
207
|
+
color: n || o ? e.vars.palette.text.primary : e.vars.palette.text.secondary,
|
|
208
|
+
textAlign: i?.orientation === "vertical" || e.generalSettings.isMobile ? "center" : "left"
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
},
|
|
134
212
|
/**
|
|
135
213
|
* Styles for the step name text with line clamp truncation.
|
|
136
214
|
*/
|
|
137
|
-
stepNameText: ({ theme:
|
|
215
|
+
stepNameText: ({ theme: e, ownerState: i }) => ({
|
|
138
216
|
display: "-webkit-box",
|
|
139
217
|
WebkitBoxOrient: "vertical",
|
|
140
218
|
WebkitLineClamp: 2,
|
|
@@ -145,104 +223,105 @@ const c = {
|
|
|
145
223
|
width: "100%",
|
|
146
224
|
direction: "ltr",
|
|
147
225
|
lineHeight: 1.2,
|
|
148
|
-
textAlign:
|
|
226
|
+
textAlign: i?.orientation === "vertical" || e.generalSettings.isMobile ? "center" : "left"
|
|
149
227
|
}),
|
|
150
228
|
/**
|
|
151
229
|
* Estilos para el indicador numérico de cada paso del Stepper.
|
|
152
230
|
*/
|
|
153
|
-
indicator: ({ theme:
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
marginTop: i.generalSettings.isMobile ? "6px" : i.vars.size.baseSpacings.sp1
|
|
158
|
-
} : {},
|
|
231
|
+
indicator: ({ theme: e, ownerState: i }) => {
|
|
232
|
+
const s = i?.isCompleted ?? !1, t = i?.isCurrent ?? !1, r = i?.isValidStep ?? !0, a = !r && i?.hasBeenValidated, n = s && r, o = i?.indicatorType === "number" && !e.generalSettings.isMobile, l = o && n, d = o && !a && !n, c = d || l, g = i?.indicatorType === "dot" || e.generalSettings.isMobile, v = i?.indicatorType === "dot" && i?.orientation !== "vertical" && !e.generalSettings.isMobile;
|
|
233
|
+
let p = e.vars.palette.default.enabled;
|
|
234
|
+
return a ? p = e.vars.palette.error.enabled : n ? p = l ? e.vars.palette.primary.enabledOpacity : e.vars.palette.background.default : d ? p = t ? e.vars.palette.primary.enabledOpacity : e.vars.palette.default.enabledOpacity : t ? p = i?.indicatorType === "dot" || e.generalSettings.isMobile ? e.vars.palette.background.default : e.vars.palette.primary.enabled : (i?.indicatorType === "dot" || e.generalSettings.isMobile) && (p = e.vars.palette.background.default), {
|
|
159
235
|
display: "flex",
|
|
160
236
|
alignItems: "center",
|
|
161
237
|
justifyContent: "center",
|
|
238
|
+
...!e.generalSettings.isMobile && i?.orientation !== "vertical" && i?.visibleTitle && { justifySelf: "center" },
|
|
162
239
|
flexShrink: 0,
|
|
163
240
|
zIndex: 1,
|
|
164
|
-
order:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
241
|
+
order: 0,
|
|
242
|
+
// Dot markers are transparent so the connector, which runs behind them, reaches the visible dot.
|
|
243
|
+
background: v || g && !a ? "transparent" : p,
|
|
244
|
+
borderRadius: c ? e.vars.size.borderRadius["r1-5"] : e.vars.size.borderRadius.r2,
|
|
245
|
+
...c && {
|
|
246
|
+
boxSizing: "border-box",
|
|
247
|
+
border: e.vars.size.borderStroke.container,
|
|
248
|
+
// Figma's default opacity (0.08) equals the theme's default.hoverOpacity;
|
|
249
|
+
// default.opacity is 0.12.
|
|
250
|
+
borderColor: l || t ? e.vars.palette.primary.selectedOpacity : e.vars.palette.default.hoverOpacity
|
|
169
251
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
content: '""',
|
|
174
|
-
position: "absolute",
|
|
175
|
-
top: "100%",
|
|
176
|
-
left: "50%",
|
|
177
|
-
transform: "translateX(-50%)",
|
|
178
|
-
width: "1px",
|
|
179
|
-
height: i.vars.size.baseSpacings.sp12,
|
|
180
|
-
borderLeft: `1px ${s ? "solid" : "dashed"} ${s ? i.vars.palette.primary.enabled : i.vars.palette.border.default}`
|
|
181
|
-
}
|
|
252
|
+
...o && {
|
|
253
|
+
// Figma's 0.16 opacity maps to selectedOpacity because hoverOpacity is 0.12.
|
|
254
|
+
boxShadow: d && t ? `0 2px 8px 0 ${e.vars.palette.primary.selectedOpacity}` : "none"
|
|
182
255
|
},
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
256
|
+
position: "relative",
|
|
257
|
+
...x(
|
|
258
|
+
e,
|
|
259
|
+
i?.size || "medium",
|
|
260
|
+
o && !a ? "base" : "case",
|
|
261
|
+
(b) => ({
|
|
262
|
+
width: b,
|
|
263
|
+
height: b
|
|
264
|
+
})
|
|
265
|
+
)
|
|
187
266
|
};
|
|
188
267
|
},
|
|
189
268
|
/**
|
|
190
269
|
* Estilos para el número de texto dentro del indicador numérico del Stepper.
|
|
191
270
|
*/
|
|
192
|
-
textNumber: ({ theme:
|
|
193
|
-
const
|
|
271
|
+
textNumber: ({ theme: e, ownerState: i }) => {
|
|
272
|
+
const s = i?.isCompleted ?? !1, t = i?.isCurrent ?? !1, r = i?.isValidStep ?? !0, a = i?.hasBeenValidated ?? !1, n = i?.indicatorType === "number" && !e.generalSettings.isMobile && !(a && !r) && !(s && r);
|
|
194
273
|
return {
|
|
195
274
|
"&.M4LTypography-root": {
|
|
196
|
-
color: !
|
|
275
|
+
color: !r && a ? e.vars.palette.error.contrastText : n ? t ? e.vars.palette.primary.semanticText : e.vars.palette.text.secondary : s || t ? e.vars.palette.primary.contrastText : e.vars.palette.text.primary
|
|
197
276
|
}
|
|
198
277
|
};
|
|
199
278
|
},
|
|
200
279
|
/**
|
|
201
280
|
* Estilos para el área de contenido del Stepper.
|
|
202
281
|
*/
|
|
203
|
-
contentAreaHeader: ({ theme:
|
|
282
|
+
contentAreaHeader: ({ theme: e }) => ({
|
|
204
283
|
display: "flex",
|
|
205
284
|
alignItems: "center",
|
|
206
|
-
gap:
|
|
285
|
+
gap: e.size.baseSpacings.sp3,
|
|
207
286
|
position: "sticky",
|
|
208
287
|
top: 0,
|
|
209
|
-
backgroundColor:
|
|
288
|
+
backgroundColor: e.vars.palette.background.default,
|
|
210
289
|
zIndex: 10
|
|
211
290
|
// paddingBottom: theme.vars.size.baseSpacings.sp2,
|
|
212
291
|
}),
|
|
213
292
|
/**
|
|
214
293
|
* Estilos para el cuerpo del área de contenido del Stepper
|
|
215
294
|
*/
|
|
216
|
-
contentAreaBody: ({ theme:
|
|
295
|
+
contentAreaBody: ({ theme: e }) => ({
|
|
217
296
|
flex: 1,
|
|
218
297
|
overflowY: "auto",
|
|
219
298
|
display: "flex",
|
|
220
299
|
flexDirection: "column",
|
|
221
|
-
gap:
|
|
300
|
+
gap: e.vars.size.baseSpacings.sp6
|
|
222
301
|
}),
|
|
223
302
|
/**
|
|
224
303
|
* Estilos para el contenedor del icono del titulo del Stepper.
|
|
225
304
|
*/
|
|
226
|
-
wrapperIcon: ({ theme:
|
|
305
|
+
wrapperIcon: ({ theme: e, ownerState: i }) => ({
|
|
227
306
|
display: "flex",
|
|
228
307
|
alignItems: "center",
|
|
229
308
|
justifyContent: "center",
|
|
230
309
|
flexShrink: 0,
|
|
231
|
-
background:
|
|
232
|
-
borderRadius:
|
|
233
|
-
...
|
|
234
|
-
width:
|
|
235
|
-
height:
|
|
310
|
+
background: e.vars.palette.primary.enabledOpacity,
|
|
311
|
+
borderRadius: e.vars.size.borderRadius["r1-5"],
|
|
312
|
+
...x(e, i?.size || "medium", "box", (s) => ({
|
|
313
|
+
width: s,
|
|
314
|
+
height: s
|
|
236
315
|
}))
|
|
237
316
|
}),
|
|
238
317
|
/**
|
|
239
318
|
* Estilos para el título del Stepper.
|
|
240
319
|
*/
|
|
241
|
-
wrapperTitle: ({ theme:
|
|
242
|
-
color:
|
|
320
|
+
wrapperTitle: ({ theme: e }) => ({
|
|
321
|
+
color: e.vars.palette.text.primary,
|
|
243
322
|
display: "flex",
|
|
244
323
|
flexDirection: "column",
|
|
245
|
-
gap:
|
|
324
|
+
gap: e.vars.size.baseSpacings["sp0-5"],
|
|
246
325
|
flex: 1,
|
|
247
326
|
minWidth: 0,
|
|
248
327
|
overflow: "hidden"
|
|
@@ -250,10 +329,10 @@ const c = {
|
|
|
250
329
|
/**
|
|
251
330
|
* Estilos para el icono del Stepper.
|
|
252
331
|
*/
|
|
253
|
-
icon: ({ theme:
|
|
254
|
-
...
|
|
255
|
-
width:
|
|
256
|
-
height:
|
|
332
|
+
icon: ({ theme: e, ownerState: i }) => ({
|
|
333
|
+
...x(e, i?.size || "medium", "case", (s) => ({
|
|
334
|
+
width: s,
|
|
335
|
+
height: s
|
|
257
336
|
}))
|
|
258
337
|
}),
|
|
259
338
|
/**
|
|
@@ -282,13 +361,13 @@ const c = {
|
|
|
282
361
|
/**
|
|
283
362
|
* Estilos para la descripción del Stepper.
|
|
284
363
|
*/
|
|
285
|
-
description: ({ theme:
|
|
364
|
+
description: ({ theme: e }) => ({
|
|
286
365
|
minWidth: 0,
|
|
287
366
|
overflow: "hidden",
|
|
288
367
|
width: "100%",
|
|
289
368
|
maxWidth: "100%",
|
|
290
369
|
"&.M4LTypography-root": {
|
|
291
|
-
color:
|
|
370
|
+
color: e.vars.palette.text.secondary,
|
|
292
371
|
overflow: "hidden",
|
|
293
372
|
minWidth: 0,
|
|
294
373
|
textOverflow: "ellipsis",
|
|
@@ -298,43 +377,43 @@ const c = {
|
|
|
298
377
|
/**
|
|
299
378
|
* Estilos para la sección de botones de acción del Stepper.
|
|
300
379
|
*/
|
|
301
|
-
stepperFooterSection: ({ theme:
|
|
380
|
+
stepperFooterSection: ({ theme: e }) => ({
|
|
302
381
|
display: "flex",
|
|
303
382
|
alignItems: "center",
|
|
304
383
|
justifyContent: "space-between",
|
|
305
384
|
flexWrap: "wrap",
|
|
306
|
-
gap:
|
|
307
|
-
paddingTop:
|
|
385
|
+
gap: e.vars.size.baseSpacings.sp2,
|
|
386
|
+
paddingTop: e.vars.size.baseSpacings.sp4,
|
|
308
387
|
position: "sticky",
|
|
309
388
|
bottom: 0,
|
|
310
|
-
backgroundColor:
|
|
389
|
+
backgroundColor: e.vars.palette.background.default,
|
|
311
390
|
marginTop: "auto",
|
|
312
391
|
zIndex: 10
|
|
313
392
|
}),
|
|
314
393
|
/**
|
|
315
394
|
* Estilos para las acciones del lado izquierdo del StepperFooter.
|
|
316
395
|
*/
|
|
317
|
-
stepperFooterLeftActions: ({ theme:
|
|
396
|
+
stepperFooterLeftActions: ({ theme: e }) => ({
|
|
318
397
|
display: "flex",
|
|
319
398
|
alignItems: "center",
|
|
320
|
-
gap:
|
|
399
|
+
gap: e.vars.size.baseSpacings.sp3
|
|
321
400
|
}),
|
|
322
401
|
/**
|
|
323
402
|
* Estilos para las acciones del lado derecho del StepperFooter.
|
|
324
403
|
*/
|
|
325
|
-
stepperFooterRightActions: ({ theme:
|
|
404
|
+
stepperFooterRightActions: ({ theme: e }) => ({
|
|
326
405
|
display: "flex",
|
|
327
406
|
alignItems: "center",
|
|
328
|
-
gap:
|
|
407
|
+
gap: e.vars.size.baseSpacings.sp3
|
|
329
408
|
}),
|
|
330
409
|
/**
|
|
331
410
|
* Estilos para el contenedor de los botones del Stepper.
|
|
332
411
|
*/
|
|
333
|
-
wrapperButtons: ({ theme:
|
|
412
|
+
wrapperButtons: ({ theme: e }) => ({
|
|
334
413
|
display: "flex",
|
|
335
|
-
gap:
|
|
414
|
+
gap: e.size.baseSpacings.sp3
|
|
336
415
|
})
|
|
337
416
|
};
|
|
338
417
|
export {
|
|
339
|
-
|
|
418
|
+
z as stepperStyles
|
|
340
419
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/Stepper/store/StepperContext/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAI/C,QAAA,MAAM,cAAc;;;;;;;;UAA2C,CAAC;AAEhE;;;;GAIG;AACH,QAAA,MAAM,eAAe,GAAI,OAAO,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/Stepper/store/StepperContext/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAI/C,QAAA,MAAM,cAAc;;;;;;;;UAA2C,CAAC;AAEhE;;;;GAIG;AACH,QAAA,MAAM,eAAe,GAAI,OAAO,mBAAmB,qDAoIlD,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { createStepperStore as
|
|
4
|
-
import { findNextVisibleValidStep as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as m } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { createContext as v, useRef as u, useEffect as l } from "react";
|
|
3
|
+
import { createStepperStore as h } from "../StepperStore/index.js";
|
|
4
|
+
import { findNextVisibleValidStep as x } from "../../helpers/findNextVisibleValidStep/index.js";
|
|
5
|
+
const D = v(null), E = (f) => {
|
|
6
6
|
const {
|
|
7
|
-
storeId:
|
|
8
|
-
storeDevtoolsEnabled:
|
|
9
|
-
steps:
|
|
7
|
+
storeId: d,
|
|
8
|
+
storeDevtoolsEnabled: g,
|
|
9
|
+
steps: r,
|
|
10
10
|
visibleTitle: a = !0,
|
|
11
|
-
indicatorType:
|
|
12
|
-
orientation:
|
|
13
|
-
visibilityData:
|
|
14
|
-
initialStepKey:
|
|
15
|
-
children:
|
|
16
|
-
} =
|
|
17
|
-
|
|
11
|
+
indicatorType: s = "number",
|
|
12
|
+
orientation: c = "horizontal",
|
|
13
|
+
visibilityData: e,
|
|
14
|
+
initialStepKey: b,
|
|
15
|
+
children: y
|
|
16
|
+
} = f, n = u(null), p = u(e);
|
|
17
|
+
n.current || (n.current = h(
|
|
18
18
|
{
|
|
19
|
-
storeId:
|
|
20
|
-
steps:
|
|
19
|
+
storeId: d,
|
|
20
|
+
steps: r,
|
|
21
21
|
visibleTitle: a,
|
|
22
22
|
ownerState: {},
|
|
23
|
-
indicatorType:
|
|
24
|
-
orientation:
|
|
25
|
-
visibilityData:
|
|
26
|
-
initialStepKey:
|
|
23
|
+
indicatorType: s,
|
|
24
|
+
orientation: c,
|
|
25
|
+
visibilityData: e,
|
|
26
|
+
initialStepKey: b
|
|
27
27
|
},
|
|
28
|
-
|
|
29
|
-
),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
}, [a,
|
|
47
|
-
if (
|
|
48
|
-
const i =
|
|
49
|
-
if (i.getState().actions.init(
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
28
|
+
g
|
|
29
|
+
), n.current.getState().actions.init(r));
|
|
30
|
+
const o = n.current;
|
|
31
|
+
return l(() => {
|
|
32
|
+
const i = o.getState();
|
|
33
|
+
i.visibleTitle !== a && o.setState((t) => ({
|
|
34
|
+
...t,
|
|
35
|
+
visibleTitle: a
|
|
36
|
+
})), i.orientation !== c && o.setState((t) => ({
|
|
37
|
+
...t,
|
|
38
|
+
orientation: c
|
|
39
|
+
})), i.indicatorType !== s && o.setState((t) => ({
|
|
40
|
+
...t,
|
|
41
|
+
indicatorType: s
|
|
42
|
+
})), i.visibilityData !== e && o.setState((t) => ({
|
|
43
|
+
...t,
|
|
44
|
+
visibilityData: e
|
|
45
|
+
}));
|
|
46
|
+
}, [o, a, c, s, e]), l(() => {
|
|
47
|
+
if (n.current && r) {
|
|
48
|
+
const i = n.current, t = i.getState();
|
|
49
|
+
if (i.getState().actions.init(r, !0), e && JSON.stringify(p.current) !== JSON.stringify(e)) {
|
|
50
|
+
const S = x(
|
|
51
|
+
t.currentStep,
|
|
52
|
+
r,
|
|
53
53
|
{},
|
|
54
|
-
|
|
54
|
+
e
|
|
55
55
|
);
|
|
56
|
-
|
|
56
|
+
S < r.length && S !== t.currentStep && (i.getState().actions.setCurrentStep(S), i.getState().actions.setStepValidationStatus(t.currentStep, !0));
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
}, [
|
|
59
|
+
p.current = e;
|
|
60
|
+
}, [r, e]), /* @__PURE__ */ m(D.Provider, { value: n.current, children: y });
|
|
61
61
|
};
|
|
62
62
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
D as StepperContext,
|
|
64
|
+
E as StepperProvider
|
|
65
65
|
};
|