@nimbus-ds/stepper 1.0.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/.turbo/turbo-build.log +24 -0
- package/CHANGELOG.md +3 -0
- package/README.md +125 -0
- package/dist/CHANGELOG.md +3 -0
- package/dist/README.md +125 -0
- package/dist/index.d.ts +850 -0
- package/dist/index.js +1 -0
- package/package.json +48 -0
- package/src/Stepper.tsx +114 -0
- package/src/components/StepperCard/StepperCard.tsx +15 -0
- package/src/components/StepperCard/index.ts +2 -0
- package/src/components/StepperCard/stepperCard.spec.tsx +47 -0
- package/src/components/StepperCard/stepperCard.stories.tsx +39 -0
- package/src/components/StepperCard/stepperCard.types.ts +11 -0
- package/src/components/StepperContext/StepperContext.tsx +9 -0
- package/src/components/StepperContext/index.ts +2 -0
- package/src/components/StepperContext/stepperContext.spec.tsx +54 -0
- package/src/components/StepperContext/stepperContext.types.ts +21 -0
- package/src/components/StepperItem/StepperItem.definitions.ts +11 -0
- package/src/components/StepperItem/StepperItem.tsx +111 -0
- package/src/components/StepperItem/index.ts +2 -0
- package/src/components/StepperItem/stepperItem.spec.tsx +572 -0
- package/src/components/StepperItem/stepperItem.stories.tsx +60 -0
- package/src/components/StepperItem/stepperItem.types.ts +21 -0
- package/src/components/index.ts +6 -0
- package/src/index.ts +12 -0
- package/src/stepper.definitions.ts +11 -0
- package/src/stepper.docs.json +68 -0
- package/src/stepper.spec.tsx +344 -0
- package/src/stepper.stories.tsx +145 -0
- package/src/stepper.types.ts +48 -0
- package/tsconfig.json +4 -0
- package/webpack.config.ts +11 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Executing post-build scripts
|
|
2
|
+
Moving CHANGELOG.md & README.md to /home/runner/work/nimbus-design-system/nimbus-design-system/packages/react/src/composite/Stepper/dist
|
|
3
|
+
asset [1m[32m./index.js[39m[22m 18.8 KiB [1m[32m[emitted][39m[22m [1m[32m[minimized][39m[22m (name: ./index)
|
|
4
|
+
runtime modules 670 bytes 3 modules
|
|
5
|
+
cacheable modules 30.8 KiB
|
|
6
|
+
modules by path [1m./src/[39m[22m 10.7 KiB 11 modules
|
|
7
|
+
modules by path [1m../[39m[22m 20.1 KiB
|
|
8
|
+
modules by path [1m../Card/src/components/[39m[22m 3.04 KiB 7 modules
|
|
9
|
+
+ 3 modules
|
|
10
|
+
modules by path [1mexternal "@nimbus-ds/[39m[22m 252 bytes
|
|
11
|
+
[1mexternal "@nimbus-ds/box"[39m[22m 42 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
12
|
+
[1mexternal "@nimbus-ds/icon"[39m[22m 42 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
13
|
+
[1mexternal "@nimbus-ds/text"[39m[22m 42 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
14
|
+
[1mexternal "@nimbus-ds/icons"[39m[22m 42 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
15
|
+
[1mexternal "@nimbus-ds/styles"[39m[22m 42 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
16
|
+
[1mexternal "@nimbus-ds/title"[39m[22m 42 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
17
|
+
[1mexternal "react"[39m[22m 42 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
18
|
+
webpack 5.90.3 compiled [1m[32msuccessfully[39m[22m in 9695 ms
|
|
19
|
+
Compiling input files...
|
|
20
|
+
Processing ./src/index.ts
|
|
21
|
+
Writing ./src/index.ts -> ./dist/index.d.ts
|
|
22
|
+
Checking generated files...
|
|
23
|
+
[1;33mCompiler option "skipLibCheck" is disabled to properly check generated output[0m
|
|
24
|
+
Done in 13.14s
|
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# `@nimbus-ds/stepper`
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@nimbus-ds/stepper)
|
|
4
|
+
|
|
5
|
+
The Stepper component guides users through multi-step processes, showing their progress and allowing navigation between completed steps.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
$ yarn add @nimbus-ds/stepper
|
|
11
|
+
# or
|
|
12
|
+
$ npm install @nimbus-ds/stepper
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Component Anatomy
|
|
16
|
+
|
|
17
|
+
The component consists of circular step indicators connected by lines, with optional labels. Each step can be in one of three states: completed, active, or upcoming.
|
|
18
|
+
|
|
19
|
+
## Guidelines
|
|
20
|
+
|
|
21
|
+
We use the Stepper component to break down complex processes into manageable steps, providing clear visual feedback about progress and allowing users to understand where they are in the workflow.
|
|
22
|
+
|
|
23
|
+
### Structure
|
|
24
|
+
|
|
25
|
+
The Stepper component consists of:
|
|
26
|
+
|
|
27
|
+
- **Stepper** - The main container that manages step state and navigation
|
|
28
|
+
- **Stepper.Item** - Individual step indicators with optional labels
|
|
29
|
+
- **Stepper.Card** - Optional wrapper that provides a card-style container
|
|
30
|
+
|
|
31
|
+
### Step States
|
|
32
|
+
|
|
33
|
+
Each step has a visual state that communicates its status:
|
|
34
|
+
|
|
35
|
+
- **Completed** - Steps that have been finished (checkmark icon)
|
|
36
|
+
- **Active** - The current step being worked on (highlighted)
|
|
37
|
+
- **Upcoming** - Steps that haven't been reached yet (numbered)
|
|
38
|
+
|
|
39
|
+
### Control Modes
|
|
40
|
+
|
|
41
|
+
The component supports both controlled and uncontrolled modes:
|
|
42
|
+
|
|
43
|
+
- **Controlled** - You manage the selected step state externally via `selectedStep` and `onSelectStep` props
|
|
44
|
+
- **Uncontrolled** - The component manages its own selected step state internally
|
|
45
|
+
|
|
46
|
+
### Navigation
|
|
47
|
+
|
|
48
|
+
Users can click on completed steps to navigate back, but cannot jump ahead to future steps. This maintains the integrity of the step-by-step process.
|
|
49
|
+
|
|
50
|
+
### Mobile Considerations
|
|
51
|
+
|
|
52
|
+
On mobile devices, labels can be hidden to save space, showing only the step indicators with numbers or icons.
|
|
53
|
+
|
|
54
|
+
### Usage Recommendations
|
|
55
|
+
|
|
56
|
+
- Guide users through multi-step forms or wizards
|
|
57
|
+
- Show progress in onboarding flows
|
|
58
|
+
- Break down complex processes into digestible steps
|
|
59
|
+
- Indicate current position in checkout or setup flows
|
|
60
|
+
|
|
61
|
+
### Content Guidelines
|
|
62
|
+
|
|
63
|
+
- Keep step labels short and descriptive (1-2 words)
|
|
64
|
+
- Use clear, action-oriented language
|
|
65
|
+
- Maintain consistent terminology throughout the process
|
|
66
|
+
- Ensure labels accurately reflect the step content
|
|
67
|
+
|
|
68
|
+
## Usage
|
|
69
|
+
|
|
70
|
+
```jsx
|
|
71
|
+
// Basic uncontrolled usage
|
|
72
|
+
<Stepper activeStep={2}>
|
|
73
|
+
<Stepper.Item label="Setup" />
|
|
74
|
+
<Stepper.Item label="Configuration" />
|
|
75
|
+
<Stepper.Item label="Review" />
|
|
76
|
+
<Stepper.Item label="Deploy" />
|
|
77
|
+
</Stepper>
|
|
78
|
+
|
|
79
|
+
// Controlled usage with navigation
|
|
80
|
+
<Stepper
|
|
81
|
+
activeStep={activeStep}
|
|
82
|
+
selectedStep={selectedStep}
|
|
83
|
+
onSelectStep={setSelectedStep}
|
|
84
|
+
>
|
|
85
|
+
<Stepper.Item label="Select audience" />
|
|
86
|
+
<Stepper.Item label="Create content" />
|
|
87
|
+
<Stepper.Item label="Define budget" />
|
|
88
|
+
<Stepper.Item label="Review" />
|
|
89
|
+
<Stepper.Item label="Publish" />
|
|
90
|
+
</Stepper>
|
|
91
|
+
|
|
92
|
+
// With card wrapper
|
|
93
|
+
<Stepper.Card>
|
|
94
|
+
<Stepper activeStep={1}>
|
|
95
|
+
<Stepper.Item label="Start" />
|
|
96
|
+
<Stepper.Item label="Process" />
|
|
97
|
+
<Stepper.Item label="Finish" />
|
|
98
|
+
</Stepper>
|
|
99
|
+
</Stepper.Card>
|
|
100
|
+
|
|
101
|
+
// Mobile-friendly (without labels)
|
|
102
|
+
<Stepper activeStep={0}>
|
|
103
|
+
<Stepper.Item />
|
|
104
|
+
<Stepper.Item />
|
|
105
|
+
<Stepper.Item />
|
|
106
|
+
</Stepper>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Props
|
|
110
|
+
|
|
111
|
+
#### Stepper
|
|
112
|
+
|
|
113
|
+
- `activeStep` (number): The currently active step (0-based index)
|
|
114
|
+
- `selectedStep` (number, optional): The currently selected step for controlled mode
|
|
115
|
+
- `onSelectStep` (function, optional): Callback for step selection in controlled mode
|
|
116
|
+
- `children` (ReactNode): StepperItem components
|
|
117
|
+
|
|
118
|
+
#### Stepper.Item
|
|
119
|
+
|
|
120
|
+
- `label` (string, optional): Text label for the step
|
|
121
|
+
- `step` (number): Step number (automatically assigned by parent)
|
|
122
|
+
|
|
123
|
+
View docs [here](https://nimbus.nuvemshop.com.br/documentation/composite-components/stepper).
|
|
124
|
+
|
|
125
|
+
<img alt="Nimbus" style="margin-bottom: 30px;" src="https://tiendanube.github.io/design-system-nimbus/static/media/nimbus-logo.ab60bd79.png" height="30" />
|
package/dist/README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# `@nimbus-ds/stepper`
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@nimbus-ds/stepper)
|
|
4
|
+
|
|
5
|
+
The Stepper component guides users through multi-step processes, showing their progress and allowing navigation between completed steps.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
$ yarn add @nimbus-ds/stepper
|
|
11
|
+
# or
|
|
12
|
+
$ npm install @nimbus-ds/stepper
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Component Anatomy
|
|
16
|
+
|
|
17
|
+
The component consists of circular step indicators connected by lines, with optional labels. Each step can be in one of three states: completed, active, or upcoming.
|
|
18
|
+
|
|
19
|
+
## Guidelines
|
|
20
|
+
|
|
21
|
+
We use the Stepper component to break down complex processes into manageable steps, providing clear visual feedback about progress and allowing users to understand where they are in the workflow.
|
|
22
|
+
|
|
23
|
+
### Structure
|
|
24
|
+
|
|
25
|
+
The Stepper component consists of:
|
|
26
|
+
|
|
27
|
+
- **Stepper** - The main container that manages step state and navigation
|
|
28
|
+
- **Stepper.Item** - Individual step indicators with optional labels
|
|
29
|
+
- **Stepper.Card** - Optional wrapper that provides a card-style container
|
|
30
|
+
|
|
31
|
+
### Step States
|
|
32
|
+
|
|
33
|
+
Each step has a visual state that communicates its status:
|
|
34
|
+
|
|
35
|
+
- **Completed** - Steps that have been finished (checkmark icon)
|
|
36
|
+
- **Active** - The current step being worked on (highlighted)
|
|
37
|
+
- **Upcoming** - Steps that haven't been reached yet (numbered)
|
|
38
|
+
|
|
39
|
+
### Control Modes
|
|
40
|
+
|
|
41
|
+
The component supports both controlled and uncontrolled modes:
|
|
42
|
+
|
|
43
|
+
- **Controlled** - You manage the selected step state externally via `selectedStep` and `onSelectStep` props
|
|
44
|
+
- **Uncontrolled** - The component manages its own selected step state internally
|
|
45
|
+
|
|
46
|
+
### Navigation
|
|
47
|
+
|
|
48
|
+
Users can click on completed steps to navigate back, but cannot jump ahead to future steps. This maintains the integrity of the step-by-step process.
|
|
49
|
+
|
|
50
|
+
### Mobile Considerations
|
|
51
|
+
|
|
52
|
+
On mobile devices, labels can be hidden to save space, showing only the step indicators with numbers or icons.
|
|
53
|
+
|
|
54
|
+
### Usage Recommendations
|
|
55
|
+
|
|
56
|
+
- Guide users through multi-step forms or wizards
|
|
57
|
+
- Show progress in onboarding flows
|
|
58
|
+
- Break down complex processes into digestible steps
|
|
59
|
+
- Indicate current position in checkout or setup flows
|
|
60
|
+
|
|
61
|
+
### Content Guidelines
|
|
62
|
+
|
|
63
|
+
- Keep step labels short and descriptive (1-2 words)
|
|
64
|
+
- Use clear, action-oriented language
|
|
65
|
+
- Maintain consistent terminology throughout the process
|
|
66
|
+
- Ensure labels accurately reflect the step content
|
|
67
|
+
|
|
68
|
+
## Usage
|
|
69
|
+
|
|
70
|
+
```jsx
|
|
71
|
+
// Basic uncontrolled usage
|
|
72
|
+
<Stepper activeStep={2}>
|
|
73
|
+
<Stepper.Item label="Setup" />
|
|
74
|
+
<Stepper.Item label="Configuration" />
|
|
75
|
+
<Stepper.Item label="Review" />
|
|
76
|
+
<Stepper.Item label="Deploy" />
|
|
77
|
+
</Stepper>
|
|
78
|
+
|
|
79
|
+
// Controlled usage with navigation
|
|
80
|
+
<Stepper
|
|
81
|
+
activeStep={activeStep}
|
|
82
|
+
selectedStep={selectedStep}
|
|
83
|
+
onSelectStep={setSelectedStep}
|
|
84
|
+
>
|
|
85
|
+
<Stepper.Item label="Select audience" />
|
|
86
|
+
<Stepper.Item label="Create content" />
|
|
87
|
+
<Stepper.Item label="Define budget" />
|
|
88
|
+
<Stepper.Item label="Review" />
|
|
89
|
+
<Stepper.Item label="Publish" />
|
|
90
|
+
</Stepper>
|
|
91
|
+
|
|
92
|
+
// With card wrapper
|
|
93
|
+
<Stepper.Card>
|
|
94
|
+
<Stepper activeStep={1}>
|
|
95
|
+
<Stepper.Item label="Start" />
|
|
96
|
+
<Stepper.Item label="Process" />
|
|
97
|
+
<Stepper.Item label="Finish" />
|
|
98
|
+
</Stepper>
|
|
99
|
+
</Stepper.Card>
|
|
100
|
+
|
|
101
|
+
// Mobile-friendly (without labels)
|
|
102
|
+
<Stepper activeStep={0}>
|
|
103
|
+
<Stepper.Item />
|
|
104
|
+
<Stepper.Item />
|
|
105
|
+
<Stepper.Item />
|
|
106
|
+
</Stepper>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Props
|
|
110
|
+
|
|
111
|
+
#### Stepper
|
|
112
|
+
|
|
113
|
+
- `activeStep` (number): The currently active step (0-based index)
|
|
114
|
+
- `selectedStep` (number, optional): The currently selected step for controlled mode
|
|
115
|
+
- `onSelectStep` (function, optional): Callback for step selection in controlled mode
|
|
116
|
+
- `children` (ReactNode): StepperItem components
|
|
117
|
+
|
|
118
|
+
#### Stepper.Item
|
|
119
|
+
|
|
120
|
+
- `label` (string, optional): Text label for the step
|
|
121
|
+
- `step` (number): Step number (automatically assigned by parent)
|
|
122
|
+
|
|
123
|
+
View docs [here](https://nimbus.nuvemshop.com.br/documentation/composite-components/stepper).
|
|
124
|
+
|
|
125
|
+
<img alt="Nimbus" style="margin-bottom: 30px;" src="https://tiendanube.github.io/design-system-nimbus/static/media/nimbus-logo.ab60bd79.png" height="30" />
|