@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
@@ -0,0 +1,374 @@
1
+ # Checkbox
2
+
3
+ > A checkbox with label handling and an indeterminate state.
4
+
5
+ Entry point: `@nanahoshi/mona-ui/check-box`
6
+
7
+ **Selectors:** `mona-check-box` · `input[type='checkbox'][monaCheckbox]`
8
+
9
+ `CheckBoxComponent` renders a custom-styled checkbox with label management, indeterminate state, and signal forms support. `CheckboxDirective` applies the same visual style to a native `<input type="checkbox">` when full layout control is required.
10
+
11
+ ## Overview
12
+
13
+ Mona UI provides two ways to render a styled checkbox:
14
+
15
+ **`CheckBoxComponent` (`mona-check-box`)** is a self-contained component. It wraps a visually hidden native `<input type="checkbox">` (accessible to screen readers) and a visible custom box that tracks focus and checked state via CSS peer selectors. It implements `FormCheckboxControl` from `@angular/forms/signals` and supports an optional text label or projected content.
16
+
17
+ **`CheckboxDirective` (`monaCheckbox`)** is an attribute directive applied directly to your own `<input type="checkbox">`. It adds Mona UI styling while keeping the native element as the form control. Because it targets a native input, Angular's built-in form directives (`[(ngModel)]`, `[formControl]`, `formControlName`) work on it without any additional wiring.
18
+
19
+ **Choose `CheckBoxComponent` when:**
20
+
21
+ - You want a ready-made label + checkbox layout without writing wrapper markup
22
+ - You need indeterminate state, read-only state, label positioning, or label size variants
23
+ - You are using signal forms via the `[formField]` binding
24
+
25
+ **Choose `CheckboxDirective` when:**
26
+
27
+ - You need full control over the surrounding markup — your own `<label>`, positioning
28
+ - You want to use `[formControl]` or `formControlName` (Angular's standard forms work on the native input directly)
29
+ - You want native browser checkbox behavior with Mona UI styling
30
+
31
+ ## Import & Quick Start
32
+
33
+ ```typescript
34
+ import { CheckBoxComponent } from "@nanahoshi/mona-ui/check-box"; // component
35
+ import { CheckboxDirective } from "@nanahoshi/mona-ui/check-box"; // directive
36
+ ```
37
+
38
+ Add the imported symbols to your standalone component's `imports` array.
39
+
40
+ ### The component
41
+
42
+ ```html
43
+ <mona-check-box label="Accept terms"></mona-check-box>
44
+ ```
45
+
46
+ **`ngModel`:**
47
+
48
+ `CheckBoxComponent` doesn't implement `ControlValueAccessor`. `[(ngModel)]` still works, because Angular binds it to the `checked` model of a custom control. Import `FormsModule` for it.
49
+
50
+ ```html
51
+
52
+ <mona-check-box label="Accept terms" [(ngModel)]="accepted"></mona-check-box>
53
+ ```
54
+
55
+ > **Listening to changes:** Use `(inputChange)` for raw DOM `change` events. For signal forms, the `[formField]` binding handles value synchronization automatically.
56
+
57
+ ## Examples
58
+
59
+ ### Labels
60
+
61
+ The text comes from `label` or from projected content. When `label` is non-empty it takes precedence over projected content. `labelPosition="before"` puts the text before the box.
62
+
63
+ `labels-example.component.ts`
64
+
65
+ ```typescript
66
+ import { Component, signal } from "@angular/core";
67
+ import { CheckBoxComponent } from "@nanahoshi/mona-ui/check-box";
68
+
69
+ @Component({
70
+ selector: "app-checkbox-labels-example",
71
+ imports: [CheckBoxComponent],
72
+ templateUrl: "./labels-example.component.html"
73
+ })
74
+ export class CheckboxLabelsExampleComponent {
75
+ protected readonly releases = signal(true);
76
+ protected readonly signedIn = signal(false);
77
+ protected readonly terms = signal(false);
78
+ }
79
+ ```
80
+
81
+ `labels-example.component.html`
82
+
83
+ ```html
84
+ <div class="flex flex-col items-start gap-3">
85
+ <mona-check-box label="Email me about new releases" [(checked)]="releases" />
86
+ <mona-check-box label="Keep me signed in" labelPosition="before" [(checked)]="signedIn" />
87
+ <mona-check-box [(checked)]="terms">
88
+ I accept the <strong>terms of service</strong>
89
+ </mona-check-box>
90
+ <mona-check-box label="Sync contacts" [disabled]="true" />
91
+ <p class="text-sm">Terms accepted: {{ terms() ? "yes" : "no" }}</p>
92
+ </div>
93
+ ```
94
+
95
+ ### Select all
96
+
97
+ `indeterminate` shows a dash and sets `aria-checked="mixed"`. It's independent of `checked`.
98
+
99
+ `indeterminate-example.component.ts`
100
+
101
+ ```typescript
102
+ import { Component, computed, signal } from "@angular/core";
103
+ import { CheckBoxComponent } from "@nanahoshi/mona-ui/check-box";
104
+
105
+ interface Topping {
106
+ readonly name: string;
107
+ readonly selected: boolean;
108
+ }
109
+
110
+ @Component({
111
+ selector: "app-checkbox-indeterminate-example",
112
+ imports: [CheckBoxComponent],
113
+ templateUrl: "./indeterminate-example.component.html"
114
+ })
115
+ export class CheckboxIndeterminateExampleComponent {
116
+ protected readonly allSelected = computed(() => this.toppings().every(topping => topping.selected));
117
+ protected readonly someSelected = computed(
118
+ () => !this.allSelected() && this.toppings().some(topping => topping.selected)
119
+ );
120
+ protected readonly toppings = signal<readonly Topping[]>([
121
+ { name: "Cheese", selected: true },
122
+ { name: "Mushrooms", selected: false },
123
+ { name: "Olives", selected: false }
124
+ ]);
125
+
126
+ protected select(name: string, selected: boolean): void {
127
+ this.toppings.update(toppings =>
128
+ toppings.map(topping => (topping.name === name ? { ...topping, selected } : topping))
129
+ );
130
+ }
131
+
132
+ protected selectAll(selected: boolean): void {
133
+ this.toppings.update(toppings => toppings.map(topping => ({ ...topping, selected })));
134
+ }
135
+ }
136
+ ```
137
+
138
+ `indeterminate-example.component.html`
139
+
140
+ ```html
141
+ <div class="flex flex-col items-start gap-2">
142
+ <mona-check-box
143
+ label="All toppings"
144
+ [checked]="allSelected()"
145
+ [indeterminate]="someSelected()"
146
+ (checkedChange)="selectAll($event)" />
147
+ <div class="ms-6 flex flex-col items-start gap-2">
148
+ @for (topping of toppings(); track topping.name) {
149
+ <mona-check-box
150
+ [checked]="topping.selected"
151
+ [label]="topping.name"
152
+ (checkedChange)="select(topping.name, $event)" />
153
+ }
154
+ </div>
155
+ </div>
156
+ ```
157
+
158
+ A user change clears it and then toggles `checked`, as on a native checkbox, and `indeterminateChange` emits `false`. A one-way `[indeterminate]` binding only writes again when its bound value changes: if it stays `true` after a click, the dash stays gone. Use `[(indeterminate)]`, or recompute the bound value after each change, as this example does.
159
+
160
+ ### Signal forms
161
+
162
+ `CheckBoxComponent` implements `FormCheckboxControl` from `@angular/forms/signals`, so it takes `[formField]`. `FormField` writes `checked`, `disabled`, `invalid`, `name`, `readonly`, `required` and `touched`. Don't set those on the same element, because Angular rejects the template. The signal forms `required` rule treats an unchecked box as empty.
163
+
164
+ `forms-example.component.ts`
165
+
166
+ ```typescript
167
+ import { Component, signal } from "@angular/core";
168
+ import { form, FormField, required } from "@angular/forms/signals";
169
+ import { CheckBoxComponent } from "@nanahoshi/mona-ui/check-box";
170
+
171
+ @Component({
172
+ selector: "app-checkbox-forms-example",
173
+ imports: [CheckBoxComponent, FormField],
174
+ templateUrl: "./forms-example.component.html"
175
+ })
176
+ export class CheckboxFormsExampleComponent {
177
+ readonly #model = signal({ newsletter: false, terms: false });
178
+ protected readonly signup = form(this.#model, path => {
179
+ required(path.terms, { message: "Accept the terms to continue." });
180
+ });
181
+ }
182
+ ```
183
+
184
+ `forms-example.component.html`
185
+
186
+ ```html
187
+ <div class="flex flex-col items-start gap-3">
188
+ <mona-check-box label="Send me the monthly newsletter" [formField]="signup.newsletter" />
189
+ <mona-check-box
190
+ aria-describedby="checkbox-terms-error"
191
+ label="I accept the terms of service"
192
+ [formField]="signup.terms" />
193
+ <p aria-live="polite" class="text-sm text-error" id="checkbox-terms-error">
194
+ @if (signup.terms().touched()) {
195
+ @for (error of signup.terms().errors(); track error.kind) {
196
+ {{ error.message }}
197
+ }
198
+ }
199
+ </p>
200
+ <p class="text-sm">Form valid: {{ signup().valid() ? "yes" : "no" }}</p>
201
+ </div>
202
+ ```
203
+
204
+ ### The directive
205
+
206
+ The directive leaves all label composition and form wiring to the consumer. The native `<input>` retains its standard keyboard behavior, form submission semantics, and Angular forms support.
207
+
208
+ `directive-example.component.ts`
209
+
210
+ ```typescript
211
+ import { Component, signal } from "@angular/core";
212
+ import { CheckboxDirective } from "@nanahoshi/mona-ui/check-box";
213
+
214
+ @Component({
215
+ selector: "app-checkbox-directive-example",
216
+ imports: [CheckboxDirective],
217
+ templateUrl: "./directive-example.component.html"
218
+ })
219
+ export class CheckboxDirectiveExampleComponent {
220
+ protected readonly chosen = signal<readonly string[]>(["Comments"]);
221
+ protected readonly topics = ["Comments", "Mentions", "New followers"];
222
+
223
+ protected toggle(topic: string, event: Event): void {
224
+ const { checked } = event.target as HTMLInputElement;
225
+ this.chosen.update(chosen => (checked ? [...chosen, topic] : chosen.filter(item => item !== topic)));
226
+ }
227
+ }
228
+ ```
229
+
230
+ `directive-example.component.html`
231
+
232
+ ```html
233
+ <fieldset class="flex flex-col gap-2">
234
+ <legend class="mb-1 text-sm font-medium">Notify me about</legend>
235
+ @for (topic of topics; track topic) {
236
+ <label class="flex items-center gap-2 text-sm">
237
+ <input monaCheckbox type="checkbox" [checked]="chosen().includes(topic)" (change)="toggle(topic, $event)" />
238
+ {{ topic }}
239
+ </label>
240
+ }
241
+ </fieldset>
242
+ <p class="mt-3 text-sm">Notifying about: {{ chosen().join(", ") || "nothing" }}</p>
243
+ ```
244
+
245
+ ## Appearance & Styling
246
+
247
+ ### Rounded presets
248
+
249
+ Both `CheckBoxComponent` and `CheckboxDirective` accept the same `rounded` input:
250
+
251
+ | `rounded` | Shape |
252
+ |-----------|-----------------------------|
253
+ | `none` | No rounding |
254
+ | `small` | Slight rounding |
255
+ | `medium` | Moderate rounding (default) |
256
+ | `large` | Strong rounding |
257
+ | `full` | Pill / fully rounded |
258
+
259
+ ### Visual states
260
+
261
+ | State | Appearance |
262
+ |-----------------|------------------------------------------------------------|
263
+ | Unchecked | Empty box with the theme's input background and border |
264
+ | Checked | Filled box using the primary color, with a checkmark |
265
+ | Indeterminate | Filled box using the primary color, with a dash indicator |
266
+ | Focused | Focus border and ring |
267
+ | Disabled | Disabled colors, no pointer interaction |
268
+ | Read-only | Default cursor, otherwise unchanged |
269
+ | Invalid (forms) | Error border and ring |
270
+
271
+ On the component, the invalid state shows once `touched` is `true` and either `invalid` is `true` or `required` is `true` and the box is unchecked. On the directive it needs both `invalid` and `touched`.
272
+
273
+ ### Label size (component only)
274
+
275
+ | `labelSize` | Description |
276
+ |-------------|-------------------------------|
277
+ | `small` | Compact label text |
278
+ | `medium` | Standard label text (default) |
279
+ | `large` | Larger label text |
280
+
281
+ ### Custom classes
282
+
283
+ Use the `class` input to extend styles. On `CheckBoxComponent` it targets the outer `<label>` container; on `CheckboxDirective` it targets the `<input>` element directly:
284
+
285
+ ```html
286
+
287
+ <mona-check-box label="Bold label" class="font-semibold"></mona-check-box>
288
+ <input type="checkbox" monaCheckbox class="my-2" />
289
+ ```
290
+
291
+ ## Behavior
292
+
293
+ ### Read-only
294
+
295
+ `readonly` cancels the click, so the value and the indeterminate state don't change. The control stays focusable and readable, and the native input gets `aria-readonly="true"`. With `[formField]`, the signal forms `readonly` rule writes it.
296
+
297
+ `CheckboxDirective` has no `readonly` input, and the HTML `readonly` attribute has no effect on a native checkbox.
298
+
299
+ ## Accessibility
300
+
301
+ `CheckBoxComponent` renders the native `<input type="checkbox">` as visually hidden but accessible to screen readers. The native input's `aria-label` is the `aria-label` input, or else the `label` text. When both are empty, the accessible name comes from the wrapping `<label>` element, which includes any projected content. Always provide a `label`, meaningful projected content, `aria-label` or `aria-labelledby`.
302
+
303
+ `CheckBoxComponent` renders its own `<label>`, so don't wrap it in `mona-label`. To label it from outside, bind a `mona-label` or `label[monaLabel]` to it with `[for]="ref"`, or point a `for` at its `inputId`. A click on such a label toggles the box.
304
+
305
+ When `indeterminate` is `true`, the component sets `aria-checked="mixed"` on the native input, which is the correct ARIA value for a partially selected checkbox (e.g., a "select all" control with some children selected).
306
+
307
+ Keyboard interaction is handled by the underlying native input. Space toggles the checked state; Enter does not activate checkboxes (browser default for `<input type="checkbox">`).
308
+
309
+ Native `<input type="checkbox">` elements are included in the tab order by default; `CheckboxDirective` does not override this behavior.
310
+
311
+ ## API
312
+
313
+ Everything below is imported from `@nanahoshi/mona-ui/check-box`.
314
+
315
+ ### `CheckBoxComponent`
316
+
317
+ **Selector:** `mona-check-box`
318
+ **Implements:** `FormCheckboxControl`
319
+
320
+ #### Inputs
321
+
322
+ | Name | Type | Default | Description |
323
+ | --- | --- | --- | --- |
324
+ | `aria-describedby` | `string` | `""` | Id of an element that describes the check box, such as an error message. |
325
+ | `aria-label` | `string` | `""` | Accessible name of the check box when it has no visible label. |
326
+ | `aria-labelledby` | `string` | `""` | Id of the element that labels the check box. |
327
+ | `checked` (two-way) | `boolean` | `false` | Whether the control is checked. |
328
+ | `class` | `string` | `""` | Additional CSS classes merged onto the label container via `tailwind-merge`. |
329
+ | `disabled` | `boolean` | `false` | Renders the component with reduced visual emphasis and removes pointer interaction. |
330
+ | `indeterminate` | `boolean` | `false` | Activates indeterminate mode, showing a dash instead of a checkmark. A user change clears it, as it does on a native checkbox. Use `[(indeterminate)]` to follow that, because a one-way binding only writes again when the bound value changes. |
331
+ | `inputId` | `string` | `generated` | Id of the native checkbox input. Point a `<label for>` at it to label the check box from outside. A unique id is generated when it isn't set. |
332
+ | `invalid` | `boolean` | `false` | Marks the checkbox as invalid. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
333
+ | `label` | `string` | `""` | Text label displayed alongside the checkbox. When provided, takes precedence over projected content. |
334
+ | `labelPosition` | `"before" \| "after"` | `"after"` | Position of the label relative to the checkbox. |
335
+ | `labelSize` | `"large" \| "medium" \| "small"` | `"medium"` | Controls the font size of the label text. |
336
+ | `name` | `string` | `""` | Name of the native checkbox input, used in native form submission. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
337
+ | `readonly` | `boolean` | `false` | Prevents value changes while the control stays focusable and readable. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
338
+ | `required` | `boolean` | `false` | Marks the control as required for form validation. |
339
+ | `rounded` | `"full" \| "large" \| "medium" \| "none" \| "small"` | `"medium"` | Border-radius preset applied to the checkmark box. |
340
+ | `tabIndex` | `number` | `0` | Tab index of the native checkbox input. |
341
+ | `touched` | `boolean` | `false` | Marks the checkbox as touched. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive. |
342
+
343
+ #### Outputs
344
+
345
+ | Name | Type | Description |
346
+ | --- | --- | --- |
347
+ | `checkedChange` | `boolean` | Emitted when `checked` changes. |
348
+ | `indeterminateChange` | `boolean` | Emitted with `false` when a user change clears the indeterminate mode. |
349
+ | `inputBlur` | `FocusEvent` | Emitted when the checkbox input loses focus. |
350
+ | `inputChange` | `Event` | Emitted when the checkbox value changes. |
351
+ | `inputFocus` | `FocusEvent` | Emitted when the checkbox input gains focus. |
352
+ | `touch` | `void` | Emitted when the checkbox loses focus or its value changes. |
353
+
354
+ #### Methods
355
+
356
+ | Signature | Description |
357
+ | --- | --- |
358
+ | `focus(options?: FocusOptions): void` | Moves focus to the native checkbox input. |
359
+
360
+ ### `CheckboxDirective`
361
+
362
+ Applies Mona UI styling to a native `<input type="checkbox">`. All native checkbox behaviors — keyboard interaction,
363
+ form submission, `indeterminate` state, and Angular forms directives — are preserved.
364
+
365
+ **Selector:** `input[type='checkbox'][monaCheckbox]`
366
+
367
+ #### Inputs
368
+
369
+ | Name | Type | Default | Description |
370
+ | --- | --- | --- | --- |
371
+ | `class` | `string` | `""` | Additional CSS classes merged onto the host element via `tailwind-merge`. |
372
+ | `invalid` | `boolean` | `false` | Marks the checkbox as invalid, triggering error border and ring styling. |
373
+ | `rounded` | `"full" \| "large" \| "medium" \| "none" \| "small"` | `"medium"` | Border-radius preset applied to the checkbox. |
374
+ | `touched` | `boolean` | `false` | Marks the checkbox as touched. Error styling is only shown when both `invalid` and `touched` are `true`. |