@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.
Files changed (33) hide show
  1. package/.turbo/turbo-build.log +24 -0
  2. package/CHANGELOG.md +3 -0
  3. package/README.md +125 -0
  4. package/dist/CHANGELOG.md +3 -0
  5. package/dist/README.md +125 -0
  6. package/dist/index.d.ts +850 -0
  7. package/dist/index.js +1 -0
  8. package/package.json +48 -0
  9. package/src/Stepper.tsx +114 -0
  10. package/src/components/StepperCard/StepperCard.tsx +15 -0
  11. package/src/components/StepperCard/index.ts +2 -0
  12. package/src/components/StepperCard/stepperCard.spec.tsx +47 -0
  13. package/src/components/StepperCard/stepperCard.stories.tsx +39 -0
  14. package/src/components/StepperCard/stepperCard.types.ts +11 -0
  15. package/src/components/StepperContext/StepperContext.tsx +9 -0
  16. package/src/components/StepperContext/index.ts +2 -0
  17. package/src/components/StepperContext/stepperContext.spec.tsx +54 -0
  18. package/src/components/StepperContext/stepperContext.types.ts +21 -0
  19. package/src/components/StepperItem/StepperItem.definitions.ts +11 -0
  20. package/src/components/StepperItem/StepperItem.tsx +111 -0
  21. package/src/components/StepperItem/index.ts +2 -0
  22. package/src/components/StepperItem/stepperItem.spec.tsx +572 -0
  23. package/src/components/StepperItem/stepperItem.stories.tsx +60 -0
  24. package/src/components/StepperItem/stepperItem.types.ts +21 -0
  25. package/src/components/index.ts +6 -0
  26. package/src/index.ts +12 -0
  27. package/src/stepper.definitions.ts +11 -0
  28. package/src/stepper.docs.json +68 -0
  29. package/src/stepper.spec.tsx +344 -0
  30. package/src/stepper.stories.tsx +145 -0
  31. package/src/stepper.types.ts +48 -0
  32. package/tsconfig.json +4 -0
  33. 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 ./index.js 18.8 KiB [emitted] [minimized] (name: ./index)
4
+ runtime modules 670 bytes 3 modules
5
+ cacheable modules 30.8 KiB
6
+ modules by path ./src/ 10.7 KiB 11 modules
7
+ modules by path ../ 20.1 KiB
8
+ modules by path ../Card/src/components/ 3.04 KiB 7 modules
9
+ + 3 modules
10
+ modules by path external "@nimbus-ds/ 252 bytes
11
+ external "@nimbus-ds/box" 42 bytes [built] [code generated]
12
+ external "@nimbus-ds/icon" 42 bytes [built] [code generated]
13
+ external "@nimbus-ds/text" 42 bytes [built] [code generated]
14
+ external "@nimbus-ds/icons" 42 bytes [built] [code generated]
15
+ external "@nimbus-ds/styles" 42 bytes [built] [code generated]
16
+ external "@nimbus-ds/title" 42 bytes [built] [code generated]
17
+ external "react" 42 bytes [built] [code generated]
18
+ webpack 5.90.3 compiled successfully 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
+ Compiler option "skipLibCheck" is disabled to properly check generated output
24
+ Done in 13.14s
package/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # Changelog
2
+
3
+ The Stepper component guides users through multi-step processes, showing their progress and allowing navigation between completed steps.
package/README.md ADDED
@@ -0,0 +1,125 @@
1
+ # `@nimbus-ds/stepper`
2
+
3
+ [![@nimbus-ds/stepper](https://img.shields.io/npm/v/@nimbus-ds/stepper?label=%40nimbus-ds%2Fstepper)](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" />
@@ -0,0 +1,3 @@
1
+ # Changelog
2
+
3
+ The Stepper component guides users through multi-step processes, showing their progress and allowing navigation between completed steps.
package/dist/README.md ADDED
@@ -0,0 +1,125 @@
1
+ # `@nimbus-ds/stepper`
2
+
3
+ [![@nimbus-ds/stepper](https://img.shields.io/npm/v/@nimbus-ds/stepper?label=%40nimbus-ds%2Fstepper)](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" />