@material/web 1.1.0 → 1.1.2-nightly.035d155.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 (109) hide show
  1. package/README.md +1 -0
  2. package/button/internal/button.js +1 -1
  3. package/button/internal/button.js.map +1 -1
  4. package/checkbox/internal/checkbox.js +2 -1
  5. package/checkbox/internal/checkbox.js.map +1 -1
  6. package/chips/internal/filter-chip.js +1 -1
  7. package/chips/internal/filter-chip.js.map +1 -1
  8. package/dialog/internal/dialog.d.ts +3 -6
  9. package/dialog/internal/dialog.js +57 -6
  10. package/dialog/internal/dialog.js.map +1 -1
  11. package/field/internal/field.js +7 -2
  12. package/field/internal/field.js.map +1 -1
  13. package/internal/events/dispatch-hooks.d.ts +85 -0
  14. package/internal/events/dispatch-hooks.js +151 -0
  15. package/internal/events/dispatch-hooks.js.map +1 -0
  16. package/internal/{controller/events.d.ts → events/form-label-activation.d.ts} +0 -22
  17. package/internal/{controller/events.js → events/form-label-activation.js} +1 -35
  18. package/internal/events/form-label-activation.js.map +1 -0
  19. package/internal/events/redispatch-event.d.ts +27 -0
  20. package/internal/events/redispatch-event.js +40 -0
  21. package/internal/events/redispatch-event.js.map +1 -0
  22. package/labs/badge/internal/badge.d.ts +1 -1
  23. package/labs/badge/internal/badge.js +1 -1
  24. package/labs/badge/internal/badge.js.map +1 -1
  25. package/labs/behaviors/form-associated.js +31 -11
  26. package/labs/behaviors/form-associated.js.map +1 -1
  27. package/labs/behaviors/validators/text-field-validator.js +12 -4
  28. package/labs/behaviors/validators/text-field-validator.js.map +1 -1
  29. package/labs/card/internal/_outlined-card.scss +3 -2
  30. package/labs/card/internal/_shared.scss +18 -4
  31. package/labs/card/internal/card.js +2 -1
  32. package/labs/card/internal/card.js.map +1 -1
  33. package/labs/card/internal/outlined-styles.css.js +1 -1
  34. package/labs/card/internal/outlined-styles.css.js.map +1 -1
  35. package/labs/card/internal/shared-styles.css.js +1 -1
  36. package/labs/card/internal/shared-styles.css.js.map +1 -1
  37. package/labs/navigationbar/internal/navigation-bar.d.ts +1 -1
  38. package/labs/navigationbar/internal/navigation-bar.js +1 -1
  39. package/labs/navigationbar/internal/navigation-bar.js.map +1 -1
  40. package/labs/navigationdrawer/internal/_navigation-drawer-modal.scss +1 -1
  41. package/labs/navigationdrawer/internal/_navigation-drawer.scss +1 -1
  42. package/labs/navigationdrawer/internal/navigation-drawer-modal.d.ts +1 -1
  43. package/labs/navigationdrawer/internal/navigation-drawer-modal.js +1 -1
  44. package/labs/navigationdrawer/internal/navigation-drawer-modal.js.map +1 -1
  45. package/labs/navigationdrawer/internal/navigation-drawer.d.ts +1 -1
  46. package/labs/navigationdrawer/internal/navigation-drawer.js +1 -1
  47. package/labs/navigationdrawer/internal/navigation-drawer.js.map +1 -1
  48. package/labs/navigationtab/internal/navigation-tab.d.ts +1 -1
  49. package/labs/navigationtab/internal/navigation-tab.js +2 -2
  50. package/labs/navigationtab/internal/navigation-tab.js.map +1 -1
  51. package/labs/navigationtab/internal/state.d.ts +0 -6
  52. package/labs/navigationtab/internal/state.js.map +1 -1
  53. package/labs/segmentedbutton/internal/_outlined-segmented-button.scss +2 -2
  54. package/labs/segmentedbutton/internal/_shared.scss +1 -1
  55. package/labs/segmentedbutton/internal/outlined-segmented-button.d.ts +1 -1
  56. package/labs/segmentedbutton/internal/outlined-segmented-button.js +1 -1
  57. package/labs/segmentedbutton/internal/outlined-segmented-button.js.map +1 -1
  58. package/labs/segmentedbuttonset/internal/outlined-segmented-button-set.d.ts +1 -1
  59. package/labs/segmentedbuttonset/internal/outlined-segmented-button-set.js +1 -1
  60. package/labs/segmentedbuttonset/internal/outlined-segmented-button-set.js.map +1 -1
  61. package/menu/internal/_menu.scss +1 -0
  62. package/menu/internal/menu-styles.css.js +1 -1
  63. package/menu/internal/menu-styles.css.js.map +1 -1
  64. package/package.json +23 -9
  65. package/progress/internal/_linear-progress.scss +6 -4
  66. package/progress/internal/linear-progress-styles.css.js +1 -1
  67. package/progress/internal/linear-progress-styles.css.js.map +1 -1
  68. package/progress/internal/linear-progress.js +4 -1
  69. package/progress/internal/linear-progress.js.map +1 -1
  70. package/radio/internal/radio.js +1 -1
  71. package/radio/internal/radio.js.map +1 -1
  72. package/ripple/internal/ripple.js +11 -0
  73. package/ripple/internal/ripple.js.map +1 -1
  74. package/select/internal/_shared.scss +10 -1
  75. package/select/internal/select.d.ts +7 -1
  76. package/select/internal/select.js +68 -26
  77. package/select/internal/select.js.map +1 -1
  78. package/select/internal/selectoption/select-option.d.ts +26 -1
  79. package/select/internal/selectoption/select-option.js.map +1 -1
  80. package/select/internal/selectoption/selectOptionController.d.ts +2 -26
  81. package/select/internal/selectoption/selectOptionController.js.map +1 -1
  82. package/select/internal/shared-styles.css.js +1 -1
  83. package/select/internal/shared-styles.css.js.map +1 -1
  84. package/select/internal/shared.d.ts +1 -1
  85. package/select/internal/shared.js.map +1 -1
  86. package/select/select-option.d.ts +1 -0
  87. package/select/select-option.js.map +1 -1
  88. package/slider/internal/_slider.scss +31 -33
  89. package/slider/internal/slider-styles.css.js +1 -1
  90. package/slider/internal/slider-styles.css.js.map +1 -1
  91. package/slider/internal/slider.js +2 -1
  92. package/slider/internal/slider.js.map +1 -1
  93. package/switch/internal/switch.js +2 -1
  94. package/switch/internal/switch.js.map +1 -1
  95. package/tabs/internal/_tab.scss +7 -5
  96. package/tabs/internal/tab-styles.css.js +1 -1
  97. package/tabs/internal/tab-styles.css.js.map +1 -1
  98. package/textfield/internal/_input.scss +1 -1
  99. package/textfield/internal/shared-styles.css.js +1 -1
  100. package/textfield/internal/shared-styles.css.js.map +1 -1
  101. package/textfield/internal/text-field.d.ts +26 -0
  102. package/textfield/internal/text-field.js +35 -5
  103. package/textfield/internal/text-field.js.map +1 -1
  104. package/tokens/_md-comp-elevated-button.scss +1 -1
  105. package/tokens/_md-comp-filled-button.scss +1 -1
  106. package/tokens/_md-comp-filled-tonal-button.scss +1 -1
  107. package/tokens/_md-comp-outlined-button.scss +1 -1
  108. package/tokens/_md-comp-text-button.scss +1 -1
  109. package/internal/controller/events.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"text-field-validator.js","sourceRoot":"","sources":["text-field-validator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAoGzC;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,SAAyB;IAI5C,eAAe,CAAC,EAAC,KAAK,EAAE,eAAe,EAAiB;QACzE,IAAI,eAAe,GAAG,eAAe,CAAC;QACtC,IAAI,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE;YAC3C,mCAAmC;YACnC,eAAe,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACvE,4CAA4C;YAC5C,IAAI,CAAC,YAAY,GAAG,eAAe,CAAC;SACrC;aAAM,IAAI,CAAC,eAAe,EAAE;YAC3B,sCAAsC;YACtC,eAAe;gBACb,IAAI,CAAC,eAAe,IAAI,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC7D,+CAA+C;YAC/C,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;SACxC;QAED,sEAAsE;QACtE,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;YAC/B,CAAC,CAAE,eAAoC;YACvC,CAAC,CAAC,IAAI,CAAC;QAET,uEAAuE;QACvE,IAAI,KAAK,EAAE;YACT,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;SACzB;QAED,IAAI,eAAe,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,EAAE;YACzC,0EAA0E;YAC1E,yEAAyE;YACzE,0EAA0E;YAC1E,+DAA+D;YAC/D,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;SACrC;QAED,eAAe,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;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AAI,CAAC,eAAe,CAAC,KAAK,CAAC;YAC9B,IAAI;YACJ,OAAO;YACP,GAAG;YACH,GAAG;YACH,IAAI;SACL,CAAC;IACJ,CAAC;IAEO,YAAY,CAAC,KAAoB;QACvC,OAAO;YACL,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC;YAC9B,IAAI,EAAE,KAAK,CAAC,IAAI;SACjB,CAAC;IACJ,CAAC;IAEO,eAAe,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,SAAS,GACmB;QAC5B,OAAO,EAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAC,CAAC;IACjD,CAAC;CACF;AAED,SAAS,YAAY,CAAC,KAAiC;IACrD,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;AACnC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {Validator} from './validator.js';\n\n/**\n * Constraint validation for a text field.\n */\nexport interface TextFieldState {\n /**\n * The input or textarea state to validate.\n */\n state: InputState | TextAreaState;\n\n /**\n * The `<input>` or `<textarea>` that is rendered on the page.\n *\n * `minlength` and `maxlength` validation do not apply until a user has\n * interacted with the control and the element is internally marked as dirty.\n * This is a spec quirk, the two properties behave differently from other\n * constraint validation.\n *\n * This means we need an actual rendered element instead of a virtual one,\n * since the virtual element will never be marked as dirty.\n *\n * This can be `null` if the element has not yet rendered, and the validator\n * will fall back to virtual elements for other constraint validation\n * properties, which do apply even if the control is not dirty.\n */\n renderedControl: HTMLInputElement | HTMLTextAreaElement | null;\n}\n\n/**\n * Constraint validation properties for an `<input>`.\n */\nexport interface InputState extends SharedInputAndTextAreaState {\n /**\n * The `<input>` type.\n *\n * Not all constraint validation properties apply to every type. See\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation#validation-related_attributes\n * for which properties will apply to which types.\n */\n readonly type: string;\n\n /**\n * The regex pattern a value must match.\n */\n readonly pattern: string;\n\n /**\n * The minimum value.\n */\n readonly min: string;\n\n /**\n * The maximum value.\n */\n readonly max: string;\n\n /**\n * The step interval of the value.\n */\n readonly step: string;\n}\n\n/**\n * Constraint validation properties for a `<textarea>`.\n */\nexport interface TextAreaState extends SharedInputAndTextAreaState {\n /**\n * The type, must be \"textarea\" to inform the validator to use `<textarea>`\n * instead of `<input>`.\n */\n readonly type: 'textarea';\n}\n\n/**\n * Constraint validation properties shared between an `<input>` and\n * `<textarea>`.\n */\ninterface SharedInputAndTextAreaState {\n /**\n * The current value.\n */\n readonly value: string;\n\n /**\n * Whether the textarea is required.\n */\n readonly required: boolean;\n\n /**\n * The minimum length of the value.\n */\n readonly minLength: number;\n\n /**\n * The maximum length of the value.\n */\n readonly maxLength: number;\n}\n\n/**\n * A validator that provides constraint validation that emulates `<input>` and\n * `<textarea>` validation.\n */\nexport class TextFieldValidator extends Validator<TextFieldState> {\n private inputControl?: HTMLInputElement;\n private textAreaControl?: HTMLTextAreaElement;\n\n protected override computeValidity({state, renderedControl}: TextFieldState) {\n let inputOrTextArea = renderedControl;\n if (isInputState(state) && !inputOrTextArea) {\n // Get cached <input> or create it.\n inputOrTextArea = this.inputControl || document.createElement('input');\n // Cache the <input> to re-use it next time.\n this.inputControl = inputOrTextArea;\n } else if (!inputOrTextArea) {\n // Get cached <textarea> or create it.\n inputOrTextArea =\n this.textAreaControl || document.createElement('textarea');\n // Cache the <textarea> to re-use it next time.\n this.textAreaControl = inputOrTextArea;\n }\n\n // Set this variable so we can check it for input-specific properties.\n const input = isInputState(state)\n ? (inputOrTextArea as HTMLInputElement)\n : null;\n\n // Set input's \"type\" first, since this can change the other properties\n if (input) {\n input.type = state.type;\n }\n\n if (inputOrTextArea.value !== state.value) {\n // Only programmatically set the value if there's a difference. When using\n // the rendered control, the value will always be up to date. Setting the\n // property (even if it's the same string) will reset the internal <input>\n // dirty flag, making minlength and maxlength validation reset.\n inputOrTextArea.value = state.value;\n }\n\n inputOrTextArea.required = state.required;\n\n // The following IDLAttribute properties will always hydrate an attribute,\n // even if set to a the default value ('' or -1). The presence of the\n // attribute triggers constraint validation, so we must remove the attribute\n // when empty.\n if (input) {\n const inputState = state as InputState;\n if (inputState.pattern) {\n input.pattern = inputState.pattern;\n } else {\n input.removeAttribute('pattern');\n }\n\n if (inputState.min) {\n input.min = inputState.min;\n } else {\n input.removeAttribute('min');\n }\n\n if (inputState.max) {\n input.max = inputState.max;\n } else {\n input.removeAttribute('max');\n }\n\n if (inputState.step) {\n input.step = inputState.step;\n } else {\n input.removeAttribute('step');\n }\n }\n\n // Use -1 to represent no minlength and maxlength, which is what the\n // platform input returns. However, it will throw an error if you try to\n // manually set it to -1.\n if (state.minLength > -1) {\n inputOrTextArea.minLength = state.minLength;\n } else {\n inputOrTextArea.removeAttribute('minlength');\n }\n\n if (state.maxLength > -1) {\n inputOrTextArea.maxLength = state.maxLength;\n } else {\n inputOrTextArea.removeAttribute('maxlength');\n }\n\n return {\n validity: inputOrTextArea.validity,\n validationMessage: inputOrTextArea.validationMessage,\n };\n }\n\n protected override equals(\n {state: prev}: TextFieldState,\n {state: next}: TextFieldState,\n ) {\n // Check shared input and textarea properties\n const inputOrTextAreaEqual =\n prev.type === next.type &&\n prev.value === next.value &&\n prev.required === next.required &&\n prev.minLength === next.minLength &&\n prev.maxLength === next.maxLength;\n\n if (!isInputState(prev) || !isInputState(next)) {\n // Both are textareas, all relevant properties are equal.\n return inputOrTextAreaEqual;\n }\n\n // Check additional input-specific properties.\n return (\n inputOrTextAreaEqual &&\n prev.pattern === next.pattern &&\n prev.min === next.min &&\n prev.max === next.max &&\n prev.step === next.step\n );\n }\n\n protected override copy({state}: TextFieldState): TextFieldState {\n // Don't hold a reference to the rendered control when copying since we\n // don't use it when checking if the state changed.\n return {\n state: isInputState(state)\n ? this.copyInput(state)\n : this.copyTextArea(state),\n renderedControl: null,\n };\n }\n\n private copyInput(state: InputState): InputState {\n const {type, pattern, min, max, step} = state;\n return {\n ...this.copySharedState(state),\n type,\n pattern,\n min,\n max,\n step,\n };\n }\n\n private copyTextArea(state: TextAreaState): TextAreaState {\n return {\n ...this.copySharedState(state),\n type: state.type,\n };\n }\n\n private copySharedState({\n value,\n required,\n minLength,\n maxLength,\n }: SharedInputAndTextAreaState): SharedInputAndTextAreaState {\n return {value, required, minLength, maxLength};\n }\n}\n\nfunction isInputState(state: InputState | TextAreaState): state is InputState {\n return state.type !== 'textarea';\n}\n"]}
1
+ {"version":3,"file":"text-field-validator.js","sourceRoot":"","sources":["text-field-validator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAoGzC;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,SAAyB;IAI5C,eAAe,CAAC,EAAC,KAAK,EAAE,eAAe,EAAiB;QACzE,IAAI,eAAe,GAAG,eAAe,CAAC;QACtC,IAAI,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE;YAC3C,mCAAmC;YACnC,eAAe,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACvE,4CAA4C;YAC5C,IAAI,CAAC,YAAY,GAAG,eAAe,CAAC;SACrC;aAAM,IAAI,CAAC,eAAe,EAAE;YAC3B,sCAAsC;YACtC,eAAe;gBACb,IAAI,CAAC,eAAe,IAAI,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC7D,+CAA+C;YAC/C,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;SACxC;QAED,sEAAsE;QACtE,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;YAC/B,CAAC,CAAE,eAAoC;YACvC,CAAC,CAAC,IAAI,CAAC;QAET,uEAAuE;QACvE,IAAI,KAAK,EAAE;YACT,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;SACzB;QAED,IAAI,eAAe,CAAC,KAAK,KAAK,KAAK,C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AAC;IAEkB,IAAI,CAAC,EAAC,KAAK,EAAiB;QAC7C,uEAAuE;QACvE,mDAAmD;QACnD,OAAO;YACL,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC;gBACxB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;gBACvB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;YAC5B,eAAe,EAAE,IAAI;SACtB,CAAC;IACJ,CAAC;IAEO,SAAS,CAAC,KAAiB;QACjC,MAAM,EAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAC,GAAG,KAAK,CAAC;QAC9C,OAAO;YACL,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC;YAC9B,IAAI;YACJ,OAAO;YACP,GAAG;YACH,GAAG;YACH,IAAI;SACL,CAAC;IACJ,CAAC;IAEO,YAAY,CAAC,KAAoB;QACvC,OAAO;YACL,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC;YAC9B,IAAI,EAAE,KAAK,CAAC,IAAI;SACjB,CAAC;IACJ,CAAC;IAEO,eAAe,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,SAAS,GACmB;QAC5B,OAAO,EAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAC,CAAC;IACjD,CAAC;CACF;AAED,SAAS,YAAY,CAAC,KAAiC;IACrD,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;AACnC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {Validator} from './validator.js';\n\n/**\n * Constraint validation for a text field.\n */\nexport interface TextFieldState {\n /**\n * The input or textarea state to validate.\n */\n state: InputState | TextAreaState;\n\n /**\n * The `<input>` or `<textarea>` that is rendered on the page.\n *\n * `minlength` and `maxlength` validation do not apply until a user has\n * interacted with the control and the element is internally marked as dirty.\n * This is a spec quirk, the two properties behave differently from other\n * constraint validation.\n *\n * This means we need an actual rendered element instead of a virtual one,\n * since the virtual element will never be marked as dirty.\n *\n * This can be `null` if the element has not yet rendered, and the validator\n * will fall back to virtual elements for other constraint validation\n * properties, which do apply even if the control is not dirty.\n */\n renderedControl: HTMLInputElement | HTMLTextAreaElement | null;\n}\n\n/**\n * Constraint validation properties for an `<input>`.\n */\nexport interface InputState extends SharedInputAndTextAreaState {\n /**\n * The `<input>` type.\n *\n * Not all constraint validation properties apply to every type. See\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation#validation-related_attributes\n * for which properties will apply to which types.\n */\n readonly type: string;\n\n /**\n * The regex pattern a value must match.\n */\n readonly pattern: string;\n\n /**\n * The minimum value.\n */\n readonly min: string;\n\n /**\n * The maximum value.\n */\n readonly max: string;\n\n /**\n * The step interval of the value.\n */\n readonly step: string;\n}\n\n/**\n * Constraint validation properties for a `<textarea>`.\n */\nexport interface TextAreaState extends SharedInputAndTextAreaState {\n /**\n * The type, must be \"textarea\" to inform the validator to use `<textarea>`\n * instead of `<input>`.\n */\n readonly type: 'textarea';\n}\n\n/**\n * Constraint validation properties shared between an `<input>` and\n * `<textarea>`.\n */\ninterface SharedInputAndTextAreaState {\n /**\n * The current value.\n */\n readonly value: string;\n\n /**\n * Whether the textarea is required.\n */\n readonly required: boolean;\n\n /**\n * The minimum length of the value.\n */\n readonly minLength: number;\n\n /**\n * The maximum length of the value.\n */\n readonly maxLength: number;\n}\n\n/**\n * A validator that provides constraint validation that emulates `<input>` and\n * `<textarea>` validation.\n */\nexport class TextFieldValidator extends Validator<TextFieldState> {\n private inputControl?: HTMLInputElement;\n private textAreaControl?: HTMLTextAreaElement;\n\n protected override computeValidity({state, renderedControl}: TextFieldState) {\n let inputOrTextArea = renderedControl;\n if (isInputState(state) && !inputOrTextArea) {\n // Get cached <input> or create it.\n inputOrTextArea = this.inputControl || document.createElement('input');\n // Cache the <input> to re-use it next time.\n this.inputControl = inputOrTextArea;\n } else if (!inputOrTextArea) {\n // Get cached <textarea> or create it.\n inputOrTextArea =\n this.textAreaControl || document.createElement('textarea');\n // Cache the <textarea> to re-use it next time.\n this.textAreaControl = inputOrTextArea;\n }\n\n // Set this variable so we can check it for input-specific properties.\n const input = isInputState(state)\n ? (inputOrTextArea as HTMLInputElement)\n : null;\n\n // Set input's \"type\" first, since this can change the other properties\n if (input) {\n input.type = state.type;\n }\n\n if (inputOrTextArea.value !== state.value) {\n // Only programmatically set the value if there's a difference. When using\n // the rendered control, the value will always be up to date. Setting the\n // property (even if it's the same string) will reset the internal <input>\n // dirty flag, making minlength and maxlength validation reset.\n inputOrTextArea.value = state.value;\n }\n\n inputOrTextArea.required = state.required;\n\n // The following IDLAttribute properties will always hydrate an attribute,\n // even if set to a the default value ('' or -1). The presence of the\n // attribute triggers constraint validation, so we must remove the attribute\n // when empty.\n if (input) {\n const inputState = state as InputState;\n if (inputState.pattern) {\n input.pattern = inputState.pattern;\n } else {\n input.removeAttribute('pattern');\n }\n\n if (inputState.min) {\n input.min = inputState.min;\n } else {\n input.removeAttribute('min');\n }\n\n if (inputState.max) {\n input.max = inputState.max;\n } else {\n input.removeAttribute('max');\n }\n\n if (inputState.step) {\n input.step = inputState.step;\n } else {\n input.removeAttribute('step');\n }\n }\n\n // Use -1 to represent no minlength and maxlength, which is what the\n // platform input returns. However, it will throw an error if you try to\n // manually set it to -1.\n //\n // While the type is `number`, it may actually be `null` at runtime.\n // `null > -1` is true since `null` coerces to `0`, so we default null and\n // undefined to -1.\n //\n // We set attributes instead of properties since setting a property may\n // throw an out of bounds error in relation to the other property.\n // Attributes will not throw errors while the state is updating.\n if ((state.minLength ?? -1) > -1) {\n inputOrTextArea.setAttribute('minlength', String(state.minLength));\n } else {\n inputOrTextArea.removeAttribute('minlength');\n }\n\n if ((state.maxLength ?? -1) > -1) {\n inputOrTextArea.setAttribute('maxlength', String(state.maxLength));\n } else {\n inputOrTextArea.removeAttribute('maxlength');\n }\n\n return {\n validity: inputOrTextArea.validity,\n validationMessage: inputOrTextArea.validationMessage,\n };\n }\n\n protected override equals(\n {state: prev}: TextFieldState,\n {state: next}: TextFieldState,\n ) {\n // Check shared input and textarea properties\n const inputOrTextAreaEqual =\n prev.type === next.type &&\n prev.value === next.value &&\n prev.required === next.required &&\n prev.minLength === next.minLength &&\n prev.maxLength === next.maxLength;\n\n if (!isInputState(prev) || !isInputState(next)) {\n // Both are textareas, all relevant properties are equal.\n return inputOrTextAreaEqual;\n }\n\n // Check additional input-specific properties.\n return (\n inputOrTextAreaEqual &&\n prev.pattern === next.pattern &&\n prev.min === next.min &&\n prev.max === next.max &&\n prev.step === next.step\n );\n }\n\n protected override copy({state}: TextFieldState): TextFieldState {\n // Don't hold a reference to the rendered control when copying since we\n // don't use it when checking if the state changed.\n return {\n state: isInputState(state)\n ? this.copyInput(state)\n : this.copyTextArea(state),\n renderedControl: null,\n };\n }\n\n private copyInput(state: InputState): InputState {\n const {type, pattern, min, max, step} = state;\n return {\n ...this.copySharedState(state),\n type,\n pattern,\n min,\n max,\n step,\n };\n }\n\n private copyTextArea(state: TextAreaState): TextAreaState {\n return {\n ...this.copySharedState(state),\n type: state.type,\n };\n }\n\n private copySharedState({\n value,\n required,\n minLength,\n maxLength,\n }: SharedInputAndTextAreaState): SharedInputAndTextAreaState {\n return {value, required, minLength, maxLength};\n }\n}\n\nfunction isInputState(state: InputState | TextAreaState): state is InputState {\n return state.type !== 'textarea';\n}\n"]}
@@ -33,7 +33,8 @@
33
33
  }
34
34
  }
35
35
 
36
- .container {
37
- border: var(--_outline-width) solid var(--_outline-color);
36
+ .outline {
37
+ border-color: var(--_outline-color);
38
+ border-width: var(--_outline-width);
38
39
  }
39
40
  }
@@ -18,18 +18,32 @@
18
18
  z-index: 0;
19
19
  }
20
20
 
21
- // Separate element will be needed for disabled opacities (b/307361748)
22
- .container {
23
- background: var(--_container-color);
21
+ md-elevation,
22
+ .background,
23
+ .outline {
24
24
  border-radius: inherit;
25
25
  inset: 0;
26
+ pointer-events: none;
26
27
  position: absolute;
28
+ }
29
+
30
+ // Separate element will be needed for disabled opacities (b/307361748)
31
+ .background {
32
+ background: var(--_container-color);
27
33
  // Place behind content.
28
34
  z-index: -1;
29
35
  }
30
36
 
37
+ // Separate element needed to overlay on top of content as opposed to
38
+ // background, which is behind content. All cards have an outline for HCM.
39
+ .outline {
40
+ // A default transparent border that is visible in HCM
41
+ border: 1px solid transparent;
42
+ // Outline should be placed on top of content, such as images.
43
+ z-index: 1;
44
+ }
45
+
31
46
  md-elevation {
32
- border-radius: inherit;
33
47
  // Place behind content.
34
48
  z-index: -1;
35
49
 
@@ -12,8 +12,9 @@ export class Card extends LitElement {
12
12
  render() {
13
13
  return html `
14
14
  <md-elevation part="elevation"></md-elevation>
15
- <div class="container"></div>
15
+ <div class="background"></div>
16
16
  <slot></slot>
17
+ <div class="outline"></div>
17
18
  `;
18
19
  }
19
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"card.js","sourceRoot":"","sources":["card.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,iCAAiC,CAAC;AAEzC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAErC;;GAEG;AACH,MAAM,OAAO,IAAK,SAAQ,UAAU;IACf,MAAM;QACvB,OAAO,IAAI,CAAA;;;;KAIV,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../../elevation/elevation.js';\n\nimport {html, LitElement} from 'lit';\n\n/**\n * A card component.\n */\nexport class Card extends LitElement {\n protected override render() {\n return html`\n <md-elevation part=\"elevation\"></md-elevation>\n <div class=\"container\"></div>\n <slot></slot>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"card.js","sourceRoot":"","sources":["card.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,iCAAiC,CAAC;AAEzC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAErC;;GAEG;AACH,MAAM,OAAO,IAAK,SAAQ,UAAU;IACf,MAAM;QACvB,OAAO,IAAI,CAAA;;;;;KAKV,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../../elevation/elevation.js';\n\nimport {html, LitElement} from 'lit';\n\n/**\n * A card component.\n */\nexport class Card extends LitElement {\n protected override render() {\n return html`\n <md-elevation part=\"elevation\"></md-elevation>\n <div class=\"background\"></div>\n <slot></slot>\n <div class=\"outline\"></div>\n `;\n }\n}\n"]}
@@ -4,6 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { css } from 'lit';
7
- export const styles = css `:host{--_container-color: var(--md-outlined-card-container-color, var(--md-sys-color-surface, #fef7ff));--_container-elevation: var(--md-outlined-card-container-elevation, 0);--_container-shadow-color: var(--md-outlined-card-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-outlined-card-container-shape, 12px);--_outline-color: var(--md-outlined-card-outline-color, var(--md-sys-color-outline-variant, #cac4d0));--_outline-width: var(--md-outlined-card-outline-width, 1px)}.container{border:var(--_outline-width) solid var(--_outline-color)}/*# sourceMappingURL=outlined-styles.css.map */
7
+ export const styles = css `:host{--_container-color: var(--md-outlined-card-container-color, var(--md-sys-color-surface, #fef7ff));--_container-elevation: var(--md-outlined-card-container-elevation, 0);--_container-shadow-color: var(--md-outlined-card-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-outlined-card-container-shape, 12px);--_outline-color: var(--md-outlined-card-outline-color, var(--md-sys-color-outline-variant, #cac4d0));--_outline-width: var(--md-outlined-card-outline-width, 1px)}.outline{border-color:var(--_outline-color);border-width:var(--_outline-width)}/*# sourceMappingURL=outlined-styles.css.map */
8
8
  `;
9
9
  //# sourceMappingURL=outlined-styles.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"outlined-styles.css.js","sourceRoot":"","sources":["outlined-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_container-color: var(--md-outlined-card-container-color, var(--md-sys-color-surface, #fef7ff));--_container-elevation: var(--md-outlined-card-container-elevation, 0);--_container-shadow-color: var(--md-outlined-card-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-outlined-card-container-shape, 12px);--_outline-color: var(--md-outlined-card-outline-color, var(--md-sys-color-outline-variant, #cac4d0));--_outline-width: var(--md-outlined-card-outline-width, 1px)}.container{border:var(--_outline-width) solid var(--_outline-color)}/*# sourceMappingURL=outlined-styles.css.map */\n`;\n "]}
1
+ {"version":3,"file":"outlined-styles.css.js","sourceRoot":"","sources":["outlined-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_container-color: var(--md-outlined-card-container-color, var(--md-sys-color-surface, #fef7ff));--_container-elevation: var(--md-outlined-card-container-elevation, 0);--_container-shadow-color: var(--md-outlined-card-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-outlined-card-container-shape, 12px);--_outline-color: var(--md-outlined-card-outline-color, var(--md-sys-color-outline-variant, #cac4d0));--_outline-width: var(--md-outlined-card-outline-width, 1px)}.outline{border-color:var(--_outline-color);border-width:var(--_outline-width)}/*# sourceMappingURL=outlined-styles.css.map */\n`;\n "]}
@@ -4,6 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { css } from 'lit';
7
- export const styles = css `:host{border-radius:var(--_container-shape);box-sizing:border-box;display:flex;flex-direction:column;position:relative;z-index:0}.container{background:var(--_container-color);border-radius:inherit;inset:0;position:absolute;z-index:-1}md-elevation{border-radius:inherit;z-index:-1;--md-elevation-level: var(--_container-elevation);--md-elevation-shadow-color: var(--_container-shadow-color)}slot{border-radius:inherit}/*# sourceMappingURL=shared-styles.css.map */
7
+ export const styles = css `:host{border-radius:var(--_container-shape);box-sizing:border-box;display:flex;flex-direction:column;position:relative;z-index:0}md-elevation,.background,.outline{border-radius:inherit;inset:0;pointer-events:none;position:absolute}.background{background:var(--_container-color);z-index:-1}.outline{border:1px solid rgba(0,0,0,0);z-index:1}md-elevation{z-index:-1;--md-elevation-level: var(--_container-elevation);--md-elevation-shadow-color: var(--_container-shadow-color)}slot{border-radius:inherit}/*# sourceMappingURL=shared-styles.css.map */
8
8
  `;
9
9
  //# sourceMappingURL=shared-styles.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared-styles.css.js","sourceRoot":"","sources":["shared-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{border-radius:var(--_container-shape);box-sizing:border-box;display:flex;flex-direction:column;position:relative;z-index:0}.container{background:var(--_container-color);border-radius:inherit;inset:0;position:absolute;z-index:-1}md-elevation{border-radius:inherit;z-index:-1;--md-elevation-level: var(--_container-elevation);--md-elevation-shadow-color: var(--_container-shadow-color)}slot{border-radius:inherit}/*# sourceMappingURL=shared-styles.css.map */\n`;\n "]}
1
+ {"version":3,"file":"shared-styles.css.js","sourceRoot":"","sources":["shared-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{border-radius:var(--_container-shape);box-sizing:border-box;display:flex;flex-direction:column;position:relative;z-index:0}md-elevation,.background,.outline{border-radius:inherit;inset:0;pointer-events:none;position:absolute}.background{background:var(--_container-color);z-index:-1}.outline{border:1px solid rgba(0,0,0,0);z-index:1}md-elevation{z-index:-1;--md-elevation-level: var(--_container-elevation);--md-elevation-shadow-color: var(--_container-shadow-color)}slot{border-radius:inherit}/*# sourceMappingURL=shared-styles.css.map */\n`;\n "]}
@@ -8,7 +8,7 @@ import { LitElement, PropertyValues } from 'lit';
8
8
  import { NavigationTab } from '../../navigationtab/internal/navigation-tab.js';
9
9
  import { NavigationBarState } from './state.js';
10
10
  /**
11
- * TODO(b/265346501): add docs
11
+ * b/265346501 - add docs
12
12
  *
13
13
  * @fires navigation-bar-activated {CustomEvent<tab: NavigationTab, activeIndex: number>}
14
14
  * Dispatched whenever the `activeIndex` changes. --bubbles --composed
@@ -10,7 +10,7 @@ import { property, queryAssignedElements } from 'lit/decorators.js';
10
10
  import { requestUpdateOnAriaChange } from '../../../internal/aria/delegate.js';
11
11
  import { isRtl } from '../../../internal/controller/is-rtl.js';
12
12
  /**
13
- * TODO(b/265346501): add docs
13
+ * b/265346501 - add docs
14
14
  *
15
15
  * @fires navigation-bar-activated {CustomEvent<tab: NavigationTab, activeIndex: number>}
16
16
  * Dispatched whenever the `activeIndex` changes. --bubbles --composed
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-bar.js","sourceRoot":"","sources":["navigation-bar.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,iCAAi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C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YACrB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;SACjE;QACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACzC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,KAAK,KAAK,CAAC;SACnC;IACH,CAAC;IAEO,0BAA0B,CAAC,KAAc;QAC/C,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE;YAC3B,GAAG,CAAC,iBAAiB,GAAG,KAAK,CAAC;SAC/B;IACH,CAAC;CACF;AA3IC;IACE,yBAAyB,CAAC,aAAa,CAAC,CAAC;AAC3C,CAAC,GAAA,CAAA;AAEoD;IAApD,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAC,CAAC;kDAAiB;AAGrE;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAC,CAAC;yDAClC;AAKV;IADhB,qBAAqB,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;kDACQ","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../../elevation/elevation.js';\n\nimport {html, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, queryAssignedElements} from 'lit/decorators.js';\n\nimport {ARIAMixinStrict} from '../../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../../internal/aria/delegate.js';\nimport {isRtl} from '../../../internal/controller/is-rtl.js';\nimport {NavigationTab} from '../../navigationtab/internal/navigation-tab.js';\n\nimport {NavigationTabInteractionEvent} from './constants.js';\nimport {NavigationBarState} from './state.js';\n\n/**\n * TODO(b/265346501): add docs\n *\n * @fires navigation-bar-activated {CustomEvent<tab: NavigationTab, activeIndex: number>}\n * Dispatched whenever the `activeIndex` changes. --bubbles --composed\n */\nexport class NavigationBar extends LitElement implements NavigationBarState {\n static {\n requestUpdateOnAriaChange(NavigationBar);\n }\n\n @property({type: Number, attribute: 'active-index'}) activeIndex = 0;\n\n @property({type: Boolean, attribute: 'hide-inactive-labels'})\n hideInactiveLabels = false;\n\n tabs: NavigationTab[] = [];\n\n @queryAssignedElements({flatten: true})\n private readonly tabsElement!: NavigationTab[];\n\n protected override render() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`<div\n class=\"md3-navigation-bar\"\n role=\"tablist\"\n aria-label=${ariaLabel || nothing}\n @keydown=\"${this.handleKeydown}\"\n @navigation-tab-interaction=\"${this.handleNavigationTabInteraction}\"\n @navigation-tab-rendered=${this.handleNavigationTabConnected}\n ><md-elevation></md-elevation\n ><div class=\"md3-navigation-bar__tabs-slot-container\"><slot></slot></div\n ></div>`;\n }\n\n protected override updated(changedProperties: PropertyValues<NavigationBar>) {\n if (changedProperties.has('activeIndex')) {\n this.onActiveIndexChange(this.activeIndex);\n this.dispatchEvent(\n new CustomEvent('navigation-bar-activated', {\n detail: {\n tab: this.tabs[this.activeIndex],\n activeIndex: this.activeIndex,\n },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n if (changedProperties.has('hideInactiveLabels')) {\n this.onHideInactiveLabelsChange(this.hideInactiveLabels);\n }\n\n if (changedProperties.has('tabs')) {\n this.onHideInactiveLabelsChange(this.hideInactiveLabels);\n this.onActiveIndexChange(this.activeIndex);\n }\n }\n\n override firstUpdated(changedProperties: PropertyValues) {\n super.firstUpdated(changedProperties);\n this.layout();\n }\n\n layout() {\n if (!this.tabsElement) return;\n const navTabs: NavigationTab[] = [];\n for (const node of this.tabsElement) {\n navTabs.push(node);\n }\n this.tabs = navTabs;\n }\n\n private handleNavigationTabConnected(event: CustomEvent) {\n const target = event.target as NavigationTab;\n if (this.tabs.indexOf(target) === -1) {\n this.layout();\n }\n }\n\n private handleNavigationTabInteraction(event: NavigationTabInteractionEvent) {\n this.activeIndex = this.tabs.indexOf(event.detail.state as NavigationTab);\n }\n\n private handleKeydown(event: KeyboardEvent) {\n const key = event.key;\n const focusedTabIndex = this.tabs.findIndex((tab) => {\n return tab.matches(':focus-within');\n });\n const isRTL = isRtl(this);\n const maxIndex = this.tabs.length - 1;\n\n if (key === 'Enter' || key === ' ') {\n this.activeIndex = focusedTabIndex;\n return;\n }\n\n if (key === 'Home') {\n this.tabs[0].focus();\n return;\n }\n\n if (key === 'End') {\n this.tabs[maxIndex].focus();\n return;\n }\n\n const toNextTab =\n (key === 'ArrowRight' && !isRTL) || (key === 'ArrowLeft' && isRTL);\n if (toNextTab && focusedTabIndex === maxIndex) {\n this.tabs[0].focus();\n return;\n }\n if (toNextTab) {\n this.tabs[focusedTabIndex + 1].focus();\n return;\n }\n\n const toPreviousTab =\n (key === 'ArrowLeft' && !isRTL) || (key === 'ArrowRight' && isRTL);\n if (toPreviousTab && focusedTabIndex === 0) {\n this.tabs[maxIndex].focus();\n return;\n }\n if (toPreviousTab) {\n this.tabs[focusedTabIndex - 1].focus();\n return;\n }\n }\n\n private onActiveIndexChange(value: number) {\n if (!this.tabs[value]) {\n throw new Error('NavigationBar: activeIndex is out of bounds.');\n }\n for (let i = 0; i < this.tabs.length; i++) {\n this.tabs[i].active = i === value;\n }\n }\n\n private onHideInactiveLabelsChange(value: boolean) {\n for (const tab of this.tabs) {\n tab.hideInactiveLabel = value;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"navigation-bar.js","sourceRoot":"","sources":["navigation-bar.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,iCAAiC,CAAC;AAEzC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAE,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAGlE,OAAO,EAAC,yBAAyB,EAAC,MAAM,o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AAC,EAAE,EAAE;YACzC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,KAAK,KAAK,CAAC;SACnC;IACH,CAAC;IAEO,0BAA0B,CAAC,KAAc;QAC/C,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE;YAC3B,GAAG,CAAC,iBAAiB,GAAG,KAAK,CAAC;SAC/B;IACH,CAAC;CACF;AA3IC;IACE,yBAAyB,CAAC,aAAa,CAAC,CAAC;AAC3C,CAAC,GAAA,CAAA;AAEoD;IAApD,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAC,CAAC;kDAAiB;AAGrE;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAC,CAAC;yDAClC;AAKV;IADhB,qBAAqB,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;kDACQ","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../../elevation/elevation.js';\n\nimport {html, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, queryAssignedElements} from 'lit/decorators.js';\n\nimport {ARIAMixinStrict} from '../../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../../internal/aria/delegate.js';\nimport {isRtl} from '../../../internal/controller/is-rtl.js';\nimport {NavigationTab} from '../../navigationtab/internal/navigation-tab.js';\n\nimport {NavigationTabInteractionEvent} from './constants.js';\nimport {NavigationBarState} from './state.js';\n\n/**\n * b/265346501 - add docs\n *\n * @fires navigation-bar-activated {CustomEvent<tab: NavigationTab, activeIndex: number>}\n * Dispatched whenever the `activeIndex` changes. --bubbles --composed\n */\nexport class NavigationBar extends LitElement implements NavigationBarState {\n static {\n requestUpdateOnAriaChange(NavigationBar);\n }\n\n @property({type: Number, attribute: 'active-index'}) activeIndex = 0;\n\n @property({type: Boolean, attribute: 'hide-inactive-labels'})\n hideInactiveLabels = false;\n\n tabs: NavigationTab[] = [];\n\n @queryAssignedElements({flatten: true})\n private readonly tabsElement!: NavigationTab[];\n\n protected override render() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`<div\n class=\"md3-navigation-bar\"\n role=\"tablist\"\n aria-label=${ariaLabel || nothing}\n @keydown=\"${this.handleKeydown}\"\n @navigation-tab-interaction=\"${this.handleNavigationTabInteraction}\"\n @navigation-tab-rendered=${this.handleNavigationTabConnected}\n ><md-elevation></md-elevation\n ><div class=\"md3-navigation-bar__tabs-slot-container\"><slot></slot></div\n ></div>`;\n }\n\n protected override updated(changedProperties: PropertyValues<NavigationBar>) {\n if (changedProperties.has('activeIndex')) {\n this.onActiveIndexChange(this.activeIndex);\n this.dispatchEvent(\n new CustomEvent('navigation-bar-activated', {\n detail: {\n tab: this.tabs[this.activeIndex],\n activeIndex: this.activeIndex,\n },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n if (changedProperties.has('hideInactiveLabels')) {\n this.onHideInactiveLabelsChange(this.hideInactiveLabels);\n }\n\n if (changedProperties.has('tabs')) {\n this.onHideInactiveLabelsChange(this.hideInactiveLabels);\n this.onActiveIndexChange(this.activeIndex);\n }\n }\n\n override firstUpdated(changedProperties: PropertyValues) {\n super.firstUpdated(changedProperties);\n this.layout();\n }\n\n layout() {\n if (!this.tabsElement) return;\n const navTabs: NavigationTab[] = [];\n for (const node of this.tabsElement) {\n navTabs.push(node);\n }\n this.tabs = navTabs;\n }\n\n private handleNavigationTabConnected(event: CustomEvent) {\n const target = event.target as NavigationTab;\n if (this.tabs.indexOf(target) === -1) {\n this.layout();\n }\n }\n\n private handleNavigationTabInteraction(event: NavigationTabInteractionEvent) {\n this.activeIndex = this.tabs.indexOf(event.detail.state as NavigationTab);\n }\n\n private handleKeydown(event: KeyboardEvent) {\n const key = event.key;\n const focusedTabIndex = this.tabs.findIndex((tab) => {\n return tab.matches(':focus-within');\n });\n const isRTL = isRtl(this);\n const maxIndex = this.tabs.length - 1;\n\n if (key === 'Enter' || key === ' ') {\n this.activeIndex = focusedTabIndex;\n return;\n }\n\n if (key === 'Home') {\n this.tabs[0].focus();\n return;\n }\n\n if (key === 'End') {\n this.tabs[maxIndex].focus();\n return;\n }\n\n const toNextTab =\n (key === 'ArrowRight' && !isRTL) || (key === 'ArrowLeft' && isRTL);\n if (toNextTab && focusedTabIndex === maxIndex) {\n this.tabs[0].focus();\n return;\n }\n if (toNextTab) {\n this.tabs[focusedTabIndex + 1].focus();\n return;\n }\n\n const toPreviousTab =\n (key === 'ArrowLeft' && !isRTL) || (key === 'ArrowRight' && isRTL);\n if (toPreviousTab && focusedTabIndex === 0) {\n this.tabs[maxIndex].focus();\n return;\n }\n if (toPreviousTab) {\n this.tabs[focusedTabIndex - 1].focus();\n return;\n }\n }\n\n private onActiveIndexChange(value: number) {\n if (!this.tabs[value]) {\n throw new Error('NavigationBar: activeIndex is out of bounds.');\n }\n for (let i = 0; i < this.tabs.length; i++) {\n this.tabs[i].active = i === value;\n }\n }\n\n private onHideInactiveLabelsChange(value: boolean) {\n for (const tab of this.tabs) {\n tab.hideInactiveLabel = value;\n }\n }\n}\n"]}
@@ -23,7 +23,7 @@ $_reference: (
23
23
  'container-height': 100%,
24
24
  'container-shape': 0 16px 16px 0,
25
25
  'container-width': 360px,
26
- // TODO(b/216384393): Temporary existing token to use for shadow color
26
+ // b/216384393 - Temporary existing token to use for shadow color
27
27
  'divider-color': #000,
28
28
  'modal-container-elevation': 1,
29
29
  'scrim-color': null,
@@ -21,7 +21,7 @@ $_reference: (
21
21
  'container-height': 100%,
22
22
  'container-shape': 0 16px 16px 0,
23
23
  'container-width': 360px,
24
- // TODO(b/216384393): Temporary existing token to use for shadow color
24
+ // b/216384393 - Temporary existing token to use for shadow color
25
25
  'divider-color': #000,
26
26
  'modal-container-elevation': 1,
27
27
  'standard-container-elevation': 0,
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { LitElement, PropertyValues } from 'lit';
7
7
  /**
8
- * TODO(b/265346501): add docs
8
+ * b/265346501 - add docs
9
9
  *
10
10
  * @fires navigation-drawer-changed {CustomEvent<{opened: boolean}>}
11
11
  * Dispatched whenever the drawer opens or closes --bubbles --composed
@@ -9,7 +9,7 @@ import { property } from 'lit/decorators.js';
9
9
  import { classMap } from 'lit/directives/class-map.js';
10
10
  import { requestUpdateOnAriaChange } from '../../../internal/aria/delegate.js';
11
11
  /**
12
- * TODO(b/265346501): add docs
12
+ * b/265346501 - add docs
13
13
  *
14
14
  * @fires navigation-drawer-changed {CustomEvent<{opened: boolean}>}
15
15
  * Dispatched whenever the drawer opens or closes --bubbles --composed
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-drawer-modal.js","sourceRoot":"","sources":["navigation-drawer-modal.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAC,yBAAyB,EAAC,MAAM,oCAAoC,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,OAAO,qBAAsB,SAAQ,UAAU;IAArD;;QAK6B,WAAM,GAAG,KAAK,CAAC;QAC9B,UAAK,GAAoB,KAAK,CAAC;IAkE7C,CAAC;IAhEoB,MAAM;QACvB,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QACpD,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QACnD,iCAAiC;QACjC,MAAM,EAAC,SAAS,EAAE,SAAS,EAAC,GAAG,IAAuB,CAAC;QACvD,OAAO,IAAI,CAAA;;oDAEqC,IAAI,CAAC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;oDAAgC","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing, PropertyValues} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {ARIAMixinStrict} from '../../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../../internal/aria/delegate.js';\n\n/**\n * TODO(b/265346501): add docs\n *\n * @fires navigation-drawer-changed {CustomEvent<{opened: boolean}>}\n * Dispatched whenever the drawer opens or closes --bubbles --composed\n */\nexport class NavigationDrawerModal extends LitElement {\n static {\n requestUpdateOnAriaChange(NavigationDrawerModal);\n }\n\n @property({type: Boolean}) opened = false;\n @property() pivot: 'start' | 'end' = 'end';\n\n protected override render() {\n const ariaExpanded = this.opened ? 'true' : 'false';\n const ariaHidden = !this.opened ? 'true' : 'false';\n // Needed for closure conformance\n const {ariaLabel, ariaModal} = this as ARIAMixinStrict;\n return html`\n <div\n class=\"md3-navigation-drawer-modal__scrim ${this.getScrimClasses()}\"\n @click=\"${this.handleScrimClick}\">\n </div>\n <div\n aria-expanded=${ariaExpanded}\n aria-hidden=${ariaHidden}\n aria-label=${ariaLabel || nothing}\n aria-modal=${ariaModal || nothing}\n class=\"md3-navigation-drawer-modal ${this.getRenderClasses()}\"\n @keydown=\"${this.handleKeyDown}\"\n role=\"dialog\"\n ><div class=\"md3-elevation-overlay\"></div>\n <div class=\"md3-navigation-drawer-modal__slot-content\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n private getScrimClasses() {\n return classMap({\n 'md3-navigation-drawer-modal--scrim-visible': this.opened,\n });\n }\n\n private getRenderClasses() {\n return classMap({\n 'md3-navigation-drawer-modal--opened': this.opened,\n 'md3-navigation-drawer-modal--pivot-at-start': this.pivot === 'start',\n });\n }\n\n protected override updated(\n changedProperties: PropertyValues<NavigationDrawerModal>,\n ) {\n if (changedProperties.has('opened')) {\n setTimeout(() => {\n this.dispatchEvent(\n new CustomEvent('navigation-drawer-changed', {\n detail: {opened: this.opened},\n bubbles: true,\n composed: true,\n }),\n );\n }, 250);\n }\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (event.code === 'Escape') {\n this.opened = false;\n }\n }\n\n private handleScrimClick() {\n this.opened = !this.opened;\n }\n}\n"]}
1
+ {"version":3,"file":"navigation-drawer-modal.js","sourceRoot":"","sources":["navigation-drawer-modal.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAC,yBAAyB,EAAC,MAAM,oCAAoC,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,OAAO,qBAAsB,SAAQ,UAAU;IAArD;;QAK6B,WAAM,GAAG,KAAK,CAAC;QAC9B,UAAK,GAAoB,KAAK,CAAC;IAkE7C,CAAC;IAhEoB,MAAM;QACvB,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QACpD,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QACnD,iCAAiC;QACjC,MAAM,EAAC,SAAS,EAAE,SAAS,EAAC,GAAG,IAAuB,CAAC;QACvD,OAAO,IAAI,CAAA;;oDAEqC,IAAI,CAAC,eAAe,EAAE;kBACxD,IAAI,CAAC,gBAAgB;;;wBAGf,YAAY;sBACd,UAAU;qBACX,SAAS,IAAI,OAAO;qBACpB,SAAS,IAAI,OAAO;6CACI,IAAI,CAAC,gBAAgB,EAAE;oBAChD,IAAI,CAAC,aAAa;;;;;;;KAOjC,CAAC;IACJ,CAAC;IAEO,eAAe;QACrB,OAAO,QAAQ,CAAC;YACd,4CAA4C,EAAE,IAAI,CAAC,MAAM;SAC1D,CAAC,CAAC;IACL,CAAC;IAEO,gBAAgB;QACtB,OAAO,QAAQ,CAAC;YACd,qCAAqC,EAAE,IAAI,CAAC,MAAM;YAClD,6CAA6C,EAAE,IAAI,CAAC,KAAK,KAAK,OAAO;SACtE,CAAC,CAAC;IACL,CAAC;IAEkB,OAAO,CACxB,iBAAwD;QAExD,IAAI,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACnC,UAAU,CAAC,GAAG,EAAE;gBACd,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,2BAA2B,EAAE;oBAC3C,MAAM,EAAE,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC;oBAC7B,OAAO,EAAE,IAAI;oBACb,QAAQ,EAAE,IAAI;iBACf,CAAC,CACH,CAAC;YACJ,CAAC,EAAE,GAAG,CAAC,CAAC;SACT;IACH,CAAC;IAEO,aAAa,CAAC,KAAoB;QACxC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YAC3B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;SACrB;IACH,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;IAC7B,CAAC;CACF;AAvEC;IACE,yBAAyB,CAAC,qBAAqB,CAAC,CAAC;AACnD,CAAC,GAAA,CAAA;AAE0B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;qDAAgB;AAC9B;IAAX,QAAQ,EAAE;oDAAgC","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing, PropertyValues} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {ARIAMixinStrict} from '../../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../../internal/aria/delegate.js';\n\n/**\n * b/265346501 - add docs\n *\n * @fires navigation-drawer-changed {CustomEvent<{opened: boolean}>}\n * Dispatched whenever the drawer opens or closes --bubbles --composed\n */\nexport class NavigationDrawerModal extends LitElement {\n static {\n requestUpdateOnAriaChange(NavigationDrawerModal);\n }\n\n @property({type: Boolean}) opened = false;\n @property() pivot: 'start' | 'end' = 'end';\n\n protected override render() {\n const ariaExpanded = this.opened ? 'true' : 'false';\n const ariaHidden = !this.opened ? 'true' : 'false';\n // Needed for closure conformance\n const {ariaLabel, ariaModal} = this as ARIAMixinStrict;\n return html`\n <div\n class=\"md3-navigation-drawer-modal__scrim ${this.getScrimClasses()}\"\n @click=\"${this.handleScrimClick}\">\n </div>\n <div\n aria-expanded=${ariaExpanded}\n aria-hidden=${ariaHidden}\n aria-label=${ariaLabel || nothing}\n aria-modal=${ariaModal || nothing}\n class=\"md3-navigation-drawer-modal ${this.getRenderClasses()}\"\n @keydown=\"${this.handleKeyDown}\"\n role=\"dialog\"\n ><div class=\"md3-elevation-overlay\"></div>\n <div class=\"md3-navigation-drawer-modal__slot-content\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n private getScrimClasses() {\n return classMap({\n 'md3-navigation-drawer-modal--scrim-visible': this.opened,\n });\n }\n\n private getRenderClasses() {\n return classMap({\n 'md3-navigation-drawer-modal--opened': this.opened,\n 'md3-navigation-drawer-modal--pivot-at-start': this.pivot === 'start',\n });\n }\n\n protected override updated(\n changedProperties: PropertyValues<NavigationDrawerModal>,\n ) {\n if (changedProperties.has('opened')) {\n setTimeout(() => {\n this.dispatchEvent(\n new CustomEvent('navigation-drawer-changed', {\n detail: {opened: this.opened},\n bubbles: true,\n composed: true,\n }),\n );\n }, 250);\n }\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (event.code === 'Escape') {\n this.opened = false;\n }\n }\n\n private handleScrimClick() {\n this.opened = !this.opened;\n }\n}\n"]}
@@ -6,7 +6,7 @@
6
6
  import '../../../elevation/elevation.js';
7
7
  import { LitElement, PropertyValues } from 'lit';
8
8
  /**
9
- * TODO(b/265346501): add docs
9
+ * b/265346501 - add docs
10
10
  *
11
11
  * @fires navigation-drawer-changed {CustomEvent<{opened: boolean}>}
12
12
  * Dispatched whenever the drawer opens or closes --bubbles --composed
@@ -10,7 +10,7 @@ import { property } from 'lit/decorators.js';
10
10
  import { classMap } from 'lit/directives/class-map.js';
11
11
  import { requestUpdateOnAriaChange } from '../../../internal/aria/delegate.js';
12
12
  /**
13
- * TODO(b/265346501): add docs
13
+ * b/265346501 - add docs
14
14
  *
15
15
  * @fires navigation-drawer-changed {CustomEvent<{opened: boolean}>}
16
16
  * Dispatched whenever the drawer opens or closes --bubbles --composed
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-drawer.js","sourceRoot":"","sources":["navigation-drawer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,iCAAiC,CAAC;AAEzC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAC,yBAAyB,EAAC,MAAM,oCAAoC,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAAhD;;QAK6B,WAAM,GAAG,KAAK,CAAC;QAC9B,UAAK,GAAoB,KAAK,CAAC;IA6C7C,CAAC;IA3CoB,MAAM;QACvB,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QACpD,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QACnD,iCAAiC;QACjC,MAAM,EAAC,SAAS,EAAE,SAAS,EAAC,GAAG,IAAuB,CAAC;QACvD,OAAO,IAAI,CAAA;;yBAEU,YAAY;uBACd,UAAU;qBACZ,SAAS,IAAI,OAAO;sBACnB,SAAS,IAAI,OAAO;uCACH,IAAI,CAAC,gBAAgB,EAAE;;;;;;;KAOzD,CAAC;IACJ,CAAC;IAEO,gBAAgB;QACtB,OAAO,QAAQ,CAAC;YACd,+BAA+B,EAAE,IAAI,CAAC,MAAM;YAC5C,uCAAuC,EAAE,IAAI,CAAC,KAAK,KAAK,OAAO;SAChE,CAAC,CAAC;IACL,CAAC;IAEkB,OAAO,CACxB,iBAAmD;QAEnD,IAAI,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACnC,UAAU,CAAC,GAAG,EAAE;gBACd,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,2BAA2B,EAAE;oBAC3C,MAAM,EAAE,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC;oBAC7B,OAAO,EAAE,IAAI;oBACb,QAAQ,EAAE,IAAI;iBACf,CAAC,CACH,CAAC;YACJ,CAAC,EAAE,GAAG,CAAC,CAAC;SACT;IACH,CAAC;CACF;AAlDC;IACE,yBAAyB,CAAC,gBAAgB,CAAC,CAAC;AAC9C,CAAC,GAAA,CAAA;AAE0B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;gDAAgB;AAC9B;IAAX,QAAQ,EAAE;+CAAgC","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../../elevation/elevation.js';\n\nimport {html, LitElement, nothing, PropertyValues} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {ARIAMixinStrict} from '../../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../../internal/aria/delegate.js';\n\n/**\n * TODO(b/265346501): add docs\n *\n * @fires navigation-drawer-changed {CustomEvent<{opened: boolean}>}\n * Dispatched whenever the drawer opens or closes --bubbles --composed\n */\nexport class NavigationDrawer extends LitElement {\n static {\n requestUpdateOnAriaChange(NavigationDrawer);\n }\n\n @property({type: Boolean}) opened = false;\n @property() pivot: 'start' | 'end' = 'end';\n\n protected override render() {\n const ariaExpanded = this.opened ? 'true' : 'false';\n const ariaHidden = !this.opened ? 'true' : 'false';\n // Needed for closure conformance\n const {ariaLabel, ariaModal} = this as ARIAMixinStrict;\n return html`\n <div\n aria-expanded=\"${ariaExpanded}\"\n aria-hidden=\"${ariaHidden}\"\n aria-label=${ariaLabel || nothing}\n aria-modal=\"${ariaModal || nothing}\"\n class=\"md3-navigation-drawer ${this.getRenderClasses()}\"\n role=\"dialog\">\n <md-elevation></md-elevation>\n <div class=\"md3-navigation-drawer__slot-content\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n private getRenderClasses() {\n return classMap({\n 'md3-navigation-drawer--opened': this.opened,\n 'md3-navigation-drawer--pivot-at-start': this.pivot === 'start',\n });\n }\n\n protected override updated(\n changedProperties: PropertyValues<NavigationDrawer>,\n ) {\n if (changedProperties.has('opened')) {\n setTimeout(() => {\n this.dispatchEvent(\n new CustomEvent('navigation-drawer-changed', {\n detail: {opened: this.opened},\n bubbles: true,\n composed: true,\n }),\n );\n }, 250);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"navigation-drawer.js","sourceRoot":"","sources":["navigation-drawer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,iCAAiC,CAAC;AAEzC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAC,yBAAyB,EAAC,MAAM,oCAAoC,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAAhD;;QAK6B,WA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","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../../elevation/elevation.js';\n\nimport {html, LitElement, nothing, PropertyValues} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {ARIAMixinStrict} from '../../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../../internal/aria/delegate.js';\n\n/**\n * b/265346501 - add docs\n *\n * @fires navigation-drawer-changed {CustomEvent<{opened: boolean}>}\n * Dispatched whenever the drawer opens or closes --bubbles --composed\n */\nexport class NavigationDrawer extends LitElement {\n static {\n requestUpdateOnAriaChange(NavigationDrawer);\n }\n\n @property({type: Boolean}) opened = false;\n @property() pivot: 'start' | 'end' = 'end';\n\n protected override render() {\n const ariaExpanded = this.opened ? 'true' : 'false';\n const ariaHidden = !this.opened ? 'true' : 'false';\n // Needed for closure conformance\n const {ariaLabel, ariaModal} = this as ARIAMixinStrict;\n return html`\n <div\n aria-expanded=\"${ariaExpanded}\"\n aria-hidden=\"${ariaHidden}\"\n aria-label=${ariaLabel || nothing}\n aria-modal=\"${ariaModal || nothing}\"\n class=\"md3-navigation-drawer ${this.getRenderClasses()}\"\n role=\"dialog\">\n <md-elevation></md-elevation>\n <div class=\"md3-navigation-drawer__slot-content\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n private getRenderClasses() {\n return classMap({\n 'md3-navigation-drawer--opened': this.opened,\n 'md3-navigation-drawer--pivot-at-start': this.pivot === 'start',\n });\n }\n\n protected override updated(\n changedProperties: PropertyValues<NavigationDrawer>,\n ) {\n if (changedProperties.has('opened')) {\n setTimeout(() => {\n this.dispatchEvent(\n new CustomEvent('navigation-drawer-changed', {\n detail: {opened: this.opened},\n bubbles: true,\n composed: true,\n }),\n );\n }, 250);\n }\n }\n}\n"]}
@@ -9,7 +9,7 @@ import '../../badge/badge.js';
9
9
  import { LitElement, PropertyValues } from 'lit';
10
10
  import { NavigationTabState } from './state.js';
11
11
  /**
12
- * TODO(b/265346501): add docs
12
+ * b/265346501 - add docs
13
13
  *
14
14
  * @fires navigation-tab-rendered {Event} Dispatched when the navigation tab's
15
15
  * DOM has rendered and custom element definition has loaded. --bubbles
@@ -12,7 +12,7 @@ import { property, query } from 'lit/decorators.js';
12
12
  import { classMap } from 'lit/directives/class-map.js';
13
13
  import { requestUpdateOnAriaChange } from '../../../internal/aria/delegate.js';
14
14
  /**
15
- * TODO(b/265346501): add docs
15
+ * b/265346501 - add docs
16
16
  *
17
17
  * @fires navigation-tab-rendered {Event} Dispatched when the navigation tab's
18
18
  * DOM has rendered and custom element definition has loaded. --bubbles
@@ -98,7 +98,7 @@ export class NavigationTab extends LitElement {
98
98
  }
99
99
  }
100
100
  handleClick() {
101
- // TODO(b/269772145): connect to ripple
101
+ // b/269772145 - connect to ripple
102
102
  this.dispatchEvent(new CustomEvent('navigation-tab-interaction', {
103
103
  detail: { state: this },
104
104
  bubbles: true,
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-tab.js","sourceRoot":"","sources":["navigation-tab.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,iCAAiC,CAAC;AACzC,OAAO,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAC,yBAAyB,EAAC,MAAM,oCAAoC,CAAC;AAI7E;;;;;;;;GAQG;AACH,MAAM,OAAO,aAAc,SAAQ,UAAU;IAA7C;;QAK6B,aAAQ,GAAG,KAAK,CAAC;QACF,WAAM,GAAG,KAAK,CAAC;QAEzD,sBAAiB,GAAG,KAAK,CAAC;QAEY,eAAU,GAAG,EAAE,CAAC;QACF,cAAS,GA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focus-ring.js';\nimport '../../../ripple/ripple.js';\nimport '../../badge/badge.js';\n\nimport {html, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {ARIAMixinStrict} from '../../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../../internal/aria/delegate.js';\n\nimport {NavigationTabState} from './state.js';\n\n/**\n * TODO(b/265346501): add docs\n *\n * @fires navigation-tab-rendered {Event} Dispatched when the navigation tab's\n * DOM has rendered and custom element definition has loaded. --bubbles\n * --composed\n * @fires navigation-tab-interaction {CustomEvent<{state: MdNavigationTab}>}\n * Dispatched when the navigation tab has been clicked. --bubbles --composed\n */\nexport class NavigationTab extends LitElement implements NavigationTabState {\n static {\n requestUpdateOnAriaChange(NavigationTab);\n }\n\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean, reflect: true}) active = false;\n @property({type: Boolean, attribute: 'hide-inactive-label'})\n hideInactiveLabel = false;\n @property() label?: string;\n @property({attribute: 'badge-value'}) badgeValue = '';\n @property({type: Boolean, attribute: 'show-badge'}) showBadge = false;\n\n @query('button') buttonElement!: HTMLElement | null;\n\n protected override render() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html` <button\n class=\"md3-navigation-tab ${classMap(this.getRenderClasses())}\"\n role=\"tab\"\n aria-selected=\"${this.active}\"\n aria-label=${ariaLabel || nothing}\n tabindex=\"${this.active ? 0 : -1}\"\n @click=\"${this.handleClick}\">\n <md-focus-ring part=\"focus-ring\" inward></md-focus-ring>\n <md-ripple\n ?disabled=\"${this.disabled}\"\n class=\"md3-navigation-tab__ripple\"></md-ripple>\n <span aria-hidden=\"true\" class=\"md3-navigation-tab__icon-content\"\n ><span class=\"md3-navigation-tab__active-indicator\"></span\n ><span class=\"md3-navigation-tab__icon\"\n ><slot name=\"inactive-icon\"></slot\n ></span>\n <span class=\"md3-navigation-tab__icon md3-navigation-tab__icon--active\"\n ><slot name=\"active-icon\"></slot></span\n >${this.renderBadge()}</span\n >${this.renderLabel()}\n </button>`;\n }\n\n private getRenderClasses() {\n return {\n 'md3-navigation-tab--hide-inactive-label': this.hideInactiveLabel,\n 'md3-navigation-tab--active': this.active,\n };\n }\n\n private renderBadge() {\n return this.showBadge\n ? html`<md-badge .value=\"${this.badgeValue}\"></md-badge>`\n : nothing;\n }\n\n private renderLabel() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n const ariaHidden = ariaLabel ? 'true' : 'false';\n return !this.label\n ? nothing\n : html` <span\n aria-hidden=\"${ariaHidden}\"\n class=\"md3-navigation-tab__label-text\"\n >${this.label}</span\n >`;\n }\n\n override firstUpdated(changedProperties: PropertyValues) {\n super.firstUpdated(changedProperties);\n const event = new Event('navigation-tab-rendered', {\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(event);\n }\n\n override focus() {\n const buttonElement = this.buttonElement;\n if (buttonElement) {\n buttonElement.focus();\n }\n }\n\n override blur() {\n const buttonElement = this.buttonElement;\n if (buttonElement) {\n buttonElement.blur();\n }\n }\n\n handleClick() {\n // TODO(b/269772145): connect to ripple\n this.dispatchEvent(\n new CustomEvent('navigation-tab-interaction', {\n detail: {state: this},\n bubbles: true,\n composed: true,\n }),\n );\n }\n}\n"]}
1
+ {"version":3,"file":"navigation-tab.js","sourceRoot":"","sources":["navigation-tab.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,iCAAiC,CAAC;AACzC,OAAO,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAC,yBAAyB,EAAC,MAAM,oCAAoC,CAAC;AAI7E;;;;;;;;G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AAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAC,CAAC;gDAAmB;AAErD;IAAhB,KAAK,CAAC,QAAQ,CAAC;oDAAoC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../../focus/md-focus-ring.js';\nimport '../../../ripple/ripple.js';\nimport '../../badge/badge.js';\n\nimport {html, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {ARIAMixinStrict} from '../../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../../internal/aria/delegate.js';\n\nimport {NavigationTabState} from './state.js';\n\n/**\n * b/265346501 - add docs\n *\n * @fires navigation-tab-rendered {Event} Dispatched when the navigation tab's\n * DOM has rendered and custom element definition has loaded. --bubbles\n * --composed\n * @fires navigation-tab-interaction {CustomEvent<{state: MdNavigationTab}>}\n * Dispatched when the navigation tab has been clicked. --bubbles --composed\n */\nexport class NavigationTab extends LitElement implements NavigationTabState {\n static {\n requestUpdateOnAriaChange(NavigationTab);\n }\n\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean, reflect: true}) active = false;\n @property({type: Boolean, attribute: 'hide-inactive-label'})\n hideInactiveLabel = false;\n @property() label?: string;\n @property({attribute: 'badge-value'}) badgeValue = '';\n @property({type: Boolean, attribute: 'show-badge'}) showBadge = false;\n\n @query('button') buttonElement!: HTMLElement | null;\n\n protected override render() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html` <button\n class=\"md3-navigation-tab ${classMap(this.getRenderClasses())}\"\n role=\"tab\"\n aria-selected=\"${this.active}\"\n aria-label=${ariaLabel || nothing}\n tabindex=\"${this.active ? 0 : -1}\"\n @click=\"${this.handleClick}\">\n <md-focus-ring part=\"focus-ring\" inward></md-focus-ring>\n <md-ripple\n ?disabled=\"${this.disabled}\"\n class=\"md3-navigation-tab__ripple\"></md-ripple>\n <span aria-hidden=\"true\" class=\"md3-navigation-tab__icon-content\"\n ><span class=\"md3-navigation-tab__active-indicator\"></span\n ><span class=\"md3-navigation-tab__icon\"\n ><slot name=\"inactive-icon\"></slot\n ></span>\n <span class=\"md3-navigation-tab__icon md3-navigation-tab__icon--active\"\n ><slot name=\"active-icon\"></slot></span\n >${this.renderBadge()}</span\n >${this.renderLabel()}\n </button>`;\n }\n\n private getRenderClasses() {\n return {\n 'md3-navigation-tab--hide-inactive-label': this.hideInactiveLabel,\n 'md3-navigation-tab--active': this.active,\n };\n }\n\n private renderBadge() {\n return this.showBadge\n ? html`<md-badge .value=\"${this.badgeValue}\"></md-badge>`\n : nothing;\n }\n\n private renderLabel() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n const ariaHidden = ariaLabel ? 'true' : 'false';\n return !this.label\n ? nothing\n : html` <span\n aria-hidden=\"${ariaHidden}\"\n class=\"md3-navigation-tab__label-text\"\n >${this.label}</span\n >`;\n }\n\n override firstUpdated(changedProperties: PropertyValues) {\n super.firstUpdated(changedProperties);\n const event = new Event('navigation-tab-rendered', {\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(event);\n }\n\n override focus() {\n const buttonElement = this.buttonElement;\n if (buttonElement) {\n buttonElement.focus();\n }\n }\n\n override blur() {\n const buttonElement = this.buttonElement;\n if (buttonElement) {\n buttonElement.blur();\n }\n }\n\n handleClick() {\n // b/269772145 - connect to ripple\n this.dispatchEvent(\n new CustomEvent('navigation-tab-interaction', {\n detail: {state: this},\n bubbles: true,\n composed: true,\n }),\n );\n }\n}\n"]}
@@ -15,10 +15,4 @@ export interface NavigationTabState {
15
15
  * If true, when inactive label will be hidden.
16
16
  */
17
17
  hideInactiveLabel: boolean;
18
- /**
19
- * Inner button for the tab
20
- * TODO(b/229015424): Remove this when the jscompiler rename issue is
21
- * understood.
22
- */
23
- buttonElement: HTMLElement | null;
24
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["state.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * The state of a navigation tab.\n */\nexport interface NavigationTabState {\n /**\n * Active state of the navigation tab.\n */\n active: boolean;\n /**\n * If true, when inactive label will be hidden.\n */\n hideInactiveLabel: boolean;\n\n /**\n * Inner button for the tab\n * TODO(b/229015424): Remove this when the jscompiler rename issue is\n * understood.\n */\n buttonElement: HTMLElement | null;\n}\n"]}
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["state.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * The state of a navigation tab.\n */\nexport interface NavigationTabState {\n /**\n * Active state of the navigation tab.\n */\n active: boolean;\n /**\n * If true, when inactive label will be hidden.\n */\n hideInactiveLabel: boolean;\n}\n"]}
@@ -15,7 +15,7 @@
15
15
 
16
16
  @mixin styles() {
17
17
  $tokens: tokens.md-comp-outlined-segmented-button-values();
18
- // TODO(b/198759625): Remove spacing tokens once provided.
18
+ // b/198759625 - Remove spacing tokens once provided.
19
19
  $tokens: map.merge(
20
20
  $tokens,
21
21
  (
@@ -33,7 +33,7 @@
33
33
  .md3-segmented-button__outline {
34
34
  border-radius: inherit;
35
35
  border-style: solid;
36
- // TODO(b/233762888): Move border-width and inset into theme after generating latest version of tokens.
36
+ // Move border-width and inset into theme.
37
37
  border-width: 1px;
38
38
  inset: 0px -0.5px;
39
39
  pointer-events: none;
@@ -98,7 +98,7 @@
98
98
  &.md3-segmented-button--selected.md3-segmented-button--with-label.md3-segmented-button--with-checkmark,
99
99
  &.md3-segmented-button--selected.md3-segmented-button--without-label.md3-segmented-button--with-checkmark {
100
100
  .md3-segmented-button__graphic {
101
- // TODO(b/198759625): Use padding token instead of hardcoded 8px value.
101
+ // b/198759625 - Use padding token instead of hardcoded 8px value.
102
102
  width: calc(var(--_icon-size) + 8px);
103
103
  }
104
104
  }
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { SegmentedButton } from './segmented-button.js';
7
7
  /**
8
- * TODO(b/265346443): add docs
8
+ * b/265346443 - add docs
9
9
  */
10
10
  export declare class OutlinedSegmentedButton extends SegmentedButton {
11
11
  protected getRenderClasses(): {
@@ -6,7 +6,7 @@
6
6
  import { html } from 'lit';
7
7
  import { SegmentedButton } from './segmented-button.js';
8
8
  /**
9
- * TODO(b/265346443): add docs
9
+ * b/265346443 - add docs
10
10
  */
11
11
  export class OutlinedSegmentedButton extends SegmentedButton {
12
12
  getRenderClasses() {
@@ -1 +1 @@
1
- {"version":3,"file":"outlined-segmented-button.js","sourceRoot":"","sources":["outlined-segmented-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,eAAe;IACvC,gBAAgB;QACjC,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,gCAAgC,EAAE,IAAI;SACvC,CAAC;IACJ,CAAC;IAEkB,aAAa;QAC9B,OAAO,IAAI,CAAA,qDAAqD,CAAC;IACnE,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html} from 'lit';\n\nimport {SegmentedButton} from './segmented-button.js';\n\n/**\n * TODO(b/265346443): add docs\n */\nexport class OutlinedSegmentedButton extends SegmentedButton {\n protected override getRenderClasses() {\n return {\n ...super.getRenderClasses(),\n 'md3-segmented-button--outlined': true,\n };\n }\n\n protected override renderOutline() {\n return html`<span class=\"md3-segmented-button__outline\"></span>`;\n }\n}\n"]}
1
+ {"version":3,"file":"outlined-segmented-button.js","sourceRoot":"","sources":["outlined-segmented-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,eAAe;IACvC,gBAAgB;QACjC,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,gCAAgC,EAAE,IAAI;SACvC,CAAC;IACJ,CAAC;IAEkB,aAAa;QAC9B,OAAO,IAAI,CAAA,qDAAqD,CAAC;IACnE,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html} from 'lit';\n\nimport {SegmentedButton} from './segmented-button.js';\n\n/**\n * b/265346443 - add docs\n */\nexport class OutlinedSegmentedButton extends SegmentedButton {\n protected override getRenderClasses() {\n return {\n ...super.getRenderClasses(),\n 'md3-segmented-button--outlined': true,\n };\n }\n\n protected override renderOutline() {\n return html`<span class=\"md3-segmented-button__outline\"></span>`;\n }\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { SegmentedButtonSet } from './segmented-button-set.js';
7
7
  /**
8
- * TODO(b/265346443): add docs
8
+ * b/265346443 - add docs
9
9
  */
10
10
  export declare class OutlinedSegmentedButtonSet extends SegmentedButtonSet {
11
11
  protected getRenderClasses(): {
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { SegmentedButtonSet } from './segmented-button-set.js';
7
7
  /**
8
- * TODO(b/265346443): add docs
8
+ * b/265346443 - add docs
9
9
  */
10
10
  export class OutlinedSegmentedButtonSet extends SegmentedButtonSet {
11
11
  getRenderClasses() {
@@ -1 +1 @@
1
- {"version":3,"file":"outlined-segmented-button-set.js","sourceRoot":"","sources":["outlined-segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IAC7C,gBAAgB;QACjC,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,oCAAoC,EAAE,IAAI;SAC3C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {SegmentedButtonSet} from './segmented-button-set.js';\n\n/**\n * TODO(b/265346443): add docs\n */\nexport class OutlinedSegmentedButtonSet extends SegmentedButtonSet {\n protected override getRenderClasses() {\n return {\n ...super.getRenderClasses(),\n 'md3-segmented-button-set--outlined': true,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"outlined-segmented-button-set.js","sourceRoot":"","sources":["outlined-segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IAC7C,gBAAgB;QACjC,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,oCAAoC,EAAE,IAAI;SAC3C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {SegmentedButtonSet} from './segmented-button-set.js';\n\n/**\n * b/265346443 - add docs\n */\nexport class OutlinedSegmentedButtonSet extends SegmentedButtonSet {\n protected override getRenderClasses() {\n return {\n ...super.getRenderClasses(),\n 'md3-segmented-button-set--outlined': true,\n };\n }\n}\n"]}
@@ -66,6 +66,7 @@
66
66
  overflow: visible;
67
67
  // [popover] adds a canvas background
68
68
  background-color: transparent;
69
+ color: inherit;
69
70
  opacity: 0;
70
71
  z-index: 20;
71
72
  position: absolute;
@@ -4,6 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { css } from 'lit';
7
- export const styles = css `:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, 4px)}.menu{border-radius:var(--md-menu-container-shape, 4px);display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit}.item-padding{padding-block:8px}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}/*# sourceMappingURL=menu-styles.css.map */
7
+ export const styles = css `:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, 4px)}.menu{border-radius:var(--md-menu-container-shape, 4px);display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit}.item-padding{padding-block:8px}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}/*# sourceMappingURL=menu-styles.css.map */
8
8
  `;
9
9
  //# sourceMappingURL=menu-styles.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu-styles.css.js","sourceRoot":"","sources":["menu-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, 4px)}.menu{border-radius:var(--md-menu-container-shape, 4px);display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit}.item-padding{padding-block:8px}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}/*# sourceMappingURL=menu-styles.css.map */\n`;\n "]}
1
+ {"version":3,"file":"menu-styles.css.js","sourceRoot":"","sources":["menu-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, 4px)}.menu{border-radius:var(--md-menu-container-shape, 4px);display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit}.item-padding{padding-block:8px}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}/*# sourceMappingURL=menu-styles.css.map */\n`;\n "]}