@m3e/web 2.5.10 → 2.5.11

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 (88) hide show
  1. package/dist/all.js +282 -86
  2. package/dist/all.js.map +1 -1
  3. package/dist/all.min.js +8 -8
  4. package/dist/all.min.js.map +1 -1
  5. package/dist/breadcrumb.js +1 -1
  6. package/dist/breadcrumb.js.map +1 -1
  7. package/dist/breadcrumb.min.js +1 -1
  8. package/dist/breadcrumb.min.js.map +1 -1
  9. package/dist/button.js +13 -7
  10. package/dist/button.js.map +1 -1
  11. package/dist/button.min.js +1 -1
  12. package/dist/button.min.js.map +1 -1
  13. package/dist/checkbox.js +5 -0
  14. package/dist/checkbox.js.map +1 -1
  15. package/dist/checkbox.min.js +1 -1
  16. package/dist/checkbox.min.js.map +1 -1
  17. package/dist/chips.js +2 -2
  18. package/dist/chips.js.map +1 -1
  19. package/dist/chips.min.js +1 -1
  20. package/dist/chips.min.js.map +1 -1
  21. package/dist/css-custom-data.json +5263 -5233
  22. package/dist/custom-elements.json +50798 -49906
  23. package/dist/fab.js +9 -9
  24. package/dist/fab.js.map +1 -1
  25. package/dist/fab.min.js +1 -1
  26. package/dist/fab.min.js.map +1 -1
  27. package/dist/form-field.js +4 -5
  28. package/dist/form-field.js.map +1 -1
  29. package/dist/form-field.min.js +1 -1
  30. package/dist/form-field.min.js.map +1 -1
  31. package/dist/html-custom-data.json +1693 -1666
  32. package/dist/icon-button.js +48 -42
  33. package/dist/icon-button.js.map +1 -1
  34. package/dist/icon-button.min.js +1 -1
  35. package/dist/icon-button.min.js.map +1 -1
  36. package/dist/menu.js +2 -2
  37. package/dist/menu.js.map +1 -1
  38. package/dist/menu.min.js +1 -1
  39. package/dist/menu.min.js.map +1 -1
  40. package/dist/option.js +1 -1
  41. package/dist/option.js.map +1 -1
  42. package/dist/option.min.js +1 -1
  43. package/dist/option.min.js.map +1 -1
  44. package/dist/paginator.js +1 -1
  45. package/dist/paginator.js.map +1 -1
  46. package/dist/paginator.min.js +2 -2
  47. package/dist/paginator.min.js.map +1 -1
  48. package/dist/radio-group.js +6 -1
  49. package/dist/radio-group.js.map +1 -1
  50. package/dist/radio-group.min.js +1 -1
  51. package/dist/radio-group.min.js.map +1 -1
  52. package/dist/split-button.js +1 -1
  53. package/dist/split-button.js.map +1 -1
  54. package/dist/split-button.min.js +1 -1
  55. package/dist/split-button.min.js.map +1 -1
  56. package/dist/src/button/ButtonElement.d.ts +1 -0
  57. package/dist/src/button/ButtonElement.d.ts.map +1 -1
  58. package/dist/src/checkbox/CheckboxElement.d.ts.map +1 -1
  59. package/dist/src/fab/styles/FabSizeToken.d.ts.map +1 -1
  60. package/dist/src/form-field/FormFieldElement.d.ts.map +1 -1
  61. package/dist/src/icon-button/IconButtonElement.d.ts +1 -0
  62. package/dist/src/icon-button/IconButtonElement.d.ts.map +1 -1
  63. package/dist/src/icon-button/styles/IconButtonSizeToken.d.ts.map +1 -1
  64. package/dist/src/menu/MenuElement.d.ts.map +1 -1
  65. package/dist/src/menu/MenuItemElementBase.d.ts.map +1 -1
  66. package/dist/src/option/OptionElement.d.ts.map +1 -1
  67. package/dist/src/paginator/PaginatorElement.d.ts.map +1 -1
  68. package/dist/src/radio-group/RadioElement.d.ts.map +1 -1
  69. package/dist/src/split-button/SplitButtonElement.d.ts.map +1 -1
  70. package/dist/src/switch/SwitchElement.d.ts.map +1 -1
  71. package/dist/src/switch/styles/SwitchToken.d.ts.map +1 -1
  72. package/dist/src/theme/ThemeElement.d.ts +6 -0
  73. package/dist/src/theme/ThemeElement.d.ts.map +1 -1
  74. package/dist/src/theme/ThemeIconElement.d.ts +60 -0
  75. package/dist/src/theme/ThemeIconElement.d.ts.map +1 -0
  76. package/dist/src/theme/ThemeVariant.d.ts +3 -0
  77. package/dist/src/theme/ThemeVariant.d.ts.map +1 -0
  78. package/dist/src/theme/index.d.ts +2 -0
  79. package/dist/src/theme/index.d.ts.map +1 -1
  80. package/dist/switch.js +16 -11
  81. package/dist/switch.js.map +1 -1
  82. package/dist/switch.min.js +1 -1
  83. package/dist/switch.min.js.map +1 -1
  84. package/dist/theme.js +174 -4
  85. package/dist/theme.js.map +1 -1
  86. package/dist/theme.min.js +31 -31
  87. package/dist/theme.min.js.map +1 -1
  88. package/package.json +1 -1
@@ -160,7 +160,7 @@ _M3eBreadcrumbItemButtonElement_handleClick = function _M3eBreadcrumbItemButtonE
160
160
  }
161
161
  };
162
162
  /** The styles of the element. */
163
- M3eBreadcrumbItemButtonElement.styles = css`:host { display: block; outline: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .base { display: flex; align-items: center; justify-content: center; position: relative; border-radius: var(--m3e-breadcrumb-item-shape, ${DesignToken.shape.corner.full}); height: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${DesignToken.density.calc(-1)}); column-gap: var(--m3e-breadcrumb-item-icon-label-space, 0.5rem); } .icon { font-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem); --m3e-icon-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem); } ::slotted([slot="icon"]) { font-size: inherit !important; flex: none; } ::slotted(svg[slot="icon"]) { width: 1em; height: 1em; } :host(:is(:state(--icon-only), :--icon-only)) .overflow { flex: none; } :host(:not(:is(:state(--icon-only), :--icon-only))), :host(:not(:is(:state(--icon-only), :--icon-only))) .base { min-width: 0; } :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base { color: var(--m3e-breadcrumb-item-icon-color, ${DesignToken.color.onSurfaceVariant}); } :host(:is(:state(--icon-only), :--icon-only)) .base { width: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${DesignToken.density.calc(-1)}); padding-inline: var(--m3e-breadcrumb-item-icon-padding-inline, 0px); --m3e-state-layer-hover-color: var( --m3e-breadcrumb-item-icon-hover-state-layer-color, ${DesignToken.color.onSurface} ); --m3e-state-layer-focus-color: var( --m3e-breadcrumb-item-icon-focus-state-layer-color, ${DesignToken.color.onSurface} ); --m3e-ripple-color: var(--m3e-breadcrumb-item-icon-pressed-state-layer-color, ${DesignToken.color.onSurface}); } :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base { color: var(--m3e-breadcrumb-item-label-color, ${DesignToken.color.primary}); } :host(:not(:is(:state(--icon-only), :--icon-only))) .base { font-size: var(--m3e-breadcrumb-item-label-font-size, ${DesignToken.typescale.standard.label.large.fontSize}); font-weight: var( --m3e-breadcrumb-item-label-font-weight, ${DesignToken.typescale.standard.label.large.fontWeight} ); line-height: var( --m3e-breadcrumb-item-label-line-height, ${DesignToken.typescale.standard.label.large.lineHeight} ); letter-spacing: var(--m3e-breadcrumb-item-label-tracking, ${DesignToken.typescale.standard.label.large.tracking}); } :host(:not(:is(:state(--icon-only), :--icon-only))) .base { padding-inline: var(--m3e-breadcrumb-item-label-padding-inline, 0.75rem); --m3e-state-layer-hover-color: var( --m3e-breadcrumb-item-label-hover-state-layer-color, ${DesignToken.color.primary} ); --m3e-state-layer-focus-color: var( --m3e-breadcrumb-item-label-focus-state-layer-color, ${DesignToken.color.primary} ); --m3e-ripple-color: var(--m3e-breadcrumb-item-label-pressed-state-layer-color, ${DesignToken.color.primary}); } :host([current]) .base { color: var(--m3e-breadcrumb-item-last-color, ${DesignToken.color.onSurface}); } :host(:not(:disabled):not([current])) { cursor: pointer; user-select: none; } :host(:disabled:not([current])) .base { color: color-mix( in srgb, var(--m3e-breadcrumb-item-disabled-color, ${DesignToken.color.onSurface}) var(--m3e-breadcrumb-item-disabled-opacity, 38%), transparent ); } .touch { position: absolute; height: 3rem; width: max(3rem, 100%); margin: auto; } a { all: unset; display: block; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; z-index: 1; } @media (forced-colors: active) { :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base, :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base { color: LinkText; outline: 1px solid LinkText; } :host(:disabled) .base { color: GrayText; } }`;
163
+ M3eBreadcrumbItemButtonElement.styles = css`:host { display: block; outline: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .base { display: flex; align-items: center; justify-content: center; position: relative; border-radius: var(--m3e-breadcrumb-item-shape, ${DesignToken.shape.corner.full}); height: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${DesignToken.density.calc(-3)}); column-gap: var(--m3e-breadcrumb-item-icon-label-space, 0.5rem); } .icon { font-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem); --m3e-icon-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem); } ::slotted([slot="icon"]) { font-size: inherit !important; flex: none; } ::slotted(svg[slot="icon"]) { width: 1em; height: 1em; } :host(:is(:state(--icon-only), :--icon-only)) .overflow { flex: none; } :host(:not(:is(:state(--icon-only), :--icon-only))), :host(:not(:is(:state(--icon-only), :--icon-only))) .base { min-width: 0; } :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base { color: var(--m3e-breadcrumb-item-icon-color, ${DesignToken.color.onSurfaceVariant}); } :host(:is(:state(--icon-only), :--icon-only)) .base { width: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${DesignToken.density.calc(-3)}); padding-inline: var(--m3e-breadcrumb-item-icon-padding-inline, 0px); --m3e-state-layer-hover-color: var( --m3e-breadcrumb-item-icon-hover-state-layer-color, ${DesignToken.color.onSurface} ); --m3e-state-layer-focus-color: var( --m3e-breadcrumb-item-icon-focus-state-layer-color, ${DesignToken.color.onSurface} ); --m3e-ripple-color: var(--m3e-breadcrumb-item-icon-pressed-state-layer-color, ${DesignToken.color.onSurface}); } :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base { color: var(--m3e-breadcrumb-item-label-color, ${DesignToken.color.primary}); } :host(:not(:is(:state(--icon-only), :--icon-only))) .base { font-size: var(--m3e-breadcrumb-item-label-font-size, ${DesignToken.typescale.standard.label.large.fontSize}); font-weight: var( --m3e-breadcrumb-item-label-font-weight, ${DesignToken.typescale.standard.label.large.fontWeight} ); line-height: var( --m3e-breadcrumb-item-label-line-height, ${DesignToken.typescale.standard.label.large.lineHeight} ); letter-spacing: var(--m3e-breadcrumb-item-label-tracking, ${DesignToken.typescale.standard.label.large.tracking}); } :host(:not(:is(:state(--icon-only), :--icon-only))) .base { padding-inline: var(--m3e-breadcrumb-item-label-padding-inline, 0.75rem); --m3e-state-layer-hover-color: var( --m3e-breadcrumb-item-label-hover-state-layer-color, ${DesignToken.color.primary} ); --m3e-state-layer-focus-color: var( --m3e-breadcrumb-item-label-focus-state-layer-color, ${DesignToken.color.primary} ); --m3e-ripple-color: var(--m3e-breadcrumb-item-label-pressed-state-layer-color, ${DesignToken.color.primary}); } :host([current]) .base { color: var(--m3e-breadcrumb-item-last-color, ${DesignToken.color.onSurface}); } :host(:not(:disabled):not([current])) { cursor: pointer; user-select: none; } :host(:disabled:not([current])) .base { color: color-mix( in srgb, var(--m3e-breadcrumb-item-disabled-color, ${DesignToken.color.onSurface}) var(--m3e-breadcrumb-item-disabled-opacity, 38%), transparent ); } .touch { position: absolute; height: 3rem; width: max(3rem, 100%); margin: auto; } a { all: unset; display: block; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; z-index: 1; } @media (forced-colors: active) { :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base, :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base { color: LinkText; outline: 1px solid LinkText; } :host(:disabled) .base { color: GrayText; } }`;
164
164
  __decorate([query(".focus-ring")], M3eBreadcrumbItemButtonElement.prototype, "_focusRing", void 0);
165
165
  __decorate([query(".state-layer")], M3eBreadcrumbItemButtonElement.prototype, "_stateLayer", void 0);
166
166
  __decorate([query(".ripple")], M3eBreadcrumbItemButtonElement.prototype, "_ripple", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.js","sources":["../../src/breadcrumb/BreadcrumbElement.ts","../../src/breadcrumb/isIconOnly.ts","../../src/breadcrumb/BreadcrumbItemButtonElement.ts","../../src/breadcrumb/BreadcrumbItemElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement } from \"lit\";\r\nimport { property } from \"lit/decorators.js\";\r\n\r\nimport { customElement, Role } from \"@m3e/web/core\";\r\n\r\nimport type { M3eBreadcrumbItemElement } from \"./BreadcrumbItemElement\";\r\n\r\n/**\r\n * Displays a hierarchical navigation path and identifies the user's\r\n * current location within an application.\r\n *\r\n * @description\r\n * The `m3e-breadcrumb` component arranges `m3e-breadcrumb-item` children into\r\n * a trail of navigation steps. It tracks the last item as the current page and\r\n * supports a custom separator slot for alternate divider content.\r\n *\r\n * @example\r\n * The following example illustrates a simple breadcrumb with three items.\r\n * ```html\r\n * <m3e-breadcrumb>\r\n * <m3e-breadcrumb-item href=\"/dashboard\">Dashboard</m3e-breadcrumb-item>\r\n * <m3e-breadcrumb-item href=\"/dashboard/reports\">Reports</m3e-breadcrumb-item>\r\n * <m3e-breadcrumb-item href=\"/dashboard/reports/annual\">Annual</m3e-breadcrumb-item>\r\n * </m3e-breadcrumb>\r\n * ```\r\n *\r\n * @tag m3e-breadcrumb\r\n *\r\n * @slot - Renders breadcrumb items.\r\n * @slot separator - Renders a custom separator between breadcrumb items.\r\n *\r\n * @attr wrap - Whether breadcrumb items should wrap onto a new line.\r\n */\r\n@customElement(\"m3e-breadcrumb\")\r\nexport class M3eBreadcrumbElement extends Role(LitElement, \"navigation\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n }\r\n .base {\r\n display: flex;\r\n align-items: center;\r\n }\r\n :host([wrap]) .base {\r\n flex-wrap: wrap;\r\n }\r\n slot[name=\"separator\"] {\r\n display: none;\r\n }\r\n `;\r\n\r\n /** @private */ #customSeparator: Element[] = [];\r\n\r\n /**\r\n * Whether items wrap to a new line.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) wrap = false;\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\" role=\"list\">\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n <slot name=\"separator\" @slotchange=\"${this.#handleSeparatorSlotChange}\"></slot>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(): void {\r\n const items = this.querySelectorAll(\"m3e-breadcrumb-item\");\r\n for (let i = 0; i < items.length; i++) {\r\n const item = items[i];\r\n if (i < items.length - 1) {\r\n item.removeAttribute(\"current\");\r\n } else if (!item.hasAttribute(\"current\")) {\r\n item.setAttribute(\"current\", \"page\");\r\n }\r\n this.#setSeparator(item);\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleSeparatorSlotChange(e: Event): void {\r\n this.#customSeparator = (e.target as HTMLSlotElement).assignedElements({ flatten: true });\r\n this.querySelectorAll(\"m3e-breadcrumb-item\").forEach((x) => this.#setSeparator(x));\r\n }\r\n\r\n /** @private */\r\n #setSeparator(item: M3eBreadcrumbItemElement): void {\r\n item._setSeparator(\r\n this.#customSeparator.map((x) => {\r\n const clone = <Element>x.cloneNode(true);\r\n clone.part = \"separator\";\r\n return clone;\r\n }),\r\n );\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-breadcrumb\": M3eBreadcrumbElement;\r\n }\r\n}\r\n","/** @internal */\r\nexport function isIconOnly(slot: HTMLSlotElement): boolean {\r\n const elements = slot.assignedElements({ flatten: true });\r\n if (elements.length === 1) {\r\n const rect = elements[0].getBoundingClientRect();\r\n return rect.width <= 28 && rect.height <= 28;\r\n }\r\n return false;\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\nimport { ifDefined } from \"lit/directives/if-defined.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n Focusable,\r\n KeyboardClick,\r\n LinkButton,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n renderPseudoLink,\r\n Role,\r\n setCustomState,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { BreadcrumbItemCurrent } from \"./BreadcrumbItemCurrent\";\r\nimport { isIconOnly } from \"./isIconOnly\";\r\n\r\n/**\r\n * @internal\r\n * An internal interactive element used to present the content of a breadcrumb item.\r\n */\r\n@customElement(\"m3e-breadcrumb-item-button\")\r\nexport class M3eBreadcrumbItemButtonElement extends KeyboardClick(\r\n LinkButton(Focusable(Disabled(AttachInternals(Role(LitElement, \"button\"), true)))),\r\n) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n outline: none;\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n .base {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n border-radius: var(--m3e-breadcrumb-item-shape, ${DesignToken.shape.corner.full});\r\n height: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${DesignToken.density.calc(-1)});\r\n column-gap: var(--m3e-breadcrumb-item-icon-label-space, 0.5rem);\r\n }\r\n .icon {\r\n font-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem);\r\n --m3e-icon-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem);\r\n }\r\n ::slotted([slot=\"icon\"]) {\r\n font-size: inherit !important;\r\n flex: none;\r\n }\r\n ::slotted(svg[slot=\"icon\"]) {\r\n width: 1em;\r\n height: 1em;\r\n }\r\n :host(:is(:state(--icon-only), :--icon-only)) .overflow {\r\n flex: none;\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))),\r\n :host(:not(:is(:state(--icon-only), :--icon-only))) .base {\r\n min-width: 0;\r\n }\r\n :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base {\r\n color: var(--m3e-breadcrumb-item-icon-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host(:is(:state(--icon-only), :--icon-only)) .base {\r\n width: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${DesignToken.density.calc(-1)});\r\n padding-inline: var(--m3e-breadcrumb-item-icon-padding-inline, 0px);\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-breadcrumb-item-icon-hover-state-layer-color,\r\n ${DesignToken.color.onSurface}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-breadcrumb-item-icon-focus-state-layer-color,\r\n ${DesignToken.color.onSurface}\r\n );\r\n --m3e-ripple-color: var(--m3e-breadcrumb-item-icon-pressed-state-layer-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base {\r\n color: var(--m3e-breadcrumb-item-label-color, ${DesignToken.color.primary});\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))) .base {\r\n font-size: var(--m3e-breadcrumb-item-label-font-size, ${DesignToken.typescale.standard.label.large.fontSize});\r\n font-weight: var(\r\n --m3e-breadcrumb-item-label-font-weight,\r\n ${DesignToken.typescale.standard.label.large.fontWeight}\r\n );\r\n line-height: var(\r\n --m3e-breadcrumb-item-label-line-height,\r\n ${DesignToken.typescale.standard.label.large.lineHeight}\r\n );\r\n letter-spacing: var(--m3e-breadcrumb-item-label-tracking, ${DesignToken.typescale.standard.label.large.tracking});\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))) .base {\r\n padding-inline: var(--m3e-breadcrumb-item-label-padding-inline, 0.75rem);\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-breadcrumb-item-label-hover-state-layer-color,\r\n ${DesignToken.color.primary}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-breadcrumb-item-label-focus-state-layer-color,\r\n ${DesignToken.color.primary}\r\n );\r\n --m3e-ripple-color: var(--m3e-breadcrumb-item-label-pressed-state-layer-color, ${DesignToken.color.primary});\r\n }\r\n :host([current]) .base {\r\n color: var(--m3e-breadcrumb-item-last-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:not(:disabled):not([current])) {\r\n cursor: pointer;\r\n user-select: none;\r\n }\r\n :host(:disabled:not([current])) .base {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-breadcrumb-item-disabled-color, ${DesignToken.color.onSurface})\r\n var(--m3e-breadcrumb-item-disabled-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n .touch {\r\n position: absolute;\r\n height: 3rem;\r\n width: max(3rem, 100%);\r\n margin: auto;\r\n }\r\n a {\r\n all: unset;\r\n display: block;\r\n position: absolute;\r\n top: 0px;\r\n left: 0px;\r\n right: 0px;\r\n bottom: 0px;\r\n z-index: 1;\r\n }\r\n @media (forced-colors: active) {\r\n :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base,\r\n :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base {\r\n color: LinkText;\r\n outline: 1px solid LinkText;\r\n }\r\n :host(:disabled) .base {\r\n color: GrayText;\r\n }\r\n }\r\n `;\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\r\n /** @private */ #clickHandler = (e: Event) => this.#handleClick(e);\r\n\r\n /**\r\n * Indicates the current item in the breadcrumb path.\r\n * @default undefined\r\n */\r\n @property({ reflect: true }) current?: BreadcrumbItemCurrent;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n this.addEventListener(\"click\", this.#clickHandler);\r\n super.connectedCallback();\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(\"disabled\") || changedProperties.has(\"current\")) {\r\n this.ariaDisabled = this.disabled && !this.current ? \"true\" : null;\r\n }\r\n\r\n if (changedProperties.has(\"current\")) {\r\n if (this.current) {\r\n this.role = null;\r\n } else if (this.hasAttribute(\"href\")) {\r\n this.role = \"link\";\r\n } else {\r\n this.role = \"button\";\r\n }\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\" aria-current=\"${ifDefined(this.current)}\">\r\n ${this.current\r\n ? nothing\r\n : html`<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 ${this[renderPseudoLink]()}`}\r\n <slot class=\"icon\" name=\"icon\" aria-hidden=\"true\"></slot>\r\n <m3e-text-overflow class=\"overflow\">\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </m3e-text-overflow>\r\n ${this.current ? nothing : html`<div class=\"touch\" aria-hidden=\"true\"></div>`}\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(e: Event): void {\r\n setCustomState(this, \"--icon-only\", isIconOnly(e.target as HTMLSlotElement));\r\n }\r\n\r\n /** @private */\r\n #handleClick(e: Event): void {\r\n // If current and link, disable default link click handler behavior.\r\n if (this.current && this.href) {\r\n e.preventDefault();\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-breadcrumb-item-button\": M3eBreadcrumbItemButtonElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\nimport { ifDefined } from \"lit/directives/if-defined.js\";\r\n\r\nimport { AttachInternals, customElement, LinkButton, Role, setCustomState } from \"@m3e/web/core\";\r\n\r\nimport { M3eBreadcrumbItemButtonElement } from \"./BreadcrumbItemButtonElement\";\r\nimport { BreadcrumbItemCurrent } from \"./BreadcrumbItemCurrent\";\r\nimport { isIconOnly } from \"./isIconOnly\";\r\n\r\nimport \"./BreadcrumbItemButtonElement\";\r\n\r\n/**\r\n * An item in a breadcrumb.\r\n *\r\n * @description\r\n * The `m3e-breadcrumb-item` element represents a single item in a breadcrumb\r\n * navigation trail. It renders an internal button and supports navigation\r\n * attributes for link behavior.\r\n *\r\n * @tag m3e-breadcrumb-item\r\n *\r\n * @slot - Renders the content of the breadcrumb item.\r\n * @slot icon - Renders an icon before the item's label.\r\n *\r\n * @attr item-label - The accessible label used by the internal breadcrumb button.\r\n * @attr disabled - Whether the breadcrumb item is disabled.\r\n * @attr current - Marks the breadcrumb item as the current location in the trail.\r\n * @attr href - The URL to which the internal breadcrumb link button points.\r\n * @attr target - The target of the internal breadcrumb link button.\r\n * @attr download - A value indicating whether the internal link target will be downloaded, optionally specifying a file name.\r\n * @attr rel - The relationship between the internal link target and the document.\r\n *\r\n * @fires click - Dispatched when the element is clicked.\r\n *\r\n * @cssprop --m3e-breadcrumb-item-shape - Shape of the internal breadcrumb item button.\r\n * @cssprop --m3e-breadcrumb-item-container-height - Height of the internal breadcrumb item button container.\r\n * @cssprop --m3e-breadcrumb-item-icon-color - Color of breadcrumb item icon-only content.\r\n * @cssprop --m3e-breadcrumb-item-icon-padding-inline - Horizontal padding for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-icon-hover-state-layer-color - Hover state layer color for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-icon-focus-state-layer-color - Focus state layer color for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-icon-pressed-state-layer-color - Pressed state layer color for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-color - Color of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-font-size - Font size of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-font-weight - Font weight of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-line-height - Line height of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-tracking - Letter spacing of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-padding-inline - Horizontal padding for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-hover-state-layer-color - Hover state layer color for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-focus-state-layer-color - Focus state layer color for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-pressed-state-layer-color - Pressed state layer color for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-last-color - Color used for the current breadcrumb item.\r\n * @cssprop --m3e-breadcrumb-item-icon-label-space - Space between icon and label.\r\n * @cssprop --m3e-breadcrumb-item-icon-size - Size of the icon.\r\n * @cssprop --m3e-breadcrumb-item-disabled-color - Disabled color used by the breadcrumb item button.\r\n * @cssprop --m3e-breadcrumb-item-disabled-opacity - Disabled opacity used by the breadcrumb item button.\r\n */\r\n@customElement(\"m3e-breadcrumb-item\")\r\nexport class M3eBreadcrumbItemElement extends LinkButton(AttachInternals(Role(LitElement, \"listitem\")), true) {\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 .base {\r\n display: flex;\r\n align-items: center;\r\n height: 100%;\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))[current]),\r\n :host(:not(:is(:state(--icon-only), :--icon-only))[current]) .base {\r\n min-width: 0;\r\n }\r\n .button {\r\n flex: 1 1 auto;\r\n }\r\n .separator {\r\n flex: none;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n min-width: 0.5rem;\r\n --m3e-icon-size: var(--m3e-breadcrumb-separator-icon-size, 1.5rem);\r\n }\r\n .separator-icon {\r\n width: 1em;\r\n height: 1em;\r\n font-size: var(--m3e-icon-size);\r\n vertical-align: middle;\r\n }\r\n `;\r\n\r\n /** @private */ @query(\".button\") private readonly _button!: M3eBreadcrumbItemButtonElement;\r\n /** @private */ #defaultSeparator?: Element;\r\n\r\n /**\r\n * The accessible label given to the item's internal button.\r\n * @default \"\"\r\n */\r\n @property({ attribute: \"item-label\" }) itemLabel = \"\";\r\n\r\n /**\r\n * Whether the element is disabled.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) disabled = false;\r\n\r\n /**\r\n * Indicates the current item in the breadcrumb path.\r\n * @default undefined\r\n */\r\n @property({ reflect: true }) current?: BreadcrumbItemCurrent;\r\n\r\n /** @inheritdoc */\r\n override focus(options?: FocusOptions): void {\r\n this._button?.focus(options);\r\n }\r\n\r\n /** @inheritdoc */\r\n override blur(): void {\r\n this._button?.blur();\r\n }\r\n\r\n /** @inheritdoc */\r\n override click(): void {\r\n this._button?.click();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n if (_changedProperties.has(\"current\")) {\r\n this.#updateIconFilled();\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-breadcrumb-item-button\r\n class=\"button\"\r\n aria-label=\"${ifDefined(this.itemLabel || undefined)}\"\r\n ?disabled=\"${this.disabled}\"\r\n current=\"${ifDefined(this.current)}\"\r\n href=\"${ifDefined(this.href || undefined)}\"\r\n target=\"${ifDefined(this.target || undefined)}\"\r\n download=\"${ifDefined(this.download || undefined)}\"\r\n rel=\"${ifDefined(this.rel || undefined)}\"\r\n >\r\n <slot name=\"icon\" slot=\"icon\" @slotchange=\"${this.#handleIconSlotChange}\"></slot>\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </m3e-breadcrumb-item-button>\r\n ${this.#renderSeparator()}\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #renderSeparator(): unknown {\r\n return this.current\r\n ? nothing\r\n : html`<div class=\"separator\" aria-hidden=\"true\">\r\n <svg class=\"separator-icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z\" />\r\n </svg>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleIconSlotChange(): void {\r\n this.#updateIconFilled();\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(e: Event): void {\r\n setCustomState(this, \"--icon-only\", isIconOnly(e.target as HTMLSlotElement));\r\n this.#updateIconFilled();\r\n }\r\n\r\n /** @private */\r\n #updateIconFilled(): void {\r\n this.querySelectorAll(\"m3e-icon\").forEach((x) => (x.filled = this.current !== undefined && this.current !== null));\r\n }\r\n\r\n /** @internal */\r\n _setSeparator(nodes: Array<Node>) {\r\n const separator = this.shadowRoot?.querySelector(\".separator\");\r\n if (!separator) return;\r\n\r\n if (nodes.length > 0) {\r\n if (!this.#defaultSeparator && separator.firstElementChild) {\r\n this.#defaultSeparator = separator.firstElementChild;\r\n }\r\n separator.replaceChildren(...nodes);\r\n } else if (this.#defaultSeparator) {\r\n separator.replaceChildren(this.#defaultSeparator);\r\n this.#defaultSeparator = undefined;\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-breadcrumb-item\": M3eBreadcrumbItemElement;\r\n }\r\n}\r\n"],"names":["M3eBreadcrumbElement","Role","LitElement","constructor","_M3eBreadcrumbElement_customSeparator","set","wrap","render","html","__classPrivateFieldGet","_M3eBreadcrumbElement_instances","_M3eBreadcrumbElement_handleSlotChange","_M3eBreadcrumbElement_handleSeparatorSlotChange","items","querySelectorAll","i","length","item","removeAttribute","hasAttribute","setAttribute","_M3eBreadcrumbElement_setSeparator","call","e","__classPrivateFieldSet","target","assignedElements","flatten","forEach","x","_setSeparator","map","clone","cloneNode","part","styles","css","__decorate","property","type","Boolean","reflect","prototype","customElement","isIconOnly","slot","elements","rect","getBoundingClientRect","width","height","M3eBreadcrumbItemButtonElement","KeyboardClick","LinkButton","Focusable","Disabled","AttachInternals","_M3eBreadcrumbItemButtonElement_clickHandler","connectedCallback","addEventListener","disconnectedCallback","removeEventListener","firstUpdated","_changedProperties","_focusRing","_stateLayer","_ripple","attach","update","changedProperties","has","ariaDisabled","disabled","current","role","ifDefined","nothing","renderPseudoLink","_M3eBreadcrumbItemButtonElement_instances","_M3eBreadcrumbItemButtonElement_handleSlotChange","setCustomState","href","preventDefault","DesignToken","shape","corner","full","density","calc","color","onSurfaceVariant","onSurface","primary","typescale","standard","label","large","fontSize","fontWeight","lineHeight","tracking","query","M3eBreadcrumbItemElement","_M3eBreadcrumbItemElement_defaultSeparator","itemLabel","focus","options","_button","blur","click","updated","_M3eBreadcrumbItemElement_instances","_M3eBreadcrumbItemElement_updateIconFilled","undefined","download","rel","_M3eBreadcrumbItemElement_handleIconSlotChange","_M3eBreadcrumbItemElement_handleSlotChange","_M3eBreadcrumbItemElement_renderSeparator","nodes","separator","shadowRoot","querySelector","firstElementChild","replaceChildren","filled","attribute"],"mappings":";;;;;;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AAEI,IAAMA,oBAAoB,GAA1B,MAAMA,oBAAqB,SAAQC,IAAI,CAACC,UAAU,EAAE,YAAY,CAAC,CAAA;AAAjEC,EAAAA,WAAAA,GAAA;;;AAkBL;AAAgBC,IAAAA,qCAAA,CAAAC,GAAA,CAAA,IAAA,EAA8B,EAAE,CAAA;AAEhD;;;AAGG;IACyC,IAAA,CAAAC,IAAI,GAAG,KAAK;AAwC1D,EAAA;AAtCE;AACmBC,EAAAA,MAAMA,GAAA;IACvB,OAAOC,IAAI,oDACYC,sBAAA,CAAA,IAAI,EAAAC,+BAAA,EAAA,GAAA,EAAAC,sCAAA,CAAkB,CAAA,6CAAA,EACLF,sBAAA,CAAA,IAAI,EAAAC,+BAAA,EAAA,GAAA,EAAAE,+CAAA,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AC,CAA2D,EAAAC,wBAAA,CAAA5D,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAOrDL,UAAA,CAAA,CAAtCC,QAAQ,CAAC;AAAEwF,EAAAA,SAAS,EAAE;CAAc,CAAC,CAAgB,EAAAxB,wBAAA,CAAA5D,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAMVL,UAAA,CAAA,CAA3CC,QAAQ,CAAC;AAAEC,EAAAA,IAAI,EAAEC,OAAO;AAAEC,EAAAA,OAAO,EAAE;AAAI,CAAE,CAAC,CAAkB,EAAA6D,wBAAA,CAAA5D,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAMhCL,UAAA,CAAA,CAA5BC,QAAQ,CAAC;AAAEG,EAAAA,OAAO,EAAE;CAAM,CAAC,CAAiC,EAAA6D,wBAAA,CAAA5D,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AArDlD4D,wBAAwB,GAAAjE,UAAA,CAAA,CADpCM,aAAa,CAAC,qBAAqB,CAAC,CACxB,EAAA2D,wBAAwB,CA4IpC;;;;"}
1
+ {"version":3,"file":"breadcrumb.js","sources":["../../src/breadcrumb/BreadcrumbElement.ts","../../src/breadcrumb/isIconOnly.ts","../../src/breadcrumb/BreadcrumbItemButtonElement.ts","../../src/breadcrumb/BreadcrumbItemElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement } from \"lit\";\r\nimport { property } from \"lit/decorators.js\";\r\n\r\nimport { customElement, Role } from \"@m3e/web/core\";\r\n\r\nimport type { M3eBreadcrumbItemElement } from \"./BreadcrumbItemElement\";\r\n\r\n/**\r\n * Displays a hierarchical navigation path and identifies the user's\r\n * current location within an application.\r\n *\r\n * @description\r\n * The `m3e-breadcrumb` component arranges `m3e-breadcrumb-item` children into\r\n * a trail of navigation steps. It tracks the last item as the current page and\r\n * supports a custom separator slot for alternate divider content.\r\n *\r\n * @example\r\n * The following example illustrates a simple breadcrumb with three items.\r\n * ```html\r\n * <m3e-breadcrumb>\r\n * <m3e-breadcrumb-item href=\"/dashboard\">Dashboard</m3e-breadcrumb-item>\r\n * <m3e-breadcrumb-item href=\"/dashboard/reports\">Reports</m3e-breadcrumb-item>\r\n * <m3e-breadcrumb-item href=\"/dashboard/reports/annual\">Annual</m3e-breadcrumb-item>\r\n * </m3e-breadcrumb>\r\n * ```\r\n *\r\n * @tag m3e-breadcrumb\r\n *\r\n * @slot - Renders breadcrumb items.\r\n * @slot separator - Renders a custom separator between breadcrumb items.\r\n *\r\n * @attr wrap - Whether breadcrumb items should wrap onto a new line.\r\n */\r\n@customElement(\"m3e-breadcrumb\")\r\nexport class M3eBreadcrumbElement extends Role(LitElement, \"navigation\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n }\r\n .base {\r\n display: flex;\r\n align-items: center;\r\n }\r\n :host([wrap]) .base {\r\n flex-wrap: wrap;\r\n }\r\n slot[name=\"separator\"] {\r\n display: none;\r\n }\r\n `;\r\n\r\n /** @private */ #customSeparator: Element[] = [];\r\n\r\n /**\r\n * Whether items wrap to a new line.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) wrap = false;\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\" role=\"list\">\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n <slot name=\"separator\" @slotchange=\"${this.#handleSeparatorSlotChange}\"></slot>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(): void {\r\n const items = this.querySelectorAll(\"m3e-breadcrumb-item\");\r\n for (let i = 0; i < items.length; i++) {\r\n const item = items[i];\r\n if (i < items.length - 1) {\r\n item.removeAttribute(\"current\");\r\n } else if (!item.hasAttribute(\"current\")) {\r\n item.setAttribute(\"current\", \"page\");\r\n }\r\n this.#setSeparator(item);\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleSeparatorSlotChange(e: Event): void {\r\n this.#customSeparator = (e.target as HTMLSlotElement).assignedElements({ flatten: true });\r\n this.querySelectorAll(\"m3e-breadcrumb-item\").forEach((x) => this.#setSeparator(x));\r\n }\r\n\r\n /** @private */\r\n #setSeparator(item: M3eBreadcrumbItemElement): void {\r\n item._setSeparator(\r\n this.#customSeparator.map((x) => {\r\n const clone = <Element>x.cloneNode(true);\r\n clone.part = \"separator\";\r\n return clone;\r\n }),\r\n );\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-breadcrumb\": M3eBreadcrumbElement;\r\n }\r\n}\r\n","/** @internal */\r\nexport function isIconOnly(slot: HTMLSlotElement): boolean {\r\n const elements = slot.assignedElements({ flatten: true });\r\n if (elements.length === 1) {\r\n const rect = elements[0].getBoundingClientRect();\r\n return rect.width <= 28 && rect.height <= 28;\r\n }\r\n return false;\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\nimport { ifDefined } from \"lit/directives/if-defined.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n Focusable,\r\n KeyboardClick,\r\n LinkButton,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n renderPseudoLink,\r\n Role,\r\n setCustomState,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { BreadcrumbItemCurrent } from \"./BreadcrumbItemCurrent\";\r\nimport { isIconOnly } from \"./isIconOnly\";\r\n\r\n/**\r\n * @internal\r\n * An internal interactive element used to present the content of a breadcrumb item.\r\n */\r\n@customElement(\"m3e-breadcrumb-item-button\")\r\nexport class M3eBreadcrumbItemButtonElement extends KeyboardClick(\r\n LinkButton(Focusable(Disabled(AttachInternals(Role(LitElement, \"button\"), true)))),\r\n) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n outline: none;\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n .base {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n border-radius: var(--m3e-breadcrumb-item-shape, ${DesignToken.shape.corner.full});\r\n height: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${DesignToken.density.calc(-3)});\r\n column-gap: var(--m3e-breadcrumb-item-icon-label-space, 0.5rem);\r\n }\r\n .icon {\r\n font-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem);\r\n --m3e-icon-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem);\r\n }\r\n ::slotted([slot=\"icon\"]) {\r\n font-size: inherit !important;\r\n flex: none;\r\n }\r\n ::slotted(svg[slot=\"icon\"]) {\r\n width: 1em;\r\n height: 1em;\r\n }\r\n :host(:is(:state(--icon-only), :--icon-only)) .overflow {\r\n flex: none;\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))),\r\n :host(:not(:is(:state(--icon-only), :--icon-only))) .base {\r\n min-width: 0;\r\n }\r\n :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base {\r\n color: var(--m3e-breadcrumb-item-icon-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host(:is(:state(--icon-only), :--icon-only)) .base {\r\n width: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${DesignToken.density.calc(-3)});\r\n padding-inline: var(--m3e-breadcrumb-item-icon-padding-inline, 0px);\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-breadcrumb-item-icon-hover-state-layer-color,\r\n ${DesignToken.color.onSurface}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-breadcrumb-item-icon-focus-state-layer-color,\r\n ${DesignToken.color.onSurface}\r\n );\r\n --m3e-ripple-color: var(--m3e-breadcrumb-item-icon-pressed-state-layer-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base {\r\n color: var(--m3e-breadcrumb-item-label-color, ${DesignToken.color.primary});\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))) .base {\r\n font-size: var(--m3e-breadcrumb-item-label-font-size, ${DesignToken.typescale.standard.label.large.fontSize});\r\n font-weight: var(\r\n --m3e-breadcrumb-item-label-font-weight,\r\n ${DesignToken.typescale.standard.label.large.fontWeight}\r\n );\r\n line-height: var(\r\n --m3e-breadcrumb-item-label-line-height,\r\n ${DesignToken.typescale.standard.label.large.lineHeight}\r\n );\r\n letter-spacing: var(--m3e-breadcrumb-item-label-tracking, ${DesignToken.typescale.standard.label.large.tracking});\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))) .base {\r\n padding-inline: var(--m3e-breadcrumb-item-label-padding-inline, 0.75rem);\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-breadcrumb-item-label-hover-state-layer-color,\r\n ${DesignToken.color.primary}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-breadcrumb-item-label-focus-state-layer-color,\r\n ${DesignToken.color.primary}\r\n );\r\n --m3e-ripple-color: var(--m3e-breadcrumb-item-label-pressed-state-layer-color, ${DesignToken.color.primary});\r\n }\r\n :host([current]) .base {\r\n color: var(--m3e-breadcrumb-item-last-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:not(:disabled):not([current])) {\r\n cursor: pointer;\r\n user-select: none;\r\n }\r\n :host(:disabled:not([current])) .base {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-breadcrumb-item-disabled-color, ${DesignToken.color.onSurface})\r\n var(--m3e-breadcrumb-item-disabled-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n .touch {\r\n position: absolute;\r\n height: 3rem;\r\n width: max(3rem, 100%);\r\n margin: auto;\r\n }\r\n a {\r\n all: unset;\r\n display: block;\r\n position: absolute;\r\n top: 0px;\r\n left: 0px;\r\n right: 0px;\r\n bottom: 0px;\r\n z-index: 1;\r\n }\r\n @media (forced-colors: active) {\r\n :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base,\r\n :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base {\r\n color: LinkText;\r\n outline: 1px solid LinkText;\r\n }\r\n :host(:disabled) .base {\r\n color: GrayText;\r\n }\r\n }\r\n `;\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\r\n /** @private */ #clickHandler = (e: Event) => this.#handleClick(e);\r\n\r\n /**\r\n * Indicates the current item in the breadcrumb path.\r\n * @default undefined\r\n */\r\n @property({ reflect: true }) current?: BreadcrumbItemCurrent;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n this.addEventListener(\"click\", this.#clickHandler);\r\n super.connectedCallback();\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(\"disabled\") || changedProperties.has(\"current\")) {\r\n this.ariaDisabled = this.disabled && !this.current ? \"true\" : null;\r\n }\r\n\r\n if (changedProperties.has(\"current\")) {\r\n if (this.current) {\r\n this.role = null;\r\n } else if (this.hasAttribute(\"href\")) {\r\n this.role = \"link\";\r\n } else {\r\n this.role = \"button\";\r\n }\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\" aria-current=\"${ifDefined(this.current)}\">\r\n ${this.current\r\n ? nothing\r\n : html`<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 ${this[renderPseudoLink]()}`}\r\n <slot class=\"icon\" name=\"icon\" aria-hidden=\"true\"></slot>\r\n <m3e-text-overflow class=\"overflow\">\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </m3e-text-overflow>\r\n ${this.current ? nothing : html`<div class=\"touch\" aria-hidden=\"true\"></div>`}\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(e: Event): void {\r\n setCustomState(this, \"--icon-only\", isIconOnly(e.target as HTMLSlotElement));\r\n }\r\n\r\n /** @private */\r\n #handleClick(e: Event): void {\r\n // If current and link, disable default link click handler behavior.\r\n if (this.current && this.href) {\r\n e.preventDefault();\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-breadcrumb-item-button\": M3eBreadcrumbItemButtonElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\nimport { ifDefined } from \"lit/directives/if-defined.js\";\r\n\r\nimport { AttachInternals, customElement, LinkButton, Role, setCustomState } from \"@m3e/web/core\";\r\n\r\nimport { M3eBreadcrumbItemButtonElement } from \"./BreadcrumbItemButtonElement\";\r\nimport { BreadcrumbItemCurrent } from \"./BreadcrumbItemCurrent\";\r\nimport { isIconOnly } from \"./isIconOnly\";\r\n\r\nimport \"./BreadcrumbItemButtonElement\";\r\n\r\n/**\r\n * An item in a breadcrumb.\r\n *\r\n * @description\r\n * The `m3e-breadcrumb-item` element represents a single item in a breadcrumb\r\n * navigation trail. It renders an internal button and supports navigation\r\n * attributes for link behavior.\r\n *\r\n * @tag m3e-breadcrumb-item\r\n *\r\n * @slot - Renders the content of the breadcrumb item.\r\n * @slot icon - Renders an icon before the item's label.\r\n *\r\n * @attr item-label - The accessible label used by the internal breadcrumb button.\r\n * @attr disabled - Whether the breadcrumb item is disabled.\r\n * @attr current - Marks the breadcrumb item as the current location in the trail.\r\n * @attr href - The URL to which the internal breadcrumb link button points.\r\n * @attr target - The target of the internal breadcrumb link button.\r\n * @attr download - A value indicating whether the internal link target will be downloaded, optionally specifying a file name.\r\n * @attr rel - The relationship between the internal link target and the document.\r\n *\r\n * @fires click - Dispatched when the element is clicked.\r\n *\r\n * @cssprop --m3e-breadcrumb-item-shape - Shape of the internal breadcrumb item button.\r\n * @cssprop --m3e-breadcrumb-item-container-height - Height of the internal breadcrumb item button container.\r\n * @cssprop --m3e-breadcrumb-item-icon-color - Color of breadcrumb item icon-only content.\r\n * @cssprop --m3e-breadcrumb-item-icon-padding-inline - Horizontal padding for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-icon-hover-state-layer-color - Hover state layer color for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-icon-focus-state-layer-color - Focus state layer color for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-icon-pressed-state-layer-color - Pressed state layer color for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-color - Color of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-font-size - Font size of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-font-weight - Font weight of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-line-height - Line height of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-tracking - Letter spacing of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-padding-inline - Horizontal padding for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-hover-state-layer-color - Hover state layer color for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-focus-state-layer-color - Focus state layer color for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-pressed-state-layer-color - Pressed state layer color for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-last-color - Color used for the current breadcrumb item.\r\n * @cssprop --m3e-breadcrumb-item-icon-label-space - Space between icon and label.\r\n * @cssprop --m3e-breadcrumb-item-icon-size - Size of the icon.\r\n * @cssprop --m3e-breadcrumb-item-disabled-color - Disabled color used by the breadcrumb item button.\r\n * @cssprop --m3e-breadcrumb-item-disabled-opacity - Disabled opacity used by the breadcrumb item button.\r\n */\r\n@customElement(\"m3e-breadcrumb-item\")\r\nexport class M3eBreadcrumbItemElement extends LinkButton(AttachInternals(Role(LitElement, \"listitem\")), true) {\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 .base {\r\n display: flex;\r\n align-items: center;\r\n height: 100%;\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))[current]),\r\n :host(:not(:is(:state(--icon-only), :--icon-only))[current]) .base {\r\n min-width: 0;\r\n }\r\n .button {\r\n flex: 1 1 auto;\r\n }\r\n .separator {\r\n flex: none;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n min-width: 0.5rem;\r\n --m3e-icon-size: var(--m3e-breadcrumb-separator-icon-size, 1.5rem);\r\n }\r\n .separator-icon {\r\n width: 1em;\r\n height: 1em;\r\n font-size: var(--m3e-icon-size);\r\n vertical-align: middle;\r\n }\r\n `;\r\n\r\n /** @private */ @query(\".button\") private readonly _button!: M3eBreadcrumbItemButtonElement;\r\n /** @private */ #defaultSeparator?: Element;\r\n\r\n /**\r\n * The accessible label given to the item's internal button.\r\n * @default \"\"\r\n */\r\n @property({ attribute: \"item-label\" }) itemLabel = \"\";\r\n\r\n /**\r\n * Whether the element is disabled.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) disabled = false;\r\n\r\n /**\r\n * Indicates the current item in the breadcrumb path.\r\n * @default undefined\r\n */\r\n @property({ reflect: true }) current?: BreadcrumbItemCurrent;\r\n\r\n /** @inheritdoc */\r\n override focus(options?: FocusOptions): void {\r\n this._button?.focus(options);\r\n }\r\n\r\n /** @inheritdoc */\r\n override blur(): void {\r\n this._button?.blur();\r\n }\r\n\r\n /** @inheritdoc */\r\n override click(): void {\r\n this._button?.click();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n if (_changedProperties.has(\"current\")) {\r\n this.#updateIconFilled();\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-breadcrumb-item-button\r\n class=\"button\"\r\n aria-label=\"${ifDefined(this.itemLabel || undefined)}\"\r\n ?disabled=\"${this.disabled}\"\r\n current=\"${ifDefined(this.current)}\"\r\n href=\"${ifDefined(this.href || undefined)}\"\r\n target=\"${ifDefined(this.target || undefined)}\"\r\n download=\"${ifDefined(this.download || undefined)}\"\r\n rel=\"${ifDefined(this.rel || undefined)}\"\r\n >\r\n <slot name=\"icon\" slot=\"icon\" @slotchange=\"${this.#handleIconSlotChange}\"></slot>\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </m3e-breadcrumb-item-button>\r\n ${this.#renderSeparator()}\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #renderSeparator(): unknown {\r\n return this.current\r\n ? nothing\r\n : html`<div class=\"separator\" aria-hidden=\"true\">\r\n <svg class=\"separator-icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z\" />\r\n </svg>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleIconSlotChange(): void {\r\n this.#updateIconFilled();\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(e: Event): void {\r\n setCustomState(this, \"--icon-only\", isIconOnly(e.target as HTMLSlotElement));\r\n this.#updateIconFilled();\r\n }\r\n\r\n /** @private */\r\n #updateIconFilled(): void {\r\n this.querySelectorAll(\"m3e-icon\").forEach((x) => (x.filled = this.current !== undefined && this.current !== null));\r\n }\r\n\r\n /** @internal */\r\n _setSeparator(nodes: Array<Node>) {\r\n const separator = this.shadowRoot?.querySelector(\".separator\");\r\n if (!separator) return;\r\n\r\n if (nodes.length > 0) {\r\n if (!this.#defaultSeparator && separator.firstElementChild) {\r\n this.#defaultSeparator = separator.firstElementChild;\r\n }\r\n separator.replaceChildren(...nodes);\r\n } else if (this.#defaultSeparator) {\r\n separator.replaceChildren(this.#defaultSeparator);\r\n this.#defaultSeparator = undefined;\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-breadcrumb-item\": M3eBreadcrumbItemElement;\r\n }\r\n}\r\n"],"names":["M3eBreadcrumbElement","Role","LitElement","constructor","_M3eBreadcrumbElement_customSeparator","set","wrap","render","html","__classPrivateFieldGet","_M3eBreadcrumbElement_instances","_M3eBreadcrumbElement_handleSlotChange","_M3eBreadcrumbElement_handleSeparatorSlotChange","items","querySelectorAll","i","length","item","removeAttribute","hasAttribute","setAttribute","_M3eBreadcrumbElement_setSeparator","call","e","__classPrivateFieldSet","target","assignedElements","flatten","forEach","x","_setSeparator","map","clone","cloneNode","part","styles","css","__decorate","property","type","Boolean","reflect","prototype","customElement","isIconOnly","slot","elements","rect","getBoundingClientRect","width","height","M3eBreadcrumbItemButtonElement","KeyboardClick","LinkButton","Focusable","Disabled","AttachInternals","_M3eBreadcrumbItemButtonElement_clickHandler","connectedCallback","addEventListener","disconnectedCallback","removeEventListener","firstUpdated","_changedProperties","_focusRing","_stateLayer","_ripple","attach","update","changedProperties","has","ariaDisabled","disabled","current","role","ifDefined","nothing","renderPseudoLink","_M3eBreadcrumbItemButtonElement_instances","_M3eBreadcrumbItemButtonElement_handleSlotChange","setCustomState","href","preventDefault","DesignToken","shape","corner","full","density","calc","color","onSurfaceVariant","onSurface","primary","typescale","standard","label","large","fontSize","fontWeight","lineHeight","tracking","query","M3eBreadcrumbItemElement","_M3eBreadcrumbItemElement_defaultSeparator","itemLabel","focus","options","_button","blur","click","updated","_M3eBreadcrumbItemElement_instances","_M3eBreadcrumbItemElement_updateIconFilled","undefined","download","rel","_M3eBreadcrumbItemElement_handleIconSlotChange","_M3eBreadcrumbItemElement_handleSlotChange","_M3eBreadcrumbItemElement_renderSeparator","nodes","separator","shadowRoot","querySelector","firstElementChild","replaceChildren","filled","attribute"],"mappings":";;;;;;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AAEI,IAAMA,oBAAoB,GAA1B,MAAMA,oBAAqB,SAAQC,IAAI,CAACC,UAAU,EAAE,YAAY,CAAC,CAAA;AAAjEC,EAAAA,WAAAA,GAAA;;;AAkBL;AAAgBC,IAAAA,qCAAA,CAAAC,GAAA,CAAA,IAAA,EAA8B,EAAE,CAAA;AAEhD;;;AAGG;IACyC,IAAA,CAAAC,IAAI,GAAG,KAAK;AAwC1D,EAAA;AAtCE;AACmBC,EAAAA,MAAMA,GAAA;IACvB,OAAOC,IAAI,oDACYC,sBAAA,CAAA,IAAI,EAAAC,+BAAA,EAAA,GAAA,EAAAC,sCAAA,CAAkB,CAAA,6CAAA,EACLF,sBAAA,CAAA,IAAI,EAAAC,+BAAA,EAAA,GAAA,EAAAE,+CAAA,CAA2B,CAAA,eAAA,CAChE;AACT,EAAA;;;;;AAIE,EAAA,MAAMC,KAAK,GAAG,IAAI,CAACC,gBAAgB,CAAC,qBAAqB,CAAC;AAC1D,EAAA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,KAAK,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;AACrC,IAAA,MAAME,IAAI,GAAGJ,KAAK,CAACE,CAAC,CAAC;AACrB,IAAA,IAAIA,CAAC,GAAGF,KAAK,CAACG,MAAM,GAAG,CAAC,EAAE;AACxBC,MAAAA,IAAI,CAACC,eAAe,CAAC,SAAS,CAAC;IACjC,CAAC,MAAM,IAAI,CAACD,IAAI,CAACE,YAAY,CAAC,SAAS,CA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AA,OAAO,EAAE;CAAM,CAAC,CAAiC,EAAA6D,wBAAA,CAAA5D,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AArDlD4D,wBAAwB,GAAAjE,UAAA,CAAA,CADpCM,aAAa,CAAC,qBAAqB,CAAC,CACxB,EAAA2D,wBAAwB,CA4IpC;;;;"}
@@ -3,5 +3,5 @@
3
3
  * Copyright (c) 2025–2026 matraic
4
4
  * See LICENSE file in the project root for full license text.
5
5
  */
6
- import{__classPrivateFieldGet as e,__classPrivateFieldSet as t,__decorate as r}from"tslib";import{LitElement as i,html as o,css as a,nothing as s}from"lit";import{property as l,query as n}from"lit/decorators.js";import{Role as c,customElement as d,KeyboardClick as m,LinkButton as h,Focusable as u,Disabled as b,AttachInternals as p,renderPseudoLink as f,setCustomState as y,DesignToken as v}from"@m3e/web/core";import{ifDefined as g}from"lit/directives/if-defined.js";var $,w,x,k,S;let z=class extends(c(i,"navigation")){constructor(){super(...arguments),$.add(this),w.set(this,[]),this.wrap=!1}render(){return o`<div class="base" role="list"><slot @slotchange="${e(this,$,"m",x)}"></slot><slot name="separator" @slotchange="${e(this,$,"m",k)}"></slot></div>`}};function _(e){const t=e.assignedElements({flatten:!0});if(1===t.length){const e=t[0].getBoundingClientRect();return e.width<=28&&e.height<=28}return!1}var C,E,L,A;w=new WeakMap,$=new WeakSet,x=function(){const t=this.querySelectorAll("m3e-breadcrumb-item");for(let r=0;r<t.length;r++){const i=t[r];r<t.length-1?i.removeAttribute("current"):i.hasAttribute("current")||i.setAttribute("current","page"),e(this,$,"m",S).call(this,i)}},k=function(r){t(this,w,r.target.assignedElements({flatten:!0}),"f"),this.querySelectorAll("m3e-breadcrumb-item").forEach(t=>e(this,$,"m",S).call(this,t))},S=function(t){t._setSeparator(e(this,w,"f").map(e=>{const t=e.cloneNode(!0);return t.part="separator",t}))},z.styles=a`:host { display: block; } .base { display: flex; align-items: center; } :host([wrap]) .base { flex-wrap: wrap; } slot[name="separator"] { display: none; }`,r([l({type:Boolean,reflect:!0})],z.prototype,"wrap",void 0),z=r([d("m3e-breadcrumb")],z);let W=class extends(m(h(u(b(p(c(i,"button"),!0)))))){constructor(){super(...arguments),C.add(this),E.set(this,t=>e(this,C,"m",A).call(this,t))}connectedCallback(){this.addEventListener("click",e(this,E,"f")),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",e(this,E,"f"))}firstUpdated(e){super.firstUpdated(e),[this._focusRing,this._stateLayer,this._ripple].forEach(e=>e?.attach(this))}update(e){super.update(e),(e.has("disabled")||e.has("current"))&&(this.ariaDisabled=this.disabled&&!this.current?"true":null),e.has("current")&&(this.current?this.role=null:this.hasAttribute("href")?this.role="link":this.role="button")}render(){return o`<div class="base" aria-current="${g(this.current)}">${this.current?s:o`<m3e-state-layer class="state-layer" ?disabled="${this.disabled}"></m3e-state-layer><m3e-focus-ring class="focus-ring" ?disabled="${this.disabled}"></m3e-focus-ring><m3e-ripple class="ripple" ?disabled="${this.disabled}"></m3e-ripple>${this[f]()}`}<slot class="icon" name="icon" aria-hidden="true"></slot><m3e-text-overflow class="overflow"><slot @slotchange="${e(this,C,"m",L)}"></slot></m3e-text-overflow>${this.current?s:o`<div class="touch" aria-hidden="true"></div>`}</div>`}};var j,q,B,M,R,T;E=new WeakMap,C=new WeakSet,L=function(e){y(this,"--icon-only",_(e.target))},A=function(e){this.current&&this.href&&e.preventDefault()},W.styles=a`:host { display: block; outline: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .base { display: flex; align-items: center; justify-content: center; position: relative; border-radius: var(--m3e-breadcrumb-item-shape, ${v.shape.corner.full}); height: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${v.density.calc(-1)}); column-gap: var(--m3e-breadcrumb-item-icon-label-space, 0.5rem); } .icon { font-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem); --m3e-icon-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem); } ::slotted([slot="icon"]) { font-size: inherit !important; flex: none; } ::slotted(svg[slot="icon"]) { width: 1em; height: 1em; } :host(:is(:state(--icon-only), :--icon-only)) .overflow { flex: none; } :host(:not(:is(:state(--icon-only), :--icon-only))), :host(:not(:is(:state(--icon-only), :--icon-only))) .base { min-width: 0; } :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base { color: var(--m3e-breadcrumb-item-icon-color, ${v.color.onSurfaceVariant}); } :host(:is(:state(--icon-only), :--icon-only)) .base { width: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${v.density.calc(-1)}); padding-inline: var(--m3e-breadcrumb-item-icon-padding-inline, 0px); --m3e-state-layer-hover-color: var( --m3e-breadcrumb-item-icon-hover-state-layer-color, ${v.color.onSurface} ); --m3e-state-layer-focus-color: var( --m3e-breadcrumb-item-icon-focus-state-layer-color, ${v.color.onSurface} ); --m3e-ripple-color: var(--m3e-breadcrumb-item-icon-pressed-state-layer-color, ${v.color.onSurface}); } :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base { color: var(--m3e-breadcrumb-item-label-color, ${v.color.primary}); } :host(:not(:is(:state(--icon-only), :--icon-only))) .base { font-size: var(--m3e-breadcrumb-item-label-font-size, ${v.typescale.standard.label.large.fontSize}); font-weight: var( --m3e-breadcrumb-item-label-font-weight, ${v.typescale.standard.label.large.fontWeight} ); line-height: var( --m3e-breadcrumb-item-label-line-height, ${v.typescale.standard.label.large.lineHeight} ); letter-spacing: var(--m3e-breadcrumb-item-label-tracking, ${v.typescale.standard.label.large.tracking}); } :host(:not(:is(:state(--icon-only), :--icon-only))) .base { padding-inline: var(--m3e-breadcrumb-item-label-padding-inline, 0.75rem); --m3e-state-layer-hover-color: var( --m3e-breadcrumb-item-label-hover-state-layer-color, ${v.color.primary} ); --m3e-state-layer-focus-color: var( --m3e-breadcrumb-item-label-focus-state-layer-color, ${v.color.primary} ); --m3e-ripple-color: var(--m3e-breadcrumb-item-label-pressed-state-layer-color, ${v.color.primary}); } :host([current]) .base { color: var(--m3e-breadcrumb-item-last-color, ${v.color.onSurface}); } :host(:not(:disabled):not([current])) { cursor: pointer; user-select: none; } :host(:disabled:not([current])) .base { color: color-mix( in srgb, var(--m3e-breadcrumb-item-disabled-color, ${v.color.onSurface}) var(--m3e-breadcrumb-item-disabled-opacity, 38%), transparent ); } .touch { position: absolute; height: 3rem; width: max(3rem, 100%); margin: auto; } a { all: unset; display: block; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; z-index: 1; } @media (forced-colors: active) { :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base, :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base { color: LinkText; outline: 1px solid LinkText; } :host(:disabled) .base { color: GrayText; } }`,r([n(".focus-ring")],W.prototype,"_focusRing",void 0),r([n(".state-layer")],W.prototype,"_stateLayer",void 0),r([n(".ripple")],W.prototype,"_ripple",void 0),r([l({reflect:!0})],W.prototype,"current",void 0),W=r([d("m3e-breadcrumb-item-button")],W);let D=class extends(h(p(c(i,"listitem")),!0)){constructor(){super(...arguments),j.add(this),q.set(this,void 0),this.itemLabel="",this.disabled=!1}focus(e){this._button?.focus(e)}blur(){this._button?.blur()}click(){this._button?.click()}updated(t){super.updated(t),t.has("current")&&e(this,j,"m",T).call(this)}render(){return o`<div class="base"><m3e-breadcrumb-item-button class="button" aria-label="${g(this.itemLabel||void 0)}" ?disabled="${this.disabled}" current="${g(this.current)}" href="${g(this.href||void 0)}" target="${g(this.target||void 0)}" download="${g(this.download||void 0)}" rel="${g(this.rel||void 0)}"><slot name="icon" slot="icon" @slotchange="${e(this,j,"m",M)}"></slot><slot @slotchange="${e(this,j,"m",R)}"></slot></m3e-breadcrumb-item-button>${e(this,j,"m",B).call(this)}</div>`}_setSeparator(r){const i=this.shadowRoot?.querySelector(".separator");i&&(r.length>0?(!e(this,q,"f")&&i.firstElementChild&&t(this,q,i.firstElementChild,"f"),i.replaceChildren(...r)):e(this,q,"f")&&(i.replaceChildren(e(this,q,"f")),t(this,q,void 0,"f")))}};q=new WeakMap,j=new WeakSet,B=function(){return this.current?s:o`<div class="separator" aria-hidden="true"><svg class="separator-icon" viewBox="0 -960 960 960" fill="currentColor"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg></div>`},M=function(){e(this,j,"m",T).call(this)},R=function(t){y(this,"--icon-only",_(t.target)),e(this,j,"m",T).call(this)},T=function(){this.querySelectorAll("m3e-icon").forEach(e=>e.filled=void 0!==this.current&&null!==this.current)},D.styles=a`:host { display: block; } .base { display: flex; align-items: center; height: 100%; } :host(:not(:is(:state(--icon-only), :--icon-only))[current]), :host(:not(:is(:state(--icon-only), :--icon-only))[current]) .base { min-width: 0; } .button { flex: 1 1 auto; } .separator { flex: none; display: flex; justify-content: center; align-items: center; min-width: 0.5rem; --m3e-icon-size: var(--m3e-breadcrumb-separator-icon-size, 1.5rem); } .separator-icon { width: 1em; height: 1em; font-size: var(--m3e-icon-size); vertical-align: middle; }`,r([n(".button")],D.prototype,"_button",void 0),r([l({attribute:"item-label"})],D.prototype,"itemLabel",void 0),r([l({type:Boolean,reflect:!0})],D.prototype,"disabled",void 0),r([l({reflect:!0})],D.prototype,"current",void 0),D=r([d("m3e-breadcrumb-item")],D);export{z as M3eBreadcrumbElement,D as M3eBreadcrumbItemElement};
6
+ import{__classPrivateFieldGet as e,__classPrivateFieldSet as t,__decorate as r}from"tslib";import{LitElement as i,html as o,css as a,nothing as s}from"lit";import{property as l,query as n}from"lit/decorators.js";import{Role as c,customElement as d,KeyboardClick as m,LinkButton as h,Focusable as u,Disabled as b,AttachInternals as p,renderPseudoLink as f,setCustomState as y,DesignToken as v}from"@m3e/web/core";import{ifDefined as g}from"lit/directives/if-defined.js";var $,w,x,k,S;let z=class extends(c(i,"navigation")){constructor(){super(...arguments),$.add(this),w.set(this,[]),this.wrap=!1}render(){return o`<div class="base" role="list"><slot @slotchange="${e(this,$,"m",x)}"></slot><slot name="separator" @slotchange="${e(this,$,"m",k)}"></slot></div>`}};function _(e){const t=e.assignedElements({flatten:!0});if(1===t.length){const e=t[0].getBoundingClientRect();return e.width<=28&&e.height<=28}return!1}var C,E,L,A;w=new WeakMap,$=new WeakSet,x=function(){const t=this.querySelectorAll("m3e-breadcrumb-item");for(let r=0;r<t.length;r++){const i=t[r];r<t.length-1?i.removeAttribute("current"):i.hasAttribute("current")||i.setAttribute("current","page"),e(this,$,"m",S).call(this,i)}},k=function(r){t(this,w,r.target.assignedElements({flatten:!0}),"f"),this.querySelectorAll("m3e-breadcrumb-item").forEach(t=>e(this,$,"m",S).call(this,t))},S=function(t){t._setSeparator(e(this,w,"f").map(e=>{const t=e.cloneNode(!0);return t.part="separator",t}))},z.styles=a`:host { display: block; } .base { display: flex; align-items: center; } :host([wrap]) .base { flex-wrap: wrap; } slot[name="separator"] { display: none; }`,r([l({type:Boolean,reflect:!0})],z.prototype,"wrap",void 0),z=r([d("m3e-breadcrumb")],z);let W=class extends(m(h(u(b(p(c(i,"button"),!0)))))){constructor(){super(...arguments),C.add(this),E.set(this,t=>e(this,C,"m",A).call(this,t))}connectedCallback(){this.addEventListener("click",e(this,E,"f")),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",e(this,E,"f"))}firstUpdated(e){super.firstUpdated(e),[this._focusRing,this._stateLayer,this._ripple].forEach(e=>e?.attach(this))}update(e){super.update(e),(e.has("disabled")||e.has("current"))&&(this.ariaDisabled=this.disabled&&!this.current?"true":null),e.has("current")&&(this.current?this.role=null:this.hasAttribute("href")?this.role="link":this.role="button")}render(){return o`<div class="base" aria-current="${g(this.current)}">${this.current?s:o`<m3e-state-layer class="state-layer" ?disabled="${this.disabled}"></m3e-state-layer><m3e-focus-ring class="focus-ring" ?disabled="${this.disabled}"></m3e-focus-ring><m3e-ripple class="ripple" ?disabled="${this.disabled}"></m3e-ripple>${this[f]()}`}<slot class="icon" name="icon" aria-hidden="true"></slot><m3e-text-overflow class="overflow"><slot @slotchange="${e(this,C,"m",L)}"></slot></m3e-text-overflow>${this.current?s:o`<div class="touch" aria-hidden="true"></div>`}</div>`}};var j,q,B,M,R,T;E=new WeakMap,C=new WeakSet,L=function(e){y(this,"--icon-only",_(e.target))},A=function(e){this.current&&this.href&&e.preventDefault()},W.styles=a`:host { display: block; outline: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .base { display: flex; align-items: center; justify-content: center; position: relative; border-radius: var(--m3e-breadcrumb-item-shape, ${v.shape.corner.full}); height: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${v.density.calc(-3)}); column-gap: var(--m3e-breadcrumb-item-icon-label-space, 0.5rem); } .icon { font-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem); --m3e-icon-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem); } ::slotted([slot="icon"]) { font-size: inherit !important; flex: none; } ::slotted(svg[slot="icon"]) { width: 1em; height: 1em; } :host(:is(:state(--icon-only), :--icon-only)) .overflow { flex: none; } :host(:not(:is(:state(--icon-only), :--icon-only))), :host(:not(:is(:state(--icon-only), :--icon-only))) .base { min-width: 0; } :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base { color: var(--m3e-breadcrumb-item-icon-color, ${v.color.onSurfaceVariant}); } :host(:is(:state(--icon-only), :--icon-only)) .base { width: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${v.density.calc(-3)}); padding-inline: var(--m3e-breadcrumb-item-icon-padding-inline, 0px); --m3e-state-layer-hover-color: var( --m3e-breadcrumb-item-icon-hover-state-layer-color, ${v.color.onSurface} ); --m3e-state-layer-focus-color: var( --m3e-breadcrumb-item-icon-focus-state-layer-color, ${v.color.onSurface} ); --m3e-ripple-color: var(--m3e-breadcrumb-item-icon-pressed-state-layer-color, ${v.color.onSurface}); } :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base { color: var(--m3e-breadcrumb-item-label-color, ${v.color.primary}); } :host(:not(:is(:state(--icon-only), :--icon-only))) .base { font-size: var(--m3e-breadcrumb-item-label-font-size, ${v.typescale.standard.label.large.fontSize}); font-weight: var( --m3e-breadcrumb-item-label-font-weight, ${v.typescale.standard.label.large.fontWeight} ); line-height: var( --m3e-breadcrumb-item-label-line-height, ${v.typescale.standard.label.large.lineHeight} ); letter-spacing: var(--m3e-breadcrumb-item-label-tracking, ${v.typescale.standard.label.large.tracking}); } :host(:not(:is(:state(--icon-only), :--icon-only))) .base { padding-inline: var(--m3e-breadcrumb-item-label-padding-inline, 0.75rem); --m3e-state-layer-hover-color: var( --m3e-breadcrumb-item-label-hover-state-layer-color, ${v.color.primary} ); --m3e-state-layer-focus-color: var( --m3e-breadcrumb-item-label-focus-state-layer-color, ${v.color.primary} ); --m3e-ripple-color: var(--m3e-breadcrumb-item-label-pressed-state-layer-color, ${v.color.primary}); } :host([current]) .base { color: var(--m3e-breadcrumb-item-last-color, ${v.color.onSurface}); } :host(:not(:disabled):not([current])) { cursor: pointer; user-select: none; } :host(:disabled:not([current])) .base { color: color-mix( in srgb, var(--m3e-breadcrumb-item-disabled-color, ${v.color.onSurface}) var(--m3e-breadcrumb-item-disabled-opacity, 38%), transparent ); } .touch { position: absolute; height: 3rem; width: max(3rem, 100%); margin: auto; } a { all: unset; display: block; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; z-index: 1; } @media (forced-colors: active) { :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base, :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base { color: LinkText; outline: 1px solid LinkText; } :host(:disabled) .base { color: GrayText; } }`,r([n(".focus-ring")],W.prototype,"_focusRing",void 0),r([n(".state-layer")],W.prototype,"_stateLayer",void 0),r([n(".ripple")],W.prototype,"_ripple",void 0),r([l({reflect:!0})],W.prototype,"current",void 0),W=r([d("m3e-breadcrumb-item-button")],W);let D=class extends(h(p(c(i,"listitem")),!0)){constructor(){super(...arguments),j.add(this),q.set(this,void 0),this.itemLabel="",this.disabled=!1}focus(e){this._button?.focus(e)}blur(){this._button?.blur()}click(){this._button?.click()}updated(t){super.updated(t),t.has("current")&&e(this,j,"m",T).call(this)}render(){return o`<div class="base"><m3e-breadcrumb-item-button class="button" aria-label="${g(this.itemLabel||void 0)}" ?disabled="${this.disabled}" current="${g(this.current)}" href="${g(this.href||void 0)}" target="${g(this.target||void 0)}" download="${g(this.download||void 0)}" rel="${g(this.rel||void 0)}"><slot name="icon" slot="icon" @slotchange="${e(this,j,"m",M)}"></slot><slot @slotchange="${e(this,j,"m",R)}"></slot></m3e-breadcrumb-item-button>${e(this,j,"m",B).call(this)}</div>`}_setSeparator(r){const i=this.shadowRoot?.querySelector(".separator");i&&(r.length>0?(!e(this,q,"f")&&i.firstElementChild&&t(this,q,i.firstElementChild,"f"),i.replaceChildren(...r)):e(this,q,"f")&&(i.replaceChildren(e(this,q,"f")),t(this,q,void 0,"f")))}};q=new WeakMap,j=new WeakSet,B=function(){return this.current?s:o`<div class="separator" aria-hidden="true"><svg class="separator-icon" viewBox="0 -960 960 960" fill="currentColor"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg></div>`},M=function(){e(this,j,"m",T).call(this)},R=function(t){y(this,"--icon-only",_(t.target)),e(this,j,"m",T).call(this)},T=function(){this.querySelectorAll("m3e-icon").forEach(e=>e.filled=void 0!==this.current&&null!==this.current)},D.styles=a`:host { display: block; } .base { display: flex; align-items: center; height: 100%; } :host(:not(:is(:state(--icon-only), :--icon-only))[current]), :host(:not(:is(:state(--icon-only), :--icon-only))[current]) .base { min-width: 0; } .button { flex: 1 1 auto; } .separator { flex: none; display: flex; justify-content: center; align-items: center; min-width: 0.5rem; --m3e-icon-size: var(--m3e-breadcrumb-separator-icon-size, 1.5rem); } .separator-icon { width: 1em; height: 1em; font-size: var(--m3e-icon-size); vertical-align: middle; }`,r([n(".button")],D.prototype,"_button",void 0),r([l({attribute:"item-label"})],D.prototype,"itemLabel",void 0),r([l({type:Boolean,reflect:!0})],D.prototype,"disabled",void 0),r([l({reflect:!0})],D.prototype,"current",void 0),D=r([d("m3e-breadcrumb-item")],D);export{z as M3eBreadcrumbElement,D as M3eBreadcrumbItemElement};
7
7
  //# sourceMappingURL=breadcrumb.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.min.js","sources":["../../src/breadcrumb/BreadcrumbElement.ts","../../src/breadcrumb/isIconOnly.ts","../../src/breadcrumb/BreadcrumbItemButtonElement.ts","../../src/breadcrumb/BreadcrumbItemElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement } from \"lit\";\r\nimport { property } from \"lit/decorators.js\";\r\n\r\nimport { customElement, Role } from \"@m3e/web/core\";\r\n\r\nimport type { M3eBreadcrumbItemElement } from \"./BreadcrumbItemElement\";\r\n\r\n/**\r\n * Displays a hierarchical navigation path and identifies the user's\r\n * current location within an application.\r\n *\r\n * @description\r\n * The `m3e-breadcrumb` component arranges `m3e-breadcrumb-item` children into\r\n * a trail of navigation steps. It tracks the last item as the current page and\r\n * supports a custom separator slot for alternate divider content.\r\n *\r\n * @example\r\n * The following example illustrates a simple breadcrumb with three items.\r\n * ```html\r\n * <m3e-breadcrumb>\r\n * <m3e-breadcrumb-item href=\"/dashboard\">Dashboard</m3e-breadcrumb-item>\r\n * <m3e-breadcrumb-item href=\"/dashboard/reports\">Reports</m3e-breadcrumb-item>\r\n * <m3e-breadcrumb-item href=\"/dashboard/reports/annual\">Annual</m3e-breadcrumb-item>\r\n * </m3e-breadcrumb>\r\n * ```\r\n *\r\n * @tag m3e-breadcrumb\r\n *\r\n * @slot - Renders breadcrumb items.\r\n * @slot separator - Renders a custom separator between breadcrumb items.\r\n *\r\n * @attr wrap - Whether breadcrumb items should wrap onto a new line.\r\n */\r\n@customElement(\"m3e-breadcrumb\")\r\nexport class M3eBreadcrumbElement extends Role(LitElement, \"navigation\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n }\r\n .base {\r\n display: flex;\r\n align-items: center;\r\n }\r\n :host([wrap]) .base {\r\n flex-wrap: wrap;\r\n }\r\n slot[name=\"separator\"] {\r\n display: none;\r\n }\r\n `;\r\n\r\n /** @private */ #customSeparator: Element[] = [];\r\n\r\n /**\r\n * Whether items wrap to a new line.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) wrap = false;\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\" role=\"list\">\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n <slot name=\"separator\" @slotchange=\"${this.#handleSeparatorSlotChange}\"></slot>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(): void {\r\n const items = this.querySelectorAll(\"m3e-breadcrumb-item\");\r\n for (let i = 0; i < items.length; i++) {\r\n const item = items[i];\r\n if (i < items.length - 1) {\r\n item.removeAttribute(\"current\");\r\n } else if (!item.hasAttribute(\"current\")) {\r\n item.setAttribute(\"current\", \"page\");\r\n }\r\n this.#setSeparator(item);\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleSeparatorSlotChange(e: Event): void {\r\n this.#customSeparator = (e.target as HTMLSlotElement).assignedElements({ flatten: true });\r\n this.querySelectorAll(\"m3e-breadcrumb-item\").forEach((x) => this.#setSeparator(x));\r\n }\r\n\r\n /** @private */\r\n #setSeparator(item: M3eBreadcrumbItemElement): void {\r\n item._setSeparator(\r\n this.#customSeparator.map((x) => {\r\n const clone = <Element>x.cloneNode(true);\r\n clone.part = \"separator\";\r\n return clone;\r\n }),\r\n );\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-breadcrumb\": M3eBreadcrumbElement;\r\n }\r\n}\r\n","/** @internal */\r\nexport function isIconOnly(slot: HTMLSlotElement): boolean {\r\n const elements = slot.assignedElements({ flatten: true });\r\n if (elements.length === 1) {\r\n const rect = elements[0].getBoundingClientRect();\r\n return rect.width <= 28 && rect.height <= 28;\r\n }\r\n return false;\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\nimport { ifDefined } from \"lit/directives/if-defined.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n Focusable,\r\n KeyboardClick,\r\n LinkButton,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n renderPseudoLink,\r\n Role,\r\n setCustomState,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { BreadcrumbItemCurrent } from \"./BreadcrumbItemCurrent\";\r\nimport { isIconOnly } from \"./isIconOnly\";\r\n\r\n/**\r\n * @internal\r\n * An internal interactive element used to present the content of a breadcrumb item.\r\n */\r\n@customElement(\"m3e-breadcrumb-item-button\")\r\nexport class M3eBreadcrumbItemButtonElement extends KeyboardClick(\r\n LinkButton(Focusable(Disabled(AttachInternals(Role(LitElement, \"button\"), true)))),\r\n) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n outline: none;\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n .base {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n border-radius: var(--m3e-breadcrumb-item-shape, ${DesignToken.shape.corner.full});\r\n height: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${DesignToken.density.calc(-1)});\r\n column-gap: var(--m3e-breadcrumb-item-icon-label-space, 0.5rem);\r\n }\r\n .icon {\r\n font-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem);\r\n --m3e-icon-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem);\r\n }\r\n ::slotted([slot=\"icon\"]) {\r\n font-size: inherit !important;\r\n flex: none;\r\n }\r\n ::slotted(svg[slot=\"icon\"]) {\r\n width: 1em;\r\n height: 1em;\r\n }\r\n :host(:is(:state(--icon-only), :--icon-only)) .overflow {\r\n flex: none;\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))),\r\n :host(:not(:is(:state(--icon-only), :--icon-only))) .base {\r\n min-width: 0;\r\n }\r\n :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base {\r\n color: var(--m3e-breadcrumb-item-icon-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host(:is(:state(--icon-only), :--icon-only)) .base {\r\n width: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${DesignToken.density.calc(-1)});\r\n padding-inline: var(--m3e-breadcrumb-item-icon-padding-inline, 0px);\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-breadcrumb-item-icon-hover-state-layer-color,\r\n ${DesignToken.color.onSurface}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-breadcrumb-item-icon-focus-state-layer-color,\r\n ${DesignToken.color.onSurface}\r\n );\r\n --m3e-ripple-color: var(--m3e-breadcrumb-item-icon-pressed-state-layer-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base {\r\n color: var(--m3e-breadcrumb-item-label-color, ${DesignToken.color.primary});\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))) .base {\r\n font-size: var(--m3e-breadcrumb-item-label-font-size, ${DesignToken.typescale.standard.label.large.fontSize});\r\n font-weight: var(\r\n --m3e-breadcrumb-item-label-font-weight,\r\n ${DesignToken.typescale.standard.label.large.fontWeight}\r\n );\r\n line-height: var(\r\n --m3e-breadcrumb-item-label-line-height,\r\n ${DesignToken.typescale.standard.label.large.lineHeight}\r\n );\r\n letter-spacing: var(--m3e-breadcrumb-item-label-tracking, ${DesignToken.typescale.standard.label.large.tracking});\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))) .base {\r\n padding-inline: var(--m3e-breadcrumb-item-label-padding-inline, 0.75rem);\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-breadcrumb-item-label-hover-state-layer-color,\r\n ${DesignToken.color.primary}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-breadcrumb-item-label-focus-state-layer-color,\r\n ${DesignToken.color.primary}\r\n );\r\n --m3e-ripple-color: var(--m3e-breadcrumb-item-label-pressed-state-layer-color, ${DesignToken.color.primary});\r\n }\r\n :host([current]) .base {\r\n color: var(--m3e-breadcrumb-item-last-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:not(:disabled):not([current])) {\r\n cursor: pointer;\r\n user-select: none;\r\n }\r\n :host(:disabled:not([current])) .base {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-breadcrumb-item-disabled-color, ${DesignToken.color.onSurface})\r\n var(--m3e-breadcrumb-item-disabled-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n .touch {\r\n position: absolute;\r\n height: 3rem;\r\n width: max(3rem, 100%);\r\n margin: auto;\r\n }\r\n a {\r\n all: unset;\r\n display: block;\r\n position: absolute;\r\n top: 0px;\r\n left: 0px;\r\n right: 0px;\r\n bottom: 0px;\r\n z-index: 1;\r\n }\r\n @media (forced-colors: active) {\r\n :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base,\r\n :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base {\r\n color: LinkText;\r\n outline: 1px solid LinkText;\r\n }\r\n :host(:disabled) .base {\r\n color: GrayText;\r\n }\r\n }\r\n `;\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\r\n /** @private */ #clickHandler = (e: Event) => this.#handleClick(e);\r\n\r\n /**\r\n * Indicates the current item in the breadcrumb path.\r\n * @default undefined\r\n */\r\n @property({ reflect: true }) current?: BreadcrumbItemCurrent;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n this.addEventListener(\"click\", this.#clickHandler);\r\n super.connectedCallback();\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(\"disabled\") || changedProperties.has(\"current\")) {\r\n this.ariaDisabled = this.disabled && !this.current ? \"true\" : null;\r\n }\r\n\r\n if (changedProperties.has(\"current\")) {\r\n if (this.current) {\r\n this.role = null;\r\n } else if (this.hasAttribute(\"href\")) {\r\n this.role = \"link\";\r\n } else {\r\n this.role = \"button\";\r\n }\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\" aria-current=\"${ifDefined(this.current)}\">\r\n ${this.current\r\n ? nothing\r\n : html`<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 ${this[renderPseudoLink]()}`}\r\n <slot class=\"icon\" name=\"icon\" aria-hidden=\"true\"></slot>\r\n <m3e-text-overflow class=\"overflow\">\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </m3e-text-overflow>\r\n ${this.current ? nothing : html`<div class=\"touch\" aria-hidden=\"true\"></div>`}\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(e: Event): void {\r\n setCustomState(this, \"--icon-only\", isIconOnly(e.target as HTMLSlotElement));\r\n }\r\n\r\n /** @private */\r\n #handleClick(e: Event): void {\r\n // If current and link, disable default link click handler behavior.\r\n if (this.current && this.href) {\r\n e.preventDefault();\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-breadcrumb-item-button\": M3eBreadcrumbItemButtonElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\nimport { ifDefined } from \"lit/directives/if-defined.js\";\r\n\r\nimport { AttachInternals, customElement, LinkButton, Role, setCustomState } from \"@m3e/web/core\";\r\n\r\nimport { M3eBreadcrumbItemButtonElement } from \"./BreadcrumbItemButtonElement\";\r\nimport { BreadcrumbItemCurrent } from \"./BreadcrumbItemCurrent\";\r\nimport { isIconOnly } from \"./isIconOnly\";\r\n\r\nimport \"./BreadcrumbItemButtonElement\";\r\n\r\n/**\r\n * An item in a breadcrumb.\r\n *\r\n * @description\r\n * The `m3e-breadcrumb-item` element represents a single item in a breadcrumb\r\n * navigation trail. It renders an internal button and supports navigation\r\n * attributes for link behavior.\r\n *\r\n * @tag m3e-breadcrumb-item\r\n *\r\n * @slot - Renders the content of the breadcrumb item.\r\n * @slot icon - Renders an icon before the item's label.\r\n *\r\n * @attr item-label - The accessible label used by the internal breadcrumb button.\r\n * @attr disabled - Whether the breadcrumb item is disabled.\r\n * @attr current - Marks the breadcrumb item as the current location in the trail.\r\n * @attr href - The URL to which the internal breadcrumb link button points.\r\n * @attr target - The target of the internal breadcrumb link button.\r\n * @attr download - A value indicating whether the internal link target will be downloaded, optionally specifying a file name.\r\n * @attr rel - The relationship between the internal link target and the document.\r\n *\r\n * @fires click - Dispatched when the element is clicked.\r\n *\r\n * @cssprop --m3e-breadcrumb-item-shape - Shape of the internal breadcrumb item button.\r\n * @cssprop --m3e-breadcrumb-item-container-height - Height of the internal breadcrumb item button container.\r\n * @cssprop --m3e-breadcrumb-item-icon-color - Color of breadcrumb item icon-only content.\r\n * @cssprop --m3e-breadcrumb-item-icon-padding-inline - Horizontal padding for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-icon-hover-state-layer-color - Hover state layer color for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-icon-focus-state-layer-color - Focus state layer color for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-icon-pressed-state-layer-color - Pressed state layer color for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-color - Color of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-font-size - Font size of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-font-weight - Font weight of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-line-height - Line height of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-tracking - Letter spacing of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-padding-inline - Horizontal padding for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-hover-state-layer-color - Hover state layer color for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-focus-state-layer-color - Focus state layer color for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-pressed-state-layer-color - Pressed state layer color for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-last-color - Color used for the current breadcrumb item.\r\n * @cssprop --m3e-breadcrumb-item-icon-label-space - Space between icon and label.\r\n * @cssprop --m3e-breadcrumb-item-icon-size - Size of the icon.\r\n * @cssprop --m3e-breadcrumb-item-disabled-color - Disabled color used by the breadcrumb item button.\r\n * @cssprop --m3e-breadcrumb-item-disabled-opacity - Disabled opacity used by the breadcrumb item button.\r\n */\r\n@customElement(\"m3e-breadcrumb-item\")\r\nexport class M3eBreadcrumbItemElement extends LinkButton(AttachInternals(Role(LitElement, \"listitem\")), true) {\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 .base {\r\n display: flex;\r\n align-items: center;\r\n height: 100%;\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))[current]),\r\n :host(:not(:is(:state(--icon-only), :--icon-only))[current]) .base {\r\n min-width: 0;\r\n }\r\n .button {\r\n flex: 1 1 auto;\r\n }\r\n .separator {\r\n flex: none;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n min-width: 0.5rem;\r\n --m3e-icon-size: var(--m3e-breadcrumb-separator-icon-size, 1.5rem);\r\n }\r\n .separator-icon {\r\n width: 1em;\r\n height: 1em;\r\n font-size: var(--m3e-icon-size);\r\n vertical-align: middle;\r\n }\r\n `;\r\n\r\n /** @private */ @query(\".button\") private readonly _button!: M3eBreadcrumbItemButtonElement;\r\n /** @private */ #defaultSeparator?: Element;\r\n\r\n /**\r\n * The accessible label given to the item's internal button.\r\n * @default \"\"\r\n */\r\n @property({ attribute: \"item-label\" }) itemLabel = \"\";\r\n\r\n /**\r\n * Whether the element is disabled.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) disabled = false;\r\n\r\n /**\r\n * Indicates the current item in the breadcrumb path.\r\n * @default undefined\r\n */\r\n @property({ reflect: true }) current?: BreadcrumbItemCurrent;\r\n\r\n /** @inheritdoc */\r\n override focus(options?: FocusOptions): void {\r\n this._button?.focus(options);\r\n }\r\n\r\n /** @inheritdoc */\r\n override blur(): void {\r\n this._button?.blur();\r\n }\r\n\r\n /** @inheritdoc */\r\n override click(): void {\r\n this._button?.click();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n if (_changedProperties.has(\"current\")) {\r\n this.#updateIconFilled();\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-breadcrumb-item-button\r\n class=\"button\"\r\n aria-label=\"${ifDefined(this.itemLabel || undefined)}\"\r\n ?disabled=\"${this.disabled}\"\r\n current=\"${ifDefined(this.current)}\"\r\n href=\"${ifDefined(this.href || undefined)}\"\r\n target=\"${ifDefined(this.target || undefined)}\"\r\n download=\"${ifDefined(this.download || undefined)}\"\r\n rel=\"${ifDefined(this.rel || undefined)}\"\r\n >\r\n <slot name=\"icon\" slot=\"icon\" @slotchange=\"${this.#handleIconSlotChange}\"></slot>\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </m3e-breadcrumb-item-button>\r\n ${this.#renderSeparator()}\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #renderSeparator(): unknown {\r\n return this.current\r\n ? nothing\r\n : html`<div class=\"separator\" aria-hidden=\"true\">\r\n <svg class=\"separator-icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z\" />\r\n </svg>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleIconSlotChange(): void {\r\n this.#updateIconFilled();\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(e: Event): void {\r\n setCustomState(this, \"--icon-only\", isIconOnly(e.target as HTMLSlotElement));\r\n this.#updateIconFilled();\r\n }\r\n\r\n /** @private */\r\n #updateIconFilled(): void {\r\n this.querySelectorAll(\"m3e-icon\").forEach((x) => (x.filled = this.current !== undefined && this.current !== null));\r\n }\r\n\r\n /** @internal */\r\n _setSeparator(nodes: Array<Node>) {\r\n const separator = this.shadowRoot?.querySelector(\".separator\");\r\n if (!separator) return;\r\n\r\n if (nodes.length > 0) {\r\n if (!this.#defaultSeparator && separator.firstElementChild) {\r\n this.#defaultSeparator = separator.firstElementChild;\r\n }\r\n separator.replaceChildren(...nodes);\r\n } else if (this.#defaultSeparator) {\r\n separator.replaceChildren(this.#defaultSeparator);\r\n this.#defaultSeparator = undefined;\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-breadcrumb-item\": M3eBreadcrumbItemElement;\r\n }\r\n}\r\n"],"names":["M3eBreadcrumbElement","Role","LitElement","constructor","_M3eBreadcrumbElement_customSeparator","set","this","wrap","render","html","__classPrivateFieldGet","_M3eBreadcrumbElement_instances","_M3eBreadcrumbElement_handleSlotChange","_M3eBreadcrumbElement_handleSeparatorSlotChange","isIconOnly","slot","elements","assignedElements","flatten","length","rect","getBoundingClientRect","width","height","items","querySelectorAll","i","item","removeAttribute","hasAttribute","setAttribute","_M3eBreadcrumbElement_setSeparator","call","e","__classPrivateFieldSet","target","forEach","x","_setSeparator","map","clone","cloneNode","part","styles","css","__decorate","property","type","Boolean","reflect","prototype","customElement","M3eBreadcrumbItemButtonElement","KeyboardClick","LinkButton","Focusable","Disabled","AttachInternals","_M3eBreadcrumbItemButtonElement_clickHandler","connectedCallback","addEventListener","super","disconnectedCallback","removeEventListener","firstUpdated","_changedProperties","_focusRing","_stateLayer","_ripple","attach","update","changedProperties","has","ariaDisabled","disabled","current","role","ifDefined","nothing","renderPseudoLink","_M3eBreadcrumbItemButtonElement_instances","_M3eBreadcrumbItemButtonElement_handleSlotChange","setCustomState","href","preventDefault","DesignToken","shape","corner","full","density","calc","color","onSurfaceVariant","onSurface","primary","typescale","standard","label","large","fontSize","fontWeight","lineHeight","tracking","query","M3eBreadcrumbItemElement","_M3eBreadcrumbItemElement_defaultSeparator","itemLabel","focus","options","_button","blur","click","updated","_M3eBreadcrumbItemElement_instances","_M3eBreadcrumbItemElement_updateIconFilled","undefined","download","rel","_M3eBreadcrumbItemElement_handleIconSlotChange","_M3eBreadcrumbItemElement_handleSlotChange","_M3eBreadcrumbItemElement_renderSeparator","nodes","separator","shadowRoot","querySelector","firstElementChild","replaceChildren","filled","attribute"],"mappings":";;;;;meAkCO,IAAMA,EAAN,cAAmCC,EAAKC,EAAY,eAApDC,WAAAA,mCAkBWC,EAAAC,IAAAC,KAA8B,IAMFA,KAAAC,MAAO,CAwCrD,CArCqBC,MAAAA,GACjB,OAAOC,CAAI,oDACYC,EAAAJ,KAAIK,EAAA,IAAAC,kDACaF,EAAAJ,KAAIK,EAAA,IAAAE,mBAE9C,GCjEI,SAAUC,EAAWC,GACzB,MAAMC,EAAWD,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crumb/isIconOnly.ts","../../src/breadcrumb/BreadcrumbItemButtonElement.ts","../../src/breadcrumb/BreadcrumbItemElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement } from \"lit\";\r\nimport { property } from \"lit/decorators.js\";\r\n\r\nimport { customElement, Role } from \"@m3e/web/core\";\r\n\r\nimport type { M3eBreadcrumbItemElement } from \"./BreadcrumbItemElement\";\r\n\r\n/**\r\n * Displays a hierarchical navigation path and identifies the user's\r\n * current location within an application.\r\n *\r\n * @description\r\n * The `m3e-breadcrumb` component arranges `m3e-breadcrumb-item` children into\r\n * a trail of navigation steps. It tracks the last item as the current page and\r\n * supports a custom separator slot for alternate divider content.\r\n *\r\n * @example\r\n * The following example illustrates a simple breadcrumb with three items.\r\n * ```html\r\n * <m3e-breadcrumb>\r\n * <m3e-breadcrumb-item href=\"/dashboard\">Dashboard</m3e-breadcrumb-item>\r\n * <m3e-breadcrumb-item href=\"/dashboard/reports\">Reports</m3e-breadcrumb-item>\r\n * <m3e-breadcrumb-item href=\"/dashboard/reports/annual\">Annual</m3e-breadcrumb-item>\r\n * </m3e-breadcrumb>\r\n * ```\r\n *\r\n * @tag m3e-breadcrumb\r\n *\r\n * @slot - Renders breadcrumb items.\r\n * @slot separator - Renders a custom separator between breadcrumb items.\r\n *\r\n * @attr wrap - Whether breadcrumb items should wrap onto a new line.\r\n */\r\n@customElement(\"m3e-breadcrumb\")\r\nexport class M3eBreadcrumbElement extends Role(LitElement, \"navigation\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n }\r\n .base {\r\n display: flex;\r\n align-items: center;\r\n }\r\n :host([wrap]) .base {\r\n flex-wrap: wrap;\r\n }\r\n slot[name=\"separator\"] {\r\n display: none;\r\n }\r\n `;\r\n\r\n /** @private */ #customSeparator: Element[] = [];\r\n\r\n /**\r\n * Whether items wrap to a new line.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) wrap = false;\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\" role=\"list\">\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n <slot name=\"separator\" @slotchange=\"${this.#handleSeparatorSlotChange}\"></slot>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(): void {\r\n const items = this.querySelectorAll(\"m3e-breadcrumb-item\");\r\n for (let i = 0; i < items.length; i++) {\r\n const item = items[i];\r\n if (i < items.length - 1) {\r\n item.removeAttribute(\"current\");\r\n } else if (!item.hasAttribute(\"current\")) {\r\n item.setAttribute(\"current\", \"page\");\r\n }\r\n this.#setSeparator(item);\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleSeparatorSlotChange(e: Event): void {\r\n this.#customSeparator = (e.target as HTMLSlotElement).assignedElements({ flatten: true });\r\n this.querySelectorAll(\"m3e-breadcrumb-item\").forEach((x) => this.#setSeparator(x));\r\n }\r\n\r\n /** @private */\r\n #setSeparator(item: M3eBreadcrumbItemElement): void {\r\n item._setSeparator(\r\n this.#customSeparator.map((x) => {\r\n const clone = <Element>x.cloneNode(true);\r\n clone.part = \"separator\";\r\n return clone;\r\n }),\r\n );\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-breadcrumb\": M3eBreadcrumbElement;\r\n }\r\n}\r\n","/** @internal */\r\nexport function isIconOnly(slot: HTMLSlotElement): boolean {\r\n const elements = slot.assignedElements({ flatten: true });\r\n if (elements.length === 1) {\r\n const rect = elements[0].getBoundingClientRect();\r\n return rect.width <= 28 && rect.height <= 28;\r\n }\r\n return false;\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\nimport { ifDefined } from \"lit/directives/if-defined.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n Focusable,\r\n KeyboardClick,\r\n LinkButton,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n renderPseudoLink,\r\n Role,\r\n setCustomState,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { BreadcrumbItemCurrent } from \"./BreadcrumbItemCurrent\";\r\nimport { isIconOnly } from \"./isIconOnly\";\r\n\r\n/**\r\n * @internal\r\n * An internal interactive element used to present the content of a breadcrumb item.\r\n */\r\n@customElement(\"m3e-breadcrumb-item-button\")\r\nexport class M3eBreadcrumbItemButtonElement extends KeyboardClick(\r\n LinkButton(Focusable(Disabled(AttachInternals(Role(LitElement, \"button\"), true)))),\r\n) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n outline: none;\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n .base {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n border-radius: var(--m3e-breadcrumb-item-shape, ${DesignToken.shape.corner.full});\r\n height: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${DesignToken.density.calc(-3)});\r\n column-gap: var(--m3e-breadcrumb-item-icon-label-space, 0.5rem);\r\n }\r\n .icon {\r\n font-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem);\r\n --m3e-icon-size: var(--m3e-breadcrumb-item--icon-size, 1.25rem);\r\n }\r\n ::slotted([slot=\"icon\"]) {\r\n font-size: inherit !important;\r\n flex: none;\r\n }\r\n ::slotted(svg[slot=\"icon\"]) {\r\n width: 1em;\r\n height: 1em;\r\n }\r\n :host(:is(:state(--icon-only), :--icon-only)) .overflow {\r\n flex: none;\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))),\r\n :host(:not(:is(:state(--icon-only), :--icon-only))) .base {\r\n min-width: 0;\r\n }\r\n :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base {\r\n color: var(--m3e-breadcrumb-item-icon-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host(:is(:state(--icon-only), :--icon-only)) .base {\r\n width: calc(var(--m3e-breadcrumb-item-container-height, 2.5rem) + ${DesignToken.density.calc(-3)});\r\n padding-inline: var(--m3e-breadcrumb-item-icon-padding-inline, 0px);\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-breadcrumb-item-icon-hover-state-layer-color,\r\n ${DesignToken.color.onSurface}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-breadcrumb-item-icon-focus-state-layer-color,\r\n ${DesignToken.color.onSurface}\r\n );\r\n --m3e-ripple-color: var(--m3e-breadcrumb-item-icon-pressed-state-layer-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base {\r\n color: var(--m3e-breadcrumb-item-label-color, ${DesignToken.color.primary});\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))) .base {\r\n font-size: var(--m3e-breadcrumb-item-label-font-size, ${DesignToken.typescale.standard.label.large.fontSize});\r\n font-weight: var(\r\n --m3e-breadcrumb-item-label-font-weight,\r\n ${DesignToken.typescale.standard.label.large.fontWeight}\r\n );\r\n line-height: var(\r\n --m3e-breadcrumb-item-label-line-height,\r\n ${DesignToken.typescale.standard.label.large.lineHeight}\r\n );\r\n letter-spacing: var(--m3e-breadcrumb-item-label-tracking, ${DesignToken.typescale.standard.label.large.tracking});\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))) .base {\r\n padding-inline: var(--m3e-breadcrumb-item-label-padding-inline, 0.75rem);\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-breadcrumb-item-label-hover-state-layer-color,\r\n ${DesignToken.color.primary}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-breadcrumb-item-label-focus-state-layer-color,\r\n ${DesignToken.color.primary}\r\n );\r\n --m3e-ripple-color: var(--m3e-breadcrumb-item-label-pressed-state-layer-color, ${DesignToken.color.primary});\r\n }\r\n :host([current]) .base {\r\n color: var(--m3e-breadcrumb-item-last-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:not(:disabled):not([current])) {\r\n cursor: pointer;\r\n user-select: none;\r\n }\r\n :host(:disabled:not([current])) .base {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-breadcrumb-item-disabled-color, ${DesignToken.color.onSurface})\r\n var(--m3e-breadcrumb-item-disabled-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n .touch {\r\n position: absolute;\r\n height: 3rem;\r\n width: max(3rem, 100%);\r\n margin: auto;\r\n }\r\n a {\r\n all: unset;\r\n display: block;\r\n position: absolute;\r\n top: 0px;\r\n left: 0px;\r\n right: 0px;\r\n bottom: 0px;\r\n z-index: 1;\r\n }\r\n @media (forced-colors: active) {\r\n :host(:is(:state(--icon-only), :--icon-only):not([current]):not(:disabled)) .base,\r\n :host(:not(:is(:state(--icon-only), :--icon-only)):not([current]):not(:disabled)) .base {\r\n color: LinkText;\r\n outline: 1px solid LinkText;\r\n }\r\n :host(:disabled) .base {\r\n color: GrayText;\r\n }\r\n }\r\n `;\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\r\n /** @private */ #clickHandler = (e: Event) => this.#handleClick(e);\r\n\r\n /**\r\n * Indicates the current item in the breadcrumb path.\r\n * @default undefined\r\n */\r\n @property({ reflect: true }) current?: BreadcrumbItemCurrent;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n this.addEventListener(\"click\", this.#clickHandler);\r\n super.connectedCallback();\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(\"disabled\") || changedProperties.has(\"current\")) {\r\n this.ariaDisabled = this.disabled && !this.current ? \"true\" : null;\r\n }\r\n\r\n if (changedProperties.has(\"current\")) {\r\n if (this.current) {\r\n this.role = null;\r\n } else if (this.hasAttribute(\"href\")) {\r\n this.role = \"link\";\r\n } else {\r\n this.role = \"button\";\r\n }\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\" aria-current=\"${ifDefined(this.current)}\">\r\n ${this.current\r\n ? nothing\r\n : html`<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 ${this[renderPseudoLink]()}`}\r\n <slot class=\"icon\" name=\"icon\" aria-hidden=\"true\"></slot>\r\n <m3e-text-overflow class=\"overflow\">\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </m3e-text-overflow>\r\n ${this.current ? nothing : html`<div class=\"touch\" aria-hidden=\"true\"></div>`}\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(e: Event): void {\r\n setCustomState(this, \"--icon-only\", isIconOnly(e.target as HTMLSlotElement));\r\n }\r\n\r\n /** @private */\r\n #handleClick(e: Event): void {\r\n // If current and link, disable default link click handler behavior.\r\n if (this.current && this.href) {\r\n e.preventDefault();\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-breadcrumb-item-button\": M3eBreadcrumbItemButtonElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, nothing, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\nimport { ifDefined } from \"lit/directives/if-defined.js\";\r\n\r\nimport { AttachInternals, customElement, LinkButton, Role, setCustomState } from \"@m3e/web/core\";\r\n\r\nimport { M3eBreadcrumbItemButtonElement } from \"./BreadcrumbItemButtonElement\";\r\nimport { BreadcrumbItemCurrent } from \"./BreadcrumbItemCurrent\";\r\nimport { isIconOnly } from \"./isIconOnly\";\r\n\r\nimport \"./BreadcrumbItemButtonElement\";\r\n\r\n/**\r\n * An item in a breadcrumb.\r\n *\r\n * @description\r\n * The `m3e-breadcrumb-item` element represents a single item in a breadcrumb\r\n * navigation trail. It renders an internal button and supports navigation\r\n * attributes for link behavior.\r\n *\r\n * @tag m3e-breadcrumb-item\r\n *\r\n * @slot - Renders the content of the breadcrumb item.\r\n * @slot icon - Renders an icon before the item's label.\r\n *\r\n * @attr item-label - The accessible label used by the internal breadcrumb button.\r\n * @attr disabled - Whether the breadcrumb item is disabled.\r\n * @attr current - Marks the breadcrumb item as the current location in the trail.\r\n * @attr href - The URL to which the internal breadcrumb link button points.\r\n * @attr target - The target of the internal breadcrumb link button.\r\n * @attr download - A value indicating whether the internal link target will be downloaded, optionally specifying a file name.\r\n * @attr rel - The relationship between the internal link target and the document.\r\n *\r\n * @fires click - Dispatched when the element is clicked.\r\n *\r\n * @cssprop --m3e-breadcrumb-item-shape - Shape of the internal breadcrumb item button.\r\n * @cssprop --m3e-breadcrumb-item-container-height - Height of the internal breadcrumb item button container.\r\n * @cssprop --m3e-breadcrumb-item-icon-color - Color of breadcrumb item icon-only content.\r\n * @cssprop --m3e-breadcrumb-item-icon-padding-inline - Horizontal padding for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-icon-hover-state-layer-color - Hover state layer color for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-icon-focus-state-layer-color - Focus state layer color for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-icon-pressed-state-layer-color - Pressed state layer color for icon-only breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-color - Color of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-font-size - Font size of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-font-weight - Font weight of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-line-height - Line height of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-tracking - Letter spacing of breadcrumb item label content.\r\n * @cssprop --m3e-breadcrumb-item-label-padding-inline - Horizontal padding for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-hover-state-layer-color - Hover state layer color for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-focus-state-layer-color - Focus state layer color for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-label-pressed-state-layer-color - Pressed state layer color for label breadcrumb items.\r\n * @cssprop --m3e-breadcrumb-item-last-color - Color used for the current breadcrumb item.\r\n * @cssprop --m3e-breadcrumb-item-icon-label-space - Space between icon and label.\r\n * @cssprop --m3e-breadcrumb-item-icon-size - Size of the icon.\r\n * @cssprop --m3e-breadcrumb-item-disabled-color - Disabled color used by the breadcrumb item button.\r\n * @cssprop --m3e-breadcrumb-item-disabled-opacity - Disabled opacity used by the breadcrumb item button.\r\n */\r\n@customElement(\"m3e-breadcrumb-item\")\r\nexport class M3eBreadcrumbItemElement extends LinkButton(AttachInternals(Role(LitElement, \"listitem\")), true) {\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 .base {\r\n display: flex;\r\n align-items: center;\r\n height: 100%;\r\n }\r\n :host(:not(:is(:state(--icon-only), :--icon-only))[current]),\r\n :host(:not(:is(:state(--icon-only), :--icon-only))[current]) .base {\r\n min-width: 0;\r\n }\r\n .button {\r\n flex: 1 1 auto;\r\n }\r\n .separator {\r\n flex: none;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n min-width: 0.5rem;\r\n --m3e-icon-size: var(--m3e-breadcrumb-separator-icon-size, 1.5rem);\r\n }\r\n .separator-icon {\r\n width: 1em;\r\n height: 1em;\r\n font-size: var(--m3e-icon-size);\r\n vertical-align: middle;\r\n }\r\n `;\r\n\r\n /** @private */ @query(\".button\") private readonly _button!: M3eBreadcrumbItemButtonElement;\r\n /** @private */ #defaultSeparator?: Element;\r\n\r\n /**\r\n * The accessible label given to the item's internal button.\r\n * @default \"\"\r\n */\r\n @property({ attribute: \"item-label\" }) itemLabel = \"\";\r\n\r\n /**\r\n * Whether the element is disabled.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) disabled = false;\r\n\r\n /**\r\n * Indicates the current item in the breadcrumb path.\r\n * @default undefined\r\n */\r\n @property({ reflect: true }) current?: BreadcrumbItemCurrent;\r\n\r\n /** @inheritdoc */\r\n override focus(options?: FocusOptions): void {\r\n this._button?.focus(options);\r\n }\r\n\r\n /** @inheritdoc */\r\n override blur(): void {\r\n this._button?.blur();\r\n }\r\n\r\n /** @inheritdoc */\r\n override click(): void {\r\n this._button?.click();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n if (_changedProperties.has(\"current\")) {\r\n this.#updateIconFilled();\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-breadcrumb-item-button\r\n class=\"button\"\r\n aria-label=\"${ifDefined(this.itemLabel || undefined)}\"\r\n ?disabled=\"${this.disabled}\"\r\n current=\"${ifDefined(this.current)}\"\r\n href=\"${ifDefined(this.href || undefined)}\"\r\n target=\"${ifDefined(this.target || undefined)}\"\r\n download=\"${ifDefined(this.download || undefined)}\"\r\n rel=\"${ifDefined(this.rel || undefined)}\"\r\n >\r\n <slot name=\"icon\" slot=\"icon\" @slotchange=\"${this.#handleIconSlotChange}\"></slot>\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </m3e-breadcrumb-item-button>\r\n ${this.#renderSeparator()}\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #renderSeparator(): unknown {\r\n return this.current\r\n ? nothing\r\n : html`<div class=\"separator\" aria-hidden=\"true\">\r\n <svg class=\"separator-icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z\" />\r\n </svg>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleIconSlotChange(): void {\r\n this.#updateIconFilled();\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(e: Event): void {\r\n setCustomState(this, \"--icon-only\", isIconOnly(e.target as HTMLSlotElement));\r\n this.#updateIconFilled();\r\n }\r\n\r\n /** @private */\r\n #updateIconFilled(): void {\r\n this.querySelectorAll(\"m3e-icon\").forEach((x) => (x.filled = this.current !== undefined && this.current !== null));\r\n }\r\n\r\n /** @internal */\r\n _setSeparator(nodes: Array<Node>) {\r\n const separator = this.shadowRoot?.querySelector(\".separator\");\r\n if (!separator) return;\r\n\r\n if (nodes.length > 0) {\r\n if (!this.#defaultSeparator && separator.firstElementChild) {\r\n this.#defaultSeparator = separator.firstElementChild;\r\n }\r\n separator.replaceChildren(...nodes);\r\n } else if (this.#defaultSeparator) {\r\n separator.replaceChildren(this.#defaultSeparator);\r\n this.#defaultSeparator = undefined;\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-breadcrumb-item\": M3eBreadcrumbItemElement;\r\n }\r\n}\r\n"],"names":["M3eBreadcrumbElement","Role","LitElement","constructor","_M3eBreadcrumbElement_customSeparator","set","this","wrap","render","html","__classPrivateFieldGet","_M3eBreadcrumbElement_instances","_M3eBreadcrumbElement_handleSlotChange","_M3eBreadcrumbElement_handleSeparatorSlotChange","isIconOnly","slot","elements","assignedElements","flatten","length","rect","getBoundingClientRect","width","height","items","querySelectorAll","i","item","removeAttribute","hasAttribute","setAttribute","_M3eBreadcrumbElement_setSeparator","call","e","__classPrivateFieldSet","target","forEach","x","_setSeparator","map","clone","cloneNode","part","styles","css","__decorate","property","type","Boolean","reflect","prototype","customElement","M3eBreadcrumbItemButtonElement","KeyboardClick","LinkButton","Focusable","Disabled","AttachInternals","_M3eBreadcrumbItemButtonElement_clickHandler","connectedCallback","addEventListener","super","disconnectedCallback","removeEventListener","firstUpdated","_changedProperties","_focusRing","_stateLayer","_ripple","attach","update","changedProperties","has","ariaDisabled","disabled","current","role","ifDefined","nothing","renderPseudoLink","_M3eBreadcrumbItemButtonElement_instances","_M3eBreadcrumbItemButtonElement_handleSlotChange","setCustomState","href","preventDefault","DesignToken","shape","corner","full","density","calc","color","onSurfaceVariant","onSurface","primary","typescale","standard","label","large","fontSize","fontWeight","lineHeight","tracking","query","M3eBreadcrumbItemElement","_M3eBreadcrumbItemElement_defaultSeparator","itemLabel","focus","options","_button","blur","click","updated","_M3eBreadcrumbItemElement_instances","_M3eBreadcrumbItemElement_updateIconFilled","undefined","download","rel","_M3eBreadcrumbItemElement_handleIconSlotChange","_M3eBreadcrumbItemElement_handleSlotChange","_M3eBreadcrumbItemElement_renderSeparator","nodes","separator","shadowRoot","querySelector","firstElementChild","replaceChildren","filled","attribute"],"mappings":";;;;;meAkCO,IAAMA,EAAN,cAAmCC,EAAKC,EAAY,eAApDC,WAAAA,mCAkBWC,EAAAC,IAAAC,KAA8B,IAMFA,KAAAC,MAAO,CAwCrD,CArCqBC,MAAAA,GACjB,OAAOC,CAAI,oDACYC,EAAAJ,KAAIK,EAAA,IAAAC,kDACaF,EAAAJ,KAAIK,EAAA,IAAAE,mBAE9C,GCjEI,SAAUC,EAAWC,GACzB,MAAMC,EAAWD,EAAKE,iBAAiB,CAAEC,SAAS,IAClD,GAAwB,IAApBF,EAASG,OAAc,CACzB,MAAMC,EAAOJ,EAAS,GAAGK,wBACzB,OAAOD,EAAKE,OAAS,IAAMF,EAAKG,QAAU,EAC5C,CACA,OAAO,CACT,sDD8DI,MAAMC,EAAQlB,KAAKmB,iBAAi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AS,IACZT,EAAAJ,KAAImG,EAAA,MAAsBiB,EAAUG,mBACvC3F,EAAA5B,KAAImG,EAAqBiB,EAAUG,uBAErCH,EAAUI,mBAAmBL,IACpB/G,EAAAJ,KAAImG,EAAA,OACbiB,EAAUI,gBAAgBpH,EAAAJ,KAAImG,EAAA,MAC9BvE,EAAA5B,KAAImG,OAAqBU,EAAS,MAEtC,4CAvCE,OAAO7G,KAAKqE,QACRG,EACArE,CAAI,kMAKV,eAIEC,EAAAJ,KAAI2G,EAAA,IAAAC,GAAkBlF,KAAtB1B,KACF,aAGkB2B,GAChBiD,EAAe5E,KAAM,cAAeQ,EAAWmB,EAAEE,SACjDzB,EAAAJ,KAAI2G,EAAA,IAAAC,GAAkBlF,KAAtB1B,KACF,eAIEA,KAAKmB,iBAAiB,YAAYW,QAASC,GAAOA,EAAE0F,YAA0BZ,IAAjB7G,KAAKqE,SAA0C,OAAjBrE,KAAKqE,QAClG,EAzHgB6B,EAAA7D,OAAyBC,CAAG,4hBAgCOC,EAAA,CAAlC0D,EAAM,YAAqEC,EAAAtD,UAAA,kBAOrDL,EAAA,CAAtCC,EAAS,CAAEkF,UAAW,gBAA+BxB,EAAAtD,UAAA,iBAAA,GAMVL,EAAA,CAA3CC,EAAS,CAAEC,KAAMC,QAASC,SAAS,KAAyBuD,EAAAtD,UAAA,gBAAA,GAMhCL,EAAA,CAA5BC,EAAS,CAAEG,SAAS,KAAwCuD,EAAAtD,UAAA,eAAA,GArDlDsD,EAAwB3D,EAAA,CADpCM,EAAc,wBACFqD"}
package/dist/button.js CHANGED
@@ -14,7 +14,7 @@ import { DesignToken, KeyboardClick, LinkButton, FormSubmitter, Focusable, Disab
14
14
  */
15
15
  const ButtonSizeToken = {
16
16
  "extra-small": {
17
- containerHeight: unsafeCSS(`calc(var(--m3e-button-extra-small-container-height, var(--m3e-button-container-height, 2rem)) + ${DesignToken.density.calc(0)})`),
17
+ containerHeight: unsafeCSS(`calc(var(--m3e-button-extra-small-container-height, var(--m3e-button-container-height, 2rem)) + ${DesignToken.density.calc(-3)})`),
18
18
  outlineThickness: unsafeCSS("var(--m3e-button-extra-small-outline-thickness, var(--m3e-button-outline-thickness, 1px))"),
19
19
  labelTextFontSize: unsafeCSS(`var(--m3e-button-extra-small-label-text-font-size, var(--m3e-button-label-text-font-size, ${DesignToken.typescale.standard.label.large.fontSize}))`),
20
20
  labelTextFontWeight: unsafeCSS(`var(--m3e-button-extra-small-label-text-font-weight, var(--m3e-button-label-text-font-weight, ${DesignToken.typescale.standard.label.large.fontWeight}))`),
@@ -31,7 +31,7 @@ const ButtonSizeToken = {
31
31
  iconLabelSpace: unsafeCSS("var(--m3e-button-extra-small-icon-label-space, var(--m3e-button-icon-label-space, 0.5rem))")
32
32
  },
33
33
  small: {
34
- containerHeight: unsafeCSS(`calc(var(--m3e-button-small-container-height, var(--m3e-button-container-height, 2.5rem)) + ${DesignToken.density.calc(-1)})`),
34
+ containerHeight: unsafeCSS(`calc(var(--m3e-button-small-container-height, var(--m3e-button-container-height, 2.5rem)) + ${DesignToken.density.calc(-3)})`),
35
35
  outlineThickness: unsafeCSS("var(--m3e-button-small-outline-thickness, var(--m3e-button-outline-thickness, 1px))"),
36
36
  labelTextFontSize: unsafeCSS(`var(--m3e-button-small-label-text-font-size, var(--m3e-button-label-text-font-size, ${DesignToken.typescale.standard.label.large.fontSize}))`),
37
37
  labelTextFontWeight: unsafeCSS(`var(--m3e-button-small-label-text-font-weight, var(--m3e-button-label-text-font-weight, ${DesignToken.typescale.standard.label.large.fontWeight}))`),
@@ -48,7 +48,7 @@ const ButtonSizeToken = {
48
48
  iconLabelSpace: unsafeCSS("var(--m3e-button-small-icon-label-space, var(--m3e-button-icon-label-space, 0.5rem))")
49
49
  },
50
50
  medium: {
51
- containerHeight: unsafeCSS(`calc(var(--m3e-button-medium-container-height, var(--m3e-button-container-height, 3.5rem)) + ${DesignToken.density.calc(-2)})`),
51
+ containerHeight: unsafeCSS(`calc(var(--m3e-button-medium-container-height, var(--m3e-button-container-height, 3.5rem)) + ${DesignToken.density.calc(-3)})`),
52
52
  outlineThickness: unsafeCSS("var(--m3e-button-medium-outline-thickness, var(--m3e-button-outline-thickness, 1px))"),
53
53
  labelTextFontSize: unsafeCSS(`var(--m3e-button-medium-label-text-font-size, var(--m3e-button-label-text-font-size, ${DesignToken.typescale.standard.body.large.fontSize}))`),
54
54
  labelTextFontWeight: unsafeCSS(`var(--m3e-button-medium-label-text-font-weight, var(--m3e-button-label-text-font-weight, ${DesignToken.typescale.standard.body.large.fontWeight}))`),
@@ -1132,6 +1132,8 @@ let M3eButtonElement = class M3eButtonElement extends KeyboardClick(LinkButton(F
1132
1132
  constructor() {
1133
1133
  super();
1134
1134
  _M3eButtonElement_instances.add(this);
1135
+ /** @internal */
1136
+ this._adjacentPressedTimeout = -1;
1135
1137
  /** @private */
1136
1138
  _M3eButtonElement_clickHandler.set(this, e => __classPrivateFieldGet(this, _M3eButtonElement_instances, "m", _M3eButtonElement_handleClick).call(this, e));
1137
1139
  /**
@@ -1276,6 +1278,10 @@ _M3eButtonElement_handlePressedChange = function _M3eButtonElement_handlePressed
1276
1278
  const group = this.closest("m3e-button-group");
1277
1279
  if (group && group.variant === "standard") {
1278
1280
  const buttons = [...group.querySelectorAll("m3e-button,m3e-icon-button")];
1281
+ for (const button of buttons) {
1282
+ clearTimeout(button._adjacentPressedTimeout);
1283
+ button._adjacentPressedTimeout = -1;
1284
+ }
1279
1285
  const index = buttons.indexOf(this);
1280
1286
  if (pressed) {
1281
1287
  const multiplier = parseFloat(getComputedStyle(this).getPropertyValue("--m3e-standard-button-group-width-multiplier") || "0.15");
@@ -1307,14 +1313,14 @@ _M3eButtonElement_handlePressedChange = function _M3eButtonElement_handlePressed
1307
1313
  if (!prefersReducedMotion()) {
1308
1314
  this.addEventListener("transitionend", e => {
1309
1315
  if (e.propertyName === "width") {
1310
- queueMicrotask(() => {
1311
- // Pressed state is tested to ensure this runs only when the button
1316
+ this._adjacentPressedTimeout = setTimeout(() => {
1317
+ // Pressed timeout is tested to ensure this runs only when the button
1312
1318
  // is no longer pressed. This handles changes to pressed state in
1313
1319
  // quick succession.
1314
- if (!hasCustomState(this, "--pressed")) {
1320
+ if (this._adjacentPressedTimeout > -1) {
1315
1321
  __classPrivateFieldGet(this, _M3eButtonElement_instances, "m", _M3eButtonElement_cleanupAdjacentPressed).call(this, buttons);
1316
1322
  }
1317
- });
1323
+ }, 600);
1318
1324
  }
1319
1325
  }, {
1320
1326
  once: true