@nanahoshi/mona-ui 0.25.1 → 0.26.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.
Files changed (233) hide show
  1. package/README.md +2 -0
  2. package/chart/README.md +2 -2
  3. package/command/package.json +4 -0
  4. package/docs/auto-complete.md +733 -0
  5. package/docs/avatar.md +220 -0
  6. package/docs/breadcrumb.md +320 -0
  7. package/docs/button-group.md +392 -0
  8. package/docs/button.md +256 -0
  9. package/docs/calendar.md +515 -0
  10. package/docs/card.md +292 -0
  11. package/docs/chart-bar.md +714 -0
  12. package/docs/chart-financial.md +567 -0
  13. package/docs/chart-funnel.md +546 -0
  14. package/docs/chart-heatmap.md +535 -0
  15. package/docs/chart-line-area.md +462 -0
  16. package/docs/chart-pie.md +645 -0
  17. package/docs/chart-radar.md +518 -0
  18. package/docs/chart-radial.md +658 -0
  19. package/docs/chart-scatter.md +479 -0
  20. package/docs/chart-treemap.md +651 -0
  21. package/docs/chart.md +2465 -0
  22. package/docs/checkbox.md +374 -0
  23. package/docs/chip.md +339 -0
  24. package/docs/circular-progress-bar.md +287 -0
  25. package/docs/collapsible.md +308 -0
  26. package/docs/color-gradient.md +336 -0
  27. package/docs/color-palette.md +317 -0
  28. package/docs/color-picker.md +387 -0
  29. package/docs/combo-box.md +764 -0
  30. package/docs/command.md +582 -0
  31. package/docs/contextmenu.md +530 -0
  32. package/docs/date-picker.md +251 -0
  33. package/docs/datetime-picker.md +284 -0
  34. package/docs/decimal-textbox.md +260 -0
  35. package/docs/dialog.md +822 -0
  36. package/docs/dropdown-button.md +507 -0
  37. package/docs/dropdown-list.md +779 -0
  38. package/docs/editor.md +374 -0
  39. package/docs/expansion-panel.md +348 -0
  40. package/docs/fieldset.md +217 -0
  41. package/docs/forms.md +162 -0
  42. package/docs/grid.md +2053 -0
  43. package/docs/input.md +197 -0
  44. package/docs/installation.md +54 -0
  45. package/docs/introduction.md +46 -0
  46. package/docs/label.md +340 -0
  47. package/docs/list-box.md +637 -0
  48. package/docs/list-view.md +584 -0
  49. package/docs/menubar.md +559 -0
  50. package/docs/multi-select.md +765 -0
  51. package/docs/notification.md +460 -0
  52. package/docs/numeric-textbox.md +301 -0
  53. package/docs/otp-input.md +539 -0
  54. package/docs/pager.md +513 -0
  55. package/docs/placeholder.md +176 -0
  56. package/docs/popover.md +423 -0
  57. package/docs/popup-menu.md +658 -0
  58. package/docs/popup.md +617 -0
  59. package/docs/progress-bar.md +368 -0
  60. package/docs/radio-button.md +451 -0
  61. package/docs/range-slider.md +367 -0
  62. package/docs/rating.md +518 -0
  63. package/docs/scroll-view.md +375 -0
  64. package/docs/segmented.md +434 -0
  65. package/docs/sheet.md +348 -0
  66. package/docs/sidebar.md +1126 -0
  67. package/docs/skeleton.md +181 -0
  68. package/docs/slider.md +423 -0
  69. package/docs/spinner.md +370 -0
  70. package/docs/split-button.md +522 -0
  71. package/docs/splitter.md +342 -0
  72. package/docs/stepper.md +539 -0
  73. package/docs/switch.md +340 -0
  74. package/docs/tabs.md +542 -0
  75. package/docs/textarea.md +196 -0
  76. package/docs/textbox.md +332 -0
  77. package/docs/theming.md +403 -0
  78. package/docs/time-picker.md +254 -0
  79. package/docs/tooltip-directive.md +340 -0
  80. package/docs/tooltip.md +321 -0
  81. package/docs/tree-view.md +1018 -0
  82. package/docs/window.md +663 -0
  83. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1 -1
  84. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +8 -0
  85. package/fesm2022/nanahoshi-mona-ui-button.mjs +12 -0
  86. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +5 -2
  87. package/fesm2022/nanahoshi-mona-ui-chart.mjs +212 -66
  88. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +4 -0
  89. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +4 -0
  90. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +16 -2
  91. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1 -1
  92. package/fesm2022/nanahoshi-mona-ui-command.mjs +924 -0
  93. package/fesm2022/nanahoshi-mona-ui-common.mjs +4 -0
  94. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +10 -6
  95. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +2 -1
  96. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +2 -1
  97. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +9 -5
  98. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +9 -5
  99. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +55 -1
  100. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3 -2
  101. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +13 -0
  102. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +5 -0
  103. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-2tVhD2hK.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs} +2 -2
  104. package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-BAN70Wcn.mjs → nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs} +5 -5
  105. package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-C_kCaA5b.mjs → nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs} +18 -35
  106. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-BsNfrAHz.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs} +5 -5
  107. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CEfVa7eo.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs} +4653 -4529
  108. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
  109. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +10 -0
  110. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +1 -0
  111. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +168 -0
  112. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +19 -1
  113. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +14 -0
  114. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +32 -0
  115. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +10 -0
  116. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +10 -0
  117. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +10 -0
  118. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +10 -0
  119. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +10 -0
  120. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +10 -0
  121. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +10 -0
  122. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +10 -0
  123. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +10 -0
  124. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +10 -0
  125. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +10 -0
  126. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +10 -0
  127. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +10 -0
  128. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +15 -8
  129. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +8 -5
  130. package/fesm2022/nanahoshi-mona-ui-notification.mjs +9 -0
  131. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1 -1
  132. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +5 -0
  133. package/fesm2022/nanahoshi-mona-ui-pager.mjs +2 -1
  134. package/fesm2022/nanahoshi-mona-ui-popover.mjs +14 -6
  135. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +48 -183
  136. package/fesm2022/nanahoshi-mona-ui-popup.mjs +16 -0
  137. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +4 -0
  138. package/fesm2022/nanahoshi-mona-ui-rating.mjs +2 -0
  139. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +1 -0
  140. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +5 -5
  141. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +1 -1
  142. package/fesm2022/nanahoshi-mona-ui-slider.mjs +7 -2
  143. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +9 -6
  144. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +18 -21
  145. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +11 -8
  146. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +9 -1
  147. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +2 -1
  148. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +16 -5
  149. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +13 -11
  150. package/fesm2022/nanahoshi-mona-ui-window.mjs +12 -5
  151. package/i18n/catalogs/en-US.messages.json +10 -0
  152. package/internal/popup-menu/package.json +4 -0
  153. package/llms.txt +133 -0
  154. package/locales/ar-sa/ar-sa.messages.json +10 -0
  155. package/locales/de-de/de-de.messages.json +10 -0
  156. package/locales/es-es/es-es.messages.json +10 -0
  157. package/locales/fr-fr/fr-fr.messages.json +10 -0
  158. package/locales/id-id/id-id.messages.json +10 -0
  159. package/locales/it-it/it-it.messages.json +10 -0
  160. package/locales/ja-jp/ja-jp.messages.json +10 -0
  161. package/locales/ko-kr/ko-kr.messages.json +10 -0
  162. package/locales/pt-br/pt-br.messages.json +10 -0
  163. package/locales/ru-ru/ru-ru.messages.json +10 -0
  164. package/locales/tr-tr/tr-tr.messages.json +10 -0
  165. package/locales/zh-cn/zh-cn.messages.json +10 -0
  166. package/locales/zh-tw/zh-tw.messages.json +10 -0
  167. package/package.json +9 -1
  168. package/types/nanahoshi-mona-ui-auto-complete.d.ts +1 -1
  169. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +8 -0
  170. package/types/nanahoshi-mona-ui-button.d.ts +12 -0
  171. package/types/nanahoshi-mona-ui-calendar.d.ts +3 -0
  172. package/types/nanahoshi-mona-ui-chart.d.ts +250 -20
  173. package/types/nanahoshi-mona-ui-check-box.d.ts +4 -0
  174. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +4 -0
  175. package/types/nanahoshi-mona-ui-collapsible.d.ts +10 -0
  176. package/types/nanahoshi-mona-ui-combo-box.d.ts +1 -1
  177. package/types/nanahoshi-mona-ui-command.d.ts +253 -0
  178. package/types/nanahoshi-mona-ui-common.d.ts +17 -1
  179. package/types/nanahoshi-mona-ui-contextmenu.d.ts +5 -2
  180. package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -1
  181. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +2 -1
  182. package/types/nanahoshi-mona-ui-dialog.d.ts +58 -1
  183. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +7 -3
  184. package/types/nanahoshi-mona-ui-dropdowns.d.ts +55 -1
  185. package/types/nanahoshi-mona-ui-editor.d.ts +31 -0
  186. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +13 -0
  187. package/types/nanahoshi-mona-ui-fieldset.d.ts +5 -0
  188. package/types/nanahoshi-mona-ui-grid.d.ts +162 -35
  189. package/types/nanahoshi-mona-ui-i18n.d.ts +144 -1
  190. package/types/nanahoshi-mona-ui-internal-list.d.ts +16 -1
  191. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +165 -0
  192. package/types/nanahoshi-mona-ui-internal-tree.d.ts +21 -2
  193. package/types/nanahoshi-mona-ui-internal.d.ts +4 -5
  194. package/types/nanahoshi-mona-ui-label.d.ts +1 -0
  195. package/types/nanahoshi-mona-ui-list-box.d.ts +27 -4
  196. package/types/nanahoshi-mona-ui-list-view.d.ts +34 -1
  197. package/types/nanahoshi-mona-ui-list.d.ts +1 -1
  198. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +10 -0
  199. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +10 -0
  200. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +10 -0
  201. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +10 -0
  202. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +10 -0
  203. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +10 -0
  204. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +10 -0
  205. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +10 -0
  206. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +10 -0
  207. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +10 -0
  208. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +10 -0
  209. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +10 -0
  210. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +10 -0
  211. package/types/nanahoshi-mona-ui-menubar.d.ts +10 -3
  212. package/types/nanahoshi-mona-ui-multi-select.d.ts +3 -3
  213. package/types/nanahoshi-mona-ui-notification.d.ts +9 -0
  214. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +1 -1
  215. package/types/nanahoshi-mona-ui-otp-input.d.ts +1 -0
  216. package/types/nanahoshi-mona-ui-pager.d.ts +5 -1
  217. package/types/nanahoshi-mona-ui-popover.d.ts +9 -1
  218. package/types/nanahoshi-mona-ui-popup-menu.d.ts +48 -161
  219. package/types/nanahoshi-mona-ui-popup.d.ts +16 -0
  220. package/types/nanahoshi-mona-ui-progress-bar.d.ts +4 -0
  221. package/types/nanahoshi-mona-ui-rating.d.ts +2 -0
  222. package/types/nanahoshi-mona-ui-segmented.d.ts +1 -0
  223. package/types/nanahoshi-mona-ui-sheet.d.ts +1 -1
  224. package/types/nanahoshi-mona-ui-slider.d.ts +2 -0
  225. package/types/nanahoshi-mona-ui-spinner.d.ts +7 -0
  226. package/types/nanahoshi-mona-ui-split-button.d.ts +7 -4
  227. package/types/nanahoshi-mona-ui-stepper.d.ts +11 -2
  228. package/types/nanahoshi-mona-ui-tabs.d.ts +4 -1
  229. package/types/nanahoshi-mona-ui-text-box.d.ts +9 -1
  230. package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -1
  231. package/types/nanahoshi-mona-ui-tooltip.d.ts +10 -2
  232. package/types/nanahoshi-mona-ui-tree-view.d.ts +6 -5
  233. package/types/nanahoshi-mona-ui-window.d.ts +66 -1
@@ -0,0 +1,539 @@
1
+ # Stepper
2
+
3
+ > Guides users through a sequential, multi-step process.
4
+
5
+ Entry point: `@nanahoshi/mona-ui/stepper`
6
+
7
+ **Selector:** `mona-stepper`
8
+
9
+ `StepperComponent` is a multi-step wizard control that guides users through a sequential process, displaying each step's status and progress along a shared track.
10
+
11
+ ## Overview
12
+
13
+ Use the Stepper when a task must be completed in a defined series of stages — a checkout flow, a configuration wizard, an onboarding sequence. The component enforces ordering rules, tracks the active step, and communicates progress through a built-in progress bar.
14
+
15
+ **Linear mode** (default) constrains navigation: the user can only move to the nearest enabled step before or after the current one. **Non-linear mode** lets users jump to any step freely. Individual steps can also be permanently disabled regardless of the current mode.
16
+
17
+ ## Import & Quick Start
18
+
19
+ ```typescript
20
+ import { StepperComponent } from "@nanahoshi/mona-ui/stepper";
21
+ import type { StepOptions } from "@nanahoshi/mona-ui/stepper";
22
+ ```
23
+
24
+ Add `StepperComponent` to your standalone component's `imports` array.
25
+
26
+ ```typescript
27
+ protected readonly steps: StepOptions[] = [
28
+ { label: "Account" },
29
+ { label: "Profile" },
30
+ { label: "Review" }
31
+ ];
32
+
33
+ protected readonly currentStep = signal(0);
34
+ ```
35
+
36
+ ```html
37
+ <mona-stepper [steps]="steps" [(step)]="currentStep"></mona-stepper>
38
+ ```
39
+
40
+ ## Anatomy
41
+
42
+ Each step renders an **indicator** (the numbered circle, which shows a check when the step is completed and an alert when it has errors) and a **label** (the text below or beside it). Three `ng-template` directives let you replace either part, or replace the entire step unit:
43
+
44
+ | Directive | Selector | Replaces |
45
+ | ----------------------------------- | ------------------------------------------- | --------------------------------------------- |
46
+ | `StepperIndicatorTemplateDirective` | `ng-template[monaStepperIndicatorTemplate]` | Content inside the indicator circle |
47
+ | `StepperLabelTemplateDirective` | `ng-template[monaStepperLabelTemplate]` | The step label text |
48
+ | `StepperStepTemplateDirective` | `ng-template[monaStepperStepTemplate]` | The entire step unit (indicator + label area) |
49
+
50
+ All three directives expose the same typed context (`StepperTemplateContext<T>`):
51
+
52
+ | Variable | Type | Description |
53
+ | ------------------------ | ---------------- | ----------------------------------------------------------- |
54
+ | `$implicit` (`let-step`) | `StepOptions<T>` | The step's options object |
55
+ | `active` | `boolean` | True when this step's index ≤ the current active step index |
56
+ | `currentIndex` | `number` | Zero-based index of the currently active step |
57
+ | `disabled` | `boolean` | Whether this step is disabled |
58
+ | `index` | `number` | Zero-based index of this step |
59
+ | `invalid` | `boolean` | Whether this step has errors |
60
+ | `state` | `StepState` | `current`, `completed`, `upcoming` or `disabled` |
61
+
62
+ Import all three alongside the component:
63
+
64
+ ```typescript
65
+ import {
66
+ StepperComponent,
67
+ StepperIndicatorTemplateDirective,
68
+ StepperLabelTemplateDirective,
69
+ StepperStepTemplateDirective
70
+ } from "@nanahoshi/mona-ui/stepper";
71
+ ```
72
+
73
+ ### Indicator template
74
+
75
+ Replaces only the icon or number inside the indicator circle. The circle element and its ARIA attributes are preserved.
76
+
77
+ ```html
78
+ <mona-stepper [steps]="steps" [(step)]="currentStep">
79
+ <ng-template monaStepperIndicatorTemplate let-step let-index="index" let-currentIndex="currentIndex">
80
+ @if (index < currentIndex) {
81
+ <svg lucideCheck [size]="16"></svg>
82
+ } @else { {{ index + 1 }} }
83
+ </ng-template>
84
+ </mona-stepper>
85
+ ```
86
+
87
+ ### Label template
88
+
89
+ Replaces the label span rendered beneath (horizontal) or beside (vertical) the indicator.
90
+
91
+ ```html
92
+ <mona-stepper [steps]="steps" [(step)]="currentStep">
93
+ <ng-template monaStepperLabelTemplate let-step let-active="active">
94
+ <span [class.font-bold]="active">{{ step.label }}</span>
95
+ </ng-template>
96
+ </mona-stepper>
97
+ ```
98
+
99
+ ### Step template
100
+
101
+ Replaces the entire visual step unit. The component wraps the projected content in a native `button` that preserves keyboard navigation and ARIA semantics, so put phrasing content in it, and no links or other controls. The button carries a focus outline, but anything else about how the state looks is up to the template.
102
+
103
+ ```html
104
+ <mona-stepper [steps]="steps" [(step)]="currentStep">
105
+ <ng-template monaStepperStepTemplate let-step let-active="active">
106
+ <span class="text-3xl" [class.text-primary]="active"> {{ active ? "●" : "○" }} </span>
107
+ </ng-template>
108
+ </mona-stepper>
109
+ ```
110
+
111
+ ## Examples
112
+
113
+ ### Back and Next buttons
114
+
115
+ `step` is a two-way model, so your own buttons can move it while the stepper shows where the user is.
116
+
117
+ `wizard-example.component.ts`
118
+
119
+ ```typescript
120
+ import { Component, signal } from "@angular/core";
121
+ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
122
+ import type { StepOptions } from "@nanahoshi/mona-ui/stepper";
123
+ import { StepperComponent } from "@nanahoshi/mona-ui/stepper";
124
+
125
+ @Component({
126
+ selector: "app-stepper-wizard-example",
127
+ imports: [ButtonDirective, StepperComponent],
128
+ templateUrl: "./wizard-example.component.html"
129
+ })
130
+ export class StepperWizardExampleComponent {
131
+ protected readonly currentStep = signal(0);
132
+ protected readonly descriptions = [
133
+ "Check the items in your cart.",
134
+ "Enter the delivery address.",
135
+ "Choose how to pay.",
136
+ "Review the order and place it."
137
+ ];
138
+ protected readonly steps: StepOptions[] = [
139
+ { label: "Cart" },
140
+ { label: "Address" },
141
+ { label: "Payment" },
142
+ { label: "Review" }
143
+ ];
144
+ }
145
+ ```
146
+
147
+ `wizard-example.component.html`
148
+
149
+ ```html
150
+ <div class="flex flex-col gap-4">
151
+ <mona-stepper aria-label="Checkout" [steps]="steps" [(step)]="currentStep" />
152
+
153
+ <p class="text-sm">{{ descriptions[currentStep()] }}</p>
154
+
155
+ <div class="flex gap-2">
156
+ <button monaButton type="button" [disabled]="currentStep() === 0" (click)="currentStep.set(currentStep() - 1)">
157
+ Back
158
+ </button>
159
+ <button
160
+ monaButton
161
+ look="primary"
162
+ type="button"
163
+ [disabled]="currentStep() === steps.length - 1"
164
+ (click)="currentStep.set(currentStep() + 1)">
165
+ Next
166
+ </button>
167
+ </div>
168
+ </div>
169
+ ```
170
+
171
+ ### Non-linear mode with step states
172
+
173
+ With `[linear]="false"` any enabled step can be chosen. The first step is `invalid`, the third is `disabled`, and the fourth is `completed` ahead of the current step.
174
+
175
+ `step-states-example.component.ts`
176
+
177
+ ```typescript
178
+ import { Component, signal } from "@angular/core";
179
+ import type { StepOptions } from "@nanahoshi/mona-ui/stepper";
180
+ import { StepperComponent } from "@nanahoshi/mona-ui/stepper";
181
+
182
+ @Component({
183
+ selector: "app-stepper-step-states-example",
184
+ imports: [StepperComponent],
185
+ templateUrl: "./step-states-example.component.html"
186
+ })
187
+ export class StepperStepStatesExampleComponent {
188
+ protected readonly currentStep = signal(1);
189
+ protected readonly steps: StepOptions[] = [
190
+ { label: "Details", invalid: true },
191
+ { label: "Team" },
192
+ { label: "Billing", disabled: true },
193
+ { label: "Integrations", completed: true },
194
+ { label: "Review" }
195
+ ];
196
+ }
197
+ ```
198
+
199
+ `step-states-example.component.html`
200
+
201
+ ```html
202
+ <div class="flex flex-col gap-3">
203
+ <mona-stepper aria-label="Project setup" [linear]="false" [steps]="steps" [(step)]="currentStep" />
204
+ <p class="text-sm">Current step: {{ steps[currentStep()].label }}</p>
205
+ </div>
206
+ ```
207
+
208
+ ### Disabled steps
209
+
210
+ Set `disabled: true` on individual steps to permanently block activation regardless of linear mode. Disabled steps are skipped during keyboard arrow navigation, and a linear stepper counts the step after one as adjacent, so it never gets stuck behind it.
211
+
212
+ ```typescript
213
+ protected readonly steps: StepOptions[] = [
214
+ { label: "Account" },
215
+ { label: "Suspended", disabled: true },
216
+ { label: "Review" }
217
+ ];
218
+ ```
219
+
220
+ ### Stopping a step change
221
+
222
+ `stepSelect` fires before a click or key changes the step, and the keys that change it are `Enter` and `Space`, since the arrows only move focus. Call `preventDefault()` to stay where you are, for example while the current step's form is invalid. It's a veto rather than a correction, so there's no flicker to undo. It doesn't fire when `step` is written from outside, so it can't veto your own Next and Back buttons, or for a click on the current or a locked step.
223
+
224
+ `veto-example.component.ts`
225
+
226
+ ```typescript
227
+ import { Component, signal } from "@angular/core";
228
+ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
229
+ import type { StepOptions, StepSelectEvent } from "@nanahoshi/mona-ui/stepper";
230
+ import { StepperComponent } from "@nanahoshi/mona-ui/stepper";
231
+
232
+ @Component({
233
+ selector: "app-stepper-veto-example",
234
+ imports: [ButtonDirective, StepperComponent],
235
+ templateUrl: "./veto-example.component.html"
236
+ })
237
+ export class StepperVetoExampleComponent {
238
+ protected readonly accountDone = signal(false);
239
+ protected readonly currentStep = signal(0);
240
+ protected readonly message = signal("");
241
+ protected readonly steps: StepOptions[] = [{ label: "Account" }, { label: "Profile" }, { label: "Done" }];
242
+
243
+ /** Going forward from the first step waits until it's filled in. Going back is always allowed. */
244
+ protected select(event: StepSelectEvent): void {
245
+ if (event.previousIndex === 0 && event.index > 0 && !this.accountDone()) {
246
+ event.preventDefault();
247
+ this.message.set("Fill in the account details first.");
248
+ return;
249
+ }
250
+ this.message.set("");
251
+ }
252
+ }
253
+ ```
254
+
255
+ `veto-example.component.html`
256
+
257
+ ```html
258
+ <div class="flex flex-col gap-3">
259
+ <mona-stepper aria-label="Sign-up" [steps]="steps" [(step)]="currentStep" (stepSelect)="select($event)" />
260
+ <div class="flex items-center gap-3">
261
+ <button monaButton type="button" [toggleable]="true" [(selected)]="accountDone">Account details filled in</button>
262
+ <span aria-live="polite" class="text-sm">{{ message() }}</span>
263
+ </div>
264
+ </div>
265
+ ```
266
+
267
+ ### Step states
268
+
269
+ Steps before the current one count as completed. Set `completed` when that isn't true: `false` for a step that was passed without being finished, `true` for one finished ahead of the current step. Set `invalid` on a step with errors. Both show on the indicator, and are read out as part of the step's description.
270
+
271
+ ```typescript
272
+ protected readonly steps = computed<StepOptions[]>(() => [
273
+ { label: "Account", invalid: this.accountForm().invalid() },
274
+ { label: "Profile", completed: this.profileForm().valid() },
275
+ { label: "Review" }
276
+ ]);
277
+ ```
278
+
279
+ | State | Looks like |
280
+ | ----------- | --------------------------------------------------------------- |
281
+ | `current` | Filled, with a ring around it and a heavier label |
282
+ | `completed` | Filled, with a check in place of the number |
283
+ | `upcoming` | Outlined, with the number |
284
+ | `disabled` | Muted, with a dashed border and a muted label |
285
+ | `invalid` | An alert icon and an error-colored border, on top of the others |
286
+
287
+ There's no optional state. To mark a step as optional, say so in its `label`.
288
+
289
+ ### Step values
290
+
291
+ `step` is normalized once there are steps to measure it against: below zero becomes the first step, past the end becomes the last, and a fraction is cut to a whole number. With `[(step)]` the corrected value comes back to you through `stepChange`. Writing `step` can land on a disabled step, because that's the application's decision, and it then shows as current.
292
+
293
+ ### Focus
294
+
295
+ The stepper moves focus only in response to its own keys. Rendering it, or changing `step` from your own Next and Back buttons, leaves focus where it is.
296
+
297
+ ### Vertical orientation
298
+
299
+ In vertical mode, `ArrowUp` and `ArrowDown` replace `ArrowLeft` and `ArrowRight`. Set a fixed height on the host or a containing element. This one also uses an indicator template to show an icon for each step.
300
+
301
+ `vertical-example.component.ts`
302
+
303
+ ```typescript
304
+ import { Component, signal } from "@angular/core";
305
+ import { LucideCheck, LucideCreditCard, LucideDynamicIcon, LucideShoppingCart, LucideTruck } from "@lucide/angular";
306
+ import type { StepOptions } from "@nanahoshi/mona-ui/stepper";
307
+ import { StepperComponent, StepperIndicatorTemplateDirective } from "@nanahoshi/mona-ui/stepper";
308
+
309
+ @Component({
310
+ selector: "app-stepper-vertical-example",
311
+ imports: [LucideCheck, LucideDynamicIcon, StepperComponent, StepperIndicatorTemplateDirective],
312
+ templateUrl: "./vertical-example.component.html"
313
+ })
314
+ export class StepperVerticalExampleComponent {
315
+ protected readonly currentStep = signal(1);
316
+ protected readonly icons = [LucideShoppingCart, LucideCreditCard, LucideTruck];
317
+ protected readonly steps: StepOptions[] = [{ label: "Cart" }, { label: "Payment" }, { label: "Shipping" }];
318
+ }
319
+ ```
320
+
321
+ `vertical-example.component.html`
322
+
323
+ ```html
324
+ <div class="h-72">
325
+ <mona-stepper aria-label="Delivery" orientation="vertical" [steps]="steps" [(step)]="currentStep">
326
+ <ng-template let-index="index" let-state="state" monaStepperIndicatorTemplate>
327
+ @if (state === "completed") {
328
+ <svg lucideCheck aria-hidden="true" [size]="16"></svg>
329
+ } @else {
330
+ <svg aria-hidden="true" [lucideIcon]="icons[index]" [size]="16"></svg>
331
+ }
332
+ </ng-template>
333
+ </mona-stepper>
334
+ </div>
335
+ ```
336
+
337
+ ### Rounded presets
338
+
339
+ | `rounded` | Shape |
340
+ | --------- | ------------------ |
341
+ | `none` | Square corners |
342
+ | `small` | Slightly rounded |
343
+ | `medium` | Moderately rounded |
344
+ | `large` | Generously rounded |
345
+ | `full` | Circular (default) |
346
+
347
+ ### Attaching data to steps
348
+
349
+ `StepOptions.data` accepts any value and is available in all template contexts as `step.data`.
350
+
351
+ ```typescript
352
+ protected readonly steps: StepOptions<{ icon: string }>[] = [
353
+ { label: "Cart", data: { icon: "shopping-cart" } },
354
+ { label: "Payment", data: { icon: "credit-card" } }
355
+ ];
356
+ ```
357
+
358
+ ## Behavior
359
+
360
+ - `"completed" | "current" | "disabled" | "upcoming"`. `current` outranks the others, and `disabled` outranks `completed` and `upcoming`.
361
+
362
+ ## Accessibility
363
+
364
+ ### Keyboard map
365
+
366
+ | Key | Action |
367
+ | -------------------------------------------------- | ----------------------------------------- |
368
+ | `ArrowLeft` (horizontal) / `ArrowUp` (vertical) | Move focus to the previous reachable step |
369
+ | `ArrowRight` (horizontal) / `ArrowDown` (vertical) | Move focus to the next reachable step |
370
+ | `Home` | Move focus to the first reachable step |
371
+ | `End` | Move focus to the last reachable step |
372
+ | `Enter` / `Space` | Activate the step that has focus |
373
+
374
+ A reachable step is one you could activate: never a disabled step, and in linear mode only the nearest enabled steps on either side of the current one. In a right-to-left layout, `ArrowLeft` and `ArrowRight` swap. The stepper uses a **roving tabindex** pattern — only one step has `tabindex="0"`. These keys only count on the step buttons, without `Alt`, `Ctrl`, `Meta` or `Shift`, so a control in a label template keeps its own keys and clicks.
375
+
376
+ ### ARIA attributes
377
+
378
+ | Attribute | Element | When | Value |
379
+ | --------------------------------- | ------------------------- | -------------------------------- | -------------------------------------------------------- |
380
+ | `role="group"` | Host | Always | — |
381
+ | `aria-label` | Host | Always | `aria-label` input, or the `stepper` message |
382
+ | Native `button` | Each step indicator | Always | — |
383
+ | `aria-label` | Each step indicator | Always | Step's `label` string |
384
+ | `aria-describedby` | Each step indicator | Always | Hidden text: position, completed and errors |
385
+ | `aria-current="step"` | Active step indicator | When this step is active | `"step"` |
386
+ | `aria-disabled="true"` | Locked/disabled indicator | When locked (linear) or disabled | `true` |
387
+ | `tabindex="0"` | The step's Tab stop | One step at a time | `0` |
388
+ | `tabindex="-1"` | All other indicators | Otherwise | `-1` |
389
+ | `role="list"` | The `<ol>` | Always | — |
390
+ | `role="progressbar"` | Progress track | Always | — |
391
+ | `aria-valuenow` | Progress track | Always | Current step index |
392
+ | `aria-valuetext` | Progress track | With steps | `stepPosition` message, such as "Step 2 of 4" |
393
+ | `aria-valuemin` / `aria-valuemax` | Progress track | Always | `0` / total steps minus one |
394
+ | `aria-label` | Progress track | Always | `progressAriaLabel` input, or the `stepProgress` message |
395
+
396
+ Both names are localized when you leave the inputs empty: the `stepper` message is "Progress" in English, and `stepProgress` is "Step progress".
397
+
398
+ **Consumer responsibilities:**
399
+
400
+ - Provide a meaningful `aria-label` when context does not already identify the stepper's purpose.
401
+ - All `label` fields in `StepOptions` are required and become the accessible name for each indicator.
402
+ - A custom step or indicator template replaces the check and alert icons, so show `state` and `invalid` in it some way other than color.
403
+
404
+ ## API
405
+
406
+ Everything below is imported from `@nanahoshi/mona-ui/stepper`.
407
+
408
+ ### `StepperComponent`
409
+
410
+ **Selector:** `mona-stepper`
411
+
412
+ #### Inputs
413
+
414
+ | Name | Type | Default | Description |
415
+ | --- | --- | --- | --- |
416
+ | `aria-label` | `string` | `""` | Sets the accessible label for the stepper group. |
417
+ | `linear` | `boolean` | `true` | Sets the flow of the stepper. If set to true, the user will only be able to navigate to the previous or the next step. |
418
+ | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Sets the orientation of the stepper. |
419
+ | `progressAriaLabel` | `string` | `""` | Sets the accessible label for the progress bar element. |
420
+ | `rounded` | `"full" \| "large" \| "medium" \| "none" \| "small"` | `"full"` | Sets the roundness of the stepper steps. |
421
+ | `step` (two-way) | `number` | `0` | Sets the active step of the stepper. |
422
+ | `steps` | `Iterable<StepOptions>` | `[]` | Sets the steps of the stepper. |
423
+
424
+ #### Outputs
425
+
426
+ | Name | Type | Description |
427
+ | --- | --- | --- |
428
+ | `stepChange` | `number` | Emitted when `step` changes. |
429
+ | `stepSelect` | `StepSelectEvent<unknown>` | Emitted before a click or key changes the step. Call `preventDefault()` to stay on the current step, for example while its form is invalid. It doesn't fire when `step` is written from outside. |
430
+
431
+ ### `StepperIndicatorTemplateDirective`
432
+
433
+ Marks an ng-template as the custom indicator template for mona-stepper.
434
+ The template context provides the step options, index, active state, and current step index.
435
+
436
+ **Selector:** `ng-template[monaStepperIndicatorTemplate]`
437
+
438
+ ### `StepperLabelTemplateDirective`
439
+
440
+ Marks an ng-template as the custom label template for mona-stepper.
441
+ The template context provides the step options, index, active state, and current step index.
442
+
443
+ **Selector:** `ng-template[monaStepperLabelTemplate]`
444
+
445
+ ### `StepperStepTemplateDirective`
446
+
447
+ Marks an ng-template as the custom step template for mona-stepper.
448
+ When provided, this template replaces the entire default step indicator and label for each step.
449
+ The template context provides the step options, index, active state, and current step index.
450
+
451
+ **Selector:** `ng-template[monaStepperStepTemplate]`
452
+
453
+ ### `StepSelectEvent`
454
+
455
+ What `mona-stepper` reports before a click or key changes the step. Call `preventDefault()` to stay on the current step.
456
+
457
+ **Type parameters:** `T = unknown`
458
+ **Extends:** `PreventableEvent`
459
+
460
+ #### Properties
461
+
462
+ | Name | Type | Description |
463
+ | --- | --- | --- |
464
+ | `index` (read-only) | `number` | Zero-based index of the step being selected. |
465
+ | `previousIndex` (read-only) | `number` | Zero-based index of the step that is current now. |
466
+ | `step` (read-only) | `StepOptions<T>` | The options of the step being selected. |
467
+
468
+ ### Types
469
+
470
+ #### `STEPPER_DEFAULT_MESSAGES`
471
+
472
+ ```typescript
473
+ const STEPPER_DEFAULT_MESSAGES: MonaStepperMessages;
474
+ ```
475
+
476
+ #### `StepOptions`
477
+
478
+ **Type parameters:** `T = unknown`
479
+
480
+ | Name | Type | Description |
481
+ | --- | --- | --- |
482
+ | `completed?` | `boolean` | Whether the step is finished. When left unset, the steps before the current one count as completed. Set it when a step can be passed without being finished, or finished ahead of the current one. |
483
+ | `data?` | `T` | Optional arbitrary data attached to this step. |
484
+ | `disabled?` | `boolean` | When true, the step cannot be activated by click or keyboard regardless of linear mode. |
485
+ | `invalid?` | `boolean` | When true, the step shows and announces that it has errors. |
486
+ | `label` | `string` | Display label shown beneath the step indicator. |
487
+
488
+ #### `StepperTemplateContext`
489
+
490
+ **Type parameters:** `T = unknown`
491
+
492
+ | Name | Type | Description |
493
+ | --- | --- | --- |
494
+ | `$implicit` | `StepOptions<T>` | The step's options object (also available as the implicit binding). |
495
+ | `active` | `boolean` | True when this step's index is less than or equal to the current active step index. |
496
+ | `currentIndex` | `number` | Zero-based index of the currently active step. |
497
+ | `disabled` | `boolean` | Whether this step is disabled and cannot be activated. |
498
+ | `index` | `number` | Zero-based index of this step. |
499
+ | `invalid` | `boolean` | Whether this step has errors. |
500
+ | `state` | `StepState` | Where this step stands: `current`, `completed`, `upcoming` or `disabled`. |
501
+
502
+ #### `StepState`
503
+
504
+ Where a step stands. `current` outranks the others, and `disabled` outranks `completed` and `upcoming`. Invalid is
505
+ separate, because a step of any state can have errors.
506
+
507
+ ```typescript
508
+ type StepState = "completed" | "current" | "disabled" | "upcoming";
509
+ ```
510
+
511
+ #### `MonaStepperMessages`
512
+
513
+ From `@nanahoshi/mona-ui/i18n`.
514
+
515
+ | Name | Type |
516
+ | --- | --- |
517
+ | `stepCompleted` (read-only) | `string` |
518
+ | `stepInvalid` (read-only) | `string` |
519
+ | `stepper` (read-only) | `string` |
520
+ | `stepPosition` (read-only) | `(current: number, total: number) => string` |
521
+ | `stepProgress` (read-only) | `string` |
522
+
523
+ #### `PreventableEvent`
524
+
525
+ From `@nanahoshi/mona-ui/common`.
526
+
527
+ **Type parameters:** `E extends Event = Event`
528
+
529
+ | Name | Type | Description |
530
+ | --- | --- | --- |
531
+ | `originalEvent` (read-only) | `E \| undefined` | The DOM event that caused this one, when there is one. |
532
+ | `type` (read-only) | `string \| undefined` | A name for the kind of event, when the component that emits it sets one. |
533
+
534
+ **Methods**
535
+
536
+ | Signature | Description |
537
+ | --- | --- |
538
+ | `isDefaultPrevented(): boolean` | Whether `preventDefault()` was called. |
539
+ | `preventDefault(): void` | Cancels what the event announces, such as opening or closing a popup, or closing a dialog. |