@nanahoshi/mona-ui 0.1.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 (134) hide show
  1. package/README.md +25 -0
  2. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +590 -0
  3. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +168 -0
  4. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +220 -0
  5. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +225 -0
  6. package/fesm2022/nanahoshi-mona-ui-button.mjs +497 -0
  7. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +1569 -0
  8. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +339 -0
  9. package/fesm2022/nanahoshi-mona-ui-chip.mjs +453 -0
  10. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +200 -0
  11. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +853 -0
  12. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +923 -0
  13. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +495 -0
  14. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +686 -0
  15. package/fesm2022/nanahoshi-mona-ui-common.mjs +642 -0
  16. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +485 -0
  17. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +132 -0
  18. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +460 -0
  19. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +659 -0
  20. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +828 -0
  21. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +523 -0
  22. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +615 -0
  23. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +701 -0
  24. package/fesm2022/nanahoshi-mona-ui-editor.mjs +1400 -0
  25. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +245 -0
  26. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +170 -0
  27. package/fesm2022/nanahoshi-mona-ui-filter.mjs +680 -0
  28. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs +105 -0
  29. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DlLwcCFT.mjs +42 -0
  30. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Dgea-O0X.mjs +130 -0
  31. package/fesm2022/nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs +773 -0
  32. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DRHycGIh.mjs +240 -0
  33. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs +5374 -0
  34. package/fesm2022/nanahoshi-mona-ui-grid.mjs +2 -0
  35. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +87 -0
  36. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +154 -0
  37. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +1356 -0
  38. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2263 -0
  39. package/fesm2022/nanahoshi-mona-ui-internal.mjs +379 -0
  40. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +630 -0
  41. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +527 -0
  42. package/fesm2022/nanahoshi-mona-ui-list.mjs +4 -0
  43. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +966 -0
  44. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +641 -0
  45. package/fesm2022/nanahoshi-mona-ui-notification.mjs +536 -0
  46. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +597 -0
  47. package/fesm2022/nanahoshi-mona-ui-pager.mjs +790 -0
  48. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +83 -0
  49. package/fesm2022/nanahoshi-mona-ui-popover.mjs +325 -0
  50. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +1559 -0
  51. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1321 -0
  52. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +294 -0
  53. package/fesm2022/nanahoshi-mona-ui-query.mjs +175 -0
  54. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +339 -0
  55. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +565 -0
  56. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1049 -0
  57. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +636 -0
  58. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +843 -0
  59. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +537 -0
  60. package/fesm2022/nanahoshi-mona-ui-switch.mjs +308 -0
  61. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +664 -0
  62. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +111 -0
  63. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +369 -0
  64. package/fesm2022/nanahoshi-mona-ui-theme.mjs +314 -0
  65. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +450 -0
  66. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +723 -0
  67. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +716 -0
  68. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +733 -0
  69. package/fesm2022/nanahoshi-mona-ui-window.mjs +1329 -0
  70. package/fesm2022/nanahoshi-mona-ui.mjs +9 -0
  71. package/package.json +289 -0
  72. package/types/nanahoshi-mona-ui-auto-complete.d.ts +223 -0
  73. package/types/nanahoshi-mona-ui-avatar.d.ts +642 -0
  74. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +70 -0
  75. package/types/nanahoshi-mona-ui-button-group.d.ts +77 -0
  76. package/types/nanahoshi-mona-ui-button.d.ts +111 -0
  77. package/types/nanahoshi-mona-ui-calendar.d.ts +262 -0
  78. package/types/nanahoshi-mona-ui-check-box.d.ts +133 -0
  79. package/types/nanahoshi-mona-ui-chip.d.ts +130 -0
  80. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +113 -0
  81. package/types/nanahoshi-mona-ui-color-gradient.d.ts +201 -0
  82. package/types/nanahoshi-mona-ui-color-palette.d.ts +102 -0
  83. package/types/nanahoshi-mona-ui-color-picker.d.ts +156 -0
  84. package/types/nanahoshi-mona-ui-combo-box.d.ts +232 -0
  85. package/types/nanahoshi-mona-ui-common.d.ts +386 -0
  86. package/types/nanahoshi-mona-ui-contextmenu.d.ts +129 -0
  87. package/types/nanahoshi-mona-ui-date-input.d.ts +60 -0
  88. package/types/nanahoshi-mona-ui-date-picker.d.ts +177 -0
  89. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +199 -0
  90. package/types/nanahoshi-mona-ui-dialog.d.ts +261 -0
  91. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +159 -0
  92. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +219 -0
  93. package/types/nanahoshi-mona-ui-dropdowns.d.ts +176 -0
  94. package/types/nanahoshi-mona-ui-editor.d.ts +113 -0
  95. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +87 -0
  96. package/types/nanahoshi-mona-ui-fieldset.d.ts +68 -0
  97. package/types/nanahoshi-mona-ui-filter.d.ts +115 -0
  98. package/types/nanahoshi-mona-ui-grid.d.ts +1114 -0
  99. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +25 -0
  100. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +28 -0
  101. package/types/nanahoshi-mona-ui-internal-list.d.ts +269 -0
  102. package/types/nanahoshi-mona-ui-internal-tree.d.ts +391 -0
  103. package/types/nanahoshi-mona-ui-internal.d.ts +136 -0
  104. package/types/nanahoshi-mona-ui-list-box.d.ts +225 -0
  105. package/types/nanahoshi-mona-ui-list-view.d.ts +188 -0
  106. package/types/nanahoshi-mona-ui-list.d.ts +1 -0
  107. package/types/nanahoshi-mona-ui-menubar.d.ts +198 -0
  108. package/types/nanahoshi-mona-ui-multi-select.d.ts +247 -0
  109. package/types/nanahoshi-mona-ui-notification.d.ts +106 -0
  110. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +161 -0
  111. package/types/nanahoshi-mona-ui-pager.d.ts +238 -0
  112. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -0
  113. package/types/nanahoshi-mona-ui-popover.d.ts +130 -0
  114. package/types/nanahoshi-mona-ui-popup-menu.d.ts +412 -0
  115. package/types/nanahoshi-mona-ui-popup.d.ts +485 -0
  116. package/types/nanahoshi-mona-ui-progress-bar.d.ts +139 -0
  117. package/types/nanahoshi-mona-ui-query.d.ts +89 -0
  118. package/types/nanahoshi-mona-ui-radio-button.d.ts +128 -0
  119. package/types/nanahoshi-mona-ui-scroll-view.d.ts +166 -0
  120. package/types/nanahoshi-mona-ui-slider.d.ts +305 -0
  121. package/types/nanahoshi-mona-ui-split-button.d.ts +182 -0
  122. package/types/nanahoshi-mona-ui-splitter.d.ts +70 -0
  123. package/types/nanahoshi-mona-ui-stepper.d.ts +173 -0
  124. package/types/nanahoshi-mona-ui-switch.d.ts +125 -0
  125. package/types/nanahoshi-mona-ui-tabs.d.ts +158 -0
  126. package/types/nanahoshi-mona-ui-text-area.d.ts +42 -0
  127. package/types/nanahoshi-mona-ui-text-box.d.ts +164 -0
  128. package/types/nanahoshi-mona-ui-theme.d.ts +23 -0
  129. package/types/nanahoshi-mona-ui-time-picker.d.ts +184 -0
  130. package/types/nanahoshi-mona-ui-time-selector.d.ts +143 -0
  131. package/types/nanahoshi-mona-ui-tooltip.d.ts +130 -0
  132. package/types/nanahoshi-mona-ui-tree-view.d.ts +274 -0
  133. package/types/nanahoshi-mona-ui-window.d.ts +295 -0
  134. package/types/nanahoshi-mona-ui.d.ts +2 -0
@@ -0,0 +1,339 @@
1
+ import { NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, computed, model, input, output, Component, Directive } from '@angular/core';
4
+ import * as i1 from '@angular/forms';
5
+ import { FormsModule } from '@angular/forms';
6
+ import { ThemeService } from '@nanahoshi/mona-ui/theme';
7
+ import { twMerge } from 'tailwind-merge';
8
+ import { cva } from 'class-variance-authority';
9
+
10
+ const checkboxVariants = cva(`sr-only appearance-none outline-none peer`);
11
+ const checkmarkVariants = cva(`
12
+ flex items-center justify-center
13
+ w-4.5 h-4.5 pl-0.25
14
+ overflow-hidden outline-none
15
+
16
+ bg-input-background border border-input-border
17
+ cursor-pointer
18
+
19
+ data-[disabled='true']:pointer-events-none
20
+ data-[disabled='true']:cursor-not-allowed
21
+ data-[disabled='true']:opacity-50
22
+
23
+ peer-focus-visible:ring-2 peer-focus-visible:ring-primary/40
24
+ peer-focus-visible:border-primary
25
+
26
+ peer-checked:bg-primary
27
+ peer-checked:text-primary-foreground
28
+
29
+ peer-indeterminate:bg-primary
30
+ peer-indeterminate:text-primary-foreground
31
+ peer-indeterminate:after:content-['']
32
+ peer-indeterminate:after:absolute
33
+ peer-indeterminate:after:inset-[3px_0_3px_0]
34
+ peer-indeterminate:after:[mask-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23FFFFFF'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2012h14'%2F%3E%3C%2Fsvg%3E")]
35
+ peer-indeterminate:after:[mask-repeat:no-repeat]
36
+ peer-indeterminate:after:[mask-size:contain]
37
+ peer-indeterminate:after:bg-current
38
+
39
+ [&.ng-touched.ng-invalid]:border-error
40
+
41
+ data-[invalid='true']:border-error
42
+ data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/40
43
+ `, {
44
+ variants: {
45
+ rounded: {
46
+ full: "rounded-full",
47
+ large: "rounded-lg",
48
+ medium: "rounded-md",
49
+ none: "rounded-none",
50
+ small: "rounded-sm"
51
+ }
52
+ }
53
+ });
54
+ const checkboxContainerLabelVariants = cva(`
55
+ w-full h-full
56
+ inline-flex items-center gap-2
57
+ relative
58
+
59
+ select-none
60
+
61
+ data-[disabled='true']:pointer-events-none
62
+ data-[disabled='true']:cursor-not-allowed
63
+ data-[disabled='true']:opacity-50
64
+ `, {
65
+ variants: {
66
+ labelSize: {
67
+ large: "text-lg",
68
+ medium: "text-md",
69
+ small: "text-sm"
70
+ }
71
+ }
72
+ });
73
+ const checkboxDirectiveVariants = cva(`
74
+ appearance-none outline-none
75
+ w-4.5 h-4.5
76
+ bg-input-background border border-input-border
77
+ cursor-pointer
78
+ relative
79
+
80
+ disabled:pointer-events-none
81
+ disabled:cursor-not-allowed
82
+ disabled:opacity-50
83
+
84
+ checked:text-primary-foreground
85
+ indeterminate:text-primary-foreground
86
+ indeterminate:bg-primary
87
+ checked:bg-primary
88
+
89
+ focus-visible:ring-2 focus-visible:ring-primary/40
90
+ focus-visible:border-primary
91
+
92
+ checked:after:content-['']
93
+ checked:after:absolute
94
+ checked:after:inset-[1px_0_0_1px]
95
+ checked:after:[mask-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23FFFFFF'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M18%206%209%2017l-5-5'/%3E%3C/svg%3E")]
96
+ checked:after:[mask-repeat:no-repeat]
97
+ checked:after:[mask-size:contain]
98
+ checked:after:bg-current
99
+
100
+ indeterminate:after:content-['']
101
+ indeterminate:after:absolute
102
+ indeterminate:after:inset-[1px_0_1px_1px]
103
+ indeterminate:after:[mask-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23FFFFFF'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2012h14'%2F%3E%3C%2Fsvg%3E")]
104
+ indeterminate:after:[mask-repeat:no-repeat]
105
+ indeterminate:after:[mask-size:contain]
106
+ indeterminate:after:bg-current
107
+
108
+ [&.ng-touched.ng-invalid]:border-error
109
+ `, {
110
+ variants: {
111
+ rounded: {
112
+ full: "rounded-full",
113
+ large: "rounded-lg",
114
+ medium: "rounded-md",
115
+ none: "rounded-none",
116
+ small: "rounded-sm"
117
+ }
118
+ }
119
+ });
120
+
121
+ const checkboxInputThemeVariants = (theme) => {
122
+ switch (theme) {
123
+ case "mona":
124
+ return checkboxVariants;
125
+ default:
126
+ return checkboxVariants;
127
+ }
128
+ };
129
+ const checkmarkThemeVariants = (theme) => {
130
+ switch (theme) {
131
+ case "mona":
132
+ return checkmarkVariants;
133
+ default:
134
+ return checkmarkVariants;
135
+ }
136
+ };
137
+ const checkboxContainerLabelThemeVariants = (theme) => {
138
+ switch (theme) {
139
+ case "mona":
140
+ return checkboxContainerLabelVariants;
141
+ default:
142
+ return checkboxContainerLabelVariants;
143
+ }
144
+ };
145
+ const checkboxDirectiveThemeVariants = (theme) => {
146
+ switch (theme) {
147
+ case "mona":
148
+ return checkboxDirectiveVariants;
149
+ default:
150
+ return checkboxDirectiveVariants;
151
+ }
152
+ };
153
+
154
+ class CheckBoxComponent {
155
+ constructor() {
156
+ this.#themeService = inject(ThemeService);
157
+ this.checkBoxClasses = computed(() => {
158
+ const theme = this.#themeService.theme();
159
+ return checkboxInputThemeVariants(theme)();
160
+ }, /* @ts-ignore */
161
+ ...(ngDevMode ? [{ debugName: "checkBoxClasses" }] : /* istanbul ignore next */ []));
162
+ this.checkMarkClasses = computed(() => {
163
+ const theme = this.#themeService.theme();
164
+ const rounded = this.rounded();
165
+ return checkmarkThemeVariants(theme)({ rounded });
166
+ }, /* @ts-ignore */
167
+ ...(ngDevMode ? [{ debugName: "checkMarkClasses" }] : /* istanbul ignore next */ []));
168
+ this.containerLabelClasses = computed(() => {
169
+ const theme = this.#themeService.theme();
170
+ const labelSize = this.labelSize();
171
+ const classes = this.userClass();
172
+ const variantClasses = checkboxContainerLabelThemeVariants(theme)({ labelSize });
173
+ return twMerge(variantClasses, classes);
174
+ }, /* @ts-ignore */
175
+ ...(ngDevMode ? [{ debugName: "containerLabelClasses" }] : /* istanbul ignore next */ []));
176
+ this.invalidState = computed(() => this.invalid() || (this.required() && this.touched() && !this.checked()), /* @ts-ignore */
177
+ ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
178
+ /**
179
+ * @description Whether the control is checked.
180
+ * @default false
181
+ */
182
+ this.checked = model(false, /* @ts-ignore */
183
+ ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
184
+ /**
185
+ * @description Renders the component with reduced visual emphasis and removes pointer interaction.
186
+ * @default false
187
+ */
188
+ this.disabled = input(false, /* @ts-ignore */
189
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
190
+ /**
191
+ * @description Activates indeterminate mode, showing a dash instead of a checkmark.
192
+ * @default false
193
+ */
194
+ this.indeterminate = input(false, /* @ts-ignore */
195
+ ...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
196
+ /**
197
+ * @description Emitted when the checkbox input loses focus.
198
+ */
199
+ this.inputBlur = output();
200
+ /**
201
+ * @description Emitted when the checkbox value changes.
202
+ */
203
+ this.inputChange = output();
204
+ /**
205
+ * @description Emitted when the checkbox input gains focus.
206
+ */
207
+ this.inputFocus = output();
208
+ /**
209
+ * @description Marks the checkbox as invalid. When bound to a signal form field via `[field]`,
210
+ * this is written by the signal forms `Field` directive.
211
+ * @default false
212
+ */
213
+ this.invalid = input(false, /* @ts-ignore */
214
+ ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
215
+ /**
216
+ * @description Text label displayed alongside the checkbox. When provided, takes precedence over projected content.
217
+ * @default ""
218
+ */
219
+ this.label = input("", /* @ts-ignore */
220
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
221
+ /**
222
+ * @description Position of the label relative to the checkbox.
223
+ * @default "after"
224
+ */
225
+ this.labelPosition = input("after", /* @ts-ignore */
226
+ ...(ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []));
227
+ /**
228
+ * @description Controls the font size of the label text.
229
+ * @default "medium"
230
+ */
231
+ this.labelSize = input("medium", /* @ts-ignore */
232
+ ...(ngDevMode ? [{ debugName: "labelSize" }] : /* istanbul ignore next */ []));
233
+ /**
234
+ * @description Marks the control as required for form validation.
235
+ * @default false
236
+ */
237
+ this.required = input(false, /* @ts-ignore */
238
+ ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
239
+ /**
240
+ * @description Border-radius preset applied to the checkmark box.
241
+ * @default "medium"
242
+ */
243
+ this.rounded = input("medium", /* @ts-ignore */
244
+ ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
245
+ /**
246
+ * @description Tab index of the native checkbox input.
247
+ * @default 0
248
+ */
249
+ this.tabIndex = input(0, /* @ts-ignore */
250
+ ...(ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []));
251
+ /**
252
+ * @description Emitted when the checkbox loses focus or its value changes.
253
+ */
254
+ this.touch = output();
255
+ /**
256
+ * @description Marks the checkbox as touched. When bound to a signal form field via `[field]`,
257
+ * this is written by the signal forms `Field` directive.
258
+ * @default false
259
+ */
260
+ this.touched = input(false, /* @ts-ignore */
261
+ ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
262
+ /**
263
+ * @description Additional CSS classes merged onto the label container via `tailwind-merge`.
264
+ * @default ""
265
+ */
266
+ this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
267
+ }
268
+ #themeService;
269
+ onCheckedChange(checked) {
270
+ this.checked.set(checked);
271
+ }
272
+ onInputChange(event) {
273
+ this.inputChange.emit(event);
274
+ this.touch.emit();
275
+ }
276
+ onInputBlur(event) {
277
+ this.inputBlur.emit(event);
278
+ this.touch.emit();
279
+ }
280
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
281
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: CheckBoxComponent, isStandalone: true, selector: "mona-check-box", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, labelSize: { classPropertyName: "labelSize", publicName: "labelSize", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", inputBlur: "inputBlur", inputChange: "inputChange", inputFocus: "inputFocus", touch: "touch" }, host: { properties: { "class": "'flex'", "attr.data-checked": "checked()", "attr.data-disabled": "disabled()", "attr.data-indeterminate": "indeterminate()" } }, ngImport: i0, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\r\n @if (labelPosition() === \"before\") {\r\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\r\n }\r\n\r\n <input\r\n type=\"checkbox\"\r\n [disabled]=\"disabled()\"\r\n [indeterminate]=\"indeterminate()\"\r\n [required]=\"required()\"\r\n [ngModel]=\"checked()\"\r\n [tabindex]=\"disabled() ? -1 : tabIndex()\"\r\n [class]=\"checkBoxClasses()\"\r\n [attr.aria-checked]=\"indeterminate() ? 'mixed' : null\"\r\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\r\n [attr.aria-label]=\"label() || null\"\r\n (change)=\"onInputChange($event)\"\r\n (blur)=\"onInputBlur($event)\"\r\n (focus)=\"inputFocus.emit($event)\"\r\n (ngModelChange)=\"onCheckedChange($event)\"\r\n #checkBox />\r\n\r\n <span [class]=\"checkMarkClasses()\" [attr.data-invalid]=\"invalidState() || null\" aria-hidden=\"true\">\r\n @if (checked()) {\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"16\"\r\n height=\"16\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n class=\"lucide lucide-check stroke-primary-foreground\">\r\n <path d=\"M18 6 9 17l-5-5\" />\r\n </svg>\r\n }\r\n </span>\r\n @if (labelPosition() === \"after\") {\r\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\r\n }\r\n</label>\r\n\r\n<ng-template #labelTemplate>\r\n @if (label()) {\r\n <span>{{ label() }}</span>\r\n } @else {\r\n <ng-content></ng-content>\r\n }\r\n</ng-template>\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
282
+ }
283
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckBoxComponent, decorators: [{
284
+ type: Component,
285
+ args: [{ selector: "mona-check-box", imports: [FormsModule, NgTemplateOutlet], host: {
286
+ "[class]": "'flex'",
287
+ "[attr.data-checked]": "checked()",
288
+ "[attr.data-disabled]": "disabled()",
289
+ "[attr.data-indeterminate]": "indeterminate()"
290
+ }, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\r\n @if (labelPosition() === \"before\") {\r\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\r\n }\r\n\r\n <input\r\n type=\"checkbox\"\r\n [disabled]=\"disabled()\"\r\n [indeterminate]=\"indeterminate()\"\r\n [required]=\"required()\"\r\n [ngModel]=\"checked()\"\r\n [tabindex]=\"disabled() ? -1 : tabIndex()\"\r\n [class]=\"checkBoxClasses()\"\r\n [attr.aria-checked]=\"indeterminate() ? 'mixed' : null\"\r\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\r\n [attr.aria-label]=\"label() || null\"\r\n (change)=\"onInputChange($event)\"\r\n (blur)=\"onInputBlur($event)\"\r\n (focus)=\"inputFocus.emit($event)\"\r\n (ngModelChange)=\"onCheckedChange($event)\"\r\n #checkBox />\r\n\r\n <span [class]=\"checkMarkClasses()\" [attr.data-invalid]=\"invalidState() || null\" aria-hidden=\"true\">\r\n @if (checked()) {\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"16\"\r\n height=\"16\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n class=\"lucide lucide-check stroke-primary-foreground\">\r\n <path d=\"M18 6 9 17l-5-5\" />\r\n </svg>\r\n }\r\n </span>\r\n @if (labelPosition() === \"after\") {\r\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\r\n }\r\n</label>\r\n\r\n<ng-template #labelTemplate>\r\n @if (label()) {\r\n <span>{{ label() }}</span>\r\n } @else {\r\n <ng-content></ng-content>\r\n }\r\n</ng-template>\r\n" }]
291
+ }], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputChange: [{ type: i0.Output, args: ["inputChange"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], labelSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelSize", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
292
+
293
+ class CheckboxDirective {
294
+ constructor() {
295
+ this.#themeService = inject(ThemeService);
296
+ this.classes = computed(() => {
297
+ const theme = this.#themeService.theme();
298
+ const rounded = this.rounded();
299
+ const variantClasses = checkboxDirectiveThemeVariants(theme)({ rounded });
300
+ const userClass = this.userClass();
301
+ return twMerge(variantClasses, userClass);
302
+ }, /* @ts-ignore */
303
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
304
+ /**
305
+ * @description Border-radius preset applied to the checkbox.
306
+ * @default "medium"
307
+ */
308
+ this.rounded = input("medium", /* @ts-ignore */
309
+ ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
310
+ /**
311
+ * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
312
+ * @default ""
313
+ */
314
+ this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
315
+ }
316
+ #themeService;
317
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckboxDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
318
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: CheckboxDirective, isStandalone: true, selector: "input[type='checkbox'][monaCheckbox]", inputs: { rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 }); }
319
+ }
320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckboxDirective, decorators: [{
321
+ type: Directive,
322
+ args: [{
323
+ selector: "input[type='checkbox'][monaCheckbox]",
324
+ host: {
325
+ "[class]": "classes()"
326
+ }
327
+ }]
328
+ }], propDecorators: { rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
329
+
330
+ /*
331
+ * Public API Surface of @nanahoshi/mona-ui/check-box
332
+ */
333
+
334
+ /**
335
+ * Generated bundle index. Do not edit.
336
+ */
337
+
338
+ export { CheckBoxComponent, CheckboxDirective };
339
+ //# sourceMappingURL=nanahoshi-mona-ui-check-box.mjs.map