@nanahoshi/mona-ui 0.24.11 → 0.25.1

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 (163) hide show
  1. package/README.md +9 -0
  2. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +11 -10
  3. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +37 -20
  4. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +239 -47
  5. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +183 -30
  6. package/fesm2022/nanahoshi-mona-ui-button.mjs +45 -9
  7. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +17 -13
  8. package/fesm2022/nanahoshi-mona-ui-card.mjs +54 -30
  9. package/fesm2022/nanahoshi-mona-ui-chart.mjs +5 -0
  10. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +112 -31
  11. package/fesm2022/nanahoshi-mona-ui-chip.mjs +130 -88
  12. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +59 -19
  13. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +118 -41
  14. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +243 -212
  15. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +155 -86
  16. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +161 -131
  17. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +12 -11
  18. package/fesm2022/nanahoshi-mona-ui-common.mjs +18 -1
  19. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +10 -9
  20. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +10 -9
  21. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +2 -2
  22. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +2 -2
  23. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +10 -9
  24. package/fesm2022/nanahoshi-mona-ui-editor.mjs +25 -24
  25. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +202 -33
  26. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +31 -10
  27. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1 -1
  28. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-DhKLnW06.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-2tVhD2hK.mjs} +2 -2
  29. package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-voGbKOiB.mjs → nanahoshi-mona-ui-grid-grid-list.component-BAN70Wcn.mjs} +4 -4
  30. package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-HQ1Kv6R9.mjs → nanahoshi-mona-ui-grid-grid-row.component-C_kCaA5b.mjs} +7 -7
  31. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-PNLJFcuH.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-BsNfrAHz.mjs} +4 -4
  32. package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BO19AVwC.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CEfVa7eo.mjs} +27 -29
  33. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
  34. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +39 -4
  35. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +2 -2
  36. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +1 -1
  37. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +5 -5
  38. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +7 -7
  39. package/fesm2022/nanahoshi-mona-ui-internal.mjs +183 -47
  40. package/fesm2022/nanahoshi-mona-ui-label.mjs +111 -15
  41. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1 -1
  42. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1 -1
  43. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +33 -4
  44. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +33 -4
  45. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +33 -4
  46. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +33 -4
  47. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +33 -4
  48. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +33 -4
  49. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +33 -4
  50. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +33 -4
  51. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +33 -4
  52. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +33 -4
  53. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +33 -4
  54. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +33 -4
  55. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +33 -4
  56. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +2 -2
  57. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +14 -13
  58. package/fesm2022/nanahoshi-mona-ui-notification.mjs +1 -1
  59. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +13 -12
  60. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +192 -56
  61. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1 -1
  62. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +3 -1
  63. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2 -2
  64. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +60 -29
  65. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +334 -37
  66. package/fesm2022/nanahoshi-mona-ui-rating.mjs +84 -30
  67. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +281 -111
  68. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +126 -36
  69. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +2 -2
  70. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +595 -170
  71. package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +3 -2
  72. package/fesm2022/nanahoshi-mona-ui-slider.mjs +323 -166
  73. package/fesm2022/nanahoshi-mona-ui-spinner.mjs +167 -82
  74. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +2 -2
  75. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +273 -165
  76. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +219 -132
  77. package/fesm2022/nanahoshi-mona-ui-switch.mjs +84 -32
  78. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +337 -116
  79. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +10 -12
  80. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +21 -8
  81. package/fesm2022/nanahoshi-mona-ui-theme.mjs +472 -84
  82. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +10 -9
  83. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +15 -14
  84. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +17 -3
  85. package/fesm2022/nanahoshi-mona-ui-window.mjs +1 -1
  86. package/i18n/catalogs/en-US.messages.json +33 -4
  87. package/locales/ar-sa/ar-sa.messages.json +33 -4
  88. package/locales/de-de/de-de.messages.json +33 -4
  89. package/locales/es-es/es-es.messages.json +33 -4
  90. package/locales/fr-fr/fr-fr.messages.json +33 -4
  91. package/locales/id-id/id-id.messages.json +33 -4
  92. package/locales/it-it/it-it.messages.json +33 -4
  93. package/locales/ja-jp/ja-jp.messages.json +33 -4
  94. package/locales/ko-kr/ko-kr.messages.json +33 -4
  95. package/locales/pt-br/pt-br.messages.json +33 -4
  96. package/locales/ru-ru/ru-ru.messages.json +33 -4
  97. package/locales/tr-tr/tr-tr.messages.json +33 -4
  98. package/locales/zh-cn/zh-cn.messages.json +33 -4
  99. package/locales/zh-tw/zh-tw.messages.json +33 -4
  100. package/package.json +2 -1
  101. package/styles.css +166 -0
  102. package/types/nanahoshi-mona-ui-auto-complete.d.ts +1 -0
  103. package/types/nanahoshi-mona-ui-avatar.d.ts +18 -11
  104. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +62 -14
  105. package/types/nanahoshi-mona-ui-button-group.d.ts +86 -16
  106. package/types/nanahoshi-mona-ui-button.d.ts +26 -3
  107. package/types/nanahoshi-mona-ui-calendar.d.ts +1 -0
  108. package/types/nanahoshi-mona-ui-card.d.ts +22 -6
  109. package/types/nanahoshi-mona-ui-check-box.d.ts +54 -13
  110. package/types/nanahoshi-mona-ui-chip.d.ts +31 -18
  111. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +21 -5
  112. package/types/nanahoshi-mona-ui-collapsible.d.ts +20 -11
  113. package/types/nanahoshi-mona-ui-color-gradient.d.ts +62 -36
  114. package/types/nanahoshi-mona-ui-color-palette.d.ts +65 -27
  115. package/types/nanahoshi-mona-ui-color-picker.d.ts +64 -23
  116. package/types/nanahoshi-mona-ui-combo-box.d.ts +1 -0
  117. package/types/nanahoshi-mona-ui-common.d.ts +28 -2
  118. package/types/nanahoshi-mona-ui-date-picker.d.ts +1 -0
  119. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +1 -0
  120. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +1 -0
  121. package/types/nanahoshi-mona-ui-editor.d.ts +1 -0
  122. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +51 -7
  123. package/types/nanahoshi-mona-ui-fieldset.d.ts +18 -4
  124. package/types/nanahoshi-mona-ui-grid.d.ts +0 -1
  125. package/types/nanahoshi-mona-ui-i18n.d.ts +38 -3
  126. package/types/nanahoshi-mona-ui-internal.d.ts +95 -14
  127. package/types/nanahoshi-mona-ui-label.d.ts +17 -2
  128. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +29 -0
  129. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +29 -0
  130. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +29 -0
  131. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +29 -0
  132. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +29 -0
  133. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +29 -0
  134. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +29 -0
  135. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +29 -0
  136. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +29 -0
  137. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +29 -0
  138. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +29 -0
  139. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +29 -0
  140. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +29 -0
  141. package/types/nanahoshi-mona-ui-multi-select.d.ts +1 -0
  142. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +1 -0
  143. package/types/nanahoshi-mona-ui-otp-input.d.ts +49 -12
  144. package/types/nanahoshi-mona-ui-placeholder.d.ts +2 -1
  145. package/types/nanahoshi-mona-ui-progress-bar.d.ts +21 -9
  146. package/types/nanahoshi-mona-ui-radio-button.d.ts +165 -20
  147. package/types/nanahoshi-mona-ui-rating.d.ts +21 -6
  148. package/types/nanahoshi-mona-ui-scroll-view.d.ts +59 -27
  149. package/types/nanahoshi-mona-ui-segmented.d.ts +52 -24
  150. package/types/nanahoshi-mona-ui-sidebar.d.ts +104 -41
  151. package/types/nanahoshi-mona-ui-skeleton.d.ts +1 -1
  152. package/types/nanahoshi-mona-ui-slider.d.ts +99 -35
  153. package/types/nanahoshi-mona-ui-spinner.d.ts +9 -5
  154. package/types/nanahoshi-mona-ui-splitter.d.ts +31 -10
  155. package/types/nanahoshi-mona-ui-stepper.d.ts +58 -12
  156. package/types/nanahoshi-mona-ui-switch.d.ts +32 -10
  157. package/types/nanahoshi-mona-ui-tabs.d.ts +75 -20
  158. package/types/nanahoshi-mona-ui-text-area.d.ts +7 -7
  159. package/types/nanahoshi-mona-ui-text-box.d.ts +2 -0
  160. package/types/nanahoshi-mona-ui-theme.d.ts +392 -15
  161. package/types/nanahoshi-mona-ui-time-picker.d.ts +1 -0
  162. package/types/nanahoshi-mona-ui-time-selector.d.ts +1 -0
  163. package/types/nanahoshi-mona-ui-tooltip.d.ts +7 -1
@@ -1,14 +1,15 @@
1
1
  import { NgTemplateOutlet } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { computed, input, Directive, output, viewChild, TemplateRef, Component, inject, contentChildren, contentChild } from '@angular/core';
4
- import { LucideChevronRight } from '@lucide/angular';
3
+ import { computed, input, Directive, InjectionToken, inject, ElementRef, booleanAttribute, output, contentChild, viewChild, TemplateRef, forwardRef, Component, Injector, linkedSignal, contentChildren, afterNextRender } from '@angular/core';
4
+ import { LucideChevronRight, LucideEllipsis } from '@lucide/angular';
5
5
  import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
6
6
  import { twMerge } from 'tailwind-merge';
7
7
  import { cva } from 'class-variance-authority';
8
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
9
+ import { fromEvent } from 'rxjs';
8
10
 
9
11
  const breadcrumbListThemeVariants = cva(`
10
12
  flex list-none items-center gap-1 overflow-hidden px-2 py-1
11
- select-none
12
13
  `, {
13
14
  variants: {
14
15
  disabled: {
@@ -17,41 +18,74 @@ const breadcrumbListThemeVariants = cva(`
17
18
  }
18
19
  }
19
20
  });
21
+ /**
22
+ * `min-w-0`, or a flex item never gets narrower than its text, and nothing inside it ever truncates. The other items
23
+ * shrink faster than the current page, so it's the one that stays readable. The current page keeps a factor of 1 rather
24
+ * than a fraction, because flexbox only takes that fraction of the overflow once it's the last item left to shrink.
25
+ */
26
+ const breadcrumbListItemWrapperThemeVariants = cva(`flex min-w-0 items-center`, {
27
+ variants: {
28
+ current: {
29
+ true: "",
30
+ false: "shrink-[10]"
31
+ }
32
+ }
33
+ });
34
+ /** Inset focus, because the list clips anything outside it. */
20
35
  const breadcrumbListItemThemeVariants = cva(`
21
- flex h-full items-center truncate px-1
36
+ flex h-full max-w-full min-w-0 items-center px-1
22
37
  cursor-pointer
23
- text-muted-foreground
24
- bg-transparent border-0 rounded-sm outline-none
38
+ bg-transparent border-0 rounded-sm
25
39
  transition-colors duration-100 ease-in-out
26
- hover:bg-hover hover:text-foreground
27
- active:bg-active active:text-foreground
28
- focus-visible:ring-2 focus-visible:ring-focus-indicator/35
40
+ focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-indicator
29
41
  `, {
30
42
  variants: {
31
43
  disabled: {
32
44
  true: "pointer-events-none cursor-not-allowed text-disabled-foreground",
45
+ false: "text-muted-foreground hover:bg-hover hover:text-foreground active:bg-active active:text-foreground"
46
+ }
47
+ },
48
+ defaultVariants: {
49
+ disabled: false
50
+ }
51
+ });
52
+ /** Text in a flex item only truncates from a block of its own, and an icon beside it has to stay on the same line. */
53
+ const breadcrumbItemContentThemeVariants = cva(`min-w-0 truncate [&_svg]:inline`);
54
+ const breadcrumbLinkThemeVariants = cva(`
55
+ block max-w-full min-w-0 truncate rounded-sm px-1 [&_svg]:inline
56
+ transition-colors duration-100 ease-in-out
57
+ focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-indicator
58
+ `, {
59
+ variants: {
60
+ current: {
61
+ true: "font-medium text-foreground",
33
62
  false: ""
34
63
  },
35
- listDisabled: {
36
- true: "",
64
+ disabled: {
65
+ true: "pointer-events-none cursor-not-allowed text-disabled-foreground",
37
66
  false: ""
38
67
  }
39
68
  },
40
- compoundVariants: [{ disabled: true, listDisabled: false, class: "text-disabled-foreground" }],
69
+ compoundVariants: [
70
+ {
71
+ current: false,
72
+ disabled: false,
73
+ class: "text-muted-foreground hover:bg-hover hover:text-foreground active:bg-active active:text-foreground"
74
+ }
75
+ ],
41
76
  defaultVariants: {
42
- disabled: false,
43
- listDisabled: false
77
+ current: false,
78
+ disabled: false
44
79
  }
45
80
  });
46
- const breadcrumbCurrentItemThemeVariants = cva(`flex cursor-default items-center truncate font-medium text-foreground`);
81
+ const breadcrumbCurrentItemThemeVariants = cva(`block min-w-0 cursor-default truncate font-medium text-foreground [&_svg]:inline`);
47
82
 
48
83
  class BreadcrumbItemDirective {
49
84
  constructor() {
50
85
  this.baseClass = computed(() => {
51
86
  const disabled = this.disabled();
52
- const listDisabled = this.listDisabled();
53
87
  const userClass = this.userClass();
54
- return twMerge(breadcrumbListItemThemeVariants({ disabled, listDisabled }), userClass);
88
+ return twMerge(breadcrumbListItemThemeVariants({ disabled }), userClass);
55
89
  }, /* @ts-ignore */
56
90
  ...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
57
91
  /**
@@ -60,12 +94,6 @@ class BreadcrumbItemDirective {
60
94
  */
61
95
  this.disabled = input(false, /* @ts-ignore */
62
96
  ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
63
- /**
64
- * @description Reflects whether the parent breadcrumb is disabled. Controls compound disabled styling when only individual items are disabled.
65
- * @default false
66
- */
67
- this.listDisabled = input(false, /* @ts-ignore */
68
- ...(ngDevMode ? [{ debugName: "listDisabled" }] : /* istanbul ignore next */ []));
69
97
  /**
70
98
  * @description Additional CSS classes merged onto the breadcrumb item via `tailwind-merge`.
71
99
  * @default ""
@@ -73,7 +101,7 @@ class BreadcrumbItemDirective {
73
101
  this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
74
102
  }
75
103
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
76
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: BreadcrumbItemDirective, isStandalone: true, selector: "button[monaBreadcrumbItem]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, listDisabled: { classPropertyName: "listDisabled", publicName: "listDisabled", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "baseClass()", "disabled": "disabled()" } }, ngImport: i0 }); }
104
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: BreadcrumbItemDirective, isStandalone: true, selector: "button[monaBreadcrumbItem]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "baseClass()", "disabled": "disabled()" } }, ngImport: i0 }); }
77
105
  }
78
106
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbItemDirective, decorators: [{
79
107
  type: Directive,
@@ -84,7 +112,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
84
112
  "[disabled]": "disabled()"
85
113
  }
86
114
  }]
87
- }], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], listDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "listDisabled", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
115
+ }], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
88
116
 
89
117
  class BreadcrumbSeparatorTemplateDirective {
90
118
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbSeparatorTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
@@ -100,43 +128,158 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
100
128
  // Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
101
129
  // Edit the JSON file and run `npm run generate:locale-catalogs`.
102
130
  const BREADCRUMB_DEFAULT_MESSAGES = {
103
- breadcrumb: "Breadcrumb"
131
+ breadcrumb: "Breadcrumb",
132
+ showFullPath: "Show full path"
104
133
  };
105
134
 
135
+ const BREADCRUMB_CONTEXT = new InjectionToken("MONA_BREADCRUMB_CONTEXT");
136
+ const BREADCRUMB_ITEM_CONTEXT = new InjectionToken("MONA_BREADCRUMB_ITEM_CONTEXT");
137
+
138
+ /**
139
+ * Makes a projected anchor the item's link, so the browser and the router treat it as one: ctrl-click, copy link, `href`,
140
+ * `routerLink`, `target`. The item then renders no button around it.
141
+ */
142
+ class BreadcrumbLinkDirective {
143
+ #item;
144
+ constructor() {
145
+ this.#item = inject(BREADCRUMB_ITEM_CONTEXT, { optional: true });
146
+ this.current = computed(() => this.#item?.current() ?? false, /* @ts-ignore */
147
+ ...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
148
+ this.disabled = computed(() => this.#item?.effectiveDisabled() ?? false, /* @ts-ignore */
149
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
150
+ this.linkClass = computed(() => {
151
+ const variantClass = breadcrumbLinkThemeVariants({ current: this.current(), disabled: this.disabled() });
152
+ return twMerge(variantClass, this.userClass());
153
+ }, /* @ts-ignore */
154
+ ...(ngDevMode ? [{ debugName: "linkClass" }] : /* istanbul ignore next */ []));
155
+ /**
156
+ * @description Additional CSS classes merged onto the link via `tailwind-merge`.
157
+ * @default ""
158
+ */
159
+ this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
160
+ const host = inject(ElementRef).nativeElement;
161
+ // In the capture phase, so a disabled link stops a click before `routerLink`'s own listener can act on it.
162
+ fromEvent(host, "click", { capture: true })
163
+ .pipe(takeUntilDestroyed())
164
+ .subscribe(event => {
165
+ if (this.disabled()) {
166
+ event.preventDefault();
167
+ event.stopImmediatePropagation();
168
+ }
169
+ else if (!this.current()) {
170
+ this.#item?.itemClick.emit(event);
171
+ }
172
+ });
173
+ }
174
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbLinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
175
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: BreadcrumbLinkDirective, isStandalone: true, selector: "a[monaBreadcrumbLink]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-current": "current() ? 'page' : null", "attr.aria-disabled": "disabled() ? true : null", "attr.tabindex": "disabled() ? -1 : null", "class": "linkClass()" } }, ngImport: i0 }); }
176
+ }
177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbLinkDirective, decorators: [{
178
+ type: Directive,
179
+ args: [{
180
+ selector: "a[monaBreadcrumbLink]",
181
+ host: {
182
+ "[attr.aria-current]": "current() ? 'page' : null",
183
+ "[attr.aria-disabled]": "disabled() ? true : null",
184
+ "[attr.tabindex]": "disabled() ? -1 : null",
185
+ "[class]": "linkClass()"
186
+ }
187
+ }]
188
+ }], ctorParameters: () => [], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
189
+
106
190
  class BreadcrumbItemComponent {
107
191
  constructor() {
192
+ this.#breadcrumb = inject(BREADCRUMB_CONTEXT, { optional: true });
193
+ /**
194
+ * @internal
195
+ */
196
+ this.current = computed(() => this.#breadcrumb?.currentItem() === this, /* @ts-ignore */
197
+ ...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
108
198
  /**
109
199
  * @description Renders this item with reduced visual emphasis and removes pointer interaction.
110
200
  * Has no visual effect when the parent breadcrumb is also disabled.
111
201
  * @default false
112
202
  */
113
- this.disabled = input(false, /* @ts-ignore */
114
- ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
203
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
204
+ /**
205
+ * @internal
206
+ */
207
+ this.effectiveDisabled = computed(() => !!this.#breadcrumb?.disabled() || this.disabled(), /* @ts-ignore */
208
+ ...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
115
209
  /**
116
- * @description Emitted when the item is clicked or activated via keyboard.
117
- * Not emitted when this is the last (current-page) item or when the item is disabled.
210
+ * @description Emitted with the click when the item is clicked or activated via keyboard.
211
+ * Not emitted when this is the current-page item or when the item is disabled.
118
212
  */
119
213
  this.itemClick = output();
214
+ /**
215
+ * @internal
216
+ */
217
+ this.link = contentChild(BreadcrumbLinkDirective, /* @ts-ignore */
218
+ ...(ngDevMode ? [{ debugName: "link" }] : /* istanbul ignore next */ []));
219
+ /**
220
+ * @internal
221
+ */
120
222
  this.templateRef = viewChild.required(TemplateRef, /* @ts-ignore */
121
223
  ...(ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []));
122
224
  }
225
+ #breadcrumb;
123
226
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
124
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: BreadcrumbItemComponent, isStandalone: true, selector: "mona-breadcrumb-item", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }); }
227
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: BreadcrumbItemComponent, isStandalone: true, selector: "mona-breadcrumb-item", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, providers: [{ provide: BREADCRUMB_ITEM_CONTEXT, useExisting: forwardRef(() => BreadcrumbItemComponent) }], queries: [{ propertyName: "link", first: true, predicate: BreadcrumbLinkDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }); }
125
228
  }
126
229
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbItemComponent, decorators: [{
127
230
  type: Component,
128
- args: [{ selector: "mona-breadcrumb-item", template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }]
129
- }], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], templateRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
231
+ args: [{ selector: "mona-breadcrumb-item", providers: [{ provide: BREADCRUMB_ITEM_CONTEXT, useExisting: forwardRef(() => BreadcrumbItemComponent) }], template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }]
232
+ }], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], link: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BreadcrumbLinkDirective), { isSignal: true }] }], templateRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
130
233
 
234
+ function numberOrNull(value) {
235
+ if (value == null || value === "") {
236
+ return null;
237
+ }
238
+ const parsed = Number(value);
239
+ return Number.isNaN(parsed) ? null : parsed;
240
+ }
131
241
  class BreadcrumbComponent {
132
242
  constructor() {
133
243
  this.#i18n = inject(MonaI18nService);
244
+ this.#injector = inject(Injector);
134
245
  this.currentItemClass = computed(() => {
135
246
  return breadcrumbCurrentItemThemeVariants();
136
247
  }, /* @ts-ignore */
137
248
  ...(ngDevMode ? [{ debugName: "currentItemClass" }] : /* istanbul ignore next */ []));
249
+ this.entries = computed(() => {
250
+ const items = this.itemComponents();
251
+ const hidden = this.hiddenCount();
252
+ const entries = [];
253
+ items.forEach((item, index) => {
254
+ if (hidden > 0 && index === 1) {
255
+ entries.push({ index: hidden, item: null, key: "expand" });
256
+ }
257
+ if (hidden === 0 || index === 0 || index > hidden) {
258
+ entries.push({ index, item, key: item });
259
+ }
260
+ });
261
+ return entries;
262
+ }, /* @ts-ignore */
263
+ ...(ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []));
264
+ this.expanded = linkedSignal({ ...(ngDevMode ? { debugName: "expanded" } : /* istanbul ignore next */ {}), source: () => this.itemComponents(), computation: () => false });
265
+ this.hasItems = computed(() => this.itemComponents().length > 0, /* @ts-ignore */
266
+ ...(ngDevMode ? [{ debugName: "hasItems" }] : /* istanbul ignore next */ []));
267
+ this.hiddenCount = computed(() => {
268
+ const maxItems = this.maxItems();
269
+ const count = this.itemComponents().length;
270
+ if (maxItems === null || this.expanded()) {
271
+ return 0;
272
+ }
273
+ // The first and last items are always kept, so nothing lower than two means anything.
274
+ return Math.max(count - Math.max(Math.trunc(maxItems), 2), 0);
275
+ }, /* @ts-ignore */
276
+ ...(ngDevMode ? [{ debugName: "hiddenCount" }] : /* istanbul ignore next */ []));
138
277
  this.itemComponents = contentChildren(BreadcrumbItemComponent, /* @ts-ignore */
139
278
  ...(ngDevMode ? [{ debugName: "itemComponents" }] : /* istanbul ignore next */ []));
279
+ this.itemContentClass = computed(() => {
280
+ return breadcrumbItemContentThemeVariants();
281
+ }, /* @ts-ignore */
282
+ ...(ngDevMode ? [{ debugName: "itemContentClass" }] : /* istanbul ignore next */ []));
140
283
  this.listClass = computed(() => {
141
284
  const disabled = this.disabled();
142
285
  const userClass = this.userClass();
@@ -144,6 +287,8 @@ class BreadcrumbComponent {
144
287
  return twMerge(variantClass, userClass);
145
288
  }, /* @ts-ignore */
146
289
  ...(ngDevMode ? [{ debugName: "listClass" }] : /* istanbul ignore next */ []));
290
+ this.listElement = viewChild("list", /* @ts-ignore */
291
+ ...(ngDevMode ? [{ debugName: "listElement" }] : /* istanbul ignore next */ []));
147
292
  this.messages = this.#i18n.componentMessages("breadcrumb", BREADCRUMB_DEFAULT_MESSAGES);
148
293
  this.separatorTemplate = contentChild(BreadcrumbSeparatorTemplateDirective, { ...(ngDevMode ? { debugName: "separatorTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
149
294
  /**
@@ -152,12 +297,30 @@ class BreadcrumbComponent {
152
297
  * @default ""
153
298
  */
154
299
  this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
300
+ /**
301
+ * @internal
302
+ */
303
+ this.currentItem = computed(() => {
304
+ return this.lastItemCurrent() ? (this.itemComponents().at(-1) ?? null) : null;
305
+ }, /* @ts-ignore */
306
+ ...(ngDevMode ? [{ debugName: "currentItem" }] : /* istanbul ignore next */ []));
155
307
  /**
156
308
  * @description Renders the entire breadcrumb with reduced visual emphasis and removes pointer interaction from all items.
157
309
  * @default false
158
310
  */
159
- this.disabled = input(false, /* @ts-ignore */
160
- ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
311
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
312
+ /**
313
+ * @description Treats the last item as the current page: not a button, and marked `aria-current="page"`. Turn it off
314
+ * for a trail that ends before the page you're on.
315
+ * @default true
316
+ */
317
+ this.lastItemCurrent = input(true, { ...(ngDevMode ? { debugName: "lastItemCurrent" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
318
+ /**
319
+ * @description The most items to show before the middle of the trail collapses behind a button that shows it again.
320
+ * The first and last items always stay, so anything below 2 counts as 2. `null` never collapses.
321
+ * @default null
322
+ */
323
+ this.maxItems = input(null, { ...(ngDevMode ? { debugName: "maxItems" } : /* istanbul ignore next */ {}), transform: numberOrNull });
161
324
  /**
162
325
  * @description Additional CSS classes merged onto the breadcrumb list via `tailwind-merge`.
163
326
  * @default ""
@@ -165,24 +328,53 @@ class BreadcrumbComponent {
165
328
  this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
166
329
  }
167
330
  #i18n;
168
- onItemClick(item) {
169
- if (this.disabled() || item.disabled()) {
170
- return;
331
+ #injector;
332
+ /**
333
+ * Shows the whole trail. The button that was just activated goes away, so focus moves to the first item it revealed.
334
+ */
335
+ expand() {
336
+ const firstRevealed = 1;
337
+ const lastRevealed = this.hiddenCount();
338
+ this.expanded.set(true);
339
+ afterNextRender({
340
+ read: () => {
341
+ const list = this.listElement()?.nativeElement;
342
+ for (let index = firstRevealed; index <= lastRevealed; index++) {
343
+ const target = list
344
+ ?.querySelector(`li[data-item-index="${index}"]`)
345
+ ?.querySelector("a:not([aria-disabled='true']), button:not(:disabled)");
346
+ if (target) {
347
+ target.focus();
348
+ return;
349
+ }
350
+ }
351
+ list?.querySelector("a:not([aria-disabled='true']), button:not(:disabled)")?.focus();
352
+ }
353
+ }, { injector: this.#injector });
354
+ }
355
+ listItemClass(current) {
356
+ return breadcrumbListItemWrapperThemeVariants({ current });
357
+ }
358
+ onItemClick(item, event) {
359
+ if (!item.effectiveDisabled()) {
360
+ item.itemClick.emit(event);
171
361
  }
172
- item.itemClick.emit();
173
362
  }
174
363
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
175
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: BreadcrumbComponent, isStandalone: true, selector: "mona-breadcrumb", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "navigation" }, properties: { "attr.aria-label": "ariaLabel() || messages().breadcrumb" } }, queries: [{ propertyName: "itemComponents", predicate: BreadcrumbItemComponent, isSignal: true }, { propertyName: "separatorTemplate", first: true, predicate: BreadcrumbSeparatorTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<ol role=\"list\" [class]=\"listClass()\">\n @for (item of itemComponents(); track item) {\n <li>\n @if ($last) {\n <span aria-current=\"page\" [class]=\"currentItemClass()\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </span>\n } @else {\n <button\n type=\"button\"\n monaBreadcrumbItem\n [disabled]=\"disabled() || item.disabled()\"\n (click)=\"onItemClick(item)\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </button>\n }\n </li>\n\n @if (!$last) {\n <li aria-hidden=\"true\" role=\"presentation\">\n @if (separatorTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"separatorTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: $index }\"></ng-container>\n } @else {\n <svg lucideChevronRight [size]=\"18\" class=\"rtl:rotate-180\"></svg>\n }\n </li>\n }\n }\n</ol>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: BreadcrumbItemDirective, selector: "button[monaBreadcrumbItem]", inputs: ["disabled", "listDisabled", "class"] }, { kind: "component", type: LucideChevronRight, selector: "svg[lucideChevronRight]" }] }); }
364
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: BreadcrumbComponent, isStandalone: true, selector: "mona-breadcrumb", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, lastItemCurrent: { classPropertyName: "lastItemCurrent", publicName: "lastItemCurrent", isSignal: true, isRequired: false, transformFunction: null }, maxItems: { classPropertyName: "maxItems", publicName: "maxItems", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-label": "hasItems() ? ariaLabel() || messages().breadcrumb : null", "attr.role": "hasItems() ? 'navigation' : null" }, classAttribute: "block max-w-full min-w-0" }, providers: [{ provide: BREADCRUMB_CONTEXT, useExisting: forwardRef(() => BreadcrumbComponent) }], queries: [{ propertyName: "itemComponents", predicate: BreadcrumbItemComponent, isSignal: true }, { propertyName: "separatorTemplate", first: true, predicate: BreadcrumbSeparatorTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "listElement", first: true, predicate: ["list"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (itemComponents().length > 0) {\n <ol #list role=\"list\" [class]=\"listClass()\">\n @for (entry of entries(); track entry.key) {\n @let item = entry.item;\n @if (item) {\n <li [class]=\"listItemClass(item.current())\" [attr.data-item-index]=\"entry.index\">\n @if (item.link()) {\n <!-- The anchor is the item, with its own classes and aria-current. -->\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n } @else if (item.current()) {\n <span aria-current=\"page\" [class]=\"currentItemClass()\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </span>\n } @else {\n <button\n type=\"button\"\n monaBreadcrumbItem\n [disabled]=\"item.effectiveDisabled()\"\n (click)=\"onItemClick(item, $event)\">\n <span [class]=\"itemContentClass()\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </span>\n </button>\n }\n </li>\n } @else {\n <li class=\"shrink-0\">\n <button\n type=\"button\"\n monaBreadcrumbItem\n data-breadcrumb-expand\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"messages().showFullPath\"\n (click)=\"expand()\">\n <svg lucideEllipsis [size]=\"18\" aria-hidden=\"true\"></svg>\n </button>\n </li>\n }\n\n @if (!$last) {\n <li class=\"shrink-0\" aria-hidden=\"true\" role=\"presentation\">\n @if (separatorTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"separatorTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.index }\"></ng-container>\n } @else {\n <svg lucideChevronRight [size]=\"18\" class=\"rtl:rotate-180\"></svg>\n }\n </li>\n }\n }\n </ol>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: BreadcrumbItemDirective, selector: "button[monaBreadcrumbItem]", inputs: ["disabled", "class"] }, { kind: "component", type: LucideChevronRight, selector: "svg[lucideChevronRight]" }, { kind: "component", type: LucideEllipsis, selector: "svg[lucideEllipsis], svg[lucideMoreHorizontal]" }] }); }
176
365
  }
177
366
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbComponent, decorators: [{
178
367
  type: Component,
179
- args: [{ selector: "mona-breadcrumb", imports: [NgTemplateOutlet, BreadcrumbItemDirective, LucideChevronRight], host: {
180
- role: "navigation",
181
- "[attr.aria-label]": "ariaLabel() || messages().breadcrumb"
182
- }, template: "<ol role=\"list\" [class]=\"listClass()\">\n @for (item of itemComponents(); track item) {\n <li>\n @if ($last) {\n <span aria-current=\"page\" [class]=\"currentItemClass()\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </span>\n } @else {\n <button\n type=\"button\"\n monaBreadcrumbItem\n [disabled]=\"disabled() || item.disabled()\"\n (click)=\"onItemClick(item)\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </button>\n }\n </li>\n\n @if (!$last) {\n <li aria-hidden=\"true\" role=\"presentation\">\n @if (separatorTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"separatorTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: $index }\"></ng-container>\n } @else {\n <svg lucideChevronRight [size]=\"18\" class=\"rtl:rotate-180\"></svg>\n }\n </li>\n }\n }\n</ol>\n" }]
183
- }], propDecorators: { itemComponents: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BreadcrumbItemComponent), { isSignal: true }] }], separatorTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BreadcrumbSeparatorTemplateDirective), { ...{
368
+ args: [{ selector: "mona-breadcrumb", imports: [NgTemplateOutlet, BreadcrumbItemDirective, LucideChevronRight, LucideEllipsis], providers: [{ provide: BREADCRUMB_CONTEXT, useExisting: forwardRef(() => BreadcrumbComponent) }], host: {
369
+ "[attr.aria-label]": "hasItems() ? ariaLabel() || messages().breadcrumb : null",
370
+ "[attr.role]": "hasItems() ? 'navigation' : null",
371
+ // In a flex parent the host is the flex item, and it would otherwise never get narrower than the trail's text:
372
+ // min-w-0 for one that shrinks along its row, max-w-full for one sized to fit across a column.
373
+ class: "block max-w-full min-w-0"
374
+ }, template: "@if (itemComponents().length > 0) {\n <ol #list role=\"list\" [class]=\"listClass()\">\n @for (entry of entries(); track entry.key) {\n @let item = entry.item;\n @if (item) {\n <li [class]=\"listItemClass(item.current())\" [attr.data-item-index]=\"entry.index\">\n @if (item.link()) {\n <!-- The anchor is the item, with its own classes and aria-current. -->\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n } @else if (item.current()) {\n <span aria-current=\"page\" [class]=\"currentItemClass()\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </span>\n } @else {\n <button\n type=\"button\"\n monaBreadcrumbItem\n [disabled]=\"item.effectiveDisabled()\"\n (click)=\"onItemClick(item, $event)\">\n <span [class]=\"itemContentClass()\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </span>\n </button>\n }\n </li>\n } @else {\n <li class=\"shrink-0\">\n <button\n type=\"button\"\n monaBreadcrumbItem\n data-breadcrumb-expand\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"messages().showFullPath\"\n (click)=\"expand()\">\n <svg lucideEllipsis [size]=\"18\" aria-hidden=\"true\"></svg>\n </button>\n </li>\n }\n\n @if (!$last) {\n <li class=\"shrink-0\" aria-hidden=\"true\" role=\"presentation\">\n @if (separatorTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"separatorTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.index }\"></ng-container>\n } @else {\n <svg lucideChevronRight [size]=\"18\" class=\"rtl:rotate-180\"></svg>\n }\n </li>\n }\n }\n </ol>\n}\n" }]
375
+ }], propDecorators: { itemComponents: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BreadcrumbItemComponent), { isSignal: true }] }], listElement: [{ type: i0.ViewChild, args: ["list", { isSignal: true }] }], separatorTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BreadcrumbSeparatorTemplateDirective), { ...{
184
376
  read: TemplateRef
185
- }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
377
+ }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], lastItemCurrent: [{ type: i0.Input, args: [{ isSignal: true, alias: "lastItemCurrent", required: false }] }], maxItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxItems", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
186
378
 
187
379
  /*
188
380
  * Public API Surface of @nanahoshi/mona-ui/breadcrumb
@@ -192,5 +384,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
192
384
  * Generated bundle index. Do not edit.
193
385
  */
194
386
 
195
- export { BREADCRUMB_DEFAULT_MESSAGES, BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbSeparatorTemplateDirective };
387
+ export { BREADCRUMB_DEFAULT_MESSAGES, BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbLinkDirective, BreadcrumbSeparatorTemplateDirective };
196
388
  //# sourceMappingURL=nanahoshi-mona-ui-breadcrumb.mjs.map