@kubex/zinc 1.0.25 → 1.0.99
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/.claude/project.md +556 -0
- package/.github/workflows/js_build_and_deploy.yaml +9 -10
- package/dist/custom-elements.json +13575 -8856
- package/dist/vscode.html-custom-data.json +583 -48
- package/dist/web-types.json +1441 -181
- package/dist/zn.d.ts +1645 -660
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +1412 -893
- package/docs/_utilities/code-previews.cjs +10 -1
- package/docs/assets/scripts/docs.js +42 -18
- package/docs/data/data-table.json +229 -66
- package/docs/data/empty.json +6 -0
- package/docs/data/products-table.json +41 -193
- package/docs/pages/components/action-bar.md +121 -6
- package/docs/pages/components/alert.md +118 -15
- package/docs/pages/components/animated-button.md +299 -0
- package/docs/pages/components/audio-select.md +534 -0
- package/docs/pages/components/bulk-actions.md +79 -5
- package/docs/pages/components/button-group.md +235 -27
- package/docs/pages/components/button.md +139 -1
- package/docs/pages/components/chart.md +365 -9
- package/docs/pages/components/checkbox.md +387 -58
- package/docs/pages/components/chip.md +253 -33
- package/docs/pages/components/collapsible.md +393 -46
- package/docs/pages/components/cols.md +152 -30
- package/docs/pages/components/confirm.md +182 -16
- package/docs/pages/components/copy-button.md +169 -6
- package/docs/pages/components/data-select.md +194 -15
- package/docs/pages/components/data-table-filter.md +96 -5
- package/docs/pages/components/data-table-search.md +451 -0
- package/docs/pages/components/data-table-sort.md +66 -5
- package/docs/pages/components/data-table.md +727 -66
- package/docs/pages/components/datepicker.md +402 -7
- package/docs/pages/components/defined-label.md +120 -5
- package/docs/pages/components/dialog.md +339 -59
- package/docs/pages/components/dropdown.md +366 -11
- package/docs/pages/components/editor.md +604 -7
- package/docs/pages/components/empty-state.md +315 -16
- package/docs/pages/components/expanding-action.md +212 -28
- package/docs/pages/components/file.md +421 -12
- package/docs/pages/components/filter-container.md +158 -5
- package/docs/pages/components/filter-wrapper.md +167 -6
- package/docs/pages/components/form-group.md +383 -6
- package/docs/pages/components/hover-container.md +237 -6
- package/docs/pages/components/icon-picker.md +121 -0
- package/docs/pages/components/icon.md +454 -48
- package/docs/pages/components/inline-edit.md +787 -19
- package/docs/pages/components/input-group.md +207 -13
- package/docs/pages/components/input.md +194 -0
- package/docs/pages/components/item.md +18 -0
- package/docs/pages/components/key-container.md +115 -0
- package/docs/pages/components/key.md +101 -0
- package/docs/pages/components/menu.md +512 -6
- package/docs/pages/components/note.md +239 -36
- package/docs/pages/components/opt-group.md +107 -0
- package/docs/pages/components/pagination.md +332 -6
- package/docs/pages/components/pane.md +222 -6
- package/docs/pages/components/panel.md +213 -26
- package/docs/pages/components/popup.md +1354 -6
- package/docs/pages/components/priority-list.md +233 -0
- package/docs/pages/components/progress-bar.md +387 -6
- package/docs/pages/components/radio-group.md +242 -5
- package/docs/pages/components/radio.md +474 -6
- package/docs/pages/components/rating.md +331 -7
- package/docs/pages/components/reveal.md +524 -6
- package/docs/pages/components/scroll-container.md +552 -6
- package/docs/pages/components/select.md +762 -160
- package/docs/pages/components/skeleton.md +473 -30
- package/docs/pages/components/slideout.md +261 -5
- package/docs/pages/components/sp.md +99 -41
- package/docs/pages/components/split-button.md +347 -9
- package/docs/pages/components/split-pane.md +445 -6
- package/docs/pages/components/stat.md +549 -9
- package/docs/pages/components/status-indicator.md +230 -1
- package/docs/pages/components/stepper.md +563 -6
- package/docs/pages/components/tabs.md +439 -13
- package/docs/pages/components/textarea.md +415 -17
- package/docs/pages/components/tile.md +385 -26
- package/docs/pages/components/toggle.md +424 -6
- package/docs/pages/components/tooltip.md +367 -0
- package/docs/pages/components/translation-group.md +210 -0
- package/docs/pages/components/translations.md +319 -19
- package/docs/pages/components/vertical-stepper.md +401 -8
- package/docs/pages/components/well.md +300 -3
- package/docs/pages/getting-started/form-controls.md +162 -0
- package/docs/pages/index.md +116 -15
- package/package.json +5 -6
- package/scss/_global-spacing.scss +4 -0
- package/scss/_root.scss +2 -2
- package/scss/boot.scss +19 -0
- package/scss/shared/layout.scss +5 -0
- package/scss/themes/_light.scss +3 -3
- package/src/components/alert/alert.scss +1 -0
- package/src/components/animated-button/README.md +306 -0
- package/src/components/animated-button/animated-button.component.ts +229 -0
- package/src/components/animated-button/animated-button.scss +228 -0
- package/src/components/animated-button/animated-button.test.ts +143 -0
- package/src/components/animated-button/index.ts +12 -0
- package/src/components/button/button.component.ts +5 -0
- package/src/components/button-group/button-group.component.ts +25 -13
- package/src/components/button-group/button-group.scss +6 -0
- package/src/components/checkbox/checkbox.component.ts +4 -0
- package/src/components/checkbox/checkbox.scss +7 -4
- package/src/components/checkbox-group/checkbox-group.scss +7 -0
- package/src/components/chip/chip.component.ts +7 -2
- package/src/components/chip/chip.scss +16 -2
- package/src/components/collapsible/collapsible.component.ts +27 -20
- package/src/components/cols/cols.component.ts +14 -2
- package/src/components/cols/cols.scss +6 -12
- package/src/components/confirm/confirm.component.ts +7 -0
- package/src/components/copy-button/copy-button.component.ts +12 -11
- package/src/components/data-select/data-select.component.ts +215 -44
- package/src/components/data-select/data-select.scss +66 -6
- package/src/components/data-select/providers/currency-data-provider.ts +20 -6
- package/src/components/data-select/providers/provider.ts +1 -0
- package/src/components/data-select/providers/us-state-data-provider.ts +68 -0
- package/src/components/data-table/data-table.component.ts +81 -22
- package/src/components/data-table-search/data-table-search.component.ts +184 -0
- package/src/components/data-table-search/data-table-search.scss +17 -0
- package/src/components/data-table-search/data-table-search.test.ts +11 -0
- package/src/components/data-table-search/index.ts +12 -0
- package/src/components/datepicker/datepicker.component.ts +347 -13
- package/src/components/dialog/dialog.component.ts +1 -1
- package/src/components/empty-state/empty-state.scss +6 -1
- package/src/components/header/header.scss +3 -3
- package/src/components/icon/icon.component.ts +23 -1
- package/src/components/icon/icon.scss +23 -0
- package/src/components/icon-picker/brand-icons.ts +24 -0
- package/src/components/icon-picker/icon-picker.component.ts +407 -0
- package/src/components/icon-picker/icon-picker.scss +205 -0
- package/src/components/icon-picker/index.ts +12 -0
- package/src/components/icon-picker/line-icons.ts +612 -0
- package/src/components/icon-picker/material-icons.ts +14543 -0
- package/src/components/inline-edit/inline-edit.component.ts +190 -46
- package/src/components/inline-edit/inline-edit.scss +29 -0
- package/src/components/inline-edit/inline-edit.test.ts +314 -1
- package/src/components/input/input.component.ts +324 -5
- package/src/components/input/input.scss +87 -0
- package/src/components/input-group/input-group.component.ts +28 -7
- package/src/components/input-group/input-group.scss +48 -10
- package/src/components/item/item.component.ts +24 -3
- package/src/components/item/item.scss +18 -0
- package/src/components/key/index.ts +12 -0
- package/src/components/key/key.component.ts +47 -0
- package/src/components/key/key.scss +38 -0
- package/src/components/key-container/index.ts +12 -0
- package/src/components/key-container/key-container.component.ts +142 -0
- package/src/components/key-container/key-container.scss +33 -0
- package/src/components/menu-item/menu-item.component.ts +20 -0
- package/src/components/menu-item/menu-item.scss +69 -2
- package/src/components/navbar/navbar.component.ts +103 -11
- package/src/components/navbar/navbar.scss +6 -1
- package/src/components/opt-group/index.ts +12 -0
- package/src/components/opt-group/opt-group.component.ts +74 -0
- package/src/components/opt-group/opt-group.scss +37 -0
- package/src/components/opt-group/opt-group.test.ts +27 -0
- package/src/components/option/option.component.ts +1 -16
- package/src/components/option/option.scss +4 -0
- package/src/components/panel/panel.component.ts +10 -8
- package/src/components/panel/panel.scss +20 -0
- package/src/components/priority-list/index.ts +12 -0
- package/src/components/priority-list/priority-list.component.ts +611 -0
- package/src/components/priority-list/priority-list.scss +185 -0
- package/src/components/priority-list/priority-list.test.ts +139 -0
- package/src/components/progress-bar/progress-bar.component.ts +22 -16
- package/src/components/radio/radio.scss +10 -3
- package/src/components/select/select.component.ts +812 -72
- package/src/components/select/select.scss +108 -2
- package/src/components/select/select.test.ts +147 -2
- package/src/components/settings-container/settings-container.component.ts +44 -19
- package/src/components/settings-container/settings-container.scss +1 -1
- package/src/components/skeleton/skeleton.component.ts +6 -1
- package/src/components/slideout/slideout.scss +8 -3
- package/src/components/sp/sp.component.ts +3 -1
- package/src/components/sp/sp.scss +19 -0
- package/src/components/stepper/stepper.component.ts +16 -10
- package/src/components/textarea/textarea.scss +0 -4
- package/src/components/tile/tile.component.ts +12 -3
- package/src/components/tile/tile.scss +1 -1
- package/src/components/timer/timer.component.ts +15 -2
- package/src/components/toggle/toggle.component.ts +29 -26
- package/src/components/toggle/toggle.scss +13 -1
- package/src/components/translation-group/index.ts +12 -0
- package/src/components/translation-group/translation-group.component.ts +207 -0
- package/src/components/translation-group/translation-group.scss +8 -0
- package/src/components/translations/translations.component.ts +90 -44
- package/src/components/translations/translations.scss +4 -0
- package/src/components/vertical-stepper/vertical-stepper.component.ts +14 -9
- package/src/events/events.ts +12 -7
- package/src/events/zn-language-change.ts +7 -0
- package/src/events/zn-purchase.ts +11 -0
- package/src/events/zn-redirect.ts +7 -0
- package/src/events/zn-reorder.ts +7 -0
- package/src/events/zn-search-change.ts +11 -0
- package/src/events/zn-submit.ts +1 -1
- package/src/form-control.scss +4 -0
- package/src/internal/form-navigation.ts +510 -0
- package/src/internal/form.ts +6 -0
- package/src/zinc.ts +91 -83
|
@@ -1,20 +1,577 @@
|
|
|
1
1
|
---
|
|
2
2
|
meta:
|
|
3
3
|
title: Stepper
|
|
4
|
-
description:
|
|
4
|
+
description: Steppers provide visual feedback about progress through a multi-step process or workflow, showing current position and total steps.
|
|
5
5
|
layout: component
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
```html:preview
|
|
9
|
-
<zn-stepper caption="
|
|
9
|
+
<zn-stepper caption="Setup Progress" label="Installation Wizard" steps="5" value="3" show-progress></zn-stepper>
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
## Examples
|
|
13
13
|
|
|
14
|
-
###
|
|
14
|
+
### Basic Stepper
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
A basic stepper displays progress through a sequence of steps. Use the `steps` attribute to define the total number of steps and `value` to indicate the current step position.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
```html:preview
|
|
19
|
+
<zn-stepper steps="4" value="2"></zn-stepper>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### With Caption
|
|
23
|
+
|
|
24
|
+
Use the `caption` attribute to add a descriptive label above the stepper. This helps users understand what process or workflow the stepper represents.
|
|
25
|
+
|
|
26
|
+
```html:preview
|
|
27
|
+
<zn-stepper caption="Account Setup" steps="5" value="2"></zn-stepper>
|
|
28
|
+
<br />
|
|
29
|
+
<zn-stepper caption="Order Processing" steps="6" value="4"></zn-stepper>
|
|
30
|
+
<br />
|
|
31
|
+
<zn-stepper caption="Project Onboarding" steps="3" value="1"></zn-stepper>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### With Label
|
|
35
|
+
|
|
36
|
+
Use the `label` attribute to display information above the caption. This is useful for showing the wizard or workflow name.
|
|
37
|
+
|
|
38
|
+
```html:preview
|
|
39
|
+
<zn-stepper label="New User Registration" caption="Personal Information" steps="5" value="1"></zn-stepper>
|
|
40
|
+
<br />
|
|
41
|
+
<zn-stepper label="Checkout Process" caption="Shipping Details" steps="4" value="2"></zn-stepper>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Showing Progress Count
|
|
45
|
+
|
|
46
|
+
Use the `show-progress` attribute to display the current step number alongside the total number of steps (e.g., "2 / 5 steps").
|
|
47
|
+
|
|
48
|
+
```html:preview
|
|
49
|
+
<zn-stepper caption="Installation" steps="5" value="2" show-progress></zn-stepper>
|
|
50
|
+
<br />
|
|
51
|
+
<zn-stepper caption="Data Import" steps="10" value="7" show-progress></zn-stepper>
|
|
52
|
+
<br />
|
|
53
|
+
<zn-stepper caption="Configuration" steps="3" value="3" show-progress></zn-stepper>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Complete Progress States
|
|
57
|
+
|
|
58
|
+
Examples showing different stages of a workflow, from start to completion.
|
|
59
|
+
|
|
60
|
+
```html:preview
|
|
61
|
+
<zn-stepper
|
|
62
|
+
label="Project Setup Wizard"
|
|
63
|
+
caption="Getting Started"
|
|
64
|
+
steps="5"
|
|
65
|
+
value="0"
|
|
66
|
+
show-progress>
|
|
67
|
+
</zn-stepper>
|
|
68
|
+
<br />
|
|
69
|
+
<zn-stepper
|
|
70
|
+
label="Project Setup Wizard"
|
|
71
|
+
caption="Configure Settings"
|
|
72
|
+
steps="5"
|
|
73
|
+
value="2"
|
|
74
|
+
show-progress>
|
|
75
|
+
</zn-stepper>
|
|
76
|
+
<br />
|
|
77
|
+
<zn-stepper
|
|
78
|
+
label="Project Setup Wizard"
|
|
79
|
+
caption="Review & Deploy"
|
|
80
|
+
steps="5"
|
|
81
|
+
value="4"
|
|
82
|
+
show-progress>
|
|
83
|
+
</zn-stepper>
|
|
84
|
+
<br />
|
|
85
|
+
<zn-stepper
|
|
86
|
+
label="Project Setup Wizard"
|
|
87
|
+
caption="Complete!"
|
|
88
|
+
steps="5"
|
|
89
|
+
value="5"
|
|
90
|
+
show-progress>
|
|
91
|
+
</zn-stepper>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### All Properties Combined
|
|
95
|
+
|
|
96
|
+
A comprehensive example showing all available properties working together.
|
|
97
|
+
|
|
98
|
+
```html:preview
|
|
99
|
+
<zn-stepper
|
|
100
|
+
label="E-commerce Checkout"
|
|
101
|
+
caption="Payment Information"
|
|
102
|
+
steps="4"
|
|
103
|
+
value="3"
|
|
104
|
+
show-progress>
|
|
105
|
+
</zn-stepper>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Dynamic Progress Updates
|
|
109
|
+
|
|
110
|
+
Steppers can be updated dynamically using JavaScript to reflect real-time progress through a workflow.
|
|
111
|
+
|
|
112
|
+
```html:preview
|
|
113
|
+
<zn-stepper
|
|
114
|
+
id="dynamic-stepper"
|
|
115
|
+
label="Form Wizard"
|
|
116
|
+
caption="Step 1: Personal Details"
|
|
117
|
+
steps="4"
|
|
118
|
+
value="1"
|
|
119
|
+
show-progress>
|
|
120
|
+
</zn-stepper>
|
|
121
|
+
<br />
|
|
122
|
+
<zn-button id="next-step">Next Step</zn-button>
|
|
123
|
+
<zn-button id="prev-step" color="secondary">Previous Step</zn-button>
|
|
124
|
+
<zn-button id="reset-stepper" color="transparent">Reset</zn-button>
|
|
125
|
+
|
|
126
|
+
<script type="module">
|
|
127
|
+
const stepper = document.getElementById('dynamic-stepper');
|
|
128
|
+
const nextBtn = document.getElementById('next-step');
|
|
129
|
+
const prevBtn = document.getElementById('prev-step');
|
|
130
|
+
const resetBtn = document.getElementById('reset-stepper');
|
|
131
|
+
|
|
132
|
+
const stepNames = [
|
|
133
|
+
'Personal Details',
|
|
134
|
+
'Contact Information',
|
|
135
|
+
'Preferences',
|
|
136
|
+
'Review & Submit'
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
function updateStepCaption() {
|
|
140
|
+
const stepIndex = stepper.value - 1;
|
|
141
|
+
if (stepIndex >= 0 && stepIndex < stepNames.length) {
|
|
142
|
+
stepper.caption = `Step ${stepper.value}: ${stepNames[stepIndex]}`;
|
|
143
|
+
} else if (stepper.value === 0) {
|
|
144
|
+
stepper.caption = 'Getting Started';
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
nextBtn.addEventListener('click', () => {
|
|
149
|
+
if (stepper.value < stepper.steps) {
|
|
150
|
+
stepper.value = stepper.value + 1;
|
|
151
|
+
updateStepCaption();
|
|
152
|
+
if (stepper.value === stepper.steps) {
|
|
153
|
+
stepper.caption = 'Complete!';
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
prevBtn.addEventListener('click', () => {
|
|
159
|
+
if (stepper.value > 0) {
|
|
160
|
+
stepper.value = stepper.value - 1;
|
|
161
|
+
updateStepCaption();
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
resetBtn.addEventListener('click', () => {
|
|
166
|
+
stepper.value = 1;
|
|
167
|
+
updateStepCaption();
|
|
168
|
+
});
|
|
169
|
+
</script>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Multi-Step Form Wizard
|
|
173
|
+
|
|
174
|
+
A practical example showing a stepper integrated with a form wizard interface.
|
|
175
|
+
|
|
176
|
+
```html:preview
|
|
177
|
+
<zn-stepper
|
|
178
|
+
id="wizard-stepper"
|
|
179
|
+
label="Account Creation Wizard"
|
|
180
|
+
caption="Step 1: Basic Information"
|
|
181
|
+
steps="3"
|
|
182
|
+
value="1"
|
|
183
|
+
show-progress>
|
|
184
|
+
</zn-stepper>
|
|
185
|
+
|
|
186
|
+
<div id="wizard-content" style="margin-top: 20px; padding: 20px; border: 1px solid rgb(var(--zn-border-color)); border-radius: 4px;">
|
|
187
|
+
<div class="wizard-step" data-step="1">
|
|
188
|
+
<h3>Basic Information</h3>
|
|
189
|
+
<p>Please enter your basic details to get started.</p>
|
|
190
|
+
</div>
|
|
191
|
+
<div class="wizard-step" data-step="2" style="display: none;">
|
|
192
|
+
<h3>Account Settings</h3>
|
|
193
|
+
<p>Configure your account preferences.</p>
|
|
194
|
+
</div>
|
|
195
|
+
<div class="wizard-step" data-step="3" style="display: none;">
|
|
196
|
+
<h3>Confirmation</h3>
|
|
197
|
+
<p>Review your information and complete the setup.</p>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<div style="margin-top: 20px;">
|
|
202
|
+
<zn-button id="wizard-next" color="default">Next</zn-button>
|
|
203
|
+
<zn-button id="wizard-prev" color="secondary" style="display: none;">Previous</zn-button>
|
|
204
|
+
<zn-button id="wizard-finish" color="success" style="display: none;">Finish</zn-button>
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<script type="module">
|
|
208
|
+
const wizardStepper = document.getElementById('wizard-stepper');
|
|
209
|
+
const nextBtn = document.getElementById('wizard-next');
|
|
210
|
+
const prevBtn = document.getElementById('wizard-prev');
|
|
211
|
+
const finishBtn = document.getElementById('wizard-finish');
|
|
212
|
+
const steps = document.querySelectorAll('.wizard-step');
|
|
213
|
+
|
|
214
|
+
const stepTitles = [
|
|
215
|
+
'Basic Information',
|
|
216
|
+
'Account Settings',
|
|
217
|
+
'Confirmation'
|
|
218
|
+
];
|
|
219
|
+
|
|
220
|
+
function updateWizard() {
|
|
221
|
+
const currentStep = wizardStepper.value;
|
|
222
|
+
|
|
223
|
+
// Update stepper caption
|
|
224
|
+
wizardStepper.caption = `Step ${currentStep}: ${stepTitles[currentStep - 1]}`;
|
|
225
|
+
|
|
226
|
+
// Show/hide content
|
|
227
|
+
steps.forEach((step, index) => {
|
|
228
|
+
step.style.display = (index + 1 === currentStep) ? 'block' : 'none';
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
// Show/hide buttons
|
|
232
|
+
prevBtn.style.display = currentStep > 1 ? 'inline-block' : 'none';
|
|
233
|
+
nextBtn.style.display = currentStep < wizardStepper.steps ? 'inline-block' : 'none';
|
|
234
|
+
finishBtn.style.display = currentStep === wizardStepper.steps ? 'inline-block' : 'none';
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
nextBtn.addEventListener('click', () => {
|
|
238
|
+
if (wizardStepper.value < wizardStepper.steps) {
|
|
239
|
+
wizardStepper.value++;
|
|
240
|
+
updateWizard();
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
prevBtn.addEventListener('click', () => {
|
|
245
|
+
if (wizardStepper.value > 1) {
|
|
246
|
+
wizardStepper.value--;
|
|
247
|
+
updateWizard();
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
finishBtn.addEventListener('click', () => {
|
|
252
|
+
alert('Wizard completed!');
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
updateWizard();
|
|
256
|
+
</script>
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Installation Progress Simulation
|
|
260
|
+
|
|
261
|
+
A realistic example simulating an installation or setup process with automatic progress updates.
|
|
262
|
+
|
|
263
|
+
```html:preview
|
|
264
|
+
<zn-stepper
|
|
265
|
+
id="install-stepper"
|
|
266
|
+
label="Software Installation"
|
|
267
|
+
caption="Click Start to begin"
|
|
268
|
+
steps="5"
|
|
269
|
+
value="0"
|
|
270
|
+
show-progress>
|
|
271
|
+
</zn-stepper>
|
|
272
|
+
<br />
|
|
273
|
+
<zn-button id="start-install" icon="download">Start Installation</zn-button>
|
|
274
|
+
<zn-button id="cancel-install" color="secondary" disabled>Cancel</zn-button>
|
|
275
|
+
|
|
276
|
+
<script type="module">
|
|
277
|
+
const installStepper = document.getElementById('install-stepper');
|
|
278
|
+
const startBtn = document.getElementById('start-install');
|
|
279
|
+
const cancelBtn = document.getElementById('cancel-install');
|
|
280
|
+
let installInterval;
|
|
281
|
+
|
|
282
|
+
const installSteps = [
|
|
283
|
+
'Downloading files...',
|
|
284
|
+
'Extracting packages...',
|
|
285
|
+
'Installing dependencies...',
|
|
286
|
+
'Configuring settings...',
|
|
287
|
+
'Finalizing installation...',
|
|
288
|
+
'Installation complete!'
|
|
289
|
+
];
|
|
290
|
+
|
|
291
|
+
startBtn.addEventListener('click', () => {
|
|
292
|
+
installStepper.value = 0;
|
|
293
|
+
startBtn.disabled = true;
|
|
294
|
+
startBtn.loading = true;
|
|
295
|
+
cancelBtn.disabled = false;
|
|
296
|
+
|
|
297
|
+
let currentStep = 0;
|
|
298
|
+
|
|
299
|
+
installInterval = setInterval(() => {
|
|
300
|
+
if (currentStep < installStepper.steps) {
|
|
301
|
+
currentStep++;
|
|
302
|
+
installStepper.value = currentStep;
|
|
303
|
+
installStepper.caption = installSteps[currentStep];
|
|
304
|
+
} else {
|
|
305
|
+
clearInterval(installInterval);
|
|
306
|
+
installStepper.caption = installSteps[installSteps.length - 1];
|
|
307
|
+
startBtn.disabled = false;
|
|
308
|
+
startBtn.loading = false;
|
|
309
|
+
cancelBtn.disabled = true;
|
|
310
|
+
}
|
|
311
|
+
}, 1500);
|
|
312
|
+
});
|
|
19
313
|
|
|
20
|
-
|
|
314
|
+
cancelBtn.addEventListener('click', () => {
|
|
315
|
+
clearInterval(installInterval);
|
|
316
|
+
installStepper.caption = 'Installation cancelled';
|
|
317
|
+
startBtn.disabled = false;
|
|
318
|
+
startBtn.loading = false;
|
|
319
|
+
cancelBtn.disabled = true;
|
|
320
|
+
});
|
|
321
|
+
</script>
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Multiple Steppers
|
|
325
|
+
|
|
326
|
+
Display multiple steppers to track different concurrent processes or workflows.
|
|
327
|
+
|
|
328
|
+
```html:preview
|
|
329
|
+
<zn-stepper
|
|
330
|
+
label="Frontend Build"
|
|
331
|
+
caption="Build Complete"
|
|
332
|
+
steps="4"
|
|
333
|
+
value="4"
|
|
334
|
+
show-progress>
|
|
335
|
+
</zn-stepper>
|
|
336
|
+
<br />
|
|
337
|
+
<zn-stepper
|
|
338
|
+
label="Backend Build"
|
|
339
|
+
caption="Running Tests"
|
|
340
|
+
steps="4"
|
|
341
|
+
value="3"
|
|
342
|
+
show-progress>
|
|
343
|
+
</zn-stepper>
|
|
344
|
+
<br />
|
|
345
|
+
<zn-stepper
|
|
346
|
+
label="Database Migration"
|
|
347
|
+
caption="Migrating Schema"
|
|
348
|
+
steps="6"
|
|
349
|
+
value="2"
|
|
350
|
+
show-progress>
|
|
351
|
+
</zn-stepper>
|
|
352
|
+
<br />
|
|
353
|
+
<zn-stepper
|
|
354
|
+
label="Asset Optimization"
|
|
355
|
+
caption="Waiting to Start"
|
|
356
|
+
steps="3"
|
|
357
|
+
value="0"
|
|
358
|
+
show-progress>
|
|
359
|
+
</zn-stepper>
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### Minimal Stepper
|
|
363
|
+
|
|
364
|
+
A clean, minimal stepper without any text labels, useful for compact layouts or when context is provided elsewhere.
|
|
365
|
+
|
|
366
|
+
```html:preview
|
|
367
|
+
<zn-stepper steps="5" value="1"></zn-stepper>
|
|
368
|
+
<br />
|
|
369
|
+
<zn-stepper steps="5" value="3"></zn-stepper>
|
|
370
|
+
<br />
|
|
371
|
+
<zn-stepper steps="5" value="5"></zn-stepper>
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Progress Overflow
|
|
375
|
+
|
|
376
|
+
The stepper handles cases where the value exceeds the total steps by capping the visual progress at 100%.
|
|
377
|
+
|
|
378
|
+
```html:preview
|
|
379
|
+
<zn-stepper
|
|
380
|
+
caption="Over Limit Example"
|
|
381
|
+
steps="5"
|
|
382
|
+
value="7"
|
|
383
|
+
show-progress>
|
|
384
|
+
</zn-stepper>
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
### Different Step Counts
|
|
388
|
+
|
|
389
|
+
Steppers work with any number of steps, from simple two-step processes to complex multi-step workflows.
|
|
390
|
+
|
|
391
|
+
```html:preview
|
|
392
|
+
<zn-stepper caption="Two Steps" steps="2" value="1" show-progress></zn-stepper>
|
|
393
|
+
<br />
|
|
394
|
+
<zn-stepper caption="Five Steps" steps="5" value="3" show-progress></zn-stepper>
|
|
395
|
+
<br />
|
|
396
|
+
<zn-stepper caption="Ten Steps" steps="10" value="6" show-progress></zn-stepper>
|
|
397
|
+
<br />
|
|
398
|
+
<zn-stepper caption="Twenty Steps" steps="20" value="15" show-progress></zn-stepper>
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
## Customization
|
|
402
|
+
|
|
403
|
+
### Styling with CSS
|
|
404
|
+
|
|
405
|
+
Customize the appearance of the stepper using CSS custom properties and standard CSS.
|
|
406
|
+
|
|
407
|
+
```html:preview
|
|
408
|
+
<zn-stepper
|
|
409
|
+
class="custom-stepper"
|
|
410
|
+
label="Custom Styled Stepper"
|
|
411
|
+
caption="With Custom Colors"
|
|
412
|
+
steps="5"
|
|
413
|
+
value="3"
|
|
414
|
+
show-progress>
|
|
415
|
+
</zn-stepper>
|
|
416
|
+
|
|
417
|
+
<style>
|
|
418
|
+
.custom-stepper .step-progress {
|
|
419
|
+
background-color: rgb(var(--zn-success));
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.custom-stepper .step {
|
|
423
|
+
background-color: rgba(var(--zn-success), 0.3);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.custom-stepper .header {
|
|
427
|
+
color: rgb(var(--zn-success));
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.custom-stepper .label {
|
|
431
|
+
font-weight: 700;
|
|
432
|
+
}
|
|
433
|
+
</style>
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
### Themed Steppers
|
|
437
|
+
|
|
438
|
+
Create themed steppers for different use cases or states.
|
|
439
|
+
|
|
440
|
+
```html:preview
|
|
441
|
+
<zn-stepper
|
|
442
|
+
class="success-stepper"
|
|
443
|
+
caption="Success State"
|
|
444
|
+
steps="4"
|
|
445
|
+
value="4"
|
|
446
|
+
show-progress>
|
|
447
|
+
</zn-stepper>
|
|
448
|
+
<br />
|
|
449
|
+
<zn-stepper
|
|
450
|
+
class="warning-stepper"
|
|
451
|
+
caption="Warning State"
|
|
452
|
+
steps="4"
|
|
453
|
+
value="2"
|
|
454
|
+
show-progress>
|
|
455
|
+
</zn-stepper>
|
|
456
|
+
<br />
|
|
457
|
+
<zn-stepper
|
|
458
|
+
class="error-stepper"
|
|
459
|
+
caption="Error State"
|
|
460
|
+
steps="4"
|
|
461
|
+
value="1"
|
|
462
|
+
show-progress>
|
|
463
|
+
</zn-stepper>
|
|
464
|
+
|
|
465
|
+
<style>
|
|
466
|
+
.success-stepper .step-progress {
|
|
467
|
+
background-color: rgb(var(--zn-success));
|
|
468
|
+
}
|
|
469
|
+
.success-stepper .step {
|
|
470
|
+
background-color: rgba(var(--zn-success), 0.3);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.warning-stepper .step-progress {
|
|
474
|
+
background-color: rgb(var(--zn-warning));
|
|
475
|
+
}
|
|
476
|
+
.warning-stepper .step {
|
|
477
|
+
background-color: rgba(var(--zn-warning), 0.3);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.error-stepper .step-progress {
|
|
481
|
+
background-color: rgb(var(--zn-error));
|
|
482
|
+
}
|
|
483
|
+
.error-stepper .step {
|
|
484
|
+
background-color: rgba(var(--zn-error), 0.3);
|
|
485
|
+
}
|
|
486
|
+
</style>
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
### Custom Height and Styling
|
|
490
|
+
|
|
491
|
+
Adjust the visual appearance of the stepper to match your design requirements.
|
|
492
|
+
|
|
493
|
+
```html:preview
|
|
494
|
+
<zn-stepper
|
|
495
|
+
class="large-stepper"
|
|
496
|
+
caption="Large Stepper"
|
|
497
|
+
steps="4"
|
|
498
|
+
value="2"
|
|
499
|
+
show-progress>
|
|
500
|
+
</zn-stepper>
|
|
501
|
+
|
|
502
|
+
<style>
|
|
503
|
+
.large-stepper .step-container {
|
|
504
|
+
height: 20px;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.large-stepper .step {
|
|
508
|
+
width: 24px;
|
|
509
|
+
height: 24px;
|
|
510
|
+
border-width: 4px;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.large-stepper .step-progress {
|
|
514
|
+
height: 12px;
|
|
515
|
+
top: 4px;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.large-stepper .step-line {
|
|
519
|
+
height: 4px;
|
|
520
|
+
}
|
|
521
|
+
</style>
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
## Wizard Patterns
|
|
525
|
+
|
|
526
|
+
### Using with Vertical Stepper
|
|
527
|
+
|
|
528
|
+
Combine horizontal and vertical steppers for comprehensive workflow navigation. The horizontal stepper shows overall progress while vertical steppers can show sub-steps within each main step.
|
|
529
|
+
|
|
530
|
+
```html:preview
|
|
531
|
+
<zn-stepper
|
|
532
|
+
label="Multi-Stage Process"
|
|
533
|
+
caption="Stage 2: Configuration"
|
|
534
|
+
steps="3"
|
|
535
|
+
value="2"
|
|
536
|
+
show-progress>
|
|
537
|
+
</zn-stepper>
|
|
538
|
+
<br /><br />
|
|
539
|
+
<zn-vertical-stepper caption="Database Setup" description="Configure database connection" first active></zn-vertical-stepper>
|
|
540
|
+
<zn-vertical-stepper caption="API Keys" description="Enter your API credentials" active></zn-vertical-stepper>
|
|
541
|
+
<zn-vertical-stepper caption="Deployment" description="Deploy to production" last></zn-vertical-stepper>
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
### Progressive Disclosure
|
|
545
|
+
|
|
546
|
+
Use steppers to guide users through complex forms with progressive disclosure of information.
|
|
547
|
+
|
|
548
|
+
```html:preview
|
|
549
|
+
<zn-stepper
|
|
550
|
+
id="disclosure-stepper"
|
|
551
|
+
label="Registration Process"
|
|
552
|
+
caption="Step 1 of 4"
|
|
553
|
+
steps="4"
|
|
554
|
+
value="1"
|
|
555
|
+
show-progress>
|
|
556
|
+
</zn-stepper>
|
|
557
|
+
<br />
|
|
558
|
+
<p>Steppers help break down complex multi-step processes into manageable chunks, improving user experience and reducing cognitive load.</p>
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
### Validation States
|
|
562
|
+
|
|
563
|
+
Combine steppers with validation feedback to show progress and validation status.
|
|
564
|
+
|
|
565
|
+
```html:preview
|
|
566
|
+
<zn-stepper
|
|
567
|
+
label="Form Validation"
|
|
568
|
+
caption="Step 2: Validation Required"
|
|
569
|
+
steps="3"
|
|
570
|
+
value="2"
|
|
571
|
+
show-progress>
|
|
572
|
+
</zn-stepper>
|
|
573
|
+
<br />
|
|
574
|
+
<zn-alert color="warning" open>
|
|
575
|
+
Please complete all required fields before proceeding to the next step.
|
|
576
|
+
</zn-alert>
|
|
577
|
+
```
|