@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.
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/Stepper/Stepper.styles.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,eAAO,MAAM,aAAa,EAAE,aAmb3B,CAAC"}
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 o } from "../../utils/getSizeStyles/getSizeStyles.js";
2
- const c = {
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: i }) => ({
10
+ stepperRoot: ({ theme: e }) => ({
8
11
  display: "flex",
9
12
  flexDirection: "column",
10
13
  justifyContent: "flex-start",
11
- background: i.vars.palette.background.default,
14
+ background: e.vars.palette.background.default,
12
15
  width: "100%",
13
16
  height: "100%",
14
- borderRadius: i.vars.size.borderRadius.r1
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: i, ownerState: e }) => ({
22
+ contentSection: ({ theme: e, ownerState: i }) => ({
20
23
  display: "flex",
21
24
  flex: 1,
22
25
  height: "100%",
23
26
  overflow: "hidden",
24
- gap: i.vars.size.baseSpacings.sp6,
25
- ...e?.orientation === "vertical" || i.generalSettings.isMobile ? {
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: i }) => ({
38
+ stepContent: ({ ownerState: e }) => ({
35
39
  height: "100%",
36
- display: i?.isStepVisible ? "flex" : "none",
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: i, ownerState: e }) => ({
43
- ...e?.orientation === "vertical" || i.generalSettings.isMobile ? {
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: i, ownerState: e }) => ({
71
+ contentArea: ({ theme: e, ownerState: i }) => ({
58
72
  flex: 1,
59
73
  display: "flex",
60
74
  flexDirection: "column",
61
75
  overflowY: "auto",
62
- ...e?.orientation === "vertical" || i.generalSettings.isMobile ? {
76
+ ...i?.orientation === "vertical" || e.generalSettings.isMobile ? {
63
77
  // borderTop: '1px solid',
64
- gap: i.vars.size.baseSpacings.sp4
78
+ gap: e.vars.size.baseSpacings.sp4
65
79
  // paddingTop: theme.vars.size.baseSpacings.sp8,
66
80
  } : {
67
- gap: i.vars.size.baseSpacings.sp6,
68
- borderLeft: "1px solid",
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: i, ownerState: e }) => {
77
- const t = e?.currentStep ?? 0, r = e?.step ?? 0, s = e?.totalSteps ?? 0, a = t > r, n = r === s - 1;
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: e?.isStepVisible ? "flex" : "none",
81
- flexDirection: e?.orientation === "vertical" || i.generalSettings.isMobile ? "column" : "row",
82
- alignItems: e?.orientation === "vertical" || i.generalSettings.isMobile ? "center" : "start",
83
- justifyContent: e?.visibleTitle ? "space-between" : "center",
84
- gap: e?.orientation === "vertical" || i.generalSettings.isMobile ? i.vars.size.baseSpacings.sp1 : i.vars.size.baseSpacings.sp4,
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
- ...(e?.orientation === "vertical" || i.generalSettings.isMobile) && {
87
- minWidth: i.vars.size.baseSpacings.sp10
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
- ...!n && (e?.orientation === "vertical" || i.generalSettings.isMobile) && {
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: e?.orientation === "horizontal" && i.generalSettings.isMobile ? "16px" : "10px",
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 ? i.vars.palette.primary.enabled : i.vars.palette.border.default}`,
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: i, ownerState: e }) => ({
109
- ...e?.orientation === "horizontal" && !i.generalSettings.isMobile && {
110
- minHeight: i.vars.size.desktop.medium.action,
111
- maxWidth: "120px",
112
- width: "100%"
113
- },
114
- ...(e?.orientation === "vertical" || i.generalSettings.isMobile) && {
115
- maxWidth: "120px",
116
- width: "100%",
117
- marginTop: i.vars.size.baseSpacings.sp1
118
- },
119
- alignContent: "center",
120
- cursor: "pointer",
121
- ...i.generalSettings.isMobile ? {
122
- display: "none"
123
- } : {
124
- display: e?.visibleTitle ? "block" : "none"
125
- },
126
- flex: 1,
127
- minWidth: 0,
128
- order: e?.orientation === "vertical" || i.generalSettings.isMobile ? 1 : 0,
129
- "&.M4LTypography-root": {
130
- color: e?.originalStepIndex !== void 0 && typeof e.originalStepIndex == "number" ? (e.currentStep ?? 0) > e.originalStepIndex ? i.vars.palette.primary.semanticText : (e.currentStep ?? 0) === e.originalStepIndex ? i.vars.palette.text.primary : i.vars.palette.text.secondary : i.vars.palette.text.secondary,
131
- textAlign: e?.orientation === "vertical" || i.generalSettings.isMobile ? "center" : "right"
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: i, ownerState: e }) => ({
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: e?.orientation === "vertical" || i.generalSettings.isMobile ? "center" : "left"
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: i, ownerState: e }) => {
154
- const t = e?.step ?? 0, r = e?.totalSteps ?? 0, s = e?.isCompleted ?? !1, a = e?.isCurrent ?? !1, n = e?.isValidStep ?? !0, p = t === r - 1;
155
- return {
156
- ...e?.orientation === "horizontal" ? {
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: e?.orientation === "vertical" || i.generalSettings.isMobile ? 0 : 1,
165
- background: !n && e?.hasBeenValidated ? i.vars.palette.error.enabled : s && n ? e?.indicatorType === "dot" || i.generalSettings.isMobile ? i.vars.palette.background.default : i.vars.palette.primary.toneOpacity : a ? e?.indicatorType === "dot" || i.generalSettings.isMobile ? i.vars.palette.background.default : i.vars.palette.primary.enabled : e?.indicatorType === "dot" || i.generalSettings.isMobile ? i.vars.palette.background.default : i.vars.palette.default.enabled,
166
- borderRadius: i.vars.size.borderRadius.r2,
167
- ...e?.indicatorType === "number" && !i.generalSettings.isMobile && {
168
- boxShadow: a ? "0 2px 8px 0 rgb(0, 100, 255, 0.16)" : "none"
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
- position: "relative",
171
- ...!p && e?.orientation === "horizontal" && !i.generalSettings.isMobile && {
172
- "&::after": {
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
- ...o(i, e?.size || "medium", "case", (l) => ({
184
- width: l,
185
- height: l
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: i, ownerState: e }) => {
193
- const t = e?.isCompleted ?? !1, r = e?.isCurrent ?? !1, s = e?.isValidStep ?? !0, a = e?.hasBeenValidated ?? !1;
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: !s && a ? i.vars.palette.error.contrastText : t || r ? i.vars.palette.primary.contrastText : i.vars.palette.text.primary
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: i }) => ({
282
+ contentAreaHeader: ({ theme: e }) => ({
204
283
  display: "flex",
205
284
  alignItems: "center",
206
- gap: i.size.baseSpacings.sp3,
285
+ gap: e.size.baseSpacings.sp3,
207
286
  position: "sticky",
208
287
  top: 0,
209
- backgroundColor: i.vars.palette.background.default,
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: i }) => ({
295
+ contentAreaBody: ({ theme: e }) => ({
217
296
  flex: 1,
218
297
  overflowY: "auto",
219
298
  display: "flex",
220
299
  flexDirection: "column",
221
- gap: i.vars.size.baseSpacings.sp6
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: i, ownerState: e }) => ({
305
+ wrapperIcon: ({ theme: e, ownerState: i }) => ({
227
306
  display: "flex",
228
307
  alignItems: "center",
229
308
  justifyContent: "center",
230
309
  flexShrink: 0,
231
- background: i.vars.palette.primary.enabledOpacity,
232
- borderRadius: i.vars.size.borderRadius["r1-5"],
233
- ...o(i, e?.size || "medium", "box", (t) => ({
234
- width: t,
235
- height: t
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: i }) => ({
242
- color: i.vars.palette.text.primary,
320
+ wrapperTitle: ({ theme: e }) => ({
321
+ color: e.vars.palette.text.primary,
243
322
  display: "flex",
244
323
  flexDirection: "column",
245
- gap: i.vars.size.baseSpacings["sp0-5"],
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: i, ownerState: e }) => ({
254
- ...o(i, e?.size || "medium", "case", (t) => ({
255
- width: t,
256
- height: t
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: i }) => ({
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: i.vars.palette.text.secondary,
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: i }) => ({
380
+ stepperFooterSection: ({ theme: e }) => ({
302
381
  display: "flex",
303
382
  alignItems: "center",
304
383
  justifyContent: "space-between",
305
384
  flexWrap: "wrap",
306
- gap: i.vars.size.baseSpacings.sp2,
307
- paddingTop: i.vars.size.baseSpacings.sp4,
385
+ gap: e.vars.size.baseSpacings.sp2,
386
+ paddingTop: e.vars.size.baseSpacings.sp4,
308
387
  position: "sticky",
309
388
  bottom: 0,
310
- backgroundColor: i.vars.palette.background.default,
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: i }) => ({
396
+ stepperFooterLeftActions: ({ theme: e }) => ({
318
397
  display: "flex",
319
398
  alignItems: "center",
320
- gap: i.vars.size.baseSpacings.sp3
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: i }) => ({
404
+ stepperFooterRightActions: ({ theme: e }) => ({
326
405
  display: "flex",
327
406
  alignItems: "center",
328
- gap: i.vars.size.baseSpacings.sp3
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: i }) => ({
412
+ wrapperButtons: ({ theme: e }) => ({
334
413
  display: "flex",
335
- gap: i.size.baseSpacings.sp3
414
+ gap: e.size.baseSpacings.sp3
336
415
  })
337
416
  };
338
417
  export {
339
- c as stepperStyles
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,qDAiIlD,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC"}
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 y } from "@emotion/react/jsx-runtime";
2
- import { createContext as m, useRef as S, useEffect as p } from "react";
3
- import { createStepperStore as v } from "../StepperStore/index.js";
4
- import { findNextVisibleValidStep as h } from "../../helpers/findNextVisibleValidStep/index.js";
5
- const x = m(null), R = (l) => {
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: f,
8
- storeDevtoolsEnabled: d,
9
- steps: n,
7
+ storeId: d,
8
+ storeDevtoolsEnabled: g,
9
+ steps: r,
10
10
  visibleTitle: a = !0,
11
- indicatorType: o = "number",
12
- orientation: s = "horizontal",
13
- visibilityData: r,
14
- initialStepKey: g,
15
- children: b
16
- } = l, t = S(null), u = S(r);
17
- return t.current || (t.current = v(
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: f,
20
- steps: n,
19
+ storeId: d,
20
+ steps: r,
21
21
  visibleTitle: a,
22
22
  ownerState: {},
23
- indicatorType: o,
24
- orientation: s,
25
- visibilityData: r,
26
- initialStepKey: g
23
+ indicatorType: s,
24
+ orientation: c,
25
+ visibilityData: e,
26
+ initialStepKey: b
27
27
  },
28
- d
29
- ), t.current.getState().actions.init(n)), p(() => {
30
- if (t.current) {
31
- const i = t.current.getState();
32
- i.visibleTitle !== a && t.current.setState((e) => ({
33
- ...e,
34
- visibleTitle: a
35
- })), i.orientation !== s && t.current.setState((e) => ({
36
- ...e,
37
- orientation: s
38
- })), i.indicatorType !== o && t.current.setState((e) => ({
39
- ...e,
40
- indicatorType: o
41
- })), i.visibilityData !== r && t.current.setState((e) => ({
42
- ...e,
43
- visibilityData: r
44
- }));
45
- }
46
- }, [a, s, o, r]), p(() => {
47
- if (t.current && n) {
48
- const i = t.current, e = i.getState();
49
- if (i.getState().actions.init(n, !0), r && JSON.stringify(u.current) !== JSON.stringify(r)) {
50
- const c = h(
51
- e.currentStep,
52
- n,
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
- r
54
+ e
55
55
  );
56
- c < n.length && c !== e.currentStep && (i.getState().actions.setCurrentStep(c), i.getState().actions.setStepValidationStatus(e.currentStep, !0));
56
+ S < r.length && S !== t.currentStep && (i.getState().actions.setCurrentStep(S), i.getState().actions.setStepValidationStatus(t.currentStep, !0));
57
57
  }
58
58
  }
59
- u.current = r;
60
- }, [n, r]), /* @__PURE__ */ y(x.Provider, { value: t.current, children: b });
59
+ p.current = e;
60
+ }, [r, e]), /* @__PURE__ */ m(D.Provider, { value: n.current, children: y });
61
61
  };
62
62
  export {
63
- x as StepperContext,
64
- R as StepperProvider
63
+ D as StepperContext,
64
+ E as StepperProvider
65
65
  };