@m3e/web 2.5.3 → 2.5.5

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 (210) hide show
  1. package/dist/all.js +394 -348
  2. package/dist/all.js.map +1 -1
  3. package/dist/all.min.js +56 -56
  4. package/dist/all.min.js.map +1 -1
  5. package/dist/autocomplete.js +14 -14
  6. package/dist/autocomplete.js.map +1 -1
  7. package/dist/autocomplete.min.js +1 -1
  8. package/dist/autocomplete.min.js.map +1 -1
  9. package/dist/bottom-sheet.js +11 -14
  10. package/dist/bottom-sheet.js.map +1 -1
  11. package/dist/bottom-sheet.min.js +1 -1
  12. package/dist/bottom-sheet.min.js.map +1 -1
  13. package/dist/breadcrumb.js +4 -4
  14. package/dist/breadcrumb.js.map +1 -1
  15. package/dist/breadcrumb.min.js +1 -1
  16. package/dist/breadcrumb.min.js.map +1 -1
  17. package/dist/button-group.js +5 -5
  18. package/dist/button-group.js.map +1 -1
  19. package/dist/button-group.min.js +1 -1
  20. package/dist/button-group.min.js.map +1 -1
  21. package/dist/button.js +15 -15
  22. package/dist/button.js.map +1 -1
  23. package/dist/button.min.js +1 -1
  24. package/dist/button.min.js.map +1 -1
  25. package/dist/checkbox.js +1 -1
  26. package/dist/checkbox.js.map +1 -1
  27. package/dist/checkbox.min.js +1 -1
  28. package/dist/checkbox.min.js.map +1 -1
  29. package/dist/chips.js +11 -11
  30. package/dist/chips.js.map +1 -1
  31. package/dist/chips.min.js +1 -1
  32. package/dist/chips.min.js.map +1 -1
  33. package/dist/core-a11y.js +5 -3
  34. package/dist/core-a11y.js.map +1 -1
  35. package/dist/core-a11y.min.js +4 -4
  36. package/dist/core-a11y.min.js.map +1 -1
  37. package/dist/core-anchoring.js +4 -4
  38. package/dist/core-anchoring.js.map +1 -1
  39. package/dist/core-anchoring.min.js +1 -1
  40. package/dist/core-anchoring.min.js.map +1 -1
  41. package/dist/core.js +78 -64
  42. package/dist/core.js.map +1 -1
  43. package/dist/core.min.js +1 -1
  44. package/dist/core.min.js.map +1 -1
  45. package/dist/css-custom-data.json +200 -185
  46. package/dist/custom-elements.json +1598 -1524
  47. package/dist/datepicker.js +12 -12
  48. package/dist/datepicker.js.map +1 -1
  49. package/dist/datepicker.min.js +1 -1
  50. package/dist/datepicker.min.js.map +1 -1
  51. package/dist/dialog.js +4 -4
  52. package/dist/dialog.js.map +1 -1
  53. package/dist/dialog.min.js +1 -1
  54. package/dist/dialog.min.js.map +1 -1
  55. package/dist/drawer-container.js +14 -14
  56. package/dist/drawer-container.js.map +1 -1
  57. package/dist/drawer-container.min.js +1 -1
  58. package/dist/drawer-container.min.js.map +1 -1
  59. package/dist/expansion-panel.js +4 -4
  60. package/dist/expansion-panel.js.map +1 -1
  61. package/dist/expansion-panel.min.js +1 -1
  62. package/dist/expansion-panel.min.js.map +1 -1
  63. package/dist/fab-menu.js +4 -4
  64. package/dist/fab-menu.js.map +1 -1
  65. package/dist/fab-menu.min.js +1 -1
  66. package/dist/fab-menu.min.js.map +1 -1
  67. package/dist/fab.js +2 -2
  68. package/dist/fab.js.map +1 -1
  69. package/dist/fab.min.js +1 -1
  70. package/dist/fab.min.js.map +1 -1
  71. package/dist/form-field.js +19 -19
  72. package/dist/form-field.js.map +1 -1
  73. package/dist/form-field.min.js +2 -2
  74. package/dist/form-field.min.js.map +1 -1
  75. package/dist/html-custom-data.json +54 -44
  76. package/dist/icon-button.js +15 -15
  77. package/dist/icon-button.js.map +1 -1
  78. package/dist/icon-button.min.js +1 -1
  79. package/dist/icon-button.min.js.map +1 -1
  80. package/dist/icon.js +1 -1
  81. package/dist/icon.js.map +1 -1
  82. package/dist/icon.min.js +1 -1
  83. package/dist/icon.min.js.map +1 -1
  84. package/dist/list.js +16 -16
  85. package/dist/list.js.map +1 -1
  86. package/dist/list.min.js +1 -1
  87. package/dist/list.min.js.map +1 -1
  88. package/dist/menu.js +20 -20
  89. package/dist/menu.js.map +1 -1
  90. package/dist/menu.min.js +1 -1
  91. package/dist/menu.min.js.map +1 -1
  92. package/dist/nav-bar.js +40 -10
  93. package/dist/nav-bar.js.map +1 -1
  94. package/dist/nav-bar.min.js +1 -1
  95. package/dist/nav-bar.min.js.map +1 -1
  96. package/dist/nav-menu.js +10 -10
  97. package/dist/nav-menu.js.map +1 -1
  98. package/dist/nav-menu.min.js +1 -1
  99. package/dist/nav-menu.min.js.map +1 -1
  100. package/dist/nav-rail.js +15 -11
  101. package/dist/nav-rail.js.map +1 -1
  102. package/dist/nav-rail.min.js +1 -1
  103. package/dist/nav-rail.min.js.map +1 -1
  104. package/dist/option.js +13 -13
  105. package/dist/option.js.map +1 -1
  106. package/dist/option.min.js +1 -1
  107. package/dist/option.min.js.map +1 -1
  108. package/dist/paginator.js +2 -2
  109. package/dist/paginator.js.map +1 -1
  110. package/dist/paginator.min.js +2 -2
  111. package/dist/paginator.min.js.map +1 -1
  112. package/dist/radio-group.js +2 -2
  113. package/dist/radio-group.js.map +1 -1
  114. package/dist/radio-group.min.js +1 -1
  115. package/dist/radio-group.min.js.map +1 -1
  116. package/dist/search.js +15 -15
  117. package/dist/search.js.map +1 -1
  118. package/dist/search.min.js +1 -1
  119. package/dist/search.min.js.map +1 -1
  120. package/dist/segmented-button.js +7 -7
  121. package/dist/segmented-button.js.map +1 -1
  122. package/dist/segmented-button.min.js +1 -1
  123. package/dist/segmented-button.min.js.map +1 -1
  124. package/dist/select.js +6 -6
  125. package/dist/select.js.map +1 -1
  126. package/dist/select.min.js +1 -1
  127. package/dist/select.min.js.map +1 -1
  128. package/dist/slider.js +5 -5
  129. package/dist/slider.js.map +1 -1
  130. package/dist/slider.min.js +1 -1
  131. package/dist/slider.min.js.map +1 -1
  132. package/dist/split-pane.js +10 -10
  133. package/dist/split-pane.js.map +1 -1
  134. package/dist/split-pane.min.js +1 -1
  135. package/dist/split-pane.min.js.map +1 -1
  136. package/dist/src/autocomplete/AutocompleteElement.d.ts.map +1 -1
  137. package/dist/src/bottom-sheet/BottomSheetElement.d.ts +1 -1
  138. package/dist/src/bottom-sheet/BottomSheetElement.d.ts.map +1 -1
  139. package/dist/src/button/styles/ButtonSizeStyle.d.ts.map +1 -1
  140. package/dist/src/button/styles/ButtonStyle.d.ts.map +1 -1
  141. package/dist/src/button/styles/ButtonVariantStyle.d.ts.map +1 -1
  142. package/dist/src/button-group/ButtonGroupElement.d.ts.map +1 -1
  143. package/dist/src/checkbox/CheckboxElement.d.ts.map +1 -1
  144. package/dist/src/chips/InputChipElement.d.ts.map +1 -1
  145. package/dist/src/core/a11y/InteractivityChecker.d.ts +2 -1
  146. package/dist/src/core/a11y/InteractivityChecker.d.ts.map +1 -1
  147. package/dist/src/core/anchoring/FloatingPanelElement.d.ts +1 -1
  148. package/dist/src/core/shared/mixins/SuppressInitialAnimation.d.ts +9 -2
  149. package/dist/src/core/shared/mixins/SuppressInitialAnimation.d.ts.map +1 -1
  150. package/dist/src/core/shared/mixins/index.d.ts +0 -1
  151. package/dist/src/core/shared/mixins/index.d.ts.map +1 -1
  152. package/dist/src/core/shared/primitives/CollapsibleElement.d.ts +13 -0
  153. package/dist/src/core/shared/primitives/CollapsibleElement.d.ts.map +1 -1
  154. package/dist/src/core/shared/primitives/CollapsibleOrientation.d.ts +3 -0
  155. package/dist/src/core/shared/primitives/CollapsibleOrientation.d.ts.map +1 -0
  156. package/dist/src/core/shared/primitives/index.d.ts +1 -0
  157. package/dist/src/core/shared/primitives/index.d.ts.map +1 -1
  158. package/dist/src/datepicker/DatepickerElement.d.ts +1 -1
  159. package/dist/src/dialog/DialogElement.d.ts.map +1 -1
  160. package/dist/src/drawer-container/styles/DrawerContainerStyle.d.ts.map +1 -1
  161. package/dist/src/expansion-panel/ExpansionPanelElement.d.ts.map +1 -1
  162. package/dist/src/fab/FabElement.d.ts.map +1 -1
  163. package/dist/src/fab/styles/FabStyle.d.ts.map +1 -1
  164. package/dist/src/fab-menu/FabMenuElement.d.ts +1 -1
  165. package/dist/src/form-field/FormFieldElement.d.ts.map +1 -1
  166. package/dist/src/icon/IconElement.d.ts.map +1 -1
  167. package/dist/src/icon-button/styles/IconButtonSizeStyle.d.ts.map +1 -1
  168. package/dist/src/icon-button/styles/IconButtonStyle.d.ts.map +1 -1
  169. package/dist/src/icon-button/styles/IconButtonVariantStyle.d.ts.map +1 -1
  170. package/dist/src/menu/MenuElement.d.ts +1 -1
  171. package/dist/src/nav-bar/NavItemElement.d.ts +7 -1
  172. package/dist/src/nav-bar/NavItemElement.d.ts.map +1 -1
  173. package/dist/src/nav-menu/NavMenuItemElement.d.ts.map +1 -1
  174. package/dist/src/nav-rail/NavRailElement.d.ts +10 -5
  175. package/dist/src/nav-rail/NavRailElement.d.ts.map +1 -1
  176. package/dist/src/paginator/PaginatorElement.d.ts.map +1 -1
  177. package/dist/src/search/SearchBarElement.d.ts.map +1 -1
  178. package/dist/src/search/SearchViewElement.d.ts.map +1 -1
  179. package/dist/src/search/styles/SearchBarStyle.d.ts.map +1 -1
  180. package/dist/src/split-pane/SplitPaneElement.d.ts.map +1 -1
  181. package/dist/src/stepper/StepperElement.d.ts.map +1 -1
  182. package/dist/src/toolbar/ToolbarElement.d.ts.map +1 -1
  183. package/dist/src/tree/TreeItemElement.d.ts.map +1 -1
  184. package/dist/stepper.js +6 -6
  185. package/dist/stepper.js.map +1 -1
  186. package/dist/stepper.min.js +1 -1
  187. package/dist/stepper.min.js.map +1 -1
  188. package/dist/tabs.js +5 -5
  189. package/dist/tabs.js.map +1 -1
  190. package/dist/tabs.min.js +1 -1
  191. package/dist/tabs.min.js.map +1 -1
  192. package/dist/toc.js +7 -7
  193. package/dist/toc.js.map +1 -1
  194. package/dist/toc.min.js +1 -1
  195. package/dist/toc.min.js.map +1 -1
  196. package/dist/toolbar.js +2 -1
  197. package/dist/toolbar.js.map +1 -1
  198. package/dist/toolbar.min.js +1 -1
  199. package/dist/toolbar.min.js.map +1 -1
  200. package/dist/tooltip.js +3 -3
  201. package/dist/tooltip.js.map +1 -1
  202. package/dist/tooltip.min.js +1 -1
  203. package/dist/tooltip.min.js.map +1 -1
  204. package/dist/tree.js +9 -9
  205. package/dist/tree.js.map +1 -1
  206. package/dist/tree.min.js +1 -1
  207. package/dist/tree.min.js.map +1 -1
  208. package/package.json +1 -1
  209. package/dist/src/core/shared/mixins/EventAttribute.d.ts +0 -11
  210. package/dist/src/core/shared/mixins/EventAttribute.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"stepper.min.js","sources":["../../src/stepper/StepPanelElement.ts","../../src/stepper/StepElement.ts","../../src/stepper/StepperButtonElementBase.ts","../../src/stepper/StepperElement.ts","../../src/stepper/StepperNextElement.ts","../../src/stepper/StepperPreviousElement.ts","../../src/stepper/StepperResetElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement } from \"lit\";\r\nimport { state } from \"lit/decorators.js\";\r\n\r\nimport { customElement, Role } from \"@m3e/web/core\";\r\n\r\n/**\r\n * A panel presented for a step in a wizard-like workflow.\r\n *\r\n * @description\r\n * The `m3e-step-panel` is a container for presenting contextual content and actions\r\n * associated with a single step in a structured workflow.\r\n *\r\n * @example\r\n * The following example demonstrates a linear multi-step form flow using the `m3e-stepper`\r\n * component. Each `m3e-step` defines a navigable step label, linked to its corresponding\r\n * `m3e-step-panel` via the `for` attribute. Navigation is orchestrated using the\r\n * `m3e-stepper-next`, `m3e-stepper-previous`, and `m3e-stepper-reset` components.\r\n *\r\n * <m3e-stepper>\r\n * <m3e-step for=\"step1\">Fill out your name</m3e-step>\r\n * <m3e-step for=\"step2\">Fill out your address</m3e-step>\r\n * <m3e-step for=\"step3\">Done</m3e-step>\r\n * <m3e-step-panel id=\"step1\">\r\n * <form>\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"name\">Name</label>\r\n * <input name=\"name\" id=\"name\" required />\r\n * </m3e-form-field>\r\n * </form>\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * <m3e-step-panel id=\"step2\">\r\n * <form>\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"address\">Address</label>\r\n * <input name=\"address\" id=\"address\" required />\r\n * </m3e-form-field>\r\n * </form>\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>\r\n * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * <m3e-step-panel id=\"step3\">Done\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>\r\n * <m3e-button><m3e-stepper-reset>Reset</m3e-stepper-reset></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * </m3e-stepper>\r\n *\r\n * @tag m3e-step-panel\r\n *\r\n * @slot - Renders the content of the panel.\r\n * @slot actions- Renders the actions bar of the panel.\r\n *\r\n * @cssprop --m3e-step-panel-padding - Padding inside the step panel container, defining internal spacing around content.\r\n * @cssprop --m3e-step-panel-spacing - Vertical gap between stacked elements within the step panel.\r\n * @cssprop --m3e-step-panel-actions-height - Minimum height of the slotted actions container.\r\n */\r\n@customElement(\"m3e-step-panel\")\r\nexport class M3eStepPanelElement extends Role(LitElement, \"tabpanel\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n }\r\n .content {\r\n display: flex;\r\n flex-direction: column;\r\n padding: var(--m3e-step-panel-padding, 1rem 1.5rem 1.5rem 1.5rem);\r\n row-gap: var(--m3e-step-panel-spacing, 0.5rem);\r\n }\r\n ::slotted([slot=\"actions\"]) {\r\n flex: none;\r\n display: flex;\r\n align-items: center;\r\n min-height: var(--m3e-step-panel-actions-height, 3rem);\r\n }\r\n ::slotted([slot=\"actions\"][end]) {\r\n justify-content: flex-end;\r\n }\r\n `;\r\n\r\n /** @internal */\r\n @state() active = false;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n this.slot = \"panel\";\r\n\r\n super.connectedCallback();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<m3e-collapsible ?open=${this.active}>\r\n <div class=\"content\">\r\n <div><slot></slot></div>\r\n <slot name=\"actions\"></slot>\r\n </div>\r\n </m3e-collapsible>`;\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-step-panel\": M3eStepPanelElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues } from \"lit\";\r\nimport { property, query, state } from \"lit/decorators.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n Focusable,\r\n HtmlFor,\r\n KeyboardClick,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n Role,\r\n Selected,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { addAriaReferencedId, removeAriaReferencedId, selectionManager } from \"@m3e/web/core/a11y\";\r\n\r\nimport type { M3eStepperElement } from \"./StepperElement\";\r\nimport { M3eStepPanelElement } from \"./StepPanelElement\";\r\n\r\n/**\r\n * A step in a wizard-like workflow.\r\n *\r\n * @description\r\n * The `m3e-step` component represents a single step in a structured, wizard-like workflow.\r\n * It supports semantic labeling, stateful styling, and optional interaction for completed,\r\n * selected, invalid, or disabled states. It aligns with Material Design guidance for progressive\r\n * disclosure, accessible navigation, and visual continuity across horizontal and vertical layouts.\r\n *\r\n * @example\r\n * The following example demonstrates a linear multi-step form flow using the `m3e-stepper`\r\n * component. Each `m3e-step` defines a navigable step label, linked to its corresponding\r\n * `m3e-step-panel` via the `for` attribute. Navigation is orchestrated using the\r\n * `m3e-stepper-next`, `m3e-stepper-previous`, and `m3e-stepper-reset` components.\r\n *\r\n * <m3e-stepper>\r\n * <m3e-step for=\"step1\">Fill out your name</m3e-step>\r\n * <m3e-step for=\"step2\">Fill out your address</m3e-step>\r\n * <m3e-step for=\"step3\">Done</m3e-step>\r\n * <m3e-step-panel id=\"step1\">\r\n * <form>\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"name\">Name</label>\r\n * <input name=\"name\" id=\"name\" required />\r\n * </m3e-form-field>\r\n * </form>\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * <m3e-step-panel id=\"step2\">\r\n * <form>\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"address\">Address</label>\r\n * <input name=\"address\" id=\"address\" required />\r\n * </m3e-form-field>\r\n * </form>\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>\r\n * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * <m3e-step-panel id=\"step3\">Done\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>\r\n * <m3e-button><m3e-stepper-reset>Reset</m3e-stepper-reset></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * </m3e-stepper>\r\n *\r\n * @tag m3e-step\r\n *\r\n * @slot - Renders the label of the step.\r\n * @slot icon - Renders the icon of the step.\r\n * @slot done-icon - Renders the icon of a completed step.\r\n * @slot edit-icon - Renders the icon of a completed editable step.\r\n * @slot error-icon - Renders icon of an invalid step.\r\n * @slot hint - Renders the hint text of the step.\r\n * @slot error - Renders the error message for an invalid step.\r\n *\r\n * @attr completed - Whether the step has been completed.\r\n * @attr disabled - Whether the element is disabled.\r\n * @attr editable - Whether the step is editable and users can return to it after completion.\r\n * @attr for - The identifier of the interactive control to which this element is attached.\r\n * @attr optional - Whether the step is optional.\r\n * @attr selected - Whether the element is selected.\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-step-shape - Border radius of the step container, defining its visual shape.\r\n * @cssprop --m3e-step-padding - Internal padding of the step container, used for layout spacing.\r\n * @cssprop --m3e-step-icon-shape - Border radius of the icon container, controlling its geometric form.\r\n * @cssprop --m3e-step-icon-size - Width and height of the icon container and icon glyph.\r\n * @cssprop --m3e-step-selected-icon-container-color - Background color of the icon when the step is selected.\r\n * @cssprop --m3e-step-selected-icon-color - Foreground color of the icon when the step is selected.\r\n * @cssprop --m3e-step-completed-icon-container-color - Background color of the icon when the step is completed.\r\n * @cssprop --m3e-step-completed-icon-color - Foreground color of the icon when the step is completed.\r\n * @cssprop --m3e-step-unselected-icon-container-color - Background color of the icon when the step is inactive.\r\n * @cssprop --m3e-step-unselected-icon-color - Foreground color of the icon when the step is inactive.\r\n * @cssprop --m3e-step-icon-error-color - Foreground color of the icon when the step is invalid.\r\n * @cssprop --m3e-step-disabled-icon-container-color - Base color used to mix the disabled icon background.\r\n * @cssprop --m3e-step-disabled-icon-color - Base color used to mix the disabled icon foreground.\r\n * @cssprop --m3e-step-label-color - Text color of the step label in its default state.\r\n * @cssprop --m3e-step-label-error-color - Text color of the step label when the step is invalid.\r\n * @cssprop --m3e-step-disabled-label-color - Base color used to mix the disabled label foreground.\r\n * @cssprop --m3e-step-font-size - Font size of the step label.\r\n * @cssprop --m3e-step-font-weight - Font weight of the step label.\r\n * @cssprop --m3e-step-line-height - Line height of the step label.\r\n * @cssprop --m3e-step-tracking - Letter spacing of the step label.\r\n * @cssprop --m3e-step-icon-label-space - Gap between icon and label.\r\n * @cssprop --m3e-step-hint-font-size - Font size of hint and error messages.\r\n * @cssprop --m3e-step-hint-font-weight - Font weight of hint and error messages.\r\n * @cssprop --m3e-step-hint-line-height - Line height of hint and error messages.\r\n * @cssprop --m3e-step-hint-tracking - Letter spacing of hint and error messages.\r\n * @cssprop --m3e-step-hint-color - Text color of hint messages in valid state.\r\n * @cssprop --m3e-step-disabled-hint-color - Base color used to mix the disabled hint foreground.\r\n */\r\n@customElement(\"m3e-step\")\r\nexport class M3eStepElement extends Selected(\r\n KeyboardClick(Focusable(HtmlFor(Disabled(AttachInternals(Role(LitElement, \"tab\")))))),\r\n) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n outline: none;\r\n min-width: 0px;\r\n position: relative;\r\n user-select: none;\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n .base {\r\n min-width: inherit;\r\n position: relative;\r\n border-radius: var(--m3e-step-shape, ${DesignToken.shape.corner.medium});\r\n padding: var(--m3e-step-padding, 1.5rem);\r\n }\r\n :host(:not([aria-disabled=\"true\"])) {\r\n cursor: pointer;\r\n }\r\n .icon {\r\n flex: none;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n border-radius: var(--m3e-step-icon-shape, 50%);\r\n width: var(--m3e-step-icon-size, 1.5rem);\r\n height: var(--m3e-step-icon-size, 1.5rem);\r\n }\r\n .icon svg,\r\n ::slotted([slot=\"icon\"]),\r\n ::slotted([slot=\"edit-icon\"]),\r\n ::slotted([slot=\"done-icon\"]),\r\n ::slotted([slot=\"error-icon\"]) {\r\n width: 1em;\r\n font-size: var(--m3e-step-icon-size, 1.5rem) !important;\r\n }\r\n :host(:not([aria-disabled=\"true\"])[selected]) .icon {\r\n background-color: var(--m3e-step-selected-icon-container-color, ${DesignToken.color.primary});\r\n color: var(--m3e-step-selected-icon-color, ${DesignToken.color.onPrimary});\r\n }\r\n :host(:not([aria-disabled=\"true\"])[completed]:not([invalid])) .icon {\r\n background-color: var(--m3e-step-completed-icon-container-color, ${DesignToken.color.primary});\r\n color: var(--m3e-step-completed-icon-color, ${DesignToken.color.onPrimary});\r\n }\r\n :host(:not([aria-disabled=\"true\"]):not([selected]):not([completed]):not([invalid])) .icon {\r\n background-color: var(--m3e-step-unselected-icon-container-color, ${DesignToken.color.inverseSurface});\r\n color: var(--m3e-step-unselected-icon-color, ${DesignToken.color.inverseOnSurface});\r\n }\r\n :host(:not([aria-disabled=\"true\"]):not([selected])[invalid]) .icon {\r\n color: var(--m3e-step-icon-error-color, ${DesignToken.color.error});\r\n }\r\n :host([aria-disabled=\"true\"]) .icon {\r\n background-color: color-mix(\r\n in srgb,\r\n var(--m3e-step-disabled-icon-container-color, ${DesignToken.color.onSurface}) 10%,\r\n transparent\r\n );\r\n color: color-mix(in srgb, var(--m3e-step-disabled-icon-color, ${DesignToken.color.onSurface}) 38%, transparent);\r\n }\r\n\r\n :host(:not([aria-disabled=\"true\"])) .label {\r\n color: var(--m3e-step-label-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:not([aria-disabled=\"true\"]):not([selected])[invalid]) .label {\r\n color: var(--m3e-step-label-error-color, ${DesignToken.color.error});\r\n }\r\n :host([aria-disabled=\"true\"]) .label {\r\n color: color-mix(in srgb, var(--m3e-step-disabled-label-color, ${DesignToken.color.onSurface}) 38%, transparent);\r\n }\r\n .wrapper {\r\n display: flex;\r\n align-items: center;\r\n height: 100%;\r\n border-radius: inherit;\r\n font-size: var(--m3e-step-font-size, ${DesignToken.typescale.standard.title.small.fontSize});\r\n font-weight: var(--m3e-step-font-weight, ${DesignToken.typescale.standard.title.small.fontWeight});\r\n line-height: var(--m3e-step-line-height, ${DesignToken.typescale.standard.title.small.lineHeight});\r\n letter-spacing: var(--m3e-step-tracking, ${DesignToken.typescale.standard.title.small.tracking});\r\n flex-direction: var(--_step-direction, row);\r\n gap: var(--m3e-step-icon-label-space, 0.5rem);\r\n justify-content: flex-start;\r\n }\r\n .label {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: var(--_step-label-align-items, flex-start);\r\n }\r\n ::slotted([slot=\"hint\"]),\r\n .hint,\r\n ::slotted([slot=\"error\"]) {\r\n font-size: var(--m3e-step-hint-font-size, ${DesignToken.typescale.standard.body.small.fontSize});\r\n font-weight: var(--m3e-step-hint-font-weight, ${DesignToken.typescale.standard.body.small.fontWeight});\r\n line-height: var(--m3e-step-hint-line-height, ${DesignToken.typescale.standard.body.small.lineHeight});\r\n letter-spacing: var(--m3e-step-hint-tracking, ${DesignToken.typescale.standard.body.small.tracking});\r\n }\r\n :host(:not([aria-disabled=\"true\"]):not([invalid])) ::slotted([slot=\"hint\"]),\r\n :host(:not([aria-disabled=\"true\"]):not([invalid])) .hint {\r\n color: var(--m3e-step-hint-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host([aria-disabled=\"true\"]) ::slotted([slot=\"hint\"]),\r\n :host([aria-disabled=\"true\"]) .hint {\r\n color: color-mix(in srgb, var(--m3e-step-disabled-hint-color, ${DesignToken.color.onSurface}) 38%, transparent);\r\n }\r\n `;\r\n\r\n /** @private */ private static __nextId = 0;\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 */ readonly #clickHandler = (e: Event) => this.#handleClick(e);\r\n\r\n /**\r\n * Whether the step is optional.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) optional = false;\r\n\r\n /**\r\n * Whether the step is editable and users can return to it after completion.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) editable = false;\r\n\r\n /**\r\n * Whether the step has been completed.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) completed = false;\r\n\r\n /**\r\n * Whether the step has an error.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) invalid = false;\r\n\r\n /** @internal */\r\n @state() index = -1;\r\n\r\n /** A reference to the panel controlled by the step. */\r\n get panel(): M3eStepPanelElement | null {\r\n return this.control instanceof M3eStepPanelElement ? this.control : null;\r\n }\r\n\r\n /** The stepper to which this step belongs. */\r\n get stepper(): M3eStepperElement | null {\r\n return this.closest(\"m3e-stepper\");\r\n }\r\n\r\n /** Resets the step to its initial state, clearing any form data. */\r\n reset(): void {\r\n this.invalid = false;\r\n this.completed = false;\r\n this.panel?.querySelector(\"form\")?.reset();\r\n }\r\n\r\n /** @inheritdoc */\r\n override attach(control: HTMLElement): void {\r\n if (control instanceof M3eStepPanelElement) {\r\n control.id = control.id || `m3e-step-panel-${M3eStepElement.__nextId++}`;\r\n addAriaReferencedId(this, \"aria-controls\", control.id);\r\n control.style.order = this.style.order;\r\n }\r\n super.attach(control);\r\n }\r\n\r\n /** @inheritdoc */\r\n override detach(): void {\r\n if (this.control) {\r\n this.control.style.order = \"\";\r\n if (this.control.id) {\r\n removeAriaReferencedId(this, \"aria-controls\", this.control.id);\r\n }\r\n }\r\n\r\n super.detach();\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n this.slot = \"step\";\r\n\r\n super.connectedCallback();\r\n this.addEventListener(\"click\", this.#clickHandler);\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n this.removeEventListener(\"click\", this.#clickHandler);\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.closest(\"m3e-stepper\")?.[selectionManager].notifySelectionChange(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 hint = html`<slot name=\"hint\">${this.optional ? html`<span class=\"hint\">(Optional)</span>` : nothing}</slot>`;\r\n const error = html`<slot name=\"error\">${hint}</slot>`;\r\n\r\n return html`<div class=\"base\">\r\n <m3e-state-layer class=\"state-layer\" ?disabled=\"${this.disabled}\"></m3e-state-layer>\r\n <m3e-focus-ring class=\"focus-ring\" ?disabled=\"${this.disabled}\"></m3e-focus-ring>\r\n <m3e-ripple class=\"ripple\" ?disabled=\"${this.disabled}\"></m3e-ripple>\r\n <div class=\"wrapper\">\r\n <div class=\"icon\" aria-hidden=\"true\">${this.#renderIcon()}</div>\r\n <div class=\"label\">\r\n <slot></slot>\r\n ${this.invalid ? error : hint}\r\n </div>\r\n </div>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #renderIcon(): unknown {\r\n if (!this.selected) {\r\n if (this.invalid) {\r\n return html`<slot name=\"error-icon\">\r\n <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path\r\n d=\"m40-120 440-760 440 760H40Zm138-80h604L480-720 178-200Zm302-40q17 0 28.5-11.5T520-280q0-17-11.5-28.5T480-320q-17 0-28.5 11.5T440-280q0 17 11.5 28.5T480-240Zm-40-120h80v-200h-80v200Zm40-100Z\"\r\n />\r\n </svg>\r\n </slot>`;\r\n }\r\n if (this.completed) {\r\n if (this.editable) {\r\n return html`<slot name=\"edit-icon\">\r\n <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path\r\n d=\"M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z\"\r\n />\r\n </svg>\r\n </slot>`;\r\n }\r\n return html`<slot name=\"done-icon\">\r\n <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" />\r\n </svg>\r\n </slot>`;\r\n }\r\n }\r\n\r\n return html`<slot name=\"icon\">${this.index + 1}</slot>`;\r\n }\r\n\r\n /** @private */\r\n #handleClick(e: Event): void {\r\n if (this.disabled) {\r\n e.preventDefault();\r\n e.stopImmediatePropagation();\r\n }\r\n\r\n if (e.defaultPrevented || this.selected) return;\r\n\r\n this.selected = true;\r\n if (\r\n this.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true, cancelable: true })) &&\r\n this.closest(\"m3e-stepper\")?.moveTo(this.index)\r\n ) {\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\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-step\": M3eStepElement;\r\n }\r\n}\r\n","import { ActionElementBase } from \"@m3e/web/core\";\r\n\r\n/** A base implementation for a button used to move to a step in a stepper. This class must be inherited. */\r\nexport abstract class StepperButtonElementBase extends ActionElementBase {\r\n /** @private */ readonly #action: \"next\" | \"previous\" | \"reset\";\r\n\r\n constructor(action: \"next\" | \"previous\" | \"reset\") {\r\n super();\r\n this.#action = action;\r\n }\r\n\r\n /** @inheritdoc */\r\n override _onClick(): void {\r\n switch (this.#action) {\r\n case \"next\":\r\n this.closest(\"m3e-stepper\")?.moveNext();\r\n break;\r\n case \"previous\":\r\n this.closest(\"m3e-stepper\")?.movePrevious();\r\n break;\r\n\r\n case \"reset\":\r\n this.closest(\"m3e-stepper\")?.reset();\r\n break;\r\n }\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues } from \"lit\";\r\nimport { property, state } from \"lit/decorators.js\";\r\nimport { ifDefined } from \"lit/directives/if-defined.js\";\r\n\r\nimport {\r\n addCustomState,\r\n AttachInternals,\r\n customElement,\r\n deleteCustomState,\r\n DesignToken,\r\n hasCustomState,\r\n ReconnectedCallback,\r\n registerStyleSheet,\r\n setCustomState,\r\n} 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 { M3eStepElement } from \"./StepElement\";\r\nimport { StepLabelPosition } from \"./StepLabelPosition\";\r\nimport { StepHeaderPosition } from \"./StepHeaderPosition\";\r\nimport { StepperOrientation } from \"./StepperOrientation\";\r\n\r\n/**\r\n * Provides a wizard-like workflow by dividing content into logical steps.\r\n *\r\n * @description\r\n * The `m3e-stepper` component orchestrates a structured, wizard-like workflow by dividing\r\n * content into discrete, navigable steps. It supports horizontal and vertical orientations,\r\n * linear progression, and configurable label and header positioning.\r\n *\r\n * @example\r\n * The following example demonstrates a linear multi-step form flow using the `m3e-stepper`\r\n * component. Each `m3e-step` defines a navigable step label, linked to its corresponding\r\n * `m3e-step-panel` via the `for` attribute. Navigation is orchestrated using the\r\n * `m3e-stepper-next`, `m3e-stepper-previous`, and `m3e-stepper-reset` components.\r\n *\r\n * <m3e-stepper>\r\n * <m3e-step for=\"step1\">Fill out your name</m3e-step>\r\n * <m3e-step for=\"step2\">Fill out your address</m3e-step>\r\n * <m3e-step for=\"step3\">Done</m3e-step>\r\n * <m3e-step-panel id=\"step1\">\r\n * <form>\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"name\">Name</label>\r\n * <input name=\"name\" id=\"name\" required />\r\n * </m3e-form-field>\r\n * </form>\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * <m3e-step-panel id=\"step2\">\r\n * <form>\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"address\">Address</label>\r\n * <input name=\"address\" id=\"address\" required />\r\n * </m3e-form-field>\r\n * </form>\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>\r\n * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * <m3e-step-panel id=\"step3\">Done\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>\r\n * <m3e-button><m3e-stepper-reset>Reset</m3e-stepper-reset></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * </m3e-stepper>\r\n *\r\n * @tag m3e-stepper\r\n *\r\n * @attr header-position - The position of the step header, when oriented horizontally.\r\n * @attr label-position - The position of the step labels, when oriented horizontally.\r\n * @attr linear - Whether the validity of previous steps should be checked or not.\r\n * @attr orientation - The orientation of the stepper.\r\n *\r\n * @slot step - Renders a step.\r\n * @slot panel - Renders a panel.\r\n *\r\n * @fires change - Emitted when the selected step changes.\r\n *\r\n * @cssprop --m3e-step-divider-thickness - Thickness of the divider line between steps.\r\n * @cssprop --m3e-step-divider-color - Color of the divider line between steps.\r\n * @cssprop --m3e-step-divider-inset - Inset offset for divider alignment within step layout.\r\n */\r\n@customElement(\"m3e-stepper\")\r\nexport class M3eStepperElement extends ReconnectedCallback(AttachInternals(LitElement)) {\r\n static {\r\n registerStyleSheet(css`\r\n m3e-stepper:not(:state(-vertical)) > .-m3e-step-divider::before {\r\n border-bottom-width: var(--m3e-step-divider-thickness, 1px);\r\n border-bottom-style: solid;\r\n border-bottom-color: var(--m3e-step-divider-color, ${DesignToken.color.outline});\r\n }\r\n m3e-stepper:not(:state(-vertical)) > [slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type)::before,\r\n m3e-stepper:not(:state(-vertical)) > [slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type)::after {\r\n border-bottom-width: var(--m3e-step-divider-thickness, 1px);\r\n border-bottom-style: solid;\r\n border-bottom-color: var(--m3e-step-divider-color, ${DesignToken.color.outline});\r\n }\r\n m3e-stepper:not(:state(-vertical))[label-position=\"end\"] > .-m3e-step-divider {\r\n margin-block: auto;\r\n }\r\n m3e-stepper:not(:state(-vertical))[label-position=\"below\"] > .-m3e-step-divider::before,\r\n m3e-stepper:not(:state(-vertical))[label-position=\"below\"]\r\n > [slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type)::before,\r\n m3e-stepper:not(:state(-vertical))[label-position=\"below\"]\r\n > [slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type)::after {\r\n margin-block-start: calc(var(--m3e-step-padding, 1.5rem) + calc(var(--m3e-step-icon-size, 1.5rem) / 2));\r\n }\r\n m3e-stepper:state(-vertical) > [slot=\"panel\"] {\r\n margin-inline-start: calc(var(--m3e-step-padding, 1.5rem) + calc(var(--m3e-step-icon-size, 1.5rem) / 2));\r\n }\r\n m3e-stepper:state(-vertical) > [slot=\"panel\"]:not(:last-of-type) {\r\n border-inline-start-width: var(--m3e-step-divider-thickness, 1px);\r\n border-inline-start-style: solid;\r\n border-inline-start-color: var(--m3e-step-divider-color, ${DesignToken.color.outline});\r\n }\r\n m3e-stepper:state(-vertical) > [slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type)::before,\r\n m3e-stepper:state(-vertical) > [slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type)::after {\r\n margin-inline-start: calc(var(--m3e-step-padding, 1.5rem) + calc(var(--m3e-step-icon-size, 1.5rem) / 2));\r\n border-inline-start-width: var(--m3e-step-divider-thickness, 1px);\r\n border-inline-start-style: solid;\r\n border-inline-start-color: var(--m3e-step-divider-color, ${DesignToken.color.outline});\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: flex;\r\n flex-direction: column;\r\n position: relative;\r\n }\r\n :host(:not(:state(-vertical))) .header {\r\n display: flex;\r\n align-items: flex-start;\r\n flex-wrap: nowrap;\r\n }\r\n :host(:not(:state(-vertical))) ::slotted(.-m3e-step-divider) {\r\n flex: 1 1 auto;\r\n position: relative;\r\n min-width: 2rem;\r\n }\r\n :host(:not(:state(-vertical))) ::slotted(.-m3e-step-divider)::before {\r\n content: \"\";\r\n position: absolute;\r\n left: 0;\r\n right: 0;\r\n }\r\n :host(:not(:state(-vertical)):not([label-position=\"below\"])) ::slotted(.-m3e-step-divider)::before {\r\n top: 50%;\r\n }\r\n :host(:not(:state(-vertical))) ::slotted([slot=\"step\"]) {\r\n align-self: stretch;\r\n }\r\n :host(:not(:state(-vertical))) ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before,\r\n :host(:not(:state(-vertical))) ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n content: \"\";\r\n display: block;\r\n position: absolute;\r\n top: 0;\r\n }\r\n :host(:not(:state(-vertical))[label-position=\"end\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before,\r\n :host(:not(:state(-vertical))[label-position=\"end\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n top: 50%;\r\n }\r\n :host(:not(:dir(rtl)):not(:state(-vertical))[label-position=\"end\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before {\r\n left: 0;\r\n right: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem));\r\n }\r\n :host(:dir(rtl):not(:state(-vertical))[label-position=\"end\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before {\r\n right: 0;\r\n left: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem));\r\n }\r\n :host(:not(:dir(rtl)):not(:state(-vertical))[label-position=\"end\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n left: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem));\r\n right: 0;\r\n }\r\n :host(:dir(rtl):not(:state(-vertical))[label-position=\"end\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n right: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem));\r\n left: 0;\r\n }\r\n :host(:not(:dir(rtl)):not(:state(-vertical))[label-position=\"below\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before {\r\n left: 0;\r\n right: calc(50% + calc(var(--m3e-step-icon-size, 1.5rem) / 2) + var(--m3e-step-divider-inset, 0.5rem));\r\n }\r\n :host(:dir(rtl):not(:state(-vertical))[label-position=\"below\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before {\r\n right: 0;\r\n left: calc(50% + calc(var(--m3e-step-icon-size, 1.5rem) / 2) + var(--m3e-step-divider-inset, 0.5rem));\r\n }\r\n :host(:not(:dir(rtl)):not(:state(-vertical))[label-position=\"below\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n left: calc(50% + calc(var(--m3e-step-icon-size, 1.5rem) / 2) + var(--m3e-step-divider-inset, 0.5rem));\r\n right: 0;\r\n }\r\n :host(:dir(rtl):not(:state(-vertical))[label-position=\"below\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n right: calc(50% + calc(var(--m3e-step-icon-size, 1.5rem) / 2) + var(--m3e-step-divider-inset, 0.5rem));\r\n left: 0;\r\n }\r\n :host(:not(:state(-vertical))[label-position=\"below\"]) {\r\n --_step-direction: column;\r\n --_step-label-align-items: center;\r\n }\r\n :host(:state(-vertical)) .header {\r\n display: contents;\r\n }\r\n :host(:state(-vertical)) ::slotted([slot=\"step\"]:not(.-m3e-step-divider)) {\r\n flex: none;\r\n }\r\n :host(:state(-vertical)) ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before,\r\n :host(:state(-vertical)) ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n content: \"\";\r\n display: block;\r\n position: absolute;\r\n left: 0;\r\n }\r\n :host(:state(-vertical)) ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before {\r\n top: 0;\r\n bottom: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem));\r\n }\r\n :host(:state(-vertical)) ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n top: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem));\r\n bottom: 0;\r\n }\r\n :host(:not(:state(-vertical))) {\r\n --m3e-collapsible-animation-duration: 0ms;\r\n }\r\n :host(:state(-no-animate)) {\r\n --m3e-collapsible-animation-duration: 0ms;\r\n }\r\n `;\r\n\r\n /** @private */ #breakpointUnobserve?: () => void;\r\n /** @private */ @state() private _orientation?: Exclude<StepperOrientation, \"auto\">;\r\n /** @private */ @state() private _selectedIndex: number | null = null;\r\n /** @internal */ readonly [selectionManager] = new SelectionManager<M3eStepElement>()\r\n .withHomeAndEnd()\r\n .withWrap()\r\n .onSelectedItemsChange(() => this.#handleSelectedChange());\r\n\r\n /**\r\n * The position of the step header, when oriented horizontally.\r\n * @default \"above\"\r\n */\r\n @property({ attribute: \"header-position\", reflect: true }) headerPosition: StepHeaderPosition = \"above\";\r\n\r\n /**\r\n * The position of the step labels, when oriented horizontally.\r\n * @default \"end\"\r\n */\r\n @property({ attribute: \"label-position\", reflect: true }) labelPosition: StepLabelPosition = \"end\";\r\n\r\n /**\r\n * Whether the validity of previous steps should be checked or not.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) linear = false;\r\n\r\n /**\r\n * The orientation of the stepper.\r\n * @default \"horizontal\"\r\n */\r\n @property({ reflect: true }) orientation: StepperOrientation = \"horizontal\";\r\n\r\n /** The steps. */\r\n get steps(): readonly M3eStepElement[] {\r\n return this[selectionManager]?.items ?? [];\r\n }\r\n\r\n /** The selected step. */\r\n get selectedStep(): M3eStepElement | null {\r\n return this._selectedIndex !== null ? (this.steps[this._selectedIndex] ?? null) : null;\r\n }\r\n\r\n /** The zero-based index of the selected step. */\r\n get selectedIndex(): number {\r\n return this._selectedIndex ?? -1;\r\n }\r\n\r\n /**\r\n * Moves the stepper to the previous step.\r\n * @returns {boolean} Whether the stepper moved to the previous step.\r\n */\r\n movePrevious(): boolean {\r\n return this.moveTo((this._selectedIndex ?? 1) - 1);\r\n }\r\n\r\n /**\r\n * Moves the stepper to the next step.\r\n * @returns {boolean} Whether the stepper moved to the next step.\r\n */\r\n moveNext(): boolean {\r\n return this.moveTo((this._selectedIndex ?? -1) + 1);\r\n }\r\n\r\n /**\r\n * Moves the stepper to the step with the specified index.\r\n * @param index The zero-based index of the step to which to move.\r\n * @returns {boolean} Whether the stepper moved to the specified `index`.\r\n */\r\n moveTo(index: number): boolean {\r\n const selectedStep = this.selectedStep;\r\n if (selectedStep && selectedStep.index === index) {\r\n return true;\r\n }\r\n\r\n if (this.steps[index]?.disabled) {\r\n return false;\r\n }\r\n\r\n if (index >= 0 && index < this.steps.length) {\r\n if (selectedStep) {\r\n const valid = this.#checkValidity();\r\n if (this.linear) {\r\n if (index < selectedStep.index) {\r\n const previousStep = this[selectionManager].items[index];\r\n if (!previousStep || (previousStep.completed && !previousStep.editable)) {\r\n return false;\r\n }\r\n } else if (index > selectedStep.index + 1) {\r\n const nextStep = this[selectionManager].items[index];\r\n if (!nextStep || !nextStep.completed) {\r\n return false;\r\n }\r\n } else if (!valid && !selectedStep.optional) {\r\n return false;\r\n }\r\n }\r\n\r\n selectedStep.completed = true;\r\n }\r\n\r\n this._selectedIndex = index;\r\n this[selectionManager].select(this.selectedStep);\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n return true;\r\n } else {\r\n if (selectedStep) {\r\n this[selectionManager].deselect(selectedStep);\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n }\r\n return false;\r\n }\r\n }\r\n\r\n /** Resets the stepper to its initial state, clearing any form data. */\r\n reset(): void {\r\n this.steps.forEach((x) => x.reset());\r\n const index = this.steps.findIndex((x) => !x.disabled);\r\n if (index !== this._selectedIndex) {\r\n this._selectedIndex = index;\r\n this[selectionManager].select(this.selectedStep);\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n addCustomState(this, \"-no-animate\");\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this._orientation = 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.orientation === \"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(\"orientation\")) {\r\n this.#breakpointUnobserve?.();\r\n\r\n if (this.orientation === \"auto\") {\r\n this.#initBreakpointMonitoring();\r\n } else {\r\n this._orientation = undefined;\r\n this.#updateDisplayOrder();\r\n }\r\n }\r\n if (changedProperties.has(\"_orientation\")) {\r\n this.#updateDisplayOrder();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n let panelIndex: number | undefined;\r\n if (this.selectedStep?.panel) {\r\n panelIndex = [...this.querySelectorAll(\"[slot='panel']\")].indexOf(this.selectedStep.panel);\r\n if (panelIndex === -1) {\r\n panelIndex = undefined;\r\n }\r\n }\r\n\r\n if (!this[selectionManager].vertical) {\r\n return html`${this.headerPosition === \"above\" ? this.#renderHeader() : nothing}\r\n <m3e-slide class=\"steps\" selected-index=\"${ifDefined(panelIndex)}\">\r\n <slot name=\"panel\"></slot>\r\n </m3e-slide>\r\n ${this.headerPosition === \"below\" ? this.#renderHeader() : nothing}`;\r\n }\r\n\r\n return html`${this.#renderHeader()} <slot name=\"panel\"></slot>`;\r\n }\r\n\r\n /** @private */\r\n #renderHeader(): unknown {\r\n return html`<div\r\n class=\"header\"\r\n role=\"tablist\"\r\n aria-orientation=\"${ifDefined(this[selectionManager].vertical ? \"vertical\" : undefined)}\"\r\n @change=\"${this.#handleChange}\"\r\n >\r\n <slot name=\"step\" @slotchange=\"${this.#handleSlotChange}\" @keydown=\"${this.#handleKeyDown}\"></slot>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleChange(e: Event): void {\r\n e.stopPropagation();\r\n // Note: change event emitted from moveTo.\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(): void {\r\n const { added, removed } = this[selectionManager].setItems([...this.querySelectorAll(\"m3e-step\")]);\r\n if (added.length > 0 || removed.length > 0) {\r\n this.querySelectorAll(\".-m3e-step-divider\").forEach((x) => x.remove());\r\n for (let i = 0; i < this[selectionManager].items.length; i++) {\r\n const step = this[selectionManager].items[i];\r\n step.index = i;\r\n if (i > 0) {\r\n const divider = document.createElement(\"div\");\r\n divider.ariaHidden = \"true\";\r\n divider.classList.add(\"-m3e-step-divider\");\r\n divider.slot = \"step\";\r\n step.insertAdjacentElement(\"beforebegin\", divider);\r\n }\r\n }\r\n\r\n this.#updateDisplayOrder();\r\n\r\n if (this[selectionManager].selectedItems.length == 0) {\r\n this[selectionManager].select(this[selectionManager].items.find((x) => !x.disabled));\r\n }\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleKeyDown(e: KeyboardEvent): void {\r\n this[selectionManager].onKeyDown(e);\r\n }\r\n\r\n /** @private */\r\n #handleSelectedChange(): void {\r\n const selected = this[selectionManager].selectedItems[0];\r\n let selectedIndex = selected ? this.steps.indexOf(selected) : null;\r\n if (selectedIndex === -1) {\r\n selectedIndex = null;\r\n }\r\n this._selectedIndex = selectedIndex;\r\n\r\n for (const step of this[selectionManager].items) {\r\n if (step.panel) {\r\n step.panel.active = step.index === selectedIndex;\r\n }\r\n }\r\n\r\n if (selected && this.matches(\":focus-within\") && !selected.matches(\":focus\")) {\r\n selected.focus();\r\n }\r\n\r\n if (hasCustomState(this, \"-no-animate\")) {\r\n requestAnimationFrame(() => deleteCustomState(this, \"-no-animate\"));\r\n }\r\n }\r\n\r\n /** @private */\r\n #checkValidity(): boolean {\r\n let valid = false;\r\n if (this.selectedStep) {\r\n valid = this.selectedStep.panel?.querySelector(\"form\")?.checkValidity() ?? true;\r\n if (this.selectedStep.optional) {\r\n valid = true;\r\n }\r\n this.selectedStep.invalid = !valid;\r\n }\r\n return valid;\r\n }\r\n\r\n /** @private */\r\n #initBreakpointMonitoring(): void {\r\n this.#breakpointUnobserve = M3eBreakpointObserver.observe([Breakpoint.XSmall], (matches) => {\r\n this._orientation = matches.get(Breakpoint.XSmall) ? \"vertical\" : \"horizontal\";\r\n this.#updateDisplayOrder();\r\n });\r\n }\r\n\r\n /** @private */\r\n #updateDisplayOrder(): void {\r\n this[selectionManager].vertical = (this._orientation ?? this.orientation) === \"vertical\";\r\n setCustomState(this, \"-vertical\", this[selectionManager].vertical);\r\n\r\n if (!this[selectionManager].vertical) {\r\n this.steps.forEach((x) => {\r\n x.style.order = \"\";\r\n if (x.panel) {\r\n x.panel.style.order = \"\";\r\n }\r\n });\r\n } else {\r\n this.steps.forEach((x, i) => {\r\n x.style.order = `${i}`;\r\n if (x.panel) {\r\n x.panel.style.order = `${i}`;\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-stepper\": M3eStepperElement;\r\n }\r\n}\r\n","import { customElement } from \"@m3e/web/core\";\r\n\r\nimport { StepperButtonElementBase } from \"./StepperButtonElementBase\";\r\n\r\n/**\r\n * An element, nested within a clickable element, used to move a stepper to the next step.\r\n * @tag m3e-stepper-previous\r\n *\r\n * @slot - Renders the content of the action.\r\n */\r\n@customElement(\"m3e-stepper-next\")\r\nexport class M3eStepperNextElement extends StepperButtonElementBase {\r\n constructor() {\r\n super(\"next\");\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-stepper-next\": M3eStepperNextElement;\r\n }\r\n}\r\n","import { customElement } from \"@m3e/web/core\";\r\n\r\nimport { StepperButtonElementBase } from \"./StepperButtonElementBase\";\r\n\r\n/**\r\n * An element, nested within a clickable element, used to move a stepper to the previous step.\r\n * @tag m3e-stepper-previous\r\n *\r\n * @slot - Renders the content of the action.\r\n */\r\n@customElement(\"m3e-stepper-previous\")\r\nexport class M3eStepperPreviousElement extends StepperButtonElementBase {\r\n constructor() {\r\n super(\"previous\");\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-stepper-previous\": M3eStepperPreviousElement;\r\n }\r\n}\r\n","import { customElement } from \"@m3e/web/core\";\r\n\r\nimport { StepperButtonElementBase } from \"./StepperButtonElementBase\";\r\n\r\n/**\r\n * An element, nested within a clickable element, used to reset a stepper to its initial state.\r\n * @tag m3e-stepper-reset\r\n *\r\n * @slot - Renders the content of the action.\r\n */\r\n@customElement(\"m3e-stepper-reset\")\r\nexport class M3eStepperResetElement extends StepperButtonElementBase {\r\n constructor() {\r\n super(\"reset\");\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-stepper-reset\": M3eStepperResetElement;\r\n }\r\n}\r\n"],"names":["M3eStepPanelElement","Role","LitElement","constructor","this","active","connectedCallback","slot","super","render","html","styles","css","__decorate","state","prototype","customElement","M3eStepElement","M3eStepElement_1","Selected","KeyboardClick","Focusable","HtmlFor","Disabled","AttachInternals","_M3eStepElement_clickHandler","set","e","__classPrivateFieldGet","call","optional","editable","completed","invalid","index","panel","control","stepper","closest","reset","querySelector","attach","id","__nextId","addAriaReferencedId","style","order","detach","removeAriaReferencedId","addEventListener","disconnectedCallback","removeEventListener","update","changedProperties","has","selectionManager","notifySelectionChange","firstUpdated","_changedProperties","_focusRing","_stateLayer","_ripple","forEach","x","hint","nothing","error","disabled","_M3eStepElement_instances","_M3eStepElement_renderIcon","selected","preventDefault","stopImmediatePropagation","defaultPrevented","dispatchEvent","Event","bubbles","composed","cancelable","moveTo","DesignToken","shape","corner","medium","color","primary","onPrimary","inverseSurface","inverseOnSurface","onSurface","typescale","standard","title","small","fontSize","fontWeight","lineHeight","tracking","body","onSurfaceVariant","query","property","type","Boolean","reflect","StepperButtonElementBase","ActionElementBase","action","_StepperButtonElementBase_action","__classPrivateFieldSet","_onClick","moveNext","movePrevious","M3eStepperElement","ReconnectedCallback","_M3eStepperElement_breakpointUnobserve","_selectedIndex","_a","SelectionManager","withHomeAndEnd","withWrap","onSelectedItemsChange","_M3eStepperElement_instances","_M3eStepperElement_handleSelectedChange","headerPosition","labelPosition","linear","orientation","steps","items","selectedStep","selectedIndex","length","valid","previousStep","nextStep","select","deselect","findIndex","addCustomState","_orientation","undefined","reconnectedCallback","_M3eStepperElement_initBreakpointMonitoring","willUpdate","_M3eStepperElement_updateDisplayOrder","panelIndex","querySelectorAll","indexOf","vertical","ifDefined","_M3eStepperElement_renderHeader","_M3eStepperElement_handleChange","_M3eStepperElement_handleSlotChange","_M3eStepperElement_handleKeyDown","stopPropagation","added","removed","setItems","remove","i","step","divider","document","createElement","ariaHidden","classList","add","insertAdjacentElement","selectedItems","find","onKeyDown","matches","focus","hasCustomState","requestAnimationFrame","deleteCustomState","checkValidity","M3eBreakpointObserver","observe","Breakpoint","XSmall","get","setCustomState","registerStyleSheet","outline","attribute","M3eStepperNextElement","M3eStepperPreviousElement","M3eStepperResetElement"],"mappings":";;;;;0yBA+DO,IAAMA,EAAN,cAAkCC,EAAKC,EAAY,aAAnDC,WAAAA,uBAwBIC,KAAAC,QAAS,CAkBpB,CAfWC,iBAAAA,GACPF,KAAKG,KAAO,QAEZC,MAAMF,mBACR,CAGmBG,MAAAA,GACjB,OAAOC,CAAI,2BAA0BN,KAAKC,2GAM5C,iBAvCgBL,EAAAW,OAAyBC,CAAG,2YAsBnCC,EAAA,CAARC,KAAuBd,EAAAe,UAAA,iBAxBbf,EAAmBa,EAAA,CAD/BG,EAAc,mBACFhB,GC4DN,IAAMiB,EAAcC,EAApB,cAA6BC,EAClCC,EAAcC,EAAUC,EAAQC,EAASC,EAAgBvB,EAAKC,EAAY,cADrEC,WAAAA,mCAgHoBsB,EAAAC,IAAAtB,KAAiBuB,GAAaC,EAAAxB,cAAiByB,KAAjBzB,KAAkBuB,IAM7BvB,KAAA0B,UAAW,EAMX1B,KAAA2B,UAAW,EAMX3B,KAAA4B,WAAY,EAMZ5B,KAAA6B,SAAU,EAG7C7B,KAAA8B,OAAQ,CA6InB,CA1IE,SAAIC,GACF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
+ {"version":3,"file":"stepper.min.js","sources":["../../src/stepper/StepPanelElement.ts","../../src/stepper/StepElement.ts","../../src/stepper/StepperButtonElementBase.ts","../../src/stepper/StepperElement.ts","../../src/stepper/StepperNextElement.ts","../../src/stepper/StepperPreviousElement.ts","../../src/stepper/StepperResetElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement } from \"lit\";\r\nimport { state } from \"lit/decorators.js\";\r\n\r\nimport { customElement, Role } from \"@m3e/web/core\";\r\n\r\n/**\r\n * A panel presented for a step in a wizard-like workflow.\r\n *\r\n * @description\r\n * The `m3e-step-panel` is a container for presenting contextual content and actions\r\n * associated with a single step in a structured workflow.\r\n *\r\n * @example\r\n * The following example demonstrates a linear multi-step form flow using the `m3e-stepper`\r\n * component. Each `m3e-step` defines a navigable step label, linked to its corresponding\r\n * `m3e-step-panel` via the `for` attribute. Navigation is orchestrated using the\r\n * `m3e-stepper-next`, `m3e-stepper-previous`, and `m3e-stepper-reset` components.\r\n *\r\n * <m3e-stepper>\r\n * <m3e-step for=\"step1\">Fill out your name</m3e-step>\r\n * <m3e-step for=\"step2\">Fill out your address</m3e-step>\r\n * <m3e-step for=\"step3\">Done</m3e-step>\r\n * <m3e-step-panel id=\"step1\">\r\n * <form>\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"name\">Name</label>\r\n * <input name=\"name\" id=\"name\" required />\r\n * </m3e-form-field>\r\n * </form>\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * <m3e-step-panel id=\"step2\">\r\n * <form>\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"address\">Address</label>\r\n * <input name=\"address\" id=\"address\" required />\r\n * </m3e-form-field>\r\n * </form>\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>\r\n * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * <m3e-step-panel id=\"step3\">Done\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>\r\n * <m3e-button><m3e-stepper-reset>Reset</m3e-stepper-reset></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * </m3e-stepper>\r\n *\r\n * @tag m3e-step-panel\r\n *\r\n * @slot - Renders the content of the panel.\r\n * @slot actions- Renders the actions bar of the panel.\r\n *\r\n * @cssprop --m3e-step-panel-padding - Padding inside the step panel container, defining internal spacing around content.\r\n * @cssprop --m3e-step-panel-spacing - Vertical gap between stacked elements within the step panel.\r\n * @cssprop --m3e-step-panel-actions-height - Minimum height of the slotted actions container.\r\n */\r\n@customElement(\"m3e-step-panel\")\r\nexport class M3eStepPanelElement extends Role(LitElement, \"tabpanel\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n }\r\n .content {\r\n display: flex;\r\n flex-direction: column;\r\n padding: var(--m3e-step-panel-padding, 1rem 1.5rem 1.5rem 1.5rem);\r\n row-gap: var(--m3e-step-panel-spacing, 0.5rem);\r\n }\r\n ::slotted([slot=\"actions\"]) {\r\n flex: none;\r\n display: flex;\r\n align-items: center;\r\n min-height: var(--m3e-step-panel-actions-height, 3rem);\r\n }\r\n ::slotted([slot=\"actions\"][end]) {\r\n justify-content: flex-end;\r\n }\r\n `;\r\n\r\n /** @internal */\r\n @state() active = false;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n this.slot = \"panel\";\r\n\r\n super.connectedCallback();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<m3e-collapsible ?open=${this.active}>\r\n <div class=\"content\">\r\n <div><slot></slot></div>\r\n <slot name=\"actions\"></slot>\r\n </div>\r\n </m3e-collapsible>`;\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-step-panel\": M3eStepPanelElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues } from \"lit\";\r\nimport { property, query, state } from \"lit/decorators.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n Focusable,\r\n HtmlFor,\r\n KeyboardClick,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n Role,\r\n Selected,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { addAriaReferencedId, removeAriaReferencedId, selectionManager } from \"@m3e/web/core/a11y\";\r\n\r\nimport type { M3eStepperElement } from \"./StepperElement\";\r\nimport { M3eStepPanelElement } from \"./StepPanelElement\";\r\n\r\n/**\r\n * A step in a wizard-like workflow.\r\n *\r\n * @description\r\n * The `m3e-step` component represents a single step in a structured, wizard-like workflow.\r\n * It supports semantic labeling, stateful styling, and optional interaction for completed,\r\n * selected, invalid, or disabled states. It aligns with Material Design guidance for progressive\r\n * disclosure, accessible navigation, and visual continuity across horizontal and vertical layouts.\r\n *\r\n * @example\r\n * The following example demonstrates a linear multi-step form flow using the `m3e-stepper`\r\n * component. Each `m3e-step` defines a navigable step label, linked to its corresponding\r\n * `m3e-step-panel` via the `for` attribute. Navigation is orchestrated using the\r\n * `m3e-stepper-next`, `m3e-stepper-previous`, and `m3e-stepper-reset` components.\r\n *\r\n * <m3e-stepper>\r\n * <m3e-step for=\"step1\">Fill out your name</m3e-step>\r\n * <m3e-step for=\"step2\">Fill out your address</m3e-step>\r\n * <m3e-step for=\"step3\">Done</m3e-step>\r\n * <m3e-step-panel id=\"step1\">\r\n * <form>\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"name\">Name</label>\r\n * <input name=\"name\" id=\"name\" required />\r\n * </m3e-form-field>\r\n * </form>\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * <m3e-step-panel id=\"step2\">\r\n * <form>\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"address\">Address</label>\r\n * <input name=\"address\" id=\"address\" required />\r\n * </m3e-form-field>\r\n * </form>\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>\r\n * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * <m3e-step-panel id=\"step3\">Done\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>\r\n * <m3e-button><m3e-stepper-reset>Reset</m3e-stepper-reset></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * </m3e-stepper>\r\n *\r\n * @tag m3e-step\r\n *\r\n * @slot - Renders the label of the step.\r\n * @slot icon - Renders the icon of the step.\r\n * @slot done-icon - Renders the icon of a completed step.\r\n * @slot edit-icon - Renders the icon of a completed editable step.\r\n * @slot error-icon - Renders icon of an invalid step.\r\n * @slot hint - Renders the hint text of the step.\r\n * @slot error - Renders the error message for an invalid step.\r\n *\r\n * @attr completed - Whether the step has been completed.\r\n * @attr disabled - Whether the element is disabled.\r\n * @attr editable - Whether the step is editable and users can return to it after completion.\r\n * @attr for - The identifier of the interactive control to which this element is attached.\r\n * @attr optional - Whether the step is optional.\r\n * @attr selected - Whether the element is selected.\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-step-shape - Border radius of the step container, defining its visual shape.\r\n * @cssprop --m3e-step-padding - Internal padding of the step container, used for layout spacing.\r\n * @cssprop --m3e-step-icon-shape - Border radius of the icon container, controlling its geometric form.\r\n * @cssprop --m3e-step-icon-size - Width and height of the icon container and icon glyph.\r\n * @cssprop --m3e-step-selected-icon-container-color - Background color of the icon when the step is selected.\r\n * @cssprop --m3e-step-selected-icon-color - Foreground color of the icon when the step is selected.\r\n * @cssprop --m3e-step-completed-icon-container-color - Background color of the icon when the step is completed.\r\n * @cssprop --m3e-step-completed-icon-color - Foreground color of the icon when the step is completed.\r\n * @cssprop --m3e-step-unselected-icon-container-color - Background color of the icon when the step is inactive.\r\n * @cssprop --m3e-step-unselected-icon-color - Foreground color of the icon when the step is inactive.\r\n * @cssprop --m3e-step-icon-error-color - Foreground color of the icon when the step is invalid.\r\n * @cssprop --m3e-step-disabled-icon-container-color - Base color used to mix the disabled icon background.\r\n * @cssprop --m3e-step-disabled-icon-color - Base color used to mix the disabled icon foreground.\r\n * @cssprop --m3e-step-label-color - Text color of the step label in its default state.\r\n * @cssprop --m3e-step-label-error-color - Text color of the step label when the step is invalid.\r\n * @cssprop --m3e-step-disabled-label-color - Base color used to mix the disabled label foreground.\r\n * @cssprop --m3e-step-font-size - Font size of the step label.\r\n * @cssprop --m3e-step-font-weight - Font weight of the step label.\r\n * @cssprop --m3e-step-line-height - Line height of the step label.\r\n * @cssprop --m3e-step-tracking - Letter spacing of the step label.\r\n * @cssprop --m3e-step-icon-label-space - Gap between icon and label.\r\n * @cssprop --m3e-step-hint-font-size - Font size of hint and error messages.\r\n * @cssprop --m3e-step-hint-font-weight - Font weight of hint and error messages.\r\n * @cssprop --m3e-step-hint-line-height - Line height of hint and error messages.\r\n * @cssprop --m3e-step-hint-tracking - Letter spacing of hint and error messages.\r\n * @cssprop --m3e-step-hint-color - Text color of hint messages in valid state.\r\n * @cssprop --m3e-step-disabled-hint-color - Base color used to mix the disabled hint foreground.\r\n */\r\n@customElement(\"m3e-step\")\r\nexport class M3eStepElement extends Selected(\r\n KeyboardClick(Focusable(HtmlFor(Disabled(AttachInternals(Role(LitElement, \"tab\")))))),\r\n) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n outline: none;\r\n min-width: 0px;\r\n position: relative;\r\n user-select: none;\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n .base {\r\n min-width: inherit;\r\n position: relative;\r\n border-radius: var(--m3e-step-shape, ${DesignToken.shape.corner.medium});\r\n padding: var(--m3e-step-padding, 1.5rem);\r\n }\r\n :host(:not([aria-disabled=\"true\"])) {\r\n cursor: pointer;\r\n }\r\n .icon {\r\n flex: none;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n border-radius: var(--m3e-step-icon-shape, 50%);\r\n width: var(--m3e-step-icon-size, 1.5rem);\r\n height: var(--m3e-step-icon-size, 1.5rem);\r\n }\r\n .icon svg,\r\n ::slotted([slot=\"icon\"]),\r\n ::slotted([slot=\"edit-icon\"]),\r\n ::slotted([slot=\"done-icon\"]),\r\n ::slotted([slot=\"error-icon\"]) {\r\n width: 1em;\r\n font-size: var(--m3e-step-icon-size, 1.5rem) !important;\r\n }\r\n :host(:not([aria-disabled=\"true\"])[selected]) .icon {\r\n background-color: var(--m3e-step-selected-icon-container-color, ${DesignToken.color.primary});\r\n color: var(--m3e-step-selected-icon-color, ${DesignToken.color.onPrimary});\r\n }\r\n :host(:not([aria-disabled=\"true\"])[completed]:not([invalid])) .icon {\r\n background-color: var(--m3e-step-completed-icon-container-color, ${DesignToken.color.primary});\r\n color: var(--m3e-step-completed-icon-color, ${DesignToken.color.onPrimary});\r\n }\r\n :host(:not([aria-disabled=\"true\"]):not([selected]):not([completed]):not([invalid])) .icon {\r\n background-color: var(--m3e-step-unselected-icon-container-color, ${DesignToken.color.inverseSurface});\r\n color: var(--m3e-step-unselected-icon-color, ${DesignToken.color.inverseOnSurface});\r\n }\r\n :host(:not([aria-disabled=\"true\"]):not([selected])[invalid]) .icon {\r\n color: var(--m3e-step-icon-error-color, ${DesignToken.color.error});\r\n }\r\n :host([aria-disabled=\"true\"]) .icon {\r\n background-color: color-mix(\r\n in srgb,\r\n var(--m3e-step-disabled-icon-container-color, ${DesignToken.color.onSurface}) 10%,\r\n transparent\r\n );\r\n color: color-mix(in srgb, var(--m3e-step-disabled-icon-color, ${DesignToken.color.onSurface}) 38%, transparent);\r\n }\r\n\r\n :host(:not([aria-disabled=\"true\"])) .label {\r\n color: var(--m3e-step-label-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:not([aria-disabled=\"true\"]):not([selected])[invalid]) .label {\r\n color: var(--m3e-step-label-error-color, ${DesignToken.color.error});\r\n }\r\n :host([aria-disabled=\"true\"]) .label {\r\n color: color-mix(in srgb, var(--m3e-step-disabled-label-color, ${DesignToken.color.onSurface}) 38%, transparent);\r\n }\r\n .wrapper {\r\n display: flex;\r\n align-items: center;\r\n height: 100%;\r\n border-radius: inherit;\r\n font-size: var(--m3e-step-font-size, ${DesignToken.typescale.standard.title.small.fontSize});\r\n font-weight: var(--m3e-step-font-weight, ${DesignToken.typescale.standard.title.small.fontWeight});\r\n line-height: var(--m3e-step-line-height, ${DesignToken.typescale.standard.title.small.lineHeight});\r\n letter-spacing: var(--m3e-step-tracking, ${DesignToken.typescale.standard.title.small.tracking});\r\n flex-direction: var(--_step-direction, row);\r\n gap: var(--m3e-step-icon-label-space, 0.5rem);\r\n justify-content: flex-start;\r\n }\r\n .label {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: var(--_step-label-align-items, flex-start);\r\n }\r\n ::slotted([slot=\"hint\"]),\r\n .hint,\r\n ::slotted([slot=\"error\"]) {\r\n font-size: var(--m3e-step-hint-font-size, ${DesignToken.typescale.standard.body.small.fontSize});\r\n font-weight: var(--m3e-step-hint-font-weight, ${DesignToken.typescale.standard.body.small.fontWeight});\r\n line-height: var(--m3e-step-hint-line-height, ${DesignToken.typescale.standard.body.small.lineHeight});\r\n letter-spacing: var(--m3e-step-hint-tracking, ${DesignToken.typescale.standard.body.small.tracking});\r\n }\r\n :host(:not([aria-disabled=\"true\"]):not([invalid])) ::slotted([slot=\"hint\"]),\r\n :host(:not([aria-disabled=\"true\"]):not([invalid])) .hint {\r\n color: var(--m3e-step-hint-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host([aria-disabled=\"true\"]) ::slotted([slot=\"hint\"]),\r\n :host([aria-disabled=\"true\"]) .hint {\r\n color: color-mix(in srgb, var(--m3e-step-disabled-hint-color, ${DesignToken.color.onSurface}) 38%, transparent);\r\n }\r\n `;\r\n\r\n /** @private */ private static __nextId = 0;\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 */ readonly #clickHandler = (e: Event) => this.#handleClick(e);\r\n\r\n /**\r\n * Whether the step is optional.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) optional = false;\r\n\r\n /**\r\n * Whether the step is editable and users can return to it after completion.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) editable = false;\r\n\r\n /**\r\n * Whether the step has been completed.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) completed = false;\r\n\r\n /**\r\n * Whether the step has an error.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) invalid = false;\r\n\r\n /** @internal */\r\n @state() index = -1;\r\n\r\n /** A reference to the panel controlled by the step. */\r\n get panel(): M3eStepPanelElement | null {\r\n return this.control instanceof M3eStepPanelElement ? this.control : null;\r\n }\r\n\r\n /** The stepper to which this step belongs. */\r\n get stepper(): M3eStepperElement | null {\r\n return this.closest(\"m3e-stepper\");\r\n }\r\n\r\n /** Resets the step to its initial state, clearing any form data. */\r\n reset(): void {\r\n this.invalid = false;\r\n this.completed = false;\r\n this.panel?.querySelector(\"form\")?.reset();\r\n }\r\n\r\n /** @inheritdoc */\r\n override attach(control: HTMLElement): void {\r\n if (control instanceof M3eStepPanelElement) {\r\n control.id = control.id || `m3e-step-panel-${M3eStepElement.__nextId++}`;\r\n addAriaReferencedId(this, \"aria-controls\", control.id);\r\n control.style.order = this.style.order;\r\n }\r\n super.attach(control);\r\n }\r\n\r\n /** @inheritdoc */\r\n override detach(): void {\r\n if (this.control) {\r\n this.control.style.order = \"\";\r\n if (this.control.id) {\r\n removeAriaReferencedId(this, \"aria-controls\", this.control.id);\r\n }\r\n }\r\n\r\n super.detach();\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n this.slot = \"step\";\r\n\r\n super.connectedCallback();\r\n this.addEventListener(\"click\", this.#clickHandler);\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n this.removeEventListener(\"click\", this.#clickHandler);\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.closest(\"m3e-stepper\")?.[selectionManager].notifySelectionChange(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 hint = html`<slot name=\"hint\">${this.optional ? html`<span class=\"hint\">(Optional)</span>` : nothing}</slot>`;\r\n const error = html`<slot name=\"error\">${hint}</slot>`;\r\n\r\n return html`<div class=\"base\">\r\n <m3e-state-layer class=\"state-layer\" ?disabled=\"${this.disabled}\"></m3e-state-layer>\r\n <m3e-focus-ring class=\"focus-ring\" ?disabled=\"${this.disabled}\"></m3e-focus-ring>\r\n <m3e-ripple class=\"ripple\" ?disabled=\"${this.disabled}\"></m3e-ripple>\r\n <div class=\"wrapper\">\r\n <div class=\"icon\" aria-hidden=\"true\">${this.#renderIcon()}</div>\r\n <div class=\"label\">\r\n <slot></slot>\r\n ${this.invalid ? error : hint}\r\n </div>\r\n </div>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #renderIcon(): unknown {\r\n if (!this.selected) {\r\n if (this.invalid) {\r\n return html`<slot name=\"error-icon\">\r\n <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path\r\n d=\"m40-120 440-760 440 760H40Zm138-80h604L480-720 178-200Zm302-40q17 0 28.5-11.5T520-280q0-17-11.5-28.5T480-320q-17 0-28.5 11.5T440-280q0 17 11.5 28.5T480-240Zm-40-120h80v-200h-80v200Zm40-100Z\"\r\n />\r\n </svg>\r\n </slot>`;\r\n }\r\n if (this.completed) {\r\n if (this.editable) {\r\n return html`<slot name=\"edit-icon\">\r\n <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path\r\n d=\"M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z\"\r\n />\r\n </svg>\r\n </slot>`;\r\n }\r\n return html`<slot name=\"done-icon\">\r\n <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" />\r\n </svg>\r\n </slot>`;\r\n }\r\n }\r\n\r\n return html`<slot name=\"icon\">${this.index + 1}</slot>`;\r\n }\r\n\r\n /** @private */\r\n #handleClick(e: Event): void {\r\n if (this.disabled) {\r\n e.preventDefault();\r\n e.stopImmediatePropagation();\r\n }\r\n\r\n if (e.defaultPrevented || this.selected) return;\r\n\r\n this.selected = true;\r\n if (\r\n this.dispatchEvent(new Event(\"input\", { bubbles: true, composed: true, cancelable: true })) &&\r\n this.closest(\"m3e-stepper\")?.moveTo(this.index)\r\n ) {\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\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-step\": M3eStepElement;\r\n }\r\n}\r\n","import { ActionElementBase } from \"@m3e/web/core\";\r\n\r\n/** A base implementation for a button used to move to a step in a stepper. This class must be inherited. */\r\nexport abstract class StepperButtonElementBase extends ActionElementBase {\r\n /** @private */ readonly #action: \"next\" | \"previous\" | \"reset\";\r\n\r\n constructor(action: \"next\" | \"previous\" | \"reset\") {\r\n super();\r\n this.#action = action;\r\n }\r\n\r\n /** @inheritdoc */\r\n override _onClick(): void {\r\n switch (this.#action) {\r\n case \"next\":\r\n this.closest(\"m3e-stepper\")?.moveNext();\r\n break;\r\n case \"previous\":\r\n this.closest(\"m3e-stepper\")?.movePrevious();\r\n break;\r\n\r\n case \"reset\":\r\n this.closest(\"m3e-stepper\")?.reset();\r\n break;\r\n }\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues } from \"lit\";\r\nimport { property, state } from \"lit/decorators.js\";\r\nimport { ifDefined } from \"lit/directives/if-defined.js\";\r\n\r\nimport {\r\n addCustomState,\r\n AttachInternals,\r\n customElement,\r\n deleteCustomState,\r\n DesignToken,\r\n hasCustomState,\r\n ReconnectedCallback,\r\n registerStyleSheet,\r\n setCustomState,\r\n} 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 { M3eStepElement } from \"./StepElement\";\r\nimport { StepLabelPosition } from \"./StepLabelPosition\";\r\nimport { StepHeaderPosition } from \"./StepHeaderPosition\";\r\nimport { StepperOrientation } from \"./StepperOrientation\";\r\n\r\n/**\r\n * Provides a wizard-like workflow by dividing content into logical steps.\r\n *\r\n * @description\r\n * The `m3e-stepper` component orchestrates a structured, wizard-like workflow by dividing\r\n * content into discrete, navigable steps. It supports horizontal and vertical orientations,\r\n * linear progression, and configurable label and header positioning.\r\n *\r\n * @example\r\n * The following example demonstrates a linear multi-step form flow using the `m3e-stepper`\r\n * component. Each `m3e-step` defines a navigable step label, linked to its corresponding\r\n * `m3e-step-panel` via the `for` attribute. Navigation is orchestrated using the\r\n * `m3e-stepper-next`, `m3e-stepper-previous`, and `m3e-stepper-reset` components.\r\n *\r\n * <m3e-stepper>\r\n * <m3e-step for=\"step1\">Fill out your name</m3e-step>\r\n * <m3e-step for=\"step2\">Fill out your address</m3e-step>\r\n * <m3e-step for=\"step3\">Done</m3e-step>\r\n * <m3e-step-panel id=\"step1\">\r\n * <form>\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"name\">Name</label>\r\n * <input name=\"name\" id=\"name\" required />\r\n * </m3e-form-field>\r\n * </form>\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * <m3e-step-panel id=\"step2\">\r\n * <form>\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"address\">Address</label>\r\n * <input name=\"address\" id=\"address\" required />\r\n * </m3e-form-field>\r\n * </form>\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>\r\n * <m3e-button><m3e-stepper-next>Next</m3e-stepper-next></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * <m3e-step-panel id=\"step3\">Done\r\n * <div slot=\"actions\">\r\n * <m3e-button><m3e-stepper-previous>Back</m3e-stepper-previous></m3e-button>\r\n * <m3e-button><m3e-stepper-reset>Reset</m3e-stepper-reset></m3e-button>\r\n * </div>\r\n * </m3e-step-panel>\r\n * </m3e-stepper>\r\n *\r\n * @tag m3e-stepper\r\n *\r\n * @attr header-position - The position of the step header, when oriented horizontally.\r\n * @attr label-position - The position of the step labels, when oriented horizontally.\r\n * @attr linear - Whether the validity of previous steps should be checked or not.\r\n * @attr orientation - The orientation of the stepper.\r\n *\r\n * @slot step - Renders a step.\r\n * @slot panel - Renders a panel.\r\n *\r\n * @fires change - Emitted when the selected step changes.\r\n *\r\n * @cssprop --m3e-step-divider-thickness - Thickness of the divider line between steps.\r\n * @cssprop --m3e-step-divider-color - Color of the divider line between steps.\r\n * @cssprop --m3e-step-divider-inset - Inset offset for divider alignment within step layout.\r\n */\r\n@customElement(\"m3e-stepper\")\r\nexport class M3eStepperElement extends ReconnectedCallback(AttachInternals(LitElement)) {\r\n static {\r\n registerStyleSheet(css`\r\n m3e-stepper:not(:is(:state(--vertical), :--vertical)) > .-m3e-step-divider::before {\r\n border-bottom-width: var(--m3e-step-divider-thickness, 1px);\r\n border-bottom-style: solid;\r\n border-bottom-color: var(--m3e-step-divider-color, ${DesignToken.color.outline});\r\n }\r\n m3e-stepper:not(:is(:state(--vertical), :--vertical))\r\n > [slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type)::before,\r\n m3e-stepper:not(:is(:state(--vertical), :--vertical))\r\n > [slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type)::after {\r\n border-bottom-width: var(--m3e-step-divider-thickness, 1px);\r\n border-bottom-style: solid;\r\n border-bottom-color: var(--m3e-step-divider-color, ${DesignToken.color.outline});\r\n }\r\n m3e-stepper:not(:is(:state(--vertical), :--vertical))[label-position=\"end\"] > .-m3e-step-divider {\r\n margin-block: auto;\r\n }\r\n m3e-stepper:not(:is(:state(--vertical), :--vertical))[label-position=\"below\"] > .-m3e-step-divider::before,\r\n m3e-stepper:not(:is(:state(--vertical), :--vertical))[label-position=\"below\"]\r\n > [slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type)::before,\r\n m3e-stepper:not(:is(:state(--vertical), :--vertical))[label-position=\"below\"]\r\n > [slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type)::after {\r\n margin-block-start: calc(var(--m3e-step-padding, 1.5rem) + calc(var(--m3e-step-icon-size, 1.5rem) / 2));\r\n }\r\n m3e-stepper:is(:state(--vertical), :--vertical) > [slot=\"panel\"] {\r\n margin-inline-start: calc(var(--m3e-step-padding, 1.5rem) + calc(var(--m3e-step-icon-size, 1.5rem) / 2));\r\n }\r\n m3e-stepper:is(:state(--vertical), :--vertical) > [slot=\"panel\"]:not(:last-of-type) {\r\n border-inline-start-width: var(--m3e-step-divider-thickness, 1px);\r\n border-inline-start-style: solid;\r\n border-inline-start-color: var(--m3e-step-divider-color, ${DesignToken.color.outline});\r\n }\r\n m3e-stepper:is(:state(--vertical), :--vertical)\r\n > [slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type)::before,\r\n m3e-stepper:is(:state(--vertical), :--vertical)\r\n > [slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type)::after {\r\n margin-inline-start: calc(var(--m3e-step-padding, 1.5rem) + calc(var(--m3e-step-icon-size, 1.5rem) / 2));\r\n border-inline-start-width: var(--m3e-step-divider-thickness, 1px);\r\n border-inline-start-style: solid;\r\n border-inline-start-color: var(--m3e-step-divider-color, ${DesignToken.color.outline});\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: flex;\r\n flex-direction: column;\r\n position: relative;\r\n }\r\n :host(:not(:is(:state(--vertical), :--vertical))) .header {\r\n display: flex;\r\n align-items: flex-start;\r\n flex-wrap: nowrap;\r\n }\r\n :host(:not(:is(:state(--vertical), :--vertical))) ::slotted(.-m3e-step-divider) {\r\n flex: 1 1 auto;\r\n position: relative;\r\n min-width: 2rem;\r\n }\r\n :host(:not(:is(:state(--vertical), :--vertical))) ::slotted(.-m3e-step-divider)::before {\r\n content: \"\";\r\n position: absolute;\r\n left: 0;\r\n right: 0;\r\n }\r\n :host(:not(:is(:state(--vertical), :--vertical)):not([label-position=\"below\"]))\r\n ::slotted(.-m3e-step-divider)::before {\r\n top: 50%;\r\n }\r\n :host(:not(:is(:state(--vertical), :--vertical))) ::slotted([slot=\"step\"]) {\r\n align-self: stretch;\r\n }\r\n :host(:not(:is(:state(--vertical), :--vertical)))\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before,\r\n :host(:not(:is(:state(--vertical), :--vertical)))\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n content: \"\";\r\n display: block;\r\n position: absolute;\r\n top: 0;\r\n }\r\n :host(:not(:is(:state(--vertical), :--vertical))[label-position=\"end\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before,\r\n :host(:not(:is(:state(--vertical), :--vertical))[label-position=\"end\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n top: 50%;\r\n }\r\n :host(:not(:dir(rtl)):not(:is(:state(--vertical), :--vertical))[label-position=\"end\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before {\r\n left: 0;\r\n right: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem));\r\n }\r\n :host(:dir(rtl):not(:is(:state(--vertical), :--vertical))[label-position=\"end\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before {\r\n right: 0;\r\n left: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem));\r\n }\r\n :host(:not(:dir(rtl)):not(:is(:state(--vertical), :--vertical))[label-position=\"end\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n left: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem));\r\n right: 0;\r\n }\r\n :host(:dir(rtl):not(:is(:state(--vertical), :--vertical))[label-position=\"end\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n right: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem));\r\n left: 0;\r\n }\r\n :host(:not(:dir(rtl)):not(:is(:state(--vertical), :--vertical))[label-position=\"below\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before {\r\n left: 0;\r\n right: calc(50% + calc(var(--m3e-step-icon-size, 1.5rem) / 2) + var(--m3e-step-divider-inset, 0.5rem));\r\n }\r\n :host(:dir(rtl):not(:is(:state(--vertical), :--vertical))[label-position=\"below\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before {\r\n right: 0;\r\n left: calc(50% + calc(var(--m3e-step-icon-size, 1.5rem) / 2) + var(--m3e-step-divider-inset, 0.5rem));\r\n }\r\n :host(:not(:dir(rtl)):not(:is(:state(--vertical), :--vertical))[label-position=\"below\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n left: calc(50% + calc(var(--m3e-step-icon-size, 1.5rem) / 2) + var(--m3e-step-divider-inset, 0.5rem));\r\n right: 0;\r\n }\r\n :host(:dir(rtl):not(:is(:state(--vertical), :--vertical))[label-position=\"below\"])\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n right: calc(50% + calc(var(--m3e-step-icon-size, 1.5rem) / 2) + var(--m3e-step-divider-inset, 0.5rem));\r\n left: 0;\r\n }\r\n :host(:not(:is(:state(--vertical), :--vertical))[label-position=\"below\"]) {\r\n --_step-direction: column;\r\n --_step-label-align-items: center;\r\n }\r\n :host(:is(:state(--vertical), :--vertical)) .header {\r\n display: contents;\r\n }\r\n :host(:is(:state(--vertical), :--vertical)) ::slotted([slot=\"step\"]:not(.-m3e-step-divider)) {\r\n flex: none;\r\n }\r\n :host(:is(:state(--vertical), :--vertical))\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before,\r\n :host(:is(:state(--vertical), :--vertical))\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n content: \"\";\r\n display: block;\r\n position: absolute;\r\n left: 0;\r\n }\r\n :host(:is(:state(--vertical), :--vertical))\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:first-of-type))::before {\r\n top: 0;\r\n bottom: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem));\r\n }\r\n :host(:is(:state(--vertical), :--vertical))\r\n ::slotted([slot=\"step\"]:not(.-m3e-step-divider):not(:last-of-type))::after {\r\n top: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem));\r\n bottom: 0;\r\n }\r\n :host(:not(:is(:state(--vertical), :--vertical))) {\r\n --m3e-collapsible-animation-duration: 0ms;\r\n }\r\n :host(:is(:state(--no-animate), :--no-animate)) {\r\n --m3e-collapsible-animation-duration: 0ms;\r\n }\r\n `;\r\n\r\n /** @private */ #breakpointUnobserve?: () => void;\r\n /** @private */ @state() private _orientation?: Exclude<StepperOrientation, \"auto\">;\r\n /** @private */ @state() private _selectedIndex: number | null = null;\r\n /** @internal */ readonly [selectionManager] = new SelectionManager<M3eStepElement>()\r\n .withHomeAndEnd()\r\n .withWrap()\r\n .onSelectedItemsChange(() => this.#handleSelectedChange());\r\n\r\n /**\r\n * The position of the step header, when oriented horizontally.\r\n * @default \"above\"\r\n */\r\n @property({ attribute: \"header-position\", reflect: true }) headerPosition: StepHeaderPosition = \"above\";\r\n\r\n /**\r\n * The position of the step labels, when oriented horizontally.\r\n * @default \"end\"\r\n */\r\n @property({ attribute: \"label-position\", reflect: true }) labelPosition: StepLabelPosition = \"end\";\r\n\r\n /**\r\n * Whether the validity of previous steps should be checked or not.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) linear = false;\r\n\r\n /**\r\n * The orientation of the stepper.\r\n * @default \"horizontal\"\r\n */\r\n @property({ reflect: true }) orientation: StepperOrientation = \"horizontal\";\r\n\r\n /** The steps. */\r\n get steps(): readonly M3eStepElement[] {\r\n return this[selectionManager]?.items ?? [];\r\n }\r\n\r\n /** The selected step. */\r\n get selectedStep(): M3eStepElement | null {\r\n return this._selectedIndex !== null ? (this.steps[this._selectedIndex] ?? null) : null;\r\n }\r\n\r\n /** The zero-based index of the selected step. */\r\n get selectedIndex(): number {\r\n return this._selectedIndex ?? -1;\r\n }\r\n\r\n /**\r\n * Moves the stepper to the previous step.\r\n * @returns {boolean} Whether the stepper moved to the previous step.\r\n */\r\n movePrevious(): boolean {\r\n return this.moveTo((this._selectedIndex ?? 1) - 1);\r\n }\r\n\r\n /**\r\n * Moves the stepper to the next step.\r\n * @returns {boolean} Whether the stepper moved to the next step.\r\n */\r\n moveNext(): boolean {\r\n return this.moveTo((this._selectedIndex ?? -1) + 1);\r\n }\r\n\r\n /**\r\n * Moves the stepper to the step with the specified index.\r\n * @param index The zero-based index of the step to which to move.\r\n * @returns {boolean} Whether the stepper moved to the specified `index`.\r\n */\r\n moveTo(index: number): boolean {\r\n const selectedStep = this.selectedStep;\r\n if (selectedStep && selectedStep.index === index) {\r\n return true;\r\n }\r\n\r\n if (this.steps[index]?.disabled) {\r\n return false;\r\n }\r\n\r\n if (index >= 0 && index < this.steps.length) {\r\n if (selectedStep) {\r\n const valid = this.#checkValidity();\r\n if (this.linear) {\r\n if (index < selectedStep.index) {\r\n const previousStep = this[selectionManager].items[index];\r\n if (!previousStep || (previousStep.completed && !previousStep.editable)) {\r\n return false;\r\n }\r\n } else if (index > selectedStep.index + 1) {\r\n const nextStep = this[selectionManager].items[index];\r\n if (!nextStep || !nextStep.completed) {\r\n return false;\r\n }\r\n } else if (!valid && !selectedStep.optional) {\r\n return false;\r\n }\r\n }\r\n\r\n selectedStep.completed = true;\r\n }\r\n\r\n this._selectedIndex = index;\r\n this[selectionManager].select(this.selectedStep);\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n return true;\r\n } else {\r\n if (selectedStep) {\r\n this[selectionManager].deselect(selectedStep);\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n }\r\n return false;\r\n }\r\n }\r\n\r\n /** Resets the stepper to its initial state, clearing any form data. */\r\n reset(): void {\r\n this.steps.forEach((x) => x.reset());\r\n const index = this.steps.findIndex((x) => !x.disabled);\r\n if (index !== this._selectedIndex) {\r\n this._selectedIndex = index;\r\n this[selectionManager].select(this.selectedStep);\r\n this.dispatchEvent(new Event(\"change\", { bubbles: true }));\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n addCustomState(this, \"--no-animate\");\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this._orientation = 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.orientation === \"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(\"orientation\")) {\r\n this.#breakpointUnobserve?.();\r\n\r\n if (this.orientation === \"auto\") {\r\n this.#initBreakpointMonitoring();\r\n } else {\r\n this._orientation = undefined;\r\n this.#updateDisplayOrder();\r\n }\r\n }\r\n if (changedProperties.has(\"_orientation\")) {\r\n this.#updateDisplayOrder();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n let panelIndex: number | undefined;\r\n if (this.selectedStep?.panel) {\r\n panelIndex = [...this.querySelectorAll(\"[slot='panel']\")].indexOf(this.selectedStep.panel);\r\n if (panelIndex === -1) {\r\n panelIndex = undefined;\r\n }\r\n }\r\n\r\n if (!this[selectionManager].vertical) {\r\n return html`${this.headerPosition === \"above\" ? this.#renderHeader() : nothing}\r\n <m3e-slide class=\"steps\" selected-index=\"${ifDefined(panelIndex)}\">\r\n <slot name=\"panel\"></slot>\r\n </m3e-slide>\r\n ${this.headerPosition === \"below\" ? this.#renderHeader() : nothing}`;\r\n }\r\n\r\n return html`${this.#renderHeader()} <slot name=\"panel\"></slot>`;\r\n }\r\n\r\n /** @private */\r\n #renderHeader(): unknown {\r\n return html`<div\r\n class=\"header\"\r\n role=\"tablist\"\r\n aria-orientation=\"${ifDefined(this[selectionManager].vertical ? \"vertical\" : undefined)}\"\r\n @change=\"${this.#handleChange}\"\r\n >\r\n <slot name=\"step\" @slotchange=\"${this.#handleSlotChange}\" @keydown=\"${this.#handleKeyDown}\"></slot>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleChange(e: Event): void {\r\n e.stopPropagation();\r\n // Note: change event emitted from moveTo.\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(): void {\r\n const { added, removed } = this[selectionManager].setItems([...this.querySelectorAll(\"m3e-step\")]);\r\n if (added.length > 0 || removed.length > 0) {\r\n this.querySelectorAll(\".-m3e-step-divider\").forEach((x) => x.remove());\r\n for (let i = 0; i < this[selectionManager].items.length; i++) {\r\n const step = this[selectionManager].items[i];\r\n step.index = i;\r\n if (i > 0) {\r\n const divider = document.createElement(\"div\");\r\n divider.ariaHidden = \"true\";\r\n divider.classList.add(\"-m3e-step-divider\");\r\n divider.slot = \"step\";\r\n step.insertAdjacentElement(\"beforebegin\", divider);\r\n }\r\n }\r\n\r\n this.#updateDisplayOrder();\r\n\r\n if (this[selectionManager].selectedItems.length == 0) {\r\n this[selectionManager].select(this[selectionManager].items.find((x) => !x.disabled));\r\n }\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleKeyDown(e: KeyboardEvent): void {\r\n this[selectionManager].onKeyDown(e);\r\n }\r\n\r\n /** @private */\r\n #handleSelectedChange(): void {\r\n const selected = this[selectionManager].selectedItems[0];\r\n let selectedIndex = selected ? this.steps.indexOf(selected) : null;\r\n if (selectedIndex === -1) {\r\n selectedIndex = null;\r\n }\r\n this._selectedIndex = selectedIndex;\r\n\r\n for (const step of this[selectionManager].items) {\r\n if (step.panel) {\r\n step.panel.active = step.index === selectedIndex;\r\n }\r\n }\r\n\r\n if (selected && this.matches(\":focus-within\") && !selected.matches(\":focus\")) {\r\n selected.focus();\r\n }\r\n\r\n if (hasCustomState(this, \"--no-animate\")) {\r\n requestAnimationFrame(() => deleteCustomState(this, \"--no-animate\"));\r\n }\r\n }\r\n\r\n /** @private */\r\n #checkValidity(): boolean {\r\n let valid = false;\r\n if (this.selectedStep) {\r\n valid = this.selectedStep.panel?.querySelector(\"form\")?.checkValidity() ?? true;\r\n if (this.selectedStep.optional) {\r\n valid = true;\r\n }\r\n this.selectedStep.invalid = !valid;\r\n }\r\n return valid;\r\n }\r\n\r\n /** @private */\r\n #initBreakpointMonitoring(): void {\r\n this.#breakpointUnobserve = M3eBreakpointObserver.observe([Breakpoint.XSmall], (matches) => {\r\n this._orientation = matches.get(Breakpoint.XSmall) ? \"vertical\" : \"horizontal\";\r\n this.#updateDisplayOrder();\r\n });\r\n }\r\n\r\n /** @private */\r\n #updateDisplayOrder(): void {\r\n this[selectionManager].vertical = (this._orientation ?? this.orientation) === \"vertical\";\r\n setCustomState(this, \"--vertical\", this[selectionManager].vertical);\r\n\r\n if (!this[selectionManager].vertical) {\r\n this.steps.forEach((x) => {\r\n x.style.order = \"\";\r\n if (x.panel) {\r\n x.panel.style.order = \"\";\r\n }\r\n });\r\n } else {\r\n this.steps.forEach((x, i) => {\r\n x.style.order = `${i}`;\r\n if (x.panel) {\r\n x.panel.style.order = `${i}`;\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-stepper\": M3eStepperElement;\r\n }\r\n}\r\n","import { customElement } from \"@m3e/web/core\";\r\n\r\nimport { StepperButtonElementBase } from \"./StepperButtonElementBase\";\r\n\r\n/**\r\n * An element, nested within a clickable element, used to move a stepper to the next step.\r\n * @tag m3e-stepper-previous\r\n *\r\n * @slot - Renders the content of the action.\r\n */\r\n@customElement(\"m3e-stepper-next\")\r\nexport class M3eStepperNextElement extends StepperButtonElementBase {\r\n constructor() {\r\n super(\"next\");\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-stepper-next\": M3eStepperNextElement;\r\n }\r\n}\r\n","import { customElement } from \"@m3e/web/core\";\r\n\r\nimport { StepperButtonElementBase } from \"./StepperButtonElementBase\";\r\n\r\n/**\r\n * An element, nested within a clickable element, used to move a stepper to the previous step.\r\n * @tag m3e-stepper-previous\r\n *\r\n * @slot - Renders the content of the action.\r\n */\r\n@customElement(\"m3e-stepper-previous\")\r\nexport class M3eStepperPreviousElement extends StepperButtonElementBase {\r\n constructor() {\r\n super(\"previous\");\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-stepper-previous\": M3eStepperPreviousElement;\r\n }\r\n}\r\n","import { customElement } from \"@m3e/web/core\";\r\n\r\nimport { StepperButtonElementBase } from \"./StepperButtonElementBase\";\r\n\r\n/**\r\n * An element, nested within a clickable element, used to reset a stepper to its initial state.\r\n * @tag m3e-stepper-reset\r\n *\r\n * @slot - Renders the content of the action.\r\n */\r\n@customElement(\"m3e-stepper-reset\")\r\nexport class M3eStepperResetElement extends StepperButtonElementBase {\r\n constructor() {\r\n super(\"reset\");\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-stepper-reset\": M3eStepperResetElement;\r\n }\r\n}\r\n"],"names":["M3eStepPanelElement","Role","LitElement","constructor","this","active","connectedCallback","slot","super","render","html","styles","css","__decorate","state","prototype","customElement","M3eStepElement","M3eStepElement_1","Selected","KeyboardClick","Focusable","HtmlFor","Disabled","AttachInternals","_M3eStepElement_clickHandler","set","e","__classPrivateFieldGet","call","optional","editable","completed","invalid","index","panel","control","stepper","closest","reset","querySelector","attach","id","__nextId","addAriaReferencedId","style","order","detach","removeAriaReferencedId","addEventListener","disconnectedCallback","removeEventListener","update","changedProperties","has","selectionManager","notifySelectionChange","firstUpdated","_changedProperties","_focusRing","_stateLayer","_ripple","forEach","x","hint","nothing","error","disabled","_M3eStepElement_instances","_M3eStepElement_renderIcon","selected","preventDefault","stopImmediatePropagation","defaultPrevented","dispatchEvent","Event","bubbles","composed","cancelable","moveTo","DesignToken","shape","corner","medium","color","primary","onPrimary","inverseSurface","inverseOnSurface","onSurface","typescale","standard","title","small","fontSize","fontWeight","lineHeight","tracking","body","onSurfaceVariant","query","property","type","Boolean","reflect","StepperButtonElementBase","ActionElementBase","action","_StepperButtonElementBase_action","__classPrivateFieldSet","_onClick","moveNext","movePrevious","M3eStepperElement","ReconnectedCallback","_M3eStepperElement_breakpointUnobserve","_selectedIndex","_a","SelectionManager","withHomeAndEnd","withWrap","onSelectedItemsChange","_M3eStepperElement_instances","_M3eStepperElement_handleSelectedChange","headerPosition","labelPosition","linear","orientation","steps","items","selectedStep","selectedIndex","length","valid","previousStep","nextStep","select","deselect","findIndex","addCustomState","_orientation","undefined","reconnectedCallback","_M3eStepperElement_initBreakpointMonitoring","willUpdate","_M3eStepperElement_updateDisplayOrder","panelIndex","querySelectorAll","indexOf","vertical","ifDefined","_M3eStepperElement_renderHeader","_M3eStepperElement_handleChange","_M3eStepperElement_handleSlotChange","_M3eStepperElement_handleKeyDown","stopPropagation","added","removed","setItems","remove","i","step","divider","document","createElement","ariaHidden","classList","add","insertAdjacentElement","selectedItems","find","onKeyDown","matches","focus","hasCustomState","requestAnimationFrame","deleteCustomState","checkValidity","M3eBreakpointObserver","observe","Breakpoint","XSmall","get","setCustomState","registerStyleSheet","outline","attribute","M3eStepperNextElement","M3eStepperPreviousElement","M3eStepperResetElement"],"mappings":";;;;;0yBA+DO,IAAMA,EAAN,cAAkCC,EAAKC,EAAY,aAAnDC,WAAAA,uBAwBIC,KAAAC,QAAS,CAkBpB,CAfWC,iBAAAA,GACPF,KAAKG,KAAO,QAEZC,MAAMF,mBACR,CAGmBG,MAAAA,GACjB,OAAOC,CAAI,2BAA0BN,KAAKC,2GAM5C,iBAvCgBL,EAAAW,OAAyBC,CAAG,2YAsBnCC,EAAA,CAARC,KAAuBd,EAAAe,UAAA,iBAxBbf,EAAmBa,EAAA,CAD/BG,EAAc,mBACFhB,GC4DN,IAAMiB,EAAcC,EAApB,cAA6BC,EAClCC,EAAcC,EAAUC,EAAQC,EAASC,EAAgBvB,EAAKC,EAAY,cADrEC,WAAAA,mCAgHoBsB,EA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C,GAAN,cAAwCnF,EAC7CtG,WAAAA,GACEK,MAAM,WACR,GAHWoL,GAAyB/K,EAAA,CADrCG,EAAc,yBACF4K,ICAN,IAAMC,GAAN,cAAqCpF,EAC1CtG,WAAAA,GACEK,MAAM,QACR,GAHWqL,GAAsBhL,EAAA,CADlCG,EAAc,sBACF6K"}
package/dist/tabs.js CHANGED
@@ -287,7 +287,7 @@ let M3eTabsElement = class M3eTabsElement extends AttachInternals(LitElement) {
287
287
  new ResizeController(this, {
288
288
  skipInitial: true,
289
289
  callback: () => {
290
- addCustomState(this, "-no-animate");
290
+ addCustomState(this, "--no-animate");
291
291
  __classPrivateFieldGet(this, _M3eTabsElement_instances, "m", _M3eTabsElement_updateInkBar).call(this);
292
292
  }
293
293
  });
@@ -317,7 +317,7 @@ let M3eTabsElement = class M3eTabsElement extends AttachInternals(LitElement) {
317
317
  /** @inheritdoc */
318
318
  connectedCallback() {
319
319
  super.connectedCallback();
320
- addCustomState(this, "-no-animate");
320
+ addCustomState(this, "--no-animate");
321
321
  __classPrivateFieldSet(this, _M3eTabsElement_directionalitySubscription, M3eDirectionality.observe(() => {
322
322
  this.requestUpdate();
323
323
  this[selectionManager].directionality = M3eDirectionality.current;
@@ -395,13 +395,13 @@ _M3eTabsElement_updateInkBar = function _M3eTabsElement_updateInkBar() {
395
395
  }
396
396
  this._tablist.style.setProperty("--_tabs-active-tab-position", `${left}px`);
397
397
  this._tablist.style.setProperty("--_tabs-active-tab-size", `${width}px`);
398
- if (width > 0 && hasCustomState(this, "-no-animate")) {
399
- setTimeout(() => deleteCustomState(this, "-no-animate"));
398
+ if (width > 0 && hasCustomState(this, "--no-animate")) {
399
+ setTimeout(() => deleteCustomState(this, "--no-animate"));
400
400
  }
401
401
  };
402
402
  /** The styles of the element. */
403
403
  M3eTabsElement.styles = css`:host { display: flex; flex-direction: column; position: relative; } .tablist { position: relative; box-sizing: border-box; flex: none; } ::slotted(prev-icon), ::slotted(next-icon), .icon { width: 1em; font-size: var(--m3e-tabs-paginator-button-icon-size, var(--m3e-icon-button-icon-size, 1.5rem)) !important; } .header { display: flex; flex-direction: column; } .tabs { display: flex; flex-wrap: nowrap; align-items: center; } .ink-bar { box-sizing: border-box; height: var(--_tabs-active-indicator-thickness); } .active-indicator { position: relative; height: var(--_tabs-active-indicator-thickness); left: calc(var(--_tabs-active-tab-position) + var(--_tabs-activate-indicator-inset, 0px)); width: calc(var(--_tabs-active-tab-size) - calc(var(--_tabs-activate-indicator-inset, 0px) * 2)); background-color: var(--m3e-tabs-active-indicator-color, ${DesignToken.color.primary}); transition: ${unsafeCSS(`left var(--m3e-slide-animation-duration, ${DesignToken.motion.duration.long2}) ${DesignToken.motion.easing.standard},
404
- width var(--m3e-slide-animation-duration, ${DesignToken.motion.duration.long2}) ${DesignToken.motion.easing.standard}`)}; } :host([header-position="after"]) .header { flex-direction: column-reverse; } :host([header-position="before"]) .ink-bar { margin-top: calc(0px - var(--_tabs-active-indicator-thickness)); } :host([header-position="before"]) .tablist { --m3e-slide-group-divider-bottom: var(--m3e-divider-thickness, 1px) solid var(--m3e-divider-color, ${DesignToken.color.outlineVariant}); } :host([header-position="after"]) .ink-bar { margin-bottom: calc(0px - var(--_tabs-active-indicator-thickness)); } :host([header-position="after"]) .tablist { --m3e-slide-group-divider-top: var(--m3e-divider-thickness, 1px) solid var(--m3e-divider-color, ${DesignToken.color.outlineVariant}); } :host([header-position="before"][variant="primary"]) .active-indicator { border-radius: var(--m3e-tabs-primary-before-active-indicator-shape, ${DesignToken.shape.corner.extraSmallTop}); } :host([header-position="after"][variant="primary"]) .active-indicator { border-radius: var(--m3e-tabs-primary-after-active-indicator-shape, ${DesignToken.shape.corner.extraSmallBottom}); } .tabs { flex: 1 1 auto; } :host([variant="primary"]) .tablist { --_tabs-activate-indicator-inset: var(--m3e-tabs-primary-active-indicator-inset, 0.125rem); --_tabs-active-indicator-thickness: var(--m3e-tabs-primary-active-indicator-thickness, 3px); --_tab-height: 4rem; } :host([header-position="before"]) .tablist { --_tab-focus-ring-bottom-offset: calc(var(--_tabs-active-indicator-thickness) + 1px); } :host([header-position="after"]) .tablist { --_tab-focus-ring-top-offset: calc(var(--_tabs-active-indicator-thickness) + 2px); } :host([header-position="before"][variant="primary"]) .tablist { --_tab-direction: column; } :host([header-position="after"][variant="primary"]) .tablist { --_tab-direction: column-reverse; } :host([variant="secondary"]) .tablist { --_tabs-active-indicator-thickness: var(--m3e-tabs-secondary-active-indicator-thickness, 2px); --_tab-height: 3rem; --_tab-selected-color: ${DesignToken.color.onSurface}; --_tab-selected-container-hover-color: ${DesignToken.color.onSurface}; --_tab-selected-container-focus-color: ${DesignToken.color.onSurface}; --_tab-selected-ripple-color: ${DesignToken.color.onSurface}; } :host([stretch]) .header { width: 100%; --_tab-grow: 1; } :host(:state(-no-animate)) .active-indicator { transition: none; } @media (prefers-reduced-motion) { .active-indicator { transition: none; } } @media (forced-colors: active) { .active-indicator { background-color: ButtonText; --m3e-divider-color: GrayText; } }`;
404
+ width var(--m3e-slide-animation-duration, ${DesignToken.motion.duration.long2}) ${DesignToken.motion.easing.standard}`)}; } :host([header-position="after"]) .header { flex-direction: column-reverse; } :host([header-position="before"]) .ink-bar { margin-top: calc(0px - var(--_tabs-active-indicator-thickness)); } :host([header-position="before"]) .tablist { --m3e-slide-group-divider-bottom: var(--m3e-divider-thickness, 1px) solid var(--m3e-divider-color, ${DesignToken.color.outlineVariant}); } :host([header-position="after"]) .ink-bar { margin-bottom: calc(0px - var(--_tabs-active-indicator-thickness)); } :host([header-position="after"]) .tablist { --m3e-slide-group-divider-top: var(--m3e-divider-thickness, 1px) solid var(--m3e-divider-color, ${DesignToken.color.outlineVariant}); } :host([header-position="before"][variant="primary"]) .active-indicator { border-radius: var(--m3e-tabs-primary-before-active-indicator-shape, ${DesignToken.shape.corner.extraSmallTop}); } :host([header-position="after"][variant="primary"]) .active-indicator { border-radius: var(--m3e-tabs-primary-after-active-indicator-shape, ${DesignToken.shape.corner.extraSmallBottom}); } .tabs { flex: 1 1 auto; } :host([variant="primary"]) .tablist { --_tabs-activate-indicator-inset: var(--m3e-tabs-primary-active-indicator-inset, 0.125rem); --_tabs-active-indicator-thickness: var(--m3e-tabs-primary-active-indicator-thickness, 3px); --_tab-height: 4rem; } :host([header-position="before"]) .tablist { --_tab-focus-ring-bottom-offset: calc(var(--_tabs-active-indicator-thickness) + 1px); } :host([header-position="after"]) .tablist { --_tab-focus-ring-top-offset: calc(var(--_tabs-active-indicator-thickness) + 2px); } :host([header-position="before"][variant="primary"]) .tablist { --_tab-direction: column; } :host([header-position="after"][variant="primary"]) .tablist { --_tab-direction: column-reverse; } :host([variant="secondary"]) .tablist { --_tabs-active-indicator-thickness: var(--m3e-tabs-secondary-active-indicator-thickness, 2px); --_tab-height: 3rem; --_tab-selected-color: ${DesignToken.color.onSurface}; --_tab-selected-container-hover-color: ${DesignToken.color.onSurface}; --_tab-selected-container-focus-color: ${DesignToken.color.onSurface}; --_tab-selected-ripple-color: ${DesignToken.color.onSurface}; } :host([stretch]) .header { width: 100%; --_tab-grow: 1; } :host(:is(:state(--no-animate), :--no-animate)) .active-indicator { transition: none; } @media (prefers-reduced-motion) { .active-indicator { transition: none; } } @media (forced-colors: active) { .active-indicator { background-color: ButtonText; --m3e-divider-color: GrayText; } }`;
405
405
  __decorate([query(".tablist")], M3eTabsElement.prototype, "_tablist", void 0);
406
406
  __decorate([state()], M3eTabsElement.prototype, "_selectedIndex", void 0);
407
407
  __decorate([property({
package/dist/tabs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.js","sources":["../../src/tabs/TabElement.ts","../../src/tabs/TabPanelElement.ts","../../src/tabs/TabsElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement, PropertyValues } from \"lit\";\r\nimport { query } from \"lit/decorators.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n Focusable,\r\n HtmlFor,\r\n KeyboardClick,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n Role,\r\n Selected,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { addAriaReferencedId, removeAriaReferencedId, selectionManager } from \"@m3e/web/core/a11y\";\r\n\r\n/**\r\n * An interactive element that, when activated, presents an associated tab panel.\r\n *\r\n * @description\r\n * The `m3e-tab` component is an interactive control used within a tabbed interface to activate and\r\n * reveal an associated tab panel. It supports accessible labeling, optional iconography, and selection\r\n * state styling consistent with Material 3 guidance. Tabs may be disabled, selected, or linked to a\r\n * specific panel via the `for` attribute, enabling declarative control and semantic clarity.\r\n *\r\n * @example\r\n * The following example illustrates using the `m3e-tabs`, `m3e-tab`, and `m3e-tab-panel` components to present\r\n * secondary tabs.\r\n * ```html\r\n * <m3e-tabs>\r\n * <m3e-tab selected for=\"videos\"><m3e-icon slot=\"icon\" name=\"videocam\"></m3e-icon>Video</m3e-tab>\r\n * <m3e-tab for=\"photos\"><m3e-icon slot=\"icon\" name=\"photo\"></m3e-icon>Photos</m3e-tab>\r\n * <m3e-tab for=\"audio\"><m3e-icon slot=\"icon\" name=\"music_note\"></m3e-icon>Audio</m3e-tab>\r\n * <m3e-tab-panel id=\"videos\">Videos</m3e-tab-panel>\r\n * <m3e-tab-panel id=\"photos\">Photos</m3e-tab-panel>\r\n * <m3e-tab-panel id=\"audio\">Audio</m3e-tab-panel>\r\n * </m3e-tabs>\r\n * ```\r\n *\r\n * @tag m3e-tab\r\n *\r\n * @slot - Renders the label of the tab.\r\n * @slot icon - Renders an icon before the tab's label.\r\n *\r\n * @attr disabled - Whether the element is disabled.\r\n * @attr for - The identifier of the interactive control to which this element is attached.\r\n * @attr selected - Whether the element is selected.\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-tab-font-size - Font size for tab label.\r\n * @cssprop --m3e-tab-font-weight - Font weight for tab label.\r\n * @cssprop --m3e-tab-line-height - Line height for tab label.\r\n * @cssprop --m3e-tab-tracking - Letter spacing for tab label.\r\n * @cssprop --m3e-tab-padding-start - Padding on the inline start of the tab.\r\n * @cssprop --m3e-tab-padding-end - Padding on the inline end of the tab.\r\n * @cssprop --m3e-tab-focus-ring-shape - Border radius for the focus ring.\r\n * @cssprop --m3e-tab-selected-color - Text color for selected tab.\r\n * @cssprop --m3e-tab-selected-container-hover-color - Hover state-layer color for selected tab.\r\n * @cssprop --m3e-tab-selected-container-focus-color - Focus state-layer color for selected tab.\r\n * @cssprop --m3e-tab-selected-ripple-color - Ripple color for selected tab.\r\n * @cssprop --m3e-tab-unselected-color - Text color for unselected tab.\r\n * @cssprop --m3e-tab-unselected-container-hover-color - Hover state-layer color for unselected tab.\r\n * @cssprop --m3e-tab-unselected-container-focus-color - Focus state-layer color for unselected tab.\r\n * @cssprop --m3e-tab-unselected-ripple-color - Ripple color for unselected tab.\r\n * @cssprop --m3e-tab-disabled-color - Text color for disabled tab.\r\n * @cssprop --m3e-tab-disabled-opacity - Text opacity for disabled tab.\r\n * @cssprop --m3e-tab-spacing - Column gap between icon and label.\r\n * @cssprop --m3e-tab-icon-size - Font size for slotted icon.\r\n */\r\n@customElement(\"m3e-tab\")\r\nexport class M3eTabElement extends Selected(\r\n HtmlFor(KeyboardClick(Focusable(Disabled(AttachInternals(Role(LitElement, \"tab\"), 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 outline: none;\r\n user-select: none;\r\n height: calc(var(--_tab-height) + ${DesignToken.density.calc(-3)});\r\n font-size: var(--m3e-tab-font-size, ${DesignToken.typescale.standard.title.small.fontSize});\r\n font-weight: var(--m3e-tab-font-weight, ${DesignToken.typescale.standard.title.small.fontWeight});\r\n line-height: var(--m3e-tab-line-height, ${DesignToken.typescale.standard.title.small.lineHeight});\r\n letter-spacing: var(--m3e-tab-tracking, ${DesignToken.typescale.standard.title.small.tracking});\r\n flex-grow: var(--_tab-grow);\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n :host(:not(:disabled)) {\r\n cursor: pointer;\r\n }\r\n .base {\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 height: 100%;\r\n padding-inline-start: var(--m3e-tab-padding-start, 1.5rem);\r\n padding-inline-end: var(--m3e-tab-padding-end, 1.5rem);\r\n }\r\n .touch {\r\n position: absolute;\r\n height: 3rem;\r\n left: 0;\r\n right: 0;\r\n }\r\n .focus-ring {\r\n border-radius: var(--m3e-tab-focus-ring-shape, ${DesignToken.shape.corner.large});\r\n }\r\n :host([selected]:focus-within) .focus-ring {\r\n top: var(--_tab-focus-ring-top-offset, 0);\r\n bottom: var(--_tab-focus-ring-bottom-offset, 0);\r\n }\r\n :host([selected]:not(:disabled)) .base {\r\n color: var(--m3e-tab-selected-color, var(--_tab-selected-color, ${DesignToken.color.primary}));\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-tab-selected-container-hover-color,\r\n var(--_tab-selected-container-hover-color, ${DesignToken.color.primary})\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --_tab-selected-container-focus-color,\r\n var(--m3e-tab-selected-container-focus-color, ${DesignToken.color.primary})\r\n );\r\n --m3e-ripple-color: var(\r\n --_tab-selected-ripple-color,\r\n var(--m3e-tab-selected-ripple-color, ${DesignToken.color.primary})\r\n );\r\n }\r\n :host(:not([selected]):not(:disabled)) .base {\r\n color: var(--m3e-tab-unselected-color, ${DesignToken.color.onSurfaceVariant});\r\n --m3e-state-layer-hover-color: var(--m3e-tab-unselected-container-hover-color, ${DesignToken.color.onSurface});\r\n --m3e-state-layer-focus-color: var(--m3e-tab-unselected-container-focus-color, ${DesignToken.color.onSurface});\r\n --m3e-ripple-color: var(--m3e-tab-unselected-ripple-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:disabled) .base {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-tab-disabled-color, ${DesignToken.color.onSurface}) var(--m3e-tab-disabled-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n .wrapper {\r\n display: inline-flex;\r\n align-items: center;\r\n white-space: nowrap;\r\n flex-direction: var(--_tab-direction);\r\n justify-content: center;\r\n column-gap: var(--m3e-tab-spacing, 0.5rem);\r\n }\r\n ::slotted([slot=\"icon\"]) {\r\n width: 1em;\r\n font-size: var(--m3e-tab-icon-size, 1.5rem) !important;\r\n }\r\n @media (forced-colors: active) {\r\n :host([selected]:not(:disabled)) .base {\r\n color: ButtonText;\r\n }\r\n :host(:not([selected]):not(:disabled)) .base {\r\n color: ButtonText;\r\n }\r\n :host(:disabled) .base {\r\n color: GrayText;\r\n }\r\n }\r\n `;\r\n\r\n /** @private */ private static __nextId = 0;\r\n\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 */ readonly #clickHandler = (e: Event) => this.#handleClick(e);\r\n\r\n /** @internal A reference to the element that wraps the label of the tab. */\r\n @query(\".label\") readonly label!: HTMLElement;\r\n\r\n /** @inheritdoc */\r\n override attach(control: HTMLElement): void {\r\n super.attach(control);\r\n\r\n control.id = control.id || `m3e-tab-panel-${M3eTabElement.__nextId++}`;\r\n addAriaReferencedId(this, \"aria-controls\", control.id);\r\n }\r\n\r\n /** @inheritdoc */\r\n override detach(): void {\r\n if (this.control && this.control.id) {\r\n removeAriaReferencedId(this, \"aria-controls\", this.control.id);\r\n }\r\n\r\n super.detach();\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n this.addEventListener(\"click\", this.#clickHandler);\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n this.removeEventListener(\"click\", this.#clickHandler);\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 update(changedProperties: PropertyValues<this>): void {\r\n super.update(changedProperties);\r\n\r\n if (changedProperties.has(\"selected\")) {\r\n this.closest(\"m3e-tabs\")?.[selectionManager].notifySelectionChange(this);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\">\r\n <m3e-state-layer class=\"state-layer\" ?disabled=\"${this.disabled}\"></m3e-state-layer>\r\n <m3e-focus-ring class=\"focus-ring\" inward ?disabled=\"${this.disabled}\"></m3e-focus-ring>\r\n <m3e-ripple class=\"ripple\" ?disabled=\"${this.disabled}\"></m3e-ripple>\r\n <div class=\"touch\" aria-hidden=\"true\"></div>\r\n <div class=\"wrapper\">\r\n <slot name=\"icon\" aria-hidden=\"true\"></slot><span class=\"label\"><slot></slot></span>\r\n </div>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleClick(e: Event): void {\r\n if (this.disabled) {\r\n e.preventDefault();\r\n e.stopImmediatePropagation();\r\n }\r\n\r\n if (e.defaultPrevented || this.selected) 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.closest(\"m3e-tabs\")?.[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\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-tab\": M3eTabElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement } from \"lit\";\r\n\r\nimport { customElement, DesignToken, Role } from \"@m3e/web/core\";\r\n\r\n/**\r\n * A panel presented for a tab.\r\n *\r\n * @description\r\n * The `m3e-tab-panel` component represents the content region associated with a selected tab.\r\n * It is conditionally rendered based on tab selection and provides a structured surface for\r\n * displaying contextual information, media, or interactive elements. Panels are linked to their\r\n * corresponding tabs via the `for` attribute on `m3e-tab`, enabling declarative control and\r\n * accessible navigation consistent with Material 3 guidance.\r\n *\r\n * @example\r\n * The following example illustrates using the `m3e-tabs`, `m3e-tab`, and `m3e-tab-panel` components to present\r\n * secondary tabs.\r\n * ```html\r\n * <m3e-tabs>\r\n * <m3e-tab selected for=\"videos\"><m3e-icon slot=\"icon\" name=\"videocam\"></m3e-icon>Video</m3e-tab>\r\n * <m3e-tab for=\"photos\"><m3e-icon slot=\"icon\" name=\"photo\"></m3e-icon>Photos</m3e-tab>\r\n * <m3e-tab for=\"audio\"><m3e-icon slot=\"icon\" name=\"music_note\"></m3e-icon>Audio</m3e-tab>\r\n * <m3e-tab-panel id=\"videos\">Videos</m3e-tab-panel>\r\n * <m3e-tab-panel id=\"photos\">Photos</m3e-tab-panel>\r\n * <m3e-tab-panel id=\"audio\">Audio</m3e-tab-panel>\r\n * </m3e-tabs>\r\n * ```\r\n *\r\n * @tag m3e-tab-panel\r\n *\r\n * @slot - Renders the content of the panel.\r\n */\r\n@customElement(\"m3e-tab-panel\")\r\nexport class M3eTabPanelElement extends Role(LitElement, \"tabpanel\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n overflow-y: auto;\r\n scrollbar-width: ${DesignToken.scrollbar.width};\r\n scrollbar-color: ${DesignToken.scrollbar.color};\r\n }\r\n `;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n this.slot = \"panel\";\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<slot></slot>`;\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-tab-panel\": M3eTabPanelElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues, unsafeCSS } from \"lit\";\r\nimport { property, query, state } from \"lit/decorators.js\";\r\nimport { ifDefined } from \"lit/directives/if-defined.js\";\r\n\r\nimport {\r\n addCustomState,\r\n AttachInternals,\r\n customElement,\r\n deleteCustomState,\r\n DesignToken,\r\n hasCustomState,\r\n ResizeController,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { SelectionManager, selectionManager } from \"@m3e/web/core/a11y\";\r\nimport { M3eDirectionality } from \"@m3e/web/core/bidi\";\r\n\r\nimport \"@m3e/web/slide-group\";\r\n\r\nimport { TabVariant } from \"./TabVariant\";\r\nimport { M3eTabElement } from \"./TabElement\";\r\nimport { TabHeaderPosition } from \"./TabHeaderPosition\";\r\n\r\nconst MIN_PRIMARY_TAB_WIDTH = 24;\r\n\r\n/**\r\n * Organizes content into separate views where only one view can be visible at a time.\r\n *\r\n * @description\r\n * The `m3e-tabs` component provides a structured navigation surface for organizing content into distinct views,\r\n * where only one view is visible at a time. It supports scrollable tab headers with optional pagination,\r\n * accessible labeling for navigation controls, and configurable header positioning to suit various layout\r\n * contexts. Two visual variants are available: `primary`, which emphasizes active indicators and shape styling\r\n * for prominent navigation, and `secondary`, which offers a more subtle presentation with reduced indicator\r\n * thickness. Stretch behavior allows tabs to expand and align rhythmically within their container, consistent\r\n * with Material 3 guidance.\r\n *\r\n * @example\r\n * The following example illustrates using the `m3e-tabs`, `m3e-tab`, and `m3e-tab-panel` components to present\r\n * secondary tabs.\r\n * ```html\r\n * <m3e-tabs>\r\n * <m3e-tab selected for=\"videos\"><m3e-icon slot=\"icon\" name=\"videocam\"></m3e-icon>Video</m3e-tab>\r\n * <m3e-tab for=\"photos\"><m3e-icon slot=\"icon\" name=\"photo\"></m3e-icon>Photos</m3e-tab>\r\n * <m3e-tab for=\"audio\"><m3e-icon slot=\"icon\" name=\"music_note\"></m3e-icon>Audio</m3e-tab>\r\n * <m3e-tab-panel id=\"videos\">Videos</m3e-tab-panel>\r\n * <m3e-tab-panel id=\"photos\">Photos</m3e-tab-panel>\r\n * <m3e-tab-panel id=\"audio\">Audio</m3e-tab-panel>\r\n * </m3e-tabs>\r\n * ```\r\n *\r\n * @tag m3e-tabs\r\n *\r\n * @slot - Renders the tabs.\r\n * @slot panel - Renders the panels of the tabs.\r\n * @slot next-icon - Renders the icon to present for the next button used to paginate.\r\n * @slot prev-icon - Renders the icon to present for the previous button used to paginate.\r\n *\r\n * @attr disable-pagination - Whether scroll buttons are disabled.\r\n * @attr header-position - The position of the tab headers.\r\n * @attr next-page-label - The accessible label given to the button used to move to the previous page.\r\n * @attr previous-page-label - The accessible label given to the button used to move to the next page.\r\n * @attr stretch - Whether tabs are stretched to fill the header.\r\n * @attr variant - The appearance variant of the tabs.\r\n *\r\n * @fires change - Emitted when the selected tab changes.\r\n *\r\n * @cssprop --m3e-tabs-paginator-button-icon-size - Overrides the icon size for paginator buttons.\r\n * @cssprop --m3e-tabs-active-indicator-color - Color of the active tab indicator.\r\n * @cssprop --m3e-tabs-primary-before-active-indicator-shape - Border radius for active indicator when header is before and variant is primary.\r\n * @cssprop --m3e-tabs-primary-after-active-indicator-shape - Border radius for active indicator when header is after and variant is primary.\r\n * @cssprop --m3e-tabs-primary-active-indicator-inset - Inset for primary variant's active indicator.\r\n * @cssprop --m3e-tabs-primary-active-indicator-thickness - Thickness for primary variant's active indicator.\r\n * @cssprop --m3e-tabs-secondary-active-indicator-thickness - Thickness for secondary variant's active indicator.\r\n */\r\n@customElement(\"m3e-tabs\")\r\nexport class M3eTabsElement extends AttachInternals(LitElement) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: flex;\r\n flex-direction: column;\r\n position: relative;\r\n }\r\n .tablist {\r\n position: relative;\r\n box-sizing: border-box;\r\n flex: none;\r\n }\r\n ::slotted(prev-icon),\r\n ::slotted(next-icon),\r\n .icon {\r\n width: 1em;\r\n font-size: var(--m3e-tabs-paginator-button-icon-size, var(--m3e-icon-button-icon-size, 1.5rem)) !important;\r\n }\r\n .header {\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n .tabs {\r\n display: flex;\r\n flex-wrap: nowrap;\r\n align-items: center;\r\n }\r\n .ink-bar {\r\n box-sizing: border-box;\r\n height: var(--_tabs-active-indicator-thickness);\r\n }\r\n .active-indicator {\r\n position: relative;\r\n height: var(--_tabs-active-indicator-thickness);\r\n left: calc(var(--_tabs-active-tab-position) + var(--_tabs-activate-indicator-inset, 0px));\r\n width: calc(var(--_tabs-active-tab-size) - calc(var(--_tabs-activate-indicator-inset, 0px) * 2));\r\n background-color: var(--m3e-tabs-active-indicator-color, ${DesignToken.color.primary});\r\n transition: ${unsafeCSS(\r\n `left var(--m3e-slide-animation-duration, ${DesignToken.motion.duration.long2}) ${DesignToken.motion.easing.standard},\r\n width var(--m3e-slide-animation-duration, ${DesignToken.motion.duration.long2}) ${DesignToken.motion.easing.standard}`,\r\n )};\r\n }\r\n :host([header-position=\"after\"]) .header {\r\n flex-direction: column-reverse;\r\n }\r\n :host([header-position=\"before\"]) .ink-bar {\r\n margin-top: calc(0px - var(--_tabs-active-indicator-thickness));\r\n }\r\n :host([header-position=\"before\"]) .tablist {\r\n --m3e-slide-group-divider-bottom: var(--m3e-divider-thickness, 1px) solid\r\n var(--m3e-divider-color, ${DesignToken.color.outlineVariant});\r\n }\r\n :host([header-position=\"after\"]) .ink-bar {\r\n margin-bottom: calc(0px - var(--_tabs-active-indicator-thickness));\r\n }\r\n :host([header-position=\"after\"]) .tablist {\r\n --m3e-slide-group-divider-top: var(--m3e-divider-thickness, 1px) solid\r\n var(--m3e-divider-color, ${DesignToken.color.outlineVariant});\r\n }\r\n :host([header-position=\"before\"][variant=\"primary\"]) .active-indicator {\r\n border-radius: var(--m3e-tabs-primary-before-active-indicator-shape, ${DesignToken.shape.corner.extraSmallTop});\r\n }\r\n :host([header-position=\"after\"][variant=\"primary\"]) .active-indicator {\r\n border-radius: var(--m3e-tabs-primary-after-active-indicator-shape, ${DesignToken.shape.corner.extraSmallBottom});\r\n }\r\n .tabs {\r\n flex: 1 1 auto;\r\n }\r\n :host([variant=\"primary\"]) .tablist {\r\n --_tabs-activate-indicator-inset: var(--m3e-tabs-primary-active-indicator-inset, 0.125rem);\r\n --_tabs-active-indicator-thickness: var(--m3e-tabs-primary-active-indicator-thickness, 3px);\r\n --_tab-height: 4rem;\r\n }\r\n :host([header-position=\"before\"]) .tablist {\r\n --_tab-focus-ring-bottom-offset: calc(var(--_tabs-active-indicator-thickness) + 1px);\r\n }\r\n :host([header-position=\"after\"]) .tablist {\r\n --_tab-focus-ring-top-offset: calc(var(--_tabs-active-indicator-thickness) + 2px);\r\n }\r\n :host([header-position=\"before\"][variant=\"primary\"]) .tablist {\r\n --_tab-direction: column;\r\n }\r\n :host([header-position=\"after\"][variant=\"primary\"]) .tablist {\r\n --_tab-direction: column-reverse;\r\n }\r\n :host([variant=\"secondary\"]) .tablist {\r\n --_tabs-active-indicator-thickness: var(--m3e-tabs-secondary-active-indicator-thickness, 2px);\r\n --_tab-height: 3rem;\r\n --_tab-selected-color: ${DesignToken.color.onSurface};\r\n --_tab-selected-container-hover-color: ${DesignToken.color.onSurface};\r\n --_tab-selected-container-focus-color: ${DesignToken.color.onSurface};\r\n --_tab-selected-ripple-color: ${DesignToken.color.onSurface};\r\n }\r\n :host([stretch]) .header {\r\n width: 100%;\r\n --_tab-grow: 1;\r\n }\r\n :host(:state(-no-animate)) .active-indicator {\r\n transition: none;\r\n }\r\n @media (prefers-reduced-motion) {\r\n .active-indicator {\r\n transition: none;\r\n }\r\n }\r\n @media (forced-colors: active) {\r\n .active-indicator {\r\n background-color: ButtonText;\r\n --m3e-divider-color: GrayText;\r\n }\r\n }\r\n `;\r\n\r\n /** @private */ #directionalitySubscription?: () => void;\r\n /** @private */ @query(\".tablist\") private readonly _tablist!: HTMLElement;\r\n /** @private */ @state() _selectedIndex: number | null = null;\r\n\r\n /** @internal */\r\n readonly [selectionManager] = new SelectionManager<M3eTabElement>()\r\n .onSelectedItemsChange(() => this.#handleSelectedChange())\r\n .withHomeAndEnd()\r\n .withWrap()\r\n .withDirectionality(M3eDirectionality.current);\r\n\r\n constructor() {\r\n super();\r\n new ResizeController(this, {\r\n skipInitial: true,\r\n callback: () => {\r\n addCustomState(this, \"-no-animate\");\r\n this.#updateInkBar();\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Whether scroll buttons are disabled.\r\n * @default false\r\n */\r\n @property({ attribute: \"disable-pagination\", type: Boolean }) disablePagination = false;\r\n\r\n /**\r\n * The position of the tab headers.\r\n * @default \"before\"\r\n */\r\n @property({ attribute: \"header-position\", reflect: true }) headerPosition: TabHeaderPosition = \"before\";\r\n\r\n /**\r\n * The appearance variant of the tabs.\r\n * @default \"secondary\"\r\n */\r\n @property({ reflect: true }) variant: TabVariant = \"secondary\";\r\n\r\n /**\r\n * Whether tabs are stretched to fill the header.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) stretch = false;\r\n\r\n /**\r\n * The accessible label given to the button used to move to the previous page.\r\n * @default \"Previous page\"\r\n */\r\n @property({ attribute: \"previous-page-label\" }) previousPageLabel = \"Previous page\";\r\n\r\n /**\r\n * The accessible label given to the button used to move to the next page.\r\n * @default \"Next page\"\r\n */\r\n @property({ attribute: \"next-page-label\" }) nextPageLabel = \"Next page\";\r\n\r\n /** The tabs. */\r\n get tabs(): readonly M3eTabElement[] {\r\n return this[selectionManager]?.items ?? [];\r\n }\r\n\r\n /** The selected tab. */\r\n get selectedTab(): M3eTabElement | null {\r\n return this._selectedIndex !== null ? (this.tabs[this._selectedIndex] ?? null) : null;\r\n }\r\n\r\n /** The zero-based index of the selected tab. */\r\n get selectedIndex(): number {\r\n return this._selectedIndex ?? -1;\r\n }\r\n set selectedIndex(value: number) {\r\n if (value >= 0 && value < this.tabs.length) {\r\n this.tabs[value].selected = true;\r\n } else {\r\n const selectedTab = this.selectedTab;\r\n if (selectedTab) {\r\n selectedTab.selected = false;\r\n }\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n\r\n addCustomState(this, \"-no-animate\");\r\n this.#directionalitySubscription = M3eDirectionality.observe(() => {\r\n this.requestUpdate();\r\n this[selectionManager].directionality = M3eDirectionality.current;\r\n });\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this.#directionalitySubscription?.();\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(\"variant\") || _changedProperties.has(\"stretch\")) && this._selectedIndex !== null) {\r\n this.#updateInkBar();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n let panelIndex: number | undefined;\r\n if (this.selectedTab?.control) {\r\n panelIndex = [...this.querySelectorAll(\"[slot='panel']\")].indexOf(this.selectedTab.control);\r\n if (panelIndex === -1) {\r\n panelIndex = undefined;\r\n }\r\n }\r\n\r\n return html` ${this.headerPosition === \"before\" ? this.#renderHeader() : nothing}\r\n <m3e-slide class=\"tabs\" selected-index=\"${ifDefined(panelIndex)}\">\r\n <slot name=\"panel\"></slot>\r\n </m3e-slide>\r\n ${this.headerPosition === \"after\" ? this.#renderHeader() : nothing}`;\r\n }\r\n\r\n /** @private */\r\n #renderHeader(): unknown {\r\n return html`<m3e-slide-group\r\n class=\"tablist\"\r\n threshold=\"8\"\r\n previous-page-label=\"${this.previousPageLabel}\"\r\n next-page-label=\"${this.nextPageLabel}\"\r\n ?disabled=\"${this.disablePagination}\"\r\n >\r\n <slot name=\"prev-icon\" slot=\"prev-icon\">\r\n ${M3eDirectionality.current === \"ltr\"\r\n ? html`<svg class=\"prev icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"M640-80 240-480l400-400 71 71-329 329 329 329-71 71Z\" />\r\n </svg>`\r\n : html`<svg class=\"next icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"m321-80-71-71 329-329-329-329 71-71 400 400L321-80Z\" />\r\n </svg>`}\r\n </slot>\r\n <slot name=\"next-icon\" slot=\"next-icon\">\r\n ${M3eDirectionality.current === \"ltr\"\r\n ? html`<svg class=\"next icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"m321-80-71-71 329-329-329-329 71-71 400 400L321-80Z\" />\r\n </svg>`\r\n : html`<svg class=\"prev icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"M640-80 240-480l400-400 71 71-329 329 329 329-71 71Z\" />\r\n </svg>`}\r\n </slot>\r\n <div class=\"header\" role=\"tablist\">\r\n <div class=\"tabs\">\r\n <slot\r\n @slotchange=\"${this.#handleSlotChange}\"\r\n @keydown=\"${this.#handleKeyDown}\"\r\n @change=\"${this.#handleChange}\"\r\n ></slot>\r\n </div>\r\n <div class=\"ink-bar\" aria-hidden=\"true\">\r\n <div class=\"active-indicator\"></div>\r\n </div>\r\n </div>\r\n </m3e-slide-group>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(): void {\r\n this[selectionManager].setItems([...this.querySelectorAll(\"m3e-tab\")]);\r\n }\r\n\r\n /** @private */\r\n #handleKeyDown(e: KeyboardEvent): void {\r\n this[selectionManager].onKeyDown(e);\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 /** @private */\r\n #handleSelectedChange(): void {\r\n const selected = this[selectionManager].selectedItems[0];\r\n let selectedIndex = selected ? this.tabs.indexOf(selected) : null;\r\n if (selectedIndex === -1) {\r\n selectedIndex = null;\r\n }\r\n this._selectedIndex = selectedIndex;\r\n this.#updateInkBar();\r\n }\r\n\r\n /** @private */\r\n #updateInkBar(): void {\r\n if (!this._tablist) return;\r\n const selected = this[selectionManager].selectedItems[0];\r\n let left = 0;\r\n let width = 0;\r\n\r\n if (selected && this._selectedIndex !== null) {\r\n for (let i = 0; i < this._selectedIndex; i++) {\r\n left += this.tabs[i].clientWidth;\r\n }\r\n\r\n width = selected.clientWidth;\r\n if (this.variant === \"primary\" && selected.label) {\r\n left += selected.label.offsetLeft;\r\n width = selected.label.clientWidth;\r\n if (width < MIN_PRIMARY_TAB_WIDTH) {\r\n left -= (MIN_PRIMARY_TAB_WIDTH - width) / 2;\r\n width = MIN_PRIMARY_TAB_WIDTH;\r\n }\r\n }\r\n }\r\n\r\n this._tablist.style.setProperty(\"--_tabs-active-tab-position\", `${left}px`);\r\n this._tablist.style.setProperty(\"--_tabs-active-tab-size\", `${width}px`);\r\n\r\n if (width > 0 && hasCustomState(this, \"-no-animate\")) {\r\n setTimeout(() => deleteCustomState(this, \"-no-animate\"));\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-tabs\": M3eTabsElement;\r\n }\r\n}\r\n"],"names":["M3eTabElement","M3eTabElement_1","Selected","HtmlFor","KeyboardClick","Focusable","Disabled","AttachInternals","Role","LitElement","constructor","_M3eTabElement_clickHandler","set","e","__classPrivateFieldGet","call","attach","control","id","__nextId","addAriaReferencedId","detach","removeAriaReferencedId","connectedCallback","addEventListener","disconnectedCallback","removeEventListener","firstUpdated","_changedProperties","_focusRing","_stateLayer","_ripple","forEach","x","update","changedProperties","has","closest","selectionManager","notifySelectionChange","render","html","disabled","preventDefault","stopImmediatePropagation","defaultPrevented","selected","dispatchEvent","Event","bubbles","composed","cancelable","styles","css","DesignToken","density","calc","typescale","standard","title","small","fontSize","fontWeight","lineHeight","tracking","shape","corner","large","color","primary","onSurfaceVariant","onSurface","__decorate","query","prototype","customElement","M3eTabPanelElement","slot","scrollbar","width","MIN_PRIMARY_TAB_WIDTH","M3eTabsElement","_M3eTabsElement_directionalitySubscription","_selectedIndex","_a","SelectionManager","onSelectedItemsChange","_M3eTabsElement_instances","_M3eTabsElement_handleSelectedChange","withHomeAndEnd","withWrap","withDirectionality","M3eDirectionality","current","disablePagination","headerPosition","variant","stretch","previousPageLabel","nextPageLabel","ResizeController","skipInitial","callback","addCustomState","_M3eTabsElement_updateInkBar","tabs","items","selectedTab","selectedIndex","value","length","__classPrivateFieldSet","observe","requestUpdate","directionality","updated","panelIndex","querySelectorAll","indexOf","undefined","nothing","ifDefined","_M3eTabsElement_renderHeader","_M3eTabsElement_handleSlotChange","_M3eTabsElement_handleKeyDown","_M3eTabsElement_handleChange","setItems","onKeyDown","stopPropagation","selectedItems","_tablist","left","i","clientWidth","label","offsetLeft","style","setProperty","hasCustomState","setTimeout","deleteCustomState","unsafeCSS","motion","duration","long2","easing","outlineVariant","extraSmallTop","extraSmallBottom","state","property","attribute","type","Boolean","reflect"],"mappings":";;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDG;AAEI,IAAMA,aAAa,GAAAC,eAAA,GAAnB,MAAMD,aAAc,SAAQE,QAAQ,CACzCC,OAAO,CAACC,aAAa,CAACC,SAAS,CAACC,QAAQ,CAACC,eAAe,CAACC,IAAI,CAACC,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAC5F,CAAA;AAFMC,EAAAA,WAAAA,GAAA;;;AAuGL;IAAyBC,2BAAA,CAAAC,GAAA,CAAA,IAAA,EAAiBC,CAAQ,IAAKC,sBAAA,CAAA,IAAI,4DAAa,CAAAC,IAAA,CAAjB,IAAI,EAAcF,CAAC,CAAC,CAAA;AA+E7E,EAAA;AA1EE;EACSG,MAAMA,CAACC,OAAoB,EAAA;AAClC,IAAA,KAAK,CAACD,MAAM,CAACC,OAAO,CAAC;AAErBA,IAAAA,OAAO,CAACC,EAAE,GAAGD,OAAO,CAACC,EAAE,IAAI,CAAA,cAAA,EAAiBjB,eAAa,CAACkB,QAAQ,EAAE,CAAA,CAAE;IACtEC,mBAAmB,CAAC,IAAI,EAAE,eAAe,EAAEH,OAAO,CAACC,E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AA2B,EAAAxE,cAAA,CAAAP,SAAA,EAAA,mBAAA,EAAA,MAAA,CAAA;AAM7BF,UAAA,CAAA,CAA1D8E,QAAQ,CAAC;AAAEC,EAAAA,SAAS,EAAE,iBAAiB;AAAEG,EAAAA,OAAO,EAAE;AAAI,CAAE,CAAC,CAA8C,EAAAzE,cAAA,CAAAP,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AAM3EF,UAAA,CAAA,CAA5B8E,QAAQ,CAAC;AAAEI,EAAAA,OAAO,EAAE;CAAM,CAAC,CAAmC,EAAAzE,cAAA,CAAAP,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAMnBF,UAAA,CAAA,CAA3C8E,QAAQ,CAAC;AAAEE,EAAAA,IAAI,EAAEC,OAAO;AAAEC,EAAAA,OAAO,EAAE;AAAI,CAAE,CAAC,CAAiB,EAAAzE,cAAA,CAAAP,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAMZF,UAAA,CAAA,CAA/C8E,QAAQ,CAAC;AAAEC,EAAAA,SAAS,EAAE;CAAuB,CAAC,CAAqC,EAAAtE,cAAA,CAAAP,SAAA,EAAA,mBAAA,EAAA,MAAA,CAAA;AAMxCF,UAAA,CAAA,CAA3C8E,QAAQ,CAAC;AAAEC,EAAAA,SAAS,EAAE;CAAmB,CAAC,CAA6B,EAAAtE,cAAA,CAAAP,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AA1K7DO,cAAc,GAAAT,UAAA,CAAA,CAD1BG,aAAa,CAAC,UAAU,CAAC,CACb,EAAAM,cAAc,CAoV1B;;;;"}
1
+ {"version":3,"file":"tabs.js","sources":["../../src/tabs/TabElement.ts","../../src/tabs/TabPanelElement.ts","../../src/tabs/TabsElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement, PropertyValues } from \"lit\";\r\nimport { query } from \"lit/decorators.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n Focusable,\r\n HtmlFor,\r\n KeyboardClick,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n Role,\r\n Selected,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { addAriaReferencedId, removeAriaReferencedId, selectionManager } from \"@m3e/web/core/a11y\";\r\n\r\n/**\r\n * An interactive element that, when activated, presents an associated tab panel.\r\n *\r\n * @description\r\n * The `m3e-tab` component is an interactive control used within a tabbed interface to activate and\r\n * reveal an associated tab panel. It supports accessible labeling, optional iconography, and selection\r\n * state styling consistent with Material 3 guidance. Tabs may be disabled, selected, or linked to a\r\n * specific panel via the `for` attribute, enabling declarative control and semantic clarity.\r\n *\r\n * @example\r\n * The following example illustrates using the `m3e-tabs`, `m3e-tab`, and `m3e-tab-panel` components to present\r\n * secondary tabs.\r\n * ```html\r\n * <m3e-tabs>\r\n * <m3e-tab selected for=\"videos\"><m3e-icon slot=\"icon\" name=\"videocam\"></m3e-icon>Video</m3e-tab>\r\n * <m3e-tab for=\"photos\"><m3e-icon slot=\"icon\" name=\"photo\"></m3e-icon>Photos</m3e-tab>\r\n * <m3e-tab for=\"audio\"><m3e-icon slot=\"icon\" name=\"music_note\"></m3e-icon>Audio</m3e-tab>\r\n * <m3e-tab-panel id=\"videos\">Videos</m3e-tab-panel>\r\n * <m3e-tab-panel id=\"photos\">Photos</m3e-tab-panel>\r\n * <m3e-tab-panel id=\"audio\">Audio</m3e-tab-panel>\r\n * </m3e-tabs>\r\n * ```\r\n *\r\n * @tag m3e-tab\r\n *\r\n * @slot - Renders the label of the tab.\r\n * @slot icon - Renders an icon before the tab's label.\r\n *\r\n * @attr disabled - Whether the element is disabled.\r\n * @attr for - The identifier of the interactive control to which this element is attached.\r\n * @attr selected - Whether the element is selected.\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-tab-font-size - Font size for tab label.\r\n * @cssprop --m3e-tab-font-weight - Font weight for tab label.\r\n * @cssprop --m3e-tab-line-height - Line height for tab label.\r\n * @cssprop --m3e-tab-tracking - Letter spacing for tab label.\r\n * @cssprop --m3e-tab-padding-start - Padding on the inline start of the tab.\r\n * @cssprop --m3e-tab-padding-end - Padding on the inline end of the tab.\r\n * @cssprop --m3e-tab-focus-ring-shape - Border radius for the focus ring.\r\n * @cssprop --m3e-tab-selected-color - Text color for selected tab.\r\n * @cssprop --m3e-tab-selected-container-hover-color - Hover state-layer color for selected tab.\r\n * @cssprop --m3e-tab-selected-container-focus-color - Focus state-layer color for selected tab.\r\n * @cssprop --m3e-tab-selected-ripple-color - Ripple color for selected tab.\r\n * @cssprop --m3e-tab-unselected-color - Text color for unselected tab.\r\n * @cssprop --m3e-tab-unselected-container-hover-color - Hover state-layer color for unselected tab.\r\n * @cssprop --m3e-tab-unselected-container-focus-color - Focus state-layer color for unselected tab.\r\n * @cssprop --m3e-tab-unselected-ripple-color - Ripple color for unselected tab.\r\n * @cssprop --m3e-tab-disabled-color - Text color for disabled tab.\r\n * @cssprop --m3e-tab-disabled-opacity - Text opacity for disabled tab.\r\n * @cssprop --m3e-tab-spacing - Column gap between icon and label.\r\n * @cssprop --m3e-tab-icon-size - Font size for slotted icon.\r\n */\r\n@customElement(\"m3e-tab\")\r\nexport class M3eTabElement extends Selected(\r\n HtmlFor(KeyboardClick(Focusable(Disabled(AttachInternals(Role(LitElement, \"tab\"), 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 outline: none;\r\n user-select: none;\r\n height: calc(var(--_tab-height) + ${DesignToken.density.calc(-3)});\r\n font-size: var(--m3e-tab-font-size, ${DesignToken.typescale.standard.title.small.fontSize});\r\n font-weight: var(--m3e-tab-font-weight, ${DesignToken.typescale.standard.title.small.fontWeight});\r\n line-height: var(--m3e-tab-line-height, ${DesignToken.typescale.standard.title.small.lineHeight});\r\n letter-spacing: var(--m3e-tab-tracking, ${DesignToken.typescale.standard.title.small.tracking});\r\n flex-grow: var(--_tab-grow);\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n :host(:not(:disabled)) {\r\n cursor: pointer;\r\n }\r\n .base {\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 height: 100%;\r\n padding-inline-start: var(--m3e-tab-padding-start, 1.5rem);\r\n padding-inline-end: var(--m3e-tab-padding-end, 1.5rem);\r\n }\r\n .touch {\r\n position: absolute;\r\n height: 3rem;\r\n left: 0;\r\n right: 0;\r\n }\r\n .focus-ring {\r\n border-radius: var(--m3e-tab-focus-ring-shape, ${DesignToken.shape.corner.large});\r\n }\r\n :host([selected]:focus-within) .focus-ring {\r\n top: var(--_tab-focus-ring-top-offset, 0);\r\n bottom: var(--_tab-focus-ring-bottom-offset, 0);\r\n }\r\n :host([selected]:not(:disabled)) .base {\r\n color: var(--m3e-tab-selected-color, var(--_tab-selected-color, ${DesignToken.color.primary}));\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-tab-selected-container-hover-color,\r\n var(--_tab-selected-container-hover-color, ${DesignToken.color.primary})\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --_tab-selected-container-focus-color,\r\n var(--m3e-tab-selected-container-focus-color, ${DesignToken.color.primary})\r\n );\r\n --m3e-ripple-color: var(\r\n --_tab-selected-ripple-color,\r\n var(--m3e-tab-selected-ripple-color, ${DesignToken.color.primary})\r\n );\r\n }\r\n :host(:not([selected]):not(:disabled)) .base {\r\n color: var(--m3e-tab-unselected-color, ${DesignToken.color.onSurfaceVariant});\r\n --m3e-state-layer-hover-color: var(--m3e-tab-unselected-container-hover-color, ${DesignToken.color.onSurface});\r\n --m3e-state-layer-focus-color: var(--m3e-tab-unselected-container-focus-color, ${DesignToken.color.onSurface});\r\n --m3e-ripple-color: var(--m3e-tab-unselected-ripple-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:disabled) .base {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-tab-disabled-color, ${DesignToken.color.onSurface}) var(--m3e-tab-disabled-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n .wrapper {\r\n display: inline-flex;\r\n align-items: center;\r\n white-space: nowrap;\r\n flex-direction: var(--_tab-direction);\r\n justify-content: center;\r\n column-gap: var(--m3e-tab-spacing, 0.5rem);\r\n }\r\n ::slotted([slot=\"icon\"]) {\r\n width: 1em;\r\n font-size: var(--m3e-tab-icon-size, 1.5rem) !important;\r\n }\r\n @media (forced-colors: active) {\r\n :host([selected]:not(:disabled)) .base {\r\n color: ButtonText;\r\n }\r\n :host(:not([selected]):not(:disabled)) .base {\r\n color: ButtonText;\r\n }\r\n :host(:disabled) .base {\r\n color: GrayText;\r\n }\r\n }\r\n `;\r\n\r\n /** @private */ private static __nextId = 0;\r\n\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 */ readonly #clickHandler = (e: Event) => this.#handleClick(e);\r\n\r\n /** @internal A reference to the element that wraps the label of the tab. */\r\n @query(\".label\") readonly label!: HTMLElement;\r\n\r\n /** @inheritdoc */\r\n override attach(control: HTMLElement): void {\r\n super.attach(control);\r\n\r\n control.id = control.id || `m3e-tab-panel-${M3eTabElement.__nextId++}`;\r\n addAriaReferencedId(this, \"aria-controls\", control.id);\r\n }\r\n\r\n /** @inheritdoc */\r\n override detach(): void {\r\n if (this.control && this.control.id) {\r\n removeAriaReferencedId(this, \"aria-controls\", this.control.id);\r\n }\r\n\r\n super.detach();\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n this.addEventListener(\"click\", this.#clickHandler);\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n this.removeEventListener(\"click\", this.#clickHandler);\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 update(changedProperties: PropertyValues<this>): void {\r\n super.update(changedProperties);\r\n\r\n if (changedProperties.has(\"selected\")) {\r\n this.closest(\"m3e-tabs\")?.[selectionManager].notifySelectionChange(this);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\">\r\n <m3e-state-layer class=\"state-layer\" ?disabled=\"${this.disabled}\"></m3e-state-layer>\r\n <m3e-focus-ring class=\"focus-ring\" inward ?disabled=\"${this.disabled}\"></m3e-focus-ring>\r\n <m3e-ripple class=\"ripple\" ?disabled=\"${this.disabled}\"></m3e-ripple>\r\n <div class=\"touch\" aria-hidden=\"true\"></div>\r\n <div class=\"wrapper\">\r\n <slot name=\"icon\" aria-hidden=\"true\"></slot><span class=\"label\"><slot></slot></span>\r\n </div>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleClick(e: Event): void {\r\n if (this.disabled) {\r\n e.preventDefault();\r\n e.stopImmediatePropagation();\r\n }\r\n\r\n if (e.defaultPrevented || this.selected) 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.closest(\"m3e-tabs\")?.[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\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-tab\": M3eTabElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement } from \"lit\";\r\n\r\nimport { customElement, DesignToken, Role } from \"@m3e/web/core\";\r\n\r\n/**\r\n * A panel presented for a tab.\r\n *\r\n * @description\r\n * The `m3e-tab-panel` component represents the content region associated with a selected tab.\r\n * It is conditionally rendered based on tab selection and provides a structured surface for\r\n * displaying contextual information, media, or interactive elements. Panels are linked to their\r\n * corresponding tabs via the `for` attribute on `m3e-tab`, enabling declarative control and\r\n * accessible navigation consistent with Material 3 guidance.\r\n *\r\n * @example\r\n * The following example illustrates using the `m3e-tabs`, `m3e-tab`, and `m3e-tab-panel` components to present\r\n * secondary tabs.\r\n * ```html\r\n * <m3e-tabs>\r\n * <m3e-tab selected for=\"videos\"><m3e-icon slot=\"icon\" name=\"videocam\"></m3e-icon>Video</m3e-tab>\r\n * <m3e-tab for=\"photos\"><m3e-icon slot=\"icon\" name=\"photo\"></m3e-icon>Photos</m3e-tab>\r\n * <m3e-tab for=\"audio\"><m3e-icon slot=\"icon\" name=\"music_note\"></m3e-icon>Audio</m3e-tab>\r\n * <m3e-tab-panel id=\"videos\">Videos</m3e-tab-panel>\r\n * <m3e-tab-panel id=\"photos\">Photos</m3e-tab-panel>\r\n * <m3e-tab-panel id=\"audio\">Audio</m3e-tab-panel>\r\n * </m3e-tabs>\r\n * ```\r\n *\r\n * @tag m3e-tab-panel\r\n *\r\n * @slot - Renders the content of the panel.\r\n */\r\n@customElement(\"m3e-tab-panel\")\r\nexport class M3eTabPanelElement extends Role(LitElement, \"tabpanel\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n overflow-y: auto;\r\n scrollbar-width: ${DesignToken.scrollbar.width};\r\n scrollbar-color: ${DesignToken.scrollbar.color};\r\n }\r\n `;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n this.slot = \"panel\";\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<slot></slot>`;\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-tab-panel\": M3eTabPanelElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues, unsafeCSS } from \"lit\";\r\nimport { property, query, state } from \"lit/decorators.js\";\r\nimport { ifDefined } from \"lit/directives/if-defined.js\";\r\n\r\nimport {\r\n addCustomState,\r\n AttachInternals,\r\n customElement,\r\n deleteCustomState,\r\n DesignToken,\r\n hasCustomState,\r\n ResizeController,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { SelectionManager, selectionManager } from \"@m3e/web/core/a11y\";\r\nimport { M3eDirectionality } from \"@m3e/web/core/bidi\";\r\n\r\nimport \"@m3e/web/slide-group\";\r\n\r\nimport { TabVariant } from \"./TabVariant\";\r\nimport { M3eTabElement } from \"./TabElement\";\r\nimport { TabHeaderPosition } from \"./TabHeaderPosition\";\r\n\r\nconst MIN_PRIMARY_TAB_WIDTH = 24;\r\n\r\n/**\r\n * Organizes content into separate views where only one view can be visible at a time.\r\n *\r\n * @description\r\n * The `m3e-tabs` component provides a structured navigation surface for organizing content into distinct views,\r\n * where only one view is visible at a time. It supports scrollable tab headers with optional pagination,\r\n * accessible labeling for navigation controls, and configurable header positioning to suit various layout\r\n * contexts. Two visual variants are available: `primary`, which emphasizes active indicators and shape styling\r\n * for prominent navigation, and `secondary`, which offers a more subtle presentation with reduced indicator\r\n * thickness. Stretch behavior allows tabs to expand and align rhythmically within their container, consistent\r\n * with Material 3 guidance.\r\n *\r\n * @example\r\n * The following example illustrates using the `m3e-tabs`, `m3e-tab`, and `m3e-tab-panel` components to present\r\n * secondary tabs.\r\n * ```html\r\n * <m3e-tabs>\r\n * <m3e-tab selected for=\"videos\"><m3e-icon slot=\"icon\" name=\"videocam\"></m3e-icon>Video</m3e-tab>\r\n * <m3e-tab for=\"photos\"><m3e-icon slot=\"icon\" name=\"photo\"></m3e-icon>Photos</m3e-tab>\r\n * <m3e-tab for=\"audio\"><m3e-icon slot=\"icon\" name=\"music_note\"></m3e-icon>Audio</m3e-tab>\r\n * <m3e-tab-panel id=\"videos\">Videos</m3e-tab-panel>\r\n * <m3e-tab-panel id=\"photos\">Photos</m3e-tab-panel>\r\n * <m3e-tab-panel id=\"audio\">Audio</m3e-tab-panel>\r\n * </m3e-tabs>\r\n * ```\r\n *\r\n * @tag m3e-tabs\r\n *\r\n * @slot - Renders the tabs.\r\n * @slot panel - Renders the panels of the tabs.\r\n * @slot next-icon - Renders the icon to present for the next button used to paginate.\r\n * @slot prev-icon - Renders the icon to present for the previous button used to paginate.\r\n *\r\n * @attr disable-pagination - Whether scroll buttons are disabled.\r\n * @attr header-position - The position of the tab headers.\r\n * @attr next-page-label - The accessible label given to the button used to move to the previous page.\r\n * @attr previous-page-label - The accessible label given to the button used to move to the next page.\r\n * @attr stretch - Whether tabs are stretched to fill the header.\r\n * @attr variant - The appearance variant of the tabs.\r\n *\r\n * @fires change - Emitted when the selected tab changes.\r\n *\r\n * @cssprop --m3e-tabs-paginator-button-icon-size - Overrides the icon size for paginator buttons.\r\n * @cssprop --m3e-tabs-active-indicator-color - Color of the active tab indicator.\r\n * @cssprop --m3e-tabs-primary-before-active-indicator-shape - Border radius for active indicator when header is before and variant is primary.\r\n * @cssprop --m3e-tabs-primary-after-active-indicator-shape - Border radius for active indicator when header is after and variant is primary.\r\n * @cssprop --m3e-tabs-primary-active-indicator-inset - Inset for primary variant's active indicator.\r\n * @cssprop --m3e-tabs-primary-active-indicator-thickness - Thickness for primary variant's active indicator.\r\n * @cssprop --m3e-tabs-secondary-active-indicator-thickness - Thickness for secondary variant's active indicator.\r\n */\r\n@customElement(\"m3e-tabs\")\r\nexport class M3eTabsElement extends AttachInternals(LitElement) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: flex;\r\n flex-direction: column;\r\n position: relative;\r\n }\r\n .tablist {\r\n position: relative;\r\n box-sizing: border-box;\r\n flex: none;\r\n }\r\n ::slotted(prev-icon),\r\n ::slotted(next-icon),\r\n .icon {\r\n width: 1em;\r\n font-size: var(--m3e-tabs-paginator-button-icon-size, var(--m3e-icon-button-icon-size, 1.5rem)) !important;\r\n }\r\n .header {\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n .tabs {\r\n display: flex;\r\n flex-wrap: nowrap;\r\n align-items: center;\r\n }\r\n .ink-bar {\r\n box-sizing: border-box;\r\n height: var(--_tabs-active-indicator-thickness);\r\n }\r\n .active-indicator {\r\n position: relative;\r\n height: var(--_tabs-active-indicator-thickness);\r\n left: calc(var(--_tabs-active-tab-position) + var(--_tabs-activate-indicator-inset, 0px));\r\n width: calc(var(--_tabs-active-tab-size) - calc(var(--_tabs-activate-indicator-inset, 0px) * 2));\r\n background-color: var(--m3e-tabs-active-indicator-color, ${DesignToken.color.primary});\r\n transition: ${unsafeCSS(\r\n `left var(--m3e-slide-animation-duration, ${DesignToken.motion.duration.long2}) ${DesignToken.motion.easing.standard},\r\n width var(--m3e-slide-animation-duration, ${DesignToken.motion.duration.long2}) ${DesignToken.motion.easing.standard}`,\r\n )};\r\n }\r\n :host([header-position=\"after\"]) .header {\r\n flex-direction: column-reverse;\r\n }\r\n :host([header-position=\"before\"]) .ink-bar {\r\n margin-top: calc(0px - var(--_tabs-active-indicator-thickness));\r\n }\r\n :host([header-position=\"before\"]) .tablist {\r\n --m3e-slide-group-divider-bottom: var(--m3e-divider-thickness, 1px) solid\r\n var(--m3e-divider-color, ${DesignToken.color.outlineVariant});\r\n }\r\n :host([header-position=\"after\"]) .ink-bar {\r\n margin-bottom: calc(0px - var(--_tabs-active-indicator-thickness));\r\n }\r\n :host([header-position=\"after\"]) .tablist {\r\n --m3e-slide-group-divider-top: var(--m3e-divider-thickness, 1px) solid\r\n var(--m3e-divider-color, ${DesignToken.color.outlineVariant});\r\n }\r\n :host([header-position=\"before\"][variant=\"primary\"]) .active-indicator {\r\n border-radius: var(--m3e-tabs-primary-before-active-indicator-shape, ${DesignToken.shape.corner.extraSmallTop});\r\n }\r\n :host([header-position=\"after\"][variant=\"primary\"]) .active-indicator {\r\n border-radius: var(--m3e-tabs-primary-after-active-indicator-shape, ${DesignToken.shape.corner.extraSmallBottom});\r\n }\r\n .tabs {\r\n flex: 1 1 auto;\r\n }\r\n :host([variant=\"primary\"]) .tablist {\r\n --_tabs-activate-indicator-inset: var(--m3e-tabs-primary-active-indicator-inset, 0.125rem);\r\n --_tabs-active-indicator-thickness: var(--m3e-tabs-primary-active-indicator-thickness, 3px);\r\n --_tab-height: 4rem;\r\n }\r\n :host([header-position=\"before\"]) .tablist {\r\n --_tab-focus-ring-bottom-offset: calc(var(--_tabs-active-indicator-thickness) + 1px);\r\n }\r\n :host([header-position=\"after\"]) .tablist {\r\n --_tab-focus-ring-top-offset: calc(var(--_tabs-active-indicator-thickness) + 2px);\r\n }\r\n :host([header-position=\"before\"][variant=\"primary\"]) .tablist {\r\n --_tab-direction: column;\r\n }\r\n :host([header-position=\"after\"][variant=\"primary\"]) .tablist {\r\n --_tab-direction: column-reverse;\r\n }\r\n :host([variant=\"secondary\"]) .tablist {\r\n --_tabs-active-indicator-thickness: var(--m3e-tabs-secondary-active-indicator-thickness, 2px);\r\n --_tab-height: 3rem;\r\n --_tab-selected-color: ${DesignToken.color.onSurface};\r\n --_tab-selected-container-hover-color: ${DesignToken.color.onSurface};\r\n --_tab-selected-container-focus-color: ${DesignToken.color.onSurface};\r\n --_tab-selected-ripple-color: ${DesignToken.color.onSurface};\r\n }\r\n :host([stretch]) .header {\r\n width: 100%;\r\n --_tab-grow: 1;\r\n }\r\n :host(:is(:state(--no-animate), :--no-animate)) .active-indicator {\r\n transition: none;\r\n }\r\n @media (prefers-reduced-motion) {\r\n .active-indicator {\r\n transition: none;\r\n }\r\n }\r\n @media (forced-colors: active) {\r\n .active-indicator {\r\n background-color: ButtonText;\r\n --m3e-divider-color: GrayText;\r\n }\r\n }\r\n `;\r\n\r\n /** @private */ #directionalitySubscription?: () => void;\r\n /** @private */ @query(\".tablist\") private readonly _tablist!: HTMLElement;\r\n /** @private */ @state() _selectedIndex: number | null = null;\r\n\r\n /** @internal */\r\n readonly [selectionManager] = new SelectionManager<M3eTabElement>()\r\n .onSelectedItemsChange(() => this.#handleSelectedChange())\r\n .withHomeAndEnd()\r\n .withWrap()\r\n .withDirectionality(M3eDirectionality.current);\r\n\r\n constructor() {\r\n super();\r\n new ResizeController(this, {\r\n skipInitial: true,\r\n callback: () => {\r\n addCustomState(this, \"--no-animate\");\r\n this.#updateInkBar();\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Whether scroll buttons are disabled.\r\n * @default false\r\n */\r\n @property({ attribute: \"disable-pagination\", type: Boolean }) disablePagination = false;\r\n\r\n /**\r\n * The position of the tab headers.\r\n * @default \"before\"\r\n */\r\n @property({ attribute: \"header-position\", reflect: true }) headerPosition: TabHeaderPosition = \"before\";\r\n\r\n /**\r\n * The appearance variant of the tabs.\r\n * @default \"secondary\"\r\n */\r\n @property({ reflect: true }) variant: TabVariant = \"secondary\";\r\n\r\n /**\r\n * Whether tabs are stretched to fill the header.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) stretch = false;\r\n\r\n /**\r\n * The accessible label given to the button used to move to the previous page.\r\n * @default \"Previous page\"\r\n */\r\n @property({ attribute: \"previous-page-label\" }) previousPageLabel = \"Previous page\";\r\n\r\n /**\r\n * The accessible label given to the button used to move to the next page.\r\n * @default \"Next page\"\r\n */\r\n @property({ attribute: \"next-page-label\" }) nextPageLabel = \"Next page\";\r\n\r\n /** The tabs. */\r\n get tabs(): readonly M3eTabElement[] {\r\n return this[selectionManager]?.items ?? [];\r\n }\r\n\r\n /** The selected tab. */\r\n get selectedTab(): M3eTabElement | null {\r\n return this._selectedIndex !== null ? (this.tabs[this._selectedIndex] ?? null) : null;\r\n }\r\n\r\n /** The zero-based index of the selected tab. */\r\n get selectedIndex(): number {\r\n return this._selectedIndex ?? -1;\r\n }\r\n set selectedIndex(value: number) {\r\n if (value >= 0 && value < this.tabs.length) {\r\n this.tabs[value].selected = true;\r\n } else {\r\n const selectedTab = this.selectedTab;\r\n if (selectedTab) {\r\n selectedTab.selected = false;\r\n }\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n\r\n addCustomState(this, \"--no-animate\");\r\n this.#directionalitySubscription = M3eDirectionality.observe(() => {\r\n this.requestUpdate();\r\n this[selectionManager].directionality = M3eDirectionality.current;\r\n });\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this.#directionalitySubscription?.();\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(\"variant\") || _changedProperties.has(\"stretch\")) && this._selectedIndex !== null) {\r\n this.#updateInkBar();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n let panelIndex: number | undefined;\r\n if (this.selectedTab?.control) {\r\n panelIndex = [...this.querySelectorAll(\"[slot='panel']\")].indexOf(this.selectedTab.control);\r\n if (panelIndex === -1) {\r\n panelIndex = undefined;\r\n }\r\n }\r\n\r\n return html` ${this.headerPosition === \"before\" ? this.#renderHeader() : nothing}\r\n <m3e-slide class=\"tabs\" selected-index=\"${ifDefined(panelIndex)}\">\r\n <slot name=\"panel\"></slot>\r\n </m3e-slide>\r\n ${this.headerPosition === \"after\" ? this.#renderHeader() : nothing}`;\r\n }\r\n\r\n /** @private */\r\n #renderHeader(): unknown {\r\n return html`<m3e-slide-group\r\n class=\"tablist\"\r\n threshold=\"8\"\r\n previous-page-label=\"${this.previousPageLabel}\"\r\n next-page-label=\"${this.nextPageLabel}\"\r\n ?disabled=\"${this.disablePagination}\"\r\n >\r\n <slot name=\"prev-icon\" slot=\"prev-icon\">\r\n ${M3eDirectionality.current === \"ltr\"\r\n ? html`<svg class=\"prev icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"M640-80 240-480l400-400 71 71-329 329 329 329-71 71Z\" />\r\n </svg>`\r\n : html`<svg class=\"next icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"m321-80-71-71 329-329-329-329 71-71 400 400L321-80Z\" />\r\n </svg>`}\r\n </slot>\r\n <slot name=\"next-icon\" slot=\"next-icon\">\r\n ${M3eDirectionality.current === \"ltr\"\r\n ? html`<svg class=\"next icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"m321-80-71-71 329-329-329-329 71-71 400 400L321-80Z\" />\r\n </svg>`\r\n : html`<svg class=\"prev icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"M640-80 240-480l400-400 71 71-329 329 329 329-71 71Z\" />\r\n </svg>`}\r\n </slot>\r\n <div class=\"header\" role=\"tablist\">\r\n <div class=\"tabs\">\r\n <slot\r\n @slotchange=\"${this.#handleSlotChange}\"\r\n @keydown=\"${this.#handleKeyDown}\"\r\n @change=\"${this.#handleChange}\"\r\n ></slot>\r\n </div>\r\n <div class=\"ink-bar\" aria-hidden=\"true\">\r\n <div class=\"active-indicator\"></div>\r\n </div>\r\n </div>\r\n </m3e-slide-group>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(): void {\r\n this[selectionManager].setItems([...this.querySelectorAll(\"m3e-tab\")]);\r\n }\r\n\r\n /** @private */\r\n #handleKeyDown(e: KeyboardEvent): void {\r\n this[selectionManager].onKeyDown(e);\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 /** @private */\r\n #handleSelectedChange(): void {\r\n const selected = this[selectionManager].selectedItems[0];\r\n let selectedIndex = selected ? this.tabs.indexOf(selected) : null;\r\n if (selectedIndex === -1) {\r\n selectedIndex = null;\r\n }\r\n this._selectedIndex = selectedIndex;\r\n this.#updateInkBar();\r\n }\r\n\r\n /** @private */\r\n #updateInkBar(): void {\r\n if (!this._tablist) return;\r\n const selected = this[selectionManager].selectedItems[0];\r\n let left = 0;\r\n let width = 0;\r\n\r\n if (selected && this._selectedIndex !== null) {\r\n for (let i = 0; i < this._selectedIndex; i++) {\r\n left += this.tabs[i].clientWidth;\r\n }\r\n\r\n width = selected.clientWidth;\r\n if (this.variant === \"primary\" && selected.label) {\r\n left += selected.label.offsetLeft;\r\n width = selected.label.clientWidth;\r\n if (width < MIN_PRIMARY_TAB_WIDTH) {\r\n left -= (MIN_PRIMARY_TAB_WIDTH - width) / 2;\r\n width = MIN_PRIMARY_TAB_WIDTH;\r\n }\r\n }\r\n }\r\n\r\n this._tablist.style.setProperty(\"--_tabs-active-tab-position\", `${left}px`);\r\n this._tablist.style.setProperty(\"--_tabs-active-tab-size\", `${width}px`);\r\n\r\n if (width > 0 && hasCustomState(this, \"--no-animate\")) {\r\n setTimeout(() => deleteCustomState(this, \"--no-animate\"));\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-tabs\": M3eTabsElement;\r\n }\r\n}\r\n"],"names":["M3eTabElement","M3eTabElement_1","Selected","HtmlFor","KeyboardClick","Focusable","Disabled","AttachInternals","Role","LitElement","constructor","_M3eTabElement_clickHandler","set","e","__classPrivateFieldGet","call","attach","control","id","__nextId","addAriaReferencedId","detach","removeAriaReferencedId","connectedCallback","addEventListener","disconnectedCallback","removeEventListener","firstUpdated","_changedProperties","_focusRing","_stateLayer","_ripple","forEach","x","update","changedProperties","has","closest","selectionManager","notifySelectionChange","render","html","disabled","preventDefault","stopImmediatePropagation","defaultPrevented","selected","dispatchEvent","Event","bubbles","composed","cancelable","styles","css","DesignToken","density","calc","typescale","standard","title","small","fontSize","fontWeight","lineHeight","tracking","shape","corner","large","color","primary","onSurfaceVariant","onSurface","__decorate","query","prototype","customElement","M3eTabPanelElement","slot","scrollbar","width","MIN_PRIMARY_TAB_WIDTH","M3eTabsElement","_M3eTabsElement_directionalitySubscription","_selectedIndex","_a","SelectionManager","onSelectedItemsChange","_M3eTabsElement_instances","_M3eTabsElement_handleSelectedChange","withHomeAndEnd","withWrap","withDirectionality","M3eDirectionality","current","disablePagination","headerPosition","variant","stretch","previousPageLabel","nextPageLabel","ResizeController","skipInitial","callback","addCustomState","_M3eTabsElement_updateInkBar","tabs","items","selectedTab","selectedIndex","value","length","__classPrivateFieldSet","observe","requestUpdate","directionality","updated","panelIndex","querySelectorAll","indexOf","undefined","nothing","ifDefined","_M3eTabsElement_renderHeader","_M3eTabsElement_handleSlotChange","_M3eTabsElement_handleKeyDown","_M3eTabsElement_handleChange","setItems","onKeyDown","stopPropagation","selectedItems","_tablist","left","i","clientWidth","label","offsetLeft","style","setProperty","hasCustomState","setTimeout","deleteCustomState","unsafeCSS","motion","duration","long2","easing","outlineVariant","extraSmallTop","extraSmallBottom","state","property","attribute","type","Boolean","reflect"],"mappings":";;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDG;AAEI,IAAMA,aAAa,GAAAC,eAAA,GAAnB,MAAMD,aAAc,SAAQE,QAAQ,CACzCC,OAAO,CAACC,aAAa,CAACC,SAAS,CAACC,QAAQ,CAACC,eAAe,CAACC,IAAI,CAACC,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAC5F,CAAA;AAFMC,EAAAA,WAAAA,GAAA;;;AAuGL;IAAyBC,2BAAA,CAAAC,GAAA,CAAA,IAAA,EAAiBC,CAAQ,IAAKC,sBAAA,CAAA,IAAI,4DAAa,CAAAC,IAAA,CAAjB,IAAI,EAAcF,CAAC,CAAC,CAAA;AA+E7E,EAAA;AA1EE;EACSG,MAAMA,CAACC,OAAoB,EAAA;AAClC,IAAA,KAAK,CAACD,MAAM,CAACC,OAAO,CAAC;AAErBA,IAAAA,OAAO,CAACC,EAAE,GAAGD,OAAO,CAACC,EAAE,IAAI,CAAA,cAAA,EAAiBjB,eAAa,CAACkB,QAAQ,EAAE,CAAA,CAAE;IAC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