@nanahoshi/mona-ui 0.27.2 → 0.28.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 (208) hide show
  1. package/docs/api/chart.md +2 -2
  2. package/docs/api/popup.md +1 -1
  3. package/docs/api/theme.md +2 -2
  4. package/docs/chart.md +14 -0
  5. package/docs/editor.md +2 -0
  6. package/docs/installation.md +147 -15
  7. package/docs/introduction.md +37 -15
  8. package/docs/theming-built-in-themes.md +67 -0
  9. package/docs/theming-custom-colors.md +274 -0
  10. package/docs/theming-custom-themes.md +168 -0
  11. package/docs/theming.md +164 -248
  12. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
  13. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
  14. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
  15. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
  16. package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
  17. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
  18. package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
  19. package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
  20. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
  21. package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
  22. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
  23. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -390
  24. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
  25. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
  26. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
  27. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
  28. package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
  29. package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -743
  30. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
  31. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -266
  32. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
  33. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
  34. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
  35. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
  36. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
  37. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -734
  38. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
  39. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
  40. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
  41. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
  42. package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
  43. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
  44. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
  45. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
  46. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
  47. package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
  48. package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
  49. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
  50. package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5077
  51. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
  52. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
  53. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
  54. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
  55. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
  56. package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
  57. package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
  58. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
  59. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
  60. package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
  61. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
  62. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
  63. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
  64. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
  65. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
  66. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
  67. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
  68. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
  69. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
  70. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
  71. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
  72. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
  73. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
  74. package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
  75. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
  76. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
  77. package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
  78. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
  79. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
  80. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
  81. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
  82. package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
  83. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
  84. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
  85. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
  86. package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
  87. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
  88. package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
  89. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
  90. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
  91. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
  92. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
  93. package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
  94. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
  95. package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
  96. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
  97. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
  98. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
  99. package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
  100. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
  101. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
  102. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
  103. package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
  104. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
  105. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
  106. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
  107. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
  108. package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
  109. package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
  110. package/llms.txt +6 -2
  111. package/package.json +62 -23
  112. package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
  113. package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
  114. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
  115. package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
  116. package/types/nanahoshi-mona-ui-button.d.ts +227 -166
  117. package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
  118. package/types/nanahoshi-mona-ui-card.d.ts +125 -111
  119. package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
  120. package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
  121. package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
  122. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
  123. package/types/nanahoshi-mona-ui-collapsible.d.ts +103 -87
  124. package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
  125. package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
  126. package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
  127. package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
  128. package/types/nanahoshi-mona-ui-command.d.ts +279 -191
  129. package/types/nanahoshi-mona-ui-common.d.ts +354 -385
  130. package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
  131. package/types/nanahoshi-mona-ui-date-input.d.ts +79 -96
  132. package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
  133. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
  134. package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
  135. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
  136. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
  137. package/types/nanahoshi-mona-ui-dropdowns.d.ts +231 -217
  138. package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
  139. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
  140. package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
  141. package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
  142. package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
  143. package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
  144. package/types/nanahoshi-mona-ui-i18n.d.ts +987 -1052
  145. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
  146. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
  147. package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
  148. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
  149. package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
  150. package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
  151. package/types/nanahoshi-mona-ui-label.d.ts +108 -78
  152. package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
  153. package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
  154. package/types/nanahoshi-mona-ui-list.d.ts +2 -1
  155. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
  156. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
  157. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
  158. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
  159. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
  160. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
  161. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
  162. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
  163. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
  164. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
  165. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
  166. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
  167. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
  168. package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
  169. package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
  170. package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
  171. package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
  172. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
  173. package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
  174. package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
  175. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
  176. package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
  177. package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
  178. package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
  179. package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
  180. package/types/nanahoshi-mona-ui-query.d.ts +82 -88
  181. package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
  182. package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
  183. package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
  184. package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
  185. package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
  186. package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
  187. package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
  188. package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
  189. package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
  190. package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
  191. package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
  192. package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
  193. package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
  194. package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
  195. package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
  196. package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
  197. package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
  198. package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
  199. package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
  200. package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
  201. package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
  202. package/types/nanahoshi-mona-ui-window.d.ts +494 -399
  203. package/types/nanahoshi-mona-ui.d.ts +1 -2
  204. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
  205. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
  206. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
  207. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
  208. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
@@ -1,40 +1,48 @@
1
- import { NgTemplateOutlet } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Directive, inject, DestroyRef, ElementRef, computed, viewChild, contentChild, TemplateRef, input, output, booleanAttribute, model, afterNextRender, isDevMode, Component } from '@angular/core';
4
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
- import { RouterLink } from '@angular/router';
6
- import { LucideCircleX } from '@lucide/angular';
7
- import { ButtonDirective } from '@nanahoshi/mona-ui/button';
8
- import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
9
- import { fromEvent } from 'rxjs';
10
- import { twMerge } from 'tailwind-merge';
11
- import { cva } from 'class-variance-authority';
12
- import { themeSelectionBorderClasses, themeRaisedSurfaceClasses } from '@nanahoshi/mona-ui/internal';
13
-
14
- // Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
15
- // Edit the JSON file and run `npm run generate:locale-catalogs`.
16
- const CHIP_DEFAULT_MESSAGES = {
17
- removeLabel: (label) => (label ? `Remove, ${label}` : "Remove, item")
1
+ import { NgTemplateOutlet } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Component, DestroyRef, Directive, ElementRef, TemplateRef, afterNextRender, booleanAttribute, computed, contentChild, inject, input, isDevMode, model, output, viewChild } from "@angular/core";
4
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
5
+ import { RouterLink } from "@angular/router";
6
+ import { LucideCircleX } from "@lucide/angular";
7
+ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
8
+ import { MonaI18nService } from "@nanahoshi/mona-ui/i18n";
9
+ import { fromEvent } from "rxjs";
10
+ import { twMerge } from "tailwind-merge";
11
+ import { cva } from "class-variance-authority";
12
+ import { themeRaisedSurfaceClasses, themeSelectionBorderClasses } from "@nanahoshi/mona-ui/internal";
13
+ const CHIP_DEFAULT_MESSAGES = { removeLabel: (label) => label ? `Remove, ${label}` : "Remove, item" };
14
+ var ChipPrefixTemplateDirective = class ChipPrefixTemplateDirective {
15
+ static {
16
+ this.ɵfac = i0.ɵɵngDeclareFactory({
17
+ minVersion: "12.0.0",
18
+ version: "22.2.6",
19
+ ngImport: i0,
20
+ type: ChipPrefixTemplateDirective,
21
+ deps: [],
22
+ target: i0.ɵɵFactoryTarget.Directive
23
+ });
24
+ }
25
+ static {
26
+ this.ɵdir = i0.ɵɵngDeclareDirective({
27
+ minVersion: "14.0.0",
28
+ version: "22.2.6",
29
+ type: ChipPrefixTemplateDirective,
30
+ isStandalone: true,
31
+ selector: "ng-template[monaChipPrefixTemplate]",
32
+ ngImport: i0
33
+ });
34
+ }
18
35
  };
19
-
20
- /**
21
- * @description Apply to an `<ng-template>` directly inside `<mona-chip>` to render prefix content
22
- * (e.g., an avatar or icon) before the chip label or projected content. The template receives no context.
23
- */
24
- class ChipPrefixTemplateDirective {
25
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ChipPrefixTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
26
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: ChipPrefixTemplateDirective, isStandalone: true, selector: "ng-template[monaChipPrefixTemplate]", ngImport: i0 }); }
27
- }
28
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ChipPrefixTemplateDirective, decorators: [{
29
- type: Directive,
30
- args: [{
31
- selector: "ng-template[monaChipPrefixTemplate]"
32
- }]
33
- }] });
34
-
35
- /**
36
- * The removable, interactive chip's own control, beside the remove button. Its focus ring stays off that button.
37
- */
36
+ i0.ɵɵngDeclareClassMetadata({
37
+ minVersion: "12.0.0",
38
+ version: "22.2.6",
39
+ ngImport: i0,
40
+ type: ChipPrefixTemplateDirective,
41
+ decorators: [{
42
+ type: Directive,
43
+ args: [{ selector: "ng-template[monaChipPrefixTemplate]" }]
44
+ }]
45
+ });
38
46
  const CHIP_BODY_CONTROL_CLASSES = `
39
47
  inline-flex items-center gap-1.5 [border-radius:inherit]
40
48
  focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-indicator
@@ -47,561 +55,774 @@ const chipThemeVariants = cva(`
47
55
  [&_button[data-chip-remove='true']]:relative
48
56
  [&_button[data-chip-remove='true']]:before:absolute
49
57
  `, {
50
- variants: {
51
- disabled: {
52
- true: "pointer-events-none opacity-50 cursor-not-allowed select-none",
53
- false: ""
54
- },
55
- interactive: {
56
- true: `
58
+ variants: {
59
+ disabled: {
60
+ true: "pointer-events-none opacity-50 cursor-not-allowed select-none",
61
+ false: ""
62
+ },
63
+ interactive: {
64
+ true: `
57
65
  cursor-pointer
58
66
  focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-indicator
59
67
  `,
60
- false: ""
61
- },
62
- look: {
63
- default: `
68
+ false: ""
69
+ },
70
+ look: {
71
+ default: `
64
72
  ${themeRaisedSurfaceClasses} text-foreground
65
73
  border border-border
66
74
  `,
67
- primary: "bg-primary text-primary-foreground",
68
- success: "bg-success text-success-foreground",
69
- error: "bg-error text-error-foreground",
70
- warning: "bg-warning text-warning-foreground",
71
- info: "bg-info text-info-foreground",
72
- outline: "bg-transparent text-foreground border border-input-border",
73
- secondary: "bg-secondary text-secondary-foreground",
74
- ghost: "bg-transparent text-foreground shadow-none"
75
- },
76
- rounded: {
77
- full: "rounded-full",
78
- large: "rounded-lg",
79
- medium: "rounded-md",
80
- none: "rounded-none",
81
- small: "rounded-sm"
82
- },
83
- size: {
84
- small: `
75
+ primary: "bg-primary text-primary-foreground",
76
+ success: "bg-success text-success-foreground",
77
+ error: "bg-error text-error-foreground",
78
+ warning: "bg-warning text-warning-foreground",
79
+ info: "bg-info text-info-foreground",
80
+ outline: "bg-transparent text-foreground border border-input-border",
81
+ secondary: "bg-secondary text-secondary-foreground",
82
+ ghost: "bg-transparent text-foreground shadow-none"
83
+ },
84
+ rounded: {
85
+ full: "rounded-full",
86
+ large: "rounded-lg",
87
+ medium: "rounded-md",
88
+ none: "rounded-none",
89
+ small: "rounded-sm"
90
+ },
91
+ size: {
92
+ small: `
85
93
  px-1 py-0.5
86
94
  [&_button[data-chip-remove='true']]:w-3
87
95
  [&_button[data-chip-remove='true']]:h-3
88
96
  [&_button[data-chip-remove='true']]:before:-inset-1.5
89
97
  `,
90
- medium: `
98
+ medium: `
91
99
  px-1.5 py-1
92
100
  [&_button[data-chip-remove='true']]:w-4
93
101
  [&_button[data-chip-remove='true']]:h-4
94
102
  [&_button[data-chip-remove='true']]:before:-inset-1
95
103
  `,
96
- large: `
104
+ large: `
97
105
  px-2 py-1.5
98
106
  [&_button[data-chip-remove='true']]:w-5
99
107
  [&_button[data-chip-remove='true']]:h-5
100
108
  [&_button[data-chip-remove='true']]:before:-inset-0.5
101
109
  `
102
- },
103
- selected: {
104
- // A border in the text's color under prefers-contrast: more and forced colors, where the fill alone isn't enough.
105
- true: themeSelectionBorderClasses,
106
- false: ""
107
- }
108
- },
109
- compoundVariants: [
110
- {
111
- look: "default",
112
- selected: true,
113
- class: "after:-inset-px bg-(--color-selected) text-(--color-selected-foreground)"
114
- },
115
- {
116
- look: "primary",
117
- selected: true,
118
- class: "bg-primary-selected text-primary-foreground"
119
- },
120
- {
121
- look: "secondary",
122
- selected: true,
123
- class: "bg-secondary-selected text-secondary-foreground"
124
- },
125
- {
126
- look: "success",
127
- selected: true,
128
- class: "bg-success-selected text-success-foreground"
129
- },
130
- {
131
- look: "error",
132
- selected: true,
133
- class: "bg-error-selected text-error-foreground"
134
- },
135
- {
136
- look: "warning",
137
- selected: true,
138
- class: "bg-warning-selected text-warning-foreground"
139
- },
140
- {
141
- look: "info",
142
- selected: true,
143
- class: "bg-info-selected text-info-foreground"
144
- },
145
- {
146
- look: "outline",
147
- selected: true,
148
- class: "after:-inset-px bg-(--color-selected) text-(--color-selected-foreground)"
149
- },
150
- {
151
- look: "ghost",
152
- selected: true,
153
- class: "bg-(--color-selected) text-(--color-selected-foreground)"
154
- },
155
- {
156
- look: "default",
157
- interactive: true,
158
- selected: false,
159
- class: `
110
+ },
111
+ selected: {
112
+ true: themeSelectionBorderClasses,
113
+ false: ""
114
+ }
115
+ },
116
+ compoundVariants: [
117
+ {
118
+ look: "default",
119
+ selected: true,
120
+ class: "after:-inset-px bg-(--color-selected) text-(--color-selected-foreground)"
121
+ },
122
+ {
123
+ look: "primary",
124
+ selected: true,
125
+ class: "bg-primary-selected text-primary-foreground"
126
+ },
127
+ {
128
+ look: "secondary",
129
+ selected: true,
130
+ class: "bg-secondary-selected text-secondary-foreground"
131
+ },
132
+ {
133
+ look: "success",
134
+ selected: true,
135
+ class: "bg-success-selected text-success-foreground"
136
+ },
137
+ {
138
+ look: "error",
139
+ selected: true,
140
+ class: "bg-error-selected text-error-foreground"
141
+ },
142
+ {
143
+ look: "warning",
144
+ selected: true,
145
+ class: "bg-warning-selected text-warning-foreground"
146
+ },
147
+ {
148
+ look: "info",
149
+ selected: true,
150
+ class: "bg-info-selected text-info-foreground"
151
+ },
152
+ {
153
+ look: "outline",
154
+ selected: true,
155
+ class: "after:-inset-px bg-(--color-selected) text-(--color-selected-foreground)"
156
+ },
157
+ {
158
+ look: "ghost",
159
+ selected: true,
160
+ class: "bg-(--color-selected) text-(--color-selected-foreground)"
161
+ },
162
+ {
163
+ look: "default",
164
+ interactive: true,
165
+ selected: false,
166
+ class: `
160
167
  hover:bg-hover hover:text-foreground
161
168
  active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
162
169
  `
163
- },
164
- {
165
- look: "primary",
166
- interactive: true,
167
- selected: false,
168
- class: `
170
+ },
171
+ {
172
+ look: "primary",
173
+ interactive: true,
174
+ selected: false,
175
+ class: `
169
176
  hover:bg-primary-hover hover:text-primary-foreground
170
177
  active:bg-primary-active active:text-primary-foreground
171
178
  `
172
- },
173
- {
174
- look: "secondary",
175
- interactive: true,
176
- selected: false,
177
- class: `
179
+ },
180
+ {
181
+ look: "secondary",
182
+ interactive: true,
183
+ selected: false,
184
+ class: `
178
185
  hover:bg-secondary-hover hover:text-secondary-foreground
179
186
  active:bg-secondary-active active:text-secondary-foreground
180
187
  `
181
- },
182
- {
183
- look: "success",
184
- interactive: true,
185
- selected: false,
186
- class: `
188
+ },
189
+ {
190
+ look: "success",
191
+ interactive: true,
192
+ selected: false,
193
+ class: `
187
194
  hover:bg-success-hover hover:text-success-foreground
188
195
  active:bg-success-active active:text-success-foreground
189
196
  `
190
- },
191
- {
192
- look: "error",
193
- interactive: true,
194
- selected: false,
195
- class: `
197
+ },
198
+ {
199
+ look: "error",
200
+ interactive: true,
201
+ selected: false,
202
+ class: `
196
203
  hover:bg-error-hover hover:text-error-foreground
197
204
  active:bg-error-active active:text-error-foreground
198
205
  `
199
- },
200
- {
201
- look: "warning",
202
- interactive: true,
203
- selected: false,
204
- class: `
206
+ },
207
+ {
208
+ look: "warning",
209
+ interactive: true,
210
+ selected: false,
211
+ class: `
205
212
  hover:bg-warning-hover hover:text-warning-foreground
206
213
  active:bg-warning-active active:text-warning-foreground
207
214
  `
208
- },
209
- {
210
- look: "info",
211
- interactive: true,
212
- selected: false,
213
- class: `
215
+ },
216
+ {
217
+ look: "info",
218
+ interactive: true,
219
+ selected: false,
220
+ class: `
214
221
  hover:bg-info-hover hover:text-info-foreground
215
222
  active:bg-info-active active:text-info-foreground
216
223
  `
217
- },
218
- {
219
- look: "outline",
220
- interactive: true,
221
- selected: false,
222
- class: `
224
+ },
225
+ {
226
+ look: "outline",
227
+ interactive: true,
228
+ selected: false,
229
+ class: `
223
230
  hover:bg-hover hover:text-foreground
224
231
  active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
225
232
  `
226
- },
227
- {
228
- look: "ghost",
229
- interactive: true,
230
- selected: false,
231
- class: `
233
+ },
234
+ {
235
+ look: "ghost",
236
+ interactive: true,
237
+ selected: false,
238
+ class: `
232
239
  hover:bg-hover hover:text-foreground
233
240
  active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
234
241
  `
235
- },
236
- {
237
- look: "default",
238
- interactive: true,
239
- selected: true,
240
- class: `
242
+ },
243
+ {
244
+ look: "default",
245
+ interactive: true,
246
+ selected: true,
247
+ class: `
241
248
  hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
242
249
  active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
243
250
  `
244
- },
245
- {
246
- look: "primary",
247
- interactive: true,
248
- selected: true,
249
- class: `
251
+ },
252
+ {
253
+ look: "primary",
254
+ interactive: true,
255
+ selected: true,
256
+ class: `
250
257
  hover:bg-primary-selected/95 hover:text-primary-foreground
251
258
  active:bg-primary-selected/100 active:text-primary-foreground
252
259
  `
253
- },
254
- {
255
- look: "secondary",
256
- interactive: true,
257
- selected: true,
258
- class: `
260
+ },
261
+ {
262
+ look: "secondary",
263
+ interactive: true,
264
+ selected: true,
265
+ class: `
259
266
  hover:bg-secondary-selected/95 hover:text-secondary-foreground
260
267
  active:bg-secondary-selected/100 active:text-secondary-foreground
261
268
  `
262
- },
263
- {
264
- look: "success",
265
- interactive: true,
266
- selected: true,
267
- class: `
269
+ },
270
+ {
271
+ look: "success",
272
+ interactive: true,
273
+ selected: true,
274
+ class: `
268
275
  hover:bg-success-selected/95 hover:text-success-foreground
269
276
  active:bg-success-selected/100 active:text-success-foreground
270
277
  `
271
- },
272
- {
273
- look: "error",
274
- interactive: true,
275
- selected: true,
276
- class: `
278
+ },
279
+ {
280
+ look: "error",
281
+ interactive: true,
282
+ selected: true,
283
+ class: `
277
284
  hover:bg-error-selected/95 hover:text-error-foreground
278
285
  active:bg-error-selected/100 active:text-error-foreground
279
286
  `
280
- },
281
- {
282
- look: "warning",
283
- interactive: true,
284
- selected: true,
285
- class: `
287
+ },
288
+ {
289
+ look: "warning",
290
+ interactive: true,
291
+ selected: true,
292
+ class: `
286
293
  hover:bg-warning-selected/95 hover:text-warning-foreground
287
294
  active:bg-warning-selected/100 active:text-warning-foreground
288
295
  `
289
- },
290
- {
291
- look: "info",
292
- interactive: true,
293
- selected: true,
294
- class: `
296
+ },
297
+ {
298
+ look: "info",
299
+ interactive: true,
300
+ selected: true,
301
+ class: `
295
302
  hover:bg-info-selected/95 hover:text-info-foreground
296
303
  active:bg-info-selected/100 active:text-info-foreground
297
304
  `
298
- },
299
- {
300
- look: "outline",
301
- interactive: true,
302
- selected: true,
303
- class: `
305
+ },
306
+ {
307
+ look: "outline",
308
+ interactive: true,
309
+ selected: true,
310
+ class: `
304
311
  hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
305
312
  active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
306
313
  `
307
- },
308
- {
309
- look: "ghost",
310
- interactive: true,
311
- selected: true,
312
- class: `
314
+ },
315
+ {
316
+ look: "ghost",
317
+ interactive: true,
318
+ selected: true,
319
+ class: `
313
320
  hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
314
321
  active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
315
322
  `
316
- }
317
- ],
318
- defaultVariants: {
319
- interactive: false,
320
- rounded: "medium",
321
- selected: false
322
- }
323
+ }
324
+ ],
325
+ defaultVariants: {
326
+ interactive: false,
327
+ rounded: "medium",
328
+ selected: false
329
+ }
323
330
  });
324
-
325
- /** Projected controls keep their own clicks and keys. */
326
331
  const PROJECTED_CONTROL_SELECTOR = "a[href], button, input, select, textarea, [role='button'], [role='link'], [tabindex]";
327
- class ChipComponent {
328
- #destroyRef;
329
- #elementRef;
330
- #i18n;
331
- #routerLink;
332
- constructor() {
333
- this.#destroyRef = inject(DestroyRef);
334
- this.#elementRef = inject(ElementRef);
335
- this.#i18n = inject(MonaI18nService);
336
- this.#routerLink = inject(RouterLink, { optional: true });
337
- this.ariaChecked = computed(() => {
338
- if (!this.toggleable()) {
339
- return undefined;
340
- }
341
- return this.selected() ? "true" : "false";
342
- }, /* @ts-ignore */
343
- ...(ngDevMode ? [{ debugName: "ariaChecked" }] : /* istanbul ignore next */ []));
344
- this.baseClass = computed(() => {
345
- const disabled = this.disabled();
346
- const interactive = this.bodyInteractive();
347
- const look = this.look();
348
- const rounded = this.rounded();
349
- const size = this.size();
350
- const selected = this.selected();
351
- const userClass = this.userClass();
352
- const variantClasses = chipThemeVariants({ disabled, interactive, look, rounded, size, selected });
353
- return twMerge(variantClasses, userClass);
354
- }, /* @ts-ignore */
355
- ...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
356
- this.bodyClasses = computed(() => (this.split() ? CHIP_BODY_CONTROL_CLASSES : "contents"), /* @ts-ignore */
357
- ...(ngDevMode ? [{ debugName: "bodyClasses" }] : /* istanbul ignore next */ []));
358
- this.bodyElement = viewChild.required("body", /* @ts-ignore */
359
- ...(ngDevMode ? [{ debugName: "bodyElement" }] : /* istanbul ignore next */ []));
360
- this.bodyInteractive = computed(() => !this.disabled() && (this.toggleable() || this.isLink()), /* @ts-ignore */
361
- ...(ngDevMode ? [{ debugName: "bodyInteractive" }] : /* istanbul ignore next */ []));
362
- /** The role of the chip's own control, wherever it ends up. */
363
- this.controlRole = computed(() => {
364
- if (this.toggleable()) {
365
- return "checkbox";
366
- }
367
- return this.isLink() ? "link" : null;
368
- }, /* @ts-ignore */
369
- ...(ngDevMode ? [{ debugName: "controlRole" }] : /* istanbul ignore next */ []));
370
- this.effectiveTabIndex = computed(() => {
371
- const explicitTabindex = this.tabindex();
372
- if (!this.controlRole() && explicitTabindex == null) {
373
- return null;
374
- }
375
- return this.disabled() ? -1 : (explicitTabindex ?? 0);
376
- }, /* @ts-ignore */
377
- ...(ngDevMode ? [{ debugName: "effectiveTabIndex" }] : /* istanbul ignore next */ []));
378
- /** A name needs a role to land on, and an interactive host can't hold a remove button. */
379
- this.hostRole = computed(() => {
380
- if (this.split()) {
381
- return "group";
382
- }
383
- return this.controlRole() ?? (this.ariaLabel() ? "group" : null);
384
- }, /* @ts-ignore */
385
- ...(ngDevMode ? [{ debugName: "hostRole" }] : /* istanbul ignore next */ []));
386
- this.iconSize = computed(() => {
387
- const size = this.size();
388
- switch (size) {
389
- case "small":
390
- return 13;
391
- case "medium":
392
- return 14;
393
- case "large":
394
- return 16;
395
- default:
396
- return 14;
397
- }
398
- }, /* @ts-ignore */
399
- ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
400
- this.isLink = computed(() => !!this.#routerLink, /* @ts-ignore */
401
- ...(ngDevMode ? [{ debugName: "isLink" }] : /* istanbul ignore next */ []));
402
- this.messages = this.#i18n.componentMessages("chip", CHIP_DEFAULT_MESSAGES);
403
- this.prefixTemplate = contentChild(ChipPrefixTemplateDirective, { ...(ngDevMode ? { debugName: "prefixTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
404
- /**
405
- * An interactive role makes its children presentational, which would hide the remove button, so a chip with both
406
- * keeps its control on an inner element.
407
- */
408
- this.split = computed(() => this.removable() && !!this.controlRole(), /* @ts-ignore */
409
- ...(ngDevMode ? [{ debugName: "split" }] : /* istanbul ignore next */ []));
410
- /**
411
- * @description Accessible name of the chip, for one whose text doesn't describe it, such as an icon. On a chip with no
412
- * other role, it makes the chip a named group.
413
- * @default ""
414
- */
415
- this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
416
- /**
417
- * @description Emitted when a toggleable chip body is activated via click, Enter, or Space.
418
- * Not emitted when the remove button is activated or for non-toggleable chips.
419
- */
420
- this.contentClick = output();
421
- /**
422
- * @description Renders the chip with reduced visual emphasis and removes pointer interaction.
423
- * @default false
424
- */
425
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
426
- /**
427
- * @description Text label displayed inside the chip. When non-empty, takes precedence over projected content.
428
- * @default ""
429
- */
430
- this.label = input("", /* @ts-ignore */
431
- ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
432
- /**
433
- * @description Visual style variant controlling the chip's background color, border, and interaction states.
434
- * @default "default"
435
- */
436
- this.look = input("default", /* @ts-ignore */
437
- ...(ngDevMode ? [{ debugName: "look" }] : /* istanbul ignore next */ []));
438
- /**
439
- * @description Renders a remove button inside the chip. When activated, emits the `remove` output.
440
- * @default false
441
- */
442
- this.removable = input(false, { ...(ngDevMode ? { debugName: "removable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
443
- /**
444
- * @description Emitted when the remove button is clicked, or Delete or Backspace is pressed on the chip. Only fires
445
- * when `removable` is `true`. Emits the originating `Event`. The chip can't keep focus once its parent destroys it, so
446
- * move focus to the next chip or the list here.
447
- */
448
- this.remove = output();
449
- /**
450
- * @description Accessible label for the remove button, overriding the auto-computed `"Remove, <label>"` fallback.
451
- * A chip with only projected content needs this or `aria-label`, or it warns in development.
452
- * @default undefined
453
- */
454
- this.removeLabel = input(/* @ts-ignore */
455
- ...(ngDevMode ? [undefined, { debugName: "removeLabel" }] : /* istanbul ignore next */ []));
456
- /**
457
- * @description Tab index for the remove button, independent of the chip host's own tabindex.
458
- * Set to `-1` to exclude the remove button from tab order, since Delete and Backspace on the chip also remove it.
459
- * @default 0
460
- */
461
- this.removeTabIndex = input(0, /* @ts-ignore */
462
- ...(ngDevMode ? [{ debugName: "removeTabIndex" }] : /* istanbul ignore next */ []));
463
- /**
464
- * @description Border-radius preset applied to the chip.
465
- * @default "medium"
466
- */
467
- this.rounded = input("medium", /* @ts-ignore */
468
- ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
469
- /**
470
- * @description Whether the chip is selected. When `toggleable` is `true`, each activation flips this value.
471
- * Supports two-way binding via `[(selected)]`. Without `toggleable`, it's only a look, with no state for assistive
472
- * technology.
473
- * @default false
474
- */
475
- this.selected = model(false, /* @ts-ignore */
476
- ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
477
- /**
478
- * @description Size preset controlling the chip's padding and remove button dimensions.
479
- * @default "medium"
480
- */
481
- this.size = input("medium", /* @ts-ignore */
482
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
483
- /**
484
- * @description Tab index override for the chip host element. When not set, computed automatically:
485
- * `0` when `toggleable` is `true` or functioning as a link, not focusable otherwise. Overridden to `-1` when `disabled`
486
- * is `true`.
487
- * @default undefined
488
- */
489
- this.tabindex = input(/* @ts-ignore */
490
- ...(ngDevMode ? [undefined, { debugName: "tabindex" }] : /* istanbul ignore next */ []));
491
- /**
492
- * @description Enables toggle behavior. When `true`, each activation flips `selected`
493
- * and the host receives `role="checkbox"` with `aria-checked`. With `removable`, the host is a `group` instead, and an
494
- * inner element is the checkbox, beside the remove button.
495
- * @default false
496
- */
497
- this.toggleable = input(false, { ...(ngDevMode ? { debugName: "toggleable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
498
- /**
499
- * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
500
- * @default ""
501
- */
502
- this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
503
- /**
504
- * @description Arbitrary value associated with this chip. The chip doesn't use it or emit it, so to tell which chip was
505
- * removed, pass the item in your `(remove)` handler.
506
- * @default undefined
507
- */
508
- this.value = input(/* @ts-ignore */
509
- ...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
510
- afterNextRender({
511
- read: () => {
512
- this.#setSubscriptions();
513
- this.#warnIfRemoveHasNoName();
514
- }
515
- });
516
- }
517
- onRemoveClick(event) {
518
- if (this.disabled()) {
519
- return;
520
- }
521
- event.stopPropagation();
522
- this.remove.emit(event);
523
- }
524
- #handleActivation() {
525
- if (!this.toggleable() || this.disabled()) {
526
- return;
527
- }
528
- this.selected.set(!this.selected());
529
- this.contentClick.emit();
530
- }
531
- #handleKeydown(event) {
532
- const target = event.target;
533
- const onControl = target === this.#elementRef.nativeElement || target === this.bodyElement().nativeElement;
534
- if (this.disabled()) {
535
- return;
536
- }
537
- if (event.key === "Delete" || event.key === "Backspace") {
538
- if (this.removable() && (onControl || target.closest("button[data-chip-remove]"))) {
539
- event.preventDefault();
540
- this.remove.emit(event);
541
- }
542
- return;
543
- }
544
- if (!onControl) {
545
- return;
546
- }
547
- if (event.key === "Enter" && this.isLink()) {
548
- event.preventDefault();
549
- if (!event.repeat) {
550
- this.#elementRef.nativeElement.click();
551
- }
552
- }
553
- else if ((event.key === "Enter" || event.key === " ") && this.toggleable()) {
554
- event.preventDefault();
555
- if (!event.repeat) {
556
- this.#handleActivation();
557
- }
558
- }
559
- }
560
- #isOnProjectedControl(event) {
561
- const control = event.target.closest?.(PROJECTED_CONTROL_SELECTOR);
562
- return !!control && control !== this.#elementRef.nativeElement && control !== this.bodyElement().nativeElement;
563
- }
564
- #setSubscriptions() {
565
- const element = this.#elementRef.nativeElement;
566
- fromEvent(element, "keydown")
567
- .pipe(takeUntilDestroyed(this.#destroyRef))
568
- .subscribe(event => this.#handleKeydown(event));
569
- fromEvent(element, "click")
570
- .pipe(takeUntilDestroyed(this.#destroyRef))
571
- .subscribe(event => {
572
- if (!this.#isOnProjectedControl(event)) {
573
- this.#handleActivation();
574
- }
575
- });
576
- }
577
- #warnIfRemoveHasNoName() {
578
- if (isDevMode() && this.removable() && !this.label() && !this.ariaLabel() && !this.removeLabel()) {
579
- console.warn("[Mona Chip] A removable chip with projected content needs removeLabel or aria-label, or its remove button " +
580
- "reads as a generic item.", this.#elementRef.nativeElement);
581
- }
582
- }
583
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
584
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ChipComponent, isStandalone: true, selector: "mona-chip", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null }, removeTabIndex: { classPropertyName: "removeTabIndex", publicName: "removeTabIndex", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, toggleable: { classPropertyName: "toggleable", publicName: "toggleable", 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: { contentClick: "contentClick", remove: "remove", selected: "selectedChange" }, host: { properties: { "class": "baseClass()", "attr.tabindex": "split() ? null : effectiveTabIndex()", "attr.aria-disabled": "hostRole() && disabled() ? 'true' : null", "attr.role": "hostRole()", "attr.aria-checked": "split() ? null : ariaChecked()", "attr.aria-label": "split() ? null : ariaLabel() || null" } }, queries: [{ propertyName: "prefixTemplate", first: true, predicate: ChipPrefixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "bodyElement", first: true, predicate: ["body"], descendants: true, isSignal: true }], ngImport: i0, template: "<span\n #body\n [class]=\"bodyClasses()\"\n [attr.aria-checked]=\"split() ? ariaChecked() : null\"\n [attr.aria-disabled]=\"split() && disabled() ? 'true' : null\"\n [attr.aria-label]=\"split() ? ariaLabel() || null : null\"\n [attr.role]=\"split() ? controlRole() : null\"\n [attr.tabindex]=\"split() ? effectiveTabIndex() : null\">\n @if (prefixTemplate()) {\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n }\n\n @if (label()) {\n <span>{{ label() }}</span>\n } @else {\n <ng-content></ng-content>\n }\n</span>\n\n@if (removable()) {\n @let removeAriaLabel = removeLabel() || messages().removeLabel(label() || ariaLabel());\n <button\n monaButton\n look=\"link\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [attr.aria-label]=\"removeAriaLabel\"\n [tabindex]=\"removeTabIndex()\"\n [disabled]=\"disabled()\"\n (click)=\"onRemoveClick($event)\"\n [attr.data-chip-remove]=\"true\">\n <svg lucideCircleX [size]=\"iconSize()\"></svg>\n </button>\n}\n", dependencies: [{ 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: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LucideCircleX, selector: "svg[lucideCircleX], svg[lucideXCircle]" }] }); }
585
- }
586
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ChipComponent, decorators: [{
587
- type: Component,
588
- args: [{ selector: "mona-chip", imports: [ButtonDirective, NgTemplateOutlet, LucideCircleX], host: {
589
- "[class]": "baseClass()",
590
- "[attr.tabindex]": "split() ? null : effectiveTabIndex()",
591
- "[attr.aria-disabled]": "hostRole() && disabled() ? 'true' : null",
592
- "[attr.role]": "hostRole()",
593
- "[attr.aria-checked]": "split() ? null : ariaChecked()",
594
- "[attr.aria-label]": "split() ? null : ariaLabel() || null"
595
- }, template: "<span\n #body\n [class]=\"bodyClasses()\"\n [attr.aria-checked]=\"split() ? ariaChecked() : null\"\n [attr.aria-disabled]=\"split() && disabled() ? 'true' : null\"\n [attr.aria-label]=\"split() ? ariaLabel() || null : null\"\n [attr.role]=\"split() ? controlRole() : null\"\n [attr.tabindex]=\"split() ? effectiveTabIndex() : null\">\n @if (prefixTemplate()) {\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n }\n\n @if (label()) {\n <span>{{ label() }}</span>\n } @else {\n <ng-content></ng-content>\n }\n</span>\n\n@if (removable()) {\n @let removeAriaLabel = removeLabel() || messages().removeLabel(label() || ariaLabel());\n <button\n monaButton\n look=\"link\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [attr.aria-label]=\"removeAriaLabel\"\n [tabindex]=\"removeTabIndex()\"\n [disabled]=\"disabled()\"\n (click)=\"onRemoveClick($event)\"\n [attr.data-chip-remove]=\"true\">\n <svg lucideCircleX [size]=\"iconSize()\"></svg>\n </button>\n}\n" }]
596
- }], ctorParameters: () => [], propDecorators: { bodyElement: [{ type: i0.ViewChild, args: ["body", { isSignal: true }] }], prefixTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ChipPrefixTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], contentClick: [{ type: i0.Output, args: ["contentClick"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], look: [{ type: i0.Input, args: [{ isSignal: true, alias: "look", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], remove: [{ type: i0.Output, args: ["remove"] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], removeTabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeTabIndex", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }, { type: i0.Output, args: ["selectedChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }], toggleable: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleable", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
597
-
598
- /*
599
- * Public API Surface of @nanahoshi/mona-ui/chip
600
- */
601
-
602
- /**
603
- * Generated bundle index. Do not edit.
604
- */
605
-
332
+ var ChipComponent = class ChipComponent {
333
+ #destroyRef;
334
+ #elementRef;
335
+ #i18n;
336
+ #routerLink;
337
+ constructor() {
338
+ this.#destroyRef = inject(DestroyRef);
339
+ this.#elementRef = inject(ElementRef);
340
+ this.#i18n = inject(MonaI18nService);
341
+ this.#routerLink = inject(RouterLink, { optional: true });
342
+ this.ariaChecked = computed(() => {
343
+ if (!this.toggleable()) return;
344
+ return this.selected() ? "true" : "false";
345
+ }, ...ngDevMode ? [{ debugName: "ariaChecked" }] : /* istanbul ignore next */ []);
346
+ this.baseClass = computed(() => {
347
+ const disabled = this.disabled();
348
+ const interactive = this.bodyInteractive();
349
+ const look = this.look();
350
+ const rounded = this.rounded();
351
+ const size = this.size();
352
+ const selected = this.selected();
353
+ const userClass = this.userClass();
354
+ const variantClasses = chipThemeVariants({
355
+ disabled,
356
+ interactive,
357
+ look,
358
+ rounded,
359
+ size,
360
+ selected
361
+ });
362
+ return twMerge(variantClasses, userClass);
363
+ }, ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
364
+ this.bodyClasses = computed(() => this.split() ? CHIP_BODY_CONTROL_CLASSES : "contents", ...ngDevMode ? [{ debugName: "bodyClasses" }] : /* istanbul ignore next */ []);
365
+ this.bodyElement = viewChild.required("body", ...ngDevMode ? [{ debugName: "bodyElement" }] : /* istanbul ignore next */ []);
366
+ this.bodyInteractive = computed(() => !this.disabled() && (this.toggleable() || this.isLink()), ...ngDevMode ? [{ debugName: "bodyInteractive" }] : /* istanbul ignore next */ []);
367
+ this.controlRole = computed(() => {
368
+ if (this.toggleable()) return "checkbox";
369
+ return this.isLink() ? "link" : null;
370
+ }, ...ngDevMode ? [{ debugName: "controlRole" }] : /* istanbul ignore next */ []);
371
+ this.effectiveTabIndex = computed(() => {
372
+ const explicitTabindex = this.tabindex();
373
+ if (!this.controlRole() && explicitTabindex == null) return null;
374
+ return this.disabled() ? -1 : explicitTabindex ?? 0;
375
+ }, ...ngDevMode ? [{ debugName: "effectiveTabIndex" }] : /* istanbul ignore next */ []);
376
+ this.hostRole = computed(() => {
377
+ if (this.split()) return "group";
378
+ return this.controlRole() ?? (this.ariaLabel() ? "group" : null);
379
+ }, ...ngDevMode ? [{ debugName: "hostRole" }] : /* istanbul ignore next */ []);
380
+ this.iconSize = computed(() => {
381
+ switch (this.size()) {
382
+ case "small": return 13;
383
+ case "medium": return 14;
384
+ case "large": return 16;
385
+ default: return 14;
386
+ }
387
+ }, ...ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []);
388
+ this.isLink = computed(() => !!this.#routerLink, ...ngDevMode ? [{ debugName: "isLink" }] : /* istanbul ignore next */ []);
389
+ this.messages = this.#i18n.componentMessages("chip", CHIP_DEFAULT_MESSAGES);
390
+ this.prefixTemplate = contentChild(ChipPrefixTemplateDirective, {
391
+ ...ngDevMode ? { debugName: "prefixTemplate" } : /* istanbul ignore next */ {},
392
+ read: TemplateRef
393
+ });
394
+ this.split = computed(() => this.removable() && !!this.controlRole(), ...ngDevMode ? [{ debugName: "split" }] : /* istanbul ignore next */ []);
395
+ this.ariaLabel = input("", {
396
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
397
+ alias: "aria-label"
398
+ });
399
+ this.contentClick = output();
400
+ this.disabled = input(false, {
401
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
402
+ transform: booleanAttribute
403
+ });
404
+ this.label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
405
+ this.look = input("default", ...ngDevMode ? [{ debugName: "look" }] : /* istanbul ignore next */ []);
406
+ this.removable = input(false, {
407
+ ...ngDevMode ? { debugName: "removable" } : /* istanbul ignore next */ {},
408
+ transform: booleanAttribute
409
+ });
410
+ this.remove = output();
411
+ this.removeLabel = input(...ngDevMode ? [void 0, { debugName: "removeLabel" }] : /* istanbul ignore next */ []);
412
+ this.removeTabIndex = input(0, ...ngDevMode ? [{ debugName: "removeTabIndex" }] : /* istanbul ignore next */ []);
413
+ this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
414
+ this.selected = model(false, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
415
+ this.size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
416
+ this.tabindex = input(...ngDevMode ? [void 0, { debugName: "tabindex" }] : /* istanbul ignore next */ []);
417
+ this.toggleable = input(false, {
418
+ ...ngDevMode ? { debugName: "toggleable" } : /* istanbul ignore next */ {},
419
+ transform: booleanAttribute
420
+ });
421
+ this.userClass = input("", {
422
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
423
+ alias: "class"
424
+ });
425
+ this.value = input(...ngDevMode ? [void 0, { debugName: "value" }] : /* istanbul ignore next */ []);
426
+ afterNextRender({ read: () => {
427
+ this.#setSubscriptions();
428
+ this.#warnIfRemoveHasNoName();
429
+ } });
430
+ }
431
+ onRemoveClick(event) {
432
+ if (this.disabled()) return;
433
+ event.stopPropagation();
434
+ this.remove.emit(event);
435
+ }
436
+ #handleActivation() {
437
+ if (!this.toggleable() || this.disabled()) return;
438
+ this.selected.set(!this.selected());
439
+ this.contentClick.emit();
440
+ }
441
+ #handleKeydown(event) {
442
+ const target = event.target;
443
+ const onControl = target === this.#elementRef.nativeElement || target === this.bodyElement().nativeElement;
444
+ if (this.disabled()) return;
445
+ if (event.key === "Delete" || event.key === "Backspace") {
446
+ if (this.removable() && (onControl || target.closest("button[data-chip-remove]"))) {
447
+ event.preventDefault();
448
+ this.remove.emit(event);
449
+ }
450
+ return;
451
+ }
452
+ if (!onControl) return;
453
+ if (event.key === "Enter" && this.isLink()) {
454
+ event.preventDefault();
455
+ if (!event.repeat) this.#elementRef.nativeElement.click();
456
+ } else if ((event.key === "Enter" || event.key === " ") && this.toggleable()) {
457
+ event.preventDefault();
458
+ if (!event.repeat) this.#handleActivation();
459
+ }
460
+ }
461
+ #isOnProjectedControl(event) {
462
+ const control = event.target.closest?.(PROJECTED_CONTROL_SELECTOR);
463
+ return !!control && control !== this.#elementRef.nativeElement && control !== this.bodyElement().nativeElement;
464
+ }
465
+ #setSubscriptions() {
466
+ const element = this.#elementRef.nativeElement;
467
+ fromEvent(element, "keydown").pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => this.#handleKeydown(event));
468
+ fromEvent(element, "click").pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
469
+ if (!this.#isOnProjectedControl(event)) this.#handleActivation();
470
+ });
471
+ }
472
+ #warnIfRemoveHasNoName() {
473
+ if (isDevMode() && this.removable() && !this.label() && !this.ariaLabel() && !this.removeLabel()) console.warn("[Mona Chip] A removable chip with projected content needs removeLabel or aria-label, or its remove button reads as a generic item.", this.#elementRef.nativeElement);
474
+ }
475
+ static {
476
+ this.ɵfac = i0.ɵɵngDeclareFactory({
477
+ minVersion: "12.0.0",
478
+ version: "22.2.6",
479
+ ngImport: i0,
480
+ type: ChipComponent,
481
+ deps: [],
482
+ target: i0.ɵɵFactoryTarget.Component
483
+ });
484
+ }
485
+ static {
486
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
487
+ minVersion: "17.0.0",
488
+ version: "22.2.6",
489
+ type: ChipComponent,
490
+ isStandalone: true,
491
+ selector: "mona-chip",
492
+ inputs: {
493
+ ariaLabel: {
494
+ classPropertyName: "ariaLabel",
495
+ publicName: "aria-label",
496
+ isSignal: true,
497
+ isRequired: false,
498
+ transformFunction: null
499
+ },
500
+ disabled: {
501
+ classPropertyName: "disabled",
502
+ publicName: "disabled",
503
+ isSignal: true,
504
+ isRequired: false,
505
+ transformFunction: null
506
+ },
507
+ label: {
508
+ classPropertyName: "label",
509
+ publicName: "label",
510
+ isSignal: true,
511
+ isRequired: false,
512
+ transformFunction: null
513
+ },
514
+ look: {
515
+ classPropertyName: "look",
516
+ publicName: "look",
517
+ isSignal: true,
518
+ isRequired: false,
519
+ transformFunction: null
520
+ },
521
+ removable: {
522
+ classPropertyName: "removable",
523
+ publicName: "removable",
524
+ isSignal: true,
525
+ isRequired: false,
526
+ transformFunction: null
527
+ },
528
+ removeLabel: {
529
+ classPropertyName: "removeLabel",
530
+ publicName: "removeLabel",
531
+ isSignal: true,
532
+ isRequired: false,
533
+ transformFunction: null
534
+ },
535
+ removeTabIndex: {
536
+ classPropertyName: "removeTabIndex",
537
+ publicName: "removeTabIndex",
538
+ isSignal: true,
539
+ isRequired: false,
540
+ transformFunction: null
541
+ },
542
+ rounded: {
543
+ classPropertyName: "rounded",
544
+ publicName: "rounded",
545
+ isSignal: true,
546
+ isRequired: false,
547
+ transformFunction: null
548
+ },
549
+ selected: {
550
+ classPropertyName: "selected",
551
+ publicName: "selected",
552
+ isSignal: true,
553
+ isRequired: false,
554
+ transformFunction: null
555
+ },
556
+ size: {
557
+ classPropertyName: "size",
558
+ publicName: "size",
559
+ isSignal: true,
560
+ isRequired: false,
561
+ transformFunction: null
562
+ },
563
+ tabindex: {
564
+ classPropertyName: "tabindex",
565
+ publicName: "tabindex",
566
+ isSignal: true,
567
+ isRequired: false,
568
+ transformFunction: null
569
+ },
570
+ toggleable: {
571
+ classPropertyName: "toggleable",
572
+ publicName: "toggleable",
573
+ isSignal: true,
574
+ isRequired: false,
575
+ transformFunction: null
576
+ },
577
+ userClass: {
578
+ classPropertyName: "userClass",
579
+ publicName: "class",
580
+ isSignal: true,
581
+ isRequired: false,
582
+ transformFunction: null
583
+ },
584
+ value: {
585
+ classPropertyName: "value",
586
+ publicName: "value",
587
+ isSignal: true,
588
+ isRequired: false,
589
+ transformFunction: null
590
+ }
591
+ },
592
+ outputs: {
593
+ contentClick: "contentClick",
594
+ remove: "remove",
595
+ selected: "selectedChange"
596
+ },
597
+ host: { properties: {
598
+ "class": "baseClass()",
599
+ "attr.tabindex": "split() ? null : effectiveTabIndex()",
600
+ "attr.aria-disabled": "hostRole() && disabled() ? 'true' : null",
601
+ "attr.role": "hostRole()",
602
+ "attr.aria-checked": "split() ? null : ariaChecked()",
603
+ "attr.aria-label": "split() ? null : ariaLabel() || null"
604
+ } },
605
+ queries: [{
606
+ propertyName: "prefixTemplate",
607
+ first: true,
608
+ predicate: ChipPrefixTemplateDirective,
609
+ descendants: true,
610
+ read: TemplateRef,
611
+ isSignal: true
612
+ }],
613
+ viewQueries: [{
614
+ propertyName: "bodyElement",
615
+ first: true,
616
+ predicate: ["body"],
617
+ descendants: true,
618
+ isSignal: true
619
+ }],
620
+ ngImport: i0,
621
+ template: "<span\n #body\n [class]=\"bodyClasses()\"\n [attr.aria-checked]=\"split() ? ariaChecked() : null\"\n [attr.aria-disabled]=\"split() && disabled() ? 'true' : null\"\n [attr.aria-label]=\"split() ? ariaLabel() || null : null\"\n [attr.role]=\"split() ? controlRole() : null\"\n [attr.tabindex]=\"split() ? effectiveTabIndex() : null\">\n @if (prefixTemplate()) {\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n }\n\n @if (label()) {\n <span>{{ label() }}</span>\n } @else {\n <ng-content></ng-content>\n }\n</span>\n\n@if (removable()) {\n @let removeAriaLabel = removeLabel() || messages().removeLabel(label() || ariaLabel());\n <button\n monaButton\n look=\"link\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [attr.aria-label]=\"removeAriaLabel\"\n [tabindex]=\"removeTabIndex()\"\n [disabled]=\"disabled()\"\n (click)=\"onRemoveClick($event)\"\n [attr.data-chip-remove]=\"true\">\n <svg lucideCircleX [size]=\"iconSize()\"></svg>\n </button>\n}\n",
622
+ dependencies: [
623
+ {
624
+ kind: "directive",
625
+ type: ButtonDirective,
626
+ selector: "button[monaButton]",
627
+ inputs: [
628
+ "aria-haspopup",
629
+ "disabled",
630
+ "iconOnly",
631
+ "loading",
632
+ "look",
633
+ "rounded",
634
+ "selected",
635
+ "size",
636
+ "tabindex",
637
+ "toggleable",
638
+ "type",
639
+ "class",
640
+ "value"
641
+ ],
642
+ outputs: ["lookChange", "selectedChange"]
643
+ },
644
+ {
645
+ kind: "directive",
646
+ type: NgTemplateOutlet,
647
+ selector: "[ngTemplateOutlet]",
648
+ inputs: [
649
+ "ngTemplateOutletContext",
650
+ "ngTemplateOutlet",
651
+ "ngTemplateOutletInjector"
652
+ ]
653
+ },
654
+ {
655
+ kind: "component",
656
+ type: LucideCircleX,
657
+ selector: "svg[lucideCircleX], svg[lucideXCircle]"
658
+ }
659
+ ]
660
+ });
661
+ }
662
+ };
663
+ i0.ɵɵngDeclareClassMetadata({
664
+ minVersion: "12.0.0",
665
+ version: "22.2.6",
666
+ ngImport: i0,
667
+ type: ChipComponent,
668
+ decorators: [{
669
+ type: Component,
670
+ args: [{
671
+ selector: "mona-chip",
672
+ imports: [
673
+ ButtonDirective,
674
+ NgTemplateOutlet,
675
+ LucideCircleX
676
+ ],
677
+ host: {
678
+ "[class]": "baseClass()",
679
+ "[attr.tabindex]": "split() ? null : effectiveTabIndex()",
680
+ "[attr.aria-disabled]": "hostRole() && disabled() ? 'true' : null",
681
+ "[attr.role]": "hostRole()",
682
+ "[attr.aria-checked]": "split() ? null : ariaChecked()",
683
+ "[attr.aria-label]": "split() ? null : ariaLabel() || null"
684
+ },
685
+ template: "<span\n #body\n [class]=\"bodyClasses()\"\n [attr.aria-checked]=\"split() ? ariaChecked() : null\"\n [attr.aria-disabled]=\"split() && disabled() ? 'true' : null\"\n [attr.aria-label]=\"split() ? ariaLabel() || null : null\"\n [attr.role]=\"split() ? controlRole() : null\"\n [attr.tabindex]=\"split() ? effectiveTabIndex() : null\">\n @if (prefixTemplate()) {\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n }\n\n @if (label()) {\n <span>{{ label() }}</span>\n } @else {\n <ng-content></ng-content>\n }\n</span>\n\n@if (removable()) {\n @let removeAriaLabel = removeLabel() || messages().removeLabel(label() || ariaLabel());\n <button\n monaButton\n look=\"link\"\n [iconOnly]=\"true\"\n [size]=\"'small'\"\n [attr.aria-label]=\"removeAriaLabel\"\n [tabindex]=\"removeTabIndex()\"\n [disabled]=\"disabled()\"\n (click)=\"onRemoveClick($event)\"\n [attr.data-chip-remove]=\"true\">\n <svg lucideCircleX [size]=\"iconSize()\"></svg>\n </button>\n}\n"
686
+ }]
687
+ }],
688
+ ctorParameters: () => [],
689
+ propDecorators: {
690
+ bodyElement: [{
691
+ type: i0.ViewChild,
692
+ args: ["body", { isSignal: true }]
693
+ }],
694
+ prefixTemplate: [{
695
+ type: i0.ContentChild,
696
+ args: [i0.forwardRef(() => ChipPrefixTemplateDirective), {
697
+ read: TemplateRef,
698
+ isSignal: true
699
+ }]
700
+ }],
701
+ ariaLabel: [{
702
+ type: i0.Input,
703
+ args: [{
704
+ isSignal: true,
705
+ alias: "aria-label",
706
+ required: false
707
+ }]
708
+ }],
709
+ contentClick: [{
710
+ type: i0.Output,
711
+ args: ["contentClick"]
712
+ }],
713
+ disabled: [{
714
+ type: i0.Input,
715
+ args: [{
716
+ isSignal: true,
717
+ alias: "disabled",
718
+ required: false
719
+ }]
720
+ }],
721
+ label: [{
722
+ type: i0.Input,
723
+ args: [{
724
+ isSignal: true,
725
+ alias: "label",
726
+ required: false
727
+ }]
728
+ }],
729
+ look: [{
730
+ type: i0.Input,
731
+ args: [{
732
+ isSignal: true,
733
+ alias: "look",
734
+ required: false
735
+ }]
736
+ }],
737
+ removable: [{
738
+ type: i0.Input,
739
+ args: [{
740
+ isSignal: true,
741
+ alias: "removable",
742
+ required: false
743
+ }]
744
+ }],
745
+ remove: [{
746
+ type: i0.Output,
747
+ args: ["remove"]
748
+ }],
749
+ removeLabel: [{
750
+ type: i0.Input,
751
+ args: [{
752
+ isSignal: true,
753
+ alias: "removeLabel",
754
+ required: false
755
+ }]
756
+ }],
757
+ removeTabIndex: [{
758
+ type: i0.Input,
759
+ args: [{
760
+ isSignal: true,
761
+ alias: "removeTabIndex",
762
+ required: false
763
+ }]
764
+ }],
765
+ rounded: [{
766
+ type: i0.Input,
767
+ args: [{
768
+ isSignal: true,
769
+ alias: "rounded",
770
+ required: false
771
+ }]
772
+ }],
773
+ selected: [{
774
+ type: i0.Input,
775
+ args: [{
776
+ isSignal: true,
777
+ alias: "selected",
778
+ required: false
779
+ }]
780
+ }, {
781
+ type: i0.Output,
782
+ args: ["selectedChange"]
783
+ }],
784
+ size: [{
785
+ type: i0.Input,
786
+ args: [{
787
+ isSignal: true,
788
+ alias: "size",
789
+ required: false
790
+ }]
791
+ }],
792
+ tabindex: [{
793
+ type: i0.Input,
794
+ args: [{
795
+ isSignal: true,
796
+ alias: "tabindex",
797
+ required: false
798
+ }]
799
+ }],
800
+ toggleable: [{
801
+ type: i0.Input,
802
+ args: [{
803
+ isSignal: true,
804
+ alias: "toggleable",
805
+ required: false
806
+ }]
807
+ }],
808
+ userClass: [{
809
+ type: i0.Input,
810
+ args: [{
811
+ isSignal: true,
812
+ alias: "class",
813
+ required: false
814
+ }]
815
+ }],
816
+ value: [{
817
+ type: i0.Input,
818
+ args: [{
819
+ isSignal: true,
820
+ alias: "value",
821
+ required: false
822
+ }]
823
+ }]
824
+ }
825
+ });
606
826
  export { CHIP_DEFAULT_MESSAGES, ChipComponent, ChipPrefixTemplateDirective };
607
- //# sourceMappingURL=nanahoshi-mona-ui-chip.mjs.map
827
+
828
+ //# sourceMappingURL=nanahoshi-mona-ui-chip.mjs.map