@rubenpazch/stepper 4.0.0 → 4.1.1
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/README.md +27 -0
- package/dist/Stepper.d.ts +3 -1
- package/dist/Stepper.d.ts.map +1 -1
- package/dist/index.cjs.js +6 -4
- package/dist/index.d.ts +3 -1
- package/dist/index.esm.js +6 -4
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
1
|
# Stepper
|
|
2
2
|
|
|
3
3
|
Generated component package.
|
|
4
|
+
|
|
5
|
+
<!-- catalogo:inicio (generado por pnpm catalogo, no editar) -->
|
|
6
|
+
|
|
7
|
+
Indicador de pasos numerados (opcionalmente clicables) para procesos en etapas.
|
|
8
|
+
|
|
9
|
+
- **Usar cuando:** Asistentes y formularios de varios pasos.
|
|
10
|
+
- **Evitar cuando:** Navegación entre secciones independientes: usa Tabs.
|
|
11
|
+
|
|
12
|
+
Se recomienda instalar el paquete completo `@rubenpazch/ui` (incluye este). Por separado:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @rubenpazch/stepper
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Stepper
|
|
19
|
+
|
|
20
|
+
| Prop | Tipo | Req. | Por defecto | Descripción |
|
|
21
|
+
| --------------- | -------------------------------------------------------- | ---- | ----------- | -------------------------------------------------------------------- |
|
|
22
|
+
| `currentStep` | `number` | sí | | |
|
|
23
|
+
| `steps` | `Step[]` | sí | | |
|
|
24
|
+
| `ariaLabel` | `string` | | `Progreso` | Nombre accesible de la navegación de pasos (por defecto "Progreso"). |
|
|
25
|
+
| `className` | `string` | | `` | |
|
|
26
|
+
| `onStepChange` | `(step: number) => void` | | | |
|
|
27
|
+
| `size` | `"small" \| "medium" \| "large" \| "sm" \| "md" \| "lg"` | | `medium` | |
|
|
28
|
+
| `stepClickable` | `boolean` | | `false` | |
|
|
29
|
+
|
|
30
|
+
<!-- catalogo:fin -->
|
package/dist/Stepper.d.ts
CHANGED
|
@@ -5,12 +5,14 @@ export interface Step {
|
|
|
5
5
|
link?: string;
|
|
6
6
|
onClick?: () => void;
|
|
7
7
|
}
|
|
8
|
-
type StepperSize = "small" | "medium" | "large";
|
|
8
|
+
export type StepperSize = "small" | "medium" | "large" | "sm" | "md" | "lg";
|
|
9
9
|
interface Stepper {
|
|
10
10
|
steps: Step[];
|
|
11
11
|
currentStep: number;
|
|
12
12
|
className?: string;
|
|
13
13
|
stepClickable?: boolean;
|
|
14
|
+
/** Nombre accesible de la navegación de pasos (por defecto "Progreso"). */
|
|
15
|
+
ariaLabel?: string;
|
|
14
16
|
onStepChange?: (step: number) => void;
|
|
15
17
|
size?: StepperSize;
|
|
16
18
|
}
|
package/dist/Stepper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../src/Stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../src/Stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC5E,UAAU,OAAO;IACf,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAuBD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,OAAO,CAyGpC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var require$$0 = require('react');
|
|
4
|
+
var shared = require('@rubenpazch/shared');
|
|
4
5
|
|
|
5
6
|
var jsxRuntime = {exports: {}};
|
|
6
7
|
|
|
@@ -451,7 +452,7 @@ function styleInject(css, ref) {
|
|
|
451
452
|
}
|
|
452
453
|
}
|
|
453
454
|
|
|
454
|
-
var css_248z = "/* Container */\n.Stepper-module_container__DJqqd {\n margin-bottom: 2rem;\n}\n\n/* Step container */\n.Stepper-module_stepsContainer__BSRre {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.Stepper-module_stepWrapper__tLZrN {\n display: flex;\n align-items: center;\n flex: 1;\n}\n\n.Stepper-module_stepContent__U41GC {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n/* Circle */\n.Stepper-module_circle__NG20I {\n border-radius: 9999px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 600;\n transition: all 150ms ease;\n}\n\n/* Circle sizes */\n.Stepper-module_circleSmall__OvjYU {\n width: 1.5rem;\n height: 1.5rem;\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.Stepper-module_circleMedium__4USpR {\n width: 2.5rem;\n height: 2.5rem;\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.Stepper-module_circleLarge__YJTfR {\n width: 4rem;\n height: 4rem;\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n\n/* Circle states */\n.Stepper-module_circleActive__b9Mg5 {\n background: var(--lb-color-primary);\n color: var(--lb-color-primary-foreground);\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);\n transform: scale(1.1);\n}\n\n.Stepper-module_circleActiveSmall__y038c {\n box-shadow: 0 0 0 2px var(--lb-color-
|
|
455
|
+
var css_248z = "/* Container */\n.Stepper-module_container__DJqqd {\n margin-bottom: 2rem;\n}\n\n/* Step container */\n.Stepper-module_stepsContainer__BSRre {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.Stepper-module_stepWrapper__tLZrN {\n display: flex;\n align-items: center;\n flex: 1;\n}\n\n.Stepper-module_stepContent__U41GC {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n/* Circle */\n.Stepper-module_circle__NG20I {\n border-radius: 9999px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 600;\n transition: all 150ms ease;\n}\n\n/* Circle sizes */\n.Stepper-module_circleSmall__OvjYU {\n width: 1.5rem;\n height: 1.5rem;\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.Stepper-module_circleMedium__4USpR {\n width: 2.5rem;\n height: 2.5rem;\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.Stepper-module_circleLarge__YJTfR {\n width: 4rem;\n height: 4rem;\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n\n/* Circle states */\n.Stepper-module_circleActive__b9Mg5 {\n background: var(--lb-color-primary);\n color: var(--lb-color-primary-foreground);\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);\n transform: scale(1.1);\n}\n\n.Stepper-module_circleActiveSmall__y038c {\n box-shadow: 0 0 0 2px var(--lb-color-primary-border);\n}\n\n.Stepper-module_circleActiveMedium__f5x7y {\n box-shadow: 0 0 0 4px var(--lb-color-primary-border);\n}\n\n.Stepper-module_circleActiveLarge__k5w2P {\n box-shadow: 0 0 0 8px var(--lb-color-primary-border);\n}\n\n.Stepper-module_circleCompleted__3PZzz {\n background: var(--lb-color-primary-subtle);\n color: var(--lb-color-primary);\n}\n\n.Stepper-module_circleFuture__5QSu9 {\n background: var(--lb-color-neutral-300);\n color: var(--lb-color-neutral-600);\n}\n\n/* Title */\n.Stepper-module_title__-ugD2 {\n margin-top: 0.5rem;\n font-weight: 500;\n transition: all 150ms ease;\n}\n\n/* Title sizes */\n.Stepper-module_titleSmall__UaJEH {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.Stepper-module_titleMedium__9l6Ig {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n.Stepper-module_titleLarge__CK7gk {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n\n/* Title states */\n.Stepper-module_titleActive__DUnmr {\n color: var(--lb-color-primary-hover);\n font-weight: 700;\n}\n\n.Stepper-module_titleClickable__b3i-v {\n color: var(--lb-color-primary);\n text-decoration: underline;\n cursor: pointer;\n}\n\n.Stepper-module_titleClickable__b3i-v:hover {\n color: var(--lb-color-primary-strong);\n}\n\n.Stepper-module_titleCompleted__VdB7c {\n color: var(--lb-color-primary);\n}\n\n.Stepper-module_titleFuture__cSPZD {\n color: var(--lb-color-neutral-500);\n}\n\n/* Link and button styles */\n.Stepper-module_link__3WBTp {\n text-decoration: none;\n}\n\n.Stepper-module_link__3WBTp:hover {\n text-decoration: underline;\n}\n\n.Stepper-module_link__3WBTp:focus {\n outline: none;\n}\n\n.Stepper-module_button__2p5jI {\n background: transparent;\n border: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n}\n\n.Stepper-module_button__2p5jI:focus {\n outline: none;\n}\n\n/* Connector line */\n.Stepper-module_connector__7JYHQ {\n height: 0.25rem;\n flex: 1;\n margin-left: 1rem;\n margin-right: 1rem;\n margin-top: -1.25rem;\n}\n\n.Stepper-module_connectorCompleted__ZrGL7 {\n background: var(--lb-color-primary);\n}\n\n.Stepper-module_connectorIncomplete__6Gg1g {\n background: var(--lb-color-neutral-300);\n}\n";
|
|
455
456
|
var styles = {"container":"Stepper-module_container__DJqqd","stepsContainer":"Stepper-module_stepsContainer__BSRre","stepWrapper":"Stepper-module_stepWrapper__tLZrN","stepContent":"Stepper-module_stepContent__U41GC","circle":"Stepper-module_circle__NG20I","circleSmall":"Stepper-module_circleSmall__OvjYU","circleMedium":"Stepper-module_circleMedium__4USpR","circleLarge":"Stepper-module_circleLarge__YJTfR","circleActive":"Stepper-module_circleActive__b9Mg5","circleActiveSmall":"Stepper-module_circleActiveSmall__y038c","circleActiveMedium":"Stepper-module_circleActiveMedium__f5x7y","circleActiveLarge":"Stepper-module_circleActiveLarge__k5w2P","circleCompleted":"Stepper-module_circleCompleted__3PZzz","circleFuture":"Stepper-module_circleFuture__5QSu9","title":"Stepper-module_title__-ugD2","titleSmall":"Stepper-module_titleSmall__UaJEH","titleMedium":"Stepper-module_titleMedium__9l6Ig","titleLarge":"Stepper-module_titleLarge__CK7gk","titleActive":"Stepper-module_titleActive__DUnmr","titleClickable":"Stepper-module_titleClickable__b3i-v","titleCompleted":"Stepper-module_titleCompleted__VdB7c","titleFuture":"Stepper-module_titleFuture__cSPZD","link":"Stepper-module_link__3WBTp","button":"Stepper-module_button__2p5jI","connector":"Stepper-module_connector__7JYHQ","connectorCompleted":"Stepper-module_connectorCompleted__ZrGL7","connectorIncomplete":"Stepper-module_connectorIncomplete__6Gg1g"};
|
|
456
457
|
styleInject(css_248z);
|
|
457
458
|
|
|
@@ -473,7 +474,8 @@ const sizeMap = {
|
|
|
473
474
|
ring: styles.circleActiveLarge,
|
|
474
475
|
},
|
|
475
476
|
};
|
|
476
|
-
const ProgressSteps = ({ steps, currentStep, className = "", stepClickable = false, onStepChange, size = "medium", }) => {
|
|
477
|
+
const ProgressSteps = ({ steps, currentStep, className = "", stepClickable = false, onStepChange, ariaLabel = "Progreso", size: sizeProp = "medium", }) => {
|
|
478
|
+
const size = shared.toLegacySize(sizeProp);
|
|
477
479
|
const sizeStyles = sizeMap[size] || sizeMap.medium;
|
|
478
480
|
const handleStepClick = (step) => {
|
|
479
481
|
if (step.onClick)
|
|
@@ -481,7 +483,7 @@ const ProgressSteps = ({ steps, currentStep, className = "", stepClickable = fal
|
|
|
481
483
|
if (onStepChange)
|
|
482
484
|
onStepChange(step.number);
|
|
483
485
|
};
|
|
484
|
-
return (jsxRuntimeExports.jsx("
|
|
486
|
+
return (jsxRuntimeExports.jsx("nav", { "aria-label": ariaLabel, className: classNames(styles.container, className), "data-testid": "progress-steps", children: jsxRuntimeExports.jsx("div", { className: styles.stepsContainer, role: "list", children: steps.map((step, index) => {
|
|
485
487
|
const isClickable = stepClickable && (step.link || step.onClick || onStepChange);
|
|
486
488
|
const isActive = step.number === currentStep;
|
|
487
489
|
const isFuture = step.number > currentStep;
|
|
@@ -490,7 +492,7 @@ const ProgressSteps = ({ steps, currentStep, className = "", stepClickable = fal
|
|
|
490
492
|
!isClickableStep &&
|
|
491
493
|
!isFuture &&
|
|
492
494
|
styles.titleCompleted, isFuture && styles.titleFuture), "data-testid": `step-title-${step.number}`, children: step.title })] }));
|
|
493
|
-
return (jsxRuntimeExports.jsxs("div", { className: styles.stepWrapper, children: [isClickable ? (step.link ? (jsxRuntimeExports.jsx("a", { href: step.link, className: styles.link, tabIndex: 0, children: stepContent })) : (jsxRuntimeExports.jsx("button", { type: "button", onClick: () => handleStepClick(step), className: styles.button, children: stepContent }))) : (stepContent), index < steps.length - 1 && (jsxRuntimeExports.jsx("div", { className: classNames(styles.connector, step.number < currentStep
|
|
495
|
+
return (jsxRuntimeExports.jsxs("div", { className: styles.stepWrapper, role: "listitem", "aria-current": isActive ? "step" : undefined, children: [isClickable ? (step.link ? (jsxRuntimeExports.jsx("a", { href: step.link, className: styles.link, tabIndex: 0, children: stepContent })) : (jsxRuntimeExports.jsx("button", { type: "button", onClick: () => handleStepClick(step), className: styles.button, children: stepContent }))) : (stepContent), index < steps.length - 1 && (jsxRuntimeExports.jsx("div", { className: classNames(styles.connector, step.number < currentStep
|
|
494
496
|
? styles.connectorCompleted
|
|
495
497
|
: styles.connectorIncomplete), "data-testid": `connector-${step.number}` }))] }, step.number));
|
|
496
498
|
}) }) }));
|
package/dist/index.d.ts
CHANGED
|
@@ -6,12 +6,14 @@ interface Step {
|
|
|
6
6
|
link?: string;
|
|
7
7
|
onClick?: () => void;
|
|
8
8
|
}
|
|
9
|
-
type StepperSize = "small" | "medium" | "large";
|
|
9
|
+
type StepperSize = "small" | "medium" | "large" | "sm" | "md" | "lg";
|
|
10
10
|
interface Stepper {
|
|
11
11
|
steps: Step[];
|
|
12
12
|
currentStep: number;
|
|
13
13
|
className?: string;
|
|
14
14
|
stepClickable?: boolean;
|
|
15
|
+
/** Nombre accesible de la navegación de pasos (por defecto "Progreso"). */
|
|
16
|
+
ariaLabel?: string;
|
|
15
17
|
onStepChange?: (step: number) => void;
|
|
16
18
|
size?: StepperSize;
|
|
17
19
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import require$$0 from 'react';
|
|
2
|
+
import { toLegacySize } from '@rubenpazch/shared';
|
|
2
3
|
|
|
3
4
|
var jsxRuntime = {exports: {}};
|
|
4
5
|
|
|
@@ -449,7 +450,7 @@ function styleInject(css, ref) {
|
|
|
449
450
|
}
|
|
450
451
|
}
|
|
451
452
|
|
|
452
|
-
var css_248z = "/* Container */\n.Stepper-module_container__DJqqd {\n margin-bottom: 2rem;\n}\n\n/* Step container */\n.Stepper-module_stepsContainer__BSRre {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.Stepper-module_stepWrapper__tLZrN {\n display: flex;\n align-items: center;\n flex: 1;\n}\n\n.Stepper-module_stepContent__U41GC {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n/* Circle */\n.Stepper-module_circle__NG20I {\n border-radius: 9999px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 600;\n transition: all 150ms ease;\n}\n\n/* Circle sizes */\n.Stepper-module_circleSmall__OvjYU {\n width: 1.5rem;\n height: 1.5rem;\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.Stepper-module_circleMedium__4USpR {\n width: 2.5rem;\n height: 2.5rem;\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.Stepper-module_circleLarge__YJTfR {\n width: 4rem;\n height: 4rem;\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n\n/* Circle states */\n.Stepper-module_circleActive__b9Mg5 {\n background: var(--lb-color-primary);\n color: var(--lb-color-primary-foreground);\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);\n transform: scale(1.1);\n}\n\n.Stepper-module_circleActiveSmall__y038c {\n box-shadow: 0 0 0 2px var(--lb-color-
|
|
453
|
+
var css_248z = "/* Container */\n.Stepper-module_container__DJqqd {\n margin-bottom: 2rem;\n}\n\n/* Step container */\n.Stepper-module_stepsContainer__BSRre {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.Stepper-module_stepWrapper__tLZrN {\n display: flex;\n align-items: center;\n flex: 1;\n}\n\n.Stepper-module_stepContent__U41GC {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n/* Circle */\n.Stepper-module_circle__NG20I {\n border-radius: 9999px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 600;\n transition: all 150ms ease;\n}\n\n/* Circle sizes */\n.Stepper-module_circleSmall__OvjYU {\n width: 1.5rem;\n height: 1.5rem;\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.Stepper-module_circleMedium__4USpR {\n width: 2.5rem;\n height: 2.5rem;\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.Stepper-module_circleLarge__YJTfR {\n width: 4rem;\n height: 4rem;\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n\n/* Circle states */\n.Stepper-module_circleActive__b9Mg5 {\n background: var(--lb-color-primary);\n color: var(--lb-color-primary-foreground);\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);\n transform: scale(1.1);\n}\n\n.Stepper-module_circleActiveSmall__y038c {\n box-shadow: 0 0 0 2px var(--lb-color-primary-border);\n}\n\n.Stepper-module_circleActiveMedium__f5x7y {\n box-shadow: 0 0 0 4px var(--lb-color-primary-border);\n}\n\n.Stepper-module_circleActiveLarge__k5w2P {\n box-shadow: 0 0 0 8px var(--lb-color-primary-border);\n}\n\n.Stepper-module_circleCompleted__3PZzz {\n background: var(--lb-color-primary-subtle);\n color: var(--lb-color-primary);\n}\n\n.Stepper-module_circleFuture__5QSu9 {\n background: var(--lb-color-neutral-300);\n color: var(--lb-color-neutral-600);\n}\n\n/* Title */\n.Stepper-module_title__-ugD2 {\n margin-top: 0.5rem;\n font-weight: 500;\n transition: all 150ms ease;\n}\n\n/* Title sizes */\n.Stepper-module_titleSmall__UaJEH {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.Stepper-module_titleMedium__9l6Ig {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n.Stepper-module_titleLarge__CK7gk {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n\n/* Title states */\n.Stepper-module_titleActive__DUnmr {\n color: var(--lb-color-primary-hover);\n font-weight: 700;\n}\n\n.Stepper-module_titleClickable__b3i-v {\n color: var(--lb-color-primary);\n text-decoration: underline;\n cursor: pointer;\n}\n\n.Stepper-module_titleClickable__b3i-v:hover {\n color: var(--lb-color-primary-strong);\n}\n\n.Stepper-module_titleCompleted__VdB7c {\n color: var(--lb-color-primary);\n}\n\n.Stepper-module_titleFuture__cSPZD {\n color: var(--lb-color-neutral-500);\n}\n\n/* Link and button styles */\n.Stepper-module_link__3WBTp {\n text-decoration: none;\n}\n\n.Stepper-module_link__3WBTp:hover {\n text-decoration: underline;\n}\n\n.Stepper-module_link__3WBTp:focus {\n outline: none;\n}\n\n.Stepper-module_button__2p5jI {\n background: transparent;\n border: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n}\n\n.Stepper-module_button__2p5jI:focus {\n outline: none;\n}\n\n/* Connector line */\n.Stepper-module_connector__7JYHQ {\n height: 0.25rem;\n flex: 1;\n margin-left: 1rem;\n margin-right: 1rem;\n margin-top: -1.25rem;\n}\n\n.Stepper-module_connectorCompleted__ZrGL7 {\n background: var(--lb-color-primary);\n}\n\n.Stepper-module_connectorIncomplete__6Gg1g {\n background: var(--lb-color-neutral-300);\n}\n";
|
|
453
454
|
var styles = {"container":"Stepper-module_container__DJqqd","stepsContainer":"Stepper-module_stepsContainer__BSRre","stepWrapper":"Stepper-module_stepWrapper__tLZrN","stepContent":"Stepper-module_stepContent__U41GC","circle":"Stepper-module_circle__NG20I","circleSmall":"Stepper-module_circleSmall__OvjYU","circleMedium":"Stepper-module_circleMedium__4USpR","circleLarge":"Stepper-module_circleLarge__YJTfR","circleActive":"Stepper-module_circleActive__b9Mg5","circleActiveSmall":"Stepper-module_circleActiveSmall__y038c","circleActiveMedium":"Stepper-module_circleActiveMedium__f5x7y","circleActiveLarge":"Stepper-module_circleActiveLarge__k5w2P","circleCompleted":"Stepper-module_circleCompleted__3PZzz","circleFuture":"Stepper-module_circleFuture__5QSu9","title":"Stepper-module_title__-ugD2","titleSmall":"Stepper-module_titleSmall__UaJEH","titleMedium":"Stepper-module_titleMedium__9l6Ig","titleLarge":"Stepper-module_titleLarge__CK7gk","titleActive":"Stepper-module_titleActive__DUnmr","titleClickable":"Stepper-module_titleClickable__b3i-v","titleCompleted":"Stepper-module_titleCompleted__VdB7c","titleFuture":"Stepper-module_titleFuture__cSPZD","link":"Stepper-module_link__3WBTp","button":"Stepper-module_button__2p5jI","connector":"Stepper-module_connector__7JYHQ","connectorCompleted":"Stepper-module_connectorCompleted__ZrGL7","connectorIncomplete":"Stepper-module_connectorIncomplete__6Gg1g"};
|
|
454
455
|
styleInject(css_248z);
|
|
455
456
|
|
|
@@ -471,7 +472,8 @@ const sizeMap = {
|
|
|
471
472
|
ring: styles.circleActiveLarge,
|
|
472
473
|
},
|
|
473
474
|
};
|
|
474
|
-
const ProgressSteps = ({ steps, currentStep, className = "", stepClickable = false, onStepChange, size = "medium", }) => {
|
|
475
|
+
const ProgressSteps = ({ steps, currentStep, className = "", stepClickable = false, onStepChange, ariaLabel = "Progreso", size: sizeProp = "medium", }) => {
|
|
476
|
+
const size = toLegacySize(sizeProp);
|
|
475
477
|
const sizeStyles = sizeMap[size] || sizeMap.medium;
|
|
476
478
|
const handleStepClick = (step) => {
|
|
477
479
|
if (step.onClick)
|
|
@@ -479,7 +481,7 @@ const ProgressSteps = ({ steps, currentStep, className = "", stepClickable = fal
|
|
|
479
481
|
if (onStepChange)
|
|
480
482
|
onStepChange(step.number);
|
|
481
483
|
};
|
|
482
|
-
return (jsxRuntimeExports.jsx("
|
|
484
|
+
return (jsxRuntimeExports.jsx("nav", { "aria-label": ariaLabel, className: classNames(styles.container, className), "data-testid": "progress-steps", children: jsxRuntimeExports.jsx("div", { className: styles.stepsContainer, role: "list", children: steps.map((step, index) => {
|
|
483
485
|
const isClickable = stepClickable && (step.link || step.onClick || onStepChange);
|
|
484
486
|
const isActive = step.number === currentStep;
|
|
485
487
|
const isFuture = step.number > currentStep;
|
|
@@ -488,7 +490,7 @@ const ProgressSteps = ({ steps, currentStep, className = "", stepClickable = fal
|
|
|
488
490
|
!isClickableStep &&
|
|
489
491
|
!isFuture &&
|
|
490
492
|
styles.titleCompleted, isFuture && styles.titleFuture), "data-testid": `step-title-${step.number}`, children: step.title })] }));
|
|
491
|
-
return (jsxRuntimeExports.jsxs("div", { className: styles.stepWrapper, children: [isClickable ? (step.link ? (jsxRuntimeExports.jsx("a", { href: step.link, className: styles.link, tabIndex: 0, children: stepContent })) : (jsxRuntimeExports.jsx("button", { type: "button", onClick: () => handleStepClick(step), className: styles.button, children: stepContent }))) : (stepContent), index < steps.length - 1 && (jsxRuntimeExports.jsx("div", { className: classNames(styles.connector, step.number < currentStep
|
|
493
|
+
return (jsxRuntimeExports.jsxs("div", { className: styles.stepWrapper, role: "listitem", "aria-current": isActive ? "step" : undefined, children: [isClickable ? (step.link ? (jsxRuntimeExports.jsx("a", { href: step.link, className: styles.link, tabIndex: 0, children: stepContent })) : (jsxRuntimeExports.jsx("button", { type: "button", onClick: () => handleStepClick(step), className: styles.button, children: stepContent }))) : (stepContent), index < steps.length - 1 && (jsxRuntimeExports.jsx("div", { className: classNames(styles.connector, step.number < currentStep
|
|
492
494
|
? styles.connectorCompleted
|
|
493
495
|
: styles.connectorIncomplete), "data-testid": `connector-${step.number}` }))] }, step.number));
|
|
494
496
|
}) }) }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rubenpazch/stepper",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Stepper component",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": "^19.0.0",
|
|
31
31
|
"react-dom": "^19.0.0",
|
|
32
|
-
"@rubenpazch/tokens": "0.
|
|
32
|
+
"@rubenpazch/tokens": "0.5.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@rubenpazch/typescript-config": "3.0.0"
|
|
@@ -37,6 +37,15 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
+
"lbyte": {
|
|
41
|
+
"categoria": "navegacion",
|
|
42
|
+
"resumen": "Indicador de pasos numerados (opcionalmente clicables) para procesos en etapas.",
|
|
43
|
+
"usarCuando": "Asistentes y formularios de varios pasos.",
|
|
44
|
+
"evitarCuando": "Navegación entre secciones independientes: usa Tabs."
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@rubenpazch/shared": "5.2.0"
|
|
48
|
+
},
|
|
40
49
|
"scripts": {
|
|
41
50
|
"build": "rollup -c",
|
|
42
51
|
"test": "jest --passWithNoTests"
|