@m3e/web 2.5.4 → 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 (273) hide show
  1. package/README.md +1 -1
  2. package/dist/all.js +667 -532
  3. package/dist/all.js.map +1 -1
  4. package/dist/all.min.js +56 -56
  5. package/dist/all.min.js.map +1 -1
  6. package/dist/autocomplete.js +15 -15
  7. package/dist/autocomplete.js.map +1 -1
  8. package/dist/autocomplete.min.js +1 -1
  9. package/dist/autocomplete.min.js.map +1 -1
  10. package/dist/bottom-sheet.js +15 -18
  11. package/dist/bottom-sheet.js.map +1 -1
  12. package/dist/bottom-sheet.min.js +1 -1
  13. package/dist/bottom-sheet.min.js.map +1 -1
  14. package/dist/breadcrumb.js +5 -5
  15. package/dist/breadcrumb.js.map +1 -1
  16. package/dist/breadcrumb.min.js +1 -1
  17. package/dist/breadcrumb.min.js.map +1 -1
  18. package/dist/button-group.js +5 -5
  19. package/dist/button-group.js.map +1 -1
  20. package/dist/button-group.min.js +1 -1
  21. package/dist/button-group.min.js.map +1 -1
  22. package/dist/button.js +22 -23
  23. package/dist/button.js.map +1 -1
  24. package/dist/button.min.js +1 -1
  25. package/dist/button.min.js.map +1 -1
  26. package/dist/calendar.js +1 -1
  27. package/dist/calendar.js.map +1 -1
  28. package/dist/calendar.min.js.map +1 -1
  29. package/dist/card.js +1 -1
  30. package/dist/card.js.map +1 -1
  31. package/dist/card.min.js.map +1 -1
  32. package/dist/checkbox.js +11 -10
  33. package/dist/checkbox.js.map +1 -1
  34. package/dist/checkbox.min.js +1 -1
  35. package/dist/checkbox.min.js.map +1 -1
  36. package/dist/chips.js +26 -25
  37. package/dist/chips.js.map +1 -1
  38. package/dist/chips.min.js +1 -1
  39. package/dist/chips.min.js.map +1 -1
  40. package/dist/core-a11y.js +5 -3
  41. package/dist/core-a11y.js.map +1 -1
  42. package/dist/core-a11y.min.js +4 -4
  43. package/dist/core-a11y.min.js.map +1 -1
  44. package/dist/core-anchoring.js +4 -4
  45. package/dist/core-anchoring.js.map +1 -1
  46. package/dist/core-anchoring.min.js +1 -1
  47. package/dist/core-anchoring.min.js.map +1 -1
  48. package/dist/core.js +82 -45
  49. package/dist/core.js.map +1 -1
  50. package/dist/core.min.js +1 -1
  51. package/dist/core.min.js.map +1 -1
  52. package/dist/css-custom-data.json +523 -508
  53. package/dist/custom-elements.json +4405 -4011
  54. package/dist/datepicker.js +38 -14
  55. package/dist/datepicker.js.map +1 -1
  56. package/dist/datepicker.min.js +1 -1
  57. package/dist/datepicker.min.js.map +1 -1
  58. package/dist/dialog.js +7 -7
  59. package/dist/dialog.js.map +1 -1
  60. package/dist/dialog.min.js +1 -1
  61. package/dist/dialog.min.js.map +1 -1
  62. package/dist/drawer-container.js +15 -15
  63. package/dist/drawer-container.js.map +1 -1
  64. package/dist/drawer-container.min.js +1 -1
  65. package/dist/drawer-container.min.js.map +1 -1
  66. package/dist/expansion-panel.js +7 -7
  67. package/dist/expansion-panel.js.map +1 -1
  68. package/dist/expansion-panel.min.js +1 -1
  69. package/dist/expansion-panel.min.js.map +1 -1
  70. package/dist/fab-menu.js +5 -5
  71. package/dist/fab-menu.js.map +1 -1
  72. package/dist/fab-menu.min.js +1 -1
  73. package/dist/fab-menu.min.js.map +1 -1
  74. package/dist/fab.js +3 -3
  75. package/dist/fab.js.map +1 -1
  76. package/dist/fab.min.js +1 -1
  77. package/dist/fab.min.js.map +1 -1
  78. package/dist/form-field.js +19 -19
  79. package/dist/form-field.js.map +1 -1
  80. package/dist/form-field.min.js +2 -2
  81. package/dist/form-field.min.js.map +1 -1
  82. package/dist/html-custom-data.json +183 -168
  83. package/dist/icon-button.js +22 -23
  84. package/dist/icon-button.js.map +1 -1
  85. package/dist/icon-button.min.js +1 -1
  86. package/dist/icon-button.min.js.map +1 -1
  87. package/dist/list.js +33 -32
  88. package/dist/list.js.map +1 -1
  89. package/dist/list.min.js +1 -1
  90. package/dist/list.min.js.map +1 -1
  91. package/dist/menu.js +23 -23
  92. package/dist/menu.js.map +1 -1
  93. package/dist/menu.min.js +1 -1
  94. package/dist/menu.min.js.map +1 -1
  95. package/dist/nav-bar.js +52 -19
  96. package/dist/nav-bar.js.map +1 -1
  97. package/dist/nav-bar.min.js +1 -1
  98. package/dist/nav-bar.min.js.map +1 -1
  99. package/dist/nav-menu.js +13 -13
  100. package/dist/nav-menu.js.map +1 -1
  101. package/dist/nav-menu.min.js +1 -1
  102. package/dist/nav-menu.min.js.map +1 -1
  103. package/dist/nav-rail.js +18 -12
  104. package/dist/nav-rail.js.map +1 -1
  105. package/dist/nav-rail.min.js +1 -1
  106. package/dist/nav-rail.min.js.map +1 -1
  107. package/dist/option.js +13 -13
  108. package/dist/option.js.map +1 -1
  109. package/dist/option.min.js +1 -1
  110. package/dist/option.min.js.map +1 -1
  111. package/dist/paginator.js +1 -1
  112. package/dist/paginator.js.map +1 -1
  113. package/dist/paginator.min.js.map +1 -1
  114. package/dist/radio-group.js +14 -11
  115. package/dist/radio-group.js.map +1 -1
  116. package/dist/radio-group.min.js +1 -1
  117. package/dist/radio-group.min.js.map +1 -1
  118. package/dist/search.js +12 -12
  119. package/dist/search.js.map +1 -1
  120. package/dist/search.min.js +1 -1
  121. package/dist/search.min.js.map +1 -1
  122. package/dist/segmented-button.js +19 -18
  123. package/dist/segmented-button.js.map +1 -1
  124. package/dist/segmented-button.min.js +1 -1
  125. package/dist/segmented-button.min.js.map +1 -1
  126. package/dist/select.js +15 -15
  127. package/dist/select.js.map +1 -1
  128. package/dist/select.min.js +1 -1
  129. package/dist/select.min.js.map +1 -1
  130. package/dist/slider.js +49 -28
  131. package/dist/slider.js.map +1 -1
  132. package/dist/slider.min.js +1 -1
  133. package/dist/slider.min.js.map +1 -1
  134. package/dist/split-pane.js +27 -29
  135. package/dist/split-pane.js.map +1 -1
  136. package/dist/split-pane.min.js +1 -1
  137. package/dist/split-pane.min.js.map +1 -1
  138. package/dist/src/autocomplete/AutocompleteElement.d.ts +3 -3
  139. package/dist/src/autocomplete/AutocompleteQueryEventDetail.d.ts +1 -1
  140. package/dist/src/autocomplete/QueryEventDetail.d.ts +1 -1
  141. package/dist/src/bottom-sheet/BottomSheetElement.d.ts +6 -6
  142. package/dist/src/bottom-sheet/BottomSheetElement.d.ts.map +1 -1
  143. package/dist/src/breadcrumb/BreadcrumbItemElement.d.ts +1 -1
  144. package/dist/src/button/ButtonElement.d.ts +2 -1
  145. package/dist/src/button/ButtonElement.d.ts.map +1 -1
  146. package/dist/src/button/styles/ButtonSizeStyle.d.ts.map +1 -1
  147. package/dist/src/button/styles/ButtonStyle.d.ts.map +1 -1
  148. package/dist/src/button/styles/ButtonVariantStyle.d.ts.map +1 -1
  149. package/dist/src/button-group/ButtonGroupElement.d.ts.map +1 -1
  150. package/dist/src/calendar/CalendarElement.d.ts +1 -1
  151. package/dist/src/card/CardElement.d.ts +1 -1
  152. package/dist/src/checkbox/CheckboxElement.d.ts +5 -4
  153. package/dist/src/checkbox/CheckboxElement.d.ts.map +1 -1
  154. package/dist/src/chips/AssistChipElement.d.ts +1 -1
  155. package/dist/src/chips/FilterChipElement.d.ts +4 -3
  156. package/dist/src/chips/FilterChipElement.d.ts.map +1 -1
  157. package/dist/src/chips/FilterChipSetElement.d.ts +3 -2
  158. package/dist/src/chips/FilterChipSetElement.d.ts.map +1 -1
  159. package/dist/src/chips/InputChipElement.d.ts +2 -2
  160. package/dist/src/chips/InputChipSetElement.d.ts +1 -1
  161. package/dist/src/chips/SuggestionChipElement.d.ts +1 -1
  162. package/dist/src/core/a11y/InteractivityChecker.d.ts +2 -1
  163. package/dist/src/core/a11y/InteractivityChecker.d.ts.map +1 -1
  164. package/dist/src/core/anchoring/FloatingPanelElement.d.ts +1 -1
  165. package/dist/src/core/shared/mixins/SuppressInitialAnimation.d.ts +9 -2
  166. package/dist/src/core/shared/mixins/SuppressInitialAnimation.d.ts.map +1 -1
  167. package/dist/src/core/shared/primitives/CollapsibleElement.d.ts +17 -4
  168. package/dist/src/core/shared/primitives/CollapsibleElement.d.ts.map +1 -1
  169. package/dist/src/core/shared/primitives/CollapsibleOrientation.d.ts +3 -0
  170. package/dist/src/core/shared/primitives/CollapsibleOrientation.d.ts.map +1 -0
  171. package/dist/src/core/shared/primitives/TextHighlightElement.d.ts +1 -1
  172. package/dist/src/core/shared/primitives/index.d.ts +1 -0
  173. package/dist/src/core/shared/primitives/index.d.ts.map +1 -1
  174. package/dist/src/datepicker/DatepickerElement.d.ts +7 -1
  175. package/dist/src/datepicker/DatepickerElement.d.ts.map +1 -1
  176. package/dist/src/dialog/DialogElement.d.ts +5 -5
  177. package/dist/src/drawer-container/DrawerContainerElement.d.ts +1 -1
  178. package/dist/src/drawer-container/styles/DrawerContainerStyle.d.ts.map +1 -1
  179. package/dist/src/expansion-panel/ExpansionHeaderElement.d.ts +1 -1
  180. package/dist/src/expansion-panel/ExpansionPanelElement.d.ts +4 -4
  181. package/dist/src/fab/FabElement.d.ts +1 -1
  182. package/dist/src/fab/FabElement.d.ts.map +1 -1
  183. package/dist/src/fab/styles/FabStyle.d.ts.map +1 -1
  184. package/dist/src/fab-menu/FabMenuElement.d.ts +1 -1
  185. package/dist/src/fab-menu/FabMenuItemElement.d.ts +1 -1
  186. package/dist/src/form-field/FormFieldElement.d.ts.map +1 -1
  187. package/dist/src/icon-button/IconButtonElement.d.ts +2 -1
  188. package/dist/src/icon-button/IconButtonElement.d.ts.map +1 -1
  189. package/dist/src/icon-button/styles/IconButtonSizeStyle.d.ts.map +1 -1
  190. package/dist/src/icon-button/styles/IconButtonStyle.d.ts.map +1 -1
  191. package/dist/src/icon-button/styles/IconButtonVariantStyle.d.ts.map +1 -1
  192. package/dist/src/list/ExpandableListItemElement.d.ts +4 -4
  193. package/dist/src/list/ListActionElement.d.ts +1 -1
  194. package/dist/src/list/ListOptionElement.d.ts +4 -3
  195. package/dist/src/list/ListOptionElement.d.ts.map +1 -1
  196. package/dist/src/list/SelectionListElement.d.ts +3 -2
  197. package/dist/src/list/SelectionListElement.d.ts.map +1 -1
  198. package/dist/src/menu/MenuElement.d.ts +1 -1
  199. package/dist/src/menu/MenuItemCheckboxElement.d.ts +1 -1
  200. package/dist/src/menu/MenuItemElement.d.ts +1 -1
  201. package/dist/src/menu/MenuItemRadioElement.d.ts +1 -1
  202. package/dist/src/nav-bar/NavBarElement.d.ts +3 -1
  203. package/dist/src/nav-bar/NavBarElement.d.ts.map +1 -1
  204. package/dist/src/nav-bar/NavItemElement.d.ts +11 -4
  205. package/dist/src/nav-bar/NavItemElement.d.ts.map +1 -1
  206. package/dist/src/nav-menu/NavMenuItemElement.d.ts +5 -5
  207. package/dist/src/nav-rail/NavRailElement.d.ts +13 -6
  208. package/dist/src/nav-rail/NavRailElement.d.ts.map +1 -1
  209. package/dist/src/paginator/PageEventDetail.d.ts +1 -1
  210. package/dist/src/paginator/PaginatorElement.d.ts +1 -1
  211. package/dist/src/paginator/PaginatorPageEventDetail.d.ts +1 -1
  212. package/dist/src/paginator/PaginatorPageEventDetail.d.ts.map +1 -1
  213. package/dist/src/radio-group/RadioElement.d.ts +4 -3
  214. package/dist/src/radio-group/RadioElement.d.ts.map +1 -1
  215. package/dist/src/radio-group/RadioGroupElement.d.ts +3 -1
  216. package/dist/src/radio-group/RadioGroupElement.d.ts.map +1 -1
  217. package/dist/src/search/SearchViewQueryEventDetail.d.ts +1 -1
  218. package/dist/src/search/styles/SearchBarStyle.d.ts.map +1 -1
  219. package/dist/src/segmented-button/ButtonSegmentElement.d.ts +4 -3
  220. package/dist/src/segmented-button/ButtonSegmentElement.d.ts.map +1 -1
  221. package/dist/src/segmented-button/SegmentedButtonElement.d.ts +3 -2
  222. package/dist/src/segmented-button/SegmentedButtonElement.d.ts.map +1 -1
  223. package/dist/src/select/SelectElement.d.ts +3 -2
  224. package/dist/src/select/SelectElement.d.ts.map +1 -1
  225. package/dist/src/slider/SliderElement.d.ts +4 -0
  226. package/dist/src/slider/SliderElement.d.ts.map +1 -1
  227. package/dist/src/slider/SliderThumbElement.d.ts +4 -3
  228. package/dist/src/slider/SliderThumbElement.d.ts.map +1 -1
  229. package/dist/src/split-pane/SplitPaneElement.d.ts +3 -2
  230. package/dist/src/split-pane/SplitPaneElement.d.ts.map +1 -1
  231. package/dist/src/stepper/StepElement.d.ts +4 -3
  232. package/dist/src/stepper/StepElement.d.ts.map +1 -1
  233. package/dist/src/stepper/StepperElement.d.ts +5 -1
  234. package/dist/src/stepper/StepperElement.d.ts.map +1 -1
  235. package/dist/src/switch/SwitchElement.d.ts +4 -3
  236. package/dist/src/switch/SwitchElement.d.ts.map +1 -1
  237. package/dist/src/tabs/TabElement.d.ts +4 -3
  238. package/dist/src/tabs/TabElement.d.ts.map +1 -1
  239. package/dist/src/tabs/TabsElement.d.ts +3 -1
  240. package/dist/src/tabs/TabsElement.d.ts.map +1 -1
  241. package/dist/src/toc/TocItemElement.d.ts +1 -1
  242. package/dist/src/toolbar/ToolbarElement.d.ts.map +1 -1
  243. package/dist/src/tree/TreeElement.d.ts +1 -1
  244. package/dist/src/tree/TreeItemElement.d.ts +5 -5
  245. package/dist/stepper.js +32 -23
  246. package/dist/stepper.js.map +1 -1
  247. package/dist/stepper.min.js +1 -1
  248. package/dist/stepper.min.js.map +1 -1
  249. package/dist/switch.js +9 -8
  250. package/dist/switch.js.map +1 -1
  251. package/dist/switch.min.js +1 -1
  252. package/dist/switch.min.js.map +1 -1
  253. package/dist/tabs.js +17 -14
  254. package/dist/tabs.js.map +1 -1
  255. package/dist/tabs.min.js +1 -1
  256. package/dist/tabs.min.js.map +1 -1
  257. package/dist/toc.js +8 -8
  258. package/dist/toc.js.map +1 -1
  259. package/dist/toc.min.js +1 -1
  260. package/dist/toc.min.js.map +1 -1
  261. package/dist/toolbar.js +2 -1
  262. package/dist/toolbar.js.map +1 -1
  263. package/dist/toolbar.min.js +1 -1
  264. package/dist/toolbar.min.js.map +1 -1
  265. package/dist/tooltip.js +3 -3
  266. package/dist/tooltip.js.map +1 -1
  267. package/dist/tooltip.min.js +1 -1
  268. package/dist/tooltip.min.js.map +1 -1
  269. package/dist/tree.js +13 -13
  270. package/dist/tree.js.map +1 -1
  271. package/dist/tree.min.js +1 -1
  272. package/dist/tree.min.js.map +1 -1
  273. package/package.json +1 -1
package/dist/nav-bar.js CHANGED
@@ -4,9 +4,9 @@
4
4
  * See LICENSE file in the project root for full license text.
5
5
  */
6
6
  import { __classPrivateFieldGet, __classPrivateFieldSet, __decorate } from 'tslib';
7
- import { LitElement, html, css, nothing } from 'lit';
7
+ import { LitElement, html, css, nothing, unsafeCSS } from 'lit';
8
8
  import { state, property, query } from 'lit/decorators.js';
9
- import { ReconnectedCallback, AttachInternals, Role, setCustomState, DesignToken, customElement, LinkButton, Selected, KeyboardClick, Focusable, DisabledInteractive, Disabled, renderPseudoLink, hasAssignedNodes } from '@m3e/web/core';
9
+ import { ReconnectedCallback, AttachInternals, Role, setCustomState, DesignToken, customElement, SuppressInitialAnimation, LinkButton, Selected, KeyboardClick, Focusable, DisabledInteractive, Disabled, ResizeController, resumeAnimation, renderPseudoLink, hasAssignedNodes } from '@m3e/web/core';
10
10
  import { SelectionManager, selectionManager } from '@m3e/web/core/a11y';
11
11
  import { M3eBreakpointObserver, Breakpoint } from '@m3e/web/core/layout';
12
12
 
@@ -36,7 +36,9 @@ var _M3eNavBarElement_instances, _M3eNavBarElement_breakpointUnobserve, _M3eNavB
36
36
  *
37
37
  * @attr mode - The mode in which items in the bar are presented.
38
38
  *
39
- * @fires change - Emitted when the selected state of an item changes.
39
+ * @fires beforeinput - Dispatched before the selected state of an item changes.
40
+ * @fires input - Dispatched when the selected state of an item changes.
41
+ * @fires change - Dispatched when the selected state of an item changes.
40
42
  *
41
43
  * @cssprop --m3e-nav-bar-height - Height of the navigation bar.
42
44
  * @cssprop --m3e-nav-bar-container-color - Background color of the navigation bar container.
@@ -108,7 +110,7 @@ let M3eNavBarElement = class M3eNavBarElement extends ReconnectedCallback(Attach
108
110
  _updateItems() {
109
111
  const orientation = this.currentMode === "compact" ? "vertical" : "horizontal";
110
112
  this._updateOrientation(orientation);
111
- setCustomState(this, "-compact", orientation === "vertical");
113
+ setCustomState(this, "--compact", orientation === "vertical");
112
114
  }
113
115
  /** @internal */
114
116
  _updateOrientation(orientation) {
@@ -142,7 +144,7 @@ __decorate([property({
142
144
  })], M3eNavBarElement.prototype, "mode", void 0);
143
145
  M3eNavBarElement = __decorate([customElement("m3e-nav-bar")], M3eNavBarElement);
144
146
 
145
- var _M3eNavItemElement_instances, _M3eNavItemElement_clickHandler, _M3eNavItemElement_handleClick, _M3eNavItemElement_handleSelectedIconSlotChange;
147
+ var _M3eNavItemElement_instances, _M3eNavItemElement_inRail, _M3eNavItemElement_clickHandler, _M3eNavItemElement_resizeController, _M3eNavItemElement_handleClick, _M3eNavItemElement_handleSelectedIconSlotChange, _M3eNavItemElement_handleStateLayerResize, _M3eNavItemElement_initResizeObserver;
146
148
  /**
147
149
  * An item, placed in a navigation bar or rail, used to navigate to destinations in an application.
148
150
  *
@@ -177,9 +179,10 @@ var _M3eNavItemElement_instances, _M3eNavItemElement_clickHandler, _M3eNavItemEl
177
179
  * @attr selected - A value indicating whether the element is selected.
178
180
  * @attr target - The target of the link button.
179
181
  *
180
- * @fires input - Emitted when the selected state changes.
181
- * @fires change - Emitted when the selected state changes.
182
- * @fires click - Emitted when the element is clicked.
182
+ * @fires beforeinput - Dispatched before the selected state changes.
183
+ * @fires input - Dispatched when the selected state changes.
184
+ * @fires change - Dispatched when the selected state changes.
185
+ * @fires click - Dispatched when the element is clicked.
183
186
  *
184
187
  * @cssprop --m3e-nav-item-label-text-font-size - Font size for the label text.
185
188
  * @cssprop --m3e-nav-item-label-text-font-weight - Font weight for the label text.
@@ -210,12 +213,19 @@ var _M3eNavItemElement_instances, _M3eNavItemElement_clickHandler, _M3eNavItemEl
210
213
  * @cssprop --m3e-vertical-nav-item-active-indicator-height - Height of the active indicator in vertical orientation.
211
214
  * @cssprop --m3e-vertical-nav-item-active-indicator-margin - Margin for the active indicator in vertical orientation.
212
215
  */
213
- let M3eNavItemElement = class M3eNavItemElement extends LinkButton(Selected(KeyboardClick(Focusable(DisabledInteractive(Disabled(AttachInternals(Role(LitElement, "button"), true))))))) {
216
+ let M3eNavItemElement = class M3eNavItemElement extends ReconnectedCallback(SuppressInitialAnimation(LinkButton(Selected(KeyboardClick(Focusable(DisabledInteractive(Disabled(AttachInternals(Role(LitElement, "button"), true))))))))) {
214
217
  constructor() {
215
218
  super(...arguments);
216
219
  _M3eNavItemElement_instances.add(this);
217
220
  /** @private */
221
+ _M3eNavItemElement_inRail.set(this, false);
222
+ /** @private */
218
223
  _M3eNavItemElement_clickHandler.set(this, e => __classPrivateFieldGet(this, _M3eNavItemElement_instances, "m", _M3eNavItemElement_handleClick).call(this, e));
224
+ /** @private */
225
+ _M3eNavItemElement_resizeController.set(this, new ResizeController(this, {
226
+ target: null,
227
+ callback: entries => __classPrivateFieldGet(this, _M3eNavItemElement_instances, "m", _M3eNavItemElement_handleStateLayerResize).call(this, entries)
228
+ }));
219
229
  /**
220
230
  * The layout orientation of the item.
221
231
  * @default "vertical"
@@ -226,8 +236,15 @@ let M3eNavItemElement = class M3eNavItemElement extends LinkButton(Selected(Keyb
226
236
  get navBar() {
227
237
  return this.closest("m3e-nav-bar") ?? this.closest("m3e-nav-rail") ?? null;
228
238
  }
239
+ /** @internal */
240
+ [(_M3eNavItemElement_inRail = new WeakMap(), _M3eNavItemElement_clickHandler = new WeakMap(), _M3eNavItemElement_resizeController = new WeakMap(), _M3eNavItemElement_instances = new WeakSet(), resumeAnimation)]() {
241
+ if (__classPrivateFieldGet(this, _M3eNavItemElement_inRail, "f")) {
242
+ super[resumeAnimation]();
243
+ }
244
+ }
229
245
  /** @inheritdoc */
230
246
  connectedCallback() {
247
+ __classPrivateFieldSet(this, _M3eNavItemElement_inRail, this.closest("m3e-nav-rail") !== null, "f");
231
248
  super.connectedCallback();
232
249
  this.addEventListener("click", __classPrivateFieldGet(this, _M3eNavItemElement_clickHandler, "f"), {
233
250
  capture: true
@@ -239,6 +256,12 @@ let M3eNavItemElement = class M3eNavItemElement extends LinkButton(Selected(Keyb
239
256
  this.removeEventListener("click", __classPrivateFieldGet(this, _M3eNavItemElement_clickHandler, "f"), {
240
257
  capture: true
241
258
  });
259
+ __classPrivateFieldSet(this, _M3eNavItemElement_inRail, false, "f");
260
+ }
261
+ /** @inheritdoc */
262
+ reconnectedCallback() {
263
+ super.reconnectedCallback();
264
+ __classPrivateFieldGet(this, _M3eNavItemElement_instances, "m", _M3eNavItemElement_initResizeObserver).call(this);
242
265
  }
243
266
  /** @inheritdoc */
244
267
  update(changedProperties) {
@@ -264,39 +287,49 @@ let M3eNavItemElement = class M3eNavItemElement extends LinkButton(Selected(Keyb
264
287
  firstUpdated(_changedProperties) {
265
288
  super.firstUpdated(_changedProperties);
266
289
  [this._focusRing, this._stateLayer, this._ripple].forEach(x => x?.attach(this));
290
+ __classPrivateFieldGet(this, _M3eNavItemElement_instances, "m", _M3eNavItemElement_initResizeObserver).call(this);
267
291
  }
268
292
  /** @inheritdoc */
269
293
  render() {
270
294
  const disabled = this.disabled || this.disabledInteractive;
271
- return html`${this.orientation === "vertical" ? html`<m3e-focus-ring class="focus-ring" inward></m3e-focus-ring>` : nothing}<div class="outer">${this[renderPseudoLink]()}<div class="inner">${this.orientation === "horizontal" ? html`<m3e-focus-ring class="focus-ring"></m3e-focus-ring>` : nothing}<m3e-state-layer class="state-layer" ?disabled="${disabled}"></m3e-state-layer><m3e-ripple class="ripple" centered ?disabled="${disabled}"></m3e-ripple><div class="touch" aria-hidden="true"></div><div class="base"><div class="icon-wrapper" aria-hidden="true"><div class="icon" aria-hidden="true"><slot name="icon"></slot><slot name="selected-icon" @slotchange="${__classPrivateFieldGet(this, _M3eNavItemElement_instances, "m", _M3eNavItemElement_handleSelectedIconSlotChange)}"></slot></div></div><div class="label"><slot></slot></div></div></div></div>`;
295
+ const label = html`<div class="label"><slot></slot></div>`;
296
+ return html`${this.orientation === "vertical" ? html`<m3e-focus-ring class="focus-ring" inward></m3e-focus-ring>` : nothing}<div class="outer">${this[renderPseudoLink]()}<div class="inner">${this.orientation === "horizontal" ? html`<m3e-focus-ring class="focus-ring"></m3e-focus-ring>` : nothing}<m3e-state-layer class="state-layer" ?disabled="${disabled}"></m3e-state-layer><m3e-ripple class="ripple" centered ?disabled="${disabled}"></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="${__classPrivateFieldGet(this, _M3eNavItemElement_instances, "m", _M3eNavItemElement_handleSelectedIconSlotChange)}"></slot></div></div><m3e-collapsible orientation="horizontal" ?no-animate="${!__classPrivateFieldGet(this, _M3eNavItemElement_inRail, "f")}" ?open="${this.orientation === "horizontal"}">${this.orientation === "horizontal" ? label : nothing}</m3e-collapsible>${this.orientation === "horizontal" ? nothing : label}</div></div></div>`;
272
297
  }
273
298
  };
274
- _M3eNavItemElement_clickHandler = new WeakMap();
275
- _M3eNavItemElement_instances = new WeakSet();
276
299
  _M3eNavItemElement_handleClick = function _M3eNavItemElement_handleClick(e) {
277
300
  if (e.defaultPrevented) return;
278
- this.selected = true;
279
- if (this.dispatchEvent(new Event("input", {
301
+ if (this.dispatchEvent(new Event("beforeinput", {
280
302
  bubbles: true,
281
- composed: true,
282
303
  cancelable: true
283
304
  }))) {
305
+ this.selected = true;
284
306
  this.navBar?.[selectionManager].notifySelectionChange(this);
307
+ this.dispatchEvent(new Event("input", {
308
+ bubbles: true
309
+ }));
285
310
  this.dispatchEvent(new Event("change", {
286
311
  bubbles: true
287
312
  }));
288
- } else {
289
- this.selected = false;
290
313
  }
291
314
  };
292
315
  _M3eNavItemElement_handleSelectedIconSlotChange = function _M3eNavItemElement_handleSelectedIconSlotChange(e) {
293
- setCustomState(this, "-with-selected-icon", hasAssignedNodes(e.target));
316
+ setCustomState(this, "--with-selected-icon", hasAssignedNodes(e.target));
317
+ };
318
+ _M3eNavItemElement_handleStateLayerResize = function _M3eNavItemElement_handleStateLayerResize(entries) {
319
+ if (entries.length === 0 || this.orientation === "vertical") return;
320
+ this._inner?.style.setProperty("--_expanded-width", `${entries[0].contentRect.width}px`);
321
+ };
322
+ _M3eNavItemElement_initResizeObserver = function _M3eNavItemElement_initResizeObserver() {
323
+ if (this._stateLayer && __classPrivateFieldGet(this, _M3eNavItemElement_inRail, "f")) {
324
+ __classPrivateFieldGet(this, _M3eNavItemElement_resizeController, "f").observe(this._stateLayer);
325
+ }
294
326
  };
295
327
  /** The styles of the element. */
296
- M3eNavItemElement.styles = css`: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, ${DesignToken.typescale.standard.label.medium.fontSize}); font-weight: var( --m3e-nav-item-label-text-font-weight, ${DesignToken.typescale.standard.label.medium.fontWeight} ); line-height: var( --m3e-nav-item-label-text-line-height, ${DesignToken.typescale.standard.label.medium.lineHeight} ); letter-spacing: var(--m3e-nav-item-label-text-tracking, ${DesignToken.typescale.standard.label.medium.tracking}); border-radius: var(--m3e-nav-item-shape, ${DesignToken.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%; } .icon { position: absolute; } .label { vertical-align: middle; } ::slotted([slot="icon"]), ::slotted([slot="selected-icon"]) { width: 1em; font-size: var(--m3e-nav-item-icon-size, 1.5rem) !important; } :host(:not([selected])) slot[name="selected-icon"], :host(:not(:state(-with-selected-icon))) slot[name="selected-icon"], :host([selected]:state(-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, ${DesignToken.color.onSecondaryContainer} ); --m3e-state-layer-focus-color: var( --m3e-nav-item-inactive-focus-state-layer-color, ${DesignToken.color.onSecondaryContainer} ); --m3e-ripple-color: var( --m3e-nav-item-inactive-pressed-state-layer-color, ${DesignToken.color.onSecondaryContainer} ); } :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label { color: var(--m3e-nav-item-inactive-label-text-color, ${DesignToken.color.onSurfaceVariant}); } :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon { color: var(--m3e-nav-item-inactive-icon-color, ${DesignToken.color.onSurfaceVariant}); } :host([selected]:not(:disabled):not([disabled-interactive])) .outer { --m3e-state-layer-hover-color: var( --m3e-nav-item-active-hover-state-layer-color, ${DesignToken.color.onSecondaryContainer} ); --m3e-state-layer-focus-color: var( --m3e-nav-item-active-focus-state-layer-color, ${DesignToken.color.onSecondaryContainer} ); --m3e-ripple-color: var( --m3e-nav-item-active-pressed-state-layer-color, ${DesignToken.color.onSecondaryContainer} ); } :host([selected]:not(:disabled):not([disabled-interactive]):not([orientation="horizontal"])) .label { color: var(--m3e-nav-item-active-label-text-color, ${DesignToken.color.secondary}); } :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer { background-color: var(--m3e-nav-item-active-container-color, ${DesignToken.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, ${DesignToken.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="vertical"]) .base { margin-block: 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([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, ${DesignToken.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"]) .inner { height: var(--m3e-horizontal-nav-item-active-indicator-height, 2.5rem); width: fit-content; } .state-layer, .ripple { margin-inline: auto; } :host(:disabled) .label, :host([disabled-interactive]) .label { color: color-mix( in srgb, var(--m3e-nav-item-disabled-label-text-color, ${DesignToken.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, ${DesignToken.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 (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; } }`;
328
+ M3eNavItemElement.styles = css`: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, ${DesignToken.typescale.standard.label.medium.fontSize}); font-weight: var( --m3e-nav-item-label-text-font-weight, ${DesignToken.typescale.standard.label.medium.fontWeight} ); line-height: var( --m3e-nav-item-label-text-line-height, ${DesignToken.typescale.standard.label.medium.lineHeight} ); letter-spacing: var(--m3e-nav-item-label-text-tracking, ${DesignToken.typescale.standard.label.medium.tracking}); border-radius: var(--m3e-nav-item-shape, ${DesignToken.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: ${unsafeCSS(`margin-top ${DesignToken.motion.duration.short1} ${DesignToken.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: ${unsafeCSS(`height ${DesignToken.motion.duration.short1} ${DesignToken.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, ${DesignToken.color.onSecondaryContainer} ); --m3e-state-layer-focus-color: var( --m3e-nav-item-inactive-focus-state-layer-color, ${DesignToken.color.onSecondaryContainer} ); --m3e-ripple-color: var( --m3e-nav-item-inactive-pressed-state-layer-color, ${DesignToken.color.onSecondaryContainer} ); } :host(:not([selected]):not(:disabled):not([disabled-interactive])) .label { color: var(--m3e-nav-item-inactive-label-text-color, ${DesignToken.color.onSurfaceVariant}); } :host(:not([selected]):not(:disabled):not([disabled-interactive])) .icon { color: var(--m3e-nav-item-inactive-icon-color, ${DesignToken.color.onSurfaceVariant}); } :host([selected]:not(:disabled):not([disabled-interactive])) .outer { --m3e-state-layer-hover-color: var( --m3e-nav-item-active-hover-state-layer-color, ${DesignToken.color.onSecondaryContainer} ); --m3e-state-layer-focus-color: var( --m3e-nav-item-active-focus-state-layer-color, ${DesignToken.color.onSecondaryContainer} ); --m3e-ripple-color: var( --m3e-nav-item-active-pressed-state-layer-color, ${DesignToken.color.onSecondaryContainer} ); } :host([selected]:not(:disabled):not([disabled-interactive]):not([orientation="horizontal"])) .label { color: var(--m3e-nav-item-active-label-text-color, ${DesignToken.color.secondary}); } :host([selected]:not(:disabled):not([disabled-interactive])) .state-layer { background-color: var(--m3e-nav-item-active-container-color, ${DesignToken.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, ${DesignToken.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 ${DesignToken.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, ${DesignToken.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: ${unsafeCSS(`slide-down ${DesignToken.motion.duration.short2} ${DesignToken.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: ${unsafeCSS(`slide-up ${DesignToken.motion.duration.short2} ${DesignToken.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 ${DesignToken.motion.duration.medium1}; } :host(:not(:is(:state(--no-animate), :--no-animate))[orientation="vertical"]) .label { animation: vertical-fade-in ${DesignToken.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, ${DesignToken.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, ${DesignToken.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; } }`;
297
329
  __decorate([query(".focus-ring")], M3eNavItemElement.prototype, "_focusRing", void 0);
298
330
  __decorate([query(".state-layer")], M3eNavItemElement.prototype, "_stateLayer", void 0);
299
331
  __decorate([query(".ripple")], M3eNavItemElement.prototype, "_ripple", void 0);
332
+ __decorate([query(".inner")], M3eNavItemElement.prototype, "_inner", void 0);
300
333
  __decorate([property({
301
334
  reflect: true
302
335
  })], M3eNavItemElement.prototype, "orientation", void 0);
@@ -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 } 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 renderPseudoLink,\r\n Role,\r\n Selected,\r\n setCustomState,\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 LinkButton(\r\n Selected(KeyboardClick(Focusable(DisabledInteractive(Disabled(AttachInternals(Role(LitElement, \"button\"), true)))))),\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 .icon {\r\n position: absolute;\r\n }\r\n .label {\r\n vertical-align: middle;\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([selected])) slot[name=\"selected-icon\"],\r\n :host(:not(:state(-with-selected-icon))) slot[name=\"selected-icon\"],\r\n :host([selected]:state(-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=\"vertical\"]) .base {\r\n margin-block: 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([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\"]) .inner {\r\n height: var(--m3e-horizontal-nav-item-active-indicator-height, 2.5rem);\r\n width: fit-content;\r\n }\r\n .state-layer,\r\n .ripple {\r\n margin-inline: auto;\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 (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 */ 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\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 /** @inheritdoc */\r\n override connectedCallback(): void {\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 }\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 }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n const disabled = this.disabled || this.disabledInteractive;\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\" aria-hidden=\"true\">\r\n <slot name=\"icon\"></slot>\r\n <slot name=\"selected-icon\" @slotchange=\"${this.#handleSelectedIconSlotChange}\"></slot>\r\n </div>\r\n </div>\r\n <div class=\"label\">\r\n <slot></slot>\r\n </div>\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\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","LinkButton","Selected","KeyboardClick","Focusable","DisabledInteractive","Disabled","_M3eNavItemElement_clickHandler","navBar","closest","connectedCallback","addEventListener","capture","removeEventListener","update","ariaSelected","ariaPressed","ariaCurrent","icon","toggleAttribute","notifySelectionChange","updated","_changedProperties","_focusRing","attach","firstUpdated","_stateLayer","_ripple","disabled","disabledInteractive","nothing","renderPseudoLink","_M3eNavItemElement_instances","_M3eNavItemElement_handleSelectedIconSlotChange","defaultPrevented","composed","cancelable","hasAssignedNodes","target","typescale","standard","label","medium","fontSize","fontWeight","lineHeight","tracking","shape","corner","full","onSecondaryContainer","onSurfaceVariant","secondary","secondaryContainer","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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AC,CAAmD,EAAAvD,iBAAA,CAAAJ,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAChCF,UAAA,CAAA,CAAvC6D,KAAK,CAAC,cAAc,CAAC,CAAqD,EAAAvD,iBAAA,CAAAJ,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AACxCF,UAAA,CAAA,CAAlC6D,KAAK,CAAC,SAAS,CAAC,CAA6C,EAAAvD,iBAAA,CAAAJ,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAMjDF,UAAA,CAAA,CAA5BG,QAAQ,CAAC;AAAEC,EAAAA,OAAO,EAAE;CAAM,CAAC,CAA8C,EAAAE,iBAAA,CAAAJ,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AA7P/DI,iBAAiB,GAAAN,UAAA,CAAA,CAD7BK,aAAa,CAAC,cAAc,CAAC,CACjB,EAAAC,iBAAiB,CA2V7B;;;;"}
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,g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AuC,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 e,__classPrivateFieldSet as t,__decorate as i}from"tslib";import{LitElement as a,html as o,css as n,nothing as r}from"lit";import{state as l,property as s,query as c}from"lit/decorators.js";import{ReconnectedCallback as d,AttachInternals as h,Role as m,setCustomState as v,DesignToken as b,customElement as p,LinkButton as u,Selected as f,KeyboardClick as g,Focusable as y,DisabledInteractive as w,Disabled as x,renderPseudoLink as $,hasAssignedNodes as k}from"@m3e/web/core";import{SelectionManager as z,selectionManager as _}from"@m3e/web/core/a11y";import{M3eBreakpointObserver as S,Breakpoint as C}from"@m3e/web/core/layout";var E,I,j,B,W,M;let T=class extends(d(h(m(a,"navigation")))){constructor(){super(...arguments),E.add(this),this[M]=(new z).disableRovingTabIndex(),I.set(this,void 0),this.mode="compact"}get items(){return this[_].items}get selected(){return this[_].selectedItems[0]??null}get currentMode(){return this._mode??("compact"!==this.mode?"expanded":"compact")}set currentMode(e){this._mode=e}disconnectedCallback(){super.disconnectedCallback(),this._mode=void 0,e(this,I,"f")?.call(this)}reconnectedCallback(){super.reconnectedCallback(),"auto"===this.mode&&e(this,E,"m",j).call(this)}willUpdate(t){super.willUpdate(t),t.has("mode")&&(e(this,I,"f")?.call(this),"auto"===this.mode?e(this,E,"m",j).call(this):(this._mode=void 0,this._updateItems())),t.has("_mode")&&this._updateItems()}render(){return o`<div class="base"><slot @change="${e(this,E,"m",W)}" @slotchange="${e(this,E,"m",B)}"></slot></div>`}_updateItems(){const e="compact"===this.currentMode?"vertical":"horizontal";this._updateOrientation(e),v(this,"-compact","vertical"===e)}_updateOrientation(e){this[_].items.forEach(t=>t.orientation=e)}};var L,R,U,A;I=new WeakMap,E=new WeakSet,M=_,j=function(){t(this,I,S.observe([C.XSmall,C.Small],e=>{this._mode=e.get(C.XSmall)||e.get(C.Small)?"compact":"expanded",this._updateItems()}),"f")},B=function(){this[_].setItems([...this.querySelectorAll("m3e-nav-item")]),this._updateItems()},W=function(e){e.stopPropagation(),this.dispatchEvent(new Event("change",{bubbles:!0}))},T.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()],T.prototype,"_mode",void 0),i([s({reflect:!0})],T.prototype,"mode",void 0),T=i([p("m3e-nav-bar")],T);let P=class extends(u(f(g(y(w(x(h(m(a,"button"),!0)))))))){constructor(){super(...arguments),L.add(this),R.set(this,t=>e(this,L,"m",U).call(this,t)),this.orientation="vertical"}get navBar(){return this.closest("m3e-nav-bar")??this.closest("m3e-nav-rail")??null}connectedCallback(){super.connectedCallback(),this.addEventListener("click",e(this,R,"f"),{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",e(this,R,"f"),{capture:!0})}update(e){if(super.update(e),e.has("selected")){this.ariaSelected=null,this.ariaPressed=null,this.ariaCurrent=`${this.selected}`;for(const e of this.querySelectorAll("m3e-icon"))e.toggleAttribute("filled",this.selected);this.navBar?.[_].notifySelectionChange(this)}}updated(e){super.updated(e),e.has("orientation")&&this._focusRing?.attach(this)}firstUpdated(e){super.firstUpdated(e),[this._focusRing,this._stateLayer,this._ripple].forEach(e=>e?.attach(this))}render(){const t=this.disabled||this.disabledInteractive;return o`${"vertical"===this.orientation?o`<m3e-focus-ring class="focus-ring" inward></m3e-focus-ring>`:r}<div class="outer">${this[$]()}<div class="inner">${"horizontal"===this.orientation?o`<m3e-focus-ring class="focus-ring"></m3e-focus-ring>`:r}<m3e-state-layer class="state-layer" ?disabled="${t}"></m3e-state-layer><m3e-ripple class="ripple" centered ?disabled="${t}"></m3e-ripple><div class="touch" aria-hidden="true"></div><div class="base"><div class="icon-wrapper" aria-hidden="true"><div class="icon" aria-hidden="true"><slot name="icon"></slot><slot name="selected-icon" @slotchange="${e(this,L,"m",A)}"></slot></div></div><div class="label"><slot></slot></div></div></div></div>`}};R=new WeakMap,L=new WeakSet,U=function(e){e.defaultPrevented||(this.selected=!0,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0,cancelable:!0}))?(this.navBar?.[_].notifySelectionChange(this),this.dispatchEvent(new Event("change",{bubbles:!0}))):this.selected=!1)},A=function(e){v(this,"-with-selected-icon",k(e.target))},P.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%; } .icon { position: absolute; } .label { vertical-align: middle; } ::slotted([slot="icon"]), ::slotted([slot="selected-icon"]) { width: 1em; font-size: var(--m3e-nav-item-icon-size, 1.5rem) !important; } :host(:not([selected])) slot[name="selected-icon"], :host(:not(:state(-with-selected-icon))) slot[name="selected-icon"], :host([selected]:state(-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="vertical"]) .base { margin-block: 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([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"]) .inner { height: var(--m3e-horizontal-nav-item-active-indicator-height, 2.5rem); width: fit-content; } .state-layer, .ripple { margin-inline: auto; } :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 (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([c(".focus-ring")],P.prototype,"_focusRing",void 0),i([c(".state-layer")],P.prototype,"_stateLayer",void 0),i([c(".ripple")],P.prototype,"_ripple",void 0),i([s({reflect:!0})],P.prototype,"orientation",void 0),P=i([p("m3e-nav-item")],P);export{T as M3eNavBarElement,P 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