ng-hub-ui-stepper 21.1.0 → 22.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 CHANGED
@@ -1,26 +1,46 @@
1
1
  # ng-hub-ui-stepper
2
2
 
3
+ [Español](./README.es.md) | **English**
4
+
3
5
  [![npm version](https://img.shields.io/npm/v/ng-hub-ui-stepper.svg)](https://www.npmjs.com/package/ng-hub-ui-stepper)
4
6
  [![license](https://img.shields.io/npm/l/ng-hub-ui-stepper.svg)](https://github.com/carlos-morcillo/ng-hub-ui-stepper/blob/main/LICENSE)
5
7
 
6
8
  A flexible, customizable, and accessible stepper component for Angular 21+. Perfect for multi-step forms, wizards, and guided user experiences with a focus on developer experience and modern standards.
7
9
 
8
10
  > [!IMPORTANT]
9
- > This version (21.1.0) is built for **Angular 21** and uses the new **Signals** architecture.
11
+ > This version (21.2.1) is built for **Angular 21** and uses the new **Signals** architecture.
12
+
13
+ ## Documentation and Live Examples
14
+
15
+ This package is part of [Hub UI](https://hubui.dev/), a collection of Angular component libraries for standalone apps.
16
+
17
+ - Docs: https://hubui.dev/stepper/overview/
18
+ - Live examples: https://hubui.dev/stepper/examples/
19
+ - Hub UI: https://hubui.dev/
10
20
 
11
21
  ## 🧩 Library Family `ng-hub-ui`
12
22
 
13
23
  This library is part of the **ng-hub-ui** ecosystem:
14
24
 
15
- - [**ng-hub-ui-accordion**](https://www.npmjs.com/package/ng-hub-ui-accordion)
25
+ - [**ng-hub-ui-accordion**](https://www.npmjs.com/package/ng-hub-ui-accordion) (deprecated — use ng-hub-ui-panels)
26
+ - [**ng-hub-ui-action-sheet**](https://www.npmjs.com/package/ng-hub-ui-action-sheet)
16
27
  - [**ng-hub-ui-avatar**](https://www.npmjs.com/package/ng-hub-ui-avatar)
17
28
  - [**ng-hub-ui-board**](https://www.npmjs.com/package/ng-hub-ui-board)
18
29
  - [**ng-hub-ui-breadcrumbs**](https://www.npmjs.com/package/ng-hub-ui-breadcrumbs)
19
30
  - [**ng-hub-ui-calendar**](https://www.npmjs.com/package/ng-hub-ui-calendar)
31
+ - [**ng-hub-ui-dropdown**](https://www.npmjs.com/package/ng-hub-ui-dropdown)
32
+ - [**ng-hub-ui-ds**](https://www.npmjs.com/package/ng-hub-ui-ds)
33
+ - [**ng-hub-ui-forms**](https://www.npmjs.com/package/ng-hub-ui-forms)
34
+ - [**ng-hub-ui-history**](https://www.npmjs.com/package/ng-hub-ui-history)
35
+ - [**ng-hub-ui-milestones**](https://www.npmjs.com/package/ng-hub-ui-milestones)
20
36
  - [**ng-hub-ui-modal**](https://www.npmjs.com/package/ng-hub-ui-modal)
37
+ - [**ng-hub-ui-nav**](https://www.npmjs.com/package/ng-hub-ui-nav)
21
38
  - [**ng-hub-ui-paginable**](https://www.npmjs.com/package/ng-hub-ui-paginable)
39
+ - [**ng-hub-ui-panels**](https://www.npmjs.com/package/ng-hub-ui-panels)
22
40
  - [**ng-hub-ui-portal**](https://www.npmjs.com/package/ng-hub-ui-portal)
23
- - [**ng-hub-ui-stepper**](https://www.npmjs.com/package/ng-hub-ui-stepper)
41
+ - [**ng-hub-ui-skeleton**](https://www.npmjs.com/package/ng-hub-ui-skeleton)
42
+ - [**ng-hub-ui-sortable**](https://www.npmjs.com/package/ng-hub-ui-sortable)
43
+ - [**ng-hub-ui-stepper**](https://www.npmjs.com/package/ng-hub-ui-stepper) ← You are here
24
44
  - [**ng-hub-ui-utils**](https://www.npmjs.com/package/ng-hub-ui-utils)
25
45
 
26
46
  ## Table of Contents
@@ -75,17 +95,17 @@ In your template:
75
95
 
76
96
  ```html
77
97
  <hub-stepper>
78
- <hub-step [index]="0" title="Account Setup">
98
+ <hub-step title="Account Setup">
79
99
  <h3>Welcome!</h3>
80
100
  <p>Setup your account details here.</p>
81
101
  </hub-step>
82
-
83
- <hub-step [index]="1" title="Personal Info">
102
+
103
+ <hub-step title="Personal Info">
84
104
  <h3>Profile Data</h3>
85
105
  <p>Tell us more about yourself.</p>
86
106
  </hub-step>
87
107
 
88
- <hub-step [index]="2" title="Review">
108
+ <hub-step title="Review">
89
109
  <h3>Save & Finalize</h3>
90
110
  <p>Ready to go?</p>
91
111
  </hub-step>
@@ -100,12 +120,12 @@ Control navigation by enabling/disabling steps programmatically.
100
120
 
101
121
  ```html
102
122
  <hub-stepper (completed)="onFinish()">
103
- <hub-step [index]="0" title="Step 1">
104
- <!-- Step 1 Content -->
123
+ <hub-step title="Step 1">
124
+ <!-- Step 1 Content -->
105
125
  </hub-step>
106
-
107
- <hub-step [index]="1" title="Step 2" [disabled]="!isStep1Valid()">
108
- <!-- Step 2 Content -->
126
+
127
+ <hub-step title="Step 2" [disabled]="!isStep1Valid()">
128
+ <!-- Step 2 Content -->
109
129
  </hub-step>
110
130
  </hub-stepper>
111
131
  ```
@@ -118,16 +138,16 @@ Provide your own navigation template using the `stepperNavTpt` property.
118
138
  <hub-stepper>
119
139
  <nav *stepperNav="let steps = steps; let currentIndex = currentIndex" class="my-custom-nav">
120
140
  @for (step of steps; track step; let i = $index) {
121
- <button
122
- [class.active]="i === currentIndex"
141
+ <button
142
+ [class.active]="i === currentIndex"
123
143
  (click)="goTo(i)">
124
144
  {{ step.title() }}
125
145
  </button>
126
146
  }
127
147
  </nav>
128
148
 
129
- <hub-step [index]="0" title="A">...</hub-step>
130
- <hub-step [index]="1" title="B">...</hub-step>
149
+ <hub-step title="A">...</hub-step>
150
+ <hub-step title="B">...</hub-step>
131
151
  </hub-stepper>
132
152
  ```
133
153
 
@@ -137,8 +157,8 @@ Project your own buttons to override the default footer.
137
157
 
138
158
  ```html
139
159
  <hub-stepper>
140
- <hub-step [index]="0">...</hub-step>
141
-
160
+ <hub-step>...</hub-step>
161
+
142
162
  <button previousButton class="btn-back">Go back</button>
143
163
  <button nextButton class="btn-next">Next step</button>
144
164
  <button submitButton class="btn-done">Complete</button>
@@ -154,6 +174,7 @@ Project your own buttons to override the default footer.
154
174
  | `backLabel` | `string` | `'Back'` | Label for the back button. |
155
175
  | `continueLabel` | `string` | `'Continue'` | Label for the continue button. |
156
176
  | `submitLabel` | `string` | `'Submit'` | Label for the submit button. |
177
+ | `variant` | `string` | `'primary'` | Semantic accent for the active step pill and the next / submit controls. Built-in values: `primary`, `success`, `danger`, `warning`, `info`. Any other string is also accepted and resolves through `--hub-sys-color-<variant>`. |
157
178
  | `options` | `StepperOptions` | `{}` | Visual and layout configuration. |
158
179
 
159
180
  | Output | Type | Description |
@@ -166,7 +187,6 @@ Project your own buttons to override the default footer.
166
187
 
167
188
  | Input | Type | Default | Description |
168
189
  |---|---|---|---|
169
- | `index` | `number` | `required` | Position of the step (0-indexed). |
170
190
  | `title` | `string` | `optional` | Text displayed in navigation. |
171
191
  | `disabled` | `boolean` | `false` | Prevents navigation to this step. |
172
192
 
@@ -199,6 +219,33 @@ Customize the component using CSS variables. For a complete list of available to
199
219
  }
200
220
  ```
201
221
 
222
+ ### Semantic accent
223
+
224
+ The `--hub-stepper-accent` token drives the active step pill and the next / submit controls. It defaults to `var(--hub-sys-color-primary)`. The easiest way to set it is the `variant` input (see [API Reference](#steppercomponent)), but you can also override the token directly:
225
+
226
+ ```css
227
+ .my-stepper {
228
+ --hub-stepper-accent: var(--hub-sys-color-success);
229
+ }
230
+ ```
231
+
232
+ ### Sass mixin
233
+
234
+ For full theming in a single call, the package ships a `hub-stepper-theme()` Sass mixin. Every parameter is optional and defaults to `null`, so only the ones you pass are emitted as `--hub-stepper-*` overrides:
235
+
236
+ ```scss
237
+ @use 'ng-hub-ui-stepper/styles/mixins/stepper-theme' as *;
238
+
239
+ .checkout-stepper {
240
+ @include hub-stepper-theme(
241
+ $accent: var(--hub-sys-color-success),
242
+ $gap: 1.5rem,
243
+ $nav-link-active-color: #fff,
244
+ $sidebar-width: 220px
245
+ );
246
+ }
247
+ ```
248
+
202
249
  ## Contributing
203
250
 
204
251
  We welcome contributions! Please follow our [Commit Guidelines](https://github.com/carlos-morcillo/ng-hub-ui/blob/main/CONTRIBUTING.md).
@@ -218,4 +265,3 @@ If you find this project helpful, consider supporting its development:
218
265
  ## License
219
266
 
220
267
  This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
221
-