@material/web 2.4.2-nightly.95dd57c.0 → 2.4.2-nightly.a3379a3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/button/internal/_touch-target.scss +1 -1
  2. package/button/internal/button.d.ts +0 -4
  3. package/button/internal/button.js.map +1 -1
  4. package/button/internal/shared-styles.css +1 -1
  5. package/button/internal/shared-styles.css.map +1 -1
  6. package/button/internal/shared-styles.cssresult.js +1 -1
  7. package/button/internal/shared-styles.cssresult.js.map +1 -1
  8. package/checkbox/internal/checkbox.d.ts +0 -2
  9. package/checkbox/internal/checkbox.js.map +1 -1
  10. package/icon/internal/icon.d.ts +1 -1
  11. package/icon/internal/icon.js +1 -1
  12. package/icon/internal/icon.js.map +1 -1
  13. package/iconbutton/internal/icon-button.d.ts +0 -4
  14. package/iconbutton/internal/icon-button.js.map +1 -1
  15. package/labs/behaviors/form-associated.d.ts +0 -22
  16. package/labs/behaviors/form-associated.js +0 -11
  17. package/labs/behaviors/form-associated.js.map +1 -1
  18. package/labs/gb/components/button/button.d.ts +1 -1
  19. package/labs/gb/components/button/button.js +5 -5
  20. package/labs/gb/components/button/button.js.map +1 -1
  21. package/labs/gb/components/button/md-button.d.ts +1 -1
  22. package/labs/gb/components/button/md-button.js +9 -9
  23. package/labs/gb/components/button/md-button.js.map +1 -1
  24. package/labs/gb/components/card/card.d.ts +1 -1
  25. package/labs/gb/components/card/card.js +3 -3
  26. package/labs/gb/components/card/card.js.map +1 -1
  27. package/labs/gb/components/card/md-card.js +6 -6
  28. package/labs/gb/components/card/md-card.js.map +1 -1
  29. package/labs/gb/components/checkbox/checkbox.d.ts +1 -1
  30. package/labs/gb/components/checkbox/checkbox.js +4 -4
  31. package/labs/gb/components/checkbox/checkbox.js.map +1 -1
  32. package/labs/gb/components/checkbox/md-checkbox.d.ts +4 -4
  33. package/labs/gb/components/checkbox/md-checkbox.js +10 -10
  34. package/labs/gb/components/checkbox/md-checkbox.js.map +1 -1
  35. package/labs/gb/components/divider/divider.d.ts +1 -1
  36. package/labs/gb/components/divider/divider.js +1 -1
  37. package/labs/gb/components/divider/divider.js.map +1 -1
  38. package/labs/gb/components/fab/fab.d.ts +1 -1
  39. package/labs/gb/components/fab/fab.js +4 -4
  40. package/labs/gb/components/fab/fab.js.map +1 -1
  41. package/labs/gb/components/fab/md-fab.js +4 -4
  42. package/labs/gb/components/fab/md-fab.js.map +1 -1
  43. package/labs/gb/components/focus/focus-ring.js +1 -1
  44. package/labs/gb/components/focus/focus-ring.js.map +1 -1
  45. package/labs/gb/components/iconbutton/icon-button.d.ts +1 -1
  46. package/labs/gb/components/iconbutton/icon-button.js +5 -5
  47. package/labs/gb/components/iconbutton/icon-button.js.map +1 -1
  48. package/labs/gb/components/iconbutton/md-icon-button.d.ts +1 -1
  49. package/labs/gb/components/iconbutton/md-icon-button.js +7 -7
  50. package/labs/gb/components/iconbutton/md-icon-button.js.map +1 -1
  51. package/labs/gb/components/list/list.d.ts +2 -2
  52. package/labs/gb/components/list/list.js +4 -4
  53. package/labs/gb/components/list/list.js.map +1 -1
  54. package/labs/gb/components/list/md-list-item.d.ts +1 -1
  55. package/labs/gb/components/list/md-list-item.js +7 -7
  56. package/labs/gb/components/list/md-list-item.js.map +1 -1
  57. package/labs/gb/components/list/md-list.d.ts +1 -1
  58. package/labs/gb/components/list/md-list.js +1 -1
  59. package/labs/gb/components/list/md-list.js.map +1 -1
  60. package/labs/gb/components/menu/md-menu-group.d.ts +1 -1
  61. package/labs/gb/components/menu/md-menu-group.js +1 -1
  62. package/labs/gb/components/menu/md-menu-group.js.map +1 -1
  63. package/labs/gb/components/menu/md-menu-item.d.ts +1 -1
  64. package/labs/gb/components/menu/md-menu-item.js +8 -8
  65. package/labs/gb/components/menu/md-menu-item.js.map +1 -1
  66. package/labs/gb/components/menu/md-menu.d.ts +1 -1
  67. package/labs/gb/components/menu/md-menu.js +2 -2
  68. package/labs/gb/components/menu/md-menu.js.map +1 -1
  69. package/labs/gb/components/menu/menu.d.ts +2 -2
  70. package/labs/gb/components/menu/menu.js +4 -4
  71. package/labs/gb/components/menu/menu.js.map +1 -1
  72. package/labs/gb/components/radio/md-radio.d.ts +4 -4
  73. package/labs/gb/components/radio/md-radio.js +11 -11
  74. package/labs/gb/components/radio/md-radio.js.map +1 -1
  75. package/labs/gb/components/radio/radio.d.ts +1 -1
  76. package/labs/gb/components/radio/radio.js +4 -4
  77. package/labs/gb/components/radio/radio.js.map +1 -1
  78. package/labs/gb/components/ripple/ripple.js +5 -2
  79. package/labs/gb/components/ripple/ripple.js.map +1 -1
  80. package/labs/gb/components/splitbutton/_split-button-tokens.scss +135 -0
  81. package/labs/gb/components/splitbutton/md-split-button.d.ts +26 -0
  82. package/labs/gb/components/splitbutton/md-split-button.js +119 -0
  83. package/labs/gb/components/splitbutton/md-split-button.js.map +1 -0
  84. package/labs/gb/components/splitbutton/split-button.css +4 -0
  85. package/labs/gb/components/splitbutton/split-button.css.map +1 -0
  86. package/labs/gb/components/splitbutton/split-button.cssresult.d.ts +3 -0
  87. package/labs/gb/components/splitbutton/split-button.cssresult.js +14 -0
  88. package/labs/gb/components/splitbutton/split-button.cssresult.js.map +1 -0
  89. package/labs/gb/components/splitbutton/split-button.d.ts +47 -0
  90. package/labs/gb/components/splitbutton/split-button.js +46 -0
  91. package/labs/gb/components/splitbutton/split-button.js.map +1 -0
  92. package/labs/gb/components/splitbutton/split-button.scss +164 -0
  93. package/labs/gb/components/switch/md-switch.d.ts +4 -4
  94. package/labs/gb/components/switch/md-switch.js +12 -12
  95. package/labs/gb/components/switch/md-switch.js.map +1 -1
  96. package/labs/gb/components/switch/switch.d.ts +1 -1
  97. package/labs/gb/components/switch/switch.js +5 -5
  98. package/labs/gb/components/switch/switch.js.map +1 -1
  99. package/labs/gb/styles/icon/md-icon.css +1 -1
  100. package/labs/gb/styles/icon/md-icon.css.map +1 -1
  101. package/labs/gb/styles/icon/md-icon.cssresult.js +1 -1
  102. package/labs/gb/styles/icon/md-icon.cssresult.js.map +1 -1
  103. package/labs/gb/styles/icon/md-icon.d.ts +20 -0
  104. package/labs/gb/styles/icon/md-icon.js +24 -0
  105. package/labs/gb/styles/icon/md-icon.js.map +1 -0
  106. package/labs/gb/styles/icon/md-icon.scss +2 -1
  107. package/labs/gb/styles/m3.css +5 -2
  108. package/labs/gb/styles/m3.css.map +1 -1
  109. package/labs/gb/styles/m3.cssresult.js +5 -2
  110. package/labs/gb/styles/m3.cssresult.js.map +1 -1
  111. package/labs/gb/styles/m3.scss +1 -0
  112. package/labs/gb/styles/space/md-space-tokens.css +4 -0
  113. package/labs/gb/styles/space/md-space-tokens.css.map +1 -0
  114. package/labs/gb/styles/space/md-space-tokens.cssresult.d.ts +3 -0
  115. package/labs/gb/styles/space/md-space-tokens.cssresult.js +14 -0
  116. package/labs/gb/styles/space/md-space-tokens.cssresult.js.map +1 -0
  117. package/labs/gb/styles/space/md-space-tokens.scss +28 -0
  118. package/labs/gb/styles/tailwind.css +4 -0
  119. package/labs/gb/styles/tailwind.css.map +1 -0
  120. package/labs/gb/styles/tailwind.cssresult.d.ts +3 -0
  121. package/labs/gb/styles/tailwind.cssresult.js +14 -0
  122. package/labs/gb/styles/tailwind.cssresult.js.map +1 -0
  123. package/labs/gb/styles/tailwind.scss +349 -0
  124. package/labs/gb/styles/typography/internal/_typography-tokens.scss +85 -16
  125. package/labs/gb/styles/typography/md-typography-tokens.css +1 -1
  126. package/labs/gb/styles/typography/md-typography-tokens.css.map +1 -1
  127. package/labs/gb/styles/typography/md-typography-tokens.cssresult.js +1 -1
  128. package/labs/gb/styles/typography/md-typography-tokens.cssresult.js.map +1 -1
  129. package/list/internal/listitem/list-item.d.ts +4 -1
  130. package/list/internal/listitem/list-item.js +4 -1
  131. package/list/internal/listitem/list-item.js.map +1 -1
  132. package/menu/internal/submenu/sub-menu.d.ts +5 -1
  133. package/menu/internal/submenu/sub-menu.js +5 -1
  134. package/menu/internal/submenu/sub-menu.js.map +1 -1
  135. package/package.json +5 -2
  136. package/radio/internal/radio.d.ts +0 -2
  137. package/radio/internal/radio.js.map +1 -1
  138. package/select/internal/select.d.ts +0 -2
  139. package/select/internal/select.js.map +1 -1
  140. package/slider/internal/slider.d.ts +0 -2
  141. package/slider/internal/slider.js.map +1 -1
  142. package/switch/internal/_switch.scss +1 -0
  143. package/switch/internal/switch-styles.css +1 -1
  144. package/switch/internal/switch-styles.css.map +1 -1
  145. package/switch/internal/switch-styles.cssresult.js +1 -1
  146. package/switch/internal/switch-styles.cssresult.js.map +1 -1
  147. package/switch/internal/switch.d.ts +0 -2
  148. package/switch/internal/switch.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"md-icon-button.js","sourceRoot":"","sources":["md-icon-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAC,eAAe,EAAC,MAAM,mDAAmD,CAAC;AAClF,OAAO,EAAC,qBAAqB,EAAC,MAAM,mDAAmD,CAAC;AACxF,OAAO,EAAC,mBAAmB,EAAC,MAAM,iDAAiD,CAAC;AACpF,OAAO,EAAC,kBAAkB,EAAC,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AACtE,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE1D,OAAO,eAAe,MAAM,gEAAgE,CAAC;AAC7F,OAAO,YAAY,MAAM,6DAA6D,CAAC;AACvF,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAO1D,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAS5C,MAAM,SAAS,GAAG,kBAAkB,CAClC,kBAAkB,CAAC,mBAAmB,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC,CAC3E,CAAC;AAEF;;GAEG;AAEI,I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C;IADC,QAAQ,CAAC,EAAC,UAAU,EAAE,IAAI,EAAC,CAAC;sCAG5B;AAaD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;gDAChD;AAKM;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;4CAAkB;AAKhC;IAAX,QAAQ,EAAE;wCAAW;AAKV;IAAX,QAAQ,EAAE;4CAAe;AAKd;IAAX,QAAQ,EAAE;0CAA2D;AAtF3D,UAAU;IADtB,aAAa,CAAC,gBAAgB,CAAC;GACnB,UAAU,CAqItB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {ARIAMixinStrict} from '@material/web/internal/aria/aria.js';\nimport {mixinDelegatesAria} from '@material/web/internal/aria/delegate.js';\nimport {redispatchEvent} from '@material/web/internal/events/redispatch-event.js';\nimport {mixinElementInternals} from '@material/web/labs/behaviors/element-internals.js';\nimport {mixinFormAssociated} from '@material/web/labs/behaviors/form-associated.js';\nimport {mixinFormSubmitter} from '@material/web/labs/behaviors/form-submitter.js';\nimport {css, CSSResultOrNative, html, LitElement, nothing} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\n\nimport focusRingStyles from '@material/web/labs/gb/components/focus/focus-ring.cssresult.js';\nimport rippleStyles from '@material/web/labs/gb/components/ripple/ripple.cssresult.js';\nimport iconButtonStyles from './icon-button.cssresult.js';\n\nimport type {\n IconButtonColor,\n IconButtonSize,\n IconButtonWidth,\n} from './icon-button.js';\nimport {iconButton} from './icon-button.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design icon button component. */\n 'md-icon-button': IconButton;\n }\n}\n\nconst baseClass = mixinDelegatesAria(\n mixinFormSubmitter(mixinFormAssociated(mixinElementInternals(LitElement))),\n);\n\n/**\n * A Material Design icon button component.\n */\n@customElement('md-icon-button')\nexport class IconButton extends baseClass {\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n static override styles: CSSResultOrNative[] = [\n focusRingStyles,\n rippleStyles,\n iconButtonStyles,\n css`\n :host {\n display: inline-flex;\n }\n .icon-btn {\n flex: 1;\n }\n `,\n ];\n\n /**\n * The color of the button.\n */\n @property() color: IconButtonColor = 'standard';\n\n /**\n * The size of the button.\n */\n @property() size: IconButtonSize = 'sm';\n\n /**\n * Changes the shape of the button to be square.\n */\n @property({type: Boolean}) square = false;\n\n /**\n * Changes the width of the button.\n */\n @property() width: IconButtonWidth = '';\n\n /**\n * A string indicating the behavior of the button.\n *\n * - \"submit\" (default): A button that submits its associated form.\n * - \"reset\": A button that resets its associated form.\n * - \"button\": A normal button.\n * - \"toggle\": A toggle button using the `selected` property.\n * - \"link\": An anchor link (`<a>`). Type is always \"link\" when `href` is set.\n */\n @property({noAccessor: true})\n override get type(): string {\n return this.href ? 'link' : super.type;\n }\n override set type(type: string) {\n if (this.href && type !== 'link') {\n return;\n }\n super.type = type;\n }\n\n /**\n * Whether or not the button is \"soft-disabled\" (disabled but still\n * focusable).\n */\n @property({type: Boolean, attribute: 'soft-disabled', reflect: true})\n softDisabled = false;\n\n /**\n * Whether or not the button is selected, when `type=\"toggle\"`.\n */\n @property({type: Boolean}) selected = false;\n\n /**\n * The URL that the link button points to.\n */\n @property() href = '';\n\n /**\n * The filename to use when downloading the linked resource.\n */\n @property() download = '';\n\n /**\n * Where to display the linked `href` URL for a link button.\n */\n @property() target: '_blank' | '_parent' | '_self' | '_top' | '' = '';\n\n protected override render() {\n const classes = iconButton({\n color: this.color,\n size: this.size,\n width: this.width,\n square: this.square,\n disabled: this.softDisabled,\n });\n\n const {ariaLabel, ariaHasPopup, ariaExpanded} = this as ARIAMixinStrict;\n if (this.type === 'link') {\n return html`<a\n part=\"icon-btn\"\n class=${classes}\n href=${this.href}\n download=${this.download || nothing}\n target=${this.target || nothing}\n aria-label=${ariaLabel || nothing}\n aria-haspopup=${ariaHasPopup || nothing}\n aria-expanded=${ariaExpanded || nothing}\n aria-disabled=${this.disabled || this.softDisabled || nothing}\n tabindex=${this.disabled && !this.softDisabled ? -1 : nothing}>\n <slot></slot>\n </a>`;\n }\n\n return html`<button\n part=\"icon-btn\"\n class=${classes}\n type=\"button\"\n ?disabled=${this.disabled}\n aria-disabled=${this.softDisabled || nothing}\n aria-label=${ariaLabel || nothing}\n aria-pressed=${this.type === 'toggle' ? this.selected : nothing}\n aria-haspopup=${ariaHasPopup || nothing}\n aria-expanded=${ariaExpanded || nothing}\n @change=${this.handleChange}>\n <slot></slot>\n </button>`;\n }\n\n private handleChange(event: Event) {\n this.selected = (event.target as HTMLElement).ariaPressed === 'true';\n redispatchEvent(this, event);\n }\n}\n"]}
1
+ {"version":3,"file":"md-icon-button.js","sourceRoot":"","sources":["md-icon-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AACtE,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAC,eAAe,EAAC,MAAM,iDAAiD,CAAC;AAChF,OAAO,EAAC,qBAAqB,EAAC,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAC,mBAAmB,EAAC,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAC,kBAAkB,EAAC,MAAM,sCAAsC,CAAC;AAExE,OAAO,eAAe,MAAM,kCAAkC,CAAC;AAC/D,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAO1D,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAS5C,MAAM,SAAS,GAAG,kBAAkB,CAClC,kBAAkB,CAAC,mB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EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;0CAAgB;AAK9B;IAAX,QAAQ,EAAE;yCAA6B;AAYxC;IADC,QAAQ,CAAC,EAAC,UAAU,EAAE,IAAI,EAAC,CAAC;sCAG5B;AAaD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;gDAChD;AAKM;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;4CAAkB;AAKhC;IAAX,QAAQ,EAAE;wCAAW;AAKV;IAAX,QAAQ,EAAE;4CAAe;AAKd;IAAX,QAAQ,EAAE;0CAA2D;AAtF3D,UAAU;IADtB,aAAa,CAAC,gBAAgB,CAAC;GACnB,UAAU,CAqItB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {css, CSSResultOrNative, html, LitElement, nothing} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {ARIAMixinStrict} from '../../../../internal/aria/aria.js';\nimport {mixinDelegatesAria} from '../../../../internal/aria/delegate.js';\nimport {redispatchEvent} from '../../../../internal/events/redispatch-event.js';\nimport {mixinElementInternals} from '../../../behaviors/element-internals.js';\nimport {mixinFormAssociated} from '../../../behaviors/form-associated.js';\nimport {mixinFormSubmitter} from '../../../behaviors/form-submitter.js';\n\nimport focusRingStyles from '../focus/focus-ring.cssresult.js';\nimport rippleStyles from '../ripple/ripple.cssresult.js';\nimport iconButtonStyles from './icon-button.cssresult.js';\n\nimport type {\n IconButtonColor,\n IconButtonSize,\n IconButtonWidth,\n} from './icon-button.js';\nimport {iconButton} from './icon-button.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design icon button component. */\n 'md-icon-button': IconButton;\n }\n}\n\nconst baseClass = mixinDelegatesAria(\n mixinFormSubmitter(mixinFormAssociated(mixinElementInternals(LitElement))),\n);\n\n/**\n * A Material Design icon button component.\n */\n@customElement('md-icon-button')\nexport class IconButton extends baseClass {\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n static override styles: CSSResultOrNative[] = [\n focusRingStyles,\n rippleStyles,\n iconButtonStyles,\n css`\n :host {\n display: inline-flex;\n }\n .icon-btn {\n flex: 1;\n }\n `,\n ];\n\n /**\n * The color of the button.\n */\n @property() color: IconButtonColor = 'standard';\n\n /**\n * The size of the button.\n */\n @property() size: IconButtonSize = 'sm';\n\n /**\n * Changes the shape of the button to be square.\n */\n @property({type: Boolean}) square = false;\n\n /**\n * Changes the width of the button.\n */\n @property() width: IconButtonWidth = '';\n\n /**\n * A string indicating the behavior of the button.\n *\n * - \"submit\" (default): A button that submits its associated form.\n * - \"reset\": A button that resets its associated form.\n * - \"button\": A normal button.\n * - \"toggle\": A toggle button using the `selected` property.\n * - \"link\": An anchor link (`<a>`). Type is always \"link\" when `href` is set.\n */\n @property({noAccessor: true})\n override get type(): string {\n return this.href ? 'link' : super.type;\n }\n override set type(type: string) {\n if (this.href && type !== 'link') {\n return;\n }\n super.type = type;\n }\n\n /**\n * Whether or not the button is \"soft-disabled\" (disabled but still\n * focusable).\n */\n @property({type: Boolean, attribute: 'soft-disabled', reflect: true})\n softDisabled = false;\n\n /**\n * Whether or not the button is selected, when `type=\"toggle\"`.\n */\n @property({type: Boolean}) selected = false;\n\n /**\n * The URL that the link button points to.\n */\n @property() href = '';\n\n /**\n * The filename to use when downloading the linked resource.\n */\n @property() download = '';\n\n /**\n * Where to display the linked `href` URL for a link button.\n */\n @property() target: '_blank' | '_parent' | '_self' | '_top' | '' = '';\n\n protected override render() {\n const classes = iconButton({\n color: this.color,\n size: this.size,\n width: this.width,\n square: this.square,\n disabled: this.softDisabled,\n });\n\n const {ariaLabel, ariaHasPopup, ariaExpanded} = this as ARIAMixinStrict;\n if (this.type === 'link') {\n return html`<a\n part=\"icon-btn\"\n class=${classes}\n href=${this.href}\n download=${this.download || nothing}\n target=${this.target || nothing}\n aria-label=${ariaLabel || nothing}\n aria-haspopup=${ariaHasPopup || nothing}\n aria-expanded=${ariaExpanded || nothing}\n aria-disabled=${this.disabled || this.softDisabled || nothing}\n tabindex=${this.disabled && !this.softDisabled ? -1 : nothing}>\n <slot></slot>\n </a>`;\n }\n\n return html`<button\n part=\"icon-btn\"\n class=${classes}\n type=\"button\"\n ?disabled=${this.disabled}\n aria-disabled=${this.softDisabled || nothing}\n aria-label=${ariaLabel || nothing}\n aria-pressed=${this.type === 'toggle' ? this.selected : nothing}\n aria-haspopup=${ariaHasPopup || nothing}\n aria-expanded=${ariaExpanded || nothing}\n @change=${this.handleChange}>\n <slot></slot>\n </button>`;\n }\n\n private handleChange(event: Event) {\n this.selected = (event.target as HTMLElement).ariaPressed === 'true';\n redispatchEvent(this, event);\n }\n}\n"]}
@@ -35,7 +35,7 @@ export declare function listClasses({ segmented, }?: ListClassesState): ClassInf
35
35
  * `;
36
36
  * ```
37
37
  */
38
- export declare const list: (state?: ListClassesState & import("@material/web/labs/gb/components/shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
38
+ export declare const list: (state?: ListClassesState & import("../shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
39
39
  /** List item classes. */
40
40
  export declare const LIST_ITEM_CLASSES: {
41
41
  readonly listItem: "list-item";
@@ -100,4 +100,4 @@ export declare function setupListItem(listItem: HTMLElement, opts?: {
100
100
  * `;
101
101
  * ```
102
102
  */
103
- export declare const listItem: (state?: ListItemClassesState & import("@material/web/labs/gb/components/shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
103
+ export declare const listItem: (state?: ListItemClassesState & import("../shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
@@ -3,10 +3,10 @@
3
3
  * Copyright 2026 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { FOCUS_RING_CLASSES } from '@material/web/labs/gb/components/focus/focus-ring.js';
7
- import { RIPPLE_CLASSES, setupRipple, } from '@material/web/labs/gb/components/ripple/ripple.js';
8
- import { createClassMapDirective } from '@material/web/labs/gb/components/shared/directives.js';
9
- import { PSEUDO_CLASSES } from '@material/web/labs/gb/components/shared/pseudo-classes.js';
6
+ import { FOCUS_RING_CLASSES } from '../focus/focus-ring.js';
7
+ import { RIPPLE_CLASSES, setupRipple } from '../ripple/ripple.js';
8
+ import { createClassMapDirective } from '../shared/directives.js';
9
+ import { PSEUDO_CLASSES } from '../shared/pseudo-classes.js';
10
10
  /** List classes. */
11
11
  export const LIST_CLASSES = {
12
12
  list: 'list',
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,sDAAsD,CAAC;AACxF,OAAO,EACL,cAAc,EACd,WAAW,GACZ,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAC,uBAAuB,EAAC,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EAAC,cAAc,EAAC,MAAM,2DAA2D,CAAC;AAGzF,oBAAoB;AACpB,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,aAAa,EAAE,gBAAgB;CACvB,CAAC;AAQX;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,GAAG,KAAK,MACG,EAAE;IACtB,OAAO;QACL,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI;QACzB,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,SAAS;KACxC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,uBAAuB,CAAC;IAC1C,UAAU,EAAE,WAAW;CACxB,CAAC,CAAC;AAEH,yBAAyB;AACzB,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,WAA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AAQ,EAAE,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,uBAAuB,CAAC;IAC9C,UAAU,EAAE,eAAe;IAC3B,YAAY,EAAE,aAAa;CAC5B,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {FOCUS_RING_CLASSES} from '@material/web/labs/gb/components/focus/focus-ring.js';\nimport {\n RIPPLE_CLASSES,\n setupRipple,\n} from '@material/web/labs/gb/components/ripple/ripple.js';\nimport {createClassMapDirective} from '@material/web/labs/gb/components/shared/directives.js';\nimport {PSEUDO_CLASSES} from '@material/web/labs/gb/components/shared/pseudo-classes.js';\nimport {type ClassInfo} from 'lit/directives/class-map.js';\n\n/** List classes. */\nexport const LIST_CLASSES = {\n list: 'list',\n listSegmented: 'list-segmented',\n} as const;\n\n/** The state provided to the `listClasses()` function. */\nexport interface ListClassesState {\n /** Whether to render the list with segmented items. */\n segmented?: boolean;\n}\n\n/**\n * Returns the list classes to apply to an element based on the given state.\n *\n * @param state The state of the list.\n * @return An object of class names and truthy values if they apply.\n */\nexport function listClasses({\n segmented = false,\n}: ListClassesState = {}): ClassInfo {\n return {\n [LIST_CLASSES.list]: true,\n [LIST_CLASSES.listSegmented]: segmented,\n };\n}\n\n/**\n * A Lit directive that adds list styling and functionality to its element.\n *\n * @example\n * ```ts\n * html`\n * <ul class=\"${list()}\">\n * <li><button class=\"${listItem()}\">List item 1</button></li>\n * <li><button class=\"${listItem()}\">List item 2</button></li>\n * <li><button class=\"${listItem()}\">List item 3</button></li>\n * </ul>\n * `;\n * ```\n */\nexport const list = createClassMapDirective({\n getClasses: listClasses,\n});\n\n/** List item classes. */\nexport const LIST_ITEM_CLASSES = {\n listItem: 'list-item',\n listItemStatic: 'list-item-static',\n listItemContent: 'list-item-content',\n listItemLeading: 'list-item-leading',\n listItemTrailing: 'list-item-trailing',\n listItemOverline: 'list-item-overline',\n listItemSupportingText: 'list-item-supporting-text',\n listItemTrailingText: 'list-item-trailing-text',\n listItemAvatar: 'list-item-avatar',\n checked: PSEUDO_CLASSES.checked,\n hover: PSEUDO_CLASSES.hover,\n focus: PSEUDO_CLASSES.focus,\n active: PSEUDO_CLASSES.active,\n disabled: PSEUDO_CLASSES.disabled,\n} as const;\n\n/** The state provided to the `listItemClasses()` function. */\nexport interface ListItemClassesState {\n /** Whether the list item is non-interactive. */\n static?: boolean;\n /** Emulates `:checked`. */\n checked?: boolean;\n /** Emulates `:hover`. */\n hover?: boolean;\n /** Emulates `:focus`. */\n focus?: boolean;\n /** Emulates `:active`. */\n active?: boolean;\n /** Emulates `:disabled`. */\n disabled?: boolean;\n}\n\n/**\n * Returns the list item classes to apply to an element based on the given\n * state.\n *\n * @param state The state of the list item.\n * @return An object of class names and truthy values if they apply.\n */\nexport function listItemClasses({\n static: staticItem = false,\n checked = false,\n hover = false,\n focus = false,\n active = false,\n disabled = false,\n}: ListItemClassesState = {}): ClassInfo {\n return {\n [RIPPLE_CLASSES.ripple]: !staticItem,\n [FOCUS_RING_CLASSES.focusRingInner]: !staticItem,\n [LIST_ITEM_CLASSES.listItem]: true,\n [LIST_ITEM_CLASSES.listItemStatic]: staticItem,\n [LIST_ITEM_CLASSES.checked]: checked,\n [LIST_ITEM_CLASSES.hover]: hover,\n [LIST_ITEM_CLASSES.focus]: focus,\n [LIST_ITEM_CLASSES.active]: active,\n [LIST_ITEM_CLASSES.disabled]: disabled,\n };\n}\n\n/**\n * Sets up list item functionality for the given element.\n *\n * @param listItem The element on which to set up list item functionality.\n * @param opts Setup options, supports a cleanup `signal`.\n */\nexport function setupListItem(\n listItem: HTMLElement,\n opts?: {signal?: AbortSignal},\n): void {\n setupRipple(listItem, opts);\n}\n\n/**\n * A Lit directive that adds list item styling and functionality to its element.\n *\n *\n * @example\n * ```ts\n * html`\n * <ul class=\"${list()}\">\n * <li><button class=\"${listItem()}\">List item 1</button></li>\n * <li><button class=\"${listItem()}\">List item 2</button></li>\n * <li><button class=\"${listItem()}\">List item 3</button></li>\n * </ul>\n * `;\n * ```\n */\nexport const listItem = createClassMapDirective({\n getClasses: listItemClasses,\n setupElement: setupListItem,\n});\n"]}
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAC,cAAc,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAC,uBAAuB,EAAC,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAE3D,oBAAoB;AACpB,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,aAAa,EAAE,gBAAgB;CACvB,CAAC;AAQX;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,GAAG,KAAK,MACG,EAAE;IACtB,OAAO;QACL,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI;QACzB,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,SAAS;KACxC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,uBAAuB,CAAC;IAC1C,UAAU,EAAE,WAAW;CACxB,CAAC,CAAC;AAEH,yBAAyB;AACzB,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,WAAW;IACrB,cAAc,EAAE,kBAAkB;IAClC,eAAe,EAAE,mBAAmB;IACpC,eAAe,EAAE,mBAAmB;IACpC,gBAAgB,EAAE,oBAAoB;IACtC,gBAAgB,EAAE,oBAAoB;IACtC,sBAAsB,EAAE,2BAA2B;IACnD,oBAAoB,EAAE,yBAAyB;IAC/C,cAAc,EAAE,kBAAkB;IAClC,OAAO,EAAE,cAAc,CAA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0\n */\n\nimport {type ClassInfo} from 'lit/directives/class-map.js';\nimport {FOCUS_RING_CLASSES} from '../focus/focus-ring.js';\nimport {RIPPLE_CLASSES, setupRipple} from '../ripple/ripple.js';\nimport {createClassMapDirective} from '../shared/directives.js';\nimport {PSEUDO_CLASSES} from '../shared/pseudo-classes.js';\n\n/** List classes. */\nexport const LIST_CLASSES = {\n list: 'list',\n listSegmented: 'list-segmented',\n} as const;\n\n/** The state provided to the `listClasses()` function. */\nexport interface ListClassesState {\n /** Whether to render the list with segmented items. */\n segmented?: boolean;\n}\n\n/**\n * Returns the list classes to apply to an element based on the given state.\n *\n * @param state The state of the list.\n * @return An object of class names and truthy values if they apply.\n */\nexport function listClasses({\n segmented = false,\n}: ListClassesState = {}): ClassInfo {\n return {\n [LIST_CLASSES.list]: true,\n [LIST_CLASSES.listSegmented]: segmented,\n };\n}\n\n/**\n * A Lit directive that adds list styling and functionality to its element.\n *\n * @example\n * ```ts\n * html`\n * <ul class=\"${list()}\">\n * <li><button class=\"${listItem()}\">List item 1</button></li>\n * <li><button class=\"${listItem()}\">List item 2</button></li>\n * <li><button class=\"${listItem()}\">List item 3</button></li>\n * </ul>\n * `;\n * ```\n */\nexport const list = createClassMapDirective({\n getClasses: listClasses,\n});\n\n/** List item classes. */\nexport const LIST_ITEM_CLASSES = {\n listItem: 'list-item',\n listItemStatic: 'list-item-static',\n listItemContent: 'list-item-content',\n listItemLeading: 'list-item-leading',\n listItemTrailing: 'list-item-trailing',\n listItemOverline: 'list-item-overline',\n listItemSupportingText: 'list-item-supporting-text',\n listItemTrailingText: 'list-item-trailing-text',\n listItemAvatar: 'list-item-avatar',\n checked: PSEUDO_CLASSES.checked,\n hover: PSEUDO_CLASSES.hover,\n focus: PSEUDO_CLASSES.focus,\n active: PSEUDO_CLASSES.active,\n disabled: PSEUDO_CLASSES.disabled,\n} as const;\n\n/** The state provided to the `listItemClasses()` function. */\nexport interface ListItemClassesState {\n /** Whether the list item is non-interactive. */\n static?: boolean;\n /** Emulates `:checked`. */\n checked?: boolean;\n /** Emulates `:hover`. */\n hover?: boolean;\n /** Emulates `:focus`. */\n focus?: boolean;\n /** Emulates `:active`. */\n active?: boolean;\n /** Emulates `:disabled`. */\n disabled?: boolean;\n}\n\n/**\n * Returns the list item classes to apply to an element based on the given\n * state.\n *\n * @param state The state of the list item.\n * @return An object of class names and truthy values if they apply.\n */\nexport function listItemClasses({\n static: staticItem = false,\n checked = false,\n hover = false,\n focus = false,\n active = false,\n disabled = false,\n}: ListItemClassesState = {}): ClassInfo {\n return {\n [RIPPLE_CLASSES.ripple]: !staticItem,\n [FOCUS_RING_CLASSES.focusRingInner]: !staticItem,\n [LIST_ITEM_CLASSES.listItem]: true,\n [LIST_ITEM_CLASSES.listItemStatic]: staticItem,\n [LIST_ITEM_CLASSES.checked]: checked,\n [LIST_ITEM_CLASSES.hover]: hover,\n [LIST_ITEM_CLASSES.focus]: focus,\n [LIST_ITEM_CLASSES.active]: active,\n [LIST_ITEM_CLASSES.disabled]: disabled,\n };\n}\n\n/**\n * Sets up list item functionality for the given element.\n *\n * @param listItem The element on which to set up list item functionality.\n * @param opts Setup options, supports a cleanup `signal`.\n */\nexport function setupListItem(\n listItem: HTMLElement,\n opts?: {signal?: AbortSignal},\n): void {\n setupRipple(listItem, opts);\n}\n\n/**\n * A Lit directive that adds list item styling and functionality to its element.\n *\n *\n * @example\n * ```ts\n * html`\n * <ul class=\"${list()}\">\n * <li><button class=\"${listItem()}\">List item 1</button></li>\n * <li><button class=\"${listItem()}\">List item 2</button></li>\n * <li><button class=\"${listItem()}\">List item 3</button></li>\n * </ul>\n * `;\n * ```\n */\nexport const listItem = createClassMapDirective({\n getClasses: listItemClasses,\n setupElement: setupListItem,\n});\n"]}
@@ -10,7 +10,7 @@ declare global {
10
10
  'md-list-item': ListItem;
11
11
  }
12
12
  }
13
- declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("@material/web/labs/behaviors/element-internals.js").WithElementInternals>>;
13
+ declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("../../../behaviors/element-internals.js").WithElementInternals>>;
14
14
  /**
15
15
  * A Material Design list item component.
16
16
  */
@@ -4,15 +4,15 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { __decorate } from "tslib";
7
- import { mixinDelegatesAria } from '@material/web/internal/aria/delegate.js';
8
- import { internals, mixinElementInternals, } from '@material/web/labs/behaviors/element-internals.js';
9
- import { hasSlotted } from '@material/web/labs/gb/components/shared/has-slotted.js';
10
7
  import { css, html, LitElement, nothing } from 'lit';
11
8
  import { customElement, property } from 'lit/decorators.js';
12
- import focusRingStyles from '@material/web/labs/gb/components/focus/focus-ring.css' with { type: 'css' }; // github-only
13
- // import {styles as focusRingStyles} from '@material/web/labs/gb/components/focus/focus-ring.cssresult.js'; // google3-only
14
- import rippleStyles from '@material/web/labs/gb/components/ripple/ripple.css' with { type: 'css' }; // github-only
15
- // import {styles as rippleStyles} from '@material/web/labs/gb/components/ripple/ripple.cssresult.js'; // google3-only
9
+ import { mixinDelegatesAria } from '../../../../internal/aria/delegate.js';
10
+ import { internals, mixinElementInternals, } from '../../../behaviors/element-internals.js';
11
+ import { hasSlotted } from '../shared/has-slotted.js';
12
+ import focusRingStyles from '../focus/focus-ring.css' with { type: 'css' }; // github-only
13
+ // import {styles as focusRingStyles} from '../focus/focus-ring.cssresult.js'; // google3-only
14
+ import rippleStyles from '../ripple/ripple.css' with { type: 'css' }; // github-only
15
+ // import {styles as rippleStyles} from '../ripple/ripple.cssresult.js'; // google3-only
16
16
  import listStyles from './list.css' with { type: 'css' }; // github-only
17
17
  // import {styles as listStyles} from './list.cssresult.js'; // google3-only
18
18
  import { listItem } from './list.js';
@@ -1 +1 @@
1
- {"version":3,"file":"md-list-item.js","sourceRoot":"","sources":["md-list-item.ts"],"names":[],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C,cAAc;SAC5B,CAAC;QACF,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,OAAO,IAAI,CAAA,gCAAgC,QAAQ,CAAC,KAAK,CAAC;WACrD,IAAI,CAAC,aAAa,EAAE;QACvB,CAAC;QACL,CAAC;QAED,iCAAiC;QACjC,MAAM,EAAC,SAAS,EAAC,GAAG,IAAuB,CAAC;QAC5C,OAAO,IAAI,CAAA;;eAEA,QAAQ,CAAC,KAAK,CAAC;kBACZ,IAAI,CAAC,QAAQ;mBACZ,SAAS,IAAI,OAAO;QAC/B,IAAI,CAAC,aAAa,EAAE;cACd,CAAC;IACb,CAAC;IAEO,aAAa;QACnB,OAAO,IAAI,CAAA;;uDAEwC,UAAU,EAAE;+BACpC,UAAU,EAAE;;;;;;;;;;;YAW/B,UAAU,EAAE;gCACQ,UAAU,EAAE;;KAEvC,CAAC;IACJ,CAAC;;AA3FD,kBAAkB;AACF,0BAAiB,GAAG;IAClC,GAAG,UAAU,CAAC,iBAAiB;IAC/B,cAAc,EAAE,IAAI;CACrB,AAHgC,CAG/B;AAEc,eAAM,GAAwB;IAC5C,eAAe;IACf,YAAY;IACZ,UAAU;IACV,GAAG,CAAA;;;;;;;;;;;;;;;KAeF;CACF,AApBqB,CAoBpB;AAUyB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;yCAAiB;AAKhB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;0CAAkB;AAM5C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAC,CAAC;gDACvC;AAhDZ,QAAQ;IADpB,aAAa,CAAC,cAAc,CAAC;GACjB,QAAQ,CA6FpB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {ARIAMixinStrict} from '@material/web/internal/aria/aria.js';\nimport {mixinDelegatesAria} from '@material/web/internal/aria/delegate.js';\nimport {\n internals,\n mixinElementInternals,\n} from '@material/web/labs/behaviors/element-internals.js';\nimport {hasSlotted} from '@material/web/labs/gb/components/shared/has-slotted.js';\nimport {css, CSSResultOrNative, html, LitElement, nothing} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\n\nimport focusRingStyles from '@material/web/labs/gb/components/focus/focus-ring.css' with {type: 'css'}; // github-only\n// import {styles as focusRingStyles} from '@material/web/labs/gb/components/focus/focus-ring.cssresult.js'; // google3-only\nimport rippleStyles from '@material/web/labs/gb/components/ripple/ripple.css' with {type: 'css'}; // github-only\n// import {styles as rippleStyles} from '@material/web/labs/gb/components/ripple/ripple.cssresult.js'; // google3-only\nimport listStyles from './list.css' with {type: 'css'}; // github-only\n// import {styles as listStyles} from './list.cssresult.js'; // google3-only\n\nimport {listItem} from './list.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design list item component. */\n 'md-list-item': ListItem;\n }\n}\n\n// Separate variable needed for closure.\nconst baseClass = mixinDelegatesAria(mixinElementInternals(LitElement));\n\n/**\n * A Material Design list item component.\n */\n@customElement('md-list-item')\nexport class ListItem extends baseClass {\n /** @nocollapse */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n static override styles: CSSResultOrNative[] = [\n focusRingStyles,\n rippleStyles,\n listStyles,\n css`\n :host {\n display: flex;\n align-items: center;\n }\n .list-item {\n flex: 1;\n align-items: inherit;\n }\n :is(.list-item-leading, .list-item-trailing):not(:has(.has-slotted)) {\n display: none;\n }\n slot:not(.has-slotted) {\n display: contents;\n }\n `,\n ];\n\n constructor() {\n super();\n this[internals].role = 'listitem';\n }\n\n /**\n * Whether the list item is selected.\n */\n @property({type: Boolean}) checked = false;\n\n /**\n * Whether the list item is disabled.\n */\n @property({type: Boolean}) disabled = false;\n\n /**\n * Whether the list item is non-interactive.\n */\n @property({type: Boolean, reflect: true, attribute: 'static'})\n nonInteractive = false;\n\n protected override render() {\n const state = {\n checked: this.checked,\n disabled: this.disabled,\n static: this.nonInteractive,\n };\n if (this.nonInteractive) {\n return html`<div part=\"list-item\" class=\"${listItem(state)}\"\n >${this.renderContent()}</div\n >`;\n }\n\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`<button\n part=\"list-item\"\n class=\"${listItem(state)}\"\n ?disabled=${this.disabled}\n aria-label=${ariaLabel || nothing}>\n ${this.renderContent()}\n </button>`;\n }\n\n private renderContent() {\n return html`\n <span class=\"list-item-leading\">\n <slot name=\"avatar\" class=\"list-item-avatar\" ${hasSlotted()}></slot>\n <slot name=\"leading\" ${hasSlotted()}></slot>\n </span>\n <span class=\"list-item-content\">\n <slot name=\"overline\" class=\"list-item-overline\"></slot>\n <slot></slot>\n <slot name=\"supporting-text\" class=\"list-item-supporting-text\"></slot>\n </span>\n <span class=\"list-item-trailing\">\n <slot\n name=\"trailing-text\"\n class=\"list-item-trailing-text\"\n ${hasSlotted()}></slot>\n <slot name=\"trailing\" ${hasSlotted()}></slot>\n </span>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"md-list-item.js","sourceRoot":"","sources":["md-list-item.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AACtE,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,uCAAuC,CAAC;AACzE,OAAO,EACL,SAAS,EACT,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAEpD,OAAO,eAAe,MAAM,yBAAyB,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AACxF,8FAA8F;AAC9F,OAAO,YAAY,MAAM,sBAAsB,CAAC,OAAM,I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/B,UAAU,EAAE;gCACQ,UAAU,EAAE;;KAEvC,CAAC;IACJ,CAAC;;AA3FD,kBAAkB;AACF,0BAAiB,GAAG;IAClC,GAAG,UAAU,CAAC,iBAAiB;IAC/B,cAAc,EAAE,IAAI;CACrB,AAHgC,CAG/B;AAEc,eAAM,GAAwB;IAC5C,eAAe;IACf,YAAY;IACZ,UAAU;IACV,GAAG,CAAA;;;;;;;;;;;;;;;KAeF;CACF,AApBqB,CAoBpB;AAUyB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;yCAAiB;AAKhB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;0CAAkB;AAM5C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAC,CAAC;gDACvC;AAhDZ,QAAQ;IADpB,aAAa,CAAC,cAAc,CAAC;GACjB,QAAQ,CA6FpB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {css, CSSResultOrNative, html, LitElement, nothing} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {ARIAMixinStrict} from '../../../../internal/aria/aria.js';\nimport {mixinDelegatesAria} from '../../../../internal/aria/delegate.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../../behaviors/element-internals.js';\nimport {hasSlotted} from '../shared/has-slotted.js';\n\nimport focusRingStyles from '../focus/focus-ring.css' with {type: 'css'}; // github-only\n// import {styles as focusRingStyles} from '../focus/focus-ring.cssresult.js'; // google3-only\nimport rippleStyles from '../ripple/ripple.css' with {type: 'css'}; // github-only\n// import {styles as rippleStyles} from '../ripple/ripple.cssresult.js'; // google3-only\nimport listStyles from './list.css' with {type: 'css'}; // github-only\n// import {styles as listStyles} from './list.cssresult.js'; // google3-only\n\nimport {listItem} from './list.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design list item component. */\n 'md-list-item': ListItem;\n }\n}\n\n// Separate variable needed for closure.\nconst baseClass = mixinDelegatesAria(mixinElementInternals(LitElement));\n\n/**\n * A Material Design list item component.\n */\n@customElement('md-list-item')\nexport class ListItem extends baseClass {\n /** @nocollapse */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n static override styles: CSSResultOrNative[] = [\n focusRingStyles,\n rippleStyles,\n listStyles,\n css`\n :host {\n display: flex;\n align-items: center;\n }\n .list-item {\n flex: 1;\n align-items: inherit;\n }\n :is(.list-item-leading, .list-item-trailing):not(:has(.has-slotted)) {\n display: none;\n }\n slot:not(.has-slotted) {\n display: contents;\n }\n `,\n ];\n\n constructor() {\n super();\n this[internals].role = 'listitem';\n }\n\n /**\n * Whether the list item is selected.\n */\n @property({type: Boolean}) checked = false;\n\n /**\n * Whether the list item is disabled.\n */\n @property({type: Boolean}) disabled = false;\n\n /**\n * Whether the list item is non-interactive.\n */\n @property({type: Boolean, reflect: true, attribute: 'static'})\n nonInteractive = false;\n\n protected override render() {\n const state = {\n checked: this.checked,\n disabled: this.disabled,\n static: this.nonInteractive,\n };\n if (this.nonInteractive) {\n return html`<div part=\"list-item\" class=\"${listItem(state)}\"\n >${this.renderContent()}</div\n >`;\n }\n\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`<button\n part=\"list-item\"\n class=\"${listItem(state)}\"\n ?disabled=${this.disabled}\n aria-label=${ariaLabel || nothing}>\n ${this.renderContent()}\n </button>`;\n }\n\n private renderContent() {\n return html`\n <span class=\"list-item-leading\">\n <slot name=\"avatar\" class=\"list-item-avatar\" ${hasSlotted()}></slot>\n <slot name=\"leading\" ${hasSlotted()}></slot>\n </span>\n <span class=\"list-item-content\">\n <slot name=\"overline\" class=\"list-item-overline\"></slot>\n <slot></slot>\n <slot name=\"supporting-text\" class=\"list-item-supporting-text\"></slot>\n </span>\n <span class=\"list-item-trailing\">\n <slot\n name=\"trailing-text\"\n class=\"list-item-trailing-text\"\n ${hasSlotted()}></slot>\n <slot name=\"trailing\" ${hasSlotted()}></slot>\n </span>\n `;\n }\n}\n"]}
@@ -10,7 +10,7 @@ declare global {
10
10
  'md-list': List;
11
11
  }
12
12
  }
13
- declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("@material/web/labs/behaviors/element-internals.js").WithElementInternals>;
13
+ declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("../../../behaviors/element-internals.js").WithElementInternals>;
14
14
  /**
15
15
  * A Material Design list component.
16
16
  */
@@ -4,9 +4,9 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { __decorate } from "tslib";
7
- import { internals, mixinElementInternals, } from '@material/web/labs/behaviors/element-internals.js';
8
7
  import { css, html, LitElement } from 'lit';
9
8
  import { customElement, property } from 'lit/decorators.js';
9
+ import { internals, mixinElementInternals, } from '../../../behaviors/element-internals.js';
10
10
  import listStyles from './list.css' with { type: 'css' }; // github-only
11
11
  // import {styles as listStyles} from './list.cssresult.js'; // google3-only
12
12
  import { list } from './list.js';
@@ -1 +1 @@
1
- {"version":3,"file":"md-list.js","sourceRoot":"","sources":["md-list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EACL,SAAS,EACT,qBAAqB,GACtB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE1D,OAAO,UAAU,MAAM,YAAY,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AACtE,4EAA4E;AAE5E,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAS/B,wCAAwC;AACxC,MAAM,SAAS,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAEpD;;GAEG;AAEI,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,SAAS;IAajC;QACE,KAAK,EAAE,CAAC;QAIV;;WAEG;QACwB,cAAS,GAAG,KAAK,CAAC;QAN3C,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC;IAChC,CAAC;IAOkB,MAAM;QACvB,OAAO,IAAI,CAAA,2BAA2B,IAAI,CAAC,IAAI,CAAC;;WAEzC,CAAC;IACV,CAAC;;AA1Be,WAAM,GAAwB;IAC5C,UAAU;IACV,GAAG,CAAA;;;;;;;KAOF;CACF,AAVqB,CAUpB;AAUyB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;uCAAmB;AArBlC,IAAI;IADhB,aAAa,CAAC,SAAS,CAAC;GACZ,IAAI,CA4BhB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n internals,\n mixinElementInternals,\n} from '@material/web/labs/behaviors/element-internals.js';\nimport {css, CSSResultOrNative, html, LitElement} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\n\nimport listStyles from './list.css' with {type: 'css'}; // github-only\n// import {styles as listStyles} from './list.cssresult.js'; // google3-only\n\nimport {list} from './list.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design list component. */\n 'md-list': List;\n }\n}\n\n// Separate variable needed for closure.\nconst baseClass = mixinElementInternals(LitElement);\n\n/**\n * A Material Design list component.\n */\n@customElement('md-list')\nexport class List extends baseClass {\n static override styles: CSSResultOrNative[] = [\n listStyles,\n css`\n :host {\n display: flex;\n }\n .list {\n flex: 1;\n }\n `,\n ];\n\n constructor() {\n super();\n this[internals].role = 'list';\n }\n\n /**\n * Whether to render the list with segmented items.\n */\n @property({type: Boolean}) segmented = false;\n\n protected override render() {\n return html`<div part=\"list\" class=\"${list(this)}\">\n <slot></slot>\n </div>`;\n }\n}\n"]}
1
+ {"version":3,"file":"md-list.js","sourceRoot":"","sources":["md-list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,SAAS,EACT,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,UAAU,MAAM,YAAY,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AACtE,4EAA4E;AAE5E,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAS/B,wCAAwC;AACxC,MAAM,SAAS,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAEpD;;GAEG;AAEI,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,SAAS;IAajC;QACE,KAAK,EAAE,CAAC;QAIV;;WAEG;QACwB,cAAS,GAAG,KAAK,CAAC;QAN3C,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC;IAChC,CAAC;IAOkB,MAAM;QACvB,OAAO,IAAI,CAAA,2BAA2B,IAAI,CAAC,IAAI,CAAC;;WAEzC,CAAC;IACV,CAAC;;AA1Be,WAAM,GAAwB;IAC5C,UAAU;IACV,GAAG,CAAA;;;;;;;KAOF;CACF,AAVqB,CAUpB;AAUyB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;uCAAmB;AArBlC,IAAI;IADhB,aAAa,CAAC,SAAS,CAAC;GACZ,IAAI,CA4BhB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {css, CSSResultOrNative, html, LitElement} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../../behaviors/element-internals.js';\n\nimport listStyles from './list.css' with {type: 'css'}; // github-only\n// import {styles as listStyles} from './list.cssresult.js'; // google3-only\n\nimport {list} from './list.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design list component. */\n 'md-list': List;\n }\n}\n\n// Separate variable needed for closure.\nconst baseClass = mixinElementInternals(LitElement);\n\n/**\n * A Material Design list component.\n */\n@customElement('md-list')\nexport class List extends baseClass {\n static override styles: CSSResultOrNative[] = [\n listStyles,\n css`\n :host {\n display: flex;\n }\n .list {\n flex: 1;\n }\n `,\n ];\n\n constructor() {\n super();\n this[internals].role = 'list';\n }\n\n /**\n * Whether to render the list with segmented items.\n */\n @property({type: Boolean}) segmented = false;\n\n protected override render() {\n return html`<div part=\"list\" class=\"${list(this)}\">\n <slot></slot>\n </div>`;\n }\n}\n"]}
@@ -10,7 +10,7 @@ declare global {
10
10
  'md-menu-group': MenuGroup;
11
11
  }
12
12
  }
13
- declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("@material/web/labs/behaviors/element-internals.js").WithElementInternals>;
13
+ declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("../../../behaviors/element-internals.js").WithElementInternals>;
14
14
  /**
15
15
  * A Material Design menu group component.
16
16
  */
@@ -5,9 +5,9 @@
5
5
  */
6
6
  import { __decorate } from "tslib";
7
7
  import { consume, provide } from '@lit/context';
8
- import { internals, mixinElementInternals, } from '@material/web/labs/behaviors/element-internals.js';
9
8
  import { css, html, LitElement } from 'lit';
10
9
  import { customElement, property } from 'lit/decorators.js';
10
+ import { internals, mixinElementInternals, } from '../../../behaviors/element-internals.js';
11
11
  import { menuContext, menuItemCheckable, } from './menu.js';
12
12
  // Separate variable needed for closure.
13
13
  const baseClass = mixinElementInternals(LitElement);
@@ -1 +1 @@
1
- {"version":3,"file":"md-menu-group.js","sourceRoot":"","sources":["md-menu-group.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,M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CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;wBACjD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;oBACvB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AA/Ce,gBAAM,GAAwB;IAC5C,GAAG,CAAA;;;;KAIF;CACF,AANqB,CAMpB;AAIF;IAFC,OAAO,CAAC,EAAC,OAAO,EAAE,iBAAiB,EAAC,CAAC;IACrC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;4CACiB;AAiB1B;IADhB,OAAO,CAAC,EAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;8CACO;AA5B7C,SAAS;IADrB,aAAa,CAAC,eAAe,CAAC;GAClB,SAAS,CAiDrB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {consume, provide} from '@lit/context';\nimport {\n internals,\n mixinElementInternals,\n} from '@material/web/labs/behaviors/element-internals.js';\nimport {css, CSSResultOrNative, html, LitElement} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\n\nimport {\n menuContext,\n menuItemCheckable,\n type MenuContext,\n type MenuItemCheckable,\n} from './menu.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-menu-group': MenuGroup;\n }\n}\n\n// Separate variable needed for closure.\nconst baseClass = mixinElementInternals(LitElement);\n\n/**\n * A Material Design menu group component.\n */\n@customElement('md-menu-group')\nexport class MenuGroup extends baseClass {\n static override styles: CSSResultOrNative[] = [\n css`\n :host {\n display: contents;\n }\n `,\n ];\n\n @provide({context: menuItemCheckable})\n @property({reflect: true})\n checkable: MenuItemCheckable | null = null;\n\n // TODO: add optional section label\n\n get menu(): HTMLElement | null {\n return this.menuContext?.menu || null;\n }\n\n get items(): HTMLElement[] {\n return (this.menuContext?.getItems?.() || []).filter(\n (item) =>\n this.compareDocumentPosition(item) &\n Node.DOCUMENT_POSITION_CONTAINED_BY,\n );\n }\n\n @consume({context: menuContext, subscribe: true})\n private readonly menuContext: MenuContext | null = null;\n\n constructor() {\n super();\n this[internals].role = 'none';\n this.addEventListener('change', (event: Event) => {\n if (this.checkable === 'single') {\n const composedPath = event.composedPath();\n const items = this.items as Array<HTMLElement & {checked?: boolean}>;\n for (const item of items) {\n if (!composedPath.includes(item) && item.checked) {\n item.checked = false;\n }\n }\n }\n });\n }\n\n protected override render() {\n return html`<slot></slot>`;\n }\n}\n"]}
1
+ {"version":3,"file":"md-menu-group.js","sourceRoot":"","sources":["md-menu-group.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,SAAS,EACT,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EACL,WAAW,EACX,iBAAiB,GAGlB,MAAM,WAAW,CAAC;AAQnB,wCAAwC;AACxC,MAAM,SAAS,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAEpD;;GAEG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,SAAS;IAatC,mCAAmC;IAEnC,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,IAAI,CAAC;IACxC,CAAC;IAED,IAAI,KAAK;QACP,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAClD,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC;YAClC,IAAI,CAAC,8BAA8B,CACtC,CAAC;IACJ,CAAC;IAKD;QACE,KAAK,EAAE,CAAC;QApBV,cAAS,GAA6B,IAAI,CAAC;QAiB1B,gBAAW,GAAuB,IAAI,CAAC;QAItD,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC;QAC9B,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,KAAY,EAAE,EAAE;YAC/C,IAAI,IAAI,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;gBAChC,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;gBAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAiD,CAAC;gBACrE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;oBACzB,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;wBACjD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;oBACvB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AA/Ce,gBAAM,GAAwB;IAC5C,GAAG,CAAA;;;;KAIF;CACF,AANqB,CAMpB;AAIF;IAFC,OAAO,CAAC,EAAC,OAAO,EAAE,iBAAiB,EAAC,CAAC;IACrC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;4CACiB;AAiB1B;IADhB,OAAO,CAAC,EAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;8CACO;AA5B7C,SAAS;IADrB,aAAa,CAAC,eAAe,CAAC;GAClB,SAAS,CAiDrB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {consume, provide} from '@lit/context';\nimport {css, CSSResultOrNative, html, LitElement} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../../behaviors/element-internals.js';\n\nimport {\n menuContext,\n menuItemCheckable,\n type MenuContext,\n type MenuItemCheckable,\n} from './menu.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-menu-group': MenuGroup;\n }\n}\n\n// Separate variable needed for closure.\nconst baseClass = mixinElementInternals(LitElement);\n\n/**\n * A Material Design menu group component.\n */\n@customElement('md-menu-group')\nexport class MenuGroup extends baseClass {\n static override styles: CSSResultOrNative[] = [\n css`\n :host {\n display: contents;\n }\n `,\n ];\n\n @provide({context: menuItemCheckable})\n @property({reflect: true})\n checkable: MenuItemCheckable | null = null;\n\n // TODO: add optional section label\n\n get menu(): HTMLElement | null {\n return this.menuContext?.menu || null;\n }\n\n get items(): HTMLElement[] {\n return (this.menuContext?.getItems?.() || []).filter(\n (item) =>\n this.compareDocumentPosition(item) &\n Node.DOCUMENT_POSITION_CONTAINED_BY,\n );\n }\n\n @consume({context: menuContext, subscribe: true})\n private readonly menuContext: MenuContext | null = null;\n\n constructor() {\n super();\n this[internals].role = 'none';\n this.addEventListener('change', (event: Event) => {\n if (this.checkable === 'single') {\n const composedPath = event.composedPath();\n const items = this.items as Array<HTMLElement & {checked?: boolean}>;\n for (const item of items) {\n if (!composedPath.includes(item) && item.checked) {\n item.checked = false;\n }\n }\n }\n });\n }\n\n protected override render() {\n return html`<slot></slot>`;\n }\n}\n"]}
@@ -9,7 +9,7 @@ declare global {
9
9
  'md-menu-item': MenuItem;
10
10
  }
11
11
  }
12
- declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("@material/web/labs/behaviors/focusable.js").Focusable>, import("@material/web/labs/behaviors/element-internals.js").WithElementInternals>;
12
+ declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("../../../behaviors/focusable.js").Focusable>, import("../../../behaviors/element-internals.js").WithElementInternals>;
13
13
  /**
14
14
  * A Material Design menu item component.
15
15
  */
@@ -5,16 +5,16 @@
5
5
  */
6
6
  import { __decorate } from "tslib";
7
7
  import { consume } from '@lit/context';
8
- import { afterDispatch, setupDispatchHooks, } from '@material/web/internal/events/dispatch-hooks.js';
9
- import { internals, mixinElementInternals, } from '@material/web/labs/behaviors/element-internals.js';
10
- import { isFocusable, mixinFocusable, } from '@material/web/labs/behaviors/focusable.js';
11
- import { hasSlotted } from '@material/web/labs/gb/components/shared/has-slotted.js';
12
8
  import { css, html, LitElement, nothing } from 'lit';
13
9
  import { customElement, property, state } from 'lit/decorators.js';
14
- import focusRingStyles from '@material/web/labs/gb/components/focus/focus-ring.css' with { type: 'css' }; // github-only
15
- // import focusRingStyles from '@material/web/labs/gb/components/focus/focus-ring.cssresult.js'; // google3-only
16
- import rippleStyles from '@material/web/labs/gb/components/ripple/ripple.css' with { type: 'css' }; // github-only
17
- // import rippleStyles from '@material/web/labs/gb/components/ripple/ripple.cssresult.js'; // google3-only
10
+ import { afterDispatch, setupDispatchHooks, } from '../../../../internal/events/dispatch-hooks.js';
11
+ import { internals, mixinElementInternals, } from '../../../behaviors/element-internals.js';
12
+ import { isFocusable, mixinFocusable } from '../../../behaviors/focusable.js';
13
+ import { hasSlotted } from '../shared/has-slotted.js';
14
+ import focusRingStyles from '../focus/focus-ring.css' with { type: 'css' }; // github-only
15
+ // import focusRingStyles from '../focus/focus-ring.cssresult.js'; // google3-only
16
+ import rippleStyles from '../ripple/ripple.css' with { type: 'css' }; // github-only
17
+ // import rippleStyles from '../ripple/ripple.cssresult.js'; // google3-only
18
18
  import menuStyles from './menu.css' with { type: 'css' }; // github-only
19
19
  // import {styles as menuStyles} from './menu.cssresult.js'; // google3-only
20
20
  import { menuContext, menuItem, menuItemCheckable, } from './menu.js';
@@ -1 +1 @@
1
- {"version":3,"file":"md-menu-item.js","sourceRoot":"","sources":["md-menu-item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IAAI,CAAC;QACrC,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,CAAC,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;IACrC,CAAC;;AAxIe,eAAM,GAAwB;IAC5C,eAAe;IACf,YAAY;IACZ,UAAU;IACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;KAoBF;CACF,AAzBqB,CAyBpB;AAEwC;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;yCAAiB;AAChB;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;0CAAkB;AAO1C;IADhB,OAAO,CAAC,EAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;6CACN;AAI1B;IAFhB,KAAK,EAAE;IACP,OAAO,CAAC,EAAC,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;2CACD;AAxC3C,QAAQ;IADpB,aAAa,CAAC,cAAc,CAAC;GACjB,QAAQ,CA0IpB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {consume} from '@lit/context';\nimport {\n afterDispatch,\n setupDispatchHooks,\n} from '@material/web/internal/events/dispatch-hooks.js';\nimport {\n internals,\n mixinElementInternals,\n} from '@material/web/labs/behaviors/element-internals.js';\nimport {\n isFocusable,\n mixinFocusable,\n} from '@material/web/labs/behaviors/focusable.js';\nimport {hasSlotted} from '@material/web/labs/gb/components/shared/has-slotted.js';\nimport {css, CSSResultOrNative, html, LitElement, nothing} from 'lit';\nimport {customElement, property, state} from 'lit/decorators.js';\n\nimport focusRingStyles from '@material/web/labs/gb/components/focus/focus-ring.css' with {type: 'css'}; // github-only\n// import focusRingStyles from '@material/web/labs/gb/components/focus/focus-ring.cssresult.js'; // google3-only\nimport rippleStyles from '@material/web/labs/gb/components/ripple/ripple.css' with {type: 'css'}; // github-only\n// import rippleStyles from '@material/web/labs/gb/components/ripple/ripple.cssresult.js'; // google3-only\nimport menuStyles from './menu.css' with {type: 'css'}; // github-only\n// import {styles as menuStyles} from './menu.cssresult.js'; // google3-only\n\nimport {\n menuContext,\n type MenuContext,\n menuItem,\n menuItemCheckable,\n type MenuItemCheckable,\n} from './menu.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-menu-item': MenuItem;\n }\n}\n\n// Separate variable needed for closure.\nconst baseClass = mixinElementInternals(mixinFocusable(LitElement));\n\n/**\n * A Material Design menu item component.\n */\n@customElement('md-menu-item')\nexport class MenuItem extends baseClass {\n static override styles: CSSResultOrNative[] = [\n focusRingStyles,\n rippleStyles,\n menuStyles,\n css`\n :host {\n display: flex;\n outline: none;\n }\n .menu-item {\n flex: 1;\n }\n :is(.menu-item-leading, .menu-item-trailing):not(\n :has(.has-slotted, .checkmark)\n ) {\n display: none;\n }\n slot:not(.has-slotted) {\n display: contents;\n }\n .checkmark {\n display: flex;\n font: var(--md-icon-size) var(--md-icon-font);\n }\n `,\n ];\n\n @property({type: Boolean, reflect: true}) checked = false;\n @property({type: Boolean, reflect: true}) disabled = false;\n\n get menu(): HTMLElement | null {\n return this.menuContext?.menu || null;\n }\n\n @consume({context: menuContext, subscribe: true})\n private readonly menuContext?: MenuContext;\n\n @state()\n @consume({context: menuItemCheckable, subscribe: true})\n private readonly checkable?: MenuItemCheckable | null;\n\n constructor() {\n super();\n this[internals].role = 'menuitem';\n setupDispatchHooks(this, 'click');\n this.addEventListener('click', (e) => {\n if (this.disabled) {\n e.stopImmediatePropagation();\n return;\n }\n\n const wasChecked = this.checked;\n afterDispatch(e, () => {\n if (e.defaultPrevented) return;\n if (this.checkable) {\n this.checked = !wasChecked;\n this.dispatchEvent(new Event('change', {bubbles: true}));\n this.dispatchEvent(\n new InputEvent('input', {bubbles: true, composed: true}),\n );\n }\n\n if (this.checkable !== 'multiple') {\n this.menu?.hidePopover();\n }\n });\n });\n\n this.addEventListener('keydown', (e: KeyboardEvent) => {\n if (this.disabled) return;\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n this.click();\n }\n });\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this.menuContext?.itemConnected(this);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.menuContext?.itemDisconnected(this);\n }\n\n protected override render() {\n return html`<div\n part=\"menu-item\"\n class=\"${menuItem({\n checked: this.checked,\n disabled: this.disabled,\n })} ripple-host focus-ring-host\">\n ${this.renderContent()}\n </div>`;\n }\n\n private renderContent() {\n return html`\n <span class=\"menu-item-leading\">\n <slot name=\"leading\" ${hasSlotted()}>\n ${this.checked ? html`<span class=\"checkmark\">check</span>` : nothing}\n </slot>\n </span>\n <span class=\"menu-item-content\">\n <slot></slot>\n <slot name=\"supporting-text\" class=\"menu-item-supporting-text\"></slot>\n </span>\n <span class=\"menu-item-trailing\">\n <slot\n name=\"trailing-text\"\n class=\"menu-item-trailing-text\"\n ${hasSlotted()}></slot>\n <slot name=\"trailing\" ${hasSlotted()}></slot>\n </span>\n `;\n }\n\n protected override updated() {\n if (this.checkable === 'single') {\n this[internals].role = 'menuitemradio';\n } else if (this.checkable === 'multiple') {\n this[internals].role = 'menuitemcheckbox';\n } else {\n this[internals].role = 'menuitem';\n }\n\n if (this.checkable) {\n this[internals].ariaChecked = String(this.checked);\n } else {\n this[internals].ariaChecked = null;\n }\n\n this[internals].ariaDisabled = String(this.disabled);\n this[isFocusable] = !this.disabled;\n }\n}\n"]}
1
+ {"version":3,"file":"md-menu-item.js","sourceRoot":"","sources":["md-menu-item.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAE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AW,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;IACrC,CAAC;;AAxIe,eAAM,GAAwB;IAC5C,eAAe;IACf,YAAY;IACZ,UAAU;IACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;KAoBF;CACF,AAzBqB,CAyBpB;AAEwC;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;yCAAiB;AAChB;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;0CAAkB;AAO1C;IADhB,OAAO,CAAC,EAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;6CACN;AAI1B;IAFhB,KAAK,EAAE;IACP,OAAO,CAAC,EAAC,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;2CACD;AAxC3C,QAAQ;IADpB,aAAa,CAAC,cAAc,CAAC;GACjB,QAAQ,CA0IpB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {consume} from '@lit/context';\nimport {css, CSSResultOrNative, html, LitElement, nothing} from 'lit';\nimport {customElement, property, state} from 'lit/decorators.js';\nimport {\n afterDispatch,\n setupDispatchHooks,\n} from '../../../../internal/events/dispatch-hooks.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../../behaviors/element-internals.js';\nimport {isFocusable, mixinFocusable} from '../../../behaviors/focusable.js';\nimport {hasSlotted} from '../shared/has-slotted.js';\n\nimport focusRingStyles from '../focus/focus-ring.css' with {type: 'css'}; // github-only\n// import focusRingStyles from '../focus/focus-ring.cssresult.js'; // google3-only\nimport rippleStyles from '../ripple/ripple.css' with {type: 'css'}; // github-only\n// import rippleStyles from '../ripple/ripple.cssresult.js'; // google3-only\nimport menuStyles from './menu.css' with {type: 'css'}; // github-only\n// import {styles as menuStyles} from './menu.cssresult.js'; // google3-only\n\nimport {\n menuContext,\n type MenuContext,\n menuItem,\n menuItemCheckable,\n type MenuItemCheckable,\n} from './menu.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-menu-item': MenuItem;\n }\n}\n\n// Separate variable needed for closure.\nconst baseClass = mixinElementInternals(mixinFocusable(LitElement));\n\n/**\n * A Material Design menu item component.\n */\n@customElement('md-menu-item')\nexport class MenuItem extends baseClass {\n static override styles: CSSResultOrNative[] = [\n focusRingStyles,\n rippleStyles,\n menuStyles,\n css`\n :host {\n display: flex;\n outline: none;\n }\n .menu-item {\n flex: 1;\n }\n :is(.menu-item-leading, .menu-item-trailing):not(\n :has(.has-slotted, .checkmark)\n ) {\n display: none;\n }\n slot:not(.has-slotted) {\n display: contents;\n }\n .checkmark {\n display: flex;\n font: var(--md-icon-size) var(--md-icon-font);\n }\n `,\n ];\n\n @property({type: Boolean, reflect: true}) checked = false;\n @property({type: Boolean, reflect: true}) disabled = false;\n\n get menu(): HTMLElement | null {\n return this.menuContext?.menu || null;\n }\n\n @consume({context: menuContext, subscribe: true})\n private readonly menuContext?: MenuContext;\n\n @state()\n @consume({context: menuItemCheckable, subscribe: true})\n private readonly checkable?: MenuItemCheckable | null;\n\n constructor() {\n super();\n this[internals].role = 'menuitem';\n setupDispatchHooks(this, 'click');\n this.addEventListener('click', (e) => {\n if (this.disabled) {\n e.stopImmediatePropagation();\n return;\n }\n\n const wasChecked = this.checked;\n afterDispatch(e, () => {\n if (e.defaultPrevented) return;\n if (this.checkable) {\n this.checked = !wasChecked;\n this.dispatchEvent(new Event('change', {bubbles: true}));\n this.dispatchEvent(\n new InputEvent('input', {bubbles: true, composed: true}),\n );\n }\n\n if (this.checkable !== 'multiple') {\n this.menu?.hidePopover();\n }\n });\n });\n\n this.addEventListener('keydown', (e: KeyboardEvent) => {\n if (this.disabled) return;\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n this.click();\n }\n });\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this.menuContext?.itemConnected(this);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.menuContext?.itemDisconnected(this);\n }\n\n protected override render() {\n return html`<div\n part=\"menu-item\"\n class=\"${menuItem({\n checked: this.checked,\n disabled: this.disabled,\n })} ripple-host focus-ring-host\">\n ${this.renderContent()}\n </div>`;\n }\n\n private renderContent() {\n return html`\n <span class=\"menu-item-leading\">\n <slot name=\"leading\" ${hasSlotted()}>\n ${this.checked ? html`<span class=\"checkmark\">check</span>` : nothing}\n </slot>\n </span>\n <span class=\"menu-item-content\">\n <slot></slot>\n <slot name=\"supporting-text\" class=\"menu-item-supporting-text\"></slot>\n </span>\n <span class=\"menu-item-trailing\">\n <slot\n name=\"trailing-text\"\n class=\"menu-item-trailing-text\"\n ${hasSlotted()}></slot>\n <slot name=\"trailing\" ${hasSlotted()}></slot>\n </span>\n `;\n }\n\n protected override updated() {\n if (this.checkable === 'single') {\n this[internals].role = 'menuitemradio';\n } else if (this.checkable === 'multiple') {\n this[internals].role = 'menuitemcheckbox';\n } else {\n this[internals].role = 'menuitem';\n }\n\n if (this.checkable) {\n this[internals].ariaChecked = String(this.checked);\n } else {\n this[internals].ariaChecked = null;\n }\n\n this[internals].ariaDisabled = String(this.disabled);\n this[isFocusable] = !this.disabled;\n }\n}\n"]}
@@ -11,7 +11,7 @@ declare global {
11
11
  'md-menu': Menu;
12
12
  }
13
13
  }
14
- declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("@material/web/labs/behaviors/focusable.js").Focusable>, import("@material/web/labs/behaviors/element-internals.js").WithElementInternals>;
14
+ declare const baseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<typeof LitElement, import("../../../behaviors/focusable.js").Focusable>, import("../../../behaviors/element-internals.js").WithElementInternals>;
15
15
  /**
16
16
  * A Material Design menu component.
17
17
  */
@@ -5,10 +5,10 @@
5
5
  */
6
6
  import { __decorate } from "tslib";
7
7
  import { ContextProvider } from '@lit/context';
8
- import { internals, mixinElementInternals, } from '@material/web/labs/behaviors/element-internals.js';
9
- import { mixinFocusable } from '@material/web/labs/behaviors/focusable.js';
10
8
  import { css, html, LitElement } from 'lit';
11
9
  import { customElement, property } from 'lit/decorators.js';
10
+ import { internals, mixinElementInternals, } from '../../../behaviors/element-internals.js';
11
+ import { mixinFocusable } from '../../../behaviors/focusable.js';
12
12
  import menuStyles from './menu.css' with { type: 'css' }; // github-only
13
13
  // import {styles as menuStyles} from './menu.cssresult.js'; // google3-only
14
14
  import { menu, MENU_COLORS, menuContext } from './menu.js';
@@ -1 +1 @@
1
- {"version":3,"file":"md-menu.js","sourceRoot":"","sources":["md-menu.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAC7C,OAAO,EACL,SAAS,EACT,qBAAqB,GACtB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAC,cAAc,EAAC,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAE1D,OAAO,UAAU,MAAM,YAAY,CAAC,OAAM,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,cAAc;AACtE,4EAA4E;AAE5E,OAAO,EAAC,IAAI,EAAE,WAAW,EAAE,WAAW,EAAiB,MAAM,WAAW,CAAC;AASzE,wCAAwC;AACxC,MAAM,SAAS,GAAG,qBAAqB,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;AAEpE;;GAEG;AAEI,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,SAAS;IAKjC,IAAI,KAAK;QACP,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAA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AA4C;AAEtD;IAAX,QAAQ,EAAE;mCAAyC;AAHzC,IAAI;IADhB,aAAa,CAAC,SAAS,CAAC;GACZ,IAAI,CAkIhB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {ContextProvider} from '@lit/context';\nimport {\n internals,\n mixinElementInternals,\n} from '@material/web/labs/behaviors/element-internals.js';\nimport {mixinFocusable} from '@material/web/labs/behaviors/focusable.js';\nimport {css, CSSResultOrNative, html, LitElement} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\n\nimport menuStyles from './menu.css' with {type: 'css'}; // github-only\n// import {styles as menuStyles} from './menu.cssresult.js'; // google3-only\n\nimport {menu, MENU_COLORS, menuContext, type MenuColor} from './menu.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design menu component. */\n 'md-menu': Menu;\n }\n}\n\n// Separate variable needed for closure.\nconst baseClass = mixinElementInternals(mixinFocusable(LitElement));\n\n/**\n * A Material Design menu component.\n */\n@customElement('md-menu')\nexport class Menu extends baseClass {\n static override styles: CSSResultOrNative[] = [menuStyles, css``];\n\n @property() color: MenuColor = MENU_COLORS.standard;\n\n get items(): HTMLElement[] {\n return Array.from(this.itemsSet).sort((a, b) => {\n return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_PRECEDING\n ? 1\n : -1;\n });\n }\n\n private previouslyFocused?: HTMLElement;\n private readonly itemsSet = new Set<HTMLElement>();\n\n constructor() {\n super();\n this[internals].role = 'menu';\n this.addController(\n new ContextProvider(this, {\n context: menuContext,\n initialValue: {\n menu: this,\n getItems: () => this.items,\n itemConnected: (item: HTMLElement) => {\n this.itemsSet.add(item);\n },\n itemDisconnected: (item: HTMLElement) => {\n this.itemsSet.delete(item);\n },\n },\n }),\n );\n\n // TODO: move event listeners to setupMenu()\n // Handle keyboard navigation\n this.addEventListener('keydown', (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n event.preventDefault();\n this.hidePopover();\n return;\n }\n\n const items = this.items.filter(\n (item) => !item.matches(':disabled,[disabled]'),\n );\n const index = items.findIndex((item) => item.matches(':focus-within'));\n if (index === -1 && items.length > 0) {\n // If no item is focused, focus the first one on arrow key\n if (\n [\n 'ArrowDown',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowLeft',\n 'Home',\n 'End',\n ].includes(event.key)\n ) {\n event.preventDefault();\n items[0].focus();\n }\n return;\n }\n\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowRight':\n event.preventDefault();\n if (index < items.length - 1) {\n items[index + 1].focus();\n } else {\n items[0].focus();\n }\n break;\n case 'ArrowUp':\n case 'ArrowLeft':\n event.preventDefault();\n if (index > 0) {\n items[index - 1].focus();\n } else {\n items[items.length - 1].focus();\n }\n break;\n case 'Home':\n event.preventDefault();\n items[0].focus();\n break;\n case 'End':\n event.preventDefault();\n items[items.length - 1].focus();\n break;\n default:\n break;\n }\n });\n\n // Handle focus on open\n this.addEventListener(\n 'toggle',\n (event: ToggleEvent & {source?: Element | null}) => {\n if (event.newState === 'open') {\n this.previouslyFocused = event.source as HTMLElement;\n // Focus the first non-disabled item\n setTimeout(() => {\n this.items\n .find((item) => !item.matches(':disabled,.disabled,[disabled]'))\n ?.focus();\n });\n } else {\n this.previouslyFocused?.focus();\n this.previouslyFocused = undefined;\n }\n },\n );\n }\n\n override connectedCallback() {\n super.connectedCallback();\n // Set popover behavior in connectedCallback since constructor may not\n // sprout attributes.\n this.popover = 'auto';\n }\n\n protected override render() {\n return html`<div part=\"menu\" class=\"${menu({color: this.color})} menu-host\">\n <slot></slot>\n </div>`;\n }\n}\n"]}
1
+ {"version":3,"file":"md-menu.js","sourceRoot":"","sources":["md-menu.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAC,GAAG,EAAqB,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAC7D,OAAO,EAAC,a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,CAAC;wBAChE,EAAE,KAAK,EAAE,CAAC;gBACd,CAAC,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,iBAAiB,EAAE,KAAK,EAAE,CAAC;gBAChC,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;YACrC,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;IAEQ,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,sEAAsE;QACtE,qBAAqB;QACrB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA,2BAA2B,IAAI,CAAC,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAC,CAAC;;WAExD,CAAC;IACV,CAAC;;AAhIe,WAAM,GAAwB,CAAC,UAAU,EAAE,GAAG,CAAA,EAAE,CAAC,AAA3C,CAA4C;AAEtD;IAAX,QAAQ,EAAE;mCAAyC;AAHzC,IAAI;IADhB,aAAa,CAAC,SAAS,CAAC;GACZ,IAAI,CAkIhB","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {ContextProvider} from '@lit/context';\nimport {css, CSSResultOrNative, html, LitElement} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../../behaviors/element-internals.js';\nimport {mixinFocusable} from '../../../behaviors/focusable.js';\n\nimport menuStyles from './menu.css' with {type: 'css'}; // github-only\n// import {styles as menuStyles} from './menu.cssresult.js'; // google3-only\n\nimport {menu, MENU_COLORS, menuContext, type MenuColor} from './menu.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n /** A Material Design menu component. */\n 'md-menu': Menu;\n }\n}\n\n// Separate variable needed for closure.\nconst baseClass = mixinElementInternals(mixinFocusable(LitElement));\n\n/**\n * A Material Design menu component.\n */\n@customElement('md-menu')\nexport class Menu extends baseClass {\n static override styles: CSSResultOrNative[] = [menuStyles, css``];\n\n @property() color: MenuColor = MENU_COLORS.standard;\n\n get items(): HTMLElement[] {\n return Array.from(this.itemsSet).sort((a, b) => {\n return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_PRECEDING\n ? 1\n : -1;\n });\n }\n\n private previouslyFocused?: HTMLElement;\n private readonly itemsSet = new Set<HTMLElement>();\n\n constructor() {\n super();\n this[internals].role = 'menu';\n this.addController(\n new ContextProvider(this, {\n context: menuContext,\n initialValue: {\n menu: this,\n getItems: () => this.items,\n itemConnected: (item: HTMLElement) => {\n this.itemsSet.add(item);\n },\n itemDisconnected: (item: HTMLElement) => {\n this.itemsSet.delete(item);\n },\n },\n }),\n );\n\n // TODO: move event listeners to setupMenu()\n // Handle keyboard navigation\n this.addEventListener('keydown', (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n event.preventDefault();\n this.hidePopover();\n return;\n }\n\n const items = this.items.filter(\n (item) => !item.matches(':disabled,[disabled]'),\n );\n const index = items.findIndex((item) => item.matches(':focus-within'));\n if (index === -1 && items.length > 0) {\n // If no item is focused, focus the first one on arrow key\n if (\n [\n 'ArrowDown',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowLeft',\n 'Home',\n 'End',\n ].includes(event.key)\n ) {\n event.preventDefault();\n items[0].focus();\n }\n return;\n }\n\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowRight':\n event.preventDefault();\n if (index < items.length - 1) {\n items[index + 1].focus();\n } else {\n items[0].focus();\n }\n break;\n case 'ArrowUp':\n case 'ArrowLeft':\n event.preventDefault();\n if (index > 0) {\n items[index - 1].focus();\n } else {\n items[items.length - 1].focus();\n }\n break;\n case 'Home':\n event.preventDefault();\n items[0].focus();\n break;\n case 'End':\n event.preventDefault();\n items[items.length - 1].focus();\n break;\n default:\n break;\n }\n });\n\n // Handle focus on open\n this.addEventListener(\n 'toggle',\n (event: ToggleEvent & {source?: Element | null}) => {\n if (event.newState === 'open') {\n this.previouslyFocused = event.source as HTMLElement;\n // Focus the first non-disabled item\n setTimeout(() => {\n this.items\n .find((item) => !item.matches(':disabled,.disabled,[disabled]'))\n ?.focus();\n });\n } else {\n this.previouslyFocused?.focus();\n this.previouslyFocused = undefined;\n }\n },\n );\n }\n\n override connectedCallback() {\n super.connectedCallback();\n // Set popover behavior in connectedCallback since constructor may not\n // sprout attributes.\n this.popover = 'auto';\n }\n\n protected override render() {\n return html`<div part=\"menu\" class=\"${menu({color: this.color})} menu-host\">\n <slot></slot>\n </div>`;\n }\n}\n"]}
@@ -60,7 +60,7 @@ export declare function setupMenu(menu: HTMLElement, opts?: {
60
60
  * html`<div class="${menu()}">TODO: add examples</div>`;
61
61
  * ```
62
62
  */
63
- export declare const menu: (state?: MenuClassesState & import("@material/web/labs/gb/components/shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
63
+ export declare const menu: (state?: MenuClassesState & import("../shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
64
64
  /** Whether a group of menu items are single or multiple selectable. */
65
65
  export type MenuItemCheckable = 'single' | 'multiple';
66
66
  /** Context provided to menu items for the checkable state of a menu item group. */
@@ -114,4 +114,4 @@ export declare function setupMenuItem(menuItem: HTMLElement, opts?: {
114
114
  * html`<div class="${menuItem()}">TODO: add examples</div>`;
115
115
  * ```
116
116
  */
117
- export declare const menuItem: (state?: MenuItemClassesState & import("@material/web/labs/gb/components/shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
117
+ export declare const menuItem: (state?: MenuItemClassesState & import("../shared/directives.js").AdditionalClasses) => import("lit-html/directive.js").DirectiveResult;
@@ -4,10 +4,10 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { createContext } from '@lit/context';
7
- import { FOCUS_RING_TYPES, focusRingClasses, } from '@material/web/labs/gb/components/focus/focus-ring.js';
8
- import { rippleClasses, setupRipple, } from '@material/web/labs/gb/components/ripple/ripple.js';
9
- import { createClassMapDirective } from '@material/web/labs/gb/components/shared/directives.js';
10
- import { PSEUDO_CLASSES } from '@material/web/labs/gb/components/shared/pseudo-classes.js';
7
+ import { FOCUS_RING_TYPES, focusRingClasses } from '../focus/focus-ring.js';
8
+ import { rippleClasses, setupRipple } from '../ripple/ripple.js';
9
+ import { createClassMapDirective } from '../shared/directives.js';
10
+ import { PSEUDO_CLASSES } from '../shared/pseudo-classes.js';
11
11
  /** Menu context to provide to menu items. */
12
12
  export const menuContext = createContext(Symbol('menuContext'));
13
13
  /** Menu color configurations. */
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","sourceRoot":"","sources":["menu.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,aAAa,EACb,WAAW,GACZ,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAC,uBAAuB,EAAC,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EAAC,cAAc,EAAC,MAAM,2DAA2D,CAAC;AAezF,6CAA6C;AAC7C,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAc,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;AAK7E,iCAAiC;AACjC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,oBAAoB;AACpB,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,cAAc;CACnB,CAAC;AAQX;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAAC,KAAK,KAAsB,EAAE;IACxD,OAAO;QACL,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI;QACzB,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,KAAK,KAAK,WAAW,CAAC,OAAO;KAC1D,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vC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,QAAqB,EACrB,IAA6B;IAE7B,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,uBAAuB,CAAC;IAC9C,UAAU,EAAE,eAAe;IAC3B,YAAY,EAAE,aAAa;CAC5B,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {createContext} from '@lit/context';\nimport {\n FOCUS_RING_TYPES,\n focusRingClasses,\n} from '@material/web/labs/gb/components/focus/focus-ring.js';\nimport {\n rippleClasses,\n setupRipple,\n} from '@material/web/labs/gb/components/ripple/ripple.js';\nimport {createClassMapDirective} from '@material/web/labs/gb/components/shared/directives.js';\nimport {PSEUDO_CLASSES} from '@material/web/labs/gb/components/shared/pseudo-classes.js';\nimport {type ClassInfo} from 'lit/directives/class-map.js';\n\n/** Menu context provided to menu items. */\nexport interface MenuContext {\n /** The item's parent menu. */\n readonly menu: HTMLElement;\n /** Returns the menu's items. */\n getItems: () => HTMLElement[];\n /** Callback for menu items to register themselves with the menu. */\n itemConnected(item: HTMLElement): void;\n /** Callback for menu items to unregister themselves with the menu. */\n itemDisconnected(item: HTMLElement): void;\n}\n\n/** Menu context to provide to menu items. */\nexport const menuContext = createContext<MenuContext>(Symbol('menuContext'));\n\n/** Menu color configuration types. */\nexport type MenuColor = 'standard' | 'vibrant';\n\n/** Menu color configurations. */\nexport const MENU_COLORS = {\n standard: 'standard',\n vibrant: 'vibrant',\n} as const;\n\n/** Menu classes. */\nexport const MENU_CLASSES = {\n menu: 'menu',\n menuVibrant: 'menu-vibrant',\n} as const;\n\n/** The state provided to the `menuClasses()` function. */\nexport interface MenuClassesState {\n /** The color of the menu. */\n color?: MenuColor;\n}\n\n/**\n * Returns the menu classes to apply to an element based on the given state.\n *\n * @param state The state of the menu.\n * @return An object of class names and truthy values if they apply.\n */\nexport function menuClasses({color}: MenuClassesState = {}): ClassInfo {\n return {\n [MENU_CLASSES.menu]: true,\n [MENU_CLASSES.menuVibrant]: color === MENU_COLORS.vibrant,\n };\n}\n\n/**\n * Sets up menu functionality for the given element.\n *\n * @param menu The element on which to set up menu functionality.\n * @param opts Setup options, supports a cleanup `signal`.\n */\nexport function setupMenu(\n menu: HTMLElement,\n opts?: {signal?: AbortSignal},\n): void {\n // TODO: add event listeners from <md-menu>\n}\n\n/**\n * A Lit directive that adds menu styling and functionality to its element.\n *\n * @example\n * ```ts\n * html`<div class=\"${menu()}\">TODO: add examples</div>`;\n * ```\n */\nexport const menu = createClassMapDirective({\n getClasses: menuClasses,\n setupElement: setupMenu,\n});\n\n/** Whether a group of menu items are single or multiple selectable. */\nexport type MenuItemCheckable = 'single' | 'multiple';\n\n/** Context provided to menu items for the checkable state of a menu item group. */\nexport const menuItemCheckable = createContext<MenuItemCheckable | null>(\n Symbol('menuItemCheckable'),\n);\n\n/** Menu item classes. */\nexport const MENU_ITEM_CLASSES = {\n menuItem: 'menu-item',\n checked: PSEUDO_CLASSES.checked,\n hover: PSEUDO_CLASSES.hover,\n focus: PSEUDO_CLASSES.focus,\n active: PSEUDO_CLASSES.active,\n disabled: PSEUDO_CLASSES.disabled,\n} as const;\n\n/** The state provided to the `menuItemClasses()` function. */\nexport interface MenuItemClassesState {\n /** Emulates `:checked`. */\n checked?: boolean;\n /** Emulates `:hover`. */\n hover?: boolean;\n /** Emulates `:focus`. */\n focus?: boolean;\n /** Emulates `:active`. */\n active?: boolean;\n /** Emulates `:disabled`. */\n disabled?: boolean;\n}\n\n/**\n * Returns the menu item classes to apply to an element based on the given\n * state.\n *\n * @param state The state of the menu item.\n * @return An object of class names and truthy values if they apply.\n */\nexport function menuItemClasses({\n checked = false,\n hover = false,\n focus = false,\n active = false,\n disabled = false,\n}: MenuItemClassesState = {}): ClassInfo {\n return {\n ...rippleClasses(),\n ...focusRingClasses({type: FOCUS_RING_TYPES.inner}),\n [MENU_ITEM_CLASSES.menuItem]: true,\n [MENU_ITEM_CLASSES.checked]: checked,\n [MENU_ITEM_CLASSES.hover]: hover,\n [MENU_ITEM_CLASSES.focus]: focus,\n [MENU_ITEM_CLASSES.active]: active,\n [MENU_ITEM_CLASSES.disabled]: disabled,\n };\n}\n\n/**\n * Sets up menu item functionality for the given element.\n *\n * @param menuItem The element on which to set up menu item functionality.\n * @param opts Setup options, supports a cleanup `signal`.\n */\nexport function setupMenuItem(\n menuItem: HTMLElement,\n opts?: {signal?: AbortSignal},\n): void {\n setupRipple(menuItem, opts);\n}\n\n/**\n * A Lit directive that adds menu item styling and functionality to its element.\n *\n * @example\n * ```ts\n * html`<div class=\"${menuItem()}\">TODO: add examples</div>`;\n * ```\n */\nexport const menuItem = createClassMapDirective({\n getClasses: menuItemClasses,\n setupElement: setupMenuItem,\n});\n"]}
1
+ {"version":3,"file":"menu.js","sourceRoot":"","sources":["menu.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAC,aAAa,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAC,uBAAuB,EAAC,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAc3D,6CAA6C;AAC7C,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAc,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;AAK7E,iCAAiC;AACjC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,oBAAoB;AACpB,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ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iB,CAAC,OAAO,CAAC,EAAE,OAAO;QACpC,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,KAAK;QAChC,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,KAAK;QAChC,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM;QAClC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,QAAQ;KACvC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,QAAqB,EACrB,IAA6B;IAE7B,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,uBAAuB,CAAC;IAC9C,UAAU,EAAE,eAAe;IAC3B,YAAY,EAAE,aAAa;CAC5B,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2026 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {createContext} from '@lit/context';\nimport {type ClassInfo} from 'lit/directives/class-map.js';\nimport {FOCUS_RING_TYPES, focusRingClasses} from '../focus/focus-ring.js';\nimport {rippleClasses, setupRipple} from '../ripple/ripple.js';\nimport {createClassMapDirective} from '../shared/directives.js';\nimport {PSEUDO_CLASSES} from '../shared/pseudo-classes.js';\n\n/** Menu context provided to menu items. */\nexport interface MenuContext {\n /** The item's parent menu. */\n readonly menu: HTMLElement;\n /** Returns the menu's items. */\n getItems: () => HTMLElement[];\n /** Callback for menu items to register themselves with the menu. */\n itemConnected(item: HTMLElement): void;\n /** Callback for menu items to unregister themselves with the menu. */\n itemDisconnected(item: HTMLElement): void;\n}\n\n/** Menu context to provide to menu items. */\nexport const menuContext = createContext<MenuContext>(Symbol('menuContext'));\n\n/** Menu color configuration types. */\nexport type MenuColor = 'standard' | 'vibrant';\n\n/** Menu color configurations. */\nexport const MENU_COLORS = {\n standard: 'standard',\n vibrant: 'vibrant',\n} as const;\n\n/** Menu classes. */\nexport const MENU_CLASSES = {\n menu: 'menu',\n menuVibrant: 'menu-vibrant',\n} as const;\n\n/** The state provided to the `menuClasses()` function. */\nexport interface MenuClassesState {\n /** The color of the menu. */\n color?: MenuColor;\n}\n\n/**\n * Returns the menu classes to apply to an element based on the given state.\n *\n * @param state The state of the menu.\n * @return An object of class names and truthy values if they apply.\n */\nexport function menuClasses({color}: MenuClassesState = {}): ClassInfo {\n return {\n [MENU_CLASSES.menu]: true,\n [MENU_CLASSES.menuVibrant]: color === MENU_COLORS.vibrant,\n };\n}\n\n/**\n * Sets up menu functionality for the given element.\n *\n * @param menu The element on which to set up menu functionality.\n * @param opts Setup options, supports a cleanup `signal`.\n */\nexport function setupMenu(\n menu: HTMLElement,\n opts?: {signal?: AbortSignal},\n): void {\n // TODO: add event listeners from <md-menu>\n}\n\n/**\n * A Lit directive that adds menu styling and functionality to its element.\n *\n * @example\n * ```ts\n * html`<div class=\"${menu()}\">TODO: add examples</div>`;\n * ```\n */\nexport const menu = createClassMapDirective({\n getClasses: menuClasses,\n setupElement: setupMenu,\n});\n\n/** Whether a group of menu items are single or multiple selectable. */\nexport type MenuItemCheckable = 'single' | 'multiple';\n\n/** Context provided to menu items for the checkable state of a menu item group. */\nexport const menuItemCheckable = createContext<MenuItemCheckable | null>(\n Symbol('menuItemCheckable'),\n);\n\n/** Menu item classes. */\nexport const MENU_ITEM_CLASSES = {\n menuItem: 'menu-item',\n checked: PSEUDO_CLASSES.checked,\n hover: PSEUDO_CLASSES.hover,\n focus: PSEUDO_CLASSES.focus,\n active: PSEUDO_CLASSES.active,\n disabled: PSEUDO_CLASSES.disabled,\n} as const;\n\n/** The state provided to the `menuItemClasses()` function. */\nexport interface MenuItemClassesState {\n /** Emulates `:checked`. */\n checked?: boolean;\n /** Emulates `:hover`. */\n hover?: boolean;\n /** Emulates `:focus`. */\n focus?: boolean;\n /** Emulates `:active`. */\n active?: boolean;\n /** Emulates `:disabled`. */\n disabled?: boolean;\n}\n\n/**\n * Returns the menu item classes to apply to an element based on the given\n * state.\n *\n * @param state The state of the menu item.\n * @return An object of class names and truthy values if they apply.\n */\nexport function menuItemClasses({\n checked = false,\n hover = false,\n focus = false,\n active = false,\n disabled = false,\n}: MenuItemClassesState = {}): ClassInfo {\n return {\n ...rippleClasses(),\n ...focusRingClasses({type: FOCUS_RING_TYPES.inner}),\n [MENU_ITEM_CLASSES.menuItem]: true,\n [MENU_ITEM_CLASSES.checked]: checked,\n [MENU_ITEM_CLASSES.hover]: hover,\n [MENU_ITEM_CLASSES.focus]: focus,\n [MENU_ITEM_CLASSES.active]: active,\n [MENU_ITEM_CLASSES.disabled]: disabled,\n };\n}\n\n/**\n * Sets up menu item functionality for the given element.\n *\n * @param menuItem The element on which to set up menu item functionality.\n * @param opts Setup options, supports a cleanup `signal`.\n */\nexport function setupMenuItem(\n menuItem: HTMLElement,\n opts?: {signal?: AbortSignal},\n): void {\n setupRipple(menuItem, opts);\n}\n\n/**\n * A Lit directive that adds menu item styling and functionality to its element.\n *\n * @example\n * ```ts\n * html`<div class=\"${menuItem()}\">TODO: add examples</div>`;\n * ```\n */\nexport const menuItem = createClassMapDirective({\n getClasses: menuItemClasses,\n setupElement: setupMenuItem,\n});\n"]}
@@ -3,17 +3,17 @@
3
3
  * Copyright 2026 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { createValidator, getValidityAnchor } from '@material/web/labs/behaviors/constraint-validation.js';
7
- import { getFormState, getFormValue } from '@material/web/labs/behaviors/form-associated.js';
8
- import { RadioValidator } from '@material/web/labs/behaviors/validators/radio-validator.js';
9
6
  import { CSSResultOrNative, LitElement } from 'lit';
7
+ import { createValidator, getValidityAnchor } from '../../../behaviors/constraint-validation.js';
8
+ import { getFormState, getFormValue } from '../../../behaviors/form-associated.js';
9
+ import { RadioValidator } from '../../../behaviors/validators/radio-validator.js';
10
10
  declare global {
11
11
  interface HTMLElementTagNameMap {
12
12
  /** A Material Design radio component. */
13
13
  'md-radio': Radio;
14
14
  }
15
15
  }
16
- declare const radioBaseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<(abstract new (...args: any[]) => import("@material/web/labs/behaviors/element-internals.js").WithElementInternals) & (abstract new (...args: any[]) => import("@material/web/labs/behaviors/focusable.js").Focusable) & typeof LitElement & import("@material/web/labs/behaviors/form-associated.js").FormAssociatedConstructor, import("@material/web/labs/behaviors/form-associated.js").FormAssociated>, import("@material/web/labs/behaviors/constraint-validation.js").ConstraintValidation>;
16
+ declare const radioBaseClass: import("@material/web/labs/behaviors/mixin.js").MixinReturn<import("@material/web/labs/behaviors/mixin.js").MixinReturn<(abstract new (...args: any[]) => import("../../../behaviors/element-internals.js").WithElementInternals) & (abstract new (...args: any[]) => import("../../../behaviors/focusable.js").Focusable) & typeof LitElement & import("../../../behaviors/form-associated.js").FormAssociatedConstructor, import("../../../behaviors/form-associated.js").FormAssociated>, import("../../../behaviors/constraint-validation.js").ConstraintValidation>;
17
17
  /**
18
18
  * A Material Design radio component.
19
19
  */
@@ -4,19 +4,19 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { __decorate } from "tslib";
7
- import { afterDispatch, setupDispatchHooks, } from '@material/web/internal/events/dispatch-hooks.js';
8
- import { createValidator, getValidityAnchor, mixinConstraintValidation, } from '@material/web/labs/behaviors/constraint-validation.js';
9
- import { internals, mixinElementInternals, } from '@material/web/labs/behaviors/element-internals.js';
10
- import { mixinFocusable } from '@material/web/labs/behaviors/focusable.js';
11
- import { getFormState, getFormValue, mixinFormAssociated, } from '@material/web/labs/behaviors/form-associated.js';
12
- import { RadioValidator } from '@material/web/labs/behaviors/validators/radio-validator.js';
13
- import { SingleSelectionController } from '@material/web/radio/internal/single-selection-controller.js';
14
7
  import { css, html, isServer, LitElement } from 'lit';
15
8
  import { customElement, property, query, state } from 'lit/decorators.js';
16
- import focusRingStyles from '@material/web/labs/gb/components/focus/focus-ring.css' with { type: 'css' }; // github-only
17
- // import focusRingStyles from '@material/web/labs/gb/components/focus/focus-ring.cssresult.js'; // google3-only
18
- import rippleStyles from '@material/web/labs/gb/components/ripple/ripple.css' with { type: 'css' }; // github-only
19
- // import rippleStyles from '@material/web/labs/gb/components/ripple/ripple.cssresult.js'; // google3-only
9
+ import { afterDispatch, setupDispatchHooks, } from '../../../../internal/events/dispatch-hooks.js';
10
+ import { SingleSelectionController } from '../../../../radio/internal/single-selection-controller.js';
11
+ import { createValidator, getValidityAnchor, mixinConstraintValidation, } from '../../../behaviors/constraint-validation.js';
12
+ import { internals, mixinElementInternals, } from '../../../behaviors/element-internals.js';
13
+ import { mixinFocusable } from '../../../behaviors/focusable.js';
14
+ import { getFormState, getFormValue, mixinFormAssociated, } from '../../../behaviors/form-associated.js';
15
+ import { RadioValidator } from '../../../behaviors/validators/radio-validator.js';
16
+ import focusRingStyles from '../focus/focus-ring.css' with { type: 'css' }; // github-only
17
+ // import focusRingStyles from '../focus/focus-ring.cssresult.js'; // google3-only
18
+ import rippleStyles from '../ripple/ripple.css' with { type: 'css' }; // github-only
19
+ // import rippleStyles from '../ripple/ripple.cssresult.js'; // google3-only
20
20
  import radioStyles from './radio.css' with { type: 'css' }; // github-only
21
21
  // import {styles as radioStyles} from './radio.cssresult.js'; // google3-only
22
22
  import { radio } from './radio.js';