@nanahoshi/mona-ui 0.27.2 → 0.29.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 (213) hide show
  1. package/docs/api/chart.md +2 -2
  2. package/docs/api/locales.md +8 -0
  3. package/docs/api/popup.md +1 -1
  4. package/docs/api/theme.md +2 -2
  5. package/docs/chart.md +14 -0
  6. package/docs/editor.md +2 -0
  7. package/docs/installation.md +147 -15
  8. package/docs/introduction.md +37 -15
  9. package/docs/theming-built-in-themes.md +67 -0
  10. package/docs/theming-custom-colors.md +274 -0
  11. package/docs/theming-custom-themes.md +168 -0
  12. package/docs/theming.md +164 -248
  13. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
  14. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
  15. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
  16. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
  17. package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
  18. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2071 -1573
  19. package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
  20. package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
  21. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
  22. package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
  23. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
  24. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -390
  25. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
  26. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
  27. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
  28. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
  29. package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
  30. package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -743
  31. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
  32. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -266
  33. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
  34. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
  35. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
  36. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
  37. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
  38. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -734
  39. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
  40. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
  41. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
  42. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
  43. package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
  44. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
  45. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
  46. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
  47. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
  48. package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
  49. package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
  50. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
  51. package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5077
  52. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
  53. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
  54. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
  55. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
  56. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
  57. package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
  58. package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
  59. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
  60. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
  61. package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
  62. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
  63. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
  64. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
  65. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
  66. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
  67. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
  68. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
  69. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
  70. package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +599 -0
  71. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
  72. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
  73. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
  74. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
  75. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
  76. package/fesm2022/nanahoshi-mona-ui-locales.mjs +61 -77
  77. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
  78. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
  79. package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
  80. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
  81. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
  82. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
  83. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
  84. package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
  85. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
  86. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
  87. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
  88. package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
  89. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
  90. package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
  91. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
  92. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
  93. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
  94. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
  95. package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
  96. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
  97. package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
  98. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
  99. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
  100. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
  101. package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
  102. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
  103. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
  104. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
  105. package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
  106. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
  107. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
  108. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
  109. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
  110. package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
  111. package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
  112. package/llms.txt +7 -3
  113. package/locales/pl-pl/package.json +4 -0
  114. package/locales/pl-pl/pl-pl.messages.json +536 -0
  115. package/package.json +66 -23
  116. package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
  117. package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
  118. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
  119. package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
  120. package/types/nanahoshi-mona-ui-button.d.ts +227 -166
  121. package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
  122. package/types/nanahoshi-mona-ui-card.d.ts +125 -111
  123. package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
  124. package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
  125. package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
  126. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
  127. package/types/nanahoshi-mona-ui-collapsible.d.ts +103 -87
  128. package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
  129. package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
  130. package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
  131. package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
  132. package/types/nanahoshi-mona-ui-command.d.ts +279 -191
  133. package/types/nanahoshi-mona-ui-common.d.ts +354 -385
  134. package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
  135. package/types/nanahoshi-mona-ui-date-input.d.ts +79 -96
  136. package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
  137. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
  138. package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
  139. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
  140. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
  141. package/types/nanahoshi-mona-ui-dropdowns.d.ts +231 -217
  142. package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
  143. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
  144. package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
  145. package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
  146. package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
  147. package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
  148. package/types/nanahoshi-mona-ui-i18n.d.ts +987 -1052
  149. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
  150. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
  151. package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
  152. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
  153. package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
  154. package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
  155. package/types/nanahoshi-mona-ui-label.d.ts +108 -78
  156. package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
  157. package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
  158. package/types/nanahoshi-mona-ui-list.d.ts +2 -1
  159. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
  160. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
  161. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
  162. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
  163. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
  164. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
  165. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
  166. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
  167. package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +540 -0
  168. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
  169. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
  170. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
  171. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
  172. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
  173. package/types/nanahoshi-mona-ui-locales.d.ts +18 -19
  174. package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
  175. package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
  176. package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
  177. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
  178. package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
  179. package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
  180. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
  181. package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
  182. package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
  183. package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
  184. package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
  185. package/types/nanahoshi-mona-ui-query.d.ts +82 -88
  186. package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
  187. package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
  188. package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
  189. package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
  190. package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
  191. package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
  192. package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
  193. package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
  194. package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
  195. package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
  196. package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
  197. package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
  198. package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
  199. package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
  200. package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
  201. package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
  202. package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
  203. package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
  204. package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
  205. package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
  206. package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
  207. package/types/nanahoshi-mona-ui-window.d.ts +494 -399
  208. package/types/nanahoshi-mona-ui.d.ts +1 -2
  209. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
  210. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
  211. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
  212. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
  213. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
@@ -1,49 +1,77 @@
1
- import { NgTemplateOutlet } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Directive, inject, ElementRef, computed, viewChild, contentChildren, TemplateRef, input, booleanAttribute, output, model, Component } from '@angular/core';
4
- import { LucideX } from '@lucide/angular';
5
- import { ButtonDirective } from '@nanahoshi/mona-ui/button';
6
- import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
7
- import { themeControlSurfaceClasses, injectLabelAssociation, injectEffectiveDisabled, createElementControlId, AttributeBinderDirective } from '@nanahoshi/mona-ui/internal';
8
- import { twMerge } from 'tailwind-merge';
9
- import { cva } from 'class-variance-authority';
10
-
11
- /**
12
- * Marks an `<ng-template>` as a prefix slot. The template is rendered inside the container's left side. Multiple prefix
13
- * templates are supported and render in source order.
14
- */
15
- class TextBoxPrefixTemplateDirective {
16
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TextBoxPrefixTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
17
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: TextBoxPrefixTemplateDirective, isStandalone: true, selector: "ng-template[monaTextBoxPrefixTemplate]", ngImport: i0 }); }
18
- }
19
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TextBoxPrefixTemplateDirective, decorators: [{
20
- type: Directive,
21
- args: [{
22
- selector: "ng-template[monaTextBoxPrefixTemplate]"
23
- }]
24
- }] });
25
-
26
- /**
27
- * Marks an `<ng-template>` as a suffix slot. The template is rendered inside the container's right side, after the
28
- * optional clear button. Multiple suffix templates are supported and render in source order.
29
- */
30
- class TextBoxSuffixTemplateDirective {
31
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TextBoxSuffixTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
32
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: TextBoxSuffixTemplateDirective, isStandalone: true, selector: "ng-template[monaTextBoxSuffixTemplate]", ngImport: i0 }); }
33
- }
34
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TextBoxSuffixTemplateDirective, decorators: [{
35
- type: Directive,
36
- args: [{
37
- selector: "ng-template[monaTextBoxSuffixTemplate]"
38
- }]
39
- }] });
40
-
41
- // Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
42
- // Edit the JSON file and run `npm run generate:locale-catalogs`.
43
- const TEXT_BOX_DEFAULT_MESSAGES = {
44
- clear: "Clear"
1
+ import { NgTemplateOutlet } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Component, Directive, ElementRef, TemplateRef, booleanAttribute, computed, contentChildren, inject, input, model, output, viewChild } from "@angular/core";
4
+ import { LucideX } from "@lucide/angular";
5
+ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
6
+ import { MonaI18nService } from "@nanahoshi/mona-ui/i18n";
7
+ import { AttributeBinderDirective, createElementControlId, injectEffectiveDisabled, injectLabelAssociation, themeControlSurfaceClasses } from "@nanahoshi/mona-ui/internal";
8
+ import { twMerge } from "tailwind-merge";
9
+ import { cva } from "class-variance-authority";
10
+ var TextBoxPrefixTemplateDirective = class TextBoxPrefixTemplateDirective {
11
+ static {
12
+ this.ɵfac = i0.ɵɵngDeclareFactory({
13
+ minVersion: "12.0.0",
14
+ version: "22.2.6",
15
+ ngImport: i0,
16
+ type: TextBoxPrefixTemplateDirective,
17
+ deps: [],
18
+ target: i0.ɵɵFactoryTarget.Directive
19
+ });
20
+ }
21
+ static {
22
+ this.ɵdir = i0.ɵɵngDeclareDirective({
23
+ minVersion: "14.0.0",
24
+ version: "22.2.6",
25
+ type: TextBoxPrefixTemplateDirective,
26
+ isStandalone: true,
27
+ selector: "ng-template[monaTextBoxPrefixTemplate]",
28
+ ngImport: i0
29
+ });
30
+ }
45
31
  };
46
-
32
+ i0.ɵɵngDeclareClassMetadata({
33
+ minVersion: "12.0.0",
34
+ version: "22.2.6",
35
+ ngImport: i0,
36
+ type: TextBoxPrefixTemplateDirective,
37
+ decorators: [{
38
+ type: Directive,
39
+ args: [{ selector: "ng-template[monaTextBoxPrefixTemplate]" }]
40
+ }]
41
+ });
42
+ var TextBoxSuffixTemplateDirective = class TextBoxSuffixTemplateDirective {
43
+ static {
44
+ this.ɵfac = i0.ɵɵngDeclareFactory({
45
+ minVersion: "12.0.0",
46
+ version: "22.2.6",
47
+ ngImport: i0,
48
+ type: TextBoxSuffixTemplateDirective,
49
+ deps: [],
50
+ target: i0.ɵɵFactoryTarget.Directive
51
+ });
52
+ }
53
+ static {
54
+ this.ɵdir = i0.ɵɵngDeclareDirective({
55
+ minVersion: "14.0.0",
56
+ version: "22.2.6",
57
+ type: TextBoxSuffixTemplateDirective,
58
+ isStandalone: true,
59
+ selector: "ng-template[monaTextBoxSuffixTemplate]",
60
+ ngImport: i0
61
+ });
62
+ }
63
+ };
64
+ i0.ɵɵngDeclareClassMetadata({
65
+ minVersion: "12.0.0",
66
+ version: "22.2.6",
67
+ ngImport: i0,
68
+ type: TextBoxSuffixTemplateDirective,
69
+ decorators: [{
70
+ type: Directive,
71
+ args: [{ selector: "ng-template[monaTextBoxSuffixTemplate]" }]
72
+ }]
73
+ });
74
+ const TEXT_BOX_DEFAULT_MESSAGES = { clear: "Clear" };
47
75
  const textBoxThemeVariants = cva(`
48
76
  flex w-full min-w-0 items-center
49
77
  overflow-hidden
@@ -74,22 +102,20 @@ const textBoxThemeVariants = cva(`
74
102
  [&>input]:bg-transparent
75
103
  [&>input]:border-0 [&>input]:outline-none [&>input:focus-visible]:outline-hidden
76
104
  [&>input]:placeholder:text-muted-foreground
77
- `, {
78
- variants: {
79
- rounded: {
80
- full: "rounded-full",
81
- large: "rounded-lg",
82
- medium: "rounded-md",
83
- none: "rounded-none",
84
- small: "rounded-sm"
85
- },
86
- size: {
87
- large: "h-10 text-base",
88
- medium: "h-9 text-sm",
89
- small: "h-8 text-xs"
90
- }
91
- }
92
- });
105
+ `, { variants: {
106
+ rounded: {
107
+ full: "rounded-full",
108
+ large: "rounded-lg",
109
+ medium: "rounded-md",
110
+ none: "rounded-none",
111
+ small: "rounded-sm"
112
+ },
113
+ size: {
114
+ large: "h-10 text-base",
115
+ medium: "h-9 text-sm",
116
+ small: "h-8 text-xs"
117
+ }
118
+ } });
93
119
  const inputThemeVariants = cva(`
94
120
  px-2
95
121
  ${themeControlSurfaceClasses} text-foreground
@@ -115,318 +141,794 @@ const inputThemeVariants = cva(`
115
141
  data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
116
142
  data-[invalid='true']:focus-visible:border-error
117
143
  data-[invalid='true']:focus-visible:ring-error/35
118
- `, {
119
- variants: {
120
- rounded: {
121
- full: "rounded-full px-4",
122
- large: "rounded-lg",
123
- medium: "rounded-md",
124
- none: "rounded-none",
125
- small: "rounded-sm"
126
- },
127
- size: {
128
- large: "h-10 text-base",
129
- medium: "h-9 text-sm",
130
- small: "h-8 text-xs"
131
- }
132
- }
144
+ `, { variants: {
145
+ rounded: {
146
+ full: "rounded-full px-4",
147
+ large: "rounded-lg",
148
+ medium: "rounded-md",
149
+ none: "rounded-none",
150
+ small: "rounded-sm"
151
+ },
152
+ size: {
153
+ large: "h-10 text-base",
154
+ medium: "h-9 text-sm",
155
+ small: "h-8 text-xs"
156
+ }
157
+ } });
158
+ const selectableInputTypes = /* @__PURE__ */ new Set([
159
+ "password",
160
+ "search",
161
+ "tel",
162
+ "text",
163
+ "url"
164
+ ]);
165
+ var TextBoxComponent = class TextBoxComponent {
166
+ constructor() {
167
+ this.#hostElementRef = inject(ElementRef);
168
+ this.#i18n = inject(MonaI18nService);
169
+ this.#label = injectLabelAssociation({
170
+ ariaLabel: () => this.ariaLabel(),
171
+ ariaLabelledBy: () => this.ariaLabelledBy()
172
+ });
173
+ this.classes = computed(() => {
174
+ const rounded = this.rounded();
175
+ const size = this.size();
176
+ const classes = textBoxThemeVariants({
177
+ rounded,
178
+ size
179
+ });
180
+ const userClass = this.userClass();
181
+ return twMerge(classes, userClass);
182
+ }, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
183
+ this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
184
+ this.inputRef = viewChild.required("input", ...ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []);
185
+ this.invalidInput = computed(() => this.touched() && (this.invalid() || this.required() && !this.value()), ...ngDevMode ? [{ debugName: "invalidInput" }] : /* istanbul ignore next */ []);
186
+ this.labelledBy = this.#label.labelledBy;
187
+ this.messages = this.#i18n.componentMessages("textBox", TEXT_BOX_DEFAULT_MESSAGES);
188
+ this.prefixTemplateList = contentChildren(TextBoxPrefixTemplateDirective, {
189
+ ...ngDevMode ? { debugName: "prefixTemplateList" } : /* istanbul ignore next */ {},
190
+ read: TemplateRef
191
+ });
192
+ this.showClearButton = computed(() => this.clearButton() && !this.effectiveDisabled() && !this.readonly() && !!this.value(), ...ngDevMode ? [{ debugName: "showClearButton" }] : /* istanbul ignore next */ []);
193
+ this.suffixTemplateList = contentChildren(TextBoxSuffixTemplateDirective, {
194
+ ...ngDevMode ? { debugName: "suffixTemplateList" } : /* istanbul ignore next */ {},
195
+ read: TemplateRef
196
+ });
197
+ this.ariaDescribedBy = input("", {
198
+ ...ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {},
199
+ alias: "aria-describedby"
200
+ });
201
+ this.ariaLabel = input("", {
202
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
203
+ alias: "aria-label"
204
+ });
205
+ this.ariaLabelledBy = input("", {
206
+ ...ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {},
207
+ alias: "aria-labelledby"
208
+ });
209
+ this.clearButton = input(false, {
210
+ ...ngDevMode ? { debugName: "clearButton" } : /* istanbul ignore next */ {},
211
+ transform: booleanAttribute
212
+ });
213
+ this.disabled = input(false, {
214
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
215
+ transform: booleanAttribute
216
+ });
217
+ this.inputAttributes = input({}, ...ngDevMode ? [{ debugName: "inputAttributes" }] : /* istanbul ignore next */ []);
218
+ this.inputBlur = output();
219
+ this.inputClass = input("", ...ngDevMode ? [{ debugName: "inputClass" }] : /* istanbul ignore next */ []);
220
+ this.inputFocus = output();
221
+ this.inputId = input(createElementControlId(), ...ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []);
222
+ this.inputStyle = input(null, ...ngDevMode ? [{ debugName: "inputStyle" }] : /* istanbul ignore next */ []);
223
+ this.invalid = input(false, {
224
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
225
+ transform: booleanAttribute
226
+ });
227
+ this.maxLength = input(void 0, ...ngDevMode ? [{ debugName: "maxLength" }] : /* istanbul ignore next */ []);
228
+ this.minLength = input(void 0, ...ngDevMode ? [{ debugName: "minLength" }] : /* istanbul ignore next */ []);
229
+ this.name = input("", ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
230
+ this.placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
231
+ this.readonly = input(false, {
232
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
233
+ transform: booleanAttribute
234
+ });
235
+ this.required = input(false, {
236
+ ...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
237
+ transform: booleanAttribute
238
+ });
239
+ this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
240
+ this.size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
241
+ this.touch = output();
242
+ this.touched = input(false, {
243
+ ...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
244
+ transform: booleanAttribute
245
+ });
246
+ this.type = input("text", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
247
+ this.userClass = input("", {
248
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
249
+ alias: "class"
250
+ });
251
+ this.value = model("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
252
+ }
253
+ #hostElementRef;
254
+ #i18n;
255
+ #label;
256
+ focus(options) {
257
+ const input = this.inputRef().nativeElement;
258
+ input.focus(options);
259
+ if (selectableInputTypes.has(input.type)) {
260
+ const end = input.value.length;
261
+ input.setSelectionRange(end, end);
262
+ }
263
+ }
264
+ onClearClick() {
265
+ this.value.set("");
266
+ this.inputRef().nativeElement.focus();
267
+ }
268
+ onInputBlur(event) {
269
+ this.inputBlur.emit(event);
270
+ }
271
+ onValueChange(value) {
272
+ this.value.set(value);
273
+ }
274
+ setLabelledBy(id) {
275
+ this.#label.setLabelledBy(id);
276
+ }
277
+ onFocusOut(event) {
278
+ const nextTarget = event.relatedTarget;
279
+ if (nextTarget instanceof Node && this.#hostElementRef.nativeElement.contains(nextTarget)) return;
280
+ this.touch.emit();
281
+ }
282
+ static {
283
+ this.ɵfac = i0.ɵɵngDeclareFactory({
284
+ minVersion: "12.0.0",
285
+ version: "22.2.6",
286
+ ngImport: i0,
287
+ type: TextBoxComponent,
288
+ deps: [],
289
+ target: i0.ɵɵFactoryTarget.Component
290
+ });
291
+ }
292
+ static {
293
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
294
+ minVersion: "17.0.0",
295
+ version: "22.2.6",
296
+ type: TextBoxComponent,
297
+ isStandalone: true,
298
+ selector: "mona-text-box",
299
+ inputs: {
300
+ ariaDescribedBy: {
301
+ classPropertyName: "ariaDescribedBy",
302
+ publicName: "aria-describedby",
303
+ isSignal: true,
304
+ isRequired: false,
305
+ transformFunction: null
306
+ },
307
+ ariaLabel: {
308
+ classPropertyName: "ariaLabel",
309
+ publicName: "aria-label",
310
+ isSignal: true,
311
+ isRequired: false,
312
+ transformFunction: null
313
+ },
314
+ ariaLabelledBy: {
315
+ classPropertyName: "ariaLabelledBy",
316
+ publicName: "aria-labelledby",
317
+ isSignal: true,
318
+ isRequired: false,
319
+ transformFunction: null
320
+ },
321
+ clearButton: {
322
+ classPropertyName: "clearButton",
323
+ publicName: "clearButton",
324
+ isSignal: true,
325
+ isRequired: false,
326
+ transformFunction: null
327
+ },
328
+ disabled: {
329
+ classPropertyName: "disabled",
330
+ publicName: "disabled",
331
+ isSignal: true,
332
+ isRequired: false,
333
+ transformFunction: null
334
+ },
335
+ inputAttributes: {
336
+ classPropertyName: "inputAttributes",
337
+ publicName: "inputAttributes",
338
+ isSignal: true,
339
+ isRequired: false,
340
+ transformFunction: null
341
+ },
342
+ inputClass: {
343
+ classPropertyName: "inputClass",
344
+ publicName: "inputClass",
345
+ isSignal: true,
346
+ isRequired: false,
347
+ transformFunction: null
348
+ },
349
+ inputId: {
350
+ classPropertyName: "inputId",
351
+ publicName: "inputId",
352
+ isSignal: true,
353
+ isRequired: false,
354
+ transformFunction: null
355
+ },
356
+ inputStyle: {
357
+ classPropertyName: "inputStyle",
358
+ publicName: "inputStyle",
359
+ isSignal: true,
360
+ isRequired: false,
361
+ transformFunction: null
362
+ },
363
+ invalid: {
364
+ classPropertyName: "invalid",
365
+ publicName: "invalid",
366
+ isSignal: true,
367
+ isRequired: false,
368
+ transformFunction: null
369
+ },
370
+ maxLength: {
371
+ classPropertyName: "maxLength",
372
+ publicName: "maxLength",
373
+ isSignal: true,
374
+ isRequired: false,
375
+ transformFunction: null
376
+ },
377
+ minLength: {
378
+ classPropertyName: "minLength",
379
+ publicName: "minLength",
380
+ isSignal: true,
381
+ isRequired: false,
382
+ transformFunction: null
383
+ },
384
+ name: {
385
+ classPropertyName: "name",
386
+ publicName: "name",
387
+ isSignal: true,
388
+ isRequired: false,
389
+ transformFunction: null
390
+ },
391
+ placeholder: {
392
+ classPropertyName: "placeholder",
393
+ publicName: "placeholder",
394
+ isSignal: true,
395
+ isRequired: false,
396
+ transformFunction: null
397
+ },
398
+ readonly: {
399
+ classPropertyName: "readonly",
400
+ publicName: "readonly",
401
+ isSignal: true,
402
+ isRequired: false,
403
+ transformFunction: null
404
+ },
405
+ required: {
406
+ classPropertyName: "required",
407
+ publicName: "required",
408
+ isSignal: true,
409
+ isRequired: false,
410
+ transformFunction: null
411
+ },
412
+ rounded: {
413
+ classPropertyName: "rounded",
414
+ publicName: "rounded",
415
+ isSignal: true,
416
+ isRequired: false,
417
+ transformFunction: null
418
+ },
419
+ size: {
420
+ classPropertyName: "size",
421
+ publicName: "size",
422
+ isSignal: true,
423
+ isRequired: false,
424
+ transformFunction: null
425
+ },
426
+ touched: {
427
+ classPropertyName: "touched",
428
+ publicName: "touched",
429
+ isSignal: true,
430
+ isRequired: false,
431
+ transformFunction: null
432
+ },
433
+ type: {
434
+ classPropertyName: "type",
435
+ publicName: "type",
436
+ isSignal: true,
437
+ isRequired: false,
438
+ transformFunction: null
439
+ },
440
+ userClass: {
441
+ classPropertyName: "userClass",
442
+ publicName: "class",
443
+ isSignal: true,
444
+ isRequired: false,
445
+ transformFunction: null
446
+ },
447
+ value: {
448
+ classPropertyName: "value",
449
+ publicName: "value",
450
+ isSignal: true,
451
+ isRequired: false,
452
+ transformFunction: null
453
+ }
454
+ },
455
+ outputs: {
456
+ inputBlur: "inputBlur",
457
+ inputFocus: "inputFocus",
458
+ touch: "touch",
459
+ value: "valueChange"
460
+ },
461
+ host: {
462
+ listeners: { "focusout": "onFocusOut($event)" },
463
+ properties: {
464
+ "attr.aria-describedby": "null",
465
+ "attr.aria-label": "null",
466
+ "attr.aria-labelledby": "null",
467
+ "attr.data-disabled": "effectiveDisabled() || null",
468
+ "attr.data-readonly": "readonly() || null",
469
+ "attr.data-required": "required() || null",
470
+ "attr.data-invalid": "invalidInput() || null",
471
+ "class": "classes()"
472
+ }
473
+ },
474
+ queries: [{
475
+ propertyName: "prefixTemplateList",
476
+ predicate: TextBoxPrefixTemplateDirective,
477
+ read: TemplateRef,
478
+ isSignal: true
479
+ }, {
480
+ propertyName: "suffixTemplateList",
481
+ predicate: TextBoxSuffixTemplateDirective,
482
+ read: TemplateRef,
483
+ isSignal: true
484
+ }],
485
+ viewQueries: [{
486
+ propertyName: "inputRef",
487
+ first: true,
488
+ predicate: ["input"],
489
+ descendants: true,
490
+ isSignal: true
491
+ }],
492
+ ngImport: i0,
493
+ template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n </span>\n}\n<input\n [id]=\"inputId()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [placeholder]=\"placeholder()\"\n [type]=\"type()\"\n [class]=\"inputClass()\"\n [style]=\"inputStyle()\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n [attr.aria-invalid]=\"invalidInput() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.maxlength]=\"maxLength() ?? null\"\n [attr.minlength]=\"minLength() ?? null\"\n [attr.name]=\"name() || null\"\n [monaAttributeBinder]=\"inputAttributes()\"\n [value]=\"value()\"\n (input)=\"onValueChange(input.value)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n #input />\n\n@if (showClearButton()) {\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n class=\"me-1 size-6 shrink-0 p-0 text-muted-foreground hover:text-foreground\"\n [attr.aria-label]=\"messages().clear\"\n (click)=\"onClearClick()\">\n <svg lucideX class=\"size-4\"></svg>\n </button>\n}\n\n@for (suffixTemplate of suffixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"suffixTemplate\"></ng-container>\n </span>\n}\n",
494
+ dependencies: [
495
+ {
496
+ kind: "directive",
497
+ type: NgTemplateOutlet,
498
+ selector: "[ngTemplateOutlet]",
499
+ inputs: [
500
+ "ngTemplateOutletContext",
501
+ "ngTemplateOutlet",
502
+ "ngTemplateOutletInjector"
503
+ ]
504
+ },
505
+ {
506
+ kind: "directive",
507
+ type: ButtonDirective,
508
+ selector: "button[monaButton]",
509
+ inputs: [
510
+ "aria-haspopup",
511
+ "disabled",
512
+ "iconOnly",
513
+ "loading",
514
+ "look",
515
+ "rounded",
516
+ "selected",
517
+ "size",
518
+ "tabindex",
519
+ "toggleable",
520
+ "type",
521
+ "class",
522
+ "value"
523
+ ],
524
+ outputs: ["lookChange", "selectedChange"]
525
+ },
526
+ {
527
+ kind: "directive",
528
+ type: AttributeBinderDirective,
529
+ selector: "[monaAttributeBinder]",
530
+ inputs: ["monaAttributeBinder"]
531
+ },
532
+ {
533
+ kind: "component",
534
+ type: LucideX,
535
+ selector: "svg[lucideX]"
536
+ }
537
+ ]
538
+ });
539
+ }
540
+ };
541
+ i0.ɵɵngDeclareClassMetadata({
542
+ minVersion: "12.0.0",
543
+ version: "22.2.6",
544
+ ngImport: i0,
545
+ type: TextBoxComponent,
546
+ decorators: [{
547
+ type: Component,
548
+ args: [{
549
+ selector: "mona-text-box",
550
+ imports: [
551
+ NgTemplateOutlet,
552
+ ButtonDirective,
553
+ AttributeBinderDirective,
554
+ LucideX
555
+ ],
556
+ host: {
557
+ "[attr.aria-describedby]": "null",
558
+ "[attr.aria-label]": "null",
559
+ "[attr.aria-labelledby]": "null",
560
+ "[attr.data-disabled]": "effectiveDisabled() || null",
561
+ "[attr.data-readonly]": "readonly() || null",
562
+ "[attr.data-required]": "required() || null",
563
+ "[attr.data-invalid]": "invalidInput() || null",
564
+ "[class]": "classes()",
565
+ "(focusout)": "onFocusOut($event)"
566
+ },
567
+ template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n </span>\n}\n<input\n [id]=\"inputId()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [placeholder]=\"placeholder()\"\n [type]=\"type()\"\n [class]=\"inputClass()\"\n [style]=\"inputStyle()\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n [attr.aria-invalid]=\"invalidInput() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.maxlength]=\"maxLength() ?? null\"\n [attr.minlength]=\"minLength() ?? null\"\n [attr.name]=\"name() || null\"\n [monaAttributeBinder]=\"inputAttributes()\"\n [value]=\"value()\"\n (input)=\"onValueChange(input.value)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n #input />\n\n@if (showClearButton()) {\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n class=\"me-1 size-6 shrink-0 p-0 text-muted-foreground hover:text-foreground\"\n [attr.aria-label]=\"messages().clear\"\n (click)=\"onClearClick()\">\n <svg lucideX class=\"size-4\"></svg>\n </button>\n}\n\n@for (suffixTemplate of suffixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"suffixTemplate\"></ng-container>\n </span>\n}\n"
568
+ }]
569
+ }],
570
+ propDecorators: {
571
+ inputRef: [{
572
+ type: i0.ViewChild,
573
+ args: ["input", { isSignal: true }]
574
+ }],
575
+ prefixTemplateList: [{
576
+ type: i0.ContentChildren,
577
+ args: [i0.forwardRef(() => TextBoxPrefixTemplateDirective), {
578
+ read: TemplateRef,
579
+ isSignal: true
580
+ }]
581
+ }],
582
+ suffixTemplateList: [{
583
+ type: i0.ContentChildren,
584
+ args: [i0.forwardRef(() => TextBoxSuffixTemplateDirective), {
585
+ read: TemplateRef,
586
+ isSignal: true
587
+ }]
588
+ }],
589
+ ariaDescribedBy: [{
590
+ type: i0.Input,
591
+ args: [{
592
+ isSignal: true,
593
+ alias: "aria-describedby",
594
+ required: false
595
+ }]
596
+ }],
597
+ ariaLabel: [{
598
+ type: i0.Input,
599
+ args: [{
600
+ isSignal: true,
601
+ alias: "aria-label",
602
+ required: false
603
+ }]
604
+ }],
605
+ ariaLabelledBy: [{
606
+ type: i0.Input,
607
+ args: [{
608
+ isSignal: true,
609
+ alias: "aria-labelledby",
610
+ required: false
611
+ }]
612
+ }],
613
+ clearButton: [{
614
+ type: i0.Input,
615
+ args: [{
616
+ isSignal: true,
617
+ alias: "clearButton",
618
+ required: false
619
+ }]
620
+ }],
621
+ disabled: [{
622
+ type: i0.Input,
623
+ args: [{
624
+ isSignal: true,
625
+ alias: "disabled",
626
+ required: false
627
+ }]
628
+ }],
629
+ inputAttributes: [{
630
+ type: i0.Input,
631
+ args: [{
632
+ isSignal: true,
633
+ alias: "inputAttributes",
634
+ required: false
635
+ }]
636
+ }],
637
+ inputBlur: [{
638
+ type: i0.Output,
639
+ args: ["inputBlur"]
640
+ }],
641
+ inputClass: [{
642
+ type: i0.Input,
643
+ args: [{
644
+ isSignal: true,
645
+ alias: "inputClass",
646
+ required: false
647
+ }]
648
+ }],
649
+ inputFocus: [{
650
+ type: i0.Output,
651
+ args: ["inputFocus"]
652
+ }],
653
+ inputId: [{
654
+ type: i0.Input,
655
+ args: [{
656
+ isSignal: true,
657
+ alias: "inputId",
658
+ required: false
659
+ }]
660
+ }],
661
+ inputStyle: [{
662
+ type: i0.Input,
663
+ args: [{
664
+ isSignal: true,
665
+ alias: "inputStyle",
666
+ required: false
667
+ }]
668
+ }],
669
+ invalid: [{
670
+ type: i0.Input,
671
+ args: [{
672
+ isSignal: true,
673
+ alias: "invalid",
674
+ required: false
675
+ }]
676
+ }],
677
+ maxLength: [{
678
+ type: i0.Input,
679
+ args: [{
680
+ isSignal: true,
681
+ alias: "maxLength",
682
+ required: false
683
+ }]
684
+ }],
685
+ minLength: [{
686
+ type: i0.Input,
687
+ args: [{
688
+ isSignal: true,
689
+ alias: "minLength",
690
+ required: false
691
+ }]
692
+ }],
693
+ name: [{
694
+ type: i0.Input,
695
+ args: [{
696
+ isSignal: true,
697
+ alias: "name",
698
+ required: false
699
+ }]
700
+ }],
701
+ placeholder: [{
702
+ type: i0.Input,
703
+ args: [{
704
+ isSignal: true,
705
+ alias: "placeholder",
706
+ required: false
707
+ }]
708
+ }],
709
+ readonly: [{
710
+ type: i0.Input,
711
+ args: [{
712
+ isSignal: true,
713
+ alias: "readonly",
714
+ required: false
715
+ }]
716
+ }],
717
+ required: [{
718
+ type: i0.Input,
719
+ args: [{
720
+ isSignal: true,
721
+ alias: "required",
722
+ required: false
723
+ }]
724
+ }],
725
+ rounded: [{
726
+ type: i0.Input,
727
+ args: [{
728
+ isSignal: true,
729
+ alias: "rounded",
730
+ required: false
731
+ }]
732
+ }],
733
+ size: [{
734
+ type: i0.Input,
735
+ args: [{
736
+ isSignal: true,
737
+ alias: "size",
738
+ required: false
739
+ }]
740
+ }],
741
+ touch: [{
742
+ type: i0.Output,
743
+ args: ["touch"]
744
+ }],
745
+ touched: [{
746
+ type: i0.Input,
747
+ args: [{
748
+ isSignal: true,
749
+ alias: "touched",
750
+ required: false
751
+ }]
752
+ }],
753
+ type: [{
754
+ type: i0.Input,
755
+ args: [{
756
+ isSignal: true,
757
+ alias: "type",
758
+ required: false
759
+ }]
760
+ }],
761
+ userClass: [{
762
+ type: i0.Input,
763
+ args: [{
764
+ isSignal: true,
765
+ alias: "class",
766
+ required: false
767
+ }]
768
+ }],
769
+ value: [{
770
+ type: i0.Input,
771
+ args: [{
772
+ isSignal: true,
773
+ alias: "value",
774
+ required: false
775
+ }]
776
+ }, {
777
+ type: i0.Output,
778
+ args: ["valueChange"]
779
+ }]
780
+ }
781
+ });
782
+ var TextBoxDirective = class TextBoxDirective {
783
+ constructor() {
784
+ this.classes = computed(() => {
785
+ const rounded = this.rounded();
786
+ const size = this.size();
787
+ const classes = inputThemeVariants({
788
+ rounded,
789
+ size
790
+ });
791
+ const userClass = this.userClass();
792
+ return twMerge(classes, userClass);
793
+ }, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
794
+ this.inputInvalid = computed(() => this.touched() && this.invalid(), ...ngDevMode ? [{ debugName: "inputInvalid" }] : /* istanbul ignore next */ []);
795
+ this.invalid = input(false, {
796
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
797
+ transform: booleanAttribute
798
+ });
799
+ this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
800
+ this.size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
801
+ this.touched = input(false, {
802
+ ...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
803
+ transform: booleanAttribute
804
+ });
805
+ this.userClass = input("", {
806
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
807
+ alias: "class"
808
+ });
809
+ }
810
+ static {
811
+ this.ɵfac = i0.ɵɵngDeclareFactory({
812
+ minVersion: "12.0.0",
813
+ version: "22.2.6",
814
+ ngImport: i0,
815
+ type: TextBoxDirective,
816
+ deps: [],
817
+ target: i0.ɵɵFactoryTarget.Directive
818
+ });
819
+ }
820
+ static {
821
+ this.ɵdir = i0.ɵɵngDeclareDirective({
822
+ minVersion: "17.1.0",
823
+ version: "22.2.6",
824
+ type: TextBoxDirective,
825
+ isStandalone: true,
826
+ selector: "input[monaTextBox]",
827
+ inputs: {
828
+ invalid: {
829
+ classPropertyName: "invalid",
830
+ publicName: "invalid",
831
+ isSignal: true,
832
+ isRequired: false,
833
+ transformFunction: null
834
+ },
835
+ rounded: {
836
+ classPropertyName: "rounded",
837
+ publicName: "rounded",
838
+ isSignal: true,
839
+ isRequired: false,
840
+ transformFunction: null
841
+ },
842
+ size: {
843
+ classPropertyName: "size",
844
+ publicName: "size",
845
+ isSignal: true,
846
+ isRequired: false,
847
+ transformFunction: null
848
+ },
849
+ touched: {
850
+ classPropertyName: "touched",
851
+ publicName: "touched",
852
+ isSignal: true,
853
+ isRequired: false,
854
+ transformFunction: null
855
+ },
856
+ userClass: {
857
+ classPropertyName: "userClass",
858
+ publicName: "class",
859
+ isSignal: true,
860
+ isRequired: false,
861
+ transformFunction: null
862
+ }
863
+ },
864
+ host: { properties: {
865
+ "attr.aria-invalid": "inputInvalid() || null",
866
+ "attr.data-invalid": "inputInvalid() || null",
867
+ "class": "classes()"
868
+ } },
869
+ ngImport: i0
870
+ });
871
+ }
872
+ };
873
+ i0.ɵɵngDeclareClassMetadata({
874
+ minVersion: "12.0.0",
875
+ version: "22.2.6",
876
+ ngImport: i0,
877
+ type: TextBoxDirective,
878
+ decorators: [{
879
+ type: Directive,
880
+ args: [{
881
+ selector: "input[monaTextBox]",
882
+ host: {
883
+ "[attr.aria-invalid]": "inputInvalid() || null",
884
+ "[attr.data-invalid]": "inputInvalid() || null",
885
+ "[class]": "classes()"
886
+ }
887
+ }]
888
+ }],
889
+ propDecorators: {
890
+ invalid: [{
891
+ type: i0.Input,
892
+ args: [{
893
+ isSignal: true,
894
+ alias: "invalid",
895
+ required: false
896
+ }]
897
+ }],
898
+ rounded: [{
899
+ type: i0.Input,
900
+ args: [{
901
+ isSignal: true,
902
+ alias: "rounded",
903
+ required: false
904
+ }]
905
+ }],
906
+ size: [{
907
+ type: i0.Input,
908
+ args: [{
909
+ isSignal: true,
910
+ alias: "size",
911
+ required: false
912
+ }]
913
+ }],
914
+ touched: [{
915
+ type: i0.Input,
916
+ args: [{
917
+ isSignal: true,
918
+ alias: "touched",
919
+ required: false
920
+ }]
921
+ }],
922
+ userClass: [{
923
+ type: i0.Input,
924
+ args: [{
925
+ isSignal: true,
926
+ alias: "class",
927
+ required: false
928
+ }]
929
+ }]
930
+ }
133
931
  });
134
-
135
- /** Input types that support `setSelectionRange`; `email` throws. */
136
- const selectableInputTypes = new Set(["password", "search", "tel", "text", "url"]);
137
- class TextBoxComponent {
138
- constructor() {
139
- this.#hostElementRef = inject(ElementRef);
140
- this.#i18n = inject(MonaI18nService);
141
- this.#label = injectLabelAssociation({
142
- ariaLabel: () => this.ariaLabel(),
143
- ariaLabelledBy: () => this.ariaLabelledBy()
144
- });
145
- this.classes = computed(() => {
146
- const rounded = this.rounded();
147
- const size = this.size();
148
- const classes = textBoxThemeVariants({ rounded, size });
149
- const userClass = this.userClass();
150
- return twMerge(classes, userClass);
151
- }, /* @ts-ignore */
152
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
153
- this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
154
- this.inputRef = viewChild.required("input", /* @ts-ignore */
155
- ...(ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []));
156
- this.invalidInput = computed(() => this.touched() && (this.invalid() || (this.required() && !this.value())), /* @ts-ignore */
157
- ...(ngDevMode ? [{ debugName: "invalidInput" }] : /* istanbul ignore next */ []));
158
- this.labelledBy = this.#label.labelledBy;
159
- this.messages = this.#i18n.componentMessages("textBox", TEXT_BOX_DEFAULT_MESSAGES);
160
- this.prefixTemplateList = contentChildren(TextBoxPrefixTemplateDirective, { ...(ngDevMode ? { debugName: "prefixTemplateList" } : /* istanbul ignore next */ {}), read: TemplateRef });
161
- this.showClearButton = computed(() => this.clearButton() && !this.effectiveDisabled() && !this.readonly() && !!this.value(), /* @ts-ignore */
162
- ...(ngDevMode ? [{ debugName: "showClearButton" }] : /* istanbul ignore next */ []));
163
- this.suffixTemplateList = contentChildren(TextBoxSuffixTemplateDirective, { ...(ngDevMode ? { debugName: "suffixTemplateList" } : /* istanbul ignore next */ {}), read: TemplateRef });
164
- /**
165
- * @description Id of an element that describes the inner input, such as a hint or an error message.
166
- * @default ""
167
- */
168
- this.ariaDescribedBy = input("", { ...(ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {}), alias: "aria-describedby" });
169
- /**
170
- * @description Accessible name of the inner input. Prefer a visible label, linked through {@link inputId} or
171
- * `aria-labelledby`; the placeholder is not a label.
172
- * @default ""
173
- */
174
- this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
175
- /**
176
- * @description Id of the element that labels the inner input.
177
- * @default ""
178
- */
179
- this.ariaLabelledBy = input("", { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: "aria-labelledby" });
180
- /**
181
- * @description Displays a clear button that resets the value to empty.
182
- * The button is hidden while the value is empty or the text box is disabled or read-only.
183
- * @default false
184
- */
185
- this.clearButton = input(false, { ...(ngDevMode ? { debugName: "clearButton" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
186
- /**
187
- * @description Renders the component with reduced visual emphasis and removes pointer interaction.
188
- * @default false
189
- */
190
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
191
- /**
192
- * @description Additional HTML attributes applied directly to the inner `<input>` element.
193
- * @default {}
194
- */
195
- this.inputAttributes = input({}, /* @ts-ignore */
196
- ...(ngDevMode ? [{ debugName: "inputAttributes" }] : /* istanbul ignore next */ []));
197
- /**
198
- * @description Emitted when the inner input loses focus, including when focus moves to the clear button or to
199
- * content in the prefix or suffix templates.
200
- */
201
- this.inputBlur = output();
202
- /**
203
- * @description Additional CSS classes applied to the inner `<input>` element.
204
- * @default ""
205
- */
206
- this.inputClass = input("", /* @ts-ignore */
207
- ...(ngDevMode ? [{ debugName: "inputClass" }] : /* istanbul ignore next */ []));
208
- /**
209
- * @description Emitted when the inner input gains focus.
210
- */
211
- this.inputFocus = output();
212
- /**
213
- * @description Id of the inner `<input>` element. Point a `<label for>` or `<mona-label for>` at it to label the
214
- * text box. A unique id is generated when it isn't set.
215
- * @default generated
216
- */
217
- this.inputId = input(createElementControlId(), /* @ts-ignore */
218
- ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
219
- /**
220
- * @description Inline styles applied to the inner `<input>` element.
221
- * Accepts a style string or a `CSSStyleDeclaration` partial.
222
- * @default null
223
- */
224
- this.inputStyle = input(null, /* @ts-ignore */
225
- ...(ngDevMode ? [{ debugName: "inputStyle" }] : /* istanbul ignore next */ []));
226
- /**
227
- * @description Marks the text box as invalid. When bound to a signal form field via `[formField]`,
228
- * this is written by the `FormField` directive.
229
- * @default false
230
- */
231
- this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
232
- /**
233
- * @description Maximum number of characters, set as `maxlength` on the inner input. When bound to a signal form
234
- * field via `[formField]`, this is written from the field's `maxLength` rule.
235
- * @default undefined
236
- */
237
- this.maxLength = input(undefined, /* @ts-ignore */
238
- ...(ngDevMode ? [{ debugName: "maxLength" }] : /* istanbul ignore next */ []));
239
- /**
240
- * @description Minimum number of characters, set as `minlength` on the inner input. When bound to a signal form
241
- * field via `[formField]`, this is written from the field's `minLength` rule.
242
- * @default undefined
243
- */
244
- this.minLength = input(undefined, /* @ts-ignore */
245
- ...(ngDevMode ? [{ debugName: "minLength" }] : /* istanbul ignore next */ []));
246
- /**
247
- * @description Name of the inner input, used by browsers and password managers for autofill. When bound to a
248
- * signal form field via `[formField]`, this is written by the `FormField` directive.
249
- * @default ""
250
- */
251
- this.name = input("", /* @ts-ignore */
252
- ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
253
- /**
254
- * @description Placeholder text shown when no value has been entered.
255
- * @default ""
256
- */
257
- this.placeholder = input("", /* @ts-ignore */
258
- ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
259
- /**
260
- * @description Prevents value changes while preserving the component's visual state.
261
- * @default false
262
- */
263
- this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
264
- /**
265
- * @description Marks the text box as required.
266
- * Triggers the invalid state when the value is empty and the field has been touched.
267
- * @default false
268
- */
269
- this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
270
- /**
271
- * @description Border-radius preset applied to the component.
272
- * @default "medium"
273
- */
274
- this.rounded = input("medium", /* @ts-ignore */
275
- ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
276
- /**
277
- * @description Size preset controlling the component's dimensions.
278
- * @default "medium"
279
- */
280
- this.size = input("medium", /* @ts-ignore */
281
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
282
- /**
283
- * @description Emitted when focus leaves the text box, including its clear button and prefix and suffix content.
284
- * Form directives (`[formField]`, `ngModel`, `formControl`) listen to this to mark the field as touched.
285
- */
286
- this.touch = output();
287
- /**
288
- * @description Sets the touched state of the text box. When bound to a signal form field via `[formField]`,
289
- * this is written by the `FormField` directive.
290
- * @default false
291
- */
292
- this.touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
293
- /**
294
- * @description Sets the `type` attribute of the inner `<input>` element.
295
- * @default "text"
296
- */
297
- this.type = input("text", /* @ts-ignore */
298
- ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
299
- /**
300
- * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
301
- * @default ""
302
- */
303
- this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
304
- /**
305
- * @description Two-way bindable current value of the text box.
306
- * @default ""
307
- */
308
- this.value = model("", /* @ts-ignore */
309
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
310
- }
311
- #hostElementRef;
312
- #i18n;
313
- #label;
314
- /**
315
- * Focuses the inner input and places the caret after the value, so the end of a long value is in view.
316
- * @param options Options passed to the native `focus()` call, such as `preventScroll`.
317
- */
318
- focus(options) {
319
- const input = this.inputRef().nativeElement;
320
- input.focus(options);
321
- if (selectableInputTypes.has(input.type)) {
322
- const end = input.value.length;
323
- input.setSelectionRange(end, end);
324
- }
325
- }
326
- onClearClick() {
327
- this.value.set("");
328
- this.inputRef().nativeElement.focus();
329
- }
330
- onInputBlur(event) {
331
- this.inputBlur.emit(event);
332
- }
333
- onValueChange(value) {
334
- this.value.set(value);
335
- }
336
- /**
337
- * @internal
338
- */
339
- setLabelledBy(id) {
340
- this.#label.setLabelledBy(id);
341
- }
342
- onFocusOut(event) {
343
- const nextTarget = event.relatedTarget;
344
- if (nextTarget instanceof Node && this.#hostElementRef.nativeElement.contains(nextTarget)) {
345
- return;
346
- }
347
- this.touch.emit();
348
- }
349
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TextBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
350
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: TextBoxComponent, isStandalone: true, selector: "mona-text-box", inputs: { ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, clearButton: { classPropertyName: "clearButton", publicName: "clearButton", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, inputAttributes: { classPropertyName: "inputAttributes", publicName: "inputAttributes", isSignal: true, isRequired: false, transformFunction: null }, inputClass: { classPropertyName: "inputClass", publicName: "inputClass", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, inputStyle: { classPropertyName: "inputStyle", publicName: "inputStyle", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", 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 }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputBlur: "inputBlur", inputFocus: "inputFocus", touch: "touch", value: "valueChange" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "attr.aria-describedby": "null", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.data-disabled": "effectiveDisabled() || null", "attr.data-readonly": "readonly() || null", "attr.data-required": "required() || null", "attr.data-invalid": "invalidInput() || null", "class": "classes()" } }, queries: [{ propertyName: "prefixTemplateList", predicate: TextBoxPrefixTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "suffixTemplateList", predicate: TextBoxSuffixTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n </span>\n}\n<input\n [id]=\"inputId()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [placeholder]=\"placeholder()\"\n [type]=\"type()\"\n [class]=\"inputClass()\"\n [style]=\"inputStyle()\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n [attr.aria-invalid]=\"invalidInput() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.maxlength]=\"maxLength() ?? null\"\n [attr.minlength]=\"minLength() ?? null\"\n [attr.name]=\"name() || null\"\n [monaAttributeBinder]=\"inputAttributes()\"\n [value]=\"value()\"\n (input)=\"onValueChange(input.value)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n #input />\n\n@if (showClearButton()) {\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n class=\"me-1 size-6 shrink-0 p-0 text-muted-foreground hover:text-foreground\"\n [attr.aria-label]=\"messages().clear\"\n (click)=\"onClearClick()\">\n <svg lucideX class=\"size-4\"></svg>\n </button>\n}\n\n@for (suffixTemplate of suffixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"suffixTemplate\"></ng-container>\n </span>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "toggleable", "type", "class", "value"], outputs: ["lookChange", "selectedChange"] }, { kind: "directive", type: AttributeBinderDirective, selector: "[monaAttributeBinder]", inputs: ["monaAttributeBinder"] }, { kind: "component", type: LucideX, selector: "svg[lucideX]" }] }); }
351
- }
352
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TextBoxComponent, decorators: [{
353
- type: Component,
354
- args: [{ selector: "mona-text-box", imports: [NgTemplateOutlet, ButtonDirective, AttributeBinderDirective, LucideX], host: {
355
- // The ARIA inputs below are applied to the inner input, so the host must not keep the static attributes.
356
- "[attr.aria-describedby]": "null",
357
- "[attr.aria-label]": "null",
358
- "[attr.aria-labelledby]": "null",
359
- "[attr.data-disabled]": "effectiveDisabled() || null",
360
- "[attr.data-readonly]": "readonly() || null",
361
- "[attr.data-required]": "required() || null",
362
- "[attr.data-invalid]": "invalidInput() || null",
363
- "[class]": "classes()",
364
- "(focusout)": "onFocusOut($event)"
365
- }, template: "@for (prefixTemplate of prefixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n </span>\n}\n<input\n [id]=\"inputId()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [placeholder]=\"placeholder()\"\n [type]=\"type()\"\n [class]=\"inputClass()\"\n [style]=\"inputStyle()\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n [attr.aria-invalid]=\"invalidInput() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.maxlength]=\"maxLength() ?? null\"\n [attr.minlength]=\"minLength() ?? null\"\n [attr.name]=\"name() || null\"\n [monaAttributeBinder]=\"inputAttributes()\"\n [value]=\"value()\"\n (input)=\"onValueChange(input.value)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n #input />\n\n@if (showClearButton()) {\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n class=\"me-1 size-6 shrink-0 p-0 text-muted-foreground hover:text-foreground\"\n [attr.aria-label]=\"messages().clear\"\n (click)=\"onClearClick()\">\n <svg lucideX class=\"size-4\"></svg>\n </button>\n}\n\n@for (suffixTemplate of suffixTemplateList(); track $index) {\n <span class=\"flex h-full flex-wrap items-center\">\n <ng-container *ngTemplateOutlet=\"suffixTemplate\"></ng-container>\n </span>\n}\n" }]
366
- }], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ["input", { isSignal: true }] }], prefixTemplateList: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TextBoxPrefixTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], suffixTemplateList: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TextBoxSuffixTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], clearButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearButton", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], inputAttributes: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputAttributes", required: false }] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputClass", required: false }] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], inputStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputStyle", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], minLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLength", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
367
-
368
- class TextBoxDirective {
369
- constructor() {
370
- this.classes = computed(() => {
371
- const rounded = this.rounded();
372
- const size = this.size();
373
- const classes = inputThemeVariants({ rounded, size });
374
- const userClass = this.userClass();
375
- return twMerge(classes, userClass);
376
- }, /* @ts-ignore */
377
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
378
- this.inputInvalid = computed(() => this.touched() && this.invalid(), /* @ts-ignore */
379
- ...(ngDevMode ? [{ debugName: "inputInvalid" }] : /* istanbul ignore next */ []));
380
- /**
381
- * @description Marks the input as invalid, triggering error border and ring styling.
382
- * @default false
383
- */
384
- this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
385
- /**
386
- * @description Border-radius preset applied to the component.
387
- * @default "medium"
388
- */
389
- this.rounded = input("medium", /* @ts-ignore */
390
- ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
391
- /**
392
- * @description Size preset controlling the component's dimensions.
393
- * @default "medium"
394
- */
395
- this.size = input("medium", /* @ts-ignore */
396
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
397
- /**
398
- * @description Marks the input as touched. Error styling is only shown when both `invalid` and `touched` are `true`.
399
- * @default false
400
- */
401
- this.touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
402
- /**
403
- * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
404
- * @default ""
405
- */
406
- this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
407
- }
408
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TextBoxDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
409
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: TextBoxDirective, isStandalone: true, selector: "input[monaTextBox]", inputs: { invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", 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 } }, host: { properties: { "attr.aria-invalid": "inputInvalid() || null", "attr.data-invalid": "inputInvalid() || null", "class": "classes()" } }, ngImport: i0 }); }
410
- }
411
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TextBoxDirective, decorators: [{
412
- type: Directive,
413
- args: [{
414
- selector: "input[monaTextBox]",
415
- host: {
416
- "[attr.aria-invalid]": "inputInvalid() || null",
417
- "[attr.data-invalid]": "inputInvalid() || null",
418
- "[class]": "classes()"
419
- }
420
- }]
421
- }], propDecorators: { invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
422
-
423
- /*
424
- * Public API Surface of @nanahoshi/mona-ui/text-box
425
- */
426
-
427
- /**
428
- * Generated bundle index. Do not edit.
429
- */
430
-
431
932
  export { TEXT_BOX_DEFAULT_MESSAGES, TextBoxComponent, TextBoxDirective, TextBoxPrefixTemplateDirective, TextBoxSuffixTemplateDirective };
432
- //# sourceMappingURL=nanahoshi-mona-ui-text-box.mjs.map
933
+
934
+ //# sourceMappingURL=nanahoshi-mona-ui-text-box.mjs.map