@nanahoshi/mona-ui 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/README.md +2 -0
  2. package/command/package.json +4 -0
  3. package/docs/auto-complete.md +733 -0
  4. package/docs/avatar.md +220 -0
  5. package/docs/breadcrumb.md +320 -0
  6. package/docs/button-group.md +392 -0
  7. package/docs/button.md +256 -0
  8. package/docs/calendar.md +515 -0
  9. package/docs/card.md +292 -0
  10. package/docs/chart.md +4058 -0
  11. package/docs/checkbox.md +374 -0
  12. package/docs/chip.md +339 -0
  13. package/docs/circular-progress-bar.md +287 -0
  14. package/docs/collapsible.md +308 -0
  15. package/docs/color-gradient.md +336 -0
  16. package/docs/color-palette.md +317 -0
  17. package/docs/color-picker.md +387 -0
  18. package/docs/combo-box.md +764 -0
  19. package/docs/command.md +582 -0
  20. package/docs/contextmenu.md +530 -0
  21. package/docs/date-picker.md +251 -0
  22. package/docs/datetime-picker.md +284 -0
  23. package/docs/decimal-textbox.md +260 -0
  24. package/docs/dialog.md +822 -0
  25. package/docs/dropdown-button.md +507 -0
  26. package/docs/dropdown-list.md +779 -0
  27. package/docs/editor.md +374 -0
  28. package/docs/expansion-panel.md +348 -0
  29. package/docs/fieldset.md +217 -0
  30. package/docs/forms.md +162 -0
  31. package/docs/grid.md +2053 -0
  32. package/docs/input.md +197 -0
  33. package/docs/installation.md +54 -0
  34. package/docs/introduction.md +46 -0
  35. package/docs/label.md +340 -0
  36. package/docs/list-box.md +637 -0
  37. package/docs/list-view.md +584 -0
  38. package/docs/menubar.md +559 -0
  39. package/docs/multi-select.md +765 -0
  40. package/docs/notification.md +460 -0
  41. package/docs/numeric-textbox.md +301 -0
  42. package/docs/otp-input.md +539 -0
  43. package/docs/pager.md +513 -0
  44. package/docs/placeholder.md +176 -0
  45. package/docs/popover.md +423 -0
  46. package/docs/popup-menu.md +658 -0
  47. package/docs/popup.md +617 -0
  48. package/docs/progress-bar.md +368 -0
  49. package/docs/radio-button.md +451 -0
  50. package/docs/range-slider.md +367 -0
  51. package/docs/rating.md +518 -0
  52. package/docs/scroll-view.md +375 -0
  53. package/docs/segmented.md +434 -0
  54. package/docs/sheet.md +348 -0
  55. package/docs/sidebar.md +1126 -0
  56. package/docs/skeleton.md +181 -0
  57. package/docs/slider.md +423 -0
  58. package/docs/spinner.md +370 -0
  59. package/docs/split-button.md +522 -0
  60. package/docs/splitter.md +342 -0
  61. package/docs/stepper.md +539 -0
  62. package/docs/switch.md +340 -0
  63. package/docs/tabs.md +542 -0
  64. package/docs/textarea.md +196 -0
  65. package/docs/textbox.md +332 -0
  66. package/docs/theming.md +403 -0
  67. package/docs/time-picker.md +254 -0
  68. package/docs/tooltip-directive.md +340 -0
  69. package/docs/tooltip.md +321 -0
  70. package/docs/tree-view.md +1018 -0
  71. package/docs/window.md +663 -0
  72. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1 -1
  73. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +8 -0
  74. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +1 -1
  75. package/fesm2022/nanahoshi-mona-ui-button.mjs +14 -2
  76. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +5 -2
  77. package/fesm2022/nanahoshi-mona-ui-chart.mjs +108 -22
  78. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +4 -0
  79. package/fesm2022/nanahoshi-mona-ui-chip.mjs +1 -1
  80. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +4 -0
  81. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +16 -2
  82. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1 -1
  83. package/fesm2022/nanahoshi-mona-ui-command.mjs +924 -0
  84. package/fesm2022/nanahoshi-mona-ui-common.mjs +4 -0
  85. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +10 -6
  86. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +2 -1
  87. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +2 -1
  88. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +9 -5
  89. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +9 -5
  90. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +55 -1
  91. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3 -2
  92. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +13 -0
  93. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +5 -0
  94. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-2tVhD2hK.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs} +2 -2
  95. package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-BAN70Wcn.mjs → nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs} +5 -5
  96. package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-C_kCaA5b.mjs → nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs} +18 -35
  97. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-BsNfrAHz.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs} +5 -5
  98. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CEfVa7eo.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs} +4653 -4529
  99. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
  100. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +10 -0
  101. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +1 -0
  102. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +168 -0
  103. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +19 -1
  104. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +14 -0
  105. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +32 -0
  106. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +10 -0
  107. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +10 -0
  108. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +10 -0
  109. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +10 -0
  110. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +10 -0
  111. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +10 -0
  112. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +10 -0
  113. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +10 -0
  114. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +10 -0
  115. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +10 -0
  116. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +10 -0
  117. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +10 -0
  118. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +10 -0
  119. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +15 -8
  120. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +8 -5
  121. package/fesm2022/nanahoshi-mona-ui-notification.mjs +9 -0
  122. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1 -1
  123. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +5 -0
  124. package/fesm2022/nanahoshi-mona-ui-pager.mjs +2 -1
  125. package/fesm2022/nanahoshi-mona-ui-popover.mjs +14 -6
  126. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +48 -183
  127. package/fesm2022/nanahoshi-mona-ui-popup.mjs +16 -0
  128. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +4 -0
  129. package/fesm2022/nanahoshi-mona-ui-rating.mjs +2 -0
  130. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +7 -3
  131. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +2 -1
  132. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +5 -5
  133. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +1 -1
  134. package/fesm2022/nanahoshi-mona-ui-slider.mjs +8 -3
  135. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +10 -7
  136. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +18 -21
  137. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +11 -8
  138. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +9 -1
  139. package/fesm2022/nanahoshi-mona-ui-theme.mjs +53 -21
  140. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +2 -1
  141. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +16 -5
  142. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +13 -11
  143. package/fesm2022/nanahoshi-mona-ui-window.mjs +12 -5
  144. package/i18n/catalogs/en-US.messages.json +10 -0
  145. package/internal/popup-menu/package.json +4 -0
  146. package/llms.txt +123 -0
  147. package/locales/ar-sa/ar-sa.messages.json +10 -0
  148. package/locales/de-de/de-de.messages.json +10 -0
  149. package/locales/es-es/es-es.messages.json +10 -0
  150. package/locales/fr-fr/fr-fr.messages.json +10 -0
  151. package/locales/id-id/id-id.messages.json +10 -0
  152. package/locales/it-it/it-it.messages.json +10 -0
  153. package/locales/ja-jp/ja-jp.messages.json +10 -0
  154. package/locales/ko-kr/ko-kr.messages.json +10 -0
  155. package/locales/pt-br/pt-br.messages.json +10 -0
  156. package/locales/ru-ru/ru-ru.messages.json +10 -0
  157. package/locales/tr-tr/tr-tr.messages.json +10 -0
  158. package/locales/zh-cn/zh-cn.messages.json +10 -0
  159. package/locales/zh-tw/zh-tw.messages.json +10 -0
  160. package/package.json +9 -1
  161. package/styles.css +12 -2
  162. package/types/nanahoshi-mona-ui-auto-complete.d.ts +1 -1
  163. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +8 -0
  164. package/types/nanahoshi-mona-ui-button.d.ts +12 -0
  165. package/types/nanahoshi-mona-ui-calendar.d.ts +3 -0
  166. package/types/nanahoshi-mona-ui-chart.d.ts +200 -0
  167. package/types/nanahoshi-mona-ui-check-box.d.ts +4 -0
  168. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +4 -0
  169. package/types/nanahoshi-mona-ui-collapsible.d.ts +10 -0
  170. package/types/nanahoshi-mona-ui-combo-box.d.ts +1 -1
  171. package/types/nanahoshi-mona-ui-command.d.ts +253 -0
  172. package/types/nanahoshi-mona-ui-common.d.ts +17 -1
  173. package/types/nanahoshi-mona-ui-contextmenu.d.ts +5 -2
  174. package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -1
  175. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +2 -1
  176. package/types/nanahoshi-mona-ui-dialog.d.ts +58 -1
  177. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +7 -3
  178. package/types/nanahoshi-mona-ui-dropdowns.d.ts +55 -1
  179. package/types/nanahoshi-mona-ui-editor.d.ts +31 -0
  180. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +13 -0
  181. package/types/nanahoshi-mona-ui-fieldset.d.ts +5 -0
  182. package/types/nanahoshi-mona-ui-grid.d.ts +162 -35
  183. package/types/nanahoshi-mona-ui-i18n.d.ts +144 -1
  184. package/types/nanahoshi-mona-ui-internal-list.d.ts +16 -1
  185. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +165 -0
  186. package/types/nanahoshi-mona-ui-internal-tree.d.ts +21 -2
  187. package/types/nanahoshi-mona-ui-internal.d.ts +4 -5
  188. package/types/nanahoshi-mona-ui-label.d.ts +1 -0
  189. package/types/nanahoshi-mona-ui-list-box.d.ts +27 -4
  190. package/types/nanahoshi-mona-ui-list-view.d.ts +34 -1
  191. package/types/nanahoshi-mona-ui-list.d.ts +1 -1
  192. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +10 -0
  193. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +10 -0
  194. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +10 -0
  195. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +10 -0
  196. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +10 -0
  197. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +10 -0
  198. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +10 -0
  199. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +10 -0
  200. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +10 -0
  201. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +10 -0
  202. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +10 -0
  203. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +10 -0
  204. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +10 -0
  205. package/types/nanahoshi-mona-ui-menubar.d.ts +10 -3
  206. package/types/nanahoshi-mona-ui-multi-select.d.ts +3 -3
  207. package/types/nanahoshi-mona-ui-notification.d.ts +9 -0
  208. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +1 -1
  209. package/types/nanahoshi-mona-ui-otp-input.d.ts +1 -0
  210. package/types/nanahoshi-mona-ui-pager.d.ts +5 -1
  211. package/types/nanahoshi-mona-ui-popover.d.ts +9 -1
  212. package/types/nanahoshi-mona-ui-popup-menu.d.ts +48 -161
  213. package/types/nanahoshi-mona-ui-popup.d.ts +16 -0
  214. package/types/nanahoshi-mona-ui-progress-bar.d.ts +4 -0
  215. package/types/nanahoshi-mona-ui-rating.d.ts +2 -0
  216. package/types/nanahoshi-mona-ui-segmented.d.ts +1 -0
  217. package/types/nanahoshi-mona-ui-sheet.d.ts +1 -1
  218. package/types/nanahoshi-mona-ui-slider.d.ts +2 -0
  219. package/types/nanahoshi-mona-ui-spinner.d.ts +7 -0
  220. package/types/nanahoshi-mona-ui-split-button.d.ts +7 -4
  221. package/types/nanahoshi-mona-ui-stepper.d.ts +11 -2
  222. package/types/nanahoshi-mona-ui-tabs.d.ts +4 -1
  223. package/types/nanahoshi-mona-ui-text-box.d.ts +9 -1
  224. package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -1
  225. package/types/nanahoshi-mona-ui-tooltip.d.ts +10 -2
  226. package/types/nanahoshi-mona-ui-tree-view.d.ts +6 -5
  227. package/types/nanahoshi-mona-ui-window.d.ts +66 -1
package/docs/avatar.md ADDED
@@ -0,0 +1,220 @@
1
+ # Avatar
2
+
3
+ > Shows a person or entity as an image, text label or projected content.
4
+
5
+ Entry point: `@nanahoshi/mona-ui/avatar`
6
+
7
+ **Selector:** `mona-avatar`
8
+
9
+ `AvatarComponent` renders a configurable avatar supporting three exclusive display modes — image, text label, or projected content — with full control over size, shape, and border.
10
+
11
+ ## Overview
12
+
13
+ `AvatarComponent` is a presentational component that renders a single avatar in one of three exclusive display modes: image, text label, or projected content. The active mode is resolved automatically based on which inputs are provided.
14
+
15
+ **Use the avatar when you need to:**
16
+
17
+ - Display a user profile picture in headers, comment threads, or contact lists
18
+ - Show initials-based fallback content when a user has no profile image, or when the image fails to load
19
+ - Represent a team or entity with a consistent, bordered shape
20
+ - Project a custom icon into a fixed-size, bordered slot
21
+
22
+ **Do not use when:**
23
+
24
+ - The avatar needs to be interactive — wrap it in a `<button>` or `<a>` yourself; the component provides no built-in interaction
25
+ - You need a stacked avatar group — compose individual `<mona-avatar>` elements manually; there is no built-in group component
26
+
27
+ ## Import & Quick Start
28
+
29
+ ```typescript
30
+ import { AvatarComponent } from "@nanahoshi/mona-ui/avatar";
31
+ ```
32
+
33
+ Add `AvatarComponent` to your standalone component's `imports` array.
34
+
35
+ **Image mode** — set `image` to a URL. Provide `alt` to describe non-decorative images:
36
+
37
+ ```html
38
+
39
+ <mona-avatar
40
+ image="https://example.com/photo.jpg"
41
+ alt="Jane Smith's profile photo"
42
+ borderRadius="50%">
43
+ </mona-avatar>
44
+ ```
45
+
46
+ **Label mode** — omit `image`, set `label` to the visible initials. **Projected content mode** — omit both `image` and `label` and project any content. Both are shown under Examples.
47
+
48
+ > **Display priority:** `image` takes priority over `label`; `label` takes priority over projected content. Setting both `image` and `label` shows only the image, until it fails to load. Then the avatar shows the label or projected content, and a new URL tries again.
49
+
50
+ A photo that isn't square is cropped to fill the avatar. Images load lazily, which matters in long lists.
51
+
52
+ ## Examples
53
+
54
+ ### Initials
55
+
56
+ Set `label` to the visible initials and `aria-label` to the full name. `labelColor` defaults to the foreground meant for the default `backgroundColor`, so if you change one, check the other.
57
+
58
+ `initials-example.component.ts`
59
+
60
+ ```typescript
61
+ import { Component } from "@angular/core";
62
+ import { AvatarComponent } from "@nanahoshi/mona-ui/avatar";
63
+
64
+ @Component({
65
+ selector: "app-avatar-initials-example",
66
+ imports: [AvatarComponent],
67
+ templateUrl: "./initials-example.component.html"
68
+ })
69
+ export class AvatarInitialsExampleComponent {}
70
+ ```
71
+
72
+ `initials-example.component.html`
73
+
74
+ ```html
75
+ <div class="flex flex-wrap items-center gap-3">
76
+ <mona-avatar aria-label="Jane Smith" borderRadius="50%" label="JS" [height]="48" [width]="48"></mona-avatar>
77
+ <mona-avatar
78
+ aria-label="Omar Haddad"
79
+ backgroundColor="#0f766e"
80
+ borderRadius="8px"
81
+ label="OH"
82
+ labelColor="#ffffff"
83
+ [height]="48"
84
+ [width]="48"></mona-avatar>
85
+ <mona-avatar
86
+ aria-label="Design team"
87
+ backgroundColor="#4338ca"
88
+ label="DT"
89
+ labelColor="#ffffff"
90
+ [height]="48"
91
+ [width]="48"></mona-avatar>
92
+ </div>
93
+ ```
94
+
95
+ ### Icon
96
+
97
+ Leave out `image` and `label` to project content, such as an icon, and set `aria-label` to describe it. The avatar doesn't center projected content, so wrap it in an element that does.
98
+
99
+ `icon-example.component.ts`
100
+
101
+ ```typescript
102
+ import { Component } from "@angular/core";
103
+ import { LucideUser, LucideUsers } from "@lucide/angular";
104
+ import { AvatarComponent } from "@nanahoshi/mona-ui/avatar";
105
+
106
+ @Component({
107
+ selector: "app-avatar-icon-example",
108
+ imports: [AvatarComponent, LucideUser, LucideUsers],
109
+ templateUrl: "./icon-example.component.html"
110
+ })
111
+ export class AvatarIconExampleComponent {}
112
+ ```
113
+
114
+ `icon-example.component.html`
115
+
116
+ ```html
117
+ <div class="flex flex-wrap items-center gap-3">
118
+ <mona-avatar aria-label="Guest user" borderRadius="50%" [height]="48" [width]="48">
119
+ <span class="flex size-full items-center justify-center text-primary-foreground">
120
+ <svg lucideUser aria-hidden="true" [size]="24"></svg>
121
+ </span>
122
+ </mona-avatar>
123
+ <mona-avatar aria-label="Shared workspace" borderRadius="8px" [height]="48" [width]="48">
124
+ <span class="flex size-full items-center justify-center text-primary-foreground">
125
+ <svg lucideUsers aria-hidden="true" [size]="24"></svg>
126
+ </span>
127
+ </mona-avatar>
128
+ </div>
129
+ ```
130
+
131
+ ## Appearance & Styling
132
+
133
+ ### Size
134
+
135
+ `width` and `height` both default to `'64px'`. Pass a `number` for automatic `px` conversion, or a CSS string with explicit units:
136
+
137
+ ```html
138
+
139
+ <mona-avatar [width]="80" [height]="80" borderRadius="50%"></mona-avatar>
140
+ <mona-avatar width="4rem" height="4rem"></mona-avatar>
141
+ ```
142
+
143
+ Size is set as an inline style on the host, so a class like `w-8` has no effect. Use these inputs.
144
+
145
+ ### Shape
146
+
147
+ Control shape with `borderRadius`:
148
+
149
+ | `borderRadius` | Shape |
150
+ |----------------|------------------|
151
+ | `'0'` | Square (default) |
152
+ | `'8px'` | Rounded square |
153
+ | `'50%'` | Circle |
154
+
155
+ In image mode, the image is also clipped to match the configured `borderRadius`.
156
+
157
+ ### Color defaults
158
+
159
+ | Input | Default value |
160
+ |-------------------|---------------------------|
161
+ | `backgroundColor` | `var(--color-primary)` |
162
+ | `borderColor` | `var(--color-border)` |
163
+ | `labelColor` | `var(--color-primary-foreground)` |
164
+
165
+ `backgroundColor` is set to `transparent` while an image shows, regardless of the input value. It comes back if the image fails to load.
166
+
167
+ ### Custom style overrides
168
+
169
+ The `customStyles` input accepts a `Partial<CSSStyleDeclaration>` object applied after all other styles, taking precedence over every other style input. Overriding layout-critical properties such as `display` may break expected rendering:
170
+
171
+ ```html
172
+
173
+ <mona-avatar
174
+ label="X"
175
+ aria-label="Unknown user"
176
+ [customStyles]="{ boxShadow: '0 0 0 3px var(--color-primary)' }">
177
+ </mona-avatar>
178
+ ```
179
+
180
+ ## Accessibility
181
+
182
+ The avatar has no built-in keyboard behavior and no interactive role. Accessibility responsibility depends on the active display mode:
183
+
184
+ **Image mode:** Provide a meaningful `alt` value when the image conveys identity information, or an `aria-label`, which the image uses when `alt` is empty. While an image shows, `aria-label` doesn't go on the host, and it's not used at all if `alt` is set. Leave both empty only when adjacent visible text already identifies the same entity.
185
+
186
+ **Label mode:** The raw visual initials (e.g., `"JD"`) are not a meaningful accessible name on their own. Set `aria-label` to the full name or entity the initials represent (e.g., `aria-label="Jane Smith"`). When `aria-label` is non-empty, the host receives `role="img"` and assistive technology announces the label value instead of the visual text.
187
+
188
+ **Projected content mode:** Set `aria-label` to describe what is projected. When non-empty, the host receives `role="img"`.
189
+
190
+ **After an image fails to load:** the host receives `role="img"`, named by `alt` or else `aria-label`, the same name the image had. With neither, the host has no role or name of its own.
191
+
192
+ If the avatar is purely decorative and already described by adjacent visible text, you may omit both `alt` and `aria-label`. Whether this is appropriate depends on context.
193
+
194
+ ## API
195
+
196
+ Everything below is imported from `@nanahoshi/mona-ui/avatar`.
197
+
198
+ ### `AvatarComponent`
199
+
200
+ **Selector:** `mona-avatar`
201
+
202
+ #### Inputs
203
+
204
+ | Name | Type | Default | Description |
205
+ | --- | --- | --- | --- |
206
+ | `alt` | `string` | `""` | Alternative text for the avatar image. Provide a meaningful description for non-decorative images; an empty string marks the image as decorative. |
207
+ | `aria-label` | `string` | `""` | Accessible name of the avatar. Describe who or what it represents. In label and projected-content modes the host takes it with `role="img"`. While an image shows, it's the image's `alt` unless `alt` is set. |
208
+ | `backgroundColor` | `string` | `"var(--color-primary)"` | Background color of the host element. Ignored in image mode — the background is set to transparent automatically. |
209
+ | `borderColor` | `string` | `"var(--color-border)"` | Border color of the host element. |
210
+ | `borderRadius` | `string \| number` | `"0"` | Border radius of the host element. Accepts a CSS string (`'50%'`, `'8px'`) or a number converted to `px`. In image mode, the image is also clipped to this radius. |
211
+ | `borderWidth` | `string \| number` | `"1px"` | Border width of the host element. Accepts a CSS string or a number converted to `px`. |
212
+ | `class` | `string` | `""` | Additional CSS classes applied to the host element. |
213
+ | `customStyles` | `Partial<CSSStyleDeclaration>` | `{}` | Inline styles applied after all other style inputs, taking precedence over every computed style including `display`, `height`, and `width`. |
214
+ | `height` | `string \| number` | `"64px"` | Height of the host element. A string is used as-is; a number is converted to `px`. |
215
+ | `image` | `string` | `""` | Image URL. When non-empty, renders an `<img>` and suppresses `label` and projected content, until it fails to load. Then the avatar falls back to them, and a new URL tries again. |
216
+ | `label` | `string` | `""` | Text label displayed inside the avatar when there's no image, or the image failed to load. |
217
+ | `labelColor` | `string` | `"var(--color-primary-foreground)"` | Color of the label text. Ignored in image mode. |
218
+ | `labelFontSize` | `string` | `"1rem"` | Font size of the label text. Ignored in image mode. |
219
+ | `labelFontWeight` | `string` | `"700"` | Font weight of the label text. Ignored in image mode. |
220
+ | `width` | `string \| number` | `"64px"` | Width of the host element. A string is used as-is; a number is converted to `px`. |
@@ -0,0 +1,320 @@
1
+ # Breadcrumb
2
+
3
+ > A navigation trail showing where the current page sits in a hierarchy.
4
+
5
+ Entry point: `@nanahoshi/mona-ui/breadcrumb`
6
+
7
+ **Selector:** `mona-breadcrumb`
8
+
9
+ `BreadcrumbComponent` renders a navigational hierarchy trail as an accessible navigation landmark, with items that are real links or buttons, a collapse mode for long trails, and an optional custom separator template.
10
+
11
+ ## Overview
12
+
13
+ `BreadcrumbComponent` renders a navigation landmark containing an ordered list of items defined by projected `<mona-breadcrumb-item>` children. The last item is automatically treated as the current page — it renders as non-interactive text with `aria-current="page"`. All other items are buttons, or real links when you project an anchor with `monaBreadcrumbLink`.
14
+
15
+ Separators between items default to a `ChevronRight` icon and are hidden from assistive technology. Replace the default by projecting an `<ng-template monaBreadcrumbSeparatorTemplate>` anywhere inside `<mona-breadcrumb>`.
16
+
17
+ **Use the breadcrumb when you need to:**
18
+
19
+ - Show the user's position in a multi-level hierarchy (settings pages, file explorers, e-commerce categories)
20
+ - Provide clickable navigation to parent levels alongside the current page label
21
+ - Mark completed steps in a wizard flow where each step corresponds to a navigated level
22
+
23
+ **Do not use when:**
24
+
25
+ - The navigation is flat with no hierarchy — use tabs or a nav bar instead
26
+ - Only a single item would be shown — a single-item breadcrumb adds no navigational value
27
+
28
+ ## Import & Quick Start
29
+
30
+ ```typescript
31
+ import { BreadcrumbComponent, BreadcrumbItemComponent } from "@nanahoshi/mona-ui/breadcrumb";
32
+ // Optional: only needed for items that are links
33
+ import { BreadcrumbLinkDirective } from "@nanahoshi/mona-ui/breadcrumb";
34
+ // Optional: only needed when providing a custom separator
35
+ import { BreadcrumbSeparatorTemplateDirective } from "@nanahoshi/mona-ui/breadcrumb";
36
+ ```
37
+
38
+ Add the imported symbols to your standalone component's `imports` array.
39
+
40
+ **Links (use these when an item goes to a page):**
41
+
42
+ ```html
43
+
44
+ <mona-breadcrumb>
45
+ <mona-breadcrumb-item><a monaBreadcrumbLink routerLink="/">Home</a></mona-breadcrumb-item>
46
+ <mona-breadcrumb-item><a monaBreadcrumbLink routerLink="/products">Products</a></mona-breadcrumb-item>
47
+ <mona-breadcrumb-item>Wireless Headphones</mona-breadcrumb-item>
48
+ </mona-breadcrumb>
49
+ ```
50
+
51
+ The anchor is yours, so `href`, `routerLink`, `target` and `rel` all work, and so do ctrl-click, middle-click and "copy link". The item renders no button around it, and `itemClick` still fires for a click on the link. A plain `<a>` without `monaBreadcrumbLink` would end up inside a button, which is invalid and fails axe. The last item can be a link too, and the `aria-current` goes on the anchor.
52
+
53
+ **Buttons, for an action that isn't navigation:** an item without a link is a button, and emits `itemClick`. See [Buttons](#buttons).
54
+
55
+ The last `<mona-breadcrumb-item>` never emits `itemClick` — it is non-interactive regardless of whether you bind the output. Only non-last items are clickable. When a trail stops before the page you're on, set `[lastItemCurrent]="false"` and the last item becomes a normal one, with no `aria-current`.
56
+
57
+ **Long trails:** items shrink and truncate with an ellipsis as the space runs out, and the other items give up their width before the current page does. To shorten the trail instead, set `maxItems`, as in [Collapsing a long trail](#collapsing-a-long-trail). The first and last items always stay, and the middle collapses behind a button that shows it again and moves focus to the first item it revealed that can take focus. The button's name comes from `showFullPath` in the `breadcrumb` messages. The trail collapses again when its items change.
58
+
59
+ Truncation needs text to work on. An item whose content is its own flex container, such as `<div class="flex">`, gets clipped without the ellipsis.
60
+
61
+ **Custom separator:** project an `ng-template monaBreadcrumbSeparatorTemplate`, as in [Custom separator](#custom-separator). The separator template receives `{ $implicit: number }` context — the zero-based index of the preceding item. After the collapse button, it's the index of the last hidden item:
62
+
63
+ ```html
64
+
65
+ <ng-template monaBreadcrumbSeparatorTemplate let-i>
66
+ <span>{{ i === 0 ? '›' : '/' }}</span>
67
+ </ng-template>
68
+ ```
69
+
70
+ **Disabled states:**
71
+
72
+ ```html
73
+ <mona-breadcrumb [disabled]="isLoading()">
74
+ <mona-breadcrumb-item (itemClick)="go('home')">Home</mona-breadcrumb-item>
75
+ <mona-breadcrumb-item>Current</mona-breadcrumb-item>
76
+ </mona-breadcrumb>
77
+
78
+ <mona-breadcrumb>
79
+ <mona-breadcrumb-item (itemClick)="go('home')">Home</mona-breadcrumb-item>
80
+ <mona-breadcrumb-item [disabled]="true" (itemClick)="go('locked')">Locked</mona-breadcrumb-item>
81
+ <mona-breadcrumb-item>Current</mona-breadcrumb-item>
82
+ </mona-breadcrumb>
83
+ ```
84
+
85
+ > **Multiple breadcrumbs on the same page:** Set a unique `aria-label` on each `<mona-breadcrumb>` so screen reader users can distinguish the navigation landmarks.
86
+
87
+ ## Examples
88
+
89
+ ### Buttons
90
+
91
+ Clicking a parent folder opens it, which drops the folders below it from the path.
92
+
93
+ `buttons-example.component.ts`
94
+
95
+ ```typescript
96
+ import { Component, signal } from "@angular/core";
97
+ import { BreadcrumbComponent, BreadcrumbItemComponent } from "@nanahoshi/mona-ui/breadcrumb";
98
+ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
99
+
100
+ @Component({
101
+ selector: "app-breadcrumb-buttons-example",
102
+ imports: [BreadcrumbComponent, BreadcrumbItemComponent, ButtonDirective],
103
+ templateUrl: "./buttons-example.component.html"
104
+ })
105
+ export class BreadcrumbButtonsExampleComponent {
106
+ protected readonly fullPath = ["Home", "Documents", "Projects", "Reports"];
107
+ protected readonly path = signal(this.fullPath);
108
+
109
+ /** Opening a parent folder drops the folders below it from the path. */
110
+ protected openFolder(index: number): void {
111
+ this.path.update(path => path.slice(0, index + 1));
112
+ }
113
+ }
114
+ ```
115
+
116
+ `buttons-example.component.html`
117
+
118
+ ```html
119
+ <div class="flex flex-col gap-3">
120
+ <mona-breadcrumb aria-label="Folder path">
121
+ @for (folder of path(); track $index) {
122
+ <mona-breadcrumb-item (itemClick)="openFolder($index)">{{ folder }}</mona-breadcrumb-item>
123
+ }
124
+ </mona-breadcrumb>
125
+ <button monaButton class="self-start" type="button" [disabled]="path().length === fullPath.length" (click)="path.set(fullPath)">
126
+ Back to the full path
127
+ </button>
128
+ </div>
129
+ ```
130
+
131
+ ### Collapsing a long trail
132
+
133
+ With `maxItems` set to 4, the middle of the trail collapses behind a button that shows it again.
134
+
135
+ `collapsed-example.component.ts`
136
+
137
+ ```typescript
138
+ import { Component, signal } from "@angular/core";
139
+ import { BreadcrumbComponent, BreadcrumbItemComponent } from "@nanahoshi/mona-ui/breadcrumb";
140
+
141
+ @Component({
142
+ selector: "app-breadcrumb-collapsed-example",
143
+ imports: [BreadcrumbComponent, BreadcrumbItemComponent],
144
+ templateUrl: "./collapsed-example.component.html"
145
+ })
146
+ export class BreadcrumbCollapsedExampleComponent {
147
+ protected readonly categories = [
148
+ "Store",
149
+ "Electronics",
150
+ "Audio",
151
+ "Headphones",
152
+ "Over-ear",
153
+ "Wireless",
154
+ "Noise-cancelling headphones"
155
+ ];
156
+ protected readonly chosen = signal("none");
157
+ }
158
+ ```
159
+
160
+ `collapsed-example.component.html`
161
+
162
+ ```html
163
+ <div class="flex flex-col gap-3">
164
+ <mona-breadcrumb aria-label="Category" [maxItems]="4">
165
+ @for (category of categories; track category) {
166
+ <mona-breadcrumb-item (itemClick)="chosen.set(category)">{{ category }}</mona-breadcrumb-item>
167
+ }
168
+ </mona-breadcrumb>
169
+ <p aria-live="polite" class="text-sm">Last clicked: {{ chosen() }}</p>
170
+ </div>
171
+ ```
172
+
173
+ ### Custom separator
174
+
175
+ `separator-example.component.ts`
176
+
177
+ ```typescript
178
+ import { Component } from "@angular/core";
179
+ import { LucideSlash } from "@lucide/angular";
180
+ import {
181
+ BreadcrumbComponent,
182
+ BreadcrumbItemComponent,
183
+ BreadcrumbSeparatorTemplateDirective
184
+ } from "@nanahoshi/mona-ui/breadcrumb";
185
+
186
+ @Component({
187
+ selector: "app-breadcrumb-separator-example",
188
+ imports: [BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbSeparatorTemplateDirective, LucideSlash],
189
+ templateUrl: "./separator-example.component.html"
190
+ })
191
+ export class BreadcrumbSeparatorExampleComponent {}
192
+ ```
193
+
194
+ `separator-example.component.html`
195
+
196
+ ```html
197
+ <mona-breadcrumb aria-label="Settings path">
198
+ <mona-breadcrumb-item>Settings</mona-breadcrumb-item>
199
+ <mona-breadcrumb-item>Account</mona-breadcrumb-item>
200
+ <mona-breadcrumb-item>Security</mona-breadcrumb-item>
201
+ <ng-template monaBreadcrumbSeparatorTemplate>
202
+ <svg lucideSlash aria-hidden="true" [size]="14"></svg>
203
+ </ng-template>
204
+ </mona-breadcrumb>
205
+ ```
206
+
207
+ ## Appearance & Styling
208
+
209
+ ### Visual states
210
+
211
+ | State | Appearance |
212
+ |-----------------------|---------------------------------------------------------------------------------|
213
+ | Default item | Muted text; hovering applies the foreground color and a hover background |
214
+ | Focus-visible item | A solid outline in the focus color, inside the item's edge |
215
+ | Individually disabled | Disabled text color, no pointer interaction |
216
+ | List-level disabled | The entire breadcrumb list uses the disabled text color, no pointer interaction |
217
+ | Current (last) item | Medium font weight, foreground color, default cursor |
218
+
219
+ When the breadcrumb is disabled via `[disabled]="true"`, all items lose pointer interaction. When only a child item's `disabled` is `true`, only that item is visually dimmed (provided the parent is not also disabled).
220
+
221
+ ### Custom classes
222
+
223
+ Add extra styles to the breadcrumb list via the `class` input on `<mona-breadcrumb>`:
224
+
225
+ ```html
226
+
227
+ <mona-breadcrumb class="text-sm gap-2">...</mona-breadcrumb>
228
+ ```
229
+
230
+ ### Width
231
+
232
+ The host is a block with `max-width: 100%` and `min-width: 0`, and in a flex parent it needs both. `min-width: 0` lets it shrink along a row, and `max-width: 100%` keeps it inside a column that sizes to fit. Without them it would never get narrower than the trail's text, and nothing inside it would truncate.
233
+
234
+ ## Behavior
235
+
236
+ - **Content projection:** accepts `<mona-breadcrumb-item>` children and an optional `<ng-template monaBreadcrumbSeparatorTemplate>`.
237
+
238
+ ## Accessibility
239
+
240
+ `BreadcrumbComponent` renders `role="navigation"` on the host, making it a landmark that screen reader users can navigate to directly. The `aria-label` input sets the landmark's accessible name. Left empty, the name comes from the `breadcrumb` message, which is "Breadcrumb" in English. A breadcrumb with no items renders no landmark and no list.
241
+
242
+ The item list is announced as a list by assistive technology. The last item automatically receives `aria-current="page"`. Separators are hidden from assistive technology.
243
+
244
+ Items are native buttons, or the anchors you project. A disabled item is removed from the tab order and cannot be activated by keyboard or pointer. A disabled link gets `aria-disabled` and `tabindex="-1"`, and a click on it stops before `routerLink` sees it.
245
+
246
+ When multiple breadcrumbs appear on the same page, each should have a distinct `aria-label` so screen reader users can distinguish the landmarks.
247
+
248
+ ## API
249
+
250
+ Everything below is imported from `@nanahoshi/mona-ui/breadcrumb`.
251
+
252
+ ### `BreadcrumbComponent`
253
+
254
+ **Selector:** `mona-breadcrumb`
255
+
256
+ #### Inputs
257
+
258
+ | Name | Type | Default | Description |
259
+ | --- | --- | --- | --- |
260
+ | `aria-label` | `string` | `""` | Accessible name for the breadcrumb navigation landmark. Override when multiple breadcrumb components appear on the same page. |
261
+ | `class` | `string` | `""` | Additional CSS classes merged onto the breadcrumb list via `tailwind-merge`. |
262
+ | `disabled` | `boolean` | `false` | Renders the entire breadcrumb with reduced visual emphasis and removes pointer interaction from all items. |
263
+ | `lastItemCurrent` | `boolean` | `true` | Treats the last item as the current page: not a button, and marked `aria-current="page"`. Turn it off for a trail that ends before the page you're on. |
264
+ | `maxItems` | `number \| null` | `null` | The most items to show before the middle of the trail collapses behind a button that shows it again. The first and last items always stay, so anything below 2 counts as 2. `null` never collapses. |
265
+
266
+ ### `BreadcrumbItemComponent`
267
+
268
+ Use as a direct child of `<mona-breadcrumb>`. Project any Angular content — text, icons, or elements — into the
269
+ default slot.
270
+
271
+ **Selector:** `mona-breadcrumb-item`
272
+
273
+ #### Inputs
274
+
275
+ | Name | Type | Default | Description |
276
+ | --- | --- | --- | --- |
277
+ | `disabled` | `boolean` | `false` | Renders this item with reduced visual emphasis and removes pointer interaction. Has no visual effect when the parent breadcrumb is also disabled. |
278
+
279
+ #### Outputs
280
+
281
+ | Name | Type | Description |
282
+ | --- | --- | --- |
283
+ | `itemClick` | `MouseEvent` | Emitted with the click when the item is clicked or activated via keyboard. Not emitted when this is the current-page item or when the item is disabled. |
284
+
285
+ ### `BreadcrumbLinkDirective`
286
+
287
+ Makes a projected anchor the item's link, so the browser and the router treat it as one: ctrl-click, copy link, `href`,
288
+ `routerLink`, `target`. The item then renders no button around it.
289
+
290
+ **Selector:** `a[monaBreadcrumbLink]`
291
+
292
+ #### Inputs
293
+
294
+ | Name | Type | Default | Description |
295
+ | --- | --- | --- | --- |
296
+ | `class` | `string` | `""` | Additional CSS classes merged onto the link via `tailwind-merge`. |
297
+
298
+ ### `BreadcrumbSeparatorTemplateDirective`
299
+
300
+ Apply to an `<ng-template>` directly inside `<mona-breadcrumb>` to replace the default `ChevronRight` separator. One
301
+ directive per breadcrumb — the first match is used.
302
+
303
+ **Selector:** `ng-template[monaBreadcrumbSeparatorTemplate]`
304
+
305
+ ### Types
306
+
307
+ #### `BREADCRUMB_DEFAULT_MESSAGES`
308
+
309
+ ```typescript
310
+ const BREADCRUMB_DEFAULT_MESSAGES: MonaBreadcrumbMessages;
311
+ ```
312
+
313
+ #### `MonaBreadcrumbMessages`
314
+
315
+ From `@nanahoshi/mona-ui/i18n`.
316
+
317
+ | Name | Type |
318
+ | --- | --- |
319
+ | `breadcrumb` (read-only) | `string` |
320
+ | `showFullPath` (read-only) | `string` |