@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,375 @@
1
+ # Scroll View
2
+
3
+ > A fixed-size carousel that pages through a collection one item at a time.
4
+
5
+ Entry point: `@nanahoshi/mona-ui/scroll-view`
6
+
7
+ **Selector:** `mona-scroll-view`
8
+
9
+ `ScrollViewComponent` renders a fixed-size carousel that pages through a data collection one item at a time, with optional navigation arrows, a dot pager, and animated slide transitions.
10
+
11
+ ## Overview
12
+
13
+ Use `ScrollViewComponent` when you need to display a sequence of items — images, cards, or content panels — and the user navigates between them one at a time within a fixed viewport. The component requires explicit `height` and `width` values and renders exactly one item per view.
14
+
15
+ > `ScrollViewComponent` is not a form control. It does not implement `ControlValueAccessor` or any signal forms interface.
16
+
17
+ ## Import & Quick Start
18
+
19
+ ```typescript
20
+ import { ScrollViewComponent } from "@nanahoshi/mona-ui/scroll-view";
21
+ ```
22
+
23
+ A slide template projected inside `<mona-scroll-view>` is required. Without it, no content is rendered inside each slide. Mark it with `monaScrollViewSlide`, and bind the directive to the same data so `let-item` takes its type from it. Name the carousel with `aria-label` or `aria-labelledby`.
24
+
25
+ ```typescript
26
+ import { ScrollViewComponent, ScrollViewSlideDirective } from "@nanahoshi/mona-ui/scroll-view";
27
+ ```
28
+
29
+ ```html
30
+ <mona-scroll-view aria-label="Product photos" [data]="images" width="640px" height="360px" [pageable]="true">
31
+ <ng-template [monaScrollViewSlide]="images" let-image>
32
+ <img [src]="image.url" [alt]="image.description" class="w-full h-full object-cover" />
33
+ </ng-template>
34
+ </mona-scroll-view>
35
+ ```
36
+
37
+ A bare `ng-template` still works, with `let-item` untyped. It takes the first template in the content, so it's better to mark the one you mean.
38
+
39
+ ### Slide template context
40
+
41
+ Each slide renders the projected template with the following context variables:
42
+
43
+ | Variable | Type | Description |
44
+ |--------------------------------|-----------|------------------------------------------------------|
45
+ | `$implicit` (e.g., `let-item`) | `unknown` | The current data item from the `data` collection. |
46
+ | `width` | `number` | Width of the content area in pixels. Follows resizes, and is `0` until the first measurement. |
47
+ | `height` | `number` | Height of the content area in pixels. Follows resizes, and is `0` until the first measurement. |
48
+
49
+ ```html
50
+ <mona-scroll-view [data]="panels" width="100%" height="400px">
51
+ <ng-template let-panel let-w="width" let-h="height">
52
+ <div [style.width.px]="w" [style.height.px]="h">{{ panel.title }}</div>
53
+ </ng-template>
54
+ </mona-scroll-view>
55
+ ```
56
+
57
+ ## Examples
58
+
59
+ ### Arrows and dot pager
60
+
61
+ `arrows-pager-example.component.ts`
62
+
63
+ ```typescript
64
+ import { Component } from "@angular/core";
65
+ import { ScrollViewComponent, ScrollViewSlideDirective } from "@nanahoshi/mona-ui/scroll-view";
66
+
67
+ @Component({
68
+ selector: "app-scroll-view-arrows-pager-example",
69
+ imports: [ScrollViewComponent, ScrollViewSlideDirective],
70
+ templateUrl: "./arrows-pager-example.component.html"
71
+ })
72
+ export class ScrollViewArrowsPagerExampleComponent {
73
+ protected readonly highlights = [
74
+ { text: "Up to 20 hours on a single charge.", title: "All-day battery" },
75
+ { text: "Rated for rain, dust and the odd drop.", title: "Built to last" },
76
+ { text: "Pairs with your phone in seconds.", title: "Easy setup" },
77
+ { text: "Two years of repairs, no questions asked.", title: "Covered" }
78
+ ];
79
+ }
80
+ ```
81
+
82
+ `arrows-pager-example.component.html`
83
+
84
+ ```html
85
+ <mona-scroll-view
86
+ aria-label="Product highlights"
87
+ height="200px"
88
+ pagerOverlay="dark"
89
+ pagerRounded="full"
90
+ width="100%"
91
+ [arrows]="true"
92
+ [data]="highlights"
93
+ [pageable]="true">
94
+ <ng-template let-highlight [monaScrollViewSlide]="highlights">
95
+ <div class="flex h-full flex-col items-center justify-center gap-1 bg-secondary px-12 text-center text-secondary-foreground">
96
+ <p class="text-lg font-semibold">{{ highlight.title }}</p>
97
+ <p class="text-sm">{{ highlight.text }}</p>
98
+ </div>
99
+ </ng-template>
100
+ </mona-scroll-view>
101
+ ```
102
+
103
+ In finite mode, the left arrow is hidden on the first page and the right arrow is hidden on the last page. If the arrow that hides has focus, focus moves to the other arrow. In infinite mode, both arrows remain visible at all times.
104
+
105
+ When the number of dots exceeds the pager bar width, scroll arrows appear automatically on the pager bar to let the user scroll the dot list horizontally. The active dot is kept centered in the list, however the page changed. Only the list scrolls, so the pager doesn't move the page to itself.
106
+
107
+ `pagerOverlay="dark"` uses the theme's canvas color, which isn't dark in a light theme, and `"light"` uses its overlay surface color. So the names don't promise a shade. Check the strip against your slides in each theme you ship.
108
+
109
+ ### Swipe
110
+
111
+ A touch or pen swipe of 40 px or more, mostly sideways, changes the slide, reversed in RTL. Vertical scrolling and pinch zoom stay with the browser, a mouse drag stays text selection, and a drag that starts on a text field or a slider stays with that control. Swipes are always on, but `arrows` and `pageable` are off by default, and WCAG needs a way to change the slide without a gesture (2.5.1 Pointer Gestures), so turn on at least one of them.
112
+
113
+ ### Infinite loop
114
+
115
+ In infinite mode, navigating past the last item wraps to the first, and navigating before the first wraps to the last.
116
+
117
+ `infinite-example.component.ts`
118
+
119
+ ```typescript
120
+ import { Component } from "@angular/core";
121
+ import { ScrollViewComponent, ScrollViewSlideDirective } from "@nanahoshi/mona-ui/scroll-view";
122
+
123
+ @Component({
124
+ selector: "app-scroll-view-infinite-example",
125
+ imports: [ScrollViewComponent, ScrollViewSlideDirective],
126
+ templateUrl: "./infinite-example.component.html"
127
+ })
128
+ export class ScrollViewInfiniteExampleComponent {
129
+ protected readonly quotes = [
130
+ { author: "Priya, team lead", text: "We moved our whole board over in an afternoon." },
131
+ { author: "Tomás, designer", text: "The keyboard shortcuts alone saved me hours." },
132
+ { author: "Mei, support", text: "Our customers notice how fast it is." }
133
+ ];
134
+ }
135
+ ```
136
+
137
+ `infinite-example.component.html`
138
+
139
+ ```html
140
+ <mona-scroll-view
141
+ aria-label="Customer quotes"
142
+ height="160px"
143
+ width="100%"
144
+ [arrows]="true"
145
+ [data]="quotes"
146
+ [infinite]="true">
147
+ <ng-template let-quote [monaScrollViewSlide]="quotes">
148
+ <figure class="flex h-full flex-col items-center justify-center gap-2 bg-secondary px-12 text-center text-secondary-foreground">
149
+ <blockquote class="text-sm">“{{ quote.text }}”</blockquote>
150
+ <figcaption class="text-xs font-semibold">{{ quote.author }}</figcaption>
151
+ </figure>
152
+ </ng-template>
153
+ </mona-scroll-view>
154
+ ```
155
+
156
+ ### Two-way page binding
157
+
158
+ `two-way-example.component.ts`
159
+
160
+ ```typescript
161
+ import { Component, signal } from "@angular/core";
162
+ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
163
+ import { ScrollViewComponent, ScrollViewSlideDirective } from "@nanahoshi/mona-ui/scroll-view";
164
+
165
+ @Component({
166
+ selector: "app-scroll-view-two-way-example",
167
+ imports: [ButtonDirective, ScrollViewComponent, ScrollViewSlideDirective],
168
+ templateUrl: "./two-way-example.component.html"
169
+ })
170
+ export class ScrollViewTwoWayExampleComponent {
171
+ protected readonly page = signal(0);
172
+ protected readonly steps = [
173
+ "Create a project and give it a name.",
174
+ "Invite the people you work with.",
175
+ "Add your first task and assign it."
176
+ ];
177
+ }
178
+ ```
179
+
180
+ `two-way-example.component.html`
181
+
182
+ ```html
183
+ <div class="flex flex-col gap-3">
184
+ <mona-scroll-view
185
+ aria-label="Getting started"
186
+ height="160px"
187
+ width="100%"
188
+ [data]="steps"
189
+ [pageable]="true"
190
+ [(index)]="page">
191
+ <ng-template let-step [monaScrollViewSlide]="steps">
192
+ <div class="flex h-full items-center justify-center bg-secondary px-12 text-center text-secondary-foreground">
193
+ <p class="text-sm">{{ step }}</p>
194
+ </div>
195
+ </ng-template>
196
+ </mona-scroll-view>
197
+ <div class="flex items-center gap-3">
198
+ <button monaButton type="button" [disabled]="page() === 0" (click)="page.set(0)">Start over</button>
199
+ <span class="text-sm">Step {{ page() + 1 }} of {{ steps.length }}</span>
200
+ </div>
201
+ </div>
202
+ ```
203
+
204
+ `index` is a two-way model. Setting it programmatically navigates to that zero-based page index. A value outside the range is brought back to the first or last page, or wrapped in infinite mode, and the corrected value comes back through `indexChange`.
205
+
206
+ ### Animation control
207
+
208
+ ```html
209
+ <mona-scroll-view [data]="items" width="640px" height="360px" [animate]="true">
210
+ <ng-template let-item>{{ item }}</ng-template>
211
+ </mona-scroll-view>
212
+
213
+ <mona-scroll-view [data]="items" width="640px" height="360px" [animate]="false">
214
+ <ng-template let-item>{{ item }}</ng-template>
215
+ </mona-scroll-view>
216
+
217
+ <mona-scroll-view [data]="items" width="640px" height="360px" [animate]="250">
218
+ <ng-template let-item>{{ item }}</ng-template>
219
+ </mona-scroll-view>
220
+ ```
221
+
222
+ Users who enable `prefers-reduced-motion` in their OS settings will see animation duration reduced to 1 ms regardless of the configured value.
223
+
224
+ ## Accessibility
225
+
226
+ ### ARIA roles and attributes
227
+
228
+ `ScrollViewComponent` manages the following attributes automatically:
229
+
230
+ **Host element**
231
+
232
+ | Attribute | Value |
233
+ |------------------------|-----------------------------------------------|
234
+ | `role` | `"region"` when named, otherwise `"group"` |
235
+ | `aria-roledescription` | `"carousel"`, while it has slides |
236
+ | `aria-label` | From the `aria-label` input |
237
+ | `aria-labelledby` | From the `aria-labelledby` input |
238
+ | `tabindex` | `0`, while it has slides |
239
+
240
+ Give every carousel a name that says what it shows. Two regions on a page need different names, and a warning is logged in development when there's no name at all.
241
+
242
+ **Slide container**
243
+
244
+ `aria-live="polite"` and `aria-atomic="false"`, so a new slide is read out when it appears.
245
+
246
+ **Each slide**
247
+
248
+ | Attribute | Value |
249
+ |------------------------|------------|
250
+ | `role` | `"group"` |
251
+ | `aria-roledescription` | `"slide"` |
252
+ | `aria-label` | `"Page N of M"` |
253
+
254
+ While the leave animation runs, 500 ms by default, the leaving slide is still in the DOM beside the new one. Both keep these attributes, and nothing marks the one that's leaving, so a screen reader can find two slides during that time.
255
+
256
+ **Navigation arrow buttons**
257
+
258
+ Each arrow button carries a static `aria-label` of `"Previous page"` or `"Next page"`.
259
+
260
+ **Pager dot buttons**
261
+
262
+ The dots are a list labelled `"Pages"`. Each carries `aria-label="Page N"`, and `aria-current="true"` when it is the currently active page.
263
+
264
+ ### Keyboard interaction
265
+
266
+ | Key | Action |
267
+ |--------------|-------------------------------|
268
+ | `ArrowLeft` | Navigate to the previous page, or the next in RTL |
269
+ | `ArrowRight` | Navigate to the next page, or the previous in RTL |
270
+ | `Home` | Navigate to the first page |
271
+ | `End` | Navigate to the last page |
272
+
273
+ Keys work when focus is on the host, an arrow or a pager control. The host receives focus via `tabindex="0"` and is part of the natural tab order. Keys inside a slide stay with the slide's content, so a text field or a slider there works normally, and a key with a modifier isn't taken. If a slide is replaced from outside while it holds focus, focus moves to the host.
274
+
275
+ ### Consumer responsibilities
276
+
277
+ - Name the carousel with `aria-label` or `aria-labelledby`.
278
+ - Turn on `arrows` or `pageable`, because a swipe is a gesture and some users can't make one.
279
+ - Slide content is consumer-controlled through the projected template. Provide appropriate accessible labels on projected content (e.g., `alt` on `<img>` elements).
280
+
281
+ ## API
282
+
283
+ Everything below is imported from `@nanahoshi/mona-ui/scroll-view`.
284
+
285
+ ### `ScrollViewComponent`
286
+
287
+ **Selector:** `mona-scroll-view`
288
+
289
+ #### Inputs
290
+
291
+ | Name | Type | Default | Description |
292
+ | --- | --- | --- | --- |
293
+ | `animate` | `boolean \| number` | `true` | Sets whether page transitions are animated. Pass a boolean for default duration (500ms) or a number for custom duration in milliseconds. |
294
+ | `aria-label` | `string` | `""` | Accessible name of the carousel, saying what it shows. Use this or `aria-labelledby`; with neither, the host is a plain group and a warning is logged in development. |
295
+ | `aria-labelledby` | `string` | `""` | The id of the element that names the carousel. |
296
+ | `arrows` | `boolean` | `false` | Shows the previous and next arrows. A swipe is a gesture, so give pointer users arrows or a pager too. |
297
+ | `class` | `string` | `""` | Sets custom CSS classes on the component host element. Merged with base classes via tailwind-merge. |
298
+ | `data` | `Iterable<unknown>` | `[]` | Sets the data of the scroll view. |
299
+ | `height` (required) | `string \| number` | — | Sets the height of the scroll view. This property is required. |
300
+ | `index` (two-way) | `number` | `0` | Sets the active page of the scroll view. |
301
+ | `infinite` | `boolean` | `false` | Sets whether the scroll view is infinite. |
302
+ | `pageable` | `boolean` | `false` | Shows the pager. A swipe is a gesture, so give pointer users arrows or a pager too. |
303
+ | `pagerBlur` | `number` | `3` | Sets the background blur of the pager in pixels. It doesn't apply with `pagerOverlay` set to `"none"`. |
304
+ | `pagerOverlay` | `PagerOverlay` | `"dark"` | Sets the color of the pager. |
305
+ | `pagerRounded` | `"full" \| "large" \| "medium" \| "none" \| "small"` | `"medium"` | Sets the border radius of the pager items. |
306
+ | `rounded` | `"large" \| "medium" \| "none" \| "small"` | `"medium"` | Sets the border radius of the scroll view. |
307
+ | `width` (required) | `string \| number` | — | Sets the width of the scroll view. |
308
+
309
+ #### Outputs
310
+
311
+ | Name | Type | Description |
312
+ | --- | --- | --- |
313
+ | `indexChange` | `number` | Emitted when `index` changes. |
314
+
315
+ ### `ScrollViewSlideDirective`
316
+
317
+ Marks the template that renders each slide. Bind `[monaScrollViewSlide]` to the same data as the scroll
318
+ view, and `let-item` takes its type from it.
319
+
320
+ **Selector:** `ng-template[monaScrollViewSlide]`
321
+ **Type parameters:** `T = unknown`
322
+
323
+ #### Inputs
324
+
325
+ | Name | Type | Default | Description |
326
+ | --- | --- | --- | --- |
327
+ | `monaScrollViewSlide` | `Iterable<T> \| ""` | `""` | The scroll view's data, bound only so that `let-item` takes its type from it. Leave it empty for `unknown`. |
328
+
329
+ #### Template context
330
+
331
+ | Name | Type |
332
+ | --- | --- |
333
+ | `$implicit` | `T` |
334
+ | `height` | `number` |
335
+ | `width` | `number` |
336
+
337
+ ### Types
338
+
339
+ #### `SCROLL_VIEW_DEFAULT_MESSAGES`
340
+
341
+ ```typescript
342
+ const SCROLL_VIEW_DEFAULT_MESSAGES: MonaScrollViewMessages;
343
+ ```
344
+
345
+ #### `ScrollViewSlideContext`
346
+
347
+ **Type parameters:** `T = unknown`
348
+
349
+ | Name | Type |
350
+ | --- | --- |
351
+ | `$implicit` | `T` |
352
+ | `height` | `number` |
353
+ | `width` | `number` |
354
+
355
+ #### `PagerOverlay`
356
+
357
+ ```typescript
358
+ type PagerOverlay = "dark" | "light" | "none";
359
+ ```
360
+
361
+ #### `MonaScrollViewMessages`
362
+
363
+ From `@nanahoshi/mona-ui/i18n`.
364
+
365
+ | Name | Type |
366
+ | --- | --- |
367
+ | `carousel` (read-only) | `string` |
368
+ | `nextPage` (read-only) | `string` |
369
+ | `page` (read-only) | `(current: number) => string` |
370
+ | `pageOf` (read-only) | `(current: number, total: number) => string` |
371
+ | `pages` (read-only) | `string` |
372
+ | `previousPage` (read-only) | `string` |
373
+ | `scrollPagerNext` (read-only) | `string` |
374
+ | `scrollPagerPrevious` (read-only) | `string` |
375
+ | `slide` (read-only) | `string` |