@m3e/web 2.5.5 → 2.5.6

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 (201) hide show
  1. package/README.md +1 -1
  2. package/dist/all.js +287 -221
  3. package/dist/all.js.map +1 -1
  4. package/dist/all.min.js +31 -31
  5. package/dist/all.min.js.map +1 -1
  6. package/dist/autocomplete.js +3 -3
  7. package/dist/autocomplete.js.map +1 -1
  8. package/dist/autocomplete.min.js.map +1 -1
  9. package/dist/bottom-sheet.js +5 -5
  10. package/dist/bottom-sheet.js.map +1 -1
  11. package/dist/bottom-sheet.min.js.map +1 -1
  12. package/dist/breadcrumb.js +1 -1
  13. package/dist/breadcrumb.js.map +1 -1
  14. package/dist/breadcrumb.min.js.map +1 -1
  15. package/dist/button.js +7 -8
  16. package/dist/button.js.map +1 -1
  17. package/dist/button.min.js +1 -1
  18. package/dist/button.min.js.map +1 -1
  19. package/dist/calendar.js +1 -1
  20. package/dist/calendar.js.map +1 -1
  21. package/dist/calendar.min.js.map +1 -1
  22. package/dist/card.js +1 -1
  23. package/dist/card.js.map +1 -1
  24. package/dist/card.min.js.map +1 -1
  25. package/dist/checkbox.js +10 -9
  26. package/dist/checkbox.js.map +1 -1
  27. package/dist/checkbox.min.js +1 -1
  28. package/dist/checkbox.min.js.map +1 -1
  29. package/dist/chips.js +17 -16
  30. package/dist/chips.js.map +1 -1
  31. package/dist/chips.min.js +1 -1
  32. package/dist/chips.min.js.map +1 -1
  33. package/dist/core.js +5 -5
  34. package/dist/core.js.map +1 -1
  35. package/dist/core.min.js.map +1 -1
  36. package/dist/css-custom-data.json +120 -120
  37. package/dist/custom-elements.json +765 -534
  38. package/dist/datepicker.js +26 -2
  39. package/dist/datepicker.js.map +1 -1
  40. package/dist/datepicker.min.js +1 -1
  41. package/dist/datepicker.min.js.map +1 -1
  42. package/dist/dialog.js +5 -5
  43. package/dist/dialog.js.map +1 -1
  44. package/dist/dialog.min.js.map +1 -1
  45. package/dist/drawer-container.js +1 -1
  46. package/dist/drawer-container.js.map +1 -1
  47. package/dist/drawer-container.min.js.map +1 -1
  48. package/dist/expansion-panel.js +5 -5
  49. package/dist/expansion-panel.js.map +1 -1
  50. package/dist/expansion-panel.min.js.map +1 -1
  51. package/dist/fab-menu.js +1 -1
  52. package/dist/fab-menu.js.map +1 -1
  53. package/dist/fab-menu.min.js.map +1 -1
  54. package/dist/fab.js +1 -1
  55. package/dist/fab.js.map +1 -1
  56. package/dist/fab.min.js.map +1 -1
  57. package/dist/html-custom-data.json +83 -78
  58. package/dist/icon-button.js +7 -8
  59. package/dist/icon-button.js.map +1 -1
  60. package/dist/icon-button.min.js +1 -1
  61. package/dist/icon-button.min.js.map +1 -1
  62. package/dist/list.js +17 -16
  63. package/dist/list.js.map +1 -1
  64. package/dist/list.min.js +1 -1
  65. package/dist/list.min.js.map +1 -1
  66. package/dist/menu.js +3 -3
  67. package/dist/menu.js.map +1 -1
  68. package/dist/menu.min.js.map +1 -1
  69. package/dist/nav-bar.js +12 -9
  70. package/dist/nav-bar.js.map +1 -1
  71. package/dist/nav-bar.min.js +1 -1
  72. package/dist/nav-bar.min.js.map +1 -1
  73. package/dist/nav-menu.js +5 -5
  74. package/dist/nav-menu.js.map +1 -1
  75. package/dist/nav-menu.min.js.map +1 -1
  76. package/dist/nav-rail.js +3 -1
  77. package/dist/nav-rail.js.map +1 -1
  78. package/dist/nav-rail.min.js.map +1 -1
  79. package/dist/paginator.js +1 -1
  80. package/dist/paginator.js.map +1 -1
  81. package/dist/paginator.min.js.map +1 -1
  82. package/dist/radio-group.js +12 -9
  83. package/dist/radio-group.js.map +1 -1
  84. package/dist/radio-group.min.js +1 -1
  85. package/dist/radio-group.min.js.map +1 -1
  86. package/dist/segmented-button.js +12 -11
  87. package/dist/segmented-button.js.map +1 -1
  88. package/dist/segmented-button.min.js +1 -1
  89. package/dist/segmented-button.min.js.map +1 -1
  90. package/dist/select.js +9 -9
  91. package/dist/select.js.map +1 -1
  92. package/dist/select.min.js +1 -1
  93. package/dist/select.min.js.map +1 -1
  94. package/dist/slider.js +46 -25
  95. package/dist/slider.js.map +1 -1
  96. package/dist/slider.min.js +1 -1
  97. package/dist/slider.min.js.map +1 -1
  98. package/dist/split-pane.js +17 -19
  99. package/dist/split-pane.js.map +1 -1
  100. package/dist/split-pane.min.js +1 -1
  101. package/dist/split-pane.min.js.map +1 -1
  102. package/dist/src/autocomplete/AutocompleteElement.d.ts +3 -3
  103. package/dist/src/autocomplete/AutocompleteQueryEventDetail.d.ts +1 -1
  104. package/dist/src/autocomplete/QueryEventDetail.d.ts +1 -1
  105. package/dist/src/bottom-sheet/BottomSheetElement.d.ts +5 -5
  106. package/dist/src/breadcrumb/BreadcrumbItemElement.d.ts +1 -1
  107. package/dist/src/button/ButtonElement.d.ts +2 -1
  108. package/dist/src/button/ButtonElement.d.ts.map +1 -1
  109. package/dist/src/calendar/CalendarElement.d.ts +1 -1
  110. package/dist/src/card/CardElement.d.ts +1 -1
  111. package/dist/src/checkbox/CheckboxElement.d.ts +5 -4
  112. package/dist/src/checkbox/CheckboxElement.d.ts.map +1 -1
  113. package/dist/src/chips/AssistChipElement.d.ts +1 -1
  114. package/dist/src/chips/FilterChipElement.d.ts +4 -3
  115. package/dist/src/chips/FilterChipElement.d.ts.map +1 -1
  116. package/dist/src/chips/FilterChipSetElement.d.ts +3 -2
  117. package/dist/src/chips/FilterChipSetElement.d.ts.map +1 -1
  118. package/dist/src/chips/InputChipElement.d.ts +2 -2
  119. package/dist/src/chips/InputChipSetElement.d.ts +1 -1
  120. package/dist/src/chips/SuggestionChipElement.d.ts +1 -1
  121. package/dist/src/core/shared/primitives/CollapsibleElement.d.ts +4 -4
  122. package/dist/src/core/shared/primitives/TextHighlightElement.d.ts +1 -1
  123. package/dist/src/datepicker/DatepickerElement.d.ts +6 -0
  124. package/dist/src/datepicker/DatepickerElement.d.ts.map +1 -1
  125. package/dist/src/dialog/DialogElement.d.ts +5 -5
  126. package/dist/src/drawer-container/DrawerContainerElement.d.ts +1 -1
  127. package/dist/src/expansion-panel/ExpansionHeaderElement.d.ts +1 -1
  128. package/dist/src/expansion-panel/ExpansionPanelElement.d.ts +4 -4
  129. package/dist/src/fab/FabElement.d.ts +1 -1
  130. package/dist/src/fab-menu/FabMenuItemElement.d.ts +1 -1
  131. package/dist/src/icon-button/IconButtonElement.d.ts +2 -1
  132. package/dist/src/icon-button/IconButtonElement.d.ts.map +1 -1
  133. package/dist/src/list/ExpandableListItemElement.d.ts +4 -4
  134. package/dist/src/list/ListActionElement.d.ts +1 -1
  135. package/dist/src/list/ListOptionElement.d.ts +4 -3
  136. package/dist/src/list/ListOptionElement.d.ts.map +1 -1
  137. package/dist/src/list/SelectionListElement.d.ts +3 -2
  138. package/dist/src/list/SelectionListElement.d.ts.map +1 -1
  139. package/dist/src/menu/MenuItemCheckboxElement.d.ts +1 -1
  140. package/dist/src/menu/MenuItemElement.d.ts +1 -1
  141. package/dist/src/menu/MenuItemRadioElement.d.ts +1 -1
  142. package/dist/src/nav-bar/NavBarElement.d.ts +3 -1
  143. package/dist/src/nav-bar/NavBarElement.d.ts.map +1 -1
  144. package/dist/src/nav-bar/NavItemElement.d.ts +4 -3
  145. package/dist/src/nav-bar/NavItemElement.d.ts.map +1 -1
  146. package/dist/src/nav-menu/NavMenuItemElement.d.ts +5 -5
  147. package/dist/src/nav-rail/NavRailElement.d.ts +3 -1
  148. package/dist/src/nav-rail/NavRailElement.d.ts.map +1 -1
  149. package/dist/src/paginator/PageEventDetail.d.ts +1 -1
  150. package/dist/src/paginator/PaginatorElement.d.ts +1 -1
  151. package/dist/src/paginator/PaginatorPageEventDetail.d.ts +1 -1
  152. package/dist/src/paginator/PaginatorPageEventDetail.d.ts.map +1 -1
  153. package/dist/src/radio-group/RadioElement.d.ts +4 -3
  154. package/dist/src/radio-group/RadioElement.d.ts.map +1 -1
  155. package/dist/src/radio-group/RadioGroupElement.d.ts +3 -1
  156. package/dist/src/radio-group/RadioGroupElement.d.ts.map +1 -1
  157. package/dist/src/search/SearchViewQueryEventDetail.d.ts +1 -1
  158. package/dist/src/segmented-button/ButtonSegmentElement.d.ts +4 -3
  159. package/dist/src/segmented-button/ButtonSegmentElement.d.ts.map +1 -1
  160. package/dist/src/segmented-button/SegmentedButtonElement.d.ts +3 -2
  161. package/dist/src/segmented-button/SegmentedButtonElement.d.ts.map +1 -1
  162. package/dist/src/select/SelectElement.d.ts +3 -2
  163. package/dist/src/select/SelectElement.d.ts.map +1 -1
  164. package/dist/src/slider/SliderElement.d.ts +4 -0
  165. package/dist/src/slider/SliderElement.d.ts.map +1 -1
  166. package/dist/src/slider/SliderThumbElement.d.ts +4 -3
  167. package/dist/src/slider/SliderThumbElement.d.ts.map +1 -1
  168. package/dist/src/split-pane/SplitPaneElement.d.ts +3 -2
  169. package/dist/src/split-pane/SplitPaneElement.d.ts.map +1 -1
  170. package/dist/src/stepper/StepElement.d.ts +4 -3
  171. package/dist/src/stepper/StepElement.d.ts.map +1 -1
  172. package/dist/src/stepper/StepperElement.d.ts +5 -1
  173. package/dist/src/stepper/StepperElement.d.ts.map +1 -1
  174. package/dist/src/switch/SwitchElement.d.ts +4 -3
  175. package/dist/src/switch/SwitchElement.d.ts.map +1 -1
  176. package/dist/src/tabs/TabElement.d.ts +4 -3
  177. package/dist/src/tabs/TabElement.d.ts.map +1 -1
  178. package/dist/src/tabs/TabsElement.d.ts +3 -1
  179. package/dist/src/tabs/TabsElement.d.ts.map +1 -1
  180. package/dist/src/toc/TocItemElement.d.ts +1 -1
  181. package/dist/src/tree/TreeElement.d.ts +1 -1
  182. package/dist/src/tree/TreeItemElement.d.ts +5 -5
  183. package/dist/stepper.js +26 -17
  184. package/dist/stepper.js.map +1 -1
  185. package/dist/stepper.min.js +1 -1
  186. package/dist/stepper.min.js.map +1 -1
  187. package/dist/switch.js +9 -8
  188. package/dist/switch.js.map +1 -1
  189. package/dist/switch.min.js +1 -1
  190. package/dist/switch.min.js.map +1 -1
  191. package/dist/tabs.js +12 -9
  192. package/dist/tabs.js.map +1 -1
  193. package/dist/tabs.min.js +1 -1
  194. package/dist/tabs.min.js.map +1 -1
  195. package/dist/toc.js +1 -1
  196. package/dist/toc.js.map +1 -1
  197. package/dist/toc.min.js.map +1 -1
  198. package/dist/tree.js +6 -6
  199. package/dist/tree.js.map +1 -1
  200. package/dist/tree.min.js.map +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"nav-bar.js","sources":["../../src/nav-bar/NavBarElement.ts","../../src/nav-bar/NavItemElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement, PropertyValues } from \"lit\";\r\nimport { property, state } from \"lit/decorators.js\";\r\n\r\nimport { AttachInternals, customElement, DesignToken, ReconnectedCallback, Role, setCustomState } from \"@m3e/web/core\";\r\n\r\nimport { SelectionManager, selectionManager } from \"@m3e/web/core/a11y\";\r\nimport { Breakpoint, M3eBreakpointObserver } from \"@m3e/web/core/layout\";\r\n\r\nimport { M3eNavItemElement } from \"./NavItemElement\";\r\nimport { NavItemOrientation } from \"./NavItemOrientation\";\r\nimport { NavBarMode } from \"./NavBarMode\";\r\n\r\n/**\r\n * A horizontal bar, typically used on smaller devices, that allows a user to switch between 3-5 views.\r\n *\r\n * @description\r\n * The `m3e-nav-bar` component provides a horizontal navigation bar for switching between primary destinations in\r\n * an application. Designed for smaller devices, it supports 3-5 interactive items, orientation, and theming\r\n * via CSS custom properties.\r\n *\r\n * @example\r\n * The following example illustrates a nav bar with vertically oriented items.\r\n * ```html\r\n * <m3e-nav-bar>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"news\"></m3e-icon>News</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"globe\"></m3e-icon>Global</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"star\"></m3e-icon>For you</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"newsstand\"></m3e-icon>Trending</m3e-nav-item>\r\n * </m3e-nav-bar>\r\n * ```\r\n *\r\n * @tag m3e-nav-bar\r\n *\r\n * @slot - Renders the items of the bar.\r\n *\r\n * @attr mode - The mode in which items in the bar are presented.\r\n *\r\n * @fires change - Emitted when the selected state of an item changes.\r\n *\r\n * @cssprop --m3e-nav-bar-height - Height of the navigation bar.\r\n * @cssprop --m3e-nav-bar-container-color - Background color of the navigation bar container.\r\n * @cssprop --m3e-nav-bar-vertical-item-width - Minimum width of vertical nav items.\r\n */\r\n@customElement(\"m3e-nav-bar\")\r\nexport class M3eNavBarElement extends ReconnectedCallback(AttachInternals(Role(LitElement, \"navigation\"))) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n overflow-x: auto;\r\n overflow-y: hidden;\r\n scrollbar-width: ${DesignToken.scrollbar.thinWidth};\r\n scrollbar-color: ${DesignToken.scrollbar.color};\r\n min-height: var(--m3e-nav-bar-height, 4rem);\r\n }\r\n .base {\r\n display: flex;\r\n align-items: stretch;\r\n justify-content: center;\r\n box-sizing: border-box;\r\n min-height: inherit;\r\n height: inherit;\r\n width: 100%;\r\n background-color: var(--m3e-nav-bar-container-color, ${DesignToken.color.surfaceContainer});\r\n --_nav-item-min-width: var(--m3e-nav-bar-vertical-item-width, 7rem);\r\n }\r\n `;\r\n\r\n /** @internal */ readonly [selectionManager] = new SelectionManager<M3eNavItemElement>().disableRovingTabIndex();\r\n /** @private */ #breakpointUnobserve?: () => void;\r\n /** @private */ @state() private _mode?: Exclude<NavBarMode, \"auto\">;\r\n\r\n /**\r\n * The mode in which items in the bar are presented.\r\n * @default \"compact\"\r\n */\r\n @property({ reflect: true }) mode: NavBarMode = \"compact\";\r\n\r\n /** The items of the bar. */\r\n get items(): readonly M3eNavItemElement[] {\r\n return this[selectionManager].items;\r\n }\r\n\r\n /** The selected item. */\r\n get selected(): M3eNavItemElement | null {\r\n return this[selectionManager].selectedItems[0] ?? null;\r\n }\r\n\r\n /** The current mode applied to the bar. */\r\n get currentMode(): Exclude<NavBarMode, \"auto\"> {\r\n return this._mode ?? (this.mode !== \"compact\" ? \"expanded\" : \"compact\");\r\n }\r\n set currentMode(value: Exclude<NavBarMode, \"auto\">) {\r\n this._mode = value;\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this._mode = undefined;\r\n this.#breakpointUnobserve?.();\r\n }\r\n\r\n /** @inheritdoc */\r\n override reconnectedCallback(): void {\r\n super.reconnectedCallback();\r\n\r\n if (this.mode === \"auto\") {\r\n this.#initBreakpointMonitoring();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override willUpdate(changedProperties: PropertyValues): void {\r\n super.willUpdate(changedProperties);\r\n\r\n if (changedProperties.has(\"mode\")) {\r\n this.#breakpointUnobserve?.();\r\n\r\n if (this.mode === \"auto\") {\r\n this.#initBreakpointMonitoring();\r\n } else {\r\n this._mode = undefined;\r\n this._updateItems();\r\n }\r\n }\r\n if (changedProperties.has(\"_mode\")) {\r\n this._updateItems();\r\n }\r\n }\r\n\r\n /** @private */\r\n #initBreakpointMonitoring(): void {\r\n this.#breakpointUnobserve = M3eBreakpointObserver.observe([Breakpoint.XSmall, Breakpoint.Small], (matches) => {\r\n this._mode = matches.get(Breakpoint.XSmall) || matches.get(Breakpoint.Small) ? \"compact\" : \"expanded\";\r\n this._updateItems();\r\n });\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\">\r\n <slot @change=\"${this.#handleChange}\" @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(): void {\r\n this[selectionManager].setItems([...this.querySelectorAll(\"m3e-nav-item\")]);\r\n this._updateItems();\r\n }\r\n\r\n /** @private */\r\n #handleChange(e: Event): void {\r\n e.stopPropagation();\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n }\r\n\r\n /** @internal */\r\n protected _updateItems(): void {\r\n const orientation: NavItemOrientation = this.currentMode === \"compact\" ? \"vertical\" : \"horizontal\";\r\n this._updateOrientation(orientation);\r\n setCustomState(this, \"--compact\", orientation === \"vertical\");\r\n }\r\n\r\n /** @internal */\r\n protected _updateOrientation(orientation: NavItemOrientation): void {\r\n this[selectionManager].items.forEach((x) => (x.orientation = orientation));\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-nav-bar\": M3eNavBarElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues, unsafeCSS } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n DisabledInteractive,\r\n Focusable,\r\n hasAssignedNodes,\r\n KeyboardClick,\r\n LinkButton,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n ReconnectedCallback,\r\n renderPseudoLink,\r\n ResizeController,\r\n resumeAnimation,\r\n Role,\r\n Selected,\r\n setCustomState,\r\n SuppressInitialAnimation,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { selectionManager } from \"@m3e/web/core/a11y\";\r\n\r\nimport type { M3eNavBarElement } from \"./NavBarElement\";\r\nimport { NavItemOrientation } from \"./NavItemOrientation\";\r\n\r\n/**\r\n * An item, placed in a navigation bar or rail, used to navigate to destinations in an application.\r\n *\r\n * @description\r\n * The `m3e-nav-item` component represents an interactive navigation item for use in navigation bars\r\n * or rails. Designed according to Material 3 principles, it supports icon and label slots, selection state,\r\n * orientation, and extensive theming via CSS custom properties.\r\n *\r\n * @example\r\n * The following example illustrates a nav bar with vertically oriented items.\r\n * ```html\r\n * <m3e-nav-bar>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"news\"></m3e-icon>News</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"globe\"></m3e-icon>Global</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"star\"></m3e-icon>For you</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"newsstand\"></m3e-icon>Trending</m3e-nav-item>\r\n * </m3e-nav-bar>\r\n * ```\r\n *\r\n * @tag m3e-nav-item\r\n *\r\n * @slot - Renders the label of the item.\r\n * @slot icon - Renders the icon of the item.\r\n * @slot selected-icon - Renders the icon of the item when selected.\r\n *\r\n * @attr disabled - A value indicating whether the element is disabled.\r\n * @attr disabled-interactive - A value indicating whether the element is disabled and interactive.\r\n * @attr download - A value indicating whether the `target` of the link button will be downloaded, optionally specifying the new name of the file.\r\n * @attr href - The URL to which the link button points.\r\n * @attr orientation - The layout orientation of the item.\r\n * @attr rel - The relationship between the `target` of the link button and the document.\r\n * @attr selected - A value indicating whether the element is selected.\r\n * @attr target - The target of the link button.\r\n *\r\n * @fires input - Emitted when the selected state changes.\r\n * @fires change - Emitted when the selected state changes.\r\n * @fires click - Emitted when the element is clicked.\r\n *\r\n * @cssprop --m3e-nav-item-label-text-font-size - Font size for the label text.\r\n * @cssprop --m3e-nav-item-label-text-font-weight - Font weight for the label text.\r\n * @cssprop --m3e-nav-item-label-text-line-height - Line height for the label text.\r\n * @cssprop --m3e-nav-item-label-text-tracking - Letter spacing for the label text.\r\n * @cssprop --m3e-nav-item-shape - Border radius of the nav item.\r\n * @cssprop --m3e-nav-item-icon-size - Size of the icon.\r\n * @cssprop --m3e-nav-item-spacing - Spacing between icon and label.\r\n * @cssprop --m3e-nav-item-inactive-label-text-color - Color of the label text when inactive.\r\n * @cssprop --m3e-nav-item-inactive-icon-color - Color of the icon when inactive.\r\n * @cssprop --m3e-nav-item-inactive-hover-state-layer-color - State layer color on hover when inactive.\r\n * @cssprop --m3e-nav-item-inactive-focus-state-layer-color - State layer color on focus when inactive.\r\n * @cssprop --m3e-nav-item-inactive-pressed-state-layer-color - State layer color on press when inactive.\r\n * @cssprop --m3e-nav-item-active-label-text-color - Color of the label text when active/selected.\r\n * @cssprop --m3e-nav-item-active-icon-color - Color of the icon when active/selected.\r\n * @cssprop --m3e-nav-item-active-container-color - Container color when active/selected.\r\n * @cssprop --m3e-nav-item-active-hover-state-layer-color - State layer color on hover when active.\r\n * @cssprop --m3e-nav-item-active-focus-state-layer-color - State layer color on focus when active.\r\n * @cssprop --m3e-nav-item-active-pressed-state-layer-color - State layer color on press when active.\r\n * @cssprop --m3e-nav-item-focus-ring-shape - Border radius for the focus ring.\r\n * @cssprop --m3e-nav-item-disabled-label-text-color - Color of the label text when disabled.\r\n * @cssprop --m3e-nav-item-disabled-label-text-opacity - Opacity of the label text when disabled.\r\n * @cssprop --m3e-nav-item-disabled-icon-color - Color of the icon when disabled.\r\n * @cssprop --m3e-nav-item-disabled-icon-opacity - Opacity of the icon when disabled.\r\n * @cssprop --m3e-horizontal-nav-item-padding - Padding for horizontal orientation.\r\n * @cssprop --m3e-horizontal-nav-item-active-indicator-height - Height of the active indicator in horizontal orientation.\r\n * @cssprop --m3e-vertical-nav-item-active-indicator-width - Width of the active indicator in vertical orientation.\r\n * @cssprop --m3e-vertical-nav-item-active-indicator-height - Height of the active indicator in vertical orientation.\r\n * @cssprop --m3e-vertical-nav-item-active-indicator-margin - Margin for the active indicator in vertical orientation.\r\n */\r\n@customElement(\"m3e-nav-item\")\r\nexport class M3eNavItemElement extends ReconnectedCallback(\r\n SuppressInitialAnimation(\r\n LinkButton(\r\n Selected(\r\n KeyboardClick(Focusable(DisabledInteractive(Disabled(AttachInternals(Role(LitElement, \"button\"), true))))),\r\n ),\r\n ),\r\n ),\r\n) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: inline-block;\r\n vertical-align: middle;\r\n position: relative;\r\n outline: none;\r\n user-select: none;\r\n flex: 1;\r\n font-size: var(--m3e-nav-item-label-text-font-size, ${DesignToken.typescale.standard.label.medium.fontSize});\r\n font-weight: var(\r\n --m3e-nav-item-label-text-font-weight,\r\n ${DesignToken.typescale.standard.label.medium.fontWeight}\r\n );\r\n line-height: var(\r\n --m3e-nav-item-label-text-line-height,\r\n ${DesignToken.typescale.standard.label.medium.lineHeight}\r\n );\r\n letter-spacing: var(--m3e-nav-item-label-text-tracking, ${DesignToken.typescale.standard.label.medium.tracking});\r\n border-radius: var(--m3e-nav-item-shape, ${DesignToken.shape.corner.full});\r\n min-width: var(--_nav-item-min-width);\r\n align-self: var(--_nav-item-align-self);\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n :host([orientation=\"horizontal\"]) {\r\n max-width: fit-content;\r\n }\r\n :host(:not(:disabled):not([disabled-interactive])) {\r\n cursor: pointer;\r\n }\r\n :host([disabled-interactive]) {\r\n cursor: not-allowed;\r\n }\r\n .outer {\r\n height: 100%;\r\n }\r\n .outer,\r\n .inner {\r\n display: flex;\r\n align-items: center;\r\n justify-content: var(--_nav-item-justify-content, center);\r\n position: relative;\r\n border-radius: inherit;\r\n }\r\n .icon-wrapper {\r\n position: relative;\r\n flex: none;\r\n }\r\n .base {\r\n justify-content: unset;\r\n box-sizing: border-box;\r\n vertical-align: middle;\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n width: 100%;\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .base {\r\n transition: ${unsafeCSS(\r\n `margin-top ${DesignToken.motion.duration.short1} ${DesignToken.motion.easing.standard}`,\r\n )};\r\n }\r\n .icon {\r\n position: absolute;\r\n }\r\n .label {\r\n vertical-align: middle;\r\n }\r\n :host([orientation=\"horizontal\"]) .label {\r\n white-space: nowrap;\r\n }\r\n ::slotted([slot=\"icon\"]),\r\n ::slotted([slot=\"selected-icon\"]) {\r\n width: 1em;\r\n font-size: var(--m3e-nav-item-icon-size, 1.5rem) !important;\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .ripple {\r\n transition: ${unsafeCSS(`height ${DesignToken.motion.duration.short1} ${DesignToken.motion.easing.standard}`)};\r\n }\r\n :host(:not([selected])) slot[name=\"selected-icon\"],\r\n :host(:not(:is(:state(--with-selected-icon), :--with-selected-icon))) slot[name=\"selected-icon\"],\r\n :host([selected]:is(:state(--with-selected-icon), :--with-selected-icon)) slot[name=\"icon\"] {\r\n display: none;\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .outer {\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-nav-item-inactive-hover-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-nav-item-inactive-focus-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-ripple-color: var(\r\n --m3e-nav-item-inactive-pressed-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label {\r\n color: var(--m3e-nav-item-inactive-label-text-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon {\r\n color: var(--m3e-nav-item-inactive-icon-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .outer {\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-nav-item-active-hover-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-nav-item-active-focus-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-ripple-color: var(\r\n --m3e-nav-item-active-pressed-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive]):not([orientation=\"horizontal\"])) .label {\r\n color: var(--m3e-nav-item-active-label-text-color, ${DesignToken.color.secondary});\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer {\r\n background-color: var(--m3e-nav-item-active-container-color, ${DesignToken.color.secondaryContainer});\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])[orientation=\"horizontal\"]) .label,\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .icon {\r\n color: var(--m3e-nav-item-active-icon-color, ${DesignToken.color.onSecondaryContainer});\r\n }\r\n :host([orientation=\"vertical\"]) .outer {\r\n align-self: stretch;\r\n align-items: flex-start;\r\n }\r\n :host([orientation=\"vertical\"]) .label {\r\n text-align: center;\r\n display: -webkit-box;\r\n -webkit-line-clamp: 2;\r\n -webkit-box-orient: vertical;\r\n overflow: hidden;\r\n line-clamp: 2;\r\n }\r\n :host([orientation=\"vertical\"]) .base {\r\n flex-direction: column;\r\n row-gap: var(--m3e-nav-item-spacing, 0.25rem);\r\n }\r\n :host([orientation=\"horizongal\"]) .base {\r\n margin-top: 0;\r\n }\r\n :host([orientation=\"vertical\"]) .base {\r\n margin-top: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem);\r\n margin-bottom: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem);\r\n }\r\n :host([orientation=\"vertical\"]) .state-layer,\r\n :host([orientation=\"vertical\"]) .ripple {\r\n top: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem);\r\n bottom: unset;\r\n }\r\n :host([orientation=\"vertical\"]) .state-layer,\r\n :host([orientation=\"vertical\"]) .ripple,\r\n :host([orientation=\"vertical\"]) .icon-wrapper {\r\n width: var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem);\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .ripple {\r\n animation: collapse ${DesignToken.motion.duration.medium1};\r\n }\r\n @keyframes collapse {\r\n from {\r\n width: var(--_expanded-width, var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem));\r\n }\r\n to {\r\n width: var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem);\r\n }\r\n }\r\n\r\n :host([orientation=\"vertical\"]) .state-layer,\r\n :host([orientation=\"vertical\"]) .ripple,\r\n :host([orientation=\"vertical\"]) .icon-wrapper {\r\n height: var(--m3e-vertical-nav-item-active-indicator-height, 2rem);\r\n }\r\n :host([orientation=\"vertical\"]) .icon {\r\n top: calc(\r\n calc(var(--m3e-vertical-nav-item-active-indicator-height, 2rem) / 2) - calc(\r\n var(--m3e-nav-item-icon-size, 1.5rem) / 2\r\n )\r\n );\r\n left: calc(\r\n calc(var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem) / 2) - calc(\r\n var(--m3e-nav-item-icon-size, 1.5rem) / 2\r\n )\r\n );\r\n }\r\n :host([orientation=\"vertical\"]) .focus-ring {\r\n border-radius: var(--m3e-nav-item-focus-ring-shape, ${DesignToken.shape.corner.medium});\r\n }\r\n :host([orientation=\"horizontal\"]) .icon-wrapper {\r\n width: var(--m3e-nav-item-icon-size, 1.5rem);\r\n height: var(--m3e-nav-item-icon-size, 1.5rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .base {\r\n padding: var(--m3e-horizontal-nav-item-padding, 1rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .label {\r\n flex: 1 1 auto;\r\n }\r\n :host([orientation=\"horizontal\"]) .base {\r\n column-gap: var(--m3e-nav-item-spacing, 0.25rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .state-layer,\r\n :host([orientation=\"horizontal\"]) .ripple,\r\n :host([orientation=\"horizontal\"]) .inner {\r\n height: var(--m3e-horizontal-nav-item-active-indicator-height, 2.5rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .inner {\r\n width: fit-content;\r\n }\r\n .state-layer,\r\n .ripple {\r\n margin-inline: auto;\r\n }\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"])\r\n .icon-wrapper,\r\n :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper {\r\n animation: ${unsafeCSS(`slide-down ${DesignToken.motion.duration.short2} ${DesignToken.motion.easing.standard}`)};\r\n }\r\n :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"])\r\n .icon-wrapper,\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper {\r\n animation: ${unsafeCSS(`slide-up ${DesignToken.motion.duration.short2} ${DesignToken.motion.easing.standard}`)};\r\n }\r\n @keyframes slide-down {\r\n from {\r\n transform: translateY(-4px);\r\n }\r\n to {\r\n transform: translateY(0);\r\n }\r\n }\r\n @keyframes slide-up {\r\n from {\r\n transform: translateY(4px);\r\n }\r\n to {\r\n transform: translateY(0);\r\n }\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"]) .label {\r\n animation: horizontal-fade-in ${DesignToken.motion.duration.medium1};\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .label {\r\n animation: vertical-fade-in ${DesignToken.motion.duration.medium1};\r\n }\r\n @keyframes horizontal-fade-in {\r\n from {\r\n opacity: 0;\r\n }\r\n to {\r\n opacity: 1;\r\n }\r\n }\r\n @keyframes vertical-fade-in {\r\n from {\r\n opacity: 0;\r\n }\r\n to {\r\n opacity: 1;\r\n }\r\n }\r\n :host(:disabled) .label,\r\n :host([disabled-interactive]) .label {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-nav-item-disabled-label-text-color, ${DesignToken.color.onSurface})\r\n var(--m3e-nav-item-disabled-label-text-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n :host(:disabled) .icon,\r\n :host([disabled-interactive]) .icon {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-nav-item-disabled-icon-color, ${DesignToken.color.onSurface})\r\n var(--m3e-nav-item-disabled-icon-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n a {\r\n all: unset;\r\n display: block;\r\n position: absolute;\r\n top: 0px;\r\n left: 0px;\r\n right: 0px;\r\n bottom: 0px;\r\n z-index: 1;\r\n }\r\n @media (prefers-reduced-motion) {\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"])\r\n .icon-wrapper,\r\n :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper,\r\n :host(\r\n :not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"]\r\n )\r\n .icon-wrapper,\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .ripple,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"]) .label,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .label {\r\n animation: none;\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .ripple,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .base {\r\n transition: none;\r\n }\r\n }\r\n @media (forced-colors: active) {\r\n :host(:disabled) .label,\r\n :host([disabled-interactive]) .label,\r\n :host(:disabled) .icon,\r\n :host([disabled-interactive]) .icon {\r\n color: GrayText;\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label,\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon {\r\n color: ButtonText;\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer {\r\n background-color: ButtonText;\r\n }\r\n :host([orientation=\"vertical\"][selected]:not(:disabled):not([disabled-interactive])) .label {\r\n color: ButtonText;\r\n }\r\n :host([orientation=\"horizontal\"][selected]:not(:disabled):not([disabled-interactive])) .label,\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .icon {\r\n forced-color-adjust: none;\r\n color: ButtonFace;\r\n }\r\n }\r\n `;\r\n\r\n /** @private */ #inRail = false;\r\n /** @private */ readonly #clickHandler = (e: Event) => this.#handleClick(e);\r\n /** @private */ @query(\".focus-ring\") private readonly _focusRing?: M3eFocusRingElement;\r\n /** @private */ @query(\".state-layer\") private readonly _stateLayer?: M3eStateLayerElement;\r\n /** @private */ @query(\".ripple\") private readonly _ripple?: M3eRippleElement;\r\n /** @private */ @query(\".inner\") private readonly _inner?: HTMLElement;\r\n\r\n /** @private */ readonly #resizeController = new ResizeController(this, {\r\n target: null,\r\n callback: (entries) => this.#handleStateLayerResize(entries),\r\n });\r\n\r\n /**\r\n * The layout orientation of the item.\r\n * @default \"vertical\"\r\n */\r\n @property({ reflect: true }) orientation: NavItemOrientation = \"vertical\";\r\n\r\n /** The navigation bar to which this item belongs. */\r\n get navBar(): M3eNavBarElement | null {\r\n return this.closest(\"m3e-nav-bar\") ?? this.closest(\"m3e-nav-rail\") ?? null;\r\n }\r\n\r\n /** @internal */\r\n override [resumeAnimation](): void {\r\n if (this.#inRail) {\r\n super[resumeAnimation]();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n this.#inRail = this.closest(\"m3e-nav-rail\") !== null;\r\n super.connectedCallback();\r\n this.addEventListener(\"click\", this.#clickHandler, { capture: true });\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n this.removeEventListener(\"click\", this.#clickHandler, { capture: true });\r\n this.#inRail = false;\r\n }\r\n\r\n /** @inheritdoc */\r\n override reconnectedCallback(): void {\r\n super.reconnectedCallback();\r\n this.#initResizeObserver();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override update(changedProperties: PropertyValues<this>): void {\r\n super.update(changedProperties);\r\n\r\n if (changedProperties.has(\"selected\")) {\r\n this.ariaSelected = null;\r\n this.ariaPressed = null;\r\n this.ariaCurrent = `${this.selected}`;\r\n for (const icon of this.querySelectorAll(\"m3e-icon\")) {\r\n icon.toggleAttribute(\"filled\", this.selected);\r\n }\r\n this.navBar?.[selectionManager].notifySelectionChange(this);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n\r\n if (_changedProperties.has(\"orientation\")) {\r\n this._focusRing?.attach(this);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override firstUpdated(_changedProperties: PropertyValues<this>): void {\r\n super.firstUpdated(_changedProperties);\r\n [this._focusRing, this._stateLayer, this._ripple].forEach((x) => x?.attach(this));\r\n this.#initResizeObserver();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n const disabled = this.disabled || this.disabledInteractive;\r\n const label = html`<div class=\"label\"><slot></slot></div>`;\r\n return html`${this.orientation === \"vertical\"\r\n ? html`<m3e-focus-ring class=\"focus-ring\" inward></m3e-focus-ring>`\r\n : nothing}\r\n <div class=\"outer\">\r\n ${this[renderPseudoLink]()}\r\n <div class=\"inner\">\r\n ${this.orientation === \"horizontal\" ? html`<m3e-focus-ring class=\"focus-ring\"></m3e-focus-ring>` : nothing}\r\n <m3e-state-layer class=\"state-layer\" ?disabled=\"${disabled}\"></m3e-state-layer>\r\n <m3e-ripple class=\"ripple\" centered ?disabled=\"${disabled}\"></m3e-ripple>\r\n <div class=\"touch\" aria-hidden=\"true\"></div>\r\n <div class=\"base\">\r\n <div class=\"icon-wrapper\" aria-hidden=\"true\">\r\n <div class=\"icon\">\r\n <slot name=\"icon\"></slot>\r\n <slot name=\"selected-icon\" @slotchange=\"${this.#handleSelectedIconSlotChange}\"></slot>\r\n </div>\r\n </div>\r\n\r\n <m3e-collapsible\r\n orientation=\"horizontal\"\r\n ?no-animate=\"${!this.#inRail}\"\r\n ?open=\"${this.orientation === \"horizontal\"}\"\r\n >\r\n ${this.orientation === \"horizontal\" ? label : nothing}\r\n </m3e-collapsible>\r\n\r\n ${this.orientation === \"horizontal\" ? nothing : label}\r\n </div>\r\n </div>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleClick(e: Event): void {\r\n if (e.defaultPrevented) return;\r\n\r\n this.selected = true;\r\n if (this.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true, cancelable: true }))) {\r\n this.navBar?.[selectionManager].notifySelectionChange(this);\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n } else {\r\n this.selected = false;\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleSelectedIconSlotChange(e: Event): void {\r\n setCustomState(this, \"--with-selected-icon\", hasAssignedNodes(<HTMLSlotElement>e.target));\r\n }\r\n\r\n /** @private */\r\n #handleStateLayerResize(entries: ResizeObserverEntry[]): void {\r\n if (entries.length === 0 || this.orientation === \"vertical\") return;\r\n this._inner?.style.setProperty(\"--_expanded-width\", `${entries[0].contentRect.width}px`);\r\n }\r\n\r\n /** @private */\r\n #initResizeObserver(): void {\r\n if (this._stateLayer && this.#inRail) {\r\n this.#resizeController.observe(this._stateLayer);\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-nav-item\": M3eNavItemElement;\r\n }\r\n}\r\n"],"names":["M3eNavBarElement","ReconnectedCallback","AttachInternals","Role","LitElement","constructor","SelectionManager","disableRovingTabIndex","_M3eNavBarElement_breakpointUnobserve","set","mode","items","selectionManager","selected","selectedItems","currentMode","_mode","value","disconnectedCallback","undefined","__classPrivateFieldGet","call","reconnectedCallback","_M3eNavBarElement_instances","_M3eNavBarElement_initBreakpointMonitoring","willUpdate","changedProperties","has","_updateItems","render","html","_M3eNavBarElement_handleChange","_M3eNavBarElement_handleSlotChange","orientation","_updateOrientation","setCustomState","forEach","x","__classPrivateFieldSet","M3eBreakpointObserver","observe","Breakpoint","XSmall","Small","matches","get","setItems","querySelectorAll","e","stopPropagation","dispatchEvent","Event","bubbles","styles","css","DesignToken","scrollbar","thinWidth","color","surfaceContainer","__decorate","state","prototype","property","reflect","customElement","M3eNavItemElement","SuppressInitialAnimation","LinkButton","Selected","KeyboardClick","Focusable","DisabledInteractive","Disabled","_M3eNavItemElement_inRail","_M3eNavItemElement_clickHandler","_M3eNavItemElement_resizeController","ResizeController","target","callback","entries","_M3eNavItemElement_instances","_M3eNavItemElement_handleStateLayerResize","navBar","closest","WeakMap","WeakSet","resumeAnimation","connectedCallback","addEventListener","capture","removeEventListener","_M3eNavItemElement_initResizeObserver","update","ariaSelected","ariaPressed","ariaCurrent","icon","toggleAttribute","notifySelectionChange","updated","_changedProperties","_focusRing","attach","firstUpdated","_stateLayer","_ripple","disabled","disabledInteractive","label","nothing","renderPseudoLink","_M3eNavItemElement_handleSelectedIconSlotChange","defaultPrevented","composed","cancelable","hasAssignedNodes","length","_inner","style","setProperty","contentRect","width","typescale","standard","medium","fontSize","fontWeight","lineHeight","tracking","shape","corner","full","unsafeCSS","motion","duration","short1","easing","onSecondaryContainer","onSurfaceVariant","secondary","secondaryContainer","medium1","short2","onSurface","query"],"mappings":";;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AAEI,IAAMA,gBAAgB,GAAtB,MAAMA,gBAAiB,SAAQC,mBAAmB,CAACC,eAAe,CAACC,IAAI,CAACC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;AAAnGC,EAAAA,WAAAA,GAAA;;;AAwBL;IAA0B,QAAkB,GAAG,IAAIC,gBAAgB,EAAqB,CAACC,qBAAqB,EAAE;AAChH;AAAgBC,IAAAA,qCAAA,CAAAC,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AAGhB;;;AAGG;IAC0B,IAAA,CAAAC,IAAI,GAAe,SAAS;AA8F3D,EAAA;AA5FE;EACA,IAAIC,KAAKA,GAAA;AACP,IAAA,OAAO,IAAI,CAACC,gBAAg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,MAAM,CAAA,CAAA,EAAIxF,WAAW,CAAC+E,MAAM,CAACG,MAAM,CAACb,QAAQ,CAAA,CAAE,CAAC,CAAA,0TAAA,EAmB9ErE,WAAW,CAAC+E,MAAM,CAACC,QAAQ,CAACO,OAAO,CAAA,uHAAA,EAGrCvF,WAAW,CAAC+E,MAAM,CAACC,QAAQ,CAACO,OAAO,CAAA,+RAAA,EAsBfvF,WAAW,CAACG,KAAK,CAACsF,SAAS,CAAA,0MAAA,EASjCzF,WAAW,CAACG,KAAK,CAACsF,SAAS,CAAA,+iEAAA,CA3RrD;AA4ViCpF,UAAA,CAAA,CAAtCqF,KAAK,CAAC,aAAa,CAAC,CAAmD,EAAA/E,iBAAA,CAAAJ,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAChCF,UAAA,CAAA,CAAvCqF,KAAK,CAAC,cAAc,CAAC,CAAqD,EAAA/E,iBAAA,CAAAJ,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AACxCF,UAAA,CAAA,CAAlCqF,KAAK,CAAC,SAAS,CAAC,CAA6C,EAAA/E,iBAAA,CAAAJ,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAC5BF,UAAA,CAAA,CAAjCqF,KAAK,CAAC,QAAQ,CAAC,CAAuC,EAAA/E,iBAAA,CAAAJ,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAW1CF,UAAA,CAAA,CAA5BG,QAAQ,CAAC;AAAEC,EAAAA,OAAO,EAAE;CAAM,CAAC,CAA8C,EAAAE,iBAAA,CAAAJ,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AApX/DI,iBAAiB,GAAAN,UAAA,CAAA,CAD7BK,aAAa,CAAC,cAAc,CAAC,CACjB,EAAAC,iBAAiB,CAuf7B;;;;"}
1
+ {"version":3,"file":"nav-bar.js","sources":["../../src/nav-bar/NavBarElement.ts","../../src/nav-bar/NavItemElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement, PropertyValues } from \"lit\";\r\nimport { property, state } from \"lit/decorators.js\";\r\n\r\nimport { AttachInternals, customElement, DesignToken, ReconnectedCallback, Role, setCustomState } from \"@m3e/web/core\";\r\n\r\nimport { SelectionManager, selectionManager } from \"@m3e/web/core/a11y\";\r\nimport { Breakpoint, M3eBreakpointObserver } from \"@m3e/web/core/layout\";\r\n\r\nimport { M3eNavItemElement } from \"./NavItemElement\";\r\nimport { NavItemOrientation } from \"./NavItemOrientation\";\r\nimport { NavBarMode } from \"./NavBarMode\";\r\n\r\n/**\r\n * A horizontal bar, typically used on smaller devices, that allows a user to switch between 3-5 views.\r\n *\r\n * @description\r\n * The `m3e-nav-bar` component provides a horizontal navigation bar for switching between primary destinations in\r\n * an application. Designed for smaller devices, it supports 3-5 interactive items, orientation, and theming\r\n * via CSS custom properties.\r\n *\r\n * @example\r\n * The following example illustrates a nav bar with vertically oriented items.\r\n * ```html\r\n * <m3e-nav-bar>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"news\"></m3e-icon>News</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"globe\"></m3e-icon>Global</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"star\"></m3e-icon>For you</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"newsstand\"></m3e-icon>Trending</m3e-nav-item>\r\n * </m3e-nav-bar>\r\n * ```\r\n *\r\n * @tag m3e-nav-bar\r\n *\r\n * @slot - Renders the items of the bar.\r\n *\r\n * @attr mode - The mode in which items in the bar are presented.\r\n *\r\n * @fires beforeinput - Dispatched before the selected state of an item changes.\r\n * @fires input - Dispatched when the selected state of an item changes.\r\n * @fires change - Dispatched when the selected state of an item changes.\r\n *\r\n * @cssprop --m3e-nav-bar-height - Height of the navigation bar.\r\n * @cssprop --m3e-nav-bar-container-color - Background color of the navigation bar container.\r\n * @cssprop --m3e-nav-bar-vertical-item-width - Minimum width of vertical nav items.\r\n */\r\n@customElement(\"m3e-nav-bar\")\r\nexport class M3eNavBarElement extends ReconnectedCallback(AttachInternals(Role(LitElement, \"navigation\"))) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n overflow-x: auto;\r\n overflow-y: hidden;\r\n scrollbar-width: ${DesignToken.scrollbar.thinWidth};\r\n scrollbar-color: ${DesignToken.scrollbar.color};\r\n min-height: var(--m3e-nav-bar-height, 4rem);\r\n }\r\n .base {\r\n display: flex;\r\n align-items: stretch;\r\n justify-content: center;\r\n box-sizing: border-box;\r\n min-height: inherit;\r\n height: inherit;\r\n width: 100%;\r\n background-color: var(--m3e-nav-bar-container-color, ${DesignToken.color.surfaceContainer});\r\n --_nav-item-min-width: var(--m3e-nav-bar-vertical-item-width, 7rem);\r\n }\r\n `;\r\n\r\n /** @internal */ readonly [selectionManager] = new SelectionManager<M3eNavItemElement>().disableRovingTabIndex();\r\n /** @private */ #breakpointUnobserve?: () => void;\r\n /** @private */ @state() private _mode?: Exclude<NavBarMode, \"auto\">;\r\n\r\n /**\r\n * The mode in which items in the bar are presented.\r\n * @default \"compact\"\r\n */\r\n @property({ reflect: true }) mode: NavBarMode = \"compact\";\r\n\r\n /** The items of the bar. */\r\n get items(): readonly M3eNavItemElement[] {\r\n return this[selectionManager].items;\r\n }\r\n\r\n /** The selected item. */\r\n get selected(): M3eNavItemElement | null {\r\n return this[selectionManager].selectedItems[0] ?? null;\r\n }\r\n\r\n /** The current mode applied to the bar. */\r\n get currentMode(): Exclude<NavBarMode, \"auto\"> {\r\n return this._mode ?? (this.mode !== \"compact\" ? \"expanded\" : \"compact\");\r\n }\r\n set currentMode(value: Exclude<NavBarMode, \"auto\">) {\r\n this._mode = value;\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this._mode = undefined;\r\n this.#breakpointUnobserve?.();\r\n }\r\n\r\n /** @inheritdoc */\r\n override reconnectedCallback(): void {\r\n super.reconnectedCallback();\r\n\r\n if (this.mode === \"auto\") {\r\n this.#initBreakpointMonitoring();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override willUpdate(changedProperties: PropertyValues): void {\r\n super.willUpdate(changedProperties);\r\n\r\n if (changedProperties.has(\"mode\")) {\r\n this.#breakpointUnobserve?.();\r\n\r\n if (this.mode === \"auto\") {\r\n this.#initBreakpointMonitoring();\r\n } else {\r\n this._mode = undefined;\r\n this._updateItems();\r\n }\r\n }\r\n if (changedProperties.has(\"_mode\")) {\r\n this._updateItems();\r\n }\r\n }\r\n\r\n /** @private */\r\n #initBreakpointMonitoring(): void {\r\n this.#breakpointUnobserve = M3eBreakpointObserver.observe([Breakpoint.XSmall, Breakpoint.Small], (matches) => {\r\n this._mode = matches.get(Breakpoint.XSmall) || matches.get(Breakpoint.Small) ? \"compact\" : \"expanded\";\r\n this._updateItems();\r\n });\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\">\r\n <slot @change=\"${this.#handleChange}\" @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(): void {\r\n this[selectionManager].setItems([...this.querySelectorAll(\"m3e-nav-item\")]);\r\n this._updateItems();\r\n }\r\n\r\n /** @private */\r\n #handleChange(e: Event): void {\r\n e.stopPropagation();\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n }\r\n\r\n /** @internal */\r\n protected _updateItems(): void {\r\n const orientation: NavItemOrientation = this.currentMode === \"compact\" ? \"vertical\" : \"horizontal\";\r\n this._updateOrientation(orientation);\r\n setCustomState(this, \"--compact\", orientation === \"vertical\");\r\n }\r\n\r\n /** @internal */\r\n protected _updateOrientation(orientation: NavItemOrientation): void {\r\n this[selectionManager].items.forEach((x) => (x.orientation = orientation));\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-nav-bar\": M3eNavBarElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues, unsafeCSS } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n DisabledInteractive,\r\n Focusable,\r\n hasAssignedNodes,\r\n KeyboardClick,\r\n LinkButton,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n ReconnectedCallback,\r\n renderPseudoLink,\r\n ResizeController,\r\n resumeAnimation,\r\n Role,\r\n Selected,\r\n setCustomState,\r\n SuppressInitialAnimation,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { selectionManager } from \"@m3e/web/core/a11y\";\r\n\r\nimport type { M3eNavBarElement } from \"./NavBarElement\";\r\nimport { NavItemOrientation } from \"./NavItemOrientation\";\r\n\r\n/**\r\n * An item, placed in a navigation bar or rail, used to navigate to destinations in an application.\r\n *\r\n * @description\r\n * The `m3e-nav-item` component represents an interactive navigation item for use in navigation bars\r\n * or rails. Designed according to Material 3 principles, it supports icon and label slots, selection state,\r\n * orientation, and extensive theming via CSS custom properties.\r\n *\r\n * @example\r\n * The following example illustrates a nav bar with vertically oriented items.\r\n * ```html\r\n * <m3e-nav-bar>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"news\"></m3e-icon>News</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"globe\"></m3e-icon>Global</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"star\"></m3e-icon>For you</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"newsstand\"></m3e-icon>Trending</m3e-nav-item>\r\n * </m3e-nav-bar>\r\n * ```\r\n *\r\n * @tag m3e-nav-item\r\n *\r\n * @slot - Renders the label of the item.\r\n * @slot icon - Renders the icon of the item.\r\n * @slot selected-icon - Renders the icon of the item when selected.\r\n *\r\n * @attr disabled - A value indicating whether the element is disabled.\r\n * @attr disabled-interactive - A value indicating whether the element is disabled and interactive.\r\n * @attr download - A value indicating whether the `target` of the link button will be downloaded, optionally specifying the new name of the file.\r\n * @attr href - The URL to which the link button points.\r\n * @attr orientation - The layout orientation of the item.\r\n * @attr rel - The relationship between the `target` of the link button and the document.\r\n * @attr selected - A value indicating whether the element is selected.\r\n * @attr target - The target of the link button.\r\n *\r\n * @fires beforeinput - Dispatched before the selected state changes.\r\n * @fires input - Dispatched when the selected state changes.\r\n * @fires change - Dispatched when the selected state changes.\r\n * @fires click - Dispatched when the element is clicked.\r\n *\r\n * @cssprop --m3e-nav-item-label-text-font-size - Font size for the label text.\r\n * @cssprop --m3e-nav-item-label-text-font-weight - Font weight for the label text.\r\n * @cssprop --m3e-nav-item-label-text-line-height - Line height for the label text.\r\n * @cssprop --m3e-nav-item-label-text-tracking - Letter spacing for the label text.\r\n * @cssprop --m3e-nav-item-shape - Border radius of the nav item.\r\n * @cssprop --m3e-nav-item-icon-size - Size of the icon.\r\n * @cssprop --m3e-nav-item-spacing - Spacing between icon and label.\r\n * @cssprop --m3e-nav-item-inactive-label-text-color - Color of the label text when inactive.\r\n * @cssprop --m3e-nav-item-inactive-icon-color - Color of the icon when inactive.\r\n * @cssprop --m3e-nav-item-inactive-hover-state-layer-color - State layer color on hover when inactive.\r\n * @cssprop --m3e-nav-item-inactive-focus-state-layer-color - State layer color on focus when inactive.\r\n * @cssprop --m3e-nav-item-inactive-pressed-state-layer-color - State layer color on press when inactive.\r\n * @cssprop --m3e-nav-item-active-label-text-color - Color of the label text when active/selected.\r\n * @cssprop --m3e-nav-item-active-icon-color - Color of the icon when active/selected.\r\n * @cssprop --m3e-nav-item-active-container-color - Container color when active/selected.\r\n * @cssprop --m3e-nav-item-active-hover-state-layer-color - State layer color on hover when active.\r\n * @cssprop --m3e-nav-item-active-focus-state-layer-color - State layer color on focus when active.\r\n * @cssprop --m3e-nav-item-active-pressed-state-layer-color - State layer color on press when active.\r\n * @cssprop --m3e-nav-item-focus-ring-shape - Border radius for the focus ring.\r\n * @cssprop --m3e-nav-item-disabled-label-text-color - Color of the label text when disabled.\r\n * @cssprop --m3e-nav-item-disabled-label-text-opacity - Opacity of the label text when disabled.\r\n * @cssprop --m3e-nav-item-disabled-icon-color - Color of the icon when disabled.\r\n * @cssprop --m3e-nav-item-disabled-icon-opacity - Opacity of the icon when disabled.\r\n * @cssprop --m3e-horizontal-nav-item-padding - Padding for horizontal orientation.\r\n * @cssprop --m3e-horizontal-nav-item-active-indicator-height - Height of the active indicator in horizontal orientation.\r\n * @cssprop --m3e-vertical-nav-item-active-indicator-width - Width of the active indicator in vertical orientation.\r\n * @cssprop --m3e-vertical-nav-item-active-indicator-height - Height of the active indicator in vertical orientation.\r\n * @cssprop --m3e-vertical-nav-item-active-indicator-margin - Margin for the active indicator in vertical orientation.\r\n */\r\n@customElement(\"m3e-nav-item\")\r\nexport class M3eNavItemElement extends ReconnectedCallback(\r\n SuppressInitialAnimation(\r\n LinkButton(\r\n Selected(\r\n KeyboardClick(Focusable(DisabledInteractive(Disabled(AttachInternals(Role(LitElement, \"button\"), true))))),\r\n ),\r\n ),\r\n ),\r\n) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: inline-block;\r\n vertical-align: middle;\r\n position: relative;\r\n outline: none;\r\n user-select: none;\r\n flex: 1;\r\n font-size: var(--m3e-nav-item-label-text-font-size, ${DesignToken.typescale.standard.label.medium.fontSize});\r\n font-weight: var(\r\n --m3e-nav-item-label-text-font-weight,\r\n ${DesignToken.typescale.standard.label.medium.fontWeight}\r\n );\r\n line-height: var(\r\n --m3e-nav-item-label-text-line-height,\r\n ${DesignToken.typescale.standard.label.medium.lineHeight}\r\n );\r\n letter-spacing: var(--m3e-nav-item-label-text-tracking, ${DesignToken.typescale.standard.label.medium.tracking});\r\n border-radius: var(--m3e-nav-item-shape, ${DesignToken.shape.corner.full});\r\n min-width: var(--_nav-item-min-width);\r\n align-self: var(--_nav-item-align-self);\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n :host([orientation=\"horizontal\"]) {\r\n max-width: fit-content;\r\n }\r\n :host(:not(:disabled):not([disabled-interactive])) {\r\n cursor: pointer;\r\n }\r\n :host([disabled-interactive]) {\r\n cursor: not-allowed;\r\n }\r\n .outer {\r\n height: 100%;\r\n }\r\n .outer,\r\n .inner {\r\n display: flex;\r\n align-items: center;\r\n justify-content: var(--_nav-item-justify-content, center);\r\n position: relative;\r\n border-radius: inherit;\r\n }\r\n .icon-wrapper {\r\n position: relative;\r\n flex: none;\r\n }\r\n .base {\r\n justify-content: unset;\r\n box-sizing: border-box;\r\n vertical-align: middle;\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n width: 100%;\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .base {\r\n transition: ${unsafeCSS(\r\n `margin-top ${DesignToken.motion.duration.short1} ${DesignToken.motion.easing.standard}`,\r\n )};\r\n }\r\n .icon {\r\n position: absolute;\r\n }\r\n .label {\r\n vertical-align: middle;\r\n }\r\n :host([orientation=\"horizontal\"]) .label {\r\n white-space: nowrap;\r\n }\r\n ::slotted([slot=\"icon\"]),\r\n ::slotted([slot=\"selected-icon\"]) {\r\n width: 1em;\r\n font-size: var(--m3e-nav-item-icon-size, 1.5rem) !important;\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .ripple {\r\n transition: ${unsafeCSS(`height ${DesignToken.motion.duration.short1} ${DesignToken.motion.easing.standard}`)};\r\n }\r\n :host(:not([selected])) slot[name=\"selected-icon\"],\r\n :host(:not(:is(:state(--with-selected-icon), :--with-selected-icon))) slot[name=\"selected-icon\"],\r\n :host([selected]:is(:state(--with-selected-icon), :--with-selected-icon)) slot[name=\"icon\"] {\r\n display: none;\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .outer {\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-nav-item-inactive-hover-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-nav-item-inactive-focus-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-ripple-color: var(\r\n --m3e-nav-item-inactive-pressed-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label {\r\n color: var(--m3e-nav-item-inactive-label-text-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon {\r\n color: var(--m3e-nav-item-inactive-icon-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .outer {\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-nav-item-active-hover-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-nav-item-active-focus-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-ripple-color: var(\r\n --m3e-nav-item-active-pressed-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive]):not([orientation=\"horizontal\"])) .label {\r\n color: var(--m3e-nav-item-active-label-text-color, ${DesignToken.color.secondary});\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer {\r\n background-color: var(--m3e-nav-item-active-container-color, ${DesignToken.color.secondaryContainer});\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])[orientation=\"horizontal\"]) .label,\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .icon {\r\n color: var(--m3e-nav-item-active-icon-color, ${DesignToken.color.onSecondaryContainer});\r\n }\r\n :host([orientation=\"vertical\"]) .outer {\r\n align-self: stretch;\r\n align-items: flex-start;\r\n }\r\n :host([orientation=\"vertical\"]) .label {\r\n text-align: center;\r\n display: -webkit-box;\r\n -webkit-line-clamp: 2;\r\n -webkit-box-orient: vertical;\r\n overflow: hidden;\r\n line-clamp: 2;\r\n }\r\n :host([orientation=\"vertical\"]) .base {\r\n flex-direction: column;\r\n row-gap: var(--m3e-nav-item-spacing, 0.25rem);\r\n }\r\n :host([orientation=\"horizongal\"]) .base {\r\n margin-top: 0;\r\n }\r\n :host([orientation=\"vertical\"]) .base {\r\n margin-top: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem);\r\n margin-bottom: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem);\r\n }\r\n :host([orientation=\"vertical\"]) .state-layer,\r\n :host([orientation=\"vertical\"]) .ripple {\r\n top: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem);\r\n bottom: unset;\r\n }\r\n :host([orientation=\"vertical\"]) .state-layer,\r\n :host([orientation=\"vertical\"]) .ripple,\r\n :host([orientation=\"vertical\"]) .icon-wrapper {\r\n width: var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem);\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .ripple {\r\n animation: collapse ${DesignToken.motion.duration.medium1};\r\n }\r\n @keyframes collapse {\r\n from {\r\n width: var(--_expanded-width, var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem));\r\n }\r\n to {\r\n width: var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem);\r\n }\r\n }\r\n\r\n :host([orientation=\"vertical\"]) .state-layer,\r\n :host([orientation=\"vertical\"]) .ripple,\r\n :host([orientation=\"vertical\"]) .icon-wrapper {\r\n height: var(--m3e-vertical-nav-item-active-indicator-height, 2rem);\r\n }\r\n :host([orientation=\"vertical\"]) .icon {\r\n top: calc(\r\n calc(var(--m3e-vertical-nav-item-active-indicator-height, 2rem) / 2) - calc(\r\n var(--m3e-nav-item-icon-size, 1.5rem) / 2\r\n )\r\n );\r\n left: calc(\r\n calc(var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem) / 2) - calc(\r\n var(--m3e-nav-item-icon-size, 1.5rem) / 2\r\n )\r\n );\r\n }\r\n :host([orientation=\"vertical\"]) .focus-ring {\r\n border-radius: var(--m3e-nav-item-focus-ring-shape, ${DesignToken.shape.corner.medium});\r\n }\r\n :host([orientation=\"horizontal\"]) .icon-wrapper {\r\n width: var(--m3e-nav-item-icon-size, 1.5rem);\r\n height: var(--m3e-nav-item-icon-size, 1.5rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .base {\r\n padding: var(--m3e-horizontal-nav-item-padding, 1rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .label {\r\n flex: 1 1 auto;\r\n }\r\n :host([orientation=\"horizontal\"]) .base {\r\n column-gap: var(--m3e-nav-item-spacing, 0.25rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .state-layer,\r\n :host([orientation=\"horizontal\"]) .ripple,\r\n :host([orientation=\"horizontal\"]) .inner {\r\n height: var(--m3e-horizontal-nav-item-active-indicator-height, 2.5rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .inner {\r\n width: fit-content;\r\n }\r\n .state-layer,\r\n .ripple {\r\n margin-inline: auto;\r\n }\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"])\r\n .icon-wrapper,\r\n :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper {\r\n animation: ${unsafeCSS(`slide-down ${DesignToken.motion.duration.short2} ${DesignToken.motion.easing.standard}`)};\r\n }\r\n :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"])\r\n .icon-wrapper,\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper {\r\n animation: ${unsafeCSS(`slide-up ${DesignToken.motion.duration.short2} ${DesignToken.motion.easing.standard}`)};\r\n }\r\n @keyframes slide-down {\r\n from {\r\n transform: translateY(-4px);\r\n }\r\n to {\r\n transform: translateY(0);\r\n }\r\n }\r\n @keyframes slide-up {\r\n from {\r\n transform: translateY(4px);\r\n }\r\n to {\r\n transform: translateY(0);\r\n }\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"]) .label {\r\n animation: horizontal-fade-in ${DesignToken.motion.duration.medium1};\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .label {\r\n animation: vertical-fade-in ${DesignToken.motion.duration.medium1};\r\n }\r\n @keyframes horizontal-fade-in {\r\n from {\r\n opacity: 0;\r\n }\r\n to {\r\n opacity: 1;\r\n }\r\n }\r\n @keyframes vertical-fade-in {\r\n from {\r\n opacity: 0;\r\n }\r\n to {\r\n opacity: 1;\r\n }\r\n }\r\n :host(:disabled) .label,\r\n :host([disabled-interactive]) .label {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-nav-item-disabled-label-text-color, ${DesignToken.color.onSurface})\r\n var(--m3e-nav-item-disabled-label-text-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n :host(:disabled) .icon,\r\n :host([disabled-interactive]) .icon {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-nav-item-disabled-icon-color, ${DesignToken.color.onSurface})\r\n var(--m3e-nav-item-disabled-icon-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n a {\r\n all: unset;\r\n display: block;\r\n position: absolute;\r\n top: 0px;\r\n left: 0px;\r\n right: 0px;\r\n bottom: 0px;\r\n z-index: 1;\r\n }\r\n @media (prefers-reduced-motion) {\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"])\r\n .icon-wrapper,\r\n :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper,\r\n :host(\r\n :not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"]\r\n )\r\n .icon-wrapper,\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .ripple,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"]) .label,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .label {\r\n animation: none;\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .ripple,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .base {\r\n transition: none;\r\n }\r\n }\r\n @media (forced-colors: active) {\r\n :host(:disabled) .label,\r\n :host([disabled-interactive]) .label,\r\n :host(:disabled) .icon,\r\n :host([disabled-interactive]) .icon {\r\n color: GrayText;\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label,\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon {\r\n color: ButtonText;\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer {\r\n background-color: ButtonText;\r\n }\r\n :host([orientation=\"vertical\"][selected]:not(:disabled):not([disabled-interactive])) .label {\r\n color: ButtonText;\r\n }\r\n :host([orientation=\"horizontal\"][selected]:not(:disabled):not([disabled-interactive])) .label,\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .icon {\r\n forced-color-adjust: none;\r\n color: ButtonFace;\r\n }\r\n }\r\n `;\r\n\r\n /** @private */ #inRail = false;\r\n /** @private */ readonly #clickHandler = (e: Event) => this.#handleClick(e);\r\n /** @private */ @query(\".focus-ring\") private readonly _focusRing?: M3eFocusRingElement;\r\n /** @private */ @query(\".state-layer\") private readonly _stateLayer?: M3eStateLayerElement;\r\n /** @private */ @query(\".ripple\") private readonly _ripple?: M3eRippleElement;\r\n /** @private */ @query(\".inner\") private readonly _inner?: HTMLElement;\r\n\r\n /** @private */ readonly #resizeController = new ResizeController(this, {\r\n target: null,\r\n callback: (entries) => this.#handleStateLayerResize(entries),\r\n });\r\n\r\n /**\r\n * The layout orientation of the item.\r\n * @default \"vertical\"\r\n */\r\n @property({ reflect: true }) orientation: NavItemOrientation = \"vertical\";\r\n\r\n /** The navigation bar to which this item belongs. */\r\n get navBar(): M3eNavBarElement | null {\r\n return this.closest(\"m3e-nav-bar\") ?? this.closest(\"m3e-nav-rail\") ?? null;\r\n }\r\n\r\n /** @internal */\r\n override [resumeAnimation](): void {\r\n if (this.#inRail) {\r\n super[resumeAnimation]();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n this.#inRail = this.closest(\"m3e-nav-rail\") !== null;\r\n super.connectedCallback();\r\n this.addEventListener(\"click\", this.#clickHandler, { capture: true });\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n this.removeEventListener(\"click\", this.#clickHandler, { capture: true });\r\n this.#inRail = false;\r\n }\r\n\r\n /** @inheritdoc */\r\n override reconnectedCallback(): void {\r\n super.reconnectedCallback();\r\n this.#initResizeObserver();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override update(changedProperties: PropertyValues<this>): void {\r\n super.update(changedProperties);\r\n\r\n if (changedProperties.has(\"selected\")) {\r\n this.ariaSelected = null;\r\n this.ariaPressed = null;\r\n this.ariaCurrent = `${this.selected}`;\r\n for (const icon of this.querySelectorAll(\"m3e-icon\")) {\r\n icon.toggleAttribute(\"filled\", this.selected);\r\n }\r\n this.navBar?.[selectionManager].notifySelectionChange(this);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n\r\n if (_changedProperties.has(\"orientation\")) {\r\n this._focusRing?.attach(this);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override firstUpdated(_changedProperties: PropertyValues<this>): void {\r\n super.firstUpdated(_changedProperties);\r\n [this._focusRing, this._stateLayer, this._ripple].forEach((x) => x?.attach(this));\r\n this.#initResizeObserver();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n const disabled = this.disabled || this.disabledInteractive;\r\n const label = html`<div class=\"label\"><slot></slot></div>`;\r\n return html`${this.orientation === \"vertical\"\r\n ? html`<m3e-focus-ring class=\"focus-ring\" inward></m3e-focus-ring>`\r\n : nothing}\r\n <div class=\"outer\">\r\n ${this[renderPseudoLink]()}\r\n <div class=\"inner\">\r\n ${this.orientation === \"horizontal\" ? html`<m3e-focus-ring class=\"focus-ring\"></m3e-focus-ring>` : nothing}\r\n <m3e-state-layer class=\"state-layer\" ?disabled=\"${disabled}\"></m3e-state-layer>\r\n <m3e-ripple class=\"ripple\" centered ?disabled=\"${disabled}\"></m3e-ripple>\r\n <div class=\"touch\" aria-hidden=\"true\"></div>\r\n <div class=\"base\">\r\n <div class=\"icon-wrapper\" aria-hidden=\"true\">\r\n <div class=\"icon\">\r\n <slot name=\"icon\"></slot>\r\n <slot name=\"selected-icon\" @slotchange=\"${this.#handleSelectedIconSlotChange}\"></slot>\r\n </div>\r\n </div>\r\n\r\n <m3e-collapsible\r\n orientation=\"horizontal\"\r\n ?no-animate=\"${!this.#inRail}\"\r\n ?open=\"${this.orientation === \"horizontal\"}\"\r\n >\r\n ${this.orientation === \"horizontal\" ? label : nothing}\r\n </m3e-collapsible>\r\n\r\n ${this.orientation === \"horizontal\" ? nothing : label}\r\n </div>\r\n </div>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleClick(e: Event): void {\r\n if (e.defaultPrevented) return;\r\n\r\n if (this.dispatchEvent(new Event(\"beforeinput\", { bubbles: true, cancelable: true }))) {\r\n this.selected = true;\r\n this.navBar?.[selectionManager].notifySelectionChange(this);\r\n\r\n this.dispatchEvent(new Event(\"input\", { bubbles: true }));\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleSelectedIconSlotChange(e: Event): void {\r\n setCustomState(this, \"--with-selected-icon\", hasAssignedNodes(<HTMLSlotElement>e.target));\r\n }\r\n\r\n /** @private */\r\n #handleStateLayerResize(entries: ResizeObserverEntry[]): void {\r\n if (entries.length === 0 || this.orientation === \"vertical\") return;\r\n this._inner?.style.setProperty(\"--_expanded-width\", `${entries[0].contentRect.width}px`);\r\n }\r\n\r\n /** @private */\r\n #initResizeObserver(): void {\r\n if (this._stateLayer && this.#inRail) {\r\n this.#resizeController.observe(this._stateLayer);\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-nav-item\": M3eNavItemElement;\r\n }\r\n}\r\n"],"names":["M3eNavBarElement","ReconnectedCallback","AttachInternals","Role","LitElement","constructor","SelectionManager","disableRovingTabIndex","_M3eNavBarElement_breakpointUnobserve","set","mode","items","selectionManager","selected","selectedItems","currentMode","_mode","value","disconnectedCallback","undefined","__classPrivateFieldGet","call","reconnectedCallback","_M3eNavBarElement_instances","_M3eNavBarElement_initBreakpointMonitoring","willUpdate","changedProperties","has","_updateItems","render","html","_M3eNavBarElement_handleChange","_M3eNavBarElement_handleSlotChange","orientation","_updateOrientation","setCustomState","forEach","x","__classPrivateFieldSet","M3eBreakpointObserver","observe","Breakpoint","XSmall","Small","matches","get","setItems","querySelectorAll","e","stopPropagation","dispatchEvent","Event","bubbles","styles","css","DesignToken","scrollbar","thinWidth","color","surfaceContainer","__decorate","state","prototype","property","reflect","customElement","M3eNavItemElement","SuppressInitialAnimation","LinkButton","Selected","KeyboardClick","Focusable","DisabledInteractive","Disabled","_M3eNavItemElement_inRail","_M3eNavItemElement_clickHandler","_M3eNavItemElement_resizeController","ResizeController","target","callback","entries","_M3eNavItemElement_instances","_M3eNavItemElement_handleStateLayerResize","navBar","closest","WeakMap","WeakSet","resumeAnimation","connectedCallback","addEventListener","capture","removeEventListener","_M3eNavItemElement_initResizeObserver","update","ariaSelected","ariaPressed","ariaCurrent","icon","toggleAttribute","notifySelectionChange","updated","_changedProperties","_focusRing","attach","firstUpdated","_stateLayer","_ripple","disabled","disabledInteractive","label","nothing","renderPseudoLink","_M3eNavItemElement_handleSelectedIconSlotChange","defaultPrevented","cancelable","hasAssignedNodes","length","_inner","style","setProperty","contentRect","width","typescale","standard","medium","fontSize","fontWeight","lineHeight","tracking","shape","corner","full","unsafeCSS","motion","duration","short1","easing","onSecondaryContainer","onSurfaceVariant","secondary","secondaryContainer","medium1","short2","onSurface","query"],"mappings":";;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AAEI,IAAMA,gBAAgB,GAAtB,MAAMA,gBAAiB,SAAQC,mBAAmB,CAACC,eAAe,CAACC,IAAI,CAACC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;AAAnGC,EAAAA,WAAAA,GAAA;;;AAwBL;IAA0B,QAAkB,GAAG,IAAIC,gBAAgB,EAAqB,CAACC,qBAAqB,EAAE;AAChH;AAAgBC,IAAAA,qCAAA,CAAAC,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AAGhB;;;AAGG;IAC0B,IAAA,CAAAC,IAAI,GAAe,SAAS;AA8F3D,EAAA;AA5FE;EACA,IAAIC,KAAKA,GAAA;AACP,IAAA,OAAO,IAAI,CAACC,gBAAgB,CAAC,CAACD,KAAK;AACrC,EAAA;AAEA;EACA,IAAIE,QAAQA,GAAA;IACV,OAAO,IAAI,CAACD,gBAAgB,CAAC,CAACE,aAAa,CAAC,CAAC,CAAC,IAAI,IAAI;AACxD,EAAA;AAEA;EACA,IAAIC,WAAWA,GAAA;AACb,IAAA,OAAO,IAAI,CAACC,KAAK,KAAK,IAAI,CAACN,IAAI,KAAK,SAAS,GAAG,UAAU,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BftF,WAAW,CAACG,KAAK,CAACqF,SAAS,CAAA,0MAAA,EASjCxF,WAAW,CAACG,KAAK,CAACqF,SAAS,CAAA,+iEAAA,CA3RrD;AA4ViCnF,UAAA,CAAA,CAAtCoF,KAAK,CAAC,aAAa,CAAC,CAAmD,EAAA9E,iBAAA,CAAAJ,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAChCF,UAAA,CAAA,CAAvCoF,KAAK,CAAC,cAAc,CAAC,CAAqD,EAAA9E,iBAAA,CAAAJ,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AACxCF,UAAA,CAAA,CAAlCoF,KAAK,CAAC,SAAS,CAAC,CAA6C,EAAA9E,iBAAA,CAAAJ,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAC5BF,UAAA,CAAA,CAAjCoF,KAAK,CAAC,QAAQ,CAAC,CAAuC,EAAA9E,iBAAA,CAAAJ,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAW1CF,UAAA,CAAA,CAA5BG,QAAQ,CAAC;AAAEC,EAAAA,OAAO,EAAE;CAAM,CAAC,CAA8C,EAAAE,iBAAA,CAAAJ,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AApX/DI,iBAAiB,GAAAN,UAAA,CAAA,CAD7BK,aAAa,CAAC,cAAc,CAAC,CACjB,EAAAC,iBAAiB,CAuf7B;;;;"}
@@ -3,5 +3,5 @@
3
3
  * Copyright (c) 2025–2026 matraic
4
4
  * See LICENSE file in the project root for full license text.
5
5
  */
6
- import{__classPrivateFieldGet as t,__classPrivateFieldSet as e,__decorate as i}from"tslib";import{LitElement as a,html as o,css as n,nothing as r,unsafeCSS as s}from"lit";import{state as l,property as c,query as d}from"lit/decorators.js";import{ReconnectedCallback as m,AttachInternals as h,Role as v,setCustomState as p,DesignToken as b,customElement as u,SuppressInitialAnimation as f,LinkButton as g,Selected as y,KeyboardClick as w,Focusable as $,DisabledInteractive as x,Disabled as z,ResizeController as k,resumeAnimation as _,renderPseudoLink as S,hasAssignedNodes as C}from"@m3e/web/core";import{SelectionManager as E,selectionManager as I}from"@m3e/web/core/a11y";import{M3eBreakpointObserver as W,Breakpoint as j}from"@m3e/web/core/layout";var B,M,L,R,T,P;let U=class extends(m(h(v(a,"navigation")))){constructor(){super(...arguments),B.add(this),this[P]=(new E).disableRovingTabIndex(),M.set(this,void 0),this.mode="compact"}get items(){return this[I].items}get selected(){return this[I].selectedItems[0]??null}get currentMode(){return this._mode??("compact"!==this.mode?"expanded":"compact")}set currentMode(t){this._mode=t}disconnectedCallback(){super.disconnectedCallback(),this._mode=void 0,t(this,M,"f")?.call(this)}reconnectedCallback(){super.reconnectedCallback(),"auto"===this.mode&&t(this,B,"m",L).call(this)}willUpdate(e){super.willUpdate(e),e.has("mode")&&(t(this,M,"f")?.call(this),"auto"===this.mode?t(this,B,"m",L).call(this):(this._mode=void 0,this._updateItems())),e.has("_mode")&&this._updateItems()}render(){return o`<div class="base"><slot @change="${t(this,B,"m",T)}" @slotchange="${t(this,B,"m",R)}"></slot></div>`}_updateItems(){const t="compact"===this.currentMode?"vertical":"horizontal";this._updateOrientation(t),p(this,"--compact","vertical"===t)}_updateOrientation(t){this[I].items.forEach(e=>e.orientation=t)}};var Y,A,q,O,V,X,F,G;M=new WeakMap,B=new WeakSet,P=I,L=function(){e(this,M,W.observe([j.XSmall,j.Small],t=>{this._mode=t.get(j.XSmall)||t.get(j.Small)?"compact":"expanded",this._updateItems()}),"f")},R=function(){this[I].setItems([...this.querySelectorAll("m3e-nav-item")]),this._updateItems()},T=function(t){t.stopPropagation(),this.dispatchEvent(new Event("change",{bubbles:!0}))},U.styles=n`:host { display: block; overflow-x: auto; overflow-y: hidden; scrollbar-width: ${b.scrollbar.thinWidth}; scrollbar-color: ${b.scrollbar.color}; min-height: var(--m3e-nav-bar-height, 4rem); } .base { display: flex; align-items: stretch; justify-content: center; box-sizing: border-box; min-height: inherit; height: inherit; width: 100%; background-color: var(--m3e-nav-bar-container-color, ${b.color.surfaceContainer}); --_nav-item-min-width: var(--m3e-nav-bar-vertical-item-width, 7rem); }`,i([l()],U.prototype,"_mode",void 0),i([c({reflect:!0})],U.prototype,"mode",void 0),U=i([u("m3e-nav-bar")],U);let H=class extends(m(f(g(y(w($(x(z(h(v(a,"button"),!0)))))))))){constructor(){super(...arguments),Y.add(this),A.set(this,!1),q.set(this,e=>t(this,Y,"m",V).call(this,e)),O.set(this,new k(this,{target:null,callback:e=>t(this,Y,"m",F).call(this,e)})),this.orientation="vertical"}get navBar(){return this.closest("m3e-nav-bar")??this.closest("m3e-nav-rail")??null}[(A=new WeakMap,q=new WeakMap,O=new WeakMap,Y=new WeakSet,_)](){t(this,A,"f")&&super[_]()}connectedCallback(){e(this,A,null!==this.closest("m3e-nav-rail"),"f"),super.connectedCallback(),this.addEventListener("click",t(this,q,"f"),{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",t(this,q,"f"),{capture:!0}),e(this,A,!1,"f")}reconnectedCallback(){super.reconnectedCallback(),t(this,Y,"m",G).call(this)}update(t){if(super.update(t),t.has("selected")){this.ariaSelected=null,this.ariaPressed=null,this.ariaCurrent=`${this.selected}`;for(const t of this.querySelectorAll("m3e-icon"))t.toggleAttribute("filled",this.selected);this.navBar?.[I].notifySelectionChange(this)}}updated(t){super.updated(t),t.has("orientation")&&this._focusRing?.attach(this)}firstUpdated(e){super.firstUpdated(e),[this._focusRing,this._stateLayer,this._ripple].forEach(t=>t?.attach(this)),t(this,Y,"m",G).call(this)}render(){const e=this.disabled||this.disabledInteractive,i=o`<div class="label"><slot></slot></div>`;return o`${"vertical"===this.orientation?o`<m3e-focus-ring class="focus-ring" inward></m3e-focus-ring>`:r}<div class="outer">${this[S]()}<div class="inner">${"horizontal"===this.orientation?o`<m3e-focus-ring class="focus-ring"></m3e-focus-ring>`:r}<m3e-state-layer class="state-layer" ?disabled="${e}"></m3e-state-layer><m3e-ripple class="ripple" centered ?disabled="${e}"></m3e-ripple><div class="touch" aria-hidden="true"></div><div class="base"><div class="icon-wrapper" aria-hidden="true"><div class="icon"><slot name="icon"></slot><slot name="selected-icon" @slotchange="${t(this,Y,"m",X)}"></slot></div></div><m3e-collapsible orientation="horizontal" ?no-animate="${!t(this,A,"f")}" ?open="${"horizontal"===this.orientation}">${"horizontal"===this.orientation?i:r}</m3e-collapsible>${"horizontal"===this.orientation?r:i}</div></div></div>`}};V=function(t){t.defaultPrevented||(this.selected=!0,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0,cancelable:!0}))?(this.navBar?.[I].notifySelectionChange(this),this.dispatchEvent(new Event("change",{bubbles:!0}))):this.selected=!1)},X=function(t){p(this,"--with-selected-icon",C(t.target))},F=function(t){0!==t.length&&"vertical"!==this.orientation&&this._inner?.style.setProperty("--_expanded-width",`${t[0].contentRect.width}px`)},G=function(){this._stateLayer&&t(this,A,"f")&&t(this,O,"f").observe(this._stateLayer)},H.styles=n`:host { display: inline-block; vertical-align: middle; position: relative; outline: none; user-select: none; flex: 1; font-size: var(--m3e-nav-item-label-text-font-size, ${b.typescale.standard.label.medium.fontSize}); font-weight: var( --m3e-nav-item-label-text-font-weight, ${b.typescale.standard.label.medium.fontWeight} ); line-height: var( --m3e-nav-item-label-text-line-height, ${b.typescale.standard.label.medium.lineHeight} ); letter-spacing: var(--m3e-nav-item-label-text-tracking, ${b.typescale.standard.label.medium.tracking}); border-radius: var(--m3e-nav-item-shape, ${b.shape.corner.full}); min-width: var(--_nav-item-min-width); align-self: var(--_nav-item-align-self); -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } :host([orientation="horizontal"]) { max-width: fit-content; } :host(:not(:disabled):not([disabled-interactive])) { cursor: pointer; } :host([disabled-interactive]) { cursor: not-allowed; } .outer { height: 100%; } .outer, .inner { display: flex; align-items: center; justify-content: var(--_nav-item-justify-content, center); position: relative; border-radius: inherit; } .icon-wrapper { position: relative; flex: none; } .base { justify-content: unset; box-sizing: border-box; vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; position: relative; width: 100%; } :host(:not(:is(:state(--no-animate), :--no-animate))) .base { transition: ${s(`margin-top ${b.motion.duration.short1} ${b.motion.easing.standard}`)}; } .icon { position: absolute; } .label { vertical-align: middle; } :host([orientation="horizontal"]) .label { white-space: nowrap; } ::slotted([slot="icon"]), ::slotted([slot="selected-icon"]) { width: 1em; font-size: var(--m3e-nav-item-icon-size, 1.5rem) !important; } :host(:not(:is(:state(--no-animate), :--no-animate))) .state-layer, :host(:not(:is(:state(--no-animate), :--no-animate))) .ripple { transition: ${s(`height ${b.motion.duration.short1} ${b.motion.easing.standard}`)}; } :host(:not([selected])) slot[name="selected-icon"], :host(:not(:is(:state(--with-selected-icon), :--with-selected-icon))) slot[name="selected-icon"], :host([selected]:is(:state(--with-selected-icon), :--with-selected-icon)) slot[name="icon"] { display: none; } :host(:not([selected]):not(:disabled):not([disabled-interactive])) .outer { --m3e-state-layer-hover-color: var( --m3e-nav-item-inactive-hover-state-layer-color, ${b.color.onSecondaryContainer} ); --m3e-state-layer-focus-color: var( --m3e-nav-item-inactive-focus-state-layer-color, ${b.color.onSecondaryContainer} ); --m3e-ripple-color: var( --m3e-nav-item-inactive-pressed-state-layer-color, ${b.color.onSecondaryContainer} ); } :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label { color: var(--m3e-nav-item-inactive-label-text-color, ${b.color.onSurfaceVariant}); } :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon { color: var(--m3e-nav-item-inactive-icon-color, ${b.color.onSurfaceVariant}); } :host([selected]:not(:disabled):not([disabled-interactive])) .outer { --m3e-state-layer-hover-color: var( --m3e-nav-item-active-hover-state-layer-color, ${b.color.onSecondaryContainer} ); --m3e-state-layer-focus-color: var( --m3e-nav-item-active-focus-state-layer-color, ${b.color.onSecondaryContainer} ); --m3e-ripple-color: var( --m3e-nav-item-active-pressed-state-layer-color, ${b.color.onSecondaryContainer} ); } :host([selected]:not(:disabled):not([disabled-interactive]):not([orientation="horizontal"])) .label { color: var(--m3e-nav-item-active-label-text-color, ${b.color.secondary}); } :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer { background-color: var(--m3e-nav-item-active-container-color, ${b.color.secondaryContainer}); } :host([selected]:not(:disabled):not([disabled-interactive])[orientation="horizontal"]) .label, :host([selected]:not(:disabled):not([disabled-interactive])) .icon { color: var(--m3e-nav-item-active-icon-color, ${b.color.onSecondaryContainer}); } :host([orientation="vertical"]) .outer { align-self: stretch; align-items: flex-start; } :host([orientation="vertical"]) .label { text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-clamp: 2; } :host([orientation="vertical"]) .base { flex-direction: column; row-gap: var(--m3e-nav-item-spacing, 0.25rem); } :host([orientation="horizongal"]) .base { margin-top: 0; } :host([orientation="vertical"]) .base { margin-top: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem); margin-bottom: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem); } :host([orientation="vertical"]) .state-layer, :host([orientation="vertical"]) .ripple { top: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem); bottom: unset; } :host([orientation="vertical"]) .state-layer, :host([orientation="vertical"]) .ripple, :host([orientation="vertical"]) .icon-wrapper { width: var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem); } :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .state-layer, :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .ripple { animation: collapse ${b.motion.duration.medium1}; } @keyframes collapse { from { width: var(--_expanded-width, var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem)); } to { width: var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem); } } :host([orientation="vertical"]) .state-layer, :host([orientation="vertical"]) .ripple, :host([orientation="vertical"]) .icon-wrapper { height: var(--m3e-vertical-nav-item-active-indicator-height, 2rem); } :host([orientation="vertical"]) .icon { top: calc( calc(var(--m3e-vertical-nav-item-active-indicator-height, 2rem) / 2) - calc( var(--m3e-nav-item-icon-size, 1.5rem) / 2 ) ); left: calc( calc(var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem) / 2) - calc( var(--m3e-nav-item-icon-size, 1.5rem) / 2 ) ); } :host([orientation="vertical"]) .focus-ring { border-radius: var(--m3e-nav-item-focus-ring-shape, ${b.shape.corner.medium}); } :host([orientation="horizontal"]) .icon-wrapper { width: var(--m3e-nav-item-icon-size, 1.5rem); height: var(--m3e-nav-item-icon-size, 1.5rem); } :host([orientation="horizontal"]) .base { padding: var(--m3e-horizontal-nav-item-padding, 1rem); } :host([orientation="horizontal"]) .label { flex: 1 1 auto; } :host([orientation="horizontal"]) .base { column-gap: var(--m3e-nav-item-spacing, 0.25rem); } :host([orientation="horizontal"]) .state-layer, :host([orientation="horizontal"]) .ripple, :host([orientation="horizontal"]) .inner { height: var(--m3e-horizontal-nav-item-active-indicator-height, 2.5rem); } :host([orientation="horizontal"]) .inner { width: fit-content; } .state-layer, .ripple { margin-inline: auto; } :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation="horizontal"]) .icon-wrapper, :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .icon-wrapper { animation: ${s(`slide-down ${b.motion.duration.short2} ${b.motion.easing.standard}`)}; } :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation="horizontal"]) .icon-wrapper, :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .icon-wrapper { animation: ${s(`slide-up ${b.motion.duration.short2} ${b.motion.easing.standard}`)}; } @keyframes slide-down { from { transform: translateY(-4px); } to { transform: translateY(0); } } @keyframes slide-up { from { transform: translateY(4px); } to { transform: translateY(0); } } :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="horizontal"]) .label { animation: horizontal-fade-in ${b.motion.duration.medium1}; } :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .label { animation: vertical-fade-in ${b.motion.duration.medium1}; } @keyframes horizontal-fade-in { from { opacity: 0; } to { opacity: 1; } } @keyframes vertical-fade-in { from { opacity: 0; } to { opacity: 1; } } :host(:disabled) .label, :host([disabled-interactive]) .label { color: color-mix( in srgb, var(--m3e-nav-item-disabled-label-text-color, ${b.color.onSurface}) var(--m3e-nav-item-disabled-label-text-opacity, 38%), transparent ); } :host(:disabled) .icon, :host([disabled-interactive]) .icon { color: color-mix( in srgb, var(--m3e-nav-item-disabled-icon-color, ${b.color.onSurface}) var(--m3e-nav-item-disabled-icon-opacity, 38%), transparent ); } a { all: unset; display: block; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; z-index: 1; } @media (prefers-reduced-motion) { :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation="horizontal"]) .icon-wrapper, :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .icon-wrapper, :host( :not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation="horizontal"] ) .icon-wrapper, :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .icon-wrapper, :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .state-layer, :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .ripple, :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="horizontal"]) .label, :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .label { animation: none; } :host(:not(:is(:state(--no-animate), :--no-animate))) .state-layer, :host(:not(:is(:state(--no-animate), :--no-animate))) .ripple, :host(:not(:is(:state(--no-animate), :--no-animate))) .base { transition: none; } } @media (forced-colors: active) { :host(:disabled) .label, :host([disabled-interactive]) .label, :host(:disabled) .icon, :host([disabled-interactive]) .icon { color: GrayText; } :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label, :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon { color: ButtonText; } :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer { background-color: ButtonText; } :host([orientation="vertical"][selected]:not(:disabled):not([disabled-interactive])) .label { color: ButtonText; } :host([orientation="horizontal"][selected]:not(:disabled):not([disabled-interactive])) .label, :host([selected]:not(:disabled):not([disabled-interactive])) .icon { forced-color-adjust: none; color: ButtonFace; } }`,i([d(".focus-ring")],H.prototype,"_focusRing",void 0),i([d(".state-layer")],H.prototype,"_stateLayer",void 0),i([d(".ripple")],H.prototype,"_ripple",void 0),i([d(".inner")],H.prototype,"_inner",void 0),i([c({reflect:!0})],H.prototype,"orientation",void 0),H=i([u("m3e-nav-item")],H);export{U as M3eNavBarElement,H as M3eNavItemElement};
6
+ import{__classPrivateFieldGet as t,__classPrivateFieldSet as e,__decorate as i}from"tslib";import{LitElement as a,html as o,css as n,nothing as r,unsafeCSS as s}from"lit";import{state as l,property as c,query as d}from"lit/decorators.js";import{ReconnectedCallback as m,AttachInternals as h,Role as v,setCustomState as p,DesignToken as b,customElement as u,SuppressInitialAnimation as f,LinkButton as g,Selected as y,KeyboardClick as w,Focusable as $,DisabledInteractive as x,Disabled as z,ResizeController as k,resumeAnimation as _,renderPseudoLink as S,hasAssignedNodes as C}from"@m3e/web/core";import{SelectionManager as E,selectionManager as I}from"@m3e/web/core/a11y";import{M3eBreakpointObserver as W,Breakpoint as j}from"@m3e/web/core/layout";var B,M,L,R,T,P;let U=class extends(m(h(v(a,"navigation")))){constructor(){super(...arguments),B.add(this),this[P]=(new E).disableRovingTabIndex(),M.set(this,void 0),this.mode="compact"}get items(){return this[I].items}get selected(){return this[I].selectedItems[0]??null}get currentMode(){return this._mode??("compact"!==this.mode?"expanded":"compact")}set currentMode(t){this._mode=t}disconnectedCallback(){super.disconnectedCallback(),this._mode=void 0,t(this,M,"f")?.call(this)}reconnectedCallback(){super.reconnectedCallback(),"auto"===this.mode&&t(this,B,"m",L).call(this)}willUpdate(e){super.willUpdate(e),e.has("mode")&&(t(this,M,"f")?.call(this),"auto"===this.mode?t(this,B,"m",L).call(this):(this._mode=void 0,this._updateItems())),e.has("_mode")&&this._updateItems()}render(){return o`<div class="base"><slot @change="${t(this,B,"m",T)}" @slotchange="${t(this,B,"m",R)}"></slot></div>`}_updateItems(){const t="compact"===this.currentMode?"vertical":"horizontal";this._updateOrientation(t),p(this,"--compact","vertical"===t)}_updateOrientation(t){this[I].items.forEach(e=>e.orientation=t)}};var Y,A,q,O,V,X,F,G;M=new WeakMap,B=new WeakSet,P=I,L=function(){e(this,M,W.observe([j.XSmall,j.Small],t=>{this._mode=t.get(j.XSmall)||t.get(j.Small)?"compact":"expanded",this._updateItems()}),"f")},R=function(){this[I].setItems([...this.querySelectorAll("m3e-nav-item")]),this._updateItems()},T=function(t){t.stopPropagation(),this.dispatchEvent(new Event("change",{bubbles:!0}))},U.styles=n`:host { display: block; overflow-x: auto; overflow-y: hidden; scrollbar-width: ${b.scrollbar.thinWidth}; scrollbar-color: ${b.scrollbar.color}; min-height: var(--m3e-nav-bar-height, 4rem); } .base { display: flex; align-items: stretch; justify-content: center; box-sizing: border-box; min-height: inherit; height: inherit; width: 100%; background-color: var(--m3e-nav-bar-container-color, ${b.color.surfaceContainer}); --_nav-item-min-width: var(--m3e-nav-bar-vertical-item-width, 7rem); }`,i([l()],U.prototype,"_mode",void 0),i([c({reflect:!0})],U.prototype,"mode",void 0),U=i([u("m3e-nav-bar")],U);let H=class extends(m(f(g(y(w($(x(z(h(v(a,"button"),!0)))))))))){constructor(){super(...arguments),Y.add(this),A.set(this,!1),q.set(this,e=>t(this,Y,"m",V).call(this,e)),O.set(this,new k(this,{target:null,callback:e=>t(this,Y,"m",F).call(this,e)})),this.orientation="vertical"}get navBar(){return this.closest("m3e-nav-bar")??this.closest("m3e-nav-rail")??null}[(A=new WeakMap,q=new WeakMap,O=new WeakMap,Y=new WeakSet,_)](){t(this,A,"f")&&super[_]()}connectedCallback(){e(this,A,null!==this.closest("m3e-nav-rail"),"f"),super.connectedCallback(),this.addEventListener("click",t(this,q,"f"),{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",t(this,q,"f"),{capture:!0}),e(this,A,!1,"f")}reconnectedCallback(){super.reconnectedCallback(),t(this,Y,"m",G).call(this)}update(t){if(super.update(t),t.has("selected")){this.ariaSelected=null,this.ariaPressed=null,this.ariaCurrent=`${this.selected}`;for(const t of this.querySelectorAll("m3e-icon"))t.toggleAttribute("filled",this.selected);this.navBar?.[I].notifySelectionChange(this)}}updated(t){super.updated(t),t.has("orientation")&&this._focusRing?.attach(this)}firstUpdated(e){super.firstUpdated(e),[this._focusRing,this._stateLayer,this._ripple].forEach(t=>t?.attach(this)),t(this,Y,"m",G).call(this)}render(){const e=this.disabled||this.disabledInteractive,i=o`<div class="label"><slot></slot></div>`;return o`${"vertical"===this.orientation?o`<m3e-focus-ring class="focus-ring" inward></m3e-focus-ring>`:r}<div class="outer">${this[S]()}<div class="inner">${"horizontal"===this.orientation?o`<m3e-focus-ring class="focus-ring"></m3e-focus-ring>`:r}<m3e-state-layer class="state-layer" ?disabled="${e}"></m3e-state-layer><m3e-ripple class="ripple" centered ?disabled="${e}"></m3e-ripple><div class="touch" aria-hidden="true"></div><div class="base"><div class="icon-wrapper" aria-hidden="true"><div class="icon"><slot name="icon"></slot><slot name="selected-icon" @slotchange="${t(this,Y,"m",X)}"></slot></div></div><m3e-collapsible orientation="horizontal" ?no-animate="${!t(this,A,"f")}" ?open="${"horizontal"===this.orientation}">${"horizontal"===this.orientation?i:r}</m3e-collapsible>${"horizontal"===this.orientation?r:i}</div></div></div>`}};V=function(t){t.defaultPrevented||this.dispatchEvent(new Event("beforeinput",{bubbles:!0,cancelable:!0}))&&(this.selected=!0,this.navBar?.[I].notifySelectionChange(this),this.dispatchEvent(new Event("input",{bubbles:!0})),this.dispatchEvent(new Event("change",{bubbles:!0})))},X=function(t){p(this,"--with-selected-icon",C(t.target))},F=function(t){0!==t.length&&"vertical"!==this.orientation&&this._inner?.style.setProperty("--_expanded-width",`${t[0].contentRect.width}px`)},G=function(){this._stateLayer&&t(this,A,"f")&&t(this,O,"f").observe(this._stateLayer)},H.styles=n`:host { display: inline-block; vertical-align: middle; position: relative; outline: none; user-select: none; flex: 1; font-size: var(--m3e-nav-item-label-text-font-size, ${b.typescale.standard.label.medium.fontSize}); font-weight: var( --m3e-nav-item-label-text-font-weight, ${b.typescale.standard.label.medium.fontWeight} ); line-height: var( --m3e-nav-item-label-text-line-height, ${b.typescale.standard.label.medium.lineHeight} ); letter-spacing: var(--m3e-nav-item-label-text-tracking, ${b.typescale.standard.label.medium.tracking}); border-radius: var(--m3e-nav-item-shape, ${b.shape.corner.full}); min-width: var(--_nav-item-min-width); align-self: var(--_nav-item-align-self); -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } :host([orientation="horizontal"]) { max-width: fit-content; } :host(:not(:disabled):not([disabled-interactive])) { cursor: pointer; } :host([disabled-interactive]) { cursor: not-allowed; } .outer { height: 100%; } .outer, .inner { display: flex; align-items: center; justify-content: var(--_nav-item-justify-content, center); position: relative; border-radius: inherit; } .icon-wrapper { position: relative; flex: none; } .base { justify-content: unset; box-sizing: border-box; vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; position: relative; width: 100%; } :host(:not(:is(:state(--no-animate), :--no-animate))) .base { transition: ${s(`margin-top ${b.motion.duration.short1} ${b.motion.easing.standard}`)}; } .icon { position: absolute; } .label { vertical-align: middle; } :host([orientation="horizontal"]) .label { white-space: nowrap; } ::slotted([slot="icon"]), ::slotted([slot="selected-icon"]) { width: 1em; font-size: var(--m3e-nav-item-icon-size, 1.5rem) !important; } :host(:not(:is(:state(--no-animate), :--no-animate))) .state-layer, :host(:not(:is(:state(--no-animate), :--no-animate))) .ripple { transition: ${s(`height ${b.motion.duration.short1} ${b.motion.easing.standard}`)}; } :host(:not([selected])) slot[name="selected-icon"], :host(:not(:is(:state(--with-selected-icon), :--with-selected-icon))) slot[name="selected-icon"], :host([selected]:is(:state(--with-selected-icon), :--with-selected-icon)) slot[name="icon"] { display: none; } :host(:not([selected]):not(:disabled):not([disabled-interactive])) .outer { --m3e-state-layer-hover-color: var( --m3e-nav-item-inactive-hover-state-layer-color, ${b.color.onSecondaryContainer} ); --m3e-state-layer-focus-color: var( --m3e-nav-item-inactive-focus-state-layer-color, ${b.color.onSecondaryContainer} ); --m3e-ripple-color: var( --m3e-nav-item-inactive-pressed-state-layer-color, ${b.color.onSecondaryContainer} ); } :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label { color: var(--m3e-nav-item-inactive-label-text-color, ${b.color.onSurfaceVariant}); } :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon { color: var(--m3e-nav-item-inactive-icon-color, ${b.color.onSurfaceVariant}); } :host([selected]:not(:disabled):not([disabled-interactive])) .outer { --m3e-state-layer-hover-color: var( --m3e-nav-item-active-hover-state-layer-color, ${b.color.onSecondaryContainer} ); --m3e-state-layer-focus-color: var( --m3e-nav-item-active-focus-state-layer-color, ${b.color.onSecondaryContainer} ); --m3e-ripple-color: var( --m3e-nav-item-active-pressed-state-layer-color, ${b.color.onSecondaryContainer} ); } :host([selected]:not(:disabled):not([disabled-interactive]):not([orientation="horizontal"])) .label { color: var(--m3e-nav-item-active-label-text-color, ${b.color.secondary}); } :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer { background-color: var(--m3e-nav-item-active-container-color, ${b.color.secondaryContainer}); } :host([selected]:not(:disabled):not([disabled-interactive])[orientation="horizontal"]) .label, :host([selected]:not(:disabled):not([disabled-interactive])) .icon { color: var(--m3e-nav-item-active-icon-color, ${b.color.onSecondaryContainer}); } :host([orientation="vertical"]) .outer { align-self: stretch; align-items: flex-start; } :host([orientation="vertical"]) .label { text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-clamp: 2; } :host([orientation="vertical"]) .base { flex-direction: column; row-gap: var(--m3e-nav-item-spacing, 0.25rem); } :host([orientation="horizongal"]) .base { margin-top: 0; } :host([orientation="vertical"]) .base { margin-top: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem); margin-bottom: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem); } :host([orientation="vertical"]) .state-layer, :host([orientation="vertical"]) .ripple { top: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem); bottom: unset; } :host([orientation="vertical"]) .state-layer, :host([orientation="vertical"]) .ripple, :host([orientation="vertical"]) .icon-wrapper { width: var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem); } :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .state-layer, :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .ripple { animation: collapse ${b.motion.duration.medium1}; } @keyframes collapse { from { width: var(--_expanded-width, var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem)); } to { width: var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem); } } :host([orientation="vertical"]) .state-layer, :host([orientation="vertical"]) .ripple, :host([orientation="vertical"]) .icon-wrapper { height: var(--m3e-vertical-nav-item-active-indicator-height, 2rem); } :host([orientation="vertical"]) .icon { top: calc( calc(var(--m3e-vertical-nav-item-active-indicator-height, 2rem) / 2) - calc( var(--m3e-nav-item-icon-size, 1.5rem) / 2 ) ); left: calc( calc(var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem) / 2) - calc( var(--m3e-nav-item-icon-size, 1.5rem) / 2 ) ); } :host([orientation="vertical"]) .focus-ring { border-radius: var(--m3e-nav-item-focus-ring-shape, ${b.shape.corner.medium}); } :host([orientation="horizontal"]) .icon-wrapper { width: var(--m3e-nav-item-icon-size, 1.5rem); height: var(--m3e-nav-item-icon-size, 1.5rem); } :host([orientation="horizontal"]) .base { padding: var(--m3e-horizontal-nav-item-padding, 1rem); } :host([orientation="horizontal"]) .label { flex: 1 1 auto; } :host([orientation="horizontal"]) .base { column-gap: var(--m3e-nav-item-spacing, 0.25rem); } :host([orientation="horizontal"]) .state-layer, :host([orientation="horizontal"]) .ripple, :host([orientation="horizontal"]) .inner { height: var(--m3e-horizontal-nav-item-active-indicator-height, 2.5rem); } :host([orientation="horizontal"]) .inner { width: fit-content; } .state-layer, .ripple { margin-inline: auto; } :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation="horizontal"]) .icon-wrapper, :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .icon-wrapper { animation: ${s(`slide-down ${b.motion.duration.short2} ${b.motion.easing.standard}`)}; } :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation="horizontal"]) .icon-wrapper, :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .icon-wrapper { animation: ${s(`slide-up ${b.motion.duration.short2} ${b.motion.easing.standard}`)}; } @keyframes slide-down { from { transform: translateY(-4px); } to { transform: translateY(0); } } @keyframes slide-up { from { transform: translateY(4px); } to { transform: translateY(0); } } :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="horizontal"]) .label { animation: horizontal-fade-in ${b.motion.duration.medium1}; } :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .label { animation: vertical-fade-in ${b.motion.duration.medium1}; } @keyframes horizontal-fade-in { from { opacity: 0; } to { opacity: 1; } } @keyframes vertical-fade-in { from { opacity: 0; } to { opacity: 1; } } :host(:disabled) .label, :host([disabled-interactive]) .label { color: color-mix( in srgb, var(--m3e-nav-item-disabled-label-text-color, ${b.color.onSurface}) var(--m3e-nav-item-disabled-label-text-opacity, 38%), transparent ); } :host(:disabled) .icon, :host([disabled-interactive]) .icon { color: color-mix( in srgb, var(--m3e-nav-item-disabled-icon-color, ${b.color.onSurface}) var(--m3e-nav-item-disabled-icon-opacity, 38%), transparent ); } a { all: unset; display: block; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; z-index: 1; } @media (prefers-reduced-motion) { :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation="horizontal"]) .icon-wrapper, :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .icon-wrapper, :host( :not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation="horizontal"] ) .icon-wrapper, :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .icon-wrapper, :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .state-layer, :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .ripple, :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="horizontal"]) .label, :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .label { animation: none; } :host(:not(:is(:state(--no-animate), :--no-animate))) .state-layer, :host(:not(:is(:state(--no-animate), :--no-animate))) .ripple, :host(:not(:is(:state(--no-animate), :--no-animate))) .base { transition: none; } } @media (forced-colors: active) { :host(:disabled) .label, :host([disabled-interactive]) .label, :host(:disabled) .icon, :host([disabled-interactive]) .icon { color: GrayText; } :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label, :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon { color: ButtonText; } :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer { background-color: ButtonText; } :host([orientation="vertical"][selected]:not(:disabled):not([disabled-interactive])) .label { color: ButtonText; } :host([orientation="horizontal"][selected]:not(:disabled):not([disabled-interactive])) .label, :host([selected]:not(:disabled):not([disabled-interactive])) .icon { forced-color-adjust: none; color: ButtonFace; } }`,i([d(".focus-ring")],H.prototype,"_focusRing",void 0),i([d(".state-layer")],H.prototype,"_stateLayer",void 0),i([d(".ripple")],H.prototype,"_ripple",void 0),i([d(".inner")],H.prototype,"_inner",void 0),i([c({reflect:!0})],H.prototype,"orientation",void 0),H=i([u("m3e-nav-item")],H);export{U as M3eNavBarElement,H as M3eNavItemElement};
7
7
  //# sourceMappingURL=nav-bar.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nav-bar.min.js","sources":["../../src/nav-bar/NavBarElement.ts","../../src/nav-bar/NavItemElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement, PropertyValues } from \"lit\";\r\nimport { property, state } from \"lit/decorators.js\";\r\n\r\nimport { AttachInternals, customElement, DesignToken, ReconnectedCallback, Role, setCustomState } from \"@m3e/web/core\";\r\n\r\nimport { SelectionManager, selectionManager } from \"@m3e/web/core/a11y\";\r\nimport { Breakpoint, M3eBreakpointObserver } from \"@m3e/web/core/layout\";\r\n\r\nimport { M3eNavItemElement } from \"./NavItemElement\";\r\nimport { NavItemOrientation } from \"./NavItemOrientation\";\r\nimport { NavBarMode } from \"./NavBarMode\";\r\n\r\n/**\r\n * A horizontal bar, typically used on smaller devices, that allows a user to switch between 3-5 views.\r\n *\r\n * @description\r\n * The `m3e-nav-bar` component provides a horizontal navigation bar for switching between primary destinations in\r\n * an application. Designed for smaller devices, it supports 3-5 interactive items, orientation, and theming\r\n * via CSS custom properties.\r\n *\r\n * @example\r\n * The following example illustrates a nav bar with vertically oriented items.\r\n * ```html\r\n * <m3e-nav-bar>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"news\"></m3e-icon>News</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"globe\"></m3e-icon>Global</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"star\"></m3e-icon>For you</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"newsstand\"></m3e-icon>Trending</m3e-nav-item>\r\n * </m3e-nav-bar>\r\n * ```\r\n *\r\n * @tag m3e-nav-bar\r\n *\r\n * @slot - Renders the items of the bar.\r\n *\r\n * @attr mode - The mode in which items in the bar are presented.\r\n *\r\n * @fires change - Emitted when the selected state of an item changes.\r\n *\r\n * @cssprop --m3e-nav-bar-height - Height of the navigation bar.\r\n * @cssprop --m3e-nav-bar-container-color - Background color of the navigation bar container.\r\n * @cssprop --m3e-nav-bar-vertical-item-width - Minimum width of vertical nav items.\r\n */\r\n@customElement(\"m3e-nav-bar\")\r\nexport class M3eNavBarElement extends ReconnectedCallback(AttachInternals(Role(LitElement, \"navigation\"))) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n overflow-x: auto;\r\n overflow-y: hidden;\r\n scrollbar-width: ${DesignToken.scrollbar.thinWidth};\r\n scrollbar-color: ${DesignToken.scrollbar.color};\r\n min-height: var(--m3e-nav-bar-height, 4rem);\r\n }\r\n .base {\r\n display: flex;\r\n align-items: stretch;\r\n justify-content: center;\r\n box-sizing: border-box;\r\n min-height: inherit;\r\n height: inherit;\r\n width: 100%;\r\n background-color: var(--m3e-nav-bar-container-color, ${DesignToken.color.surfaceContainer});\r\n --_nav-item-min-width: var(--m3e-nav-bar-vertical-item-width, 7rem);\r\n }\r\n `;\r\n\r\n /** @internal */ readonly [selectionManager] = new SelectionManager<M3eNavItemElement>().disableRovingTabIndex();\r\n /** @private */ #breakpointUnobserve?: () => void;\r\n /** @private */ @state() private _mode?: Exclude<NavBarMode, \"auto\">;\r\n\r\n /**\r\n * The mode in which items in the bar are presented.\r\n * @default \"compact\"\r\n */\r\n @property({ reflect: true }) mode: NavBarMode = \"compact\";\r\n\r\n /** The items of the bar. */\r\n get items(): readonly M3eNavItemElement[] {\r\n return this[selectionManager].items;\r\n }\r\n\r\n /** The selected item. */\r\n get selected(): M3eNavItemElement | null {\r\n return this[selectionManager].selectedItems[0] ?? null;\r\n }\r\n\r\n /** The current mode applied to the bar. */\r\n get currentMode(): Exclude<NavBarMode, \"auto\"> {\r\n return this._mode ?? (this.mode !== \"compact\" ? \"expanded\" : \"compact\");\r\n }\r\n set currentMode(value: Exclude<NavBarMode, \"auto\">) {\r\n this._mode = value;\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this._mode = undefined;\r\n this.#breakpointUnobserve?.();\r\n }\r\n\r\n /** @inheritdoc */\r\n override reconnectedCallback(): void {\r\n super.reconnectedCallback();\r\n\r\n if (this.mode === \"auto\") {\r\n this.#initBreakpointMonitoring();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override willUpdate(changedProperties: PropertyValues): void {\r\n super.willUpdate(changedProperties);\r\n\r\n if (changedProperties.has(\"mode\")) {\r\n this.#breakpointUnobserve?.();\r\n\r\n if (this.mode === \"auto\") {\r\n this.#initBreakpointMonitoring();\r\n } else {\r\n this._mode = undefined;\r\n this._updateItems();\r\n }\r\n }\r\n if (changedProperties.has(\"_mode\")) {\r\n this._updateItems();\r\n }\r\n }\r\n\r\n /** @private */\r\n #initBreakpointMonitoring(): void {\r\n this.#breakpointUnobserve = M3eBreakpointObserver.observe([Breakpoint.XSmall, Breakpoint.Small], (matches) => {\r\n this._mode = matches.get(Breakpoint.XSmall) || matches.get(Breakpoint.Small) ? \"compact\" : \"expanded\";\r\n this._updateItems();\r\n });\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\">\r\n <slot @change=\"${this.#handleChange}\" @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(): void {\r\n this[selectionManager].setItems([...this.querySelectorAll(\"m3e-nav-item\")]);\r\n this._updateItems();\r\n }\r\n\r\n /** @private */\r\n #handleChange(e: Event): void {\r\n e.stopPropagation();\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n }\r\n\r\n /** @internal */\r\n protected _updateItems(): void {\r\n const orientation: NavItemOrientation = this.currentMode === \"compact\" ? \"vertical\" : \"horizontal\";\r\n this._updateOrientation(orientation);\r\n setCustomState(this, \"--compact\", orientation === \"vertical\");\r\n }\r\n\r\n /** @internal */\r\n protected _updateOrientation(orientation: NavItemOrientation): void {\r\n this[selectionManager].items.forEach((x) => (x.orientation = orientation));\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-nav-bar\": M3eNavBarElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues, unsafeCSS } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n DisabledInteractive,\r\n Focusable,\r\n hasAssignedNodes,\r\n KeyboardClick,\r\n LinkButton,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n ReconnectedCallback,\r\n renderPseudoLink,\r\n ResizeController,\r\n resumeAnimation,\r\n Role,\r\n Selected,\r\n setCustomState,\r\n SuppressInitialAnimation,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { selectionManager } from \"@m3e/web/core/a11y\";\r\n\r\nimport type { M3eNavBarElement } from \"./NavBarElement\";\r\nimport { NavItemOrientation } from \"./NavItemOrientation\";\r\n\r\n/**\r\n * An item, placed in a navigation bar or rail, used to navigate to destinations in an application.\r\n *\r\n * @description\r\n * The `m3e-nav-item` component represents an interactive navigation item for use in navigation bars\r\n * or rails. Designed according to Material 3 principles, it supports icon and label slots, selection state,\r\n * orientation, and extensive theming via CSS custom properties.\r\n *\r\n * @example\r\n * The following example illustrates a nav bar with vertically oriented items.\r\n * ```html\r\n * <m3e-nav-bar>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"news\"></m3e-icon>News</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"globe\"></m3e-icon>Global</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"star\"></m3e-icon>For you</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"newsstand\"></m3e-icon>Trending</m3e-nav-item>\r\n * </m3e-nav-bar>\r\n * ```\r\n *\r\n * @tag m3e-nav-item\r\n *\r\n * @slot - Renders the label of the item.\r\n * @slot icon - Renders the icon of the item.\r\n * @slot selected-icon - Renders the icon of the item when selected.\r\n *\r\n * @attr disabled - A value indicating whether the element is disabled.\r\n * @attr disabled-interactive - A value indicating whether the element is disabled and interactive.\r\n * @attr download - A value indicating whether the `target` of the link button will be downloaded, optionally specifying the new name of the file.\r\n * @attr href - The URL to which the link button points.\r\n * @attr orientation - The layout orientation of the item.\r\n * @attr rel - The relationship between the `target` of the link button and the document.\r\n * @attr selected - A value indicating whether the element is selected.\r\n * @attr target - The target of the link button.\r\n *\r\n * @fires input - Emitted when the selected state changes.\r\n * @fires change - Emitted when the selected state changes.\r\n * @fires click - Emitted when the element is clicked.\r\n *\r\n * @cssprop --m3e-nav-item-label-text-font-size - Font size for the label text.\r\n * @cssprop --m3e-nav-item-label-text-font-weight - Font weight for the label text.\r\n * @cssprop --m3e-nav-item-label-text-line-height - Line height for the label text.\r\n * @cssprop --m3e-nav-item-label-text-tracking - Letter spacing for the label text.\r\n * @cssprop --m3e-nav-item-shape - Border radius of the nav item.\r\n * @cssprop --m3e-nav-item-icon-size - Size of the icon.\r\n * @cssprop --m3e-nav-item-spacing - Spacing between icon and label.\r\n * @cssprop --m3e-nav-item-inactive-label-text-color - Color of the label text when inactive.\r\n * @cssprop --m3e-nav-item-inactive-icon-color - Color of the icon when inactive.\r\n * @cssprop --m3e-nav-item-inactive-hover-state-layer-color - State layer color on hover when inactive.\r\n * @cssprop --m3e-nav-item-inactive-focus-state-layer-color - State layer color on focus when inactive.\r\n * @cssprop --m3e-nav-item-inactive-pressed-state-layer-color - State layer color on press when inactive.\r\n * @cssprop --m3e-nav-item-active-label-text-color - Color of the label text when active/selected.\r\n * @cssprop --m3e-nav-item-active-icon-color - Color of the icon when active/selected.\r\n * @cssprop --m3e-nav-item-active-container-color - Container color when active/selected.\r\n * @cssprop --m3e-nav-item-active-hover-state-layer-color - State layer color on hover when active.\r\n * @cssprop --m3e-nav-item-active-focus-state-layer-color - State layer color on focus when active.\r\n * @cssprop --m3e-nav-item-active-pressed-state-layer-color - State layer color on press when active.\r\n * @cssprop --m3e-nav-item-focus-ring-shape - Border radius for the focus ring.\r\n * @cssprop --m3e-nav-item-disabled-label-text-color - Color of the label text when disabled.\r\n * @cssprop --m3e-nav-item-disabled-label-text-opacity - Opacity of the label text when disabled.\r\n * @cssprop --m3e-nav-item-disabled-icon-color - Color of the icon when disabled.\r\n * @cssprop --m3e-nav-item-disabled-icon-opacity - Opacity of the icon when disabled.\r\n * @cssprop --m3e-horizontal-nav-item-padding - Padding for horizontal orientation.\r\n * @cssprop --m3e-horizontal-nav-item-active-indicator-height - Height of the active indicator in horizontal orientation.\r\n * @cssprop --m3e-vertical-nav-item-active-indicator-width - Width of the active indicator in vertical orientation.\r\n * @cssprop --m3e-vertical-nav-item-active-indicator-height - Height of the active indicator in vertical orientation.\r\n * @cssprop --m3e-vertical-nav-item-active-indicator-margin - Margin for the active indicator in vertical orientation.\r\n */\r\n@customElement(\"m3e-nav-item\")\r\nexport class M3eNavItemElement extends ReconnectedCallback(\r\n SuppressInitialAnimation(\r\n LinkButton(\r\n Selected(\r\n KeyboardClick(Focusable(DisabledInteractive(Disabled(AttachInternals(Role(LitElement, \"button\"), true))))),\r\n ),\r\n ),\r\n ),\r\n) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: inline-block;\r\n vertical-align: middle;\r\n position: relative;\r\n outline: none;\r\n user-select: none;\r\n flex: 1;\r\n font-size: var(--m3e-nav-item-label-text-font-size, ${DesignToken.typescale.standard.label.medium.fontSize});\r\n font-weight: var(\r\n --m3e-nav-item-label-text-font-weight,\r\n ${DesignToken.typescale.standard.label.medium.fontWeight}\r\n );\r\n line-height: var(\r\n --m3e-nav-item-label-text-line-height,\r\n ${DesignToken.typescale.standard.label.medium.lineHeight}\r\n );\r\n letter-spacing: var(--m3e-nav-item-label-text-tracking, ${DesignToken.typescale.standard.label.medium.tracking});\r\n border-radius: var(--m3e-nav-item-shape, ${DesignToken.shape.corner.full});\r\n min-width: var(--_nav-item-min-width);\r\n align-self: var(--_nav-item-align-self);\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n :host([orientation=\"horizontal\"]) {\r\n max-width: fit-content;\r\n }\r\n :host(:not(:disabled):not([disabled-interactive])) {\r\n cursor: pointer;\r\n }\r\n :host([disabled-interactive]) {\r\n cursor: not-allowed;\r\n }\r\n .outer {\r\n height: 100%;\r\n }\r\n .outer,\r\n .inner {\r\n display: flex;\r\n align-items: center;\r\n justify-content: var(--_nav-item-justify-content, center);\r\n position: relative;\r\n border-radius: inherit;\r\n }\r\n .icon-wrapper {\r\n position: relative;\r\n flex: none;\r\n }\r\n .base {\r\n justify-content: unset;\r\n box-sizing: border-box;\r\n vertical-align: middle;\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n width: 100%;\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .base {\r\n transition: ${unsafeCSS(\r\n `margin-top ${DesignToken.motion.duration.short1} ${DesignToken.motion.easing.standard}`,\r\n )};\r\n }\r\n .icon {\r\n position: absolute;\r\n }\r\n .label {\r\n vertical-align: middle;\r\n }\r\n :host([orientation=\"horizontal\"]) .label {\r\n white-space: nowrap;\r\n }\r\n ::slotted([slot=\"icon\"]),\r\n ::slotted([slot=\"selected-icon\"]) {\r\n width: 1em;\r\n font-size: var(--m3e-nav-item-icon-size, 1.5rem) !important;\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .ripple {\r\n transition: ${unsafeCSS(`height ${DesignToken.motion.duration.short1} ${DesignToken.motion.easing.standard}`)};\r\n }\r\n :host(:not([selected])) slot[name=\"selected-icon\"],\r\n :host(:not(:is(:state(--with-selected-icon), :--with-selected-icon))) slot[name=\"selected-icon\"],\r\n :host([selected]:is(:state(--with-selected-icon), :--with-selected-icon)) slot[name=\"icon\"] {\r\n display: none;\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .outer {\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-nav-item-inactive-hover-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-nav-item-inactive-focus-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-ripple-color: var(\r\n --m3e-nav-item-inactive-pressed-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label {\r\n color: var(--m3e-nav-item-inactive-label-text-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon {\r\n color: var(--m3e-nav-item-inactive-icon-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .outer {\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-nav-item-active-hover-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-nav-item-active-focus-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-ripple-color: var(\r\n --m3e-nav-item-active-pressed-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive]):not([orientation=\"horizontal\"])) .label {\r\n color: var(--m3e-nav-item-active-label-text-color, ${DesignToken.color.secondary});\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer {\r\n background-color: var(--m3e-nav-item-active-container-color, ${DesignToken.color.secondaryContainer});\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])[orientation=\"horizontal\"]) .label,\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .icon {\r\n color: var(--m3e-nav-item-active-icon-color, ${DesignToken.color.onSecondaryContainer});\r\n }\r\n :host([orientation=\"vertical\"]) .outer {\r\n align-self: stretch;\r\n align-items: flex-start;\r\n }\r\n :host([orientation=\"vertical\"]) .label {\r\n text-align: center;\r\n display: -webkit-box;\r\n -webkit-line-clamp: 2;\r\n -webkit-box-orient: vertical;\r\n overflow: hidden;\r\n line-clamp: 2;\r\n }\r\n :host([orientation=\"vertical\"]) .base {\r\n flex-direction: column;\r\n row-gap: var(--m3e-nav-item-spacing, 0.25rem);\r\n }\r\n :host([orientation=\"horizongal\"]) .base {\r\n margin-top: 0;\r\n }\r\n :host([orientation=\"vertical\"]) .base {\r\n margin-top: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem);\r\n margin-bottom: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem);\r\n }\r\n :host([orientation=\"vertical\"]) .state-layer,\r\n :host([orientation=\"vertical\"]) .ripple {\r\n top: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem);\r\n bottom: unset;\r\n }\r\n :host([orientation=\"vertical\"]) .state-layer,\r\n :host([orientation=\"vertical\"]) .ripple,\r\n :host([orientation=\"vertical\"]) .icon-wrapper {\r\n width: var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem);\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .ripple {\r\n animation: collapse ${DesignToken.motion.duration.medium1};\r\n }\r\n @keyframes collapse {\r\n from {\r\n width: var(--_expanded-width, var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem));\r\n }\r\n to {\r\n width: var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem);\r\n }\r\n }\r\n\r\n :host([orientation=\"vertical\"]) .state-layer,\r\n :host([orientation=\"vertical\"]) .ripple,\r\n :host([orientation=\"vertical\"]) .icon-wrapper {\r\n height: var(--m3e-vertical-nav-item-active-indicator-height, 2rem);\r\n }\r\n :host([orientation=\"vertical\"]) .icon {\r\n top: calc(\r\n calc(var(--m3e-vertical-nav-item-active-indicator-height, 2rem) / 2) - calc(\r\n var(--m3e-nav-item-icon-size, 1.5rem) / 2\r\n )\r\n );\r\n left: calc(\r\n calc(var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem) / 2) - calc(\r\n var(--m3e-nav-item-icon-size, 1.5rem) / 2\r\n )\r\n );\r\n }\r\n :host([orientation=\"vertical\"]) .focus-ring {\r\n border-radius: var(--m3e-nav-item-focus-ring-shape, ${DesignToken.shape.corner.medium});\r\n }\r\n :host([orientation=\"horizontal\"]) .icon-wrapper {\r\n width: var(--m3e-nav-item-icon-size, 1.5rem);\r\n height: var(--m3e-nav-item-icon-size, 1.5rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .base {\r\n padding: var(--m3e-horizontal-nav-item-padding, 1rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .label {\r\n flex: 1 1 auto;\r\n }\r\n :host([orientation=\"horizontal\"]) .base {\r\n column-gap: var(--m3e-nav-item-spacing, 0.25rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .state-layer,\r\n :host([orientation=\"horizontal\"]) .ripple,\r\n :host([orientation=\"horizontal\"]) .inner {\r\n height: var(--m3e-horizontal-nav-item-active-indicator-height, 2.5rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .inner {\r\n width: fit-content;\r\n }\r\n .state-layer,\r\n .ripple {\r\n margin-inline: auto;\r\n }\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"])\r\n .icon-wrapper,\r\n :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper {\r\n animation: ${unsafeCSS(`slide-down ${DesignToken.motion.duration.short2} ${DesignToken.motion.easing.standard}`)};\r\n }\r\n :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"])\r\n .icon-wrapper,\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper {\r\n animation: ${unsafeCSS(`slide-up ${DesignToken.motion.duration.short2} ${DesignToken.motion.easing.standard}`)};\r\n }\r\n @keyframes slide-down {\r\n from {\r\n transform: translateY(-4px);\r\n }\r\n to {\r\n transform: translateY(0);\r\n }\r\n }\r\n @keyframes slide-up {\r\n from {\r\n transform: translateY(4px);\r\n }\r\n to {\r\n transform: translateY(0);\r\n }\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"]) .label {\r\n animation: horizontal-fade-in ${DesignToken.motion.duration.medium1};\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .label {\r\n animation: vertical-fade-in ${DesignToken.motion.duration.medium1};\r\n }\r\n @keyframes horizontal-fade-in {\r\n from {\r\n opacity: 0;\r\n }\r\n to {\r\n opacity: 1;\r\n }\r\n }\r\n @keyframes vertical-fade-in {\r\n from {\r\n opacity: 0;\r\n }\r\n to {\r\n opacity: 1;\r\n }\r\n }\r\n :host(:disabled) .label,\r\n :host([disabled-interactive]) .label {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-nav-item-disabled-label-text-color, ${DesignToken.color.onSurface})\r\n var(--m3e-nav-item-disabled-label-text-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n :host(:disabled) .icon,\r\n :host([disabled-interactive]) .icon {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-nav-item-disabled-icon-color, ${DesignToken.color.onSurface})\r\n var(--m3e-nav-item-disabled-icon-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n a {\r\n all: unset;\r\n display: block;\r\n position: absolute;\r\n top: 0px;\r\n left: 0px;\r\n right: 0px;\r\n bottom: 0px;\r\n z-index: 1;\r\n }\r\n @media (prefers-reduced-motion) {\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"])\r\n .icon-wrapper,\r\n :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper,\r\n :host(\r\n :not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"]\r\n )\r\n .icon-wrapper,\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .ripple,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"]) .label,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .label {\r\n animation: none;\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .ripple,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .base {\r\n transition: none;\r\n }\r\n }\r\n @media (forced-colors: active) {\r\n :host(:disabled) .label,\r\n :host([disabled-interactive]) .label,\r\n :host(:disabled) .icon,\r\n :host([disabled-interactive]) .icon {\r\n color: GrayText;\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label,\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon {\r\n color: ButtonText;\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer {\r\n background-color: ButtonText;\r\n }\r\n :host([orientation=\"vertical\"][selected]:not(:disabled):not([disabled-interactive])) .label {\r\n color: ButtonText;\r\n }\r\n :host([orientation=\"horizontal\"][selected]:not(:disabled):not([disabled-interactive])) .label,\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .icon {\r\n forced-color-adjust: none;\r\n color: ButtonFace;\r\n }\r\n }\r\n `;\r\n\r\n /** @private */ #inRail = false;\r\n /** @private */ readonly #clickHandler = (e: Event) => this.#handleClick(e);\r\n /** @private */ @query(\".focus-ring\") private readonly _focusRing?: M3eFocusRingElement;\r\n /** @private */ @query(\".state-layer\") private readonly _stateLayer?: M3eStateLayerElement;\r\n /** @private */ @query(\".ripple\") private readonly _ripple?: M3eRippleElement;\r\n /** @private */ @query(\".inner\") private readonly _inner?: HTMLElement;\r\n\r\n /** @private */ readonly #resizeController = new ResizeController(this, {\r\n target: null,\r\n callback: (entries) => this.#handleStateLayerResize(entries),\r\n });\r\n\r\n /**\r\n * The layout orientation of the item.\r\n * @default \"vertical\"\r\n */\r\n @property({ reflect: true }) orientation: NavItemOrientation = \"vertical\";\r\n\r\n /** The navigation bar to which this item belongs. */\r\n get navBar(): M3eNavBarElement | null {\r\n return this.closest(\"m3e-nav-bar\") ?? this.closest(\"m3e-nav-rail\") ?? null;\r\n }\r\n\r\n /** @internal */\r\n override [resumeAnimation](): void {\r\n if (this.#inRail) {\r\n super[resumeAnimation]();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n this.#inRail = this.closest(\"m3e-nav-rail\") !== null;\r\n super.connectedCallback();\r\n this.addEventListener(\"click\", this.#clickHandler, { capture: true });\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n this.removeEventListener(\"click\", this.#clickHandler, { capture: true });\r\n this.#inRail = false;\r\n }\r\n\r\n /** @inheritdoc */\r\n override reconnectedCallback(): void {\r\n super.reconnectedCallback();\r\n this.#initResizeObserver();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override update(changedProperties: PropertyValues<this>): void {\r\n super.update(changedProperties);\r\n\r\n if (changedProperties.has(\"selected\")) {\r\n this.ariaSelected = null;\r\n this.ariaPressed = null;\r\n this.ariaCurrent = `${this.selected}`;\r\n for (const icon of this.querySelectorAll(\"m3e-icon\")) {\r\n icon.toggleAttribute(\"filled\", this.selected);\r\n }\r\n this.navBar?.[selectionManager].notifySelectionChange(this);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n\r\n if (_changedProperties.has(\"orientation\")) {\r\n this._focusRing?.attach(this);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override firstUpdated(_changedProperties: PropertyValues<this>): void {\r\n super.firstUpdated(_changedProperties);\r\n [this._focusRing, this._stateLayer, this._ripple].forEach((x) => x?.attach(this));\r\n this.#initResizeObserver();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n const disabled = this.disabled || this.disabledInteractive;\r\n const label = html`<div class=\"label\"><slot></slot></div>`;\r\n return html`${this.orientation === \"vertical\"\r\n ? html`<m3e-focus-ring class=\"focus-ring\" inward></m3e-focus-ring>`\r\n : nothing}\r\n <div class=\"outer\">\r\n ${this[renderPseudoLink]()}\r\n <div class=\"inner\">\r\n ${this.orientation === \"horizontal\" ? html`<m3e-focus-ring class=\"focus-ring\"></m3e-focus-ring>` : nothing}\r\n <m3e-state-layer class=\"state-layer\" ?disabled=\"${disabled}\"></m3e-state-layer>\r\n <m3e-ripple class=\"ripple\" centered ?disabled=\"${disabled}\"></m3e-ripple>\r\n <div class=\"touch\" aria-hidden=\"true\"></div>\r\n <div class=\"base\">\r\n <div class=\"icon-wrapper\" aria-hidden=\"true\">\r\n <div class=\"icon\">\r\n <slot name=\"icon\"></slot>\r\n <slot name=\"selected-icon\" @slotchange=\"${this.#handleSelectedIconSlotChange}\"></slot>\r\n </div>\r\n </div>\r\n\r\n <m3e-collapsible\r\n orientation=\"horizontal\"\r\n ?no-animate=\"${!this.#inRail}\"\r\n ?open=\"${this.orientation === \"horizontal\"}\"\r\n >\r\n ${this.orientation === \"horizontal\" ? label : nothing}\r\n </m3e-collapsible>\r\n\r\n ${this.orientation === \"horizontal\" ? nothing : label}\r\n </div>\r\n </div>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleClick(e: Event): void {\r\n if (e.defaultPrevented) return;\r\n\r\n this.selected = true;\r\n if (this.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true, cancelable: true }))) {\r\n this.navBar?.[selectionManager].notifySelectionChange(this);\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n } else {\r\n this.selected = false;\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleSelectedIconSlotChange(e: Event): void {\r\n setCustomState(this, \"--with-selected-icon\", hasAssignedNodes(<HTMLSlotElement>e.target));\r\n }\r\n\r\n /** @private */\r\n #handleStateLayerResize(entries: ResizeObserverEntry[]): void {\r\n if (entries.length === 0 || this.orientation === \"vertical\") return;\r\n this._inner?.style.setProperty(\"--_expanded-width\", `${entries[0].contentRect.width}px`);\r\n }\r\n\r\n /** @private */\r\n #initResizeObserver(): void {\r\n if (this._stateLayer && this.#inRail) {\r\n this.#resizeController.observe(this._stateLayer);\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-nav-item\": M3eNavItemElement;\r\n }\r\n}\r\n"],"names":["M3eNavBarElement","ReconnectedCallback","AttachInternals","Role","LitElement","constructor","this","SelectionManager","disableRovingTabIndex","_M3eNavBarElement_breakpointUnobserve","set","mode","items","selectionManager","selected","selectedItems","currentMode","_mode","value","disconnectedCallback","super","undefined","__classPrivateFieldGet","call","reconnectedCallback","_M3eNavBarElement_instances","_M3eNavBarElement_initBreakpointMonitoring","willUpdate","changedProperties","has","_updateItems","render","html","_M3eNavBarElement_handleChange","_M3eNavBarElement_handleSlotChange","orientation","_updateOrientation","setCustomState","forEach","x","__classPrivateFieldSet","M3eBreakpointObserver","observe","Breakpoint","XSmall","Small","matches","get","setItems","querySelectorAll","e","stopPropagation","dispatchEvent","Event","bubbles","styles","css","DesignToken","scrollbar","thinWidth","color","surfaceContainer","__decorate","state","prototype","property","reflect","customElement","M3eNavItemElement","SuppressInitialAnimation","LinkButton","Selected","KeyboardClick","Focusable","DisabledInteractive","Disabled","_M3eNavItemElement_inRail","_M3eNavItemElement_clickHandler","_M3eNavItemElement_resizeController","ResizeController","target","callback","entries","_M3eNavItemElement_instances","_M3eNavItemElement_handleStateLayerResize","navBar","closest","WeakMap","WeakSet","resumeAnimation","connectedCallback","addEventListener","capture","removeEventListener","_M3eNavItemElement_initResizeObserver","update","ariaSelected","ariaPressed","ariaCurrent","icon","toggleAttribute","notifySelectionChange","updated","_changedProperties","_focusRing","attach","firstUpdated","_stateLayer","_ripple","disabled","disabledInteractive","label","nothing","renderPseudoLink","_M3eNavItemElement_handleSelectedIconSlotChange","defaultPrevented","composed","cancelable","hasAssignedNodes","length","_inner","style","setProperty","contentRect","width","typescale","standard","medium","fontSize","fontWeight","lineHeight","tracking","shape","corner","full","unsafeCSS","motion","duration","short1","easing","onSecondaryContainer","onSurfaceVariant","secondary","secondaryContainer","medium1","short2","onSurface","query"],"mappings":";;;;;8vBA4CO,IAAMA,EAAN,cAA+BC,EAAoBC,EAAgBC,EAAKC,EAAY,iBAApFC,WAAAA,mCAwBqBC,SAAqB,IAAIC,GAAsCC,wBACzEC,EAAAC,IAAAJ,aAOaA,KAAAK,KAAmB,SA8FlD,CA3FE,SAAIC,GACF,OAAON,KAAKO,GAAkBD,KAChC,CAGA,YAAIE,GACF,OAAOR,KAAKO,GAAkBE,cAAc,IAAM,IACpD,CAGA,eAAIC,GACF,OAAOV,KAAKW,QAAwB,YAAdX,KAAKK,KAAqB,WAAa,UAC/D,CACA,eAAIK,CAAYE,GACdZ,KAAKW,MAAQC,CACf,CAGSC,oBAAAA,GACPC,MAAMD,uBAENb,KAAKW,WAAQI,EACbC,EAAAhB,KAAIG,EAAA,MAAuBc,KAA3BjB,KACF,CAGSkB,mBAAAA,GACPJ,MAAMI,sBAEY,SAAdlB,KAAKK,MACPW,EAAAhB,KAAImB,EAAA,IAAAC,GAA0BH,KAA9BjB,KAEJ,CAGmBqB,UAAAA,CAAWC,GAC5BR,MAAMO,WAAWC,GAEbA,EAAkBC,IAAI,UACxBP,EAAAhB,KAAIG,EAAA,MAAuBc,KAA3BjB,MAEkB,SAAdA,KAAKK,KACPW,EAAAhB,KAAImB,EAAA,IAAAC,GAA0BH,KAA9BjB,OAEAA,KAAKW,WAAQI,EACbf,KAAKwB,iBAG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AAJ,UAAA,kBAC5BF,EAAA,CAAjCqF,EAAM,WAAgD/E,EAAAJ,UAAA,iBAW1CF,EAAA,CAA5BG,EAAS,CAAEC,SAAS,KAAqDE,EAAAJ,UAAA,mBAAA,GApX/DI,EAAiBN,EAAA,CAD7BK,EAAc,iBACFC"}
1
+ {"version":3,"file":"nav-bar.min.js","sources":["../../src/nav-bar/NavBarElement.ts","../../src/nav-bar/NavItemElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement, PropertyValues } from \"lit\";\r\nimport { property, state } from \"lit/decorators.js\";\r\n\r\nimport { AttachInternals, customElement, DesignToken, ReconnectedCallback, Role, setCustomState } from \"@m3e/web/core\";\r\n\r\nimport { SelectionManager, selectionManager } from \"@m3e/web/core/a11y\";\r\nimport { Breakpoint, M3eBreakpointObserver } from \"@m3e/web/core/layout\";\r\n\r\nimport { M3eNavItemElement } from \"./NavItemElement\";\r\nimport { NavItemOrientation } from \"./NavItemOrientation\";\r\nimport { NavBarMode } from \"./NavBarMode\";\r\n\r\n/**\r\n * A horizontal bar, typically used on smaller devices, that allows a user to switch between 3-5 views.\r\n *\r\n * @description\r\n * The `m3e-nav-bar` component provides a horizontal navigation bar for switching between primary destinations in\r\n * an application. Designed for smaller devices, it supports 3-5 interactive items, orientation, and theming\r\n * via CSS custom properties.\r\n *\r\n * @example\r\n * The following example illustrates a nav bar with vertically oriented items.\r\n * ```html\r\n * <m3e-nav-bar>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"news\"></m3e-icon>News</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"globe\"></m3e-icon>Global</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"star\"></m3e-icon>For you</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"newsstand\"></m3e-icon>Trending</m3e-nav-item>\r\n * </m3e-nav-bar>\r\n * ```\r\n *\r\n * @tag m3e-nav-bar\r\n *\r\n * @slot - Renders the items of the bar.\r\n *\r\n * @attr mode - The mode in which items in the bar are presented.\r\n *\r\n * @fires beforeinput - Dispatched before the selected state of an item changes.\r\n * @fires input - Dispatched when the selected state of an item changes.\r\n * @fires change - Dispatched when the selected state of an item changes.\r\n *\r\n * @cssprop --m3e-nav-bar-height - Height of the navigation bar.\r\n * @cssprop --m3e-nav-bar-container-color - Background color of the navigation bar container.\r\n * @cssprop --m3e-nav-bar-vertical-item-width - Minimum width of vertical nav items.\r\n */\r\n@customElement(\"m3e-nav-bar\")\r\nexport class M3eNavBarElement extends ReconnectedCallback(AttachInternals(Role(LitElement, \"navigation\"))) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n overflow-x: auto;\r\n overflow-y: hidden;\r\n scrollbar-width: ${DesignToken.scrollbar.thinWidth};\r\n scrollbar-color: ${DesignToken.scrollbar.color};\r\n min-height: var(--m3e-nav-bar-height, 4rem);\r\n }\r\n .base {\r\n display: flex;\r\n align-items: stretch;\r\n justify-content: center;\r\n box-sizing: border-box;\r\n min-height: inherit;\r\n height: inherit;\r\n width: 100%;\r\n background-color: var(--m3e-nav-bar-container-color, ${DesignToken.color.surfaceContainer});\r\n --_nav-item-min-width: var(--m3e-nav-bar-vertical-item-width, 7rem);\r\n }\r\n `;\r\n\r\n /** @internal */ readonly [selectionManager] = new SelectionManager<M3eNavItemElement>().disableRovingTabIndex();\r\n /** @private */ #breakpointUnobserve?: () => void;\r\n /** @private */ @state() private _mode?: Exclude<NavBarMode, \"auto\">;\r\n\r\n /**\r\n * The mode in which items in the bar are presented.\r\n * @default \"compact\"\r\n */\r\n @property({ reflect: true }) mode: NavBarMode = \"compact\";\r\n\r\n /** The items of the bar. */\r\n get items(): readonly M3eNavItemElement[] {\r\n return this[selectionManager].items;\r\n }\r\n\r\n /** The selected item. */\r\n get selected(): M3eNavItemElement | null {\r\n return this[selectionManager].selectedItems[0] ?? null;\r\n }\r\n\r\n /** The current mode applied to the bar. */\r\n get currentMode(): Exclude<NavBarMode, \"auto\"> {\r\n return this._mode ?? (this.mode !== \"compact\" ? \"expanded\" : \"compact\");\r\n }\r\n set currentMode(value: Exclude<NavBarMode, \"auto\">) {\r\n this._mode = value;\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this._mode = undefined;\r\n this.#breakpointUnobserve?.();\r\n }\r\n\r\n /** @inheritdoc */\r\n override reconnectedCallback(): void {\r\n super.reconnectedCallback();\r\n\r\n if (this.mode === \"auto\") {\r\n this.#initBreakpointMonitoring();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override willUpdate(changedProperties: PropertyValues): void {\r\n super.willUpdate(changedProperties);\r\n\r\n if (changedProperties.has(\"mode\")) {\r\n this.#breakpointUnobserve?.();\r\n\r\n if (this.mode === \"auto\") {\r\n this.#initBreakpointMonitoring();\r\n } else {\r\n this._mode = undefined;\r\n this._updateItems();\r\n }\r\n }\r\n if (changedProperties.has(\"_mode\")) {\r\n this._updateItems();\r\n }\r\n }\r\n\r\n /** @private */\r\n #initBreakpointMonitoring(): void {\r\n this.#breakpointUnobserve = M3eBreakpointObserver.observe([Breakpoint.XSmall, Breakpoint.Small], (matches) => {\r\n this._mode = matches.get(Breakpoint.XSmall) || matches.get(Breakpoint.Small) ? \"compact\" : \"expanded\";\r\n this._updateItems();\r\n });\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\">\r\n <slot @change=\"${this.#handleChange}\" @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(): void {\r\n this[selectionManager].setItems([...this.querySelectorAll(\"m3e-nav-item\")]);\r\n this._updateItems();\r\n }\r\n\r\n /** @private */\r\n #handleChange(e: Event): void {\r\n e.stopPropagation();\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n }\r\n\r\n /** @internal */\r\n protected _updateItems(): void {\r\n const orientation: NavItemOrientation = this.currentMode === \"compact\" ? \"vertical\" : \"horizontal\";\r\n this._updateOrientation(orientation);\r\n setCustomState(this, \"--compact\", orientation === \"vertical\");\r\n }\r\n\r\n /** @internal */\r\n protected _updateOrientation(orientation: NavItemOrientation): void {\r\n this[selectionManager].items.forEach((x) => (x.orientation = orientation));\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-nav-bar\": M3eNavBarElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues, unsafeCSS } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n DisabledInteractive,\r\n Focusable,\r\n hasAssignedNodes,\r\n KeyboardClick,\r\n LinkButton,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n ReconnectedCallback,\r\n renderPseudoLink,\r\n ResizeController,\r\n resumeAnimation,\r\n Role,\r\n Selected,\r\n setCustomState,\r\n SuppressInitialAnimation,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { selectionManager } from \"@m3e/web/core/a11y\";\r\n\r\nimport type { M3eNavBarElement } from \"./NavBarElement\";\r\nimport { NavItemOrientation } from \"./NavItemOrientation\";\r\n\r\n/**\r\n * An item, placed in a navigation bar or rail, used to navigate to destinations in an application.\r\n *\r\n * @description\r\n * The `m3e-nav-item` component represents an interactive navigation item for use in navigation bars\r\n * or rails. Designed according to Material 3 principles, it supports icon and label slots, selection state,\r\n * orientation, and extensive theming via CSS custom properties.\r\n *\r\n * @example\r\n * The following example illustrates a nav bar with vertically oriented items.\r\n * ```html\r\n * <m3e-nav-bar>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"news\"></m3e-icon>News</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"globe\"></m3e-icon>Global</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"star\"></m3e-icon>For you</m3e-nav-item>\r\n * <m3e-nav-item><m3e-icon slot=\"icon\" name=\"newsstand\"></m3e-icon>Trending</m3e-nav-item>\r\n * </m3e-nav-bar>\r\n * ```\r\n *\r\n * @tag m3e-nav-item\r\n *\r\n * @slot - Renders the label of the item.\r\n * @slot icon - Renders the icon of the item.\r\n * @slot selected-icon - Renders the icon of the item when selected.\r\n *\r\n * @attr disabled - A value indicating whether the element is disabled.\r\n * @attr disabled-interactive - A value indicating whether the element is disabled and interactive.\r\n * @attr download - A value indicating whether the `target` of the link button will be downloaded, optionally specifying the new name of the file.\r\n * @attr href - The URL to which the link button points.\r\n * @attr orientation - The layout orientation of the item.\r\n * @attr rel - The relationship between the `target` of the link button and the document.\r\n * @attr selected - A value indicating whether the element is selected.\r\n * @attr target - The target of the link button.\r\n *\r\n * @fires beforeinput - Dispatched before the selected state changes.\r\n * @fires input - Dispatched when the selected state changes.\r\n * @fires change - Dispatched when the selected state changes.\r\n * @fires click - Dispatched when the element is clicked.\r\n *\r\n * @cssprop --m3e-nav-item-label-text-font-size - Font size for the label text.\r\n * @cssprop --m3e-nav-item-label-text-font-weight - Font weight for the label text.\r\n * @cssprop --m3e-nav-item-label-text-line-height - Line height for the label text.\r\n * @cssprop --m3e-nav-item-label-text-tracking - Letter spacing for the label text.\r\n * @cssprop --m3e-nav-item-shape - Border radius of the nav item.\r\n * @cssprop --m3e-nav-item-icon-size - Size of the icon.\r\n * @cssprop --m3e-nav-item-spacing - Spacing between icon and label.\r\n * @cssprop --m3e-nav-item-inactive-label-text-color - Color of the label text when inactive.\r\n * @cssprop --m3e-nav-item-inactive-icon-color - Color of the icon when inactive.\r\n * @cssprop --m3e-nav-item-inactive-hover-state-layer-color - State layer color on hover when inactive.\r\n * @cssprop --m3e-nav-item-inactive-focus-state-layer-color - State layer color on focus when inactive.\r\n * @cssprop --m3e-nav-item-inactive-pressed-state-layer-color - State layer color on press when inactive.\r\n * @cssprop --m3e-nav-item-active-label-text-color - Color of the label text when active/selected.\r\n * @cssprop --m3e-nav-item-active-icon-color - Color of the icon when active/selected.\r\n * @cssprop --m3e-nav-item-active-container-color - Container color when active/selected.\r\n * @cssprop --m3e-nav-item-active-hover-state-layer-color - State layer color on hover when active.\r\n * @cssprop --m3e-nav-item-active-focus-state-layer-color - State layer color on focus when active.\r\n * @cssprop --m3e-nav-item-active-pressed-state-layer-color - State layer color on press when active.\r\n * @cssprop --m3e-nav-item-focus-ring-shape - Border radius for the focus ring.\r\n * @cssprop --m3e-nav-item-disabled-label-text-color - Color of the label text when disabled.\r\n * @cssprop --m3e-nav-item-disabled-label-text-opacity - Opacity of the label text when disabled.\r\n * @cssprop --m3e-nav-item-disabled-icon-color - Color of the icon when disabled.\r\n * @cssprop --m3e-nav-item-disabled-icon-opacity - Opacity of the icon when disabled.\r\n * @cssprop --m3e-horizontal-nav-item-padding - Padding for horizontal orientation.\r\n * @cssprop --m3e-horizontal-nav-item-active-indicator-height - Height of the active indicator in horizontal orientation.\r\n * @cssprop --m3e-vertical-nav-item-active-indicator-width - Width of the active indicator in vertical orientation.\r\n * @cssprop --m3e-vertical-nav-item-active-indicator-height - Height of the active indicator in vertical orientation.\r\n * @cssprop --m3e-vertical-nav-item-active-indicator-margin - Margin for the active indicator in vertical orientation.\r\n */\r\n@customElement(\"m3e-nav-item\")\r\nexport class M3eNavItemElement extends ReconnectedCallback(\r\n SuppressInitialAnimation(\r\n LinkButton(\r\n Selected(\r\n KeyboardClick(Focusable(DisabledInteractive(Disabled(AttachInternals(Role(LitElement, \"button\"), true))))),\r\n ),\r\n ),\r\n ),\r\n) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: inline-block;\r\n vertical-align: middle;\r\n position: relative;\r\n outline: none;\r\n user-select: none;\r\n flex: 1;\r\n font-size: var(--m3e-nav-item-label-text-font-size, ${DesignToken.typescale.standard.label.medium.fontSize});\r\n font-weight: var(\r\n --m3e-nav-item-label-text-font-weight,\r\n ${DesignToken.typescale.standard.label.medium.fontWeight}\r\n );\r\n line-height: var(\r\n --m3e-nav-item-label-text-line-height,\r\n ${DesignToken.typescale.standard.label.medium.lineHeight}\r\n );\r\n letter-spacing: var(--m3e-nav-item-label-text-tracking, ${DesignToken.typescale.standard.label.medium.tracking});\r\n border-radius: var(--m3e-nav-item-shape, ${DesignToken.shape.corner.full});\r\n min-width: var(--_nav-item-min-width);\r\n align-self: var(--_nav-item-align-self);\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n :host([orientation=\"horizontal\"]) {\r\n max-width: fit-content;\r\n }\r\n :host(:not(:disabled):not([disabled-interactive])) {\r\n cursor: pointer;\r\n }\r\n :host([disabled-interactive]) {\r\n cursor: not-allowed;\r\n }\r\n .outer {\r\n height: 100%;\r\n }\r\n .outer,\r\n .inner {\r\n display: flex;\r\n align-items: center;\r\n justify-content: var(--_nav-item-justify-content, center);\r\n position: relative;\r\n border-radius: inherit;\r\n }\r\n .icon-wrapper {\r\n position: relative;\r\n flex: none;\r\n }\r\n .base {\r\n justify-content: unset;\r\n box-sizing: border-box;\r\n vertical-align: middle;\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n width: 100%;\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .base {\r\n transition: ${unsafeCSS(\r\n `margin-top ${DesignToken.motion.duration.short1} ${DesignToken.motion.easing.standard}`,\r\n )};\r\n }\r\n .icon {\r\n position: absolute;\r\n }\r\n .label {\r\n vertical-align: middle;\r\n }\r\n :host([orientation=\"horizontal\"]) .label {\r\n white-space: nowrap;\r\n }\r\n ::slotted([slot=\"icon\"]),\r\n ::slotted([slot=\"selected-icon\"]) {\r\n width: 1em;\r\n font-size: var(--m3e-nav-item-icon-size, 1.5rem) !important;\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .ripple {\r\n transition: ${unsafeCSS(`height ${DesignToken.motion.duration.short1} ${DesignToken.motion.easing.standard}`)};\r\n }\r\n :host(:not([selected])) slot[name=\"selected-icon\"],\r\n :host(:not(:is(:state(--with-selected-icon), :--with-selected-icon))) slot[name=\"selected-icon\"],\r\n :host([selected]:is(:state(--with-selected-icon), :--with-selected-icon)) slot[name=\"icon\"] {\r\n display: none;\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .outer {\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-nav-item-inactive-hover-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-nav-item-inactive-focus-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-ripple-color: var(\r\n --m3e-nav-item-inactive-pressed-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label {\r\n color: var(--m3e-nav-item-inactive-label-text-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon {\r\n color: var(--m3e-nav-item-inactive-icon-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .outer {\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-nav-item-active-hover-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-nav-item-active-focus-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n --m3e-ripple-color: var(\r\n --m3e-nav-item-active-pressed-state-layer-color,\r\n ${DesignToken.color.onSecondaryContainer}\r\n );\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive]):not([orientation=\"horizontal\"])) .label {\r\n color: var(--m3e-nav-item-active-label-text-color, ${DesignToken.color.secondary});\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer {\r\n background-color: var(--m3e-nav-item-active-container-color, ${DesignToken.color.secondaryContainer});\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])[orientation=\"horizontal\"]) .label,\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .icon {\r\n color: var(--m3e-nav-item-active-icon-color, ${DesignToken.color.onSecondaryContainer});\r\n }\r\n :host([orientation=\"vertical\"]) .outer {\r\n align-self: stretch;\r\n align-items: flex-start;\r\n }\r\n :host([orientation=\"vertical\"]) .label {\r\n text-align: center;\r\n display: -webkit-box;\r\n -webkit-line-clamp: 2;\r\n -webkit-box-orient: vertical;\r\n overflow: hidden;\r\n line-clamp: 2;\r\n }\r\n :host([orientation=\"vertical\"]) .base {\r\n flex-direction: column;\r\n row-gap: var(--m3e-nav-item-spacing, 0.25rem);\r\n }\r\n :host([orientation=\"horizongal\"]) .base {\r\n margin-top: 0;\r\n }\r\n :host([orientation=\"vertical\"]) .base {\r\n margin-top: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem);\r\n margin-bottom: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem);\r\n }\r\n :host([orientation=\"vertical\"]) .state-layer,\r\n :host([orientation=\"vertical\"]) .ripple {\r\n top: var(--m3e-vertical-nav-item-active-indicator-margin, 0.375rem);\r\n bottom: unset;\r\n }\r\n :host([orientation=\"vertical\"]) .state-layer,\r\n :host([orientation=\"vertical\"]) .ripple,\r\n :host([orientation=\"vertical\"]) .icon-wrapper {\r\n width: var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem);\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .ripple {\r\n animation: collapse ${DesignToken.motion.duration.medium1};\r\n }\r\n @keyframes collapse {\r\n from {\r\n width: var(--_expanded-width, var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem));\r\n }\r\n to {\r\n width: var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem);\r\n }\r\n }\r\n\r\n :host([orientation=\"vertical\"]) .state-layer,\r\n :host([orientation=\"vertical\"]) .ripple,\r\n :host([orientation=\"vertical\"]) .icon-wrapper {\r\n height: var(--m3e-vertical-nav-item-active-indicator-height, 2rem);\r\n }\r\n :host([orientation=\"vertical\"]) .icon {\r\n top: calc(\r\n calc(var(--m3e-vertical-nav-item-active-indicator-height, 2rem) / 2) - calc(\r\n var(--m3e-nav-item-icon-size, 1.5rem) / 2\r\n )\r\n );\r\n left: calc(\r\n calc(var(--m3e-vertical-nav-item-active-indicator-width, 3.5rem) / 2) - calc(\r\n var(--m3e-nav-item-icon-size, 1.5rem) / 2\r\n )\r\n );\r\n }\r\n :host([orientation=\"vertical\"]) .focus-ring {\r\n border-radius: var(--m3e-nav-item-focus-ring-shape, ${DesignToken.shape.corner.medium});\r\n }\r\n :host([orientation=\"horizontal\"]) .icon-wrapper {\r\n width: var(--m3e-nav-item-icon-size, 1.5rem);\r\n height: var(--m3e-nav-item-icon-size, 1.5rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .base {\r\n padding: var(--m3e-horizontal-nav-item-padding, 1rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .label {\r\n flex: 1 1 auto;\r\n }\r\n :host([orientation=\"horizontal\"]) .base {\r\n column-gap: var(--m3e-nav-item-spacing, 0.25rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .state-layer,\r\n :host([orientation=\"horizontal\"]) .ripple,\r\n :host([orientation=\"horizontal\"]) .inner {\r\n height: var(--m3e-horizontal-nav-item-active-indicator-height, 2.5rem);\r\n }\r\n :host([orientation=\"horizontal\"]) .inner {\r\n width: fit-content;\r\n }\r\n .state-layer,\r\n .ripple {\r\n margin-inline: auto;\r\n }\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"])\r\n .icon-wrapper,\r\n :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper {\r\n animation: ${unsafeCSS(`slide-down ${DesignToken.motion.duration.short2} ${DesignToken.motion.easing.standard}`)};\r\n }\r\n :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"])\r\n .icon-wrapper,\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper {\r\n animation: ${unsafeCSS(`slide-up ${DesignToken.motion.duration.short2} ${DesignToken.motion.easing.standard}`)};\r\n }\r\n @keyframes slide-down {\r\n from {\r\n transform: translateY(-4px);\r\n }\r\n to {\r\n transform: translateY(0);\r\n }\r\n }\r\n @keyframes slide-up {\r\n from {\r\n transform: translateY(4px);\r\n }\r\n to {\r\n transform: translateY(0);\r\n }\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"]) .label {\r\n animation: horizontal-fade-in ${DesignToken.motion.duration.medium1};\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .label {\r\n animation: vertical-fade-in ${DesignToken.motion.duration.medium1};\r\n }\r\n @keyframes horizontal-fade-in {\r\n from {\r\n opacity: 0;\r\n }\r\n to {\r\n opacity: 1;\r\n }\r\n }\r\n @keyframes vertical-fade-in {\r\n from {\r\n opacity: 0;\r\n }\r\n to {\r\n opacity: 1;\r\n }\r\n }\r\n :host(:disabled) .label,\r\n :host([disabled-interactive]) .label {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-nav-item-disabled-label-text-color, ${DesignToken.color.onSurface})\r\n var(--m3e-nav-item-disabled-label-text-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n :host(:disabled) .icon,\r\n :host([disabled-interactive]) .icon {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-nav-item-disabled-icon-color, ${DesignToken.color.onSurface})\r\n var(--m3e-nav-item-disabled-icon-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n a {\r\n all: unset;\r\n display: block;\r\n position: absolute;\r\n top: 0px;\r\n left: 0px;\r\n right: 0px;\r\n bottom: 0px;\r\n z-index: 1;\r\n }\r\n @media (prefers-reduced-motion) {\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"])\r\n .icon-wrapper,\r\n :host(:not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper,\r\n :host(\r\n :not(:is(:state(--first), :--first)):not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"]\r\n )\r\n .icon-wrapper,\r\n :host(:is(:state(--first), :--first):not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"])\r\n .icon-wrapper,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .ripple,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"horizontal\"]) .label,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))[orientation=\"vertical\"]) .label {\r\n animation: none;\r\n }\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .state-layer,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .ripple,\r\n :host(:not(:is(:state(--no-animate), :--no-animate))) .base {\r\n transition: none;\r\n }\r\n }\r\n @media (forced-colors: active) {\r\n :host(:disabled) .label,\r\n :host([disabled-interactive]) .label,\r\n :host(:disabled) .icon,\r\n :host([disabled-interactive]) .icon {\r\n color: GrayText;\r\n }\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label,\r\n :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon {\r\n color: ButtonText;\r\n }\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer {\r\n background-color: ButtonText;\r\n }\r\n :host([orientation=\"vertical\"][selected]:not(:disabled):not([disabled-interactive])) .label {\r\n color: ButtonText;\r\n }\r\n :host([orientation=\"horizontal\"][selected]:not(:disabled):not([disabled-interactive])) .label,\r\n :host([selected]:not(:disabled):not([disabled-interactive])) .icon {\r\n forced-color-adjust: none;\r\n color: ButtonFace;\r\n }\r\n }\r\n `;\r\n\r\n /** @private */ #inRail = false;\r\n /** @private */ readonly #clickHandler = (e: Event) => this.#handleClick(e);\r\n /** @private */ @query(\".focus-ring\") private readonly _focusRing?: M3eFocusRingElement;\r\n /** @private */ @query(\".state-layer\") private readonly _stateLayer?: M3eStateLayerElement;\r\n /** @private */ @query(\".ripple\") private readonly _ripple?: M3eRippleElement;\r\n /** @private */ @query(\".inner\") private readonly _inner?: HTMLElement;\r\n\r\n /** @private */ readonly #resizeController = new ResizeController(this, {\r\n target: null,\r\n callback: (entries) => this.#handleStateLayerResize(entries),\r\n });\r\n\r\n /**\r\n * The layout orientation of the item.\r\n * @default \"vertical\"\r\n */\r\n @property({ reflect: true }) orientation: NavItemOrientation = \"vertical\";\r\n\r\n /** The navigation bar to which this item belongs. */\r\n get navBar(): M3eNavBarElement | null {\r\n return this.closest(\"m3e-nav-bar\") ?? this.closest(\"m3e-nav-rail\") ?? null;\r\n }\r\n\r\n /** @internal */\r\n override [resumeAnimation](): void {\r\n if (this.#inRail) {\r\n super[resumeAnimation]();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n this.#inRail = this.closest(\"m3e-nav-rail\") !== null;\r\n super.connectedCallback();\r\n this.addEventListener(\"click\", this.#clickHandler, { capture: true });\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n this.removeEventListener(\"click\", this.#clickHandler, { capture: true });\r\n this.#inRail = false;\r\n }\r\n\r\n /** @inheritdoc */\r\n override reconnectedCallback(): void {\r\n super.reconnectedCallback();\r\n this.#initResizeObserver();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override update(changedProperties: PropertyValues<this>): void {\r\n super.update(changedProperties);\r\n\r\n if (changedProperties.has(\"selected\")) {\r\n this.ariaSelected = null;\r\n this.ariaPressed = null;\r\n this.ariaCurrent = `${this.selected}`;\r\n for (const icon of this.querySelectorAll(\"m3e-icon\")) {\r\n icon.toggleAttribute(\"filled\", this.selected);\r\n }\r\n this.navBar?.[selectionManager].notifySelectionChange(this);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n\r\n if (_changedProperties.has(\"orientation\")) {\r\n this._focusRing?.attach(this);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override firstUpdated(_changedProperties: PropertyValues<this>): void {\r\n super.firstUpdated(_changedProperties);\r\n [this._focusRing, this._stateLayer, this._ripple].forEach((x) => x?.attach(this));\r\n this.#initResizeObserver();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n const disabled = this.disabled || this.disabledInteractive;\r\n const label = html`<div class=\"label\"><slot></slot></div>`;\r\n return html`${this.orientation === \"vertical\"\r\n ? html`<m3e-focus-ring class=\"focus-ring\" inward></m3e-focus-ring>`\r\n : nothing}\r\n <div class=\"outer\">\r\n ${this[renderPseudoLink]()}\r\n <div class=\"inner\">\r\n ${this.orientation === \"horizontal\" ? html`<m3e-focus-ring class=\"focus-ring\"></m3e-focus-ring>` : nothing}\r\n <m3e-state-layer class=\"state-layer\" ?disabled=\"${disabled}\"></m3e-state-layer>\r\n <m3e-ripple class=\"ripple\" centered ?disabled=\"${disabled}\"></m3e-ripple>\r\n <div class=\"touch\" aria-hidden=\"true\"></div>\r\n <div class=\"base\">\r\n <div class=\"icon-wrapper\" aria-hidden=\"true\">\r\n <div class=\"icon\">\r\n <slot name=\"icon\"></slot>\r\n <slot name=\"selected-icon\" @slotchange=\"${this.#handleSelectedIconSlotChange}\"></slot>\r\n </div>\r\n </div>\r\n\r\n <m3e-collapsible\r\n orientation=\"horizontal\"\r\n ?no-animate=\"${!this.#inRail}\"\r\n ?open=\"${this.orientation === \"horizontal\"}\"\r\n >\r\n ${this.orientation === \"horizontal\" ? label : nothing}\r\n </m3e-collapsible>\r\n\r\n ${this.orientation === \"horizontal\" ? nothing : label}\r\n </div>\r\n </div>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleClick(e: Event): void {\r\n if (e.defaultPrevented) return;\r\n\r\n if (this.dispatchEvent(new Event(\"beforeinput\", { bubbles: true, cancelable: true }))) {\r\n this.selected = true;\r\n this.navBar?.[selectionManager].notifySelectionChange(this);\r\n\r\n this.dispatchEvent(new Event(\"input\", { bubbles: true }));\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleSelectedIconSlotChange(e: Event): void {\r\n setCustomState(this, \"--with-selected-icon\", hasAssignedNodes(<HTMLSlotElement>e.target));\r\n }\r\n\r\n /** @private */\r\n #handleStateLayerResize(entries: ResizeObserverEntry[]): void {\r\n if (entries.length === 0 || this.orientation === \"vertical\") return;\r\n this._inner?.style.setProperty(\"--_expanded-width\", `${entries[0].contentRect.width}px`);\r\n }\r\n\r\n /** @private */\r\n #initResizeObserver(): void {\r\n if (this._stateLayer && this.#inRail) {\r\n this.#resizeController.observe(this._stateLayer);\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-nav-item\": M3eNavItemElement;\r\n }\r\n}\r\n"],"names":["M3eNavBarElement","ReconnectedCallback","AttachInternals","Role","LitElement","constructor","this","SelectionManager","disableRovingTabIndex","_M3eNavBarElement_breakpointUnobserve","set","mode","items","selectionManager","selected","selectedItems","currentMode","_mode","value","disconnectedCallback","super","undefined","__classPrivateFieldGet","call","reconnectedCallback","_M3eNavBarElement_instances","_M3eNavBarElement_initBreakpointMonitoring","willUpdate","changedProperties","has","_updateItems","render","html","_M3eNavBarElement_handleChange","_M3eNavBarElement_handleSlotChange","orientation","_updateOrientation","setCustomState","forEach","x","__classPrivateFieldSet","M3eBreakpointObserver","observe","Breakpoint","XSmall","Small","matches","get","setItems","querySelectorAll","e","stopPropagation","dispatchEvent","Event","bubbles","styles","css","DesignToken","scrollbar","thinWidth","color","surfaceContainer","__decorate","state","prototype","property","reflect","customElement","M3eNavItemElement","SuppressInitialAnimation","LinkButton","Selected","KeyboardClick","Focusable","DisabledInteractive","Disabled","_M3eNavItemElement_inRail","_M3eNavItemElement_clickHandler","_M3eNavItemElement_resizeController","ResizeController","target","callback","entries","_M3eNavItemElement_instances","_M3eNavItemElement_handleStateLayerResize","navBar","closest","WeakMap","WeakSet","resumeAnimation","connectedCallback","addEventListener","capture","removeEventListener","_M3eNavItemElement_initResizeObserver","update","ariaSelected","ariaPressed","ariaCurrent","icon","toggleAttribute","notifySelectionChange","updated","_changedProperties","_focusRing","attach","firstUpdated","_stateLayer","_ripple","disabled","disabledInteractive","label","nothing","renderPseudoLink","_M3eNavItemElement_handleSelectedIconSlotChange","defaultPrevented","cancelable","hasAssignedNodes","length","_inner","style","setProperty","contentRect","width","typescale","standard","medium","fontSize","fontWeight","lineHeight","tracking","shape","corner","full","unsafeCSS","motion","duration","short1","easing","onSecondaryContainer","onSurfaceVariant","secondary","secondaryContainer","medium1","short2","onSurface","query"],"mappings":";;;;;8vBA8CO,IAAMA,EAAN,cAA+BC,EAAoBC,EAAgBC,EAAKC,EAAY,iBAApFC,WAAAA,mCAwBqBC,SAAqB,IAAIC,GAAsCC,wBACzEC,EAAAC,IAAAJ,aAOaA,KAAAK,KAAmB,SA8FlD,CA3FE,SAAIC,GACF,OAAON,KAAKO,GAAkBD,KAChC,CAGA,YAAIE,GACF,OAAOR,KAAKO,GAAkBE,cAAc,IAAM,IACpD,CAGA,eAAIC,GACF,OAAOV,KAAKW,QAAwB,YAAdX,KAAKK,KAAqB,WAAa,UAC/D,CACA,eAAIK,CAAYE,GACdZ,KAAKW,MAAQC,CACf,CAGSC,oBAAAA,GACPC,MAAMD,uBAENb,KAAKW,WAAQI,EACb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E,EAAY8E,OAAOC,SAASQ,UAAUvF,EAAY8E,OAAOG,OAAOb,4RAMxFS,EAAU,YAAY7E,EAAY8E,OAAOC,SAASQ,UAAUvF,EAAY8E,OAAOG,OAAOb,wUAmBnEpE,EAAY8E,OAAOC,SAASO,iIAG9BtF,EAAY8E,OAAOC,SAASO,ySAsBRtF,EAAYG,MAAMqF,sNASxBxF,EAAYG,MAAMqF,2jEAiEXnF,EAAA,CAAtCoF,EAAM,gBAAiE9E,EAAAJ,UAAA,qBAChCF,EAAA,CAAvCoF,EAAM,iBAAoE9E,EAAAJ,UAAA,sBACxCF,EAAA,CAAlCoF,EAAM,YAAuD9E,EAAAJ,UAAA,kBAC5BF,EAAA,CAAjCoF,EAAM,WAAgD9E,EAAAJ,UAAA,iBAW1CF,EAAA,CAA5BG,EAAS,CAAEC,SAAS,KAAqDE,EAAAJ,UAAA,mBAAA,GApX/DI,EAAiBN,EAAA,CAD7BK,EAAc,iBACFC"}
package/dist/nav-menu.js CHANGED
@@ -87,11 +87,11 @@ var M3eNavMenuItemElement_1;
87
87
  * @attr open - Whether the item is expanded.
88
88
  * @attr selected - Whether the item is selected.
89
89
  *
90
- * @fires opening - Emitted when the item begins to open.
91
- * @fires opened - Emitted when the item has opened.
92
- * @fires closing - Emitted when the item begins to close.
93
- * @fires closed - Emitted when the item has closed.
94
- * @fires click - Emitted when the element is clicked.
90
+ * @fires opening - Dispatched when the item begins to open.
91
+ * @fires opened - Dispatched when the item has opened.
92
+ * @fires closing - Dispatched when the item begins to close.
93
+ * @fires closed - Dispatched when the item has closed.
94
+ * @fires click - Dispatched when the element is clicked.
95
95
  *
96
96
  * @cssprop --m3e-nav-menu-item-font-size - Font size for the item label.
97
97
  * @cssprop --m3e-nav-menu-item-font-weight - Font weight for the item label.