@nanahoshi/mona-ui 0.46.0 → 0.48.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 (59) hide show
  1. package/docs/api/button.json +1 -1
  2. package/docs/api/button.md +1 -0
  3. package/docs/api/check-box.json +1 -1
  4. package/docs/api/check-box.md +1 -0
  5. package/docs/api/chip.json +1 -1
  6. package/docs/api/chip.md +1 -0
  7. package/docs/api/common.json +1 -1
  8. package/docs/api/common.md +1 -1
  9. package/docs/api/grid.json +1 -1
  10. package/docs/api/grid.md +18 -0
  11. package/docs/api/index.json +1 -1
  12. package/docs/api/radio-button.json +1 -1
  13. package/docs/api/radio-button.md +1 -0
  14. package/docs/api/ripple.json +1 -0
  15. package/docs/api/ripple.md +75 -0
  16. package/docs/api/sidebar.json +1 -1
  17. package/docs/api/sidebar.md +1 -0
  18. package/docs/api/switch.json +1 -1
  19. package/docs/api/switch.md +1 -0
  20. package/docs/grid-rows.md +36 -0
  21. package/docs/grid-server.md +6 -0
  22. package/docs/grid.md +3 -2
  23. package/docs/manifest.json +1 -1
  24. package/docs/ripple.md +360 -0
  25. package/docs/sidebar-menus.md +8 -0
  26. package/fesm2022/{grid-colgroup.component-B4jx10Yi.mjs → grid-colgroup.component-BFbiAvkG.mjs} +2 -2
  27. package/fesm2022/{grid-footer-row.component-CVUltI39.mjs → grid-footer-row.component-DpSu7jvG.mjs} +3 -2
  28. package/fesm2022/{grid-list.component-Cv1KB5VQ.mjs → grid-list.component-B-F4bvFL.mjs} +5 -5
  29. package/fesm2022/{grid-row.component-BauMmps5.mjs → grid-row.component-CuCQ_Z5F.mjs} +37 -9
  30. package/fesm2022/{grid-virtual-list.component-DNjoZfHq.mjs → grid-virtual-list.component-rIz5AUOU.mjs} +31 -12
  31. package/fesm2022/{grid.styles-BJHVTT_v.mjs → grid.styles-D6jP3vwD.mjs} +110 -35
  32. package/fesm2022/nanahoshi-mona-ui-button.mjs +20 -2
  33. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +11 -3
  34. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +30 -5
  35. package/fesm2022/nanahoshi-mona-ui-chip.mjs +13 -0
  36. package/fesm2022/nanahoshi-mona-ui-grid.mjs +16 -20
  37. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +9 -1
  38. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +9 -3
  39. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +12 -4
  40. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +11 -3
  41. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +27 -3
  42. package/fesm2022/nanahoshi-mona-ui-ripple.mjs +196 -0
  43. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +9 -3
  44. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +21 -1
  45. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +5 -1
  46. package/fesm2022/nanahoshi-mona-ui-switch.mjs +28 -3
  47. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +7 -1
  48. package/llms.txt +3 -1
  49. package/package.json +5 -1
  50. package/ripple/package.json +5 -0
  51. package/types/nanahoshi-mona-ui-button.d.ts +8 -1
  52. package/types/nanahoshi-mona-ui-calendar.d.ts +1 -0
  53. package/types/nanahoshi-mona-ui-check-box.d.ts +10 -1
  54. package/types/nanahoshi-mona-ui-chip.d.ts +8 -1
  55. package/types/nanahoshi-mona-ui-grid.d.ts +35 -4
  56. package/types/nanahoshi-mona-ui-radio-button.d.ts +9 -1
  57. package/types/nanahoshi-mona-ui-ripple.d.ts +72 -0
  58. package/types/nanahoshi-mona-ui-sidebar.d.ts +12 -0
  59. package/types/nanahoshi-mona-ui-switch.d.ts +10 -2
@@ -9,6 +9,7 @@ import { cva } from "class-variance-authority";
9
9
  import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
10
10
  import { createElementControlId, isNavigationKey, isTypeaheadKey, rxTimeout, setupTypeahead, themeOverlaySurfaceClasses, toCssValue } from "@nanahoshi/mona-ui/internal";
11
11
  import { Subject, filter, fromEvent, take, takeUntil, tap } from "rxjs";
12
+ import { RippleDirective } from "@nanahoshi/mona-ui/ripple";
12
13
  import { any, select, selectMany } from "@mirei/ts-collections";
13
14
  import { PopupDataInjectionToken, PopupService } from "@nanahoshi/mona-ui/popup";
14
15
  import { PopupMenuGroupTemplateToken, PopupMenuIconTemplateToken, PopupMenuItemClickEvent, PopupMenuItemClickEvent as PopupMenuItemClickEvent$1, PopupMenuItemType, PopupMenuOrigin, PopupMenuRadioItemToken, PopupMenuShortcutTemplateToken, PopupMenuTemplateOrigin, PopupMenuTemplateType, PopupMenuTextTemplateToken, PopupMenuToken, preparePopupMenuItems } from "@nanahoshi/mona-ui/internal/popup-menu";
@@ -600,7 +601,7 @@ var PopupMenuListComponent = class PopupMenuListComponent {
600
601
  properties: { "class": "baseClasses()" }
601
602
  },
602
603
  ngImport: i0,
603
- template: "<div\n role=\"menu\"\n [attr.tabindex]=\"0\"\n [attr.aria-orientation]=\"'vertical'\"\n [attr.aria-activedescendant]=\"activeMenuItem()?.uid\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.id]=\"menuId()\"\n [class]=\"containerClasses()\">\n @for (group of menuItems(); track $index) {\n @if (group.title) {\n @let groupTemplate = group.items[0]?.groupTemplate?.() ?? popupGroupTemplate() ?? null;\n <div role=\"group\" [attr.aria-labelledby]=\"group.labelId\">\n <div [id]=\"group.labelId\" role=\"presentation\" [class]=\"groupHeaderClasses()\">\n @if (groupTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.title }\"></ng-container>\n } @else {\n <span>{{ group.title }}</span>\n }\n </div>\n <ng-container\n [ngTemplateOutlet]=\"itemsTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.items }\"></ng-container>\n </div>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"itemsTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.items }\"></ng-container>\n }\n }\n</div>\n\n<ng-template #itemsTemplate let-items>\n @for (item of asItems(items); track $index) {\n @if (item.separator) {\n <div role=\"separator\" class=\"bg-border my-1 h-px\"></div>\n } @else {\n @let iconTemplate = item.iconTemplate?.() ?? popupIconTemplate() ?? null;\n @let shortcutTemplate = item.shortcutTemplate?.() ?? popupShortcutTemplate() ?? null;\n @let textTemplate = item.textTemplate?.() ?? popupTextTemplate() ?? null;\n <div\n [attr.role]=\"item.checkable ? 'menuitemcheckbox' : item.radio ? 'menuitemradio' : 'menuitem'\"\n [attr.aria-checked]=\"item.checkable ? !!item.checked?.() : item.radio ? !!item.selected?.() : null\"\n [id]=\"item.uid\"\n (pointerenter)=\"onItemPointerEnter($event, item)\"\n (click)=\"onItemClick($event, item)\"\n [attr.data-active]=\"item === activeMenuItem()\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.aria-expanded]=\"item.items.length > 0 ? item === openSubmenuItem() : null\"\n [attr.aria-controls]=\"item === openSubmenuItem() ? submenuId() : null\"\n [attr.aria-haspopup]=\"item.items.length > 0 ? 'menu' : null\"\n [attr.aria-label]=\"textTemplate ? null : item.label || null\"\n [attr.data-disabled]=\"item.disabled\"\n [class]=\"menuItemClasses()\">\n @if (iconAreaVisible()) {\n <div [class]=\"iconContainerClasses()\">\n @if (!item.checkable && !item.radio) {\n <ng-container\n [ngTemplateOutlet]=\"iconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else if (item.checkable) {\n @if (item.checked?.()) {\n <svg lucideCheck [size]=\"14\"></svg>\n }\n } @else if (item.radio) {\n @if (item.selected?.()) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"lucide lucide-circle size-2 fill-current\">\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n </svg>\n }\n }\n </div>\n }\n <div class=\"flex-1\">\n @if (textTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"textTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else {\n {{ item.label }}\n }\n </div>\n @if (item.items.length > 0) {\n @if (!item.checkable) {\n <div [class]=\"linkContainerClasses()\">\n <svg lucideChevronRight [size]=\"16\" class=\"rtl:rotate-180\"></svg>\n </div>\n }\n } @else if (shortcutTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"shortcutTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </div>\n }\n }\n</ng-template>\n",
604
+ template: "<div\n role=\"menu\"\n [attr.tabindex]=\"0\"\n [attr.aria-orientation]=\"'vertical'\"\n [attr.aria-activedescendant]=\"activeMenuItem()?.uid\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.id]=\"menuId()\"\n [class]=\"containerClasses()\">\n @for (group of menuItems(); track $index) {\n @if (group.title) {\n @let groupTemplate = group.items[0]?.groupTemplate?.() ?? popupGroupTemplate() ?? null;\n <div role=\"group\" [attr.aria-labelledby]=\"group.labelId\">\n <div [id]=\"group.labelId\" role=\"presentation\" [class]=\"groupHeaderClasses()\">\n @if (groupTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.title }\"></ng-container>\n } @else {\n <span>{{ group.title }}</span>\n }\n </div>\n <ng-container\n [ngTemplateOutlet]=\"itemsTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.items }\"></ng-container>\n </div>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"itemsTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.items }\"></ng-container>\n }\n }\n</div>\n\n<ng-template #itemsTemplate let-items>\n @for (item of asItems(items); track $index) {\n @if (item.separator) {\n <div role=\"separator\" class=\"bg-border my-1 h-px\"></div>\n } @else {\n @let iconTemplate = item.iconTemplate?.() ?? popupIconTemplate() ?? null;\n @let shortcutTemplate = item.shortcutTemplate?.() ?? popupShortcutTemplate() ?? null;\n @let textTemplate = item.textTemplate?.() ?? popupTextTemplate() ?? null;\n <div\n [attr.role]=\"item.checkable ? 'menuitemcheckbox' : item.radio ? 'menuitemradio' : 'menuitem'\"\n [attr.aria-checked]=\"item.checkable ? !!item.checked?.() : item.radio ? !!item.selected?.() : null\"\n [id]=\"item.uid\"\n monaRipple\n (pointerenter)=\"onItemPointerEnter($event, item)\"\n (click)=\"onItemClick($event, item)\"\n [attr.data-active]=\"item === activeMenuItem()\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.aria-expanded]=\"item.items.length > 0 ? item === openSubmenuItem() : null\"\n [attr.aria-controls]=\"item === openSubmenuItem() ? submenuId() : null\"\n [attr.aria-haspopup]=\"item.items.length > 0 ? 'menu' : null\"\n [attr.aria-label]=\"textTemplate ? null : item.label || null\"\n [attr.data-disabled]=\"item.disabled\"\n [class]=\"menuItemClasses()\">\n @if (iconAreaVisible()) {\n <div [class]=\"iconContainerClasses()\">\n @if (!item.checkable && !item.radio) {\n <ng-container\n [ngTemplateOutlet]=\"iconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else if (item.checkable) {\n @if (item.checked?.()) {\n <svg lucideCheck [size]=\"14\"></svg>\n }\n } @else if (item.radio) {\n @if (item.selected?.()) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"lucide lucide-circle size-2 fill-current\">\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n </svg>\n }\n }\n </div>\n }\n <div class=\"flex-1\">\n @if (textTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"textTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else {\n {{ item.label }}\n }\n </div>\n @if (item.items.length > 0) {\n @if (!item.checkable) {\n <div [class]=\"linkContainerClasses()\">\n <svg lucideChevronRight [size]=\"16\" class=\"rtl:rotate-180\"></svg>\n </div>\n }\n } @else if (shortcutTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"shortcutTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </div>\n }\n }\n</ng-template>\n",
604
605
  dependencies: [
605
606
  {
606
607
  kind: "directive",
@@ -621,6 +622,12 @@ var PopupMenuListComponent = class PopupMenuListComponent {
621
622
  kind: "component",
622
623
  type: LucideCheck,
623
624
  selector: "svg[lucideCheck]"
625
+ },
626
+ {
627
+ kind: "directive",
628
+ type: RippleDirective,
629
+ selector: "[monaRipple]",
630
+ inputs: ["monaRippleDisabled"]
624
631
  }
625
632
  ]
626
633
  });
@@ -638,7 +645,8 @@ i0.ɵɵngDeclareClassMetadata({
638
645
  imports: [
639
646
  NgTemplateOutlet,
640
647
  LucideChevronRight,
641
- LucideCheck
648
+ LucideCheck,
649
+ RippleDirective
642
650
  ],
643
651
  host: {
644
652
  "[class]": "baseClasses()",
@@ -646,7 +654,7 @@ i0.ɵɵngDeclareClassMetadata({
646
654
  "(pointerenter)": "onHostPointerEnter()",
647
655
  "(pointerleave)": "onHostPointerLeave()"
648
656
  },
649
- template: "<div\n role=\"menu\"\n [attr.tabindex]=\"0\"\n [attr.aria-orientation]=\"'vertical'\"\n [attr.aria-activedescendant]=\"activeMenuItem()?.uid\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.id]=\"menuId()\"\n [class]=\"containerClasses()\">\n @for (group of menuItems(); track $index) {\n @if (group.title) {\n @let groupTemplate = group.items[0]?.groupTemplate?.() ?? popupGroupTemplate() ?? null;\n <div role=\"group\" [attr.aria-labelledby]=\"group.labelId\">\n <div [id]=\"group.labelId\" role=\"presentation\" [class]=\"groupHeaderClasses()\">\n @if (groupTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.title }\"></ng-container>\n } @else {\n <span>{{ group.title }}</span>\n }\n </div>\n <ng-container\n [ngTemplateOutlet]=\"itemsTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.items }\"></ng-container>\n </div>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"itemsTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.items }\"></ng-container>\n }\n }\n</div>\n\n<ng-template #itemsTemplate let-items>\n @for (item of asItems(items); track $index) {\n @if (item.separator) {\n <div role=\"separator\" class=\"bg-border my-1 h-px\"></div>\n } @else {\n @let iconTemplate = item.iconTemplate?.() ?? popupIconTemplate() ?? null;\n @let shortcutTemplate = item.shortcutTemplate?.() ?? popupShortcutTemplate() ?? null;\n @let textTemplate = item.textTemplate?.() ?? popupTextTemplate() ?? null;\n <div\n [attr.role]=\"item.checkable ? 'menuitemcheckbox' : item.radio ? 'menuitemradio' : 'menuitem'\"\n [attr.aria-checked]=\"item.checkable ? !!item.checked?.() : item.radio ? !!item.selected?.() : null\"\n [id]=\"item.uid\"\n (pointerenter)=\"onItemPointerEnter($event, item)\"\n (click)=\"onItemClick($event, item)\"\n [attr.data-active]=\"item === activeMenuItem()\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.aria-expanded]=\"item.items.length > 0 ? item === openSubmenuItem() : null\"\n [attr.aria-controls]=\"item === openSubmenuItem() ? submenuId() : null\"\n [attr.aria-haspopup]=\"item.items.length > 0 ? 'menu' : null\"\n [attr.aria-label]=\"textTemplate ? null : item.label || null\"\n [attr.data-disabled]=\"item.disabled\"\n [class]=\"menuItemClasses()\">\n @if (iconAreaVisible()) {\n <div [class]=\"iconContainerClasses()\">\n @if (!item.checkable && !item.radio) {\n <ng-container\n [ngTemplateOutlet]=\"iconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else if (item.checkable) {\n @if (item.checked?.()) {\n <svg lucideCheck [size]=\"14\"></svg>\n }\n } @else if (item.radio) {\n @if (item.selected?.()) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"lucide lucide-circle size-2 fill-current\">\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n </svg>\n }\n }\n </div>\n }\n <div class=\"flex-1\">\n @if (textTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"textTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else {\n {{ item.label }}\n }\n </div>\n @if (item.items.length > 0) {\n @if (!item.checkable) {\n <div [class]=\"linkContainerClasses()\">\n <svg lucideChevronRight [size]=\"16\" class=\"rtl:rotate-180\"></svg>\n </div>\n }\n } @else if (shortcutTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"shortcutTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </div>\n }\n }\n</ng-template>\n"
657
+ template: "<div\n role=\"menu\"\n [attr.tabindex]=\"0\"\n [attr.aria-orientation]=\"'vertical'\"\n [attr.aria-activedescendant]=\"activeMenuItem()?.uid\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.id]=\"menuId()\"\n [class]=\"containerClasses()\">\n @for (group of menuItems(); track $index) {\n @if (group.title) {\n @let groupTemplate = group.items[0]?.groupTemplate?.() ?? popupGroupTemplate() ?? null;\n <div role=\"group\" [attr.aria-labelledby]=\"group.labelId\">\n <div [id]=\"group.labelId\" role=\"presentation\" [class]=\"groupHeaderClasses()\">\n @if (groupTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.title }\"></ng-container>\n } @else {\n <span>{{ group.title }}</span>\n }\n </div>\n <ng-container\n [ngTemplateOutlet]=\"itemsTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.items }\"></ng-container>\n </div>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"itemsTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.items }\"></ng-container>\n }\n }\n</div>\n\n<ng-template #itemsTemplate let-items>\n @for (item of asItems(items); track $index) {\n @if (item.separator) {\n <div role=\"separator\" class=\"bg-border my-1 h-px\"></div>\n } @else {\n @let iconTemplate = item.iconTemplate?.() ?? popupIconTemplate() ?? null;\n @let shortcutTemplate = item.shortcutTemplate?.() ?? popupShortcutTemplate() ?? null;\n @let textTemplate = item.textTemplate?.() ?? popupTextTemplate() ?? null;\n <div\n [attr.role]=\"item.checkable ? 'menuitemcheckbox' : item.radio ? 'menuitemradio' : 'menuitem'\"\n [attr.aria-checked]=\"item.checkable ? !!item.checked?.() : item.radio ? !!item.selected?.() : null\"\n [id]=\"item.uid\"\n monaRipple\n (pointerenter)=\"onItemPointerEnter($event, item)\"\n (click)=\"onItemClick($event, item)\"\n [attr.data-active]=\"item === activeMenuItem()\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.aria-expanded]=\"item.items.length > 0 ? item === openSubmenuItem() : null\"\n [attr.aria-controls]=\"item === openSubmenuItem() ? submenuId() : null\"\n [attr.aria-haspopup]=\"item.items.length > 0 ? 'menu' : null\"\n [attr.aria-label]=\"textTemplate ? null : item.label || null\"\n [attr.data-disabled]=\"item.disabled\"\n [class]=\"menuItemClasses()\">\n @if (iconAreaVisible()) {\n <div [class]=\"iconContainerClasses()\">\n @if (!item.checkable && !item.radio) {\n <ng-container\n [ngTemplateOutlet]=\"iconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else if (item.checkable) {\n @if (item.checked?.()) {\n <svg lucideCheck [size]=\"14\"></svg>\n }\n } @else if (item.radio) {\n @if (item.selected?.()) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"lucide lucide-circle size-2 fill-current\">\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n </svg>\n }\n }\n </div>\n }\n <div class=\"flex-1\">\n @if (textTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"textTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n } @else {\n {{ item.label }}\n }\n </div>\n @if (item.items.length > 0) {\n @if (!item.checkable) {\n <div [class]=\"linkContainerClasses()\">\n <svg lucideChevronRight [size]=\"16\" class=\"rtl:rotate-180\"></svg>\n </div>\n }\n } @else if (shortcutTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"shortcutTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n }\n </div>\n }\n }\n</ng-template>\n"
650
658
  }]
651
659
  }],
652
660
  ctorParameters: () => []
@@ -4,6 +4,8 @@ import { Component, Directive, ElementRef, InjectionToken, afterNextRender, afte
4
4
  import { twMerge } from "tailwind-merge";
5
5
  import { cva } from "class-variance-authority";
6
6
  import { FIELD_ASSOCIATION_BOUNDARY, createElementControlId, injectEffectiveDisabled, injectLabelAssociation, themeControlSurfaceClasses } from "@nanahoshi/mona-ui/internal";
7
+ import * as i1 from "@nanahoshi/mona-ui/ripple";
8
+ import { RippleDirective } from "@nanahoshi/mona-ui/ripple";
7
9
  import { FormsModule } from "@angular/forms";
8
10
  const radioGroupThemeVariants = cva("flex", {
9
11
  variants: { orientation: {
@@ -17,7 +19,7 @@ const radioButtonThemeVariants = cva(`
17
19
  `);
18
20
  const radioButtonCircleThemeVariants = cva(`
19
21
  relative flex h-4.5 w-4.5 items-center justify-center
20
- cursor-pointer overflow-hidden
22
+ cursor-pointer
21
23
  ${themeControlSurfaceClasses}
22
24
  border border-input-border
23
25
  transition-colors duration-(--mona-motion-fast)
@@ -138,6 +140,7 @@ var RadioButtonComponent = class RadioButtonComponent {
138
140
  focus: () => this.focus(),
139
141
  wrapped: false
140
142
  });
143
+ this.circleRef = viewChild("circle", ...ngDevMode ? [{ debugName: "circleRef" }] : /* istanbul ignore next */ []);
141
144
  this.containerLabelClasses = computed(() => {
142
145
  const labelSize = this.labelSize();
143
146
  const userClasses = this.userClass();
@@ -218,6 +221,9 @@ var RadioButtonComponent = class RadioButtonComponent {
218
221
  alias: "class"
219
222
  });
220
223
  this.value = model(void 0, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
224
+ const ripple = inject(RippleDirective, { self: true });
225
+ ripple.setHostDisabled(computed(() => this.effectiveDisabled() || this.effectiveReadonly()));
226
+ ripple.setHalo(() => this.circleRef()?.nativeElement);
221
227
  const group = this.#group;
222
228
  if (group) afterRenderEffect({ write: () => {
223
229
  group.selectionVersion();
@@ -405,14 +411,24 @@ var RadioButtonComponent = class RadioButtonComponent {
405
411
  "attr.data-disabled": "effectiveDisabled()"
406
412
  } },
407
413
  viewQueries: [{
414
+ propertyName: "circleRef",
415
+ first: true,
416
+ predicate: ["circle"],
417
+ descendants: true,
418
+ isSignal: true
419
+ }, {
408
420
  propertyName: "inputRef",
409
421
  first: true,
410
422
  predicate: ["input"],
411
423
  descendants: true,
412
424
  isSignal: true
413
425
  }],
426
+ hostDirectives: [{
427
+ directive: i1.RippleDirective,
428
+ inputs: ["monaRippleDisabled", "monaRippleDisabled"]
429
+ }],
414
430
  ngImport: i0,
415
- template: "<label\n [class]=\"containerLabelClasses()\"\n [attr.data-disabled]=\"effectiveDisabled()\"\n [attr.data-readonly]=\"effectiveReadonly() || null\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n <input\n #input\n type=\"radio\"\n [id]=\"inputId()\"\n [required]=\"effectiveRequired()\"\n [disabled]=\"effectiveDisabled()\"\n [name]=\"effectiveName()\"\n [attr.value]=\"nativeValue()\"\n [class]=\"radioButtonClasses()\"\n [checked]=\"selected()\"\n [attr.aria-invalid]=\"inputInvalid() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n (blur)=\"onBlur($event)\"\n (click)=\"onInputClick($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (change)=\"onSelectionChange()\" />\n <span [class]=\"radioButtonCircleClasses()\" [attr.data-invalid]=\"invalidState() || null\">\n @if (selected()) {\n <span [class]=\"radioButtonIndicatorClasses()\"></span>\n }\n </span>\n @if (labelPosition() === \"after\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n</label>\n\n<ng-template #labelTemplate>\n @if (label()) {\n <span>{{ label() }}</span>\n } @else {\n <ng-content></ng-content>\n }\n</ng-template>\n",
431
+ template: "<label\n [class]=\"containerLabelClasses()\"\n [attr.data-disabled]=\"effectiveDisabled()\"\n [attr.data-readonly]=\"effectiveReadonly() || null\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n <input\n #input\n type=\"radio\"\n [id]=\"inputId()\"\n [required]=\"effectiveRequired()\"\n [disabled]=\"effectiveDisabled()\"\n [name]=\"effectiveName()\"\n [attr.value]=\"nativeValue()\"\n [class]=\"radioButtonClasses()\"\n [checked]=\"selected()\"\n [attr.aria-invalid]=\"inputInvalid() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n (blur)=\"onBlur($event)\"\n (click)=\"onInputClick($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (change)=\"onSelectionChange()\" />\n <span [class]=\"radioButtonCircleClasses()\" [attr.data-invalid]=\"invalidState() || null\" #circle>\n @if (selected()) {\n <span [class]=\"radioButtonIndicatorClasses()\"></span>\n }\n </span>\n @if (labelPosition() === \"after\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n</label>\n\n<ng-template #labelTemplate>\n @if (label()) {\n <span>{{ label() }}</span>\n } @else {\n <ng-content></ng-content>\n }\n</ng-template>\n",
416
432
  dependencies: [{
417
433
  kind: "ngmodule",
418
434
  type: FormsModule
@@ -438,6 +454,10 @@ i0.ɵɵngDeclareClassMetadata({
438
454
  type: Component,
439
455
  args: [{
440
456
  selector: "mona-radio-button",
457
+ hostDirectives: [{
458
+ directive: RippleDirective,
459
+ inputs: ["monaRippleDisabled"]
460
+ }],
441
461
  imports: [FormsModule, NgTemplateOutlet],
442
462
  host: {
443
463
  "[attr.aria-describedby]": "null",
@@ -447,11 +467,15 @@ i0.ɵɵngDeclareClassMetadata({
447
467
  "[attr.data-selected]": "selected()",
448
468
  "[attr.data-disabled]": "effectiveDisabled()"
449
469
  },
450
- template: "<label\n [class]=\"containerLabelClasses()\"\n [attr.data-disabled]=\"effectiveDisabled()\"\n [attr.data-readonly]=\"effectiveReadonly() || null\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n <input\n #input\n type=\"radio\"\n [id]=\"inputId()\"\n [required]=\"effectiveRequired()\"\n [disabled]=\"effectiveDisabled()\"\n [name]=\"effectiveName()\"\n [attr.value]=\"nativeValue()\"\n [class]=\"radioButtonClasses()\"\n [checked]=\"selected()\"\n [attr.aria-invalid]=\"inputInvalid() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n (blur)=\"onBlur($event)\"\n (click)=\"onInputClick($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (change)=\"onSelectionChange()\" />\n <span [class]=\"radioButtonCircleClasses()\" [attr.data-invalid]=\"invalidState() || null\">\n @if (selected()) {\n <span [class]=\"radioButtonIndicatorClasses()\"></span>\n }\n </span>\n @if (labelPosition() === \"after\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n</label>\n\n<ng-template #labelTemplate>\n @if (label()) {\n <span>{{ label() }}</span>\n } @else {\n <ng-content></ng-content>\n }\n</ng-template>\n"
470
+ template: "<label\n [class]=\"containerLabelClasses()\"\n [attr.data-disabled]=\"effectiveDisabled()\"\n [attr.data-readonly]=\"effectiveReadonly() || null\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n <input\n #input\n type=\"radio\"\n [id]=\"inputId()\"\n [required]=\"effectiveRequired()\"\n [disabled]=\"effectiveDisabled()\"\n [name]=\"effectiveName()\"\n [attr.value]=\"nativeValue()\"\n [class]=\"radioButtonClasses()\"\n [checked]=\"selected()\"\n [attr.aria-invalid]=\"inputInvalid() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"describedBy()\"\n (blur)=\"onBlur($event)\"\n (click)=\"onInputClick($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (change)=\"onSelectionChange()\" />\n <span [class]=\"radioButtonCircleClasses()\" [attr.data-invalid]=\"invalidState() || null\" #circle>\n @if (selected()) {\n <span [class]=\"radioButtonIndicatorClasses()\"></span>\n }\n </span>\n @if (labelPosition() === \"after\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n</label>\n\n<ng-template #labelTemplate>\n @if (label()) {\n <span>{{ label() }}</span>\n } @else {\n <ng-content></ng-content>\n }\n</ng-template>\n"
451
471
  }]
452
472
  }],
453
473
  ctorParameters: () => [],
454
474
  propDecorators: {
475
+ circleRef: [{
476
+ type: i0.ViewChild,
477
+ args: ["circle", { isSignal: true }]
478
+ }],
455
479
  inputRef: [{
456
480
  type: i0.ViewChild,
457
481
  args: ["input", { isSignal: true }]
@@ -0,0 +1,196 @@
1
+ import { isPlatformBrowser } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { DOCUMENT as DOCUMENT$1, DestroyRef, Directive, ElementRef, InjectionToken, NgZone, PLATFORM_ID, booleanAttribute, inject, input, makeEnvironmentProviders, signal } from "@angular/core";
4
+ const rippleLayerClasses = [
5
+ "pointer-events-none absolute -z-1",
6
+ "opacity-(--mona-ripple-opacity,12%)",
7
+ "forced-colors:hidden in-[.cdk-drag-placeholder]:hidden in-[.cdk-drag-preview]:hidden"
8
+ ].join(" ");
9
+ const rippleContainerClasses = `${rippleLayerClasses} inset-0 overflow-hidden rounded-[inherit]`;
10
+ const rippleHaloContainerClasses = `${rippleLayerClasses} start-1/2 top-1/2 text-foreground`;
11
+ const rippleWaveClasses = "absolute top-0 start-0 rounded-full bg-current";
12
+ const DEFAULT_RIPPLE_OPTIONS = { enabled: false };
13
+ const RIPPLE_OPTIONS = new InjectionToken("Mona UI ripple options", {
14
+ providedIn: "root",
15
+ factory: () => DEFAULT_RIPPLE_OPTIONS
16
+ });
17
+ function parseCssTime(value, fallback) {
18
+ const match = /^(\d*\.?\d+)(ms|s)$/iu.exec(value.trim());
19
+ if (!match) return fallback;
20
+ const amount = Number(match[1]);
21
+ return match[2].toLowerCase() === "s" ? amount * 1e3 : amount;
22
+ }
23
+ const FALLBACK_SPREAD_DURATION = 450;
24
+ const FALLBACK_FADE_DURATION = 300;
25
+ const SPREAD_EASING = "cubic-bezier(0, 0, 0.2, 1)";
26
+ const RELEASE_EVENTS = [
27
+ "pointercancel",
28
+ "pointerleave",
29
+ "pointerup"
30
+ ];
31
+ const NESTED_CONTROL_SELECTOR = "a[href], button, input, select, textarea, [contenteditable='true'], [role='button'], [role='link']";
32
+ const HALO_REACH = 10;
33
+ var RippleDirective = class RippleDirective {
34
+ #document;
35
+ #hostElementRef;
36
+ #options;
37
+ #container;
38
+ #haloTarget;
39
+ #hostDisabled;
40
+ constructor() {
41
+ this.#document = inject(DOCUMENT$1);
42
+ this.#hostElementRef = inject(ElementRef);
43
+ this.#options = inject(RIPPLE_OPTIONS);
44
+ this.#container = null;
45
+ this.#haloTarget = () => null;
46
+ this.#hostDisabled = signal(false, ...ngDevMode ? [{ debugName: "#hostDisabled" }] : /* istanbul ignore next */ []);
47
+ this.disabled = input(false, {
48
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
49
+ alias: "monaRippleDisabled",
50
+ transform: booleanAttribute
51
+ });
52
+ if (!this.#options.enabled || !isPlatformBrowser(inject(PLATFORM_ID))) return;
53
+ const host = this.#hostElementRef.nativeElement;
54
+ const listener = (event) => this.#launch(event);
55
+ inject(NgZone).runOutsideAngular(() => host.addEventListener("pointerdown", listener, { passive: true }));
56
+ inject(DestroyRef).onDestroy(() => host.removeEventListener("pointerdown", listener));
57
+ }
58
+ setHalo(target) {
59
+ this.#haloTarget = target;
60
+ }
61
+ setHostDisabled(disabled) {
62
+ this.#hostDisabled = disabled;
63
+ }
64
+ #canDraw(host, event) {
65
+ if (this.disabled() || this.#hostDisabled() || host.matches(":disabled, [aria-disabled='true']")) return false;
66
+ const control = event.target instanceof Element ? event.target.closest(NESTED_CONTROL_SELECTOR) : null;
67
+ const ownControl = host instanceof HTMLLabelElement && host.control === control;
68
+ if (control && control !== host && !ownControl && host.contains(control)) return false;
69
+ if (typeof host.animate !== "function") return false;
70
+ const view = this.#document.defaultView;
71
+ if (typeof view?.matchMedia !== "function") return true;
72
+ return !view.matchMedia("(prefers-reduced-motion: reduce)").matches && !view.matchMedia("(forced-colors: active)").matches;
73
+ }
74
+ #durations(host) {
75
+ const style = this.#document.defaultView?.getComputedStyle(host);
76
+ return {
77
+ fade: parseCssTime(style?.getPropertyValue("--mona-ripple-fade-duration") ?? "", FALLBACK_FADE_DURATION),
78
+ spread: parseCssTime(style?.getPropertyValue("--mona-ripple-duration") ?? "", FALLBACK_SPREAD_DURATION)
79
+ };
80
+ }
81
+ #ensureContainer(host, halo) {
82
+ const parent = halo ?? host;
83
+ if (this.#container && this.#container.parentNode === parent) return this.#container;
84
+ const view = this.#document.defaultView;
85
+ if (view?.getComputedStyle(parent).position === "static") parent.style.position = "relative";
86
+ if (view?.getComputedStyle(host).isolation !== "isolate") host.style.isolation = "isolate";
87
+ const container = this.#document.createElement("span");
88
+ container.className = halo ? rippleHaloContainerClasses : rippleContainerClasses;
89
+ container.setAttribute("aria-hidden", "true");
90
+ container.dir = "ltr";
91
+ parent.append(container);
92
+ this.#container = container;
93
+ return container;
94
+ }
95
+ #launch(event) {
96
+ const host = this.#hostElementRef.nativeElement;
97
+ if (event.button !== 0 || !this.#canDraw(host, event)) return;
98
+ const halo = this.#haloTarget() ?? null;
99
+ const container = this.#ensureContainer(host, halo);
100
+ const wave = this.#document.createElement("span");
101
+ wave.className = rippleWaveClasses;
102
+ if (halo) {
103
+ const bounds = halo.getBoundingClientRect();
104
+ const radius = Math.max(bounds.width, bounds.height) / 2 + HALO_REACH;
105
+ this.#placeWave(wave, radius, -radius, -radius);
106
+ } else {
107
+ const bounds = container.getBoundingClientRect();
108
+ const x = event.clientX - bounds.x;
109
+ const y = event.clientY - bounds.y;
110
+ const radius = Math.hypot(Math.max(x, bounds.width - x), Math.max(y, bounds.height - y));
111
+ this.#placeWave(wave, radius, x - radius, y - radius);
112
+ }
113
+ container.append(wave);
114
+ const durations = this.#durations(host);
115
+ const spreading = wave.animate([{ scale: 0 }, { scale: 1 }], {
116
+ duration: durations.spread,
117
+ easing: SPREAD_EASING,
118
+ fill: "forwards"
119
+ });
120
+ const release = new AbortController();
121
+ const fadeOut = () => {
122
+ release.abort();
123
+ spreading.finished.then(() => wave.animate([{ opacity: 1 }, { opacity: 0 }], {
124
+ duration: durations.fade,
125
+ fill: "forwards"
126
+ }).finished).catch(() => void 0).finally(() => wave.remove());
127
+ };
128
+ for (const type of RELEASE_EVENTS) host.addEventListener(type, fadeOut, {
129
+ passive: true,
130
+ signal: release.signal
131
+ });
132
+ }
133
+ #placeWave(wave, radius, x, y) {
134
+ wave.style.width = `${radius * 2}px`;
135
+ wave.style.height = `${radius * 2}px`;
136
+ wave.style.translate = `${x}px ${y}px`;
137
+ }
138
+ static {
139
+ this.ɵfac = i0.ɵɵngDeclareFactory({
140
+ minVersion: "12.0.0",
141
+ version: "22.3.0",
142
+ ngImport: i0,
143
+ type: RippleDirective,
144
+ deps: [],
145
+ target: i0.ɵɵFactoryTarget.Directive
146
+ });
147
+ }
148
+ static {
149
+ this.ɵdir = i0.ɵɵngDeclareDirective({
150
+ minVersion: "17.1.0",
151
+ version: "22.3.0",
152
+ type: RippleDirective,
153
+ isStandalone: true,
154
+ selector: "[monaRipple]",
155
+ inputs: { disabled: {
156
+ classPropertyName: "disabled",
157
+ publicName: "monaRippleDisabled",
158
+ isSignal: true,
159
+ isRequired: false,
160
+ transformFunction: null
161
+ } },
162
+ ngImport: i0
163
+ });
164
+ }
165
+ };
166
+ i0.ɵɵngDeclareClassMetadata({
167
+ minVersion: "12.0.0",
168
+ version: "22.3.0",
169
+ ngImport: i0,
170
+ type: RippleDirective,
171
+ decorators: [{
172
+ type: Directive,
173
+ args: [{ selector: "[monaRipple]" }]
174
+ }],
175
+ ctorParameters: () => [],
176
+ propDecorators: { disabled: [{
177
+ type: i0.Input,
178
+ args: [{
179
+ isSignal: true,
180
+ alias: "monaRippleDisabled",
181
+ required: false
182
+ }]
183
+ }] }
184
+ });
185
+ function provideRipple(options = {}) {
186
+ return makeEnvironmentProviders([{
187
+ provide: RIPPLE_OPTIONS,
188
+ useValue: {
189
+ enabled: true,
190
+ ...options
191
+ }
192
+ }]);
193
+ }
194
+ export { DEFAULT_RIPPLE_OPTIONS, RIPPLE_OPTIONS, RippleDirective, provideRipple };
195
+
196
+ //# sourceMappingURL=nanahoshi-mona-ui-ripple.mjs.map
@@ -5,6 +5,7 @@ import { injectComponentDirection } from "@nanahoshi/mona-ui/i18n";
5
5
  import { twMerge } from "tailwind-merge";
6
6
  import { cva } from "class-variance-authority";
7
7
  import { createElementControlId, injectEffectiveDisabled, injectLabelAssociation, themeControlSurfaceClasses } from "@nanahoshi/mona-ui/internal";
8
+ import { RippleDirective } from "@nanahoshi/mona-ui/ripple";
8
9
  var SegmentedItemTemplateDirective = class SegmentedItemTemplateDirective {
9
10
  constructor() {
10
11
  this.options = input(void 0, {
@@ -574,7 +575,7 @@ var SegmentedComponent = class SegmentedComponent {
574
575
  isSignal: true
575
576
  }],
576
577
  ngImport: i0,
577
- template: "@if (indicatorGeometry(); as geometry) {\n <div\n aria-hidden=\"true\"\n [class]=\"indicatorClasses()\"\n [attr.data-disabled]=\"selectedOptionDisabled() ? 'true' : null\"\n [style.transform]=\"geometry.transform\"\n [style.width.px]=\"geometry.width\"\n [style.height.px]=\"geometry.height\"></div>\n}\n\n@for (option of options(); track option.value) {\n @let selected = option.value === value();\n @let optionDisabled = effectiveDisabled() || option.disabled;\n\n <label\n #optionElement\n [class]=\"optionClasses()\"\n [attr.data-selected]=\"selected\"\n [attr.data-indicator]=\"geometryReady() || null\"\n [attr.data-disabled]=\"optionDisabled\">\n <input\n #radioInput\n type=\"radio\"\n [name]=\"name() || groupName\"\n [value]=\"option.value\"\n [checked]=\"selected\"\n [disabled]=\"optionDisabled\"\n [class]=\"inputClasses()\"\n [attr.aria-label]=\"itemTemplate() ? option.label : null\"\n (change)=\"onOptionChange(option)\"\n (click)=\"onOptionClick($event)\" />\n\n <span class=\"pointer-events-none flex flex-1 items-center justify-center gap-1 [border-radius:inherit]\">\n @if (itemTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"optionContexts()[$index]\"></ng-container>\n } @else {\n {{ option.label }}\n }\n </span>\n </label>\n}\n",
578
+ template: "@if (indicatorGeometry(); as geometry) {\n <div\n aria-hidden=\"true\"\n [class]=\"indicatorClasses()\"\n [attr.data-disabled]=\"selectedOptionDisabled() ? 'true' : null\"\n [style.transform]=\"geometry.transform\"\n [style.width.px]=\"geometry.width\"\n [style.height.px]=\"geometry.height\"></div>\n}\n\n@for (option of options(); track option.value) {\n @let selected = option.value === value();\n @let optionDisabled = effectiveDisabled() || option.disabled;\n\n <label\n #optionElement\n monaRipple\n [monaRippleDisabled]=\"optionDisabled || readonly()\"\n [class]=\"optionClasses()\"\n [attr.data-selected]=\"selected\"\n [attr.data-indicator]=\"geometryReady() || null\"\n [attr.data-disabled]=\"optionDisabled\">\n <input\n #radioInput\n type=\"radio\"\n [name]=\"name() || groupName\"\n [value]=\"option.value\"\n [checked]=\"selected\"\n [disabled]=\"optionDisabled\"\n [class]=\"inputClasses()\"\n [attr.aria-label]=\"itemTemplate() ? option.label : null\"\n (change)=\"onOptionChange(option)\"\n (click)=\"onOptionClick($event)\" />\n\n <span class=\"pointer-events-none flex flex-1 items-center justify-center gap-1 [border-radius:inherit]\">\n @if (itemTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"optionContexts()[$index]\"></ng-container>\n } @else {\n {{ option.label }}\n }\n </span>\n </label>\n}\n",
578
579
  dependencies: [{
579
580
  kind: "directive",
580
581
  type: NgTemplateOutlet,
@@ -584,6 +585,11 @@ var SegmentedComponent = class SegmentedComponent {
584
585
  "ngTemplateOutlet",
585
586
  "ngTemplateOutletInjector"
586
587
  ]
588
+ }, {
589
+ kind: "directive",
590
+ type: RippleDirective,
591
+ selector: "[monaRipple]",
592
+ inputs: ["monaRippleDisabled"]
587
593
  }]
588
594
  });
589
595
  }
@@ -597,7 +603,7 @@ i0.ɵɵngDeclareClassMetadata({
597
603
  type: Component,
598
604
  args: [{
599
605
  selector: "mona-segmented",
600
- imports: [NgTemplateOutlet],
606
+ imports: [NgTemplateOutlet, RippleDirective],
601
607
  host: {
602
608
  "[attr.aria-disabled]": "effectiveDisabled() || undefined",
603
609
  "[attr.aria-invalid]": "invalidState() ? 'true' : null",
@@ -613,7 +619,7 @@ i0.ɵɵngDeclareClassMetadata({
613
619
  "[attr.role]": "'radiogroup'",
614
620
  "[class]": "containerClasses()"
615
621
  },
616
- template: "@if (indicatorGeometry(); as geometry) {\n <div\n aria-hidden=\"true\"\n [class]=\"indicatorClasses()\"\n [attr.data-disabled]=\"selectedOptionDisabled() ? 'true' : null\"\n [style.transform]=\"geometry.transform\"\n [style.width.px]=\"geometry.width\"\n [style.height.px]=\"geometry.height\"></div>\n}\n\n@for (option of options(); track option.value) {\n @let selected = option.value === value();\n @let optionDisabled = effectiveDisabled() || option.disabled;\n\n <label\n #optionElement\n [class]=\"optionClasses()\"\n [attr.data-selected]=\"selected\"\n [attr.data-indicator]=\"geometryReady() || null\"\n [attr.data-disabled]=\"optionDisabled\">\n <input\n #radioInput\n type=\"radio\"\n [name]=\"name() || groupName\"\n [value]=\"option.value\"\n [checked]=\"selected\"\n [disabled]=\"optionDisabled\"\n [class]=\"inputClasses()\"\n [attr.aria-label]=\"itemTemplate() ? option.label : null\"\n (change)=\"onOptionChange(option)\"\n (click)=\"onOptionClick($event)\" />\n\n <span class=\"pointer-events-none flex flex-1 items-center justify-center gap-1 [border-radius:inherit]\">\n @if (itemTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"optionContexts()[$index]\"></ng-container>\n } @else {\n {{ option.label }}\n }\n </span>\n </label>\n}\n"
622
+ template: "@if (indicatorGeometry(); as geometry) {\n <div\n aria-hidden=\"true\"\n [class]=\"indicatorClasses()\"\n [attr.data-disabled]=\"selectedOptionDisabled() ? 'true' : null\"\n [style.transform]=\"geometry.transform\"\n [style.width.px]=\"geometry.width\"\n [style.height.px]=\"geometry.height\"></div>\n}\n\n@for (option of options(); track option.value) {\n @let selected = option.value === value();\n @let optionDisabled = effectiveDisabled() || option.disabled;\n\n <label\n #optionElement\n monaRipple\n [monaRippleDisabled]=\"optionDisabled || readonly()\"\n [class]=\"optionClasses()\"\n [attr.data-selected]=\"selected\"\n [attr.data-indicator]=\"geometryReady() || null\"\n [attr.data-disabled]=\"optionDisabled\">\n <input\n #radioInput\n type=\"radio\"\n [name]=\"name() || groupName\"\n [value]=\"option.value\"\n [checked]=\"selected\"\n [disabled]=\"optionDisabled\"\n [class]=\"inputClasses()\"\n [attr.aria-label]=\"itemTemplate() ? option.label : null\"\n (change)=\"onOptionChange(option)\"\n (click)=\"onOptionClick($event)\" />\n\n <span class=\"pointer-events-none flex flex-1 items-center justify-center gap-1 [border-radius:inherit]\">\n @if (itemTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"optionContexts()[$index]\"></ng-container>\n } @else {\n {{ option.label }}\n }\n </span>\n </label>\n}\n"
617
623
  }]
618
624
  }],
619
625
  ctorParameters: () => [],
@@ -1482,10 +1482,15 @@ i0.ɵɵngDeclareClassMetadata({
1482
1482
  var SidebarMenuSkeletonComponent = class SidebarMenuSkeletonComponent {
1483
1483
  constructor() {
1484
1484
  this.#sidebarService = inject(SidebarService, { optional: true });
1485
- this.baseClass = computed(() => sidebarMenuSkeletonThemeVariants({ iconOnly: this.iconOnly() }), ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
1485
+ this.baseClass = computed(() => twMerge(sidebarMenuSkeletonThemeVariants({ iconOnly: this.iconOnly() }), this.userClass()), ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
1486
1486
  this.iconOnly = computed(() => this.#sidebarService?.iconOnly() ?? false, ...ngDevMode ? [{ debugName: "iconOnly" }] : /* istanbul ignore next */ []);
1487
1487
  this.labelWidth = input("60%", ...ngDevMode ? [{ debugName: "labelWidth" }] : /* istanbul ignore next */ []);
1488
1488
  this.showIcon = input(true, ...ngDevMode ? [{ debugName: "showIcon" }] : /* istanbul ignore next */ []);
1489
+ this.userClass = input("", {
1490
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
1491
+ alias: "class",
1492
+ transform: (value) => classInputToClass(value)
1493
+ });
1489
1494
  }
1490
1495
  #sidebarService;
1491
1496
  static {
@@ -1519,6 +1524,13 @@ var SidebarMenuSkeletonComponent = class SidebarMenuSkeletonComponent {
1519
1524
  isSignal: true,
1520
1525
  isRequired: false,
1521
1526
  transformFunction: null
1527
+ },
1528
+ userClass: {
1529
+ classPropertyName: "userClass",
1530
+ publicName: "class",
1531
+ isSignal: true,
1532
+ isRequired: false,
1533
+ transformFunction: null
1522
1534
  }
1523
1535
  },
1524
1536
  host: { properties: { "class": "baseClass()" } },
@@ -1579,6 +1591,14 @@ i0.ɵɵngDeclareClassMetadata({
1579
1591
  alias: "showIcon",
1580
1592
  required: false
1581
1593
  }]
1594
+ }],
1595
+ userClass: [{
1596
+ type: i0.Input,
1597
+ args: [{
1598
+ isSignal: true,
1599
+ alias: "class",
1600
+ required: false
1601
+ }]
1582
1602
  }]
1583
1603
  }
1584
1604
  });
@@ -6,6 +6,8 @@ import { PreventableEvent } from "@nanahoshi/mona-ui/common";
6
6
  import { MonaI18nService, formatNumber, injectComponentDirection } from "@nanahoshi/mona-ui/i18n";
7
7
  import { cva } from "class-variance-authority";
8
8
  import { createElementControlId } from "@nanahoshi/mona-ui/internal";
9
+ import * as i1 from "@nanahoshi/mona-ui/ripple";
10
+ import { RippleDirective } from "@nanahoshi/mona-ui/ripple";
9
11
  import { select } from "@mirei/ts-collections";
10
12
  var StepSelectEvent = class extends PreventableEvent {
11
13
  #index;
@@ -152,7 +154,7 @@ const stepperStepListItemThemeVariants = cva(`
152
154
  defaultVariants: { orientation: "horizontal" }
153
155
  });
154
156
  const stepperStepIndicatorThemeVariants = cva(`
155
- flex h-8 w-8 items-center justify-center
157
+ relative flex h-8 w-8 items-center justify-center
156
158
  border border-border cursor-[inherit]
157
159
  transition-colors duration-(--mona-motion-standard) ease-in-out
158
160
  focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-focus-indicator
@@ -271,6 +273,7 @@ var StepperIndicatorDirective = class StepperIndicatorDirective {
271
273
  }
272
274
  },
273
275
  host: { properties: { "class": "stepIndicatorClass()" } },
276
+ hostDirectives: [{ directive: i1.RippleDirective }],
274
277
  ngImport: i0
275
278
  });
276
279
  }
@@ -284,6 +287,7 @@ i0.ɵɵngDeclareClassMetadata({
284
287
  type: Directive,
285
288
  args: [{
286
289
  selector: "button[monaStepperIndicator]",
290
+ hostDirectives: [RippleDirective],
287
291
  host: { "[class]": "stepIndicatorClass()" }
288
292
  }]
289
293
  }],
@@ -1,11 +1,13 @@
1
1
  import { NgTemplateOutlet } from "@angular/common";
2
2
  import * as i0 from "@angular/core";
3
- import { Component, DestroyRef, Directive, ElementRef, TemplateRef, afterNextRender, booleanAttribute, computed, contentChild, inject, input, model, numberAttribute, output } from "@angular/core";
3
+ import { Component, DestroyRef, Directive, ElementRef, TemplateRef, afterNextRender, booleanAttribute, computed, contentChild, inject, input, model, numberAttribute, output, viewChild } from "@angular/core";
4
4
  import { twMerge } from "tailwind-merge";
5
5
  import { cva } from "class-variance-authority";
6
6
  import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
7
7
  import { injectEffectiveDisabled, injectLabelAssociation, themeControlSurfaceClasses, themeRaisedSurfaceClasses } from "@nanahoshi/mona-ui/internal";
8
8
  import { filter, fromEvent, merge, tap } from "rxjs";
9
+ import * as i1 from "@nanahoshi/mona-ui/ripple";
10
+ import { RippleDirective } from "@nanahoshi/mona-ui/ripple";
9
11
  var SwitchHandleContentTemplateDirective = class SwitchHandleContentTemplateDirective {
10
12
  static ngTemplateContextGuard(_directive, _context) {
11
13
  return true;
@@ -228,6 +230,7 @@ var SwitchComponent = class SwitchComponent {
228
230
  ...ngDevMode ? { debugName: "handleContentTemplate" } : /* istanbul ignore next */ {},
229
231
  read: TemplateRef
230
232
  });
233
+ this.handleRef = viewChild("handle", ...ngDevMode ? [{ debugName: "handleRef" }] : /* istanbul ignore next */ []);
231
234
  this.invalidState = computed(() => this.touched() && (this.invalid() || this.required() && !this.checked()), ...ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []);
232
235
  this.labelClasses = computed(() => {
233
236
  const classes = switchLabelThemeVariants();
@@ -288,6 +291,9 @@ var SwitchComponent = class SwitchComponent {
288
291
  ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
289
292
  alias: "class"
290
293
  });
294
+ const ripple = inject(RippleDirective, { self: true });
295
+ ripple.setHostDisabled(computed(() => this.effectiveDisabled() || this.readonly()));
296
+ ripple.setHalo(() => this.handleRef()?.nativeElement);
291
297
  afterNextRender({ read: () => this.#setEventListeners() });
292
298
  }
293
299
  activateFromLabel() {
@@ -488,8 +494,19 @@ var SwitchComponent = class SwitchComponent {
488
494
  isSignal: true
489
495
  }
490
496
  ],
497
+ viewQueries: [{
498
+ propertyName: "handleRef",
499
+ first: true,
500
+ predicate: ["handle"],
501
+ descendants: true,
502
+ isSignal: true
503
+ }],
504
+ hostDirectives: [{
505
+ directive: i1.RippleDirective,
506
+ inputs: ["monaRippleDisabled", "monaRippleDisabled"]
507
+ }],
491
508
  ngImport: i0,
492
- template: "<span aria-hidden=\"true\" [class]=\"labelClasses()\">\n @if (checked() && !onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ onLabel() }}</span>\n }\n @if (checked() && onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"onLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<span aria-hidden=\"true\" [class]=\"labelClasses()\">\n @if (!checked() && !offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ offLabel() }}</span>\n }\n @if (!checked() && offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"offLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<div [class]=\"handleClasses()\" [attr.data-active]=\"checked()\">\n @if (handleContentTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"handleContentTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: checked() }\"></ng-container>\n }\n</div>\n",
509
+ template: "<span aria-hidden=\"true\" [class]=\"labelClasses()\">\n @if (checked() && !onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ onLabel() }}</span>\n }\n @if (checked() && onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"onLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<span aria-hidden=\"true\" [class]=\"labelClasses()\">\n @if (!checked() && !offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ offLabel() }}</span>\n }\n @if (!checked() && offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"offLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<div [class]=\"handleClasses()\" [attr.data-active]=\"checked()\" #handle>\n @if (handleContentTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"handleContentTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: checked() }\"></ng-container>\n }\n</div>\n",
493
510
  styles: [".mona-switch-label-enter{animation:mona-switch-label-fade-in .3s ease-out}.mona-switch-label-leave{animation:mona-switch-label-fade-out .3s ease-out}@keyframes mona-switch-label-fade-in{0%{opacity:0}to{opacity:1}}@keyframes mona-switch-label-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.mona-switch-label-enter,.mona-switch-label-leave{animation-duration:1ms}}\n"],
494
511
  dependencies: [{
495
512
  kind: "directive",
@@ -513,6 +530,10 @@ i0.ɵɵngDeclareClassMetadata({
513
530
  type: Component,
514
531
  args: [{
515
532
  selector: "mona-switch",
533
+ hostDirectives: [{
534
+ directive: RippleDirective,
535
+ inputs: ["monaRippleDisabled"]
536
+ }],
516
537
  imports: [NgTemplateOutlet],
517
538
  host: {
518
539
  "[attr.role]": "'switch'",
@@ -532,7 +553,7 @@ i0.ɵɵngDeclareClassMetadata({
532
553
  "[class]": "classes()",
533
554
  "(blur)": "onBlur()"
534
555
  },
535
- template: "<span aria-hidden=\"true\" [class]=\"labelClasses()\">\n @if (checked() && !onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ onLabel() }}</span>\n }\n @if (checked() && onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"onLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<span aria-hidden=\"true\" [class]=\"labelClasses()\">\n @if (!checked() && !offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ offLabel() }}</span>\n }\n @if (!checked() && offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"offLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<div [class]=\"handleClasses()\" [attr.data-active]=\"checked()\">\n @if (handleContentTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"handleContentTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: checked() }\"></ng-container>\n }\n</div>\n",
556
+ template: "<span aria-hidden=\"true\" [class]=\"labelClasses()\">\n @if (checked() && !onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ onLabel() }}</span>\n }\n @if (checked() && onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"onLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<span aria-hidden=\"true\" [class]=\"labelClasses()\">\n @if (!checked() && !offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ offLabel() }}</span>\n }\n @if (!checked() && offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"offLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<div [class]=\"handleClasses()\" [attr.data-active]=\"checked()\" #handle>\n @if (handleContentTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"handleContentTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: checked() }\"></ng-container>\n }\n</div>\n",
536
557
  styles: [".mona-switch-label-enter{animation:mona-switch-label-fade-in .3s ease-out}.mona-switch-label-leave{animation:mona-switch-label-fade-out .3s ease-out}@keyframes mona-switch-label-fade-in{0%{opacity:0}to{opacity:1}}@keyframes mona-switch-label-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.mona-switch-label-enter,.mona-switch-label-leave{animation-duration:1ms}}\n"]
537
558
  }]
538
559
  }],
@@ -545,6 +566,10 @@ i0.ɵɵngDeclareClassMetadata({
545
566
  isSignal: true
546
567
  }]
547
568
  }],
569
+ handleRef: [{
570
+ type: i0.ViewChild,
571
+ args: ["handle", { isSignal: true }]
572
+ }],
548
573
  offLabelTemplate: [{
549
574
  type: i0.ContentChild,
550
575
  args: [i0.forwardRef(() => SwitchOffLabelTemplateDirective), {