@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,84 +1,104 @@
1
- import { NgTemplateOutlet } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { inject, TemplateRef, Directive, signal, Service, computed, contentChild, input, Component, viewChild, effect, DestroyRef, contentChildren } from '@angular/core';
4
- import { classInputToClass } from '@nanahoshi/mona-ui/common';
5
- import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
6
- import { twMerge } from 'tailwind-merge';
7
- import { themeRaisedBackdropClasses, createElementControlId } from '@nanahoshi/mona-ui/internal';
8
- import { cva } from 'class-variance-authority';
9
-
10
- class CardContentDirective {
11
- constructor() {
12
- this.templateRef = inject(TemplateRef);
13
- }
14
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
15
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: CardContentDirective, isStandalone: true, selector: "ng-template[monaCardContent]", ngImport: i0 }); }
16
- }
17
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardContentDirective, decorators: [{
18
- type: Directive,
19
- args: [{
20
- selector: "ng-template[monaCardContent]"
21
- }]
22
- }] });
23
-
24
- // Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
25
- // Edit the JSON file and run `npm run generate:locale-catalogs`.
26
- const CARD_DEFAULT_MESSAGES = {
27
- actionsLabel: "Card actions"
1
+ import { NgTemplateOutlet } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Component, DestroyRef, Directive, Service, TemplateRef, computed, contentChild, contentChildren, effect, inject, input, signal, viewChild } from "@angular/core";
4
+ import { classInputToClass } from "@nanahoshi/mona-ui/common";
5
+ import { MonaI18nService } from "@nanahoshi/mona-ui/i18n";
6
+ import { twMerge } from "tailwind-merge";
7
+ import { createElementControlId, themeRaisedBackdropClasses } from "@nanahoshi/mona-ui/internal";
8
+ import { cva } from "class-variance-authority";
9
+ var CardContentDirective = class CardContentDirective {
10
+ constructor() {
11
+ this.templateRef = inject(TemplateRef);
12
+ }
13
+ static {
14
+ this.ɵfac = i0.ɵɵngDeclareFactory({
15
+ minVersion: "12.0.0",
16
+ version: "22.2.6",
17
+ ngImport: i0,
18
+ type: CardContentDirective,
19
+ deps: [],
20
+ target: i0.ɵɵFactoryTarget.Directive
21
+ });
22
+ }
23
+ static {
24
+ this.ɵdir = i0.ɵɵngDeclareDirective({
25
+ minVersion: "14.0.0",
26
+ version: "22.2.6",
27
+ type: CardContentDirective,
28
+ isStandalone: true,
29
+ selector: "ng-template[monaCardContent]",
30
+ ngImport: i0
31
+ });
32
+ }
28
33
  };
29
-
30
- class CardService {
31
- constructor() {
32
- this.actionTemplate = signal([], /* @ts-ignore */
33
- ...(ngDevMode ? [{ debugName: "actionTemplate" }] : /* istanbul ignore next */ []));
34
- this.descriptionId = signal(null, /* @ts-ignore */
35
- ...(ngDevMode ? [{ debugName: "descriptionId" }] : /* istanbul ignore next */ []));
36
- this.descriptionTemplate = signal(null, /* @ts-ignore */
37
- ...(ngDevMode ? [{ debugName: "descriptionTemplate" }] : /* istanbul ignore next */ []));
38
- this.footerClass = signal(undefined, /* @ts-ignore */
39
- ...(ngDevMode ? [{ debugName: "footerClass" }] : /* istanbul ignore next */ []));
40
- this.footerTemplate = signal(null, /* @ts-ignore */
41
- ...(ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []));
42
- this.headerClass = signal(undefined, /* @ts-ignore */
43
- ...(ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []));
44
- this.headerTemplate = signal(null, /* @ts-ignore */
45
- ...(ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []));
46
- this.titleId = signal(null, /* @ts-ignore */
47
- ...(ngDevMode ? [{ debugName: "titleId" }] : /* istanbul ignore next */ []));
48
- this.titleTemplate = signal(null, /* @ts-ignore */
49
- ...(ngDevMode ? [{ debugName: "titleTemplate" }] : /* istanbul ignore next */ []));
50
- }
51
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardService, deps: [], target: i0.ɵɵFactoryTarget.Service }); }
52
- static { this.ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.6", ngImport: i0, type: CardService, autoProvided: false }); }
53
- }
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardService, decorators: [{
55
- type: Service,
56
- args: [{ autoProvided: false }]
57
- }] });
58
-
34
+ i0.ɵɵngDeclareClassMetadata({
35
+ minVersion: "12.0.0",
36
+ version: "22.2.6",
37
+ ngImport: i0,
38
+ type: CardContentDirective,
39
+ decorators: [{
40
+ type: Directive,
41
+ args: [{ selector: "ng-template[monaCardContent]" }]
42
+ }]
43
+ });
44
+ const CARD_DEFAULT_MESSAGES = { actionsLabel: "Card actions" };
45
+ var CardService = class CardService {
46
+ constructor() {
47
+ this.actionTemplate = signal([], ...ngDevMode ? [{ debugName: "actionTemplate" }] : /* istanbul ignore next */ []);
48
+ this.descriptionId = signal(null, ...ngDevMode ? [{ debugName: "descriptionId" }] : /* istanbul ignore next */ []);
49
+ this.descriptionTemplate = signal(null, ...ngDevMode ? [{ debugName: "descriptionTemplate" }] : /* istanbul ignore next */ []);
50
+ this.footerClass = signal(void 0, ...ngDevMode ? [{ debugName: "footerClass" }] : /* istanbul ignore next */ []);
51
+ this.footerTemplate = signal(null, ...ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []);
52
+ this.headerClass = signal(void 0, ...ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []);
53
+ this.headerTemplate = signal(null, ...ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []);
54
+ this.titleId = signal(null, ...ngDevMode ? [{ debugName: "titleId" }] : /* istanbul ignore next */ []);
55
+ this.titleTemplate = signal(null, ...ngDevMode ? [{ debugName: "titleTemplate" }] : /* istanbul ignore next */ []);
56
+ }
57
+ static {
58
+ this.ɵfac = i0.ɵɵngDeclareFactory({
59
+ minVersion: "12.0.0",
60
+ version: "22.2.6",
61
+ ngImport: i0,
62
+ type: CardService,
63
+ deps: [],
64
+ target: i0.ɵɵFactoryTarget.Service
65
+ });
66
+ }
67
+ static {
68
+ this.ɵprov = i0.ɵɵngDeclareService({
69
+ minVersion: "22.0.0",
70
+ version: "22.2.6",
71
+ ngImport: i0,
72
+ type: CardService,
73
+ autoProvided: false
74
+ });
75
+ }
76
+ };
77
+ i0.ɵɵngDeclareClassMetadata({
78
+ minVersion: "12.0.0",
79
+ version: "22.2.6",
80
+ ngImport: i0,
81
+ type: CardService,
82
+ decorators: [{
83
+ type: Service,
84
+ args: [{ autoProvided: false }]
85
+ }]
86
+ });
59
87
  const roundedTopVariants = {
60
- small: "rounded-t-sm",
61
- medium: "rounded-t-md",
62
- large: "rounded-t-lg",
63
- xlarge: "rounded-t-xl",
64
- xxlarge: "rounded-t-2xl",
65
- none: "rounded-none"
88
+ small: "rounded-t-sm",
89
+ medium: "rounded-t-md",
90
+ large: "rounded-t-lg",
91
+ xlarge: "rounded-t-xl",
92
+ xxlarge: "rounded-t-2xl",
93
+ none: "rounded-none"
66
94
  };
67
95
  const roundedBottomVariants = {
68
- small: "rounded-b-sm",
69
- medium: "rounded-b-md",
70
- large: "rounded-b-lg",
71
- xlarge: "rounded-b-xl",
72
- xxlarge: "rounded-b-2xl",
73
- none: "rounded-none"
74
- };
75
- const roundedAllVariants = {
76
- small: "rounded-sm",
77
- medium: "rounded-md",
78
- large: "rounded-lg",
79
- xlarge: "rounded-xl",
80
- xxlarge: "rounded-2xl",
81
- none: "rounded-none"
96
+ small: "rounded-b-sm",
97
+ medium: "rounded-b-md",
98
+ large: "rounded-b-lg",
99
+ xlarge: "rounded-b-xl",
100
+ xxlarge: "rounded-b-2xl",
101
+ none: "rounded-none"
82
102
  };
83
103
  const cardBaseThemeVariants = cva(`
84
104
  flex flex-col gap-2 py-4
@@ -86,19 +106,24 @@ const cardBaseThemeVariants = cva(`
86
106
  border border-border
87
107
  bg-(--color-card) text-(--color-card-foreground)
88
108
  shadow-(--shadow-raised)
89
- `, {
90
- variants: {
91
- rounded: roundedAllVariants,
92
- hasFooter: {
93
- true: "pb-0",
94
- false: ""
95
- },
96
- hasHeader: {
97
- true: "pt-0",
98
- false: ""
99
- }
100
- }
101
- });
109
+ `, { variants: {
110
+ rounded: {
111
+ small: "rounded-sm",
112
+ medium: "rounded-md",
113
+ large: "rounded-lg",
114
+ xlarge: "rounded-xl",
115
+ xxlarge: "rounded-2xl",
116
+ none: "rounded-none"
117
+ },
118
+ hasFooter: {
119
+ true: "pb-0",
120
+ false: ""
121
+ },
122
+ hasHeader: {
123
+ true: "pt-0",
124
+ false: ""
125
+ }
126
+ } });
102
127
  const cardFooterThemeVariants = cva(`
103
128
  flex flex-row
104
129
  justify-between
@@ -106,236 +131,515 @@ const cardFooterThemeVariants = cva(`
106
131
  p-4
107
132
  border-t
108
133
  border-border
109
- `, {
110
- variants: {
111
- rounded: roundedBottomVariants
112
- }
113
- });
134
+ `, { variants: { rounded: roundedBottomVariants } });
114
135
  const cardHeaderThemeVariants = cva(`
115
136
  grid grid-cols-[1fr_auto] grid-rows-[auto_auto]
116
137
  p-4 pb-0
117
- `, {
118
- variants: {
119
- rounded: roundedTopVariants
120
- }
121
- });
138
+ `, { variants: { rounded: roundedTopVariants } });
122
139
  const cardHeaderTitleThemeVariants = cva(`col-start-1 row-start-1 items-center`);
123
140
  const cardHeaderDescriptionThemeVariants = cva(`col-start-1 row-start-2`);
124
141
  const cardHeaderActionsThemeVariants = cva(`col-start-2 row-start-1 row-span-2 self-start justify-self-end`);
125
-
126
- class CardComponent {
127
- constructor() {
128
- this.#cardService = inject(CardService);
129
- this.#i18n = inject(MonaI18nService);
130
- this.actionTemplate = this.#cardService.actionTemplate.asReadonly();
131
- this.actionsCellClass = cardHeaderActionsThemeVariants();
132
- this.baseClass = computed(() => {
133
- const rounded = this.rounded();
134
- const hasHeader = !!this.headerTemplate();
135
- const hasFooter = !!this.footerTemplate();
136
- const variantClass = cardBaseThemeVariants({ rounded, hasHeader, hasFooter });
137
- const userClass = classInputToClass(this.userClass());
138
- return twMerge(variantClass, userClass);
139
- }, /* @ts-ignore */
140
- ...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
141
- this.contentDirective = contentChild(CardContentDirective, /* @ts-ignore */
142
- ...(ngDevMode ? [{ debugName: "contentDirective" }] : /* istanbul ignore next */ []));
143
- this.descriptionCellClass = cardHeaderDescriptionThemeVariants();
144
- /** Its own id on the library's wrapper: the template's `let id` may already be on the consumer's element. */
145
- this.descriptionCellId = computed(() => {
146
- const id = this.descriptionId();
147
- return id ? `${id}-cell` : null;
148
- }, /* @ts-ignore */
149
- ...(ngDevMode ? [{ debugName: "descriptionCellId" }] : /* istanbul ignore next */ []));
150
- this.descriptionId = this.#cardService.descriptionId.asReadonly();
151
- this.descriptionTemplate = this.#cardService.descriptionTemplate.asReadonly();
152
- this.footerClass = computed(() => {
153
- const rounded = this.rounded();
154
- const variantClass = cardFooterThemeVariants({ rounded });
155
- const userClass = classInputToClass(this.#cardService.footerClass());
156
- return twMerge(variantClass, userClass);
157
- }, /* @ts-ignore */
158
- ...(ngDevMode ? [{ debugName: "footerClass" }] : /* istanbul ignore next */ []));
159
- this.footerTemplate = this.#cardService.footerTemplate.asReadonly();
160
- this.headerClass = computed(() => {
161
- const rounded = this.rounded();
162
- const variantClass = cardHeaderThemeVariants({ rounded });
163
- const userClass = classInputToClass(this.#cardService.headerClass());
164
- return twMerge(variantClass, userClass);
165
- }, /* @ts-ignore */
166
- ...(ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []));
167
- this.headerTemplate = this.#cardService.headerTemplate.asReadonly();
168
- this.messages = this.#i18n.componentMessages("card", CARD_DEFAULT_MESSAGES);
169
- this.titleCellClass = cardHeaderTitleThemeVariants();
170
- this.titleCellId = computed(() => {
171
- const id = this.titleId();
172
- return id ? `${id}-cell` : null;
173
- }, /* @ts-ignore */
174
- ...(ngDevMode ? [{ debugName: "titleCellId" }] : /* istanbul ignore next */ []));
175
- this.titleId = this.#cardService.titleId.asReadonly();
176
- this.titleTemplate = this.#cardService.titleTemplate.asReadonly();
177
- /**
178
- * @description The role the card takes when it has a title, which then names it. Use `article` for self-contained
179
- * content or `region` for a landmark.
180
- * @default "group"
181
- */
182
- this.role = input("group", /* @ts-ignore */
183
- ...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
184
- /**
185
- * @description Controls the border radius applied to the card and its header/footer regions.
186
- * @default "medium"
187
- */
188
- this.rounded = input("medium", /* @ts-ignore */
189
- ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
190
- /**
191
- * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
192
- * @default ""
193
- */
194
- this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
195
- }
196
- #cardService;
197
- #i18n;
198
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
199
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: CardComponent, isStandalone: true, selector: "mona-card", inputs: { role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "baseClass()", "attr.aria-describedby": "titleId() ? descriptionCellId() : null", "attr.aria-labelledby": "titleCellId()", "attr.role": "titleId() ? role() : null" } }, providers: [CardService], queries: [{ propertyName: "contentDirective", first: true, predicate: CardContentDirective, descendants: true, isSignal: true }], ngImport: i0, template: "@if (headerTemplate()) {\n <div [class]=\"headerClass()\">\n @if (titleTemplate()) {\n <div [class]=\"titleCellClass\" [attr.id]=\"titleCellId()\">\n <ng-container [ngTemplateOutlet]=\"titleTemplate()\" [ngTemplateOutletContext]=\"{ $implicit: titleId() }\" />\n </div>\n }\n @if (descriptionTemplate()) {\n <div [class]=\"descriptionCellClass\" [attr.id]=\"descriptionCellId()\">\n <ng-container\n [ngTemplateOutlet]=\"descriptionTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: descriptionId() }\"\n />\n </div>\n }\n @if (actionTemplate().length > 0) {\n <div [class]=\"actionsCellClass\" role=\"group\" [attr.aria-label]=\"messages().actionsLabel\">\n @for (template of actionTemplate(); track template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n }\n </div>\n }\n </div>\n}\n<ng-container [ngTemplateOutlet]=\"contentDirective()?.templateRef ?? null\" />\n@if (footerTemplate()) {\n <div [class]=\"footerClass()\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\" />\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
200
- }
201
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardComponent, decorators: [{
202
- type: Component,
203
- args: [{ selector: "mona-card", imports: [NgTemplateOutlet], host: {
204
- "[class]": "baseClass()",
205
- "[attr.aria-describedby]": "titleId() ? descriptionCellId() : null",
206
- "[attr.aria-labelledby]": "titleCellId()",
207
- // A name only counts on an element with a role, and a card with no title has no name to give it.
208
- "[attr.role]": "titleId() ? role() : null"
209
- }, providers: [CardService], template: "@if (headerTemplate()) {\n <div [class]=\"headerClass()\">\n @if (titleTemplate()) {\n <div [class]=\"titleCellClass\" [attr.id]=\"titleCellId()\">\n <ng-container [ngTemplateOutlet]=\"titleTemplate()\" [ngTemplateOutletContext]=\"{ $implicit: titleId() }\" />\n </div>\n }\n @if (descriptionTemplate()) {\n <div [class]=\"descriptionCellClass\" [attr.id]=\"descriptionCellId()\">\n <ng-container\n [ngTemplateOutlet]=\"descriptionTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: descriptionId() }\"\n />\n </div>\n }\n @if (actionTemplate().length > 0) {\n <div [class]=\"actionsCellClass\" role=\"group\" [attr.aria-label]=\"messages().actionsLabel\">\n @for (template of actionTemplate(); track template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n }\n </div>\n }\n </div>\n}\n<ng-container [ngTemplateOutlet]=\"contentDirective()?.templateRef ?? null\" />\n@if (footerTemplate()) {\n <div [class]=\"footerClass()\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\" />\n </div>\n}\n" }]
210
- }], propDecorators: { contentDirective: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CardContentDirective), { isSignal: true }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
211
-
212
- class CardFooterComponent {
213
- #cardService;
214
- constructor() {
215
- this.#cardService = inject(CardService);
216
- this.footerTemplate = viewChild.required(TemplateRef, /* @ts-ignore */
217
- ...(ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []));
218
- /**
219
- * @description Additional CSS classes merged onto the rendered footer element via `tailwind-merge`.
220
- * @default ""
221
- */
222
- this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
223
- // A plain effect, because it runs on the server and in the first pass, so the footer isn't missing from either.
224
- effect(() => {
225
- this.#cardService.footerTemplate.set(this.footerTemplate());
226
- this.#cardService.footerClass.set(this.userClass());
227
- });
228
- inject(DestroyRef).onDestroy(() => {
229
- this.#cardService.footerTemplate.set(null);
230
- this.#cardService.footerClass.set(null);
231
- });
232
- }
233
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
234
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: CardFooterComponent, isStandalone: true, selector: "mona-card-footer", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "footerTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }); }
235
- }
236
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardFooterComponent, decorators: [{
237
- type: Component,
238
- args: [{ selector: "mona-card-footer", imports: [], template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }]
239
- }], ctorParameters: () => [], propDecorators: { footerTemplate: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
240
-
241
- class CardActionDirective {
242
- constructor() {
243
- this.templateRef = inject(TemplateRef);
244
- }
245
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardActionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
246
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: CardActionDirective, isStandalone: true, selector: "ng-template[monaCardAction]", ngImport: i0 }); }
247
- }
248
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardActionDirective, decorators: [{
249
- type: Directive,
250
- args: [{
251
- selector: "ng-template[monaCardAction]"
252
- }]
253
- }] });
254
-
255
- class CardDescriptionDirective {
256
- constructor() {
257
- this.id = createElementControlId();
258
- this.templateRef = inject(TemplateRef);
259
- }
260
- static ngTemplateContextGuard(_directive, _context) {
261
- return true;
262
- }
263
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardDescriptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
264
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: CardDescriptionDirective, isStandalone: true, selector: "ng-template[monaCardDescription]", ngImport: i0 }); }
265
- }
266
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardDescriptionDirective, decorators: [{
267
- type: Directive,
268
- args: [{
269
- selector: "ng-template[monaCardDescription]"
270
- }]
271
- }] });
272
-
273
- class CardTitleDirective {
274
- constructor() {
275
- this.id = createElementControlId();
276
- this.templateRef = inject(TemplateRef);
277
- }
278
- static ngTemplateContextGuard(_directive, _context) {
279
- return true;
280
- }
281
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
282
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: CardTitleDirective, isStandalone: true, selector: "ng-template[monaCardTitle]", ngImport: i0 }); }
283
- }
284
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardTitleDirective, decorators: [{
285
- type: Directive,
286
- args: [{
287
- selector: "ng-template[monaCardTitle]"
288
- }]
289
- }] });
290
-
291
- class CardHeaderComponent {
292
- #cardService;
293
- constructor() {
294
- this.#cardService = inject(CardService);
295
- this.actionDirective = contentChildren(CardActionDirective, /* @ts-ignore */
296
- ...(ngDevMode ? [{ debugName: "actionDirective" }] : /* istanbul ignore next */ []));
297
- this.descriptionDirective = contentChild(CardDescriptionDirective, /* @ts-ignore */
298
- ...(ngDevMode ? [{ debugName: "descriptionDirective" }] : /* istanbul ignore next */ []));
299
- this.headerTemplate = viewChild.required(TemplateRef, /* @ts-ignore */
300
- ...(ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []));
301
- this.titleDirective = contentChild(CardTitleDirective, /* @ts-ignore */
302
- ...(ngDevMode ? [{ debugName: "titleDirective" }] : /* istanbul ignore next */ []));
303
- /**
304
- * @description Additional CSS classes merged onto the rendered header element via `tailwind-merge`.
305
- * @default ""
306
- */
307
- this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
308
- // A plain effect, because it runs on the server and in the first pass, so the header isn't missing from either.
309
- effect(() => {
310
- this.#cardService.actionTemplate.set(this.actionDirective().map(directive => directive.templateRef));
311
- this.#cardService.descriptionId.set(this.descriptionDirective()?.id ?? null);
312
- this.#cardService.descriptionTemplate.set(this.descriptionDirective()?.templateRef ?? null);
313
- this.#cardService.headerTemplate.set(this.headerTemplate());
314
- this.#cardService.headerClass.set(this.userClass());
315
- this.#cardService.titleId.set(this.titleDirective()?.id ?? null);
316
- this.#cardService.titleTemplate.set(this.titleDirective()?.templateRef ?? null);
317
- });
318
- inject(DestroyRef).onDestroy(() => {
319
- this.#cardService.actionTemplate.set([]);
320
- this.#cardService.descriptionId.set(null);
321
- this.#cardService.descriptionTemplate.set(null);
322
- this.#cardService.headerTemplate.set(null);
323
- this.#cardService.headerClass.set(null);
324
- this.#cardService.titleId.set(null);
325
- this.#cardService.titleTemplate.set(null);
326
- });
327
- }
328
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
329
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: CardHeaderComponent, isStandalone: true, selector: "mona-card-header", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "actionDirective", predicate: CardActionDirective, isSignal: true }, { propertyName: "descriptionDirective", first: true, predicate: CardDescriptionDirective, descendants: true, isSignal: true }, { propertyName: "titleDirective", first: true, predicate: CardTitleDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "headerTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }); }
330
- }
331
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CardHeaderComponent, decorators: [{
332
- type: Component,
333
- args: [{ selector: "mona-card-header", template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }]
334
- }], ctorParameters: () => [], propDecorators: { actionDirective: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CardActionDirective), { isSignal: true }] }], descriptionDirective: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CardDescriptionDirective), { isSignal: true }] }], headerTemplate: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }], titleDirective: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CardTitleDirective), { isSignal: true }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
335
-
336
- /**
337
- * Generated bundle index. Do not edit.
338
- */
339
-
142
+ var CardComponent = class CardComponent {
143
+ constructor() {
144
+ this.#cardService = inject(CardService);
145
+ this.#i18n = inject(MonaI18nService);
146
+ this.actionTemplate = this.#cardService.actionTemplate.asReadonly();
147
+ this.actionsCellClass = cardHeaderActionsThemeVariants();
148
+ this.baseClass = computed(() => {
149
+ const rounded = this.rounded();
150
+ const hasHeader = !!this.headerTemplate();
151
+ const hasFooter = !!this.footerTemplate();
152
+ const variantClass = cardBaseThemeVariants({
153
+ rounded,
154
+ hasHeader,
155
+ hasFooter
156
+ });
157
+ const userClass = classInputToClass(this.userClass());
158
+ return twMerge(variantClass, userClass);
159
+ }, ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
160
+ this.contentDirective = contentChild(CardContentDirective, ...ngDevMode ? [{ debugName: "contentDirective" }] : /* istanbul ignore next */ []);
161
+ this.descriptionCellClass = cardHeaderDescriptionThemeVariants();
162
+ this.descriptionCellId = computed(() => {
163
+ const id = this.descriptionId();
164
+ return id ? `${id}-cell` : null;
165
+ }, ...ngDevMode ? [{ debugName: "descriptionCellId" }] : /* istanbul ignore next */ []);
166
+ this.descriptionId = this.#cardService.descriptionId.asReadonly();
167
+ this.descriptionTemplate = this.#cardService.descriptionTemplate.asReadonly();
168
+ this.footerClass = computed(() => {
169
+ const rounded = this.rounded();
170
+ const variantClass = cardFooterThemeVariants({ rounded });
171
+ const userClass = classInputToClass(this.#cardService.footerClass());
172
+ return twMerge(variantClass, userClass);
173
+ }, ...ngDevMode ? [{ debugName: "footerClass" }] : /* istanbul ignore next */ []);
174
+ this.footerTemplate = this.#cardService.footerTemplate.asReadonly();
175
+ this.headerClass = computed(() => {
176
+ const rounded = this.rounded();
177
+ const variantClass = cardHeaderThemeVariants({ rounded });
178
+ const userClass = classInputToClass(this.#cardService.headerClass());
179
+ return twMerge(variantClass, userClass);
180
+ }, ...ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []);
181
+ this.headerTemplate = this.#cardService.headerTemplate.asReadonly();
182
+ this.messages = this.#i18n.componentMessages("card", CARD_DEFAULT_MESSAGES);
183
+ this.titleCellClass = cardHeaderTitleThemeVariants();
184
+ this.titleCellId = computed(() => {
185
+ const id = this.titleId();
186
+ return id ? `${id}-cell` : null;
187
+ }, ...ngDevMode ? [{ debugName: "titleCellId" }] : /* istanbul ignore next */ []);
188
+ this.titleId = this.#cardService.titleId.asReadonly();
189
+ this.titleTemplate = this.#cardService.titleTemplate.asReadonly();
190
+ this.role = input("group", ...ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []);
191
+ this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
192
+ this.userClass = input("", {
193
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
194
+ alias: "class"
195
+ });
196
+ }
197
+ #cardService;
198
+ #i18n;
199
+ static {
200
+ this.ɵfac = i0.ɵɵngDeclareFactory({
201
+ minVersion: "12.0.0",
202
+ version: "22.2.6",
203
+ ngImport: i0,
204
+ type: CardComponent,
205
+ deps: [],
206
+ target: i0.ɵɵFactoryTarget.Component
207
+ });
208
+ }
209
+ static {
210
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
211
+ minVersion: "17.0.0",
212
+ version: "22.2.6",
213
+ type: CardComponent,
214
+ isStandalone: true,
215
+ selector: "mona-card",
216
+ inputs: {
217
+ role: {
218
+ classPropertyName: "role",
219
+ publicName: "role",
220
+ isSignal: true,
221
+ isRequired: false,
222
+ transformFunction: null
223
+ },
224
+ rounded: {
225
+ classPropertyName: "rounded",
226
+ publicName: "rounded",
227
+ isSignal: true,
228
+ isRequired: false,
229
+ transformFunction: null
230
+ },
231
+ userClass: {
232
+ classPropertyName: "userClass",
233
+ publicName: "class",
234
+ isSignal: true,
235
+ isRequired: false,
236
+ transformFunction: null
237
+ }
238
+ },
239
+ host: { properties: {
240
+ "class": "baseClass()",
241
+ "attr.aria-describedby": "titleId() ? descriptionCellId() : null",
242
+ "attr.aria-labelledby": "titleCellId()",
243
+ "attr.role": "titleId() ? role() : null"
244
+ } },
245
+ providers: [CardService],
246
+ queries: [{
247
+ propertyName: "contentDirective",
248
+ first: true,
249
+ predicate: CardContentDirective,
250
+ descendants: true,
251
+ isSignal: true
252
+ }],
253
+ ngImport: i0,
254
+ template: "@if (headerTemplate()) {\n <div [class]=\"headerClass()\">\n @if (titleTemplate()) {\n <div [class]=\"titleCellClass\" [attr.id]=\"titleCellId()\">\n <ng-container [ngTemplateOutlet]=\"titleTemplate()\" [ngTemplateOutletContext]=\"{ $implicit: titleId() }\" />\n </div>\n }\n @if (descriptionTemplate()) {\n <div [class]=\"descriptionCellClass\" [attr.id]=\"descriptionCellId()\">\n <ng-container\n [ngTemplateOutlet]=\"descriptionTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: descriptionId() }\"\n />\n </div>\n }\n @if (actionTemplate().length > 0) {\n <div [class]=\"actionsCellClass\" role=\"group\" [attr.aria-label]=\"messages().actionsLabel\">\n @for (template of actionTemplate(); track template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n }\n </div>\n }\n </div>\n}\n<ng-container [ngTemplateOutlet]=\"contentDirective()?.templateRef ?? null\" />\n@if (footerTemplate()) {\n <div [class]=\"footerClass()\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\" />\n </div>\n}\n",
255
+ dependencies: [{
256
+ kind: "directive",
257
+ type: NgTemplateOutlet,
258
+ selector: "[ngTemplateOutlet]",
259
+ inputs: [
260
+ "ngTemplateOutletContext",
261
+ "ngTemplateOutlet",
262
+ "ngTemplateOutletInjector"
263
+ ]
264
+ }]
265
+ });
266
+ }
267
+ };
268
+ i0.ɵɵngDeclareClassMetadata({
269
+ minVersion: "12.0.0",
270
+ version: "22.2.6",
271
+ ngImport: i0,
272
+ type: CardComponent,
273
+ decorators: [{
274
+ type: Component,
275
+ args: [{
276
+ selector: "mona-card",
277
+ imports: [NgTemplateOutlet],
278
+ host: {
279
+ "[class]": "baseClass()",
280
+ "[attr.aria-describedby]": "titleId() ? descriptionCellId() : null",
281
+ "[attr.aria-labelledby]": "titleCellId()",
282
+ "[attr.role]": "titleId() ? role() : null"
283
+ },
284
+ providers: [CardService],
285
+ template: "@if (headerTemplate()) {\n <div [class]=\"headerClass()\">\n @if (titleTemplate()) {\n <div [class]=\"titleCellClass\" [attr.id]=\"titleCellId()\">\n <ng-container [ngTemplateOutlet]=\"titleTemplate()\" [ngTemplateOutletContext]=\"{ $implicit: titleId() }\" />\n </div>\n }\n @if (descriptionTemplate()) {\n <div [class]=\"descriptionCellClass\" [attr.id]=\"descriptionCellId()\">\n <ng-container\n [ngTemplateOutlet]=\"descriptionTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: descriptionId() }\"\n />\n </div>\n }\n @if (actionTemplate().length > 0) {\n <div [class]=\"actionsCellClass\" role=\"group\" [attr.aria-label]=\"messages().actionsLabel\">\n @for (template of actionTemplate(); track template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n }\n </div>\n }\n </div>\n}\n<ng-container [ngTemplateOutlet]=\"contentDirective()?.templateRef ?? null\" />\n@if (footerTemplate()) {\n <div [class]=\"footerClass()\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\" />\n </div>\n}\n"
286
+ }]
287
+ }],
288
+ propDecorators: {
289
+ contentDirective: [{
290
+ type: i0.ContentChild,
291
+ args: [i0.forwardRef(() => CardContentDirective), { isSignal: true }]
292
+ }],
293
+ role: [{
294
+ type: i0.Input,
295
+ args: [{
296
+ isSignal: true,
297
+ alias: "role",
298
+ required: false
299
+ }]
300
+ }],
301
+ rounded: [{
302
+ type: i0.Input,
303
+ args: [{
304
+ isSignal: true,
305
+ alias: "rounded",
306
+ required: false
307
+ }]
308
+ }],
309
+ userClass: [{
310
+ type: i0.Input,
311
+ args: [{
312
+ isSignal: true,
313
+ alias: "class",
314
+ required: false
315
+ }]
316
+ }]
317
+ }
318
+ });
319
+ var CardFooterComponent = class CardFooterComponent {
320
+ #cardService;
321
+ constructor() {
322
+ this.#cardService = inject(CardService);
323
+ this.footerTemplate = viewChild.required(TemplateRef, ...ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []);
324
+ this.userClass = input("", {
325
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
326
+ alias: "class"
327
+ });
328
+ effect(() => {
329
+ this.#cardService.footerTemplate.set(this.footerTemplate());
330
+ this.#cardService.footerClass.set(this.userClass());
331
+ });
332
+ inject(DestroyRef).onDestroy(() => {
333
+ this.#cardService.footerTemplate.set(null);
334
+ this.#cardService.footerClass.set(null);
335
+ });
336
+ }
337
+ static {
338
+ this.ɵfac = i0.ɵɵngDeclareFactory({
339
+ minVersion: "12.0.0",
340
+ version: "22.2.6",
341
+ ngImport: i0,
342
+ type: CardFooterComponent,
343
+ deps: [],
344
+ target: i0.ɵɵFactoryTarget.Component
345
+ });
346
+ }
347
+ static {
348
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
349
+ minVersion: "17.2.0",
350
+ version: "22.2.6",
351
+ type: CardFooterComponent,
352
+ isStandalone: true,
353
+ selector: "mona-card-footer",
354
+ inputs: { userClass: {
355
+ classPropertyName: "userClass",
356
+ publicName: "class",
357
+ isSignal: true,
358
+ isRequired: false,
359
+ transformFunction: null
360
+ } },
361
+ viewQueries: [{
362
+ propertyName: "footerTemplate",
363
+ first: true,
364
+ predicate: TemplateRef,
365
+ descendants: true,
366
+ isSignal: true
367
+ }],
368
+ ngImport: i0,
369
+ template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n"
370
+ });
371
+ }
372
+ };
373
+ i0.ɵɵngDeclareClassMetadata({
374
+ minVersion: "12.0.0",
375
+ version: "22.2.6",
376
+ ngImport: i0,
377
+ type: CardFooterComponent,
378
+ decorators: [{
379
+ type: Component,
380
+ args: [{
381
+ selector: "mona-card-footer",
382
+ imports: [],
383
+ template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n"
384
+ }]
385
+ }],
386
+ ctorParameters: () => [],
387
+ propDecorators: {
388
+ footerTemplate: [{
389
+ type: i0.ViewChild,
390
+ args: [i0.forwardRef(() => TemplateRef), { isSignal: true }]
391
+ }],
392
+ userClass: [{
393
+ type: i0.Input,
394
+ args: [{
395
+ isSignal: true,
396
+ alias: "class",
397
+ required: false
398
+ }]
399
+ }]
400
+ }
401
+ });
402
+ var CardActionDirective = class CardActionDirective {
403
+ constructor() {
404
+ this.templateRef = inject(TemplateRef);
405
+ }
406
+ static {
407
+ this.ɵfac = i0.ɵɵngDeclareFactory({
408
+ minVersion: "12.0.0",
409
+ version: "22.2.6",
410
+ ngImport: i0,
411
+ type: CardActionDirective,
412
+ deps: [],
413
+ target: i0.ɵɵFactoryTarget.Directive
414
+ });
415
+ }
416
+ static {
417
+ this.ɵdir = i0.ɵɵngDeclareDirective({
418
+ minVersion: "14.0.0",
419
+ version: "22.2.6",
420
+ type: CardActionDirective,
421
+ isStandalone: true,
422
+ selector: "ng-template[monaCardAction]",
423
+ ngImport: i0
424
+ });
425
+ }
426
+ };
427
+ i0.ɵɵngDeclareClassMetadata({
428
+ minVersion: "12.0.0",
429
+ version: "22.2.6",
430
+ ngImport: i0,
431
+ type: CardActionDirective,
432
+ decorators: [{
433
+ type: Directive,
434
+ args: [{ selector: "ng-template[monaCardAction]" }]
435
+ }]
436
+ });
437
+ var CardDescriptionDirective = class CardDescriptionDirective {
438
+ constructor() {
439
+ this.id = createElementControlId();
440
+ this.templateRef = inject(TemplateRef);
441
+ }
442
+ static ngTemplateContextGuard(_directive, _context) {
443
+ return true;
444
+ }
445
+ static {
446
+ this.ɵfac = i0.ɵɵngDeclareFactory({
447
+ minVersion: "12.0.0",
448
+ version: "22.2.6",
449
+ ngImport: i0,
450
+ type: CardDescriptionDirective,
451
+ deps: [],
452
+ target: i0.ɵɵFactoryTarget.Directive
453
+ });
454
+ }
455
+ static {
456
+ this.ɵdir = i0.ɵɵngDeclareDirective({
457
+ minVersion: "14.0.0",
458
+ version: "22.2.6",
459
+ type: CardDescriptionDirective,
460
+ isStandalone: true,
461
+ selector: "ng-template[monaCardDescription]",
462
+ ngImport: i0
463
+ });
464
+ }
465
+ };
466
+ i0.ɵɵngDeclareClassMetadata({
467
+ minVersion: "12.0.0",
468
+ version: "22.2.6",
469
+ ngImport: i0,
470
+ type: CardDescriptionDirective,
471
+ decorators: [{
472
+ type: Directive,
473
+ args: [{ selector: "ng-template[monaCardDescription]" }]
474
+ }]
475
+ });
476
+ var CardTitleDirective = class CardTitleDirective {
477
+ constructor() {
478
+ this.id = createElementControlId();
479
+ this.templateRef = inject(TemplateRef);
480
+ }
481
+ static ngTemplateContextGuard(_directive, _context) {
482
+ return true;
483
+ }
484
+ static {
485
+ this.ɵfac = i0.ɵɵngDeclareFactory({
486
+ minVersion: "12.0.0",
487
+ version: "22.2.6",
488
+ ngImport: i0,
489
+ type: CardTitleDirective,
490
+ deps: [],
491
+ target: i0.ɵɵFactoryTarget.Directive
492
+ });
493
+ }
494
+ static {
495
+ this.ɵdir = i0.ɵɵngDeclareDirective({
496
+ minVersion: "14.0.0",
497
+ version: "22.2.6",
498
+ type: CardTitleDirective,
499
+ isStandalone: true,
500
+ selector: "ng-template[monaCardTitle]",
501
+ ngImport: i0
502
+ });
503
+ }
504
+ };
505
+ i0.ɵɵngDeclareClassMetadata({
506
+ minVersion: "12.0.0",
507
+ version: "22.2.6",
508
+ ngImport: i0,
509
+ type: CardTitleDirective,
510
+ decorators: [{
511
+ type: Directive,
512
+ args: [{ selector: "ng-template[monaCardTitle]" }]
513
+ }]
514
+ });
515
+ var CardHeaderComponent = class CardHeaderComponent {
516
+ #cardService;
517
+ constructor() {
518
+ this.#cardService = inject(CardService);
519
+ this.actionDirective = contentChildren(CardActionDirective, ...ngDevMode ? [{ debugName: "actionDirective" }] : /* istanbul ignore next */ []);
520
+ this.descriptionDirective = contentChild(CardDescriptionDirective, ...ngDevMode ? [{ debugName: "descriptionDirective" }] : /* istanbul ignore next */ []);
521
+ this.headerTemplate = viewChild.required(TemplateRef, ...ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []);
522
+ this.titleDirective = contentChild(CardTitleDirective, ...ngDevMode ? [{ debugName: "titleDirective" }] : /* istanbul ignore next */ []);
523
+ this.userClass = input("", {
524
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
525
+ alias: "class"
526
+ });
527
+ effect(() => {
528
+ this.#cardService.actionTemplate.set(this.actionDirective().map((directive) => directive.templateRef));
529
+ this.#cardService.descriptionId.set(this.descriptionDirective()?.id ?? null);
530
+ this.#cardService.descriptionTemplate.set(this.descriptionDirective()?.templateRef ?? null);
531
+ this.#cardService.headerTemplate.set(this.headerTemplate());
532
+ this.#cardService.headerClass.set(this.userClass());
533
+ this.#cardService.titleId.set(this.titleDirective()?.id ?? null);
534
+ this.#cardService.titleTemplate.set(this.titleDirective()?.templateRef ?? null);
535
+ });
536
+ inject(DestroyRef).onDestroy(() => {
537
+ this.#cardService.actionTemplate.set([]);
538
+ this.#cardService.descriptionId.set(null);
539
+ this.#cardService.descriptionTemplate.set(null);
540
+ this.#cardService.headerTemplate.set(null);
541
+ this.#cardService.headerClass.set(null);
542
+ this.#cardService.titleId.set(null);
543
+ this.#cardService.titleTemplate.set(null);
544
+ });
545
+ }
546
+ static {
547
+ this.ɵfac = i0.ɵɵngDeclareFactory({
548
+ minVersion: "12.0.0",
549
+ version: "22.2.6",
550
+ ngImport: i0,
551
+ type: CardHeaderComponent,
552
+ deps: [],
553
+ target: i0.ɵɵFactoryTarget.Component
554
+ });
555
+ }
556
+ static {
557
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
558
+ minVersion: "17.2.0",
559
+ version: "22.2.6",
560
+ type: CardHeaderComponent,
561
+ isStandalone: true,
562
+ selector: "mona-card-header",
563
+ inputs: { userClass: {
564
+ classPropertyName: "userClass",
565
+ publicName: "class",
566
+ isSignal: true,
567
+ isRequired: false,
568
+ transformFunction: null
569
+ } },
570
+ queries: [
571
+ {
572
+ propertyName: "actionDirective",
573
+ predicate: CardActionDirective,
574
+ isSignal: true
575
+ },
576
+ {
577
+ propertyName: "descriptionDirective",
578
+ first: true,
579
+ predicate: CardDescriptionDirective,
580
+ descendants: true,
581
+ isSignal: true
582
+ },
583
+ {
584
+ propertyName: "titleDirective",
585
+ first: true,
586
+ predicate: CardTitleDirective,
587
+ descendants: true,
588
+ isSignal: true
589
+ }
590
+ ],
591
+ viewQueries: [{
592
+ propertyName: "headerTemplate",
593
+ first: true,
594
+ predicate: TemplateRef,
595
+ descendants: true,
596
+ isSignal: true
597
+ }],
598
+ ngImport: i0,
599
+ template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n"
600
+ });
601
+ }
602
+ };
603
+ i0.ɵɵngDeclareClassMetadata({
604
+ minVersion: "12.0.0",
605
+ version: "22.2.6",
606
+ ngImport: i0,
607
+ type: CardHeaderComponent,
608
+ decorators: [{
609
+ type: Component,
610
+ args: [{
611
+ selector: "mona-card-header",
612
+ template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n"
613
+ }]
614
+ }],
615
+ ctorParameters: () => [],
616
+ propDecorators: {
617
+ actionDirective: [{
618
+ type: i0.ContentChildren,
619
+ args: [i0.forwardRef(() => CardActionDirective), { isSignal: true }]
620
+ }],
621
+ descriptionDirective: [{
622
+ type: i0.ContentChild,
623
+ args: [i0.forwardRef(() => CardDescriptionDirective), { isSignal: true }]
624
+ }],
625
+ headerTemplate: [{
626
+ type: i0.ViewChild,
627
+ args: [i0.forwardRef(() => TemplateRef), { isSignal: true }]
628
+ }],
629
+ titleDirective: [{
630
+ type: i0.ContentChild,
631
+ args: [i0.forwardRef(() => CardTitleDirective), { isSignal: true }]
632
+ }],
633
+ userClass: [{
634
+ type: i0.Input,
635
+ args: [{
636
+ isSignal: true,
637
+ alias: "class",
638
+ required: false
639
+ }]
640
+ }]
641
+ }
642
+ });
340
643
  export { CARD_DEFAULT_MESSAGES, CardActionDirective, CardComponent, CardContentDirective, CardDescriptionDirective, CardFooterComponent, CardHeaderComponent, CardTitleDirective };
341
- //# sourceMappingURL=nanahoshi-mona-ui-card.mjs.map
644
+
645
+ //# sourceMappingURL=nanahoshi-mona-ui-card.mjs.map