@material/web 0.1.0-alpha.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.
- package/LICENSE +202 -0
- package/README.md +34 -0
- package/actionelement/action-element.d.ts +79 -0
- package/actionelement/action-element.js +97 -0
- package/actionelement/action-element.js.map +1 -0
- package/badge/badge.d.ts +19 -0
- package/badge/badge.js +22 -0
- package/badge/badge.js.map +1 -0
- package/badge/lib/_badge-theme.scss +118 -0
- package/badge/lib/_badge.scss +41 -0
- package/badge/lib/badge-styles.css.d.ts +1 -0
- package/badge/lib/badge-styles.css.js +9 -0
- package/badge/lib/badge-styles.css.js.map +1 -0
- package/badge/lib/badge-styles.scss +16 -0
- package/badge/lib/badge.d.ts +15 -0
- package/badge/lib/badge.js +31 -0
- package/badge/lib/badge.js.map +1 -0
- package/button/_elevated-button.scss +8 -0
- package/button/_filled-button.scss +8 -0
- package/button/_outlined-button.scss +8 -0
- package/button/_text-button.scss +8 -0
- package/button/_tonal-button.scss +8 -0
- package/button/elevated-button.d.ts +19 -0
- package/button/elevated-button.js +24 -0
- package/button/elevated-button.js.map +1 -0
- package/button/elevated-link-button.d.ts +19 -0
- package/button/elevated-link-button.js +24 -0
- package/button/elevated-link-button.js.map +1 -0
- package/button/filled-button.d.ts +19 -0
- package/button/filled-button.js +23 -0
- package/button/filled-button.js.map +1 -0
- package/button/filled-link-button.d.ts +19 -0
- package/button/filled-link-button.js +23 -0
- package/button/filled-link-button.js.map +1 -0
- package/button/harness.d.ts +13 -0
- package/button/harness.js +16 -0
- package/button/harness.js.map +1 -0
- package/button/lib/_button-theme.scss +204 -0
- package/button/lib/_button.scss +88 -0
- package/button/lib/_elevated-button-theme.scss +53 -0
- package/button/lib/_elevated-button.scss +8 -0
- package/button/lib/_elevation-theme.scss +94 -0
- package/button/lib/_filled-button-theme.scss +53 -0
- package/button/lib/_filled-button.scss +8 -0
- package/button/lib/_icon-theme.scss +67 -0
- package/button/lib/_icon.scss +49 -0
- package/button/lib/_outlined-button-theme.scss +112 -0
- package/button/lib/_outlined-button.scss +25 -0
- package/button/lib/_text-button-theme.scss +57 -0
- package/button/lib/_text-button.scss +8 -0
- package/button/lib/_tonal-button-theme.scss +53 -0
- package/button/lib/_tonal-button.scss +8 -0
- package/button/lib/_touch-target.scss +16 -0
- package/button/lib/button.d.ts +76 -0
- package/button/lib/button.js +238 -0
- package/button/lib/button.js.map +1 -0
- package/button/lib/elevated-button.d.ts +15 -0
- package/button/lib/elevated-button.js +22 -0
- package/button/lib/elevated-button.js.map +1 -0
- package/button/lib/elevated-link-button.d.ts +15 -0
- package/button/lib/elevated-link-button.js +22 -0
- package/button/lib/elevated-link-button.js.map +1 -0
- package/button/lib/elevated-styles.css.d.ts +1 -0
- package/button/lib/elevated-styles.css.js +9 -0
- package/button/lib/elevated-styles.css.js.map +1 -0
- package/button/lib/elevated-styles.scss +18 -0
- package/button/lib/filled-button.d.ts +12 -0
- package/button/lib/filled-button.js +17 -0
- package/button/lib/filled-button.js.map +1 -0
- package/button/lib/filled-link-button.d.ts +12 -0
- package/button/lib/filled-link-button.js +17 -0
- package/button/lib/filled-link-button.js.map +1 -0
- package/button/lib/filled-styles.css.d.ts +1 -0
- package/button/lib/filled-styles.css.js +9 -0
- package/button/lib/filled-styles.css.js.map +1 -0
- package/button/lib/filled-styles.scss +16 -0
- package/button/lib/link-button.d.ts +17 -0
- package/button/lib/link-button.js +53 -0
- package/button/lib/link-button.js.map +1 -0
- package/button/lib/outlined-button.d.ts +15 -0
- package/button/lib/outlined-button.js +22 -0
- package/button/lib/outlined-button.js.map +1 -0
- package/button/lib/outlined-link-button.d.ts +15 -0
- package/button/lib/outlined-link-button.js +22 -0
- package/button/lib/outlined-link-button.js.map +1 -0
- package/button/lib/outlined-styles.css.d.ts +1 -0
- package/button/lib/outlined-styles.css.js +9 -0
- package/button/lib/outlined-styles.css.js.map +1 -0
- package/button/lib/outlined-styles.scss +18 -0
- package/button/lib/shared-styles.css.d.ts +1 -0
- package/button/lib/shared-styles.css.js +9 -0
- package/button/lib/shared-styles.css.js.map +1 -0
- package/button/lib/shared-styles.scss +12 -0
- package/button/lib/state.d.ts +10 -0
- package/button/lib/state.js +7 -0
- package/button/lib/state.js.map +1 -0
- package/button/lib/text-button.d.ts +12 -0
- package/button/lib/text-button.js +17 -0
- package/button/lib/text-button.js.map +1 -0
- package/button/lib/text-link-button.d.ts +12 -0
- package/button/lib/text-link-button.js +17 -0
- package/button/lib/text-link-button.js.map +1 -0
- package/button/lib/text-styles.css.d.ts +1 -0
- package/button/lib/text-styles.css.js +9 -0
- package/button/lib/text-styles.css.js.map +1 -0
- package/button/lib/text-styles.scss +16 -0
- package/button/lib/tonal-button.d.ts +12 -0
- package/button/lib/tonal-button.js +17 -0
- package/button/lib/tonal-button.js.map +1 -0
- package/button/lib/tonal-link-button.d.ts +12 -0
- package/button/lib/tonal-link-button.js +17 -0
- package/button/lib/tonal-link-button.js.map +1 -0
- package/button/lib/tonal-styles.css.d.ts +1 -0
- package/button/lib/tonal-styles.css.js +9 -0
- package/button/lib/tonal-styles.css.js.map +1 -0
- package/button/lib/tonal-styles.scss +16 -0
- package/button/outlined-button.d.ts +19 -0
- package/button/outlined-button.js +23 -0
- package/button/outlined-button.js.map +1 -0
- package/button/outlined-link-button.d.ts +19 -0
- package/button/outlined-link-button.js +23 -0
- package/button/outlined-link-button.js.map +1 -0
- package/button/text-button.d.ts +19 -0
- package/button/text-button.js +23 -0
- package/button/text-button.js.map +1 -0
- package/button/text-link-button.d.ts +19 -0
- package/button/text-link-button.js +23 -0
- package/button/text-link-button.js.map +1 -0
- package/button/tonal-button.d.ts +19 -0
- package/button/tonal-button.js +23 -0
- package/button/tonal-button.js.map +1 -0
- package/button/tonal-link-button.d.ts +19 -0
- package/button/tonal-link-button.js +23 -0
- package/button/tonal-link-button.js.map +1 -0
- package/checkbox/_checkbox.scss +1 -0
- package/checkbox/checkbox.d.ts +15 -0
- package/checkbox/checkbox.js +18 -0
- package/checkbox/checkbox.js.map +1 -0
- package/checkbox/harness.d.ts +13 -0
- package/checkbox/harness.js +16 -0
- package/checkbox/harness.js.map +1 -0
- package/checkbox/lib/_checkbox-theme.scss +532 -0
- package/checkbox/lib/_checkbox.scss +424 -0
- package/checkbox/lib/checkbox-styles.css.d.ts +1 -0
- package/checkbox/lib/checkbox-styles.css.js +9 -0
- package/checkbox/lib/checkbox-styles.css.js.map +1 -0
- package/checkbox/lib/checkbox-styles.scss +15 -0
- package/checkbox/lib/checkbox.d.ts +56 -0
- package/checkbox/lib/checkbox.js +238 -0
- package/checkbox/lib/checkbox.js.map +1 -0
- package/chips/action/lib/action.d.ts +34 -0
- package/chips/action/lib/action.js +83 -0
- package/chips/action/lib/action.js.map +1 -0
- package/chips/action/lib/adapter.d.ts +21 -0
- package/chips/action/lib/adapter.js +7 -0
- package/chips/action/lib/adapter.js.map +1 -0
- package/chips/action/lib/constants.d.ts +62 -0
- package/chips/action/lib/constants.js +69 -0
- package/chips/action/lib/constants.js.map +1 -0
- package/chips/action/lib/foundation.d.ts +31 -0
- package/chips/action/lib/foundation.js +151 -0
- package/chips/action/lib/foundation.js.map +1 -0
- package/chips/action/lib/link-action.d.ts +17 -0
- package/chips/action/lib/link-action.js +43 -0
- package/chips/action/lib/link-action.js.map +1 -0
- package/chips/action/lib/presentational-action.d.ts +15 -0
- package/chips/action/lib/presentational-action.js +30 -0
- package/chips/action/lib/presentational-action.js.map +1 -0
- package/chips/action/lib/primary-action.d.ts +29 -0
- package/chips/action/lib/primary-action.js +83 -0
- package/chips/action/lib/primary-action.js.map +1 -0
- package/chips/action/lib/primary-foundation.d.ts +16 -0
- package/chips/action/lib/primary-foundation.js +24 -0
- package/chips/action/lib/primary-foundation.js.map +1 -0
- package/chips/action/lib/selectable-action.d.ts +17 -0
- package/chips/action/lib/selectable-action.js +57 -0
- package/chips/action/lib/selectable-action.js.map +1 -0
- package/chips/action/lib/trailing-action.d.ts +20 -0
- package/chips/action/lib/trailing-action.js +62 -0
- package/chips/action/lib/trailing-action.js.map +1 -0
- package/chips/action/lib/trailing-foundation.d.ts +16 -0
- package/chips/action/lib/trailing-foundation.js +23 -0
- package/chips/action/lib/trailing-foundation.js.map +1 -0
- package/chips/action/lib/types.d.ts +23 -0
- package/chips/action/lib/types.js +7 -0
- package/chips/action/lib/types.js.map +1 -0
- package/chips/chip/lib/_assist-chip-theme.scss +101 -0
- package/chips/chip/lib/_chip-theme.scss +1329 -0
- package/chips/chip/lib/_chip.scss +427 -0
- package/chips/chip/lib/_filter-chip-theme.scss +132 -0
- package/chips/chip/lib/_input-chip-theme.scss +103 -0
- package/chips/chip/lib/_suggestion-chip-theme.scss +94 -0
- package/chips/chip/lib/adapter.d.ts +50 -0
- package/chips/chip/lib/adapter.js +7 -0
- package/chips/chip/lib/adapter.js.map +1 -0
- package/chips/chip/lib/constants.d.ts +43 -0
- package/chips/chip/lib/constants.js +48 -0
- package/chips/chip/lib/constants.js.map +1 -0
- package/chips/chip/lib/foundation.d.ts +41 -0
- package/chips/chip/lib/foundation.js +256 -0
- package/chips/chip/lib/foundation.js.map +1 -0
- package/chips/chip/lib/types.d.ts +42 -0
- package/chips/chip/lib/types.js +7 -0
- package/chips/chip/lib/types.js.map +1 -0
- package/chips/chipset/lib/_chip-set-theme.scss +48 -0
- package/chips/chipset/lib/_chip-set.scss +46 -0
- package/chips/chipset/lib/adapter.d.ts +45 -0
- package/chips/chipset/lib/adapter.js +7 -0
- package/chips/chipset/lib/adapter.js.map +1 -0
- package/chips/chipset/lib/constants.d.ts +26 -0
- package/chips/chipset/lib/constants.js +30 -0
- package/chips/chipset/lib/constants.js.map +1 -0
- package/chips/chipset/lib/foundation.d.ts +68 -0
- package/chips/chipset/lib/foundation.js +316 -0
- package/chips/chipset/lib/foundation.js.map +1 -0
- package/chips/chipset/lib/types.d.ts +41 -0
- package/chips/chipset/lib/types.js +7 -0
- package/chips/chipset/lib/types.js.map +1 -0
- package/compat/animation/animationframe.d.ts +31 -0
- package/compat/animation/animationframe.js +65 -0
- package/compat/animation/animationframe.js.map +1 -0
- package/compat/base/aria-property.d.ts +39 -0
- package/compat/base/aria-property.js +93 -0
- package/compat/base/aria-property.js.map +1 -0
- package/compat/base/foundation.d.ts +44 -0
- package/compat/base/foundation.js +45 -0
- package/compat/base/foundation.js.map +1 -0
- package/compat/base/observer.d.ts +16 -0
- package/compat/base/observer.js +43 -0
- package/compat/base/observer.js.map +1 -0
- package/compat/base/utils.d.ts +7 -0
- package/compat/base/utils.js +39 -0
- package/compat/base/utils.js.map +1 -0
- package/compat/density/_density.scss +106 -0
- package/compat/dom/keyboard.d.ts +33 -0
- package/compat/dom/keyboard.js +109 -0
- package/compat/dom/keyboard.js.map +1 -0
- package/compat/theme/_color-palette.scss +277 -0
- package/compat/theme/_css.scss +92 -0
- package/compat/theme/_custom-properties.scss +309 -0
- package/compat/theme/_gss.scss +45 -0
- package/compat/theme/_keys.scss +507 -0
- package/compat/theme/_map-ext.scss +68 -0
- package/compat/theme/_replace.scss +108 -0
- package/compat/theme/_selector-ext.scss +522 -0
- package/compat/theme/_shadow-dom.scss +474 -0
- package/compat/theme/_state.scss +752 -0
- package/compat/theme/_theme-color.scss +344 -0
- package/compat/theme/_theme.scss +334 -0
- package/compat/touchtarget/_touch-target.scss +56 -0
- package/controller/action-controller.d.ts +147 -0
- package/controller/action-controller.js +286 -0
- package/controller/action-controller.js.map +1 -0
- package/controller/events.d.ts +27 -0
- package/controller/events.js +40 -0
- package/controller/events.js.map +1 -0
- package/controller/form-controller.d.ts +59 -0
- package/controller/form-controller.js +68 -0
- package/controller/form-controller.js.map +1 -0
- package/controller/foundation.d.ts +24 -0
- package/controller/foundation.js +18 -0
- package/controller/foundation.js.map +1 -0
- package/controller/observer-foundation.d.ts +25 -0
- package/controller/observer-foundation.js +37 -0
- package/controller/observer-foundation.js.map +1 -0
- package/controller/observer.d.ts +52 -0
- package/controller/observer.js +149 -0
- package/controller/observer.js.map +1 -0
- package/controller/string-converter.d.ts +9 -0
- package/controller/string-converter.js +14 -0
- package/controller/string-converter.js.map +1 -0
- package/decorators/aria-property.d.ts +32 -0
- package/decorators/aria-property.js +99 -0
- package/decorators/aria-property.js.map +1 -0
- package/decorators/bound.d.ts +40 -0
- package/decorators/bound.js +49 -0
- package/decorators/bound.js.map +1 -0
- package/elevation/lib/_elevation-overlay-theme.scss +31 -0
- package/elevation/lib/_elevation-overlay.scss +18 -0
- package/elevation/lib/_elevation-theme.scss +88 -0
- package/elevation/lib/_surface.scss +18 -0
- package/elevation/lib/elevation-overlay-styles.css.d.ts +1 -0
- package/elevation/lib/elevation-overlay-styles.css.js +9 -0
- package/elevation/lib/elevation-overlay-styles.css.js.map +1 -0
- package/elevation/lib/elevation-overlay-styles.scss +9 -0
- package/fab/_fab-extended.scss +11 -0
- package/fab/_fab.scss +20 -0
- package/fab/fab-extended.d.ts +23 -0
- package/fab/fab-extended.js +30 -0
- package/fab/fab-extended.js.map +1 -0
- package/fab/fab.d.ts +23 -0
- package/fab/fab.js +30 -0
- package/fab/fab.js.map +1 -0
- package/fab/harness.d.ts +14 -0
- package/fab/harness.js +16 -0
- package/fab/harness.js.map +1 -0
- package/fab/lib/_fab-extended-theme.scss +108 -0
- package/fab/lib/_fab-extended.scss +39 -0
- package/fab/lib/_fab-shared-theme.scss +202 -0
- package/fab/lib/_fab-shared.scss +114 -0
- package/fab/lib/_fab-theme.scss +107 -0
- package/fab/lib/_fab.scss +17 -0
- package/fab/lib/fab-extended-styles.css.d.ts +1 -0
- package/fab/lib/fab-extended-styles.css.js +9 -0
- package/fab/lib/fab-extended-styles.css.js.map +1 -0
- package/fab/lib/fab-extended-styles.scss +16 -0
- package/fab/lib/fab-extended.d.ts +19 -0
- package/fab/lib/fab-extended.js +28 -0
- package/fab/lib/fab-extended.js.map +1 -0
- package/fab/lib/fab-shared-styles.css.d.ts +1 -0
- package/fab/lib/fab-shared-styles.css.js +9 -0
- package/fab/lib/fab-shared-styles.css.js.map +1 -0
- package/fab/lib/fab-shared-styles.scss +8 -0
- package/fab/lib/fab-shared.d.ts +50 -0
- package/fab/lib/fab-shared.js +138 -0
- package/fab/lib/fab-shared.js.map +1 -0
- package/fab/lib/fab-styles.css.d.ts +1 -0
- package/fab/lib/fab-styles.css.js +9 -0
- package/fab/lib/fab-styles.css.js.map +1 -0
- package/fab/lib/fab-styles.scss +16 -0
- package/fab/lib/fab.d.ts +17 -0
- package/fab/lib/fab.js +23 -0
- package/fab/lib/fab.js.map +1 -0
- package/field/_filled-field.scss +8 -0
- package/field/_outlined-field.scss +8 -0
- package/field/filled-field.d.ts +19 -0
- package/field/filled-field.js +23 -0
- package/field/filled-field.js.map +1 -0
- package/field/harness.d.ts +16 -0
- package/field/harness.js +29 -0
- package/field/harness.js.map +1 -0
- package/field/lib/_content-theme.scss +80 -0
- package/field/lib/_content.scss +63 -0
- package/field/lib/_field-theme.scss +15 -0
- package/field/lib/_field.scss +52 -0
- package/field/lib/_filled-field-theme.scss +382 -0
- package/field/lib/_filled-field.scss +129 -0
- package/field/lib/_label-theme.scss +123 -0
- package/field/lib/_label.scss +49 -0
- package/field/lib/_outlined-field-theme.scss +311 -0
- package/field/lib/_outlined-field.scss +194 -0
- package/field/lib/_supporting-text-theme.scss +107 -0
- package/field/lib/_supporting-text.scss +20 -0
- package/field/lib/field.d.ts +56 -0
- package/field/lib/field.js +253 -0
- package/field/lib/field.js.map +1 -0
- package/field/lib/filled-field.d.ts +23 -0
- package/field/lib/filled-field.js +83 -0
- package/field/lib/filled-field.js.map +1 -0
- package/field/lib/filled-styles.css.d.ts +1 -0
- package/field/lib/filled-styles.css.js +9 -0
- package/field/lib/filled-styles.css.js.map +1 -0
- package/field/lib/filled-styles.scss +16 -0
- package/field/lib/outlined-field.d.ts +19 -0
- package/field/lib/outlined-field.js +46 -0
- package/field/lib/outlined-field.js.map +1 -0
- package/field/lib/outlined-styles.css.d.ts +1 -0
- package/field/lib/outlined-styles.css.js +9 -0
- package/field/lib/outlined-styles.css.js.map +1 -0
- package/field/lib/outlined-styles.scss +16 -0
- package/field/lib/shared-styles.css.d.ts +1 -0
- package/field/lib/shared-styles.css.js +9 -0
- package/field/lib/shared-styles.css.js.map +1 -0
- package/field/lib/shared-styles.scss +14 -0
- package/field/outlined-field.d.ts +19 -0
- package/field/outlined-field.js +23 -0
- package/field/outlined-field.js.map +1 -0
- package/focus/focus-ring.d.ts +19 -0
- package/focus/focus-ring.js +22 -0
- package/focus/focus-ring.js.map +1 -0
- package/focus/lib/_focus-ring-theme.scss +89 -0
- package/focus/lib/_focus-ring.scss +41 -0
- package/focus/lib/focus-ring-styles.css.d.ts +1 -0
- package/focus/lib/focus-ring-styles.css.js +9 -0
- package/focus/lib/focus-ring-styles.css.js.map +1 -0
- package/focus/lib/focus-ring-styles.scss +16 -0
- package/focus/lib/focus-ring.d.ts +15 -0
- package/focus/lib/focus-ring.js +31 -0
- package/focus/lib/focus-ring.js.map +1 -0
- package/focus/strong-focus.d.ts +43 -0
- package/focus/strong-focus.js +84 -0
- package/focus/strong-focus.js.map +1 -0
- package/formfield/formfield.d.ts +19 -0
- package/formfield/formfield.js +22 -0
- package/formfield/formfield.js.map +1 -0
- package/formfield/lib/_formfield-theme.scss +41 -0
- package/formfield/lib/_formfield.scss +40 -0
- package/formfield/lib/formfield-styles.css.d.ts +1 -0
- package/formfield/lib/formfield-styles.css.js +9 -0
- package/formfield/lib/formfield-styles.css.js.map +1 -0
- package/formfield/lib/formfield-styles.scss +16 -0
- package/formfield/lib/formfield.d.ts +22 -0
- package/formfield/lib/formfield.js +73 -0
- package/formfield/lib/formfield.js.map +1 -0
- package/icon/icon.d.ts +19 -0
- package/icon/icon.js +22 -0
- package/icon/icon.js.map +1 -0
- package/icon/lib/icon-styles.css.d.ts +1 -0
- package/icon/lib/icon-styles.css.js +9 -0
- package/icon/lib/icon-styles.css.js.map +1 -0
- package/icon/lib/icon-styles.scss +25 -0
- package/icon/lib/icon.d.ts +11 -0
- package/icon/lib/icon.js +14 -0
- package/icon/lib/icon.js.map +1 -0
- package/iconbutton/_filled-icon-button.scss +7 -0
- package/iconbutton/_outlined-icon-button.scss +7 -0
- package/iconbutton/_standard-icon-button.scss +7 -0
- package/iconbutton/filled-icon-button-toggle.d.ts +19 -0
- package/iconbutton/filled-icon-button-toggle.js +28 -0
- package/iconbutton/filled-icon-button-toggle.js.map +1 -0
- package/iconbutton/filled-icon-button.d.ts +19 -0
- package/iconbutton/filled-icon-button.js +27 -0
- package/iconbutton/filled-icon-button.js.map +1 -0
- package/iconbutton/filled-link-icon-button.d.ts +19 -0
- package/iconbutton/filled-link-icon-button.js +27 -0
- package/iconbutton/filled-link-icon-button.js.map +1 -0
- package/iconbutton/filled-tonal-icon-button-toggle.d.ts +19 -0
- package/iconbutton/filled-tonal-icon-button-toggle.js +28 -0
- package/iconbutton/filled-tonal-icon-button-toggle.js.map +1 -0
- package/iconbutton/filled-tonal-icon-button.d.ts +19 -0
- package/iconbutton/filled-tonal-icon-button.js +27 -0
- package/iconbutton/filled-tonal-icon-button.js.map +1 -0
- package/iconbutton/filled-tonal-link-icon-button.d.ts +19 -0
- package/iconbutton/filled-tonal-link-icon-button.js +27 -0
- package/iconbutton/filled-tonal-link-icon-button.js.map +1 -0
- package/iconbutton/harness.d.ts +14 -0
- package/iconbutton/harness.js +16 -0
- package/iconbutton/harness.js.map +1 -0
- package/iconbutton/lib/_filled-icon-button-theme.scss +138 -0
- package/iconbutton/lib/_filled-icon-button.scss +8 -0
- package/iconbutton/lib/_filled-tonal-icon-button-theme.scss +144 -0
- package/iconbutton/lib/_filled-tonal-icon-button.scss +8 -0
- package/iconbutton/lib/_icon-button-theme.scss +163 -0
- package/iconbutton/lib/_icon-button.scss +91 -0
- package/iconbutton/lib/_outlined-icon-button-theme.scss +187 -0
- package/iconbutton/lib/_outlined-icon-button.scss +30 -0
- package/iconbutton/lib/_standard-icon-button-theme.scss +107 -0
- package/iconbutton/lib/_standard-icon-button.scss +13 -0
- package/iconbutton/lib/filled-styles.css.d.ts +1 -0
- package/iconbutton/lib/filled-styles.css.js +9 -0
- package/iconbutton/lib/filled-styles.css.js.map +1 -0
- package/iconbutton/lib/filled-styles.scss +18 -0
- package/iconbutton/lib/filled-tonal-styles.css.d.ts +1 -0
- package/iconbutton/lib/filled-tonal-styles.css.js +9 -0
- package/iconbutton/lib/filled-tonal-styles.css.js.map +1 -0
- package/iconbutton/lib/filled-tonal-styles.scss +18 -0
- package/iconbutton/lib/icon-button-styles.css.d.ts +1 -0
- package/iconbutton/lib/icon-button-styles.css.js +9 -0
- package/iconbutton/lib/icon-button-styles.css.js.map +1 -0
- package/iconbutton/lib/icon-button-styles.scss +8 -0
- package/iconbutton/lib/icon-button-toggle.d.ts +44 -0
- package/iconbutton/lib/icon-button-toggle.js +155 -0
- package/iconbutton/lib/icon-button-toggle.js.map +1 -0
- package/iconbutton/lib/icon-button.d.ts +50 -0
- package/iconbutton/lib/icon-button.js +154 -0
- package/iconbutton/lib/icon-button.js.map +1 -0
- package/iconbutton/lib/link-icon-button.d.ts +14 -0
- package/iconbutton/lib/link-icon-button.js +53 -0
- package/iconbutton/lib/link-icon-button.js.map +1 -0
- package/iconbutton/lib/outlined-styles.css.d.ts +1 -0
- package/iconbutton/lib/outlined-styles.css.js +9 -0
- package/iconbutton/lib/outlined-styles.css.js.map +1 -0
- package/iconbutton/lib/outlined-styles.scss +18 -0
- package/iconbutton/lib/standard-styles.css.d.ts +1 -0
- package/iconbutton/lib/standard-styles.css.js +9 -0
- package/iconbutton/lib/standard-styles.css.js.map +1 -0
- package/iconbutton/lib/standard-styles.scss +18 -0
- package/iconbutton/outlined-icon-button-toggle.d.ts +19 -0
- package/iconbutton/outlined-icon-button-toggle.js +27 -0
- package/iconbutton/outlined-icon-button-toggle.js.map +1 -0
- package/iconbutton/outlined-icon-button.d.ts +19 -0
- package/iconbutton/outlined-icon-button.js +27 -0
- package/iconbutton/outlined-icon-button.js.map +1 -0
- package/iconbutton/outlined-link-icon-button.d.ts +19 -0
- package/iconbutton/outlined-link-icon-button.js +27 -0
- package/iconbutton/outlined-link-icon-button.js.map +1 -0
- package/iconbutton/standard-icon-button-toggle.d.ts +19 -0
- package/iconbutton/standard-icon-button-toggle.js +27 -0
- package/iconbutton/standard-icon-button-toggle.js.map +1 -0
- package/iconbutton/standard-icon-button.d.ts +19 -0
- package/iconbutton/standard-icon-button.js +27 -0
- package/iconbutton/standard-icon-button.js.map +1 -0
- package/iconbutton/standard-link-icon-button.d.ts +19 -0
- package/iconbutton/standard-link-icon-button.js +27 -0
- package/iconbutton/standard-link-icon-button.js.map +1 -0
- package/list/_list-item.scss +7 -0
- package/list/_list.scss +7 -0
- package/list/harness.d.ts +19 -0
- package/list/harness.js +24 -0
- package/list/harness.js.map +1 -0
- package/list/lib/_list-theme.scss +51 -0
- package/list/lib/_list.scss +41 -0
- package/list/lib/_tokens.scss +80 -0
- package/list/lib/avatar/_list-item-avatar-theme.scss +30 -0
- package/list/lib/avatar/_list-item-avatar.scss +14 -0
- package/list/lib/avatar/list-item-avatar-styles.css.d.ts +1 -0
- package/list/lib/avatar/list-item-avatar-styles.css.js +9 -0
- package/list/lib/avatar/list-item-avatar-styles.css.js.map +1 -0
- package/list/lib/avatar/list-item-avatar-styles.scss +20 -0
- package/list/lib/avatar/list-item-avatar.d.ts +16 -0
- package/list/lib/avatar/list-item-avatar.js +35 -0
- package/list/lib/avatar/list-item-avatar.js.map +1 -0
- package/list/lib/divider/_list-divider-theme.scss +30 -0
- package/list/lib/divider/_list-divider.scss +14 -0
- package/list/lib/divider/list-divider-styles.css.d.ts +1 -0
- package/list/lib/divider/list-divider-styles.css.js +9 -0
- package/list/lib/divider/list-divider-styles.css.js.map +1 -0
- package/list/lib/divider/list-divider-styles.scss +18 -0
- package/list/lib/divider/list-divider.d.ts +13 -0
- package/list/lib/divider/list-divider.js +30 -0
- package/list/lib/divider/list-divider.js.map +1 -0
- package/list/lib/icon/_list-item-icon-theme.scss +32 -0
- package/list/lib/icon/_list-item-icon.scss +35 -0
- package/list/lib/icon/list-item-icon-styles.css.d.ts +1 -0
- package/list/lib/icon/list-item-icon-styles.css.js +9 -0
- package/list/lib/icon/list-item-icon-styles.css.js.map +1 -0
- package/list/lib/icon/list-item-icon-styles.scss +20 -0
- package/list/lib/icon/list-item-icon.d.ts +12 -0
- package/list/lib/icon/list-item-icon.js +26 -0
- package/list/lib/icon/list-item-icon.js.map +1 -0
- package/list/lib/image/_list-item-image-theme.scss +36 -0
- package/list/lib/image/_list-item-image.scss +16 -0
- package/list/lib/image/list-item-image-styles.css.d.ts +1 -0
- package/list/lib/image/list-item-image-styles.css.js +9 -0
- package/list/lib/image/list-item-image-styles.css.js.map +1 -0
- package/list/lib/image/list-item-image-styles.scss +20 -0
- package/list/lib/image/list-item-image.d.ts +14 -0
- package/list/lib/image/list-item-image.js +37 -0
- package/list/lib/image/list-item-image.js.map +1 -0
- package/list/lib/list-styles.css.d.ts +1 -0
- package/list/lib/list-styles.css.js +9 -0
- package/list/lib/list-styles.css.js.map +1 -0
- package/list/lib/list-styles.scss +16 -0
- package/list/lib/list.d.ts +41 -0
- package/list/lib/list.js +168 -0
- package/list/lib/list.js.map +1 -0
- package/list/lib/listitem/_list-item-theme.scss +337 -0
- package/list/lib/listitem/_list-item.scss +133 -0
- package/list/lib/listitem/harness.d.ts +13 -0
- package/list/lib/listitem/harness.js +16 -0
- package/list/lib/listitem/harness.js.map +1 -0
- package/list/lib/listitem/list-item-styles.css.d.ts +1 -0
- package/list/lib/listitem/list-item-styles.css.js +9 -0
- package/list/lib/listitem/list-item-styles.css.js.map +1 -0
- package/list/lib/listitem/list-item-styles.scss +16 -0
- package/list/lib/listitem/list-item.d.ts +73 -0
- package/list/lib/listitem/list-item.js +258 -0
- package/list/lib/listitem/list-item.js.map +1 -0
- package/list/lib/video/_list-item-video-theme.scss +36 -0
- package/list/lib/video/_list-item-video.scss +18 -0
- package/list/lib/video/list-item-video-styles.css.d.ts +1 -0
- package/list/lib/video/list-item-video-styles.css.js +9 -0
- package/list/lib/video/list-item-video-styles.css.js.map +1 -0
- package/list/lib/video/list-item-video-styles.scss +20 -0
- package/list/lib/video/list-item-video.d.ts +14 -0
- package/list/lib/video/list-item-video.js +37 -0
- package/list/lib/video/list-item-video.js.map +1 -0
- package/list/list-divider.d.ts +19 -0
- package/list/list-divider.js +22 -0
- package/list/list-divider.js.map +1 -0
- package/list/list-item-avatar.d.ts +19 -0
- package/list/list-item-avatar.js +22 -0
- package/list/list-item-avatar.js.map +1 -0
- package/list/list-item-icon.d.ts +19 -0
- package/list/list-item-icon.js +22 -0
- package/list/list-item-icon.js.map +1 -0
- package/list/list-item-image.d.ts +19 -0
- package/list/list-item-image.js +22 -0
- package/list/list-item-image.js.map +1 -0
- package/list/list-item-video.d.ts +19 -0
- package/list/list-item-video.js +22 -0
- package/list/list-item-video.js.map +1 -0
- package/list/list-item.d.ts +19 -0
- package/list/list-item.js +22 -0
- package/list/list-item.js.map +1 -0
- package/list/list.d.ts +19 -0
- package/list/list.js +22 -0
- package/list/list.js.map +1 -0
- package/menu/harness.d.ts +15 -0
- package/menu/harness.js +17 -0
- package/menu/harness.js.map +1 -0
- package/menu/lib/_menu-button.scss +14 -0
- package/menu/lib/_menu-theme.scss +118 -0
- package/menu/lib/_menu.scss +8 -0
- package/menu/lib/adapter.d.ts +66 -0
- package/menu/lib/adapter.js +7 -0
- package/menu/lib/adapter.js.map +1 -0
- package/menu/lib/constants.d.ts +22 -0
- package/menu/lib/constants.js +23 -0
- package/menu/lib/constants.js.map +1 -0
- package/menu/lib/foundation.d.ts +49 -0
- package/menu/lib/foundation.js +123 -0
- package/menu/lib/foundation.js.map +1 -0
- package/menu/lib/menu-button-styles.css.d.ts +1 -0
- package/menu/lib/menu-button-styles.css.js +9 -0
- package/menu/lib/menu-button-styles.css.js.map +1 -0
- package/menu/lib/menu-button-styles.scss +9 -0
- package/menu/lib/menu-button.d.ts +27 -0
- package/menu/lib/menu-button.js +93 -0
- package/menu/lib/menu-button.js.map +1 -0
- package/menu/lib/menu-styles.css.d.ts +1 -0
- package/menu/lib/menu-styles.css.js +9 -0
- package/menu/lib/menu-styles.css.js.map +1 -0
- package/menu/lib/menu-styles.scss +17 -0
- package/menu/lib/menu.d.ts +62 -0
- package/menu/lib/menu.js +334 -0
- package/menu/lib/menu.js.map +1 -0
- package/menu/lib/menuitem/harness.d.ts +11 -0
- package/menu/lib/menuitem/harness.js +12 -0
- package/menu/lib/menuitem/harness.js.map +1 -0
- package/menu/lib/menuitem/menu-item.d.ts +11 -0
- package/menu/lib/menuitem/menu-item.js +14 -0
- package/menu/lib/menuitem/menu-item.js.map +1 -0
- package/menu/lib/types.d.ts +23 -0
- package/menu/lib/types.js +7 -0
- package/menu/lib/types.js.map +1 -0
- package/menu/menu-button.d.ts +14 -0
- package/menu/menu-button.js +17 -0
- package/menu/menu-button.js.map +1 -0
- package/menu/menu-item.d.ts +14 -0
- package/menu/menu-item.js +17 -0
- package/menu/menu-item.js.map +1 -0
- package/menu/menu.d.ts +14 -0
- package/menu/menu.js +17 -0
- package/menu/menu.js.map +1 -0
- package/menusurface/_menu-surface.scss +7 -0
- package/menusurface/lib/_menu-surface-theme.scss +58 -0
- package/menusurface/lib/_menu-surface.scss +85 -0
- package/menusurface/lib/adapter.d.ts +46 -0
- package/menusurface/lib/adapter.js +7 -0
- package/menusurface/lib/adapter.js.map +1 -0
- package/menusurface/lib/constants.d.ts +71 -0
- package/menusurface/lib/constants.js +83 -0
- package/menusurface/lib/constants.js.map +1 -0
- package/menusurface/lib/foundation.d.ts +176 -0
- package/menusurface/lib/foundation.js +544 -0
- package/menusurface/lib/foundation.js.map +1 -0
- package/menusurface/lib/menu-surface-styles.css.d.ts +1 -0
- package/menusurface/lib/menu-surface-styles.css.js +9 -0
- package/menusurface/lib/menu-surface-styles.css.js.map +1 -0
- package/menusurface/lib/menu-surface-styles.scss +16 -0
- package/menusurface/lib/menu-surface.d.ts +58 -0
- package/menusurface/lib/menu-surface.js +386 -0
- package/menusurface/lib/menu-surface.js.map +1 -0
- package/menusurface/lib/types.d.ts +19 -0
- package/menusurface/lib/types.js +7 -0
- package/menusurface/lib/types.js.map +1 -0
- package/menusurface/menu-surface.d.ts +14 -0
- package/menusurface/menu-surface.js +17 -0
- package/menusurface/menu-surface.js.map +1 -0
- package/motion/_animation.scss +33 -0
- package/motion/animation.d.ts +63 -0
- package/motion/animation.js +66 -0
- package/motion/animation.js.map +1 -0
- package/navigationbar/_navigation-bar.scss +7 -0
- package/navigationbar/harness.d.ts +19 -0
- package/navigationbar/harness.js +29 -0
- package/navigationbar/harness.js.map +1 -0
- package/navigationbar/lib/_navigation-bar-theme.scss +87 -0
- package/navigationbar/lib/_navigation-bar.scss +28 -0
- package/navigationbar/lib/constants.d.ts +17 -0
- package/navigationbar/lib/constants.js +7 -0
- package/navigationbar/lib/constants.js.map +1 -0
- package/navigationbar/lib/navigation-bar-styles.css.d.ts +1 -0
- package/navigationbar/lib/navigation-bar-styles.css.js +9 -0
- package/navigationbar/lib/navigation-bar-styles.css.js.map +1 -0
- package/navigationbar/lib/navigation-bar-styles.scss +20 -0
- package/navigationbar/lib/navigation-bar.d.ts +26 -0
- package/navigationbar/lib/navigation-bar.js +150 -0
- package/navigationbar/lib/navigation-bar.js.map +1 -0
- package/navigationbar/lib/state.d.ts +23 -0
- package/navigationbar/lib/state.js +7 -0
- package/navigationbar/lib/state.js.map +1 -0
- package/navigationbar/navigation-bar.d.ts +19 -0
- package/navigationbar/navigation-bar.js +22 -0
- package/navigationbar/navigation-bar.js.map +1 -0
- package/navigationdrawer/_navigation-drawer-modal.scss +6 -0
- package/navigationdrawer/_navigation-drawer.scss +6 -0
- package/navigationdrawer/lib/_navigation-drawer-modal-theme.scss +138 -0
- package/navigationdrawer/lib/_navigation-drawer-modal.scss +78 -0
- package/navigationdrawer/lib/_navigation-drawer-theme.scss +113 -0
- package/navigationdrawer/lib/_navigation-drawer.scss +64 -0
- package/navigationdrawer/lib/navigation-drawer-modal-styles.css.d.ts +1 -0
- package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js +9 -0
- package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js.map +1 -0
- package/navigationdrawer/lib/navigation-drawer-modal-styles.scss +12 -0
- package/navigationdrawer/lib/navigation-drawer-modal.d.ts +24 -0
- package/navigationdrawer/lib/navigation-drawer-modal.js +106 -0
- package/navigationdrawer/lib/navigation-drawer-modal.js.map +1 -0
- package/navigationdrawer/lib/navigation-drawer-styles.css.d.ts +1 -0
- package/navigationdrawer/lib/navigation-drawer-styles.css.js +9 -0
- package/navigationdrawer/lib/navigation-drawer-styles.css.js.map +1 -0
- package/navigationdrawer/lib/navigation-drawer-styles.scss +18 -0
- package/navigationdrawer/lib/navigation-drawer.d.ts +20 -0
- package/navigationdrawer/lib/navigation-drawer.js +87 -0
- package/navigationdrawer/lib/navigation-drawer.js.map +1 -0
- package/navigationdrawer/navigation-drawer-modal.d.ts +19 -0
- package/navigationdrawer/navigation-drawer-modal.js +22 -0
- package/navigationdrawer/navigation-drawer-modal.js.map +1 -0
- package/navigationdrawer/navigation-drawer.d.ts +19 -0
- package/navigationdrawer/navigation-drawer.js +22 -0
- package/navigationdrawer/navigation-drawer.js.map +1 -0
- package/navigationtab/_navigation-tab.scss +7 -0
- package/navigationtab/harness.d.ts +13 -0
- package/navigationtab/harness.js +16 -0
- package/navigationtab/harness.js.map +1 -0
- package/navigationtab/lib/_navigation-tab-theme.scss +343 -0
- package/navigationtab/lib/_navigation-tab.scss +127 -0
- package/navigationtab/lib/navigation-tab-styles.css.d.ts +1 -0
- package/navigationtab/lib/navigation-tab-styles.css.js +9 -0
- package/navigationtab/lib/navigation-tab-styles.css.js.map +1 -0
- package/navigationtab/lib/navigation-tab-styles.scss +21 -0
- package/navigationtab/lib/navigation-tab.d.ts +48 -0
- package/navigationtab/lib/navigation-tab.js +174 -0
- package/navigationtab/lib/navigation-tab.js.map +1 -0
- package/navigationtab/lib/state.d.ts +24 -0
- package/navigationtab/lib/state.js +7 -0
- package/navigationtab/lib/state.js.map +1 -0
- package/navigationtab/navigation-tab.d.ts +19 -0
- package/navigationtab/navigation-tab.js +22 -0
- package/navigationtab/navigation-tab.js.map +1 -0
- package/package.json +48 -0
- package/radio/_radio.scss +1 -0
- package/radio/harness.d.ts +13 -0
- package/radio/harness.js +16 -0
- package/radio/harness.js.map +1 -0
- package/radio/lib/_radio-theme.scss +376 -0
- package/radio/lib/_radio.scss +131 -0
- package/radio/lib/radio-styles.css.d.ts +1 -0
- package/radio/lib/radio-styles.css.js +9 -0
- package/radio/lib/radio-styles.css.js.map +1 -0
- package/radio/lib/radio-styles.scss +14 -0
- package/radio/lib/radio.d.ts +93 -0
- package/radio/lib/radio.js +302 -0
- package/radio/lib/radio.js.map +1 -0
- package/radio/lib/single-selection-controller.d.ts +167 -0
- package/radio/lib/single-selection-controller.js +289 -0
- package/radio/lib/single-selection-controller.js.map +1 -0
- package/radio/radio.d.ts +15 -0
- package/radio/radio.js +18 -0
- package/radio/radio.js.map +1 -0
- package/ripple/_index.scss +6 -0
- package/ripple/_ripple-theme.scss +6 -0
- package/ripple/lib/_ripple-theme.scss +98 -0
- package/ripple/lib/_ripple.scss +84 -0
- package/ripple/lib/ripple-styles.css.d.ts +1 -0
- package/ripple/lib/ripple-styles.css.js +9 -0
- package/ripple/lib/ripple-styles.css.js.map +1 -0
- package/ripple/lib/ripple-styles.scss +16 -0
- package/ripple/lib/ripple.d.ts +62 -0
- package/ripple/lib/ripple.js +215 -0
- package/ripple/lib/ripple.js.map +1 -0
- package/ripple/ripple.d.ts +19 -0
- package/ripple/ripple.js +22 -0
- package/ripple/ripple.js.map +1 -0
- package/sass/_assert.scss +16 -0
- package/sass/_color.scss +186 -0
- package/sass/_dom.scss +52 -0
- package/sass/_elevation.scss +155 -0
- package/sass/_feature-flags.scss +117 -0
- package/sass/_map-ext.scss +25 -0
- package/sass/_resolvers.scss +16 -0
- package/sass/_shape.scss +106 -0
- package/sass/_string-ext.scss +128 -0
- package/sass/_theme.scss +245 -0
- package/sass/_touch-target.scss +22 -0
- package/sass/_typography.scss +114 -0
- package/sass/_var.scss +241 -0
- package/segmentedbutton/lib/_outlined-segmented-button-theme.scss +167 -0
- package/segmentedbutton/lib/_outlined-segmented-button.scss +18 -0
- package/segmentedbutton/lib/_segmented-button-theme.scss +316 -0
- package/segmentedbutton/lib/_segmented-button.scss +159 -0
- package/segmentedbutton/lib/outlined-segmented-button.d.ts +15 -0
- package/segmentedbutton/lib/outlined-segmented-button.js +22 -0
- package/segmentedbutton/lib/outlined-segmented-button.js.map +1 -0
- package/segmentedbutton/lib/outlined-styles.css.d.ts +1 -0
- package/segmentedbutton/lib/outlined-styles.css.js +9 -0
- package/segmentedbutton/lib/outlined-styles.css.js.map +1 -0
- package/segmentedbutton/lib/outlined-styles.scss +17 -0
- package/segmentedbutton/lib/segmented-button-styles.css.d.ts +1 -0
- package/segmentedbutton/lib/segmented-button-styles.css.js +9 -0
- package/segmentedbutton/lib/segmented-button-styles.css.js.map +1 -0
- package/segmentedbutton/lib/segmented-button-styles.scss +8 -0
- package/segmentedbutton/lib/segmented-button.d.ts +60 -0
- package/segmentedbutton/lib/segmented-button.js +229 -0
- package/segmentedbutton/lib/segmented-button.js.map +1 -0
- package/segmentedbutton/outlined-segmented-button.d.ts +21 -0
- package/segmentedbutton/outlined-segmented-button.js +25 -0
- package/segmentedbutton/outlined-segmented-button.js.map +1 -0
- package/segmentedbuttonset/lib/_outlined-segmented-button-set-theme.scss +53 -0
- package/segmentedbuttonset/lib/_outlined-segmented-button-set.scss +12 -0
- package/segmentedbuttonset/lib/_segmented-button-set-theme.scss +41 -0
- package/segmentedbuttonset/lib/_segmented-button-set.scss +21 -0
- package/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts +12 -0
- package/segmentedbuttonset/lib/outlined-segmented-button-set.js +17 -0
- package/segmentedbuttonset/lib/outlined-segmented-button-set.js.map +1 -0
- package/segmentedbuttonset/lib/outlined-styles.css.d.ts +1 -0
- package/segmentedbuttonset/lib/outlined-styles.css.js +9 -0
- package/segmentedbuttonset/lib/outlined-styles.css.js.map +1 -0
- package/segmentedbuttonset/lib/outlined-styles.scss +17 -0
- package/segmentedbuttonset/lib/segmented-button-set.d.ts +34 -0
- package/segmentedbuttonset/lib/segmented-button-set.js +118 -0
- package/segmentedbuttonset/lib/segmented-button-set.js.map +1 -0
- package/segmentedbuttonset/lib/shared-styles.css.d.ts +1 -0
- package/segmentedbuttonset/lib/shared-styles.css.js +9 -0
- package/segmentedbuttonset/lib/shared-styles.css.js.map +1 -0
- package/segmentedbuttonset/lib/shared-styles.scss +8 -0
- package/segmentedbuttonset/outlined-segmented-button-set.d.ts +21 -0
- package/segmentedbuttonset/outlined-segmented-button-set.js +25 -0
- package/segmentedbuttonset/outlined-segmented-button-set.js.map +1 -0
- package/switch/_switch.scss +7 -0
- package/switch/harness.d.ts +13 -0
- package/switch/harness.js +16 -0
- package/switch/harness.js.map +1 -0
- package/switch/lib/_switch-handle-theme.scss +137 -0
- package/switch/lib/_switch-icon-theme.scss +52 -0
- package/switch/lib/_switch-theme.scss +232 -0
- package/switch/lib/_switch-track-theme.scss +117 -0
- package/switch/lib/_switch.scss +210 -0
- package/switch/lib/switch-styles.css.d.ts +1 -0
- package/switch/lib/switch-styles.css.js +9 -0
- package/switch/lib/switch-styles.css.js.map +1 -0
- package/switch/lib/switch-styles.scss +11 -0
- package/switch/lib/switch.d.ts +59 -0
- package/switch/lib/switch.js +223 -0
- package/switch/lib/switch.js.map +1 -0
- package/switch/switch.d.ts +19 -0
- package/switch/switch.js +22 -0
- package/switch/switch.js.map +1 -0
- package/textfield/_filled-text-field.scss +9 -0
- package/textfield/_outlined-text-field.scss +9 -0
- package/textfield/filled-text-field.d.ts +21 -0
- package/textfield/filled-text-field.js +31 -0
- package/textfield/filled-text-field.js.map +1 -0
- package/textfield/harness.d.ts +51 -0
- package/textfield/harness.js +118 -0
- package/textfield/harness.js.map +1 -0
- package/textfield/lib/_filled-text-field-theme.scss +203 -0
- package/textfield/lib/_icon-theme.scss +100 -0
- package/textfield/lib/_icon.scss +18 -0
- package/textfield/lib/_input-theme.scss +91 -0
- package/textfield/lib/_input.scss +38 -0
- package/textfield/lib/_outlined-text-field-theme.scss +186 -0
- package/textfield/lib/_text-field.scss +28 -0
- package/textfield/lib/filled-forced-colors-styles.css.d.ts +1 -0
- package/textfield/lib/filled-forced-colors-styles.css.js +9 -0
- package/textfield/lib/filled-forced-colors-styles.css.js.map +1 -0
- package/textfield/lib/filled-forced-colors-styles.scss +17 -0
- package/textfield/lib/filled-styles.css.d.ts +1 -0
- package/textfield/lib/filled-styles.css.js +9 -0
- package/textfield/lib/filled-styles.css.js.map +1 -0
- package/textfield/lib/filled-styles.scss +15 -0
- package/textfield/lib/filled-text-field.d.ts +12 -0
- package/textfield/lib/filled-text-field.js +17 -0
- package/textfield/lib/filled-text-field.js.map +1 -0
- package/textfield/lib/outlined-forced-colors-styles.css.d.ts +1 -0
- package/textfield/lib/outlined-forced-colors-styles.css.js +9 -0
- package/textfield/lib/outlined-forced-colors-styles.css.js.map +1 -0
- package/textfield/lib/outlined-forced-colors-styles.scss +17 -0
- package/textfield/lib/outlined-styles.css.d.ts +1 -0
- package/textfield/lib/outlined-styles.css.js +9 -0
- package/textfield/lib/outlined-styles.css.js.map +1 -0
- package/textfield/lib/outlined-styles.scss +15 -0
- package/textfield/lib/outlined-text-field.d.ts +12 -0
- package/textfield/lib/outlined-text-field.js +17 -0
- package/textfield/lib/outlined-text-field.js.map +1 -0
- package/textfield/lib/shared-styles.css.d.ts +1 -0
- package/textfield/lib/shared-styles.css.js +9 -0
- package/textfield/lib/shared-styles.css.js.map +1 -0
- package/textfield/lib/shared-styles.scss +12 -0
- package/textfield/lib/text-field.d.ts +319 -0
- package/textfield/lib/text-field.js +707 -0
- package/textfield/lib/text-field.js.map +1 -0
- package/textfield/outlined-text-field.d.ts +21 -0
- package/textfield/outlined-text-field.js +31 -0
- package/textfield/outlined-text-field.js.map +1 -0
- package/tokens/_index.scss +6 -0
- package/tokens/latest/_index.scss +186 -0
- package/tokens/latest/_md-comp-assist-chip.scss +98 -0
- package/tokens/latest/_md-comp-badge.scss +51 -0
- package/tokens/latest/_md-comp-banner.scss +99 -0
- package/tokens/latest/_md-comp-bottom-app-bar.scss +36 -0
- package/tokens/latest/_md-comp-checkbox.scss +119 -0
- package/tokens/latest/_md-comp-circular-progress-indicator.scss +37 -0
- package/tokens/latest/_md-comp-date-input-modal.scss +76 -0
- package/tokens/latest/_md-comp-date-picker-docked.scss +210 -0
- package/tokens/latest/_md-comp-date-picker-modal.scss +254 -0
- package/tokens/latest/_md-comp-dialog.scss +115 -0
- package/tokens/latest/_md-comp-divider.scss +25 -0
- package/tokens/latest/_md-comp-elevated-button.scss +83 -0
- package/tokens/latest/_md-comp-elevated-card.scss +59 -0
- package/tokens/latest/_md-comp-extended-fab-branded.scss +77 -0
- package/tokens/latest/_md-comp-extended-fab-primary.scss +80 -0
- package/tokens/latest/_md-comp-extended-fab-secondary.scss +83 -0
- package/tokens/latest/_md-comp-extended-fab-surface.scss +81 -0
- package/tokens/latest/_md-comp-extended-fab-tertiary.scss +80 -0
- package/tokens/latest/_md-comp-fab-branded-large.scss +59 -0
- package/tokens/latest/_md-comp-fab-branded.scss +58 -0
- package/tokens/latest/_md-comp-fab-primary-large.scss +61 -0
- package/tokens/latest/_md-comp-fab-primary-small.scss +61 -0
- package/tokens/latest/_md-comp-fab-primary.scss +61 -0
- package/tokens/latest/_md-comp-fab-secondary-large.scss +63 -0
- package/tokens/latest/_md-comp-fab-secondary-small.scss +62 -0
- package/tokens/latest/_md-comp-fab-secondary.scss +63 -0
- package/tokens/latest/_md-comp-fab-surface-large.scss +62 -0
- package/tokens/latest/_md-comp-fab-surface-small.scss +62 -0
- package/tokens/latest/_md-comp-fab-surface.scss +62 -0
- package/tokens/latest/_md-comp-fab-tertiary-large.scss +61 -0
- package/tokens/latest/_md-comp-fab-tertiary-small.scss +61 -0
- package/tokens/latest/_md-comp-fab-tertiary.scss +61 -0
- package/tokens/latest/_md-comp-filled-autocomplete.scss +235 -0
- package/tokens/latest/_md-comp-filled-button.scss +87 -0
- package/tokens/latest/_md-comp-filled-card.scss +59 -0
- package/tokens/latest/_md-comp-filled-icon-button.scss +72 -0
- package/tokens/latest/_md-comp-filled-menu-button.scss +89 -0
- package/tokens/latest/_md-comp-filled-select.scss +243 -0
- package/tokens/latest/_md-comp-filled-text-field.scss +146 -0
- package/tokens/latest/_md-comp-filled-tonal-button.scss +88 -0
- package/tokens/latest/_md-comp-filled-tonal-icon-button.scss +83 -0
- package/tokens/latest/_md-comp-filter-chip.scss +172 -0
- package/tokens/latest/_md-comp-full-screen-dialog.scss +131 -0
- package/tokens/latest/_md-comp-icon-button.scss +66 -0
- package/tokens/latest/_md-comp-input-chip.scss +112 -0
- package/tokens/latest/_md-comp-linear-progress-indicator.scss +39 -0
- package/tokens/latest/_md-comp-list.scss +205 -0
- package/tokens/latest/_md-comp-menu.scss +113 -0
- package/tokens/latest/_md-comp-navigation-bar.scss +97 -0
- package/tokens/latest/_md-comp-navigation-drawer.scss +137 -0
- package/tokens/latest/_md-comp-navigation-rail.scss +132 -0
- package/tokens/latest/_md-comp-outlined-autocomplete.scss +223 -0
- package/tokens/latest/_md-comp-outlined-button.scss +80 -0
- package/tokens/latest/_md-comp-outlined-card.scss +65 -0
- package/tokens/latest/_md-comp-outlined-icon-button.scss +68 -0
- package/tokens/latest/_md-comp-outlined-menu-button.scss +83 -0
- package/tokens/latest/_md-comp-outlined-segmented-button.scss +97 -0
- package/tokens/latest/_md-comp-outlined-select.scss +231 -0
- package/tokens/latest/_md-comp-outlined-text-field.scss +140 -0
- package/tokens/latest/_md-comp-plain-tooltip.scss +46 -0
- package/tokens/latest/_md-comp-primary-navigation-tab.scss +110 -0
- package/tokens/latest/_md-comp-radio-button.scss +58 -0
- package/tokens/latest/_md-comp-rich-tooltip.scss +98 -0
- package/tokens/latest/_md-comp-search-bar.scss +84 -0
- package/tokens/latest/_md-comp-search-view.scss +79 -0
- package/tokens/latest/_md-comp-secondary-navigation-tab.scss +78 -0
- package/tokens/latest/_md-comp-sheet-bottom.scss +41 -0
- package/tokens/latest/_md-comp-sheet-floating.scss +34 -0
- package/tokens/latest/_md-comp-sheet-side.scss +75 -0
- package/tokens/latest/_md-comp-slider.scss +105 -0
- package/tokens/latest/_md-comp-snackbar.scss +91 -0
- package/tokens/latest/_md-comp-standard-menu-button.scss +82 -0
- package/tokens/latest/_md-comp-suggestion-chip.scss +90 -0
- package/tokens/latest/_md-comp-switch.scss +126 -0
- package/tokens/latest/_md-comp-text-button.scss +75 -0
- package/tokens/latest/_md-comp-time-input.scss +184 -0
- package/tokens/latest/_md-comp-time-picker.scss +235 -0
- package/tokens/latest/_md-comp-top-app-bar-large.scss +57 -0
- package/tokens/latest/_md-comp-top-app-bar-medium.scss +56 -0
- package/tokens/latest/_md-comp-top-app-bar-small-centered.scss +60 -0
- package/tokens/latest/_md-comp-top-app-bar-small.scss +58 -0
- package/tokens/latest/_md-ref-palette.scss +95 -0
- package/tokens/latest/_md-ref-typeface.scss +20 -0
- package/tokens/latest/_md-sys-color.scss +1006 -0
- package/tokens/latest/_md-sys-elevation.scss +30 -0
- package/tokens/latest/_md-sys-motion.scss +51 -0
- package/tokens/latest/_md-sys-shape.scss +26 -0
- package/tokens/latest/_md-sys-state.scss +19 -0
- package/tokens/latest/_md-sys-typescale.scss +204 -0
- package/tokens/v0_75/_index.scss +154 -0
- package/tokens/v0_75/_md-comp-assist-chip.scss +98 -0
- package/tokens/v0_75/_md-comp-badge.scss +51 -0
- package/tokens/v0_75/_md-comp-banner.scss +99 -0
- package/tokens/v0_75/_md-comp-bottom-app-bar.scss +36 -0
- package/tokens/v0_75/_md-comp-checkbox.scss +59 -0
- package/tokens/v0_75/_md-comp-circular-progress-indicator.scss +37 -0
- package/tokens/v0_75/_md-comp-dialog.scss +102 -0
- package/tokens/v0_75/_md-comp-elevated-button.scss +83 -0
- package/tokens/v0_75/_md-comp-elevated-card.scss +56 -0
- package/tokens/v0_75/_md-comp-extended-fab-branded.scss +77 -0
- package/tokens/v0_75/_md-comp-extended-fab-primary.scss +80 -0
- package/tokens/v0_75/_md-comp-extended-fab-secondary.scss +83 -0
- package/tokens/v0_75/_md-comp-extended-fab-surface.scss +81 -0
- package/tokens/v0_75/_md-comp-extended-fab-tertiary.scss +80 -0
- package/tokens/v0_75/_md-comp-fab-branded-large.scss +59 -0
- package/tokens/v0_75/_md-comp-fab-branded.scss +58 -0
- package/tokens/v0_75/_md-comp-fab-primary-large.scss +61 -0
- package/tokens/v0_75/_md-comp-fab-primary-small.scss +61 -0
- package/tokens/v0_75/_md-comp-fab-primary.scss +61 -0
- package/tokens/v0_75/_md-comp-fab-secondary-large.scss +63 -0
- package/tokens/v0_75/_md-comp-fab-secondary-small.scss +62 -0
- package/tokens/v0_75/_md-comp-fab-secondary.scss +63 -0
- package/tokens/v0_75/_md-comp-fab-surface-large.scss +62 -0
- package/tokens/v0_75/_md-comp-fab-surface-small.scss +62 -0
- package/tokens/v0_75/_md-comp-fab-surface.scss +62 -0
- package/tokens/v0_75/_md-comp-fab-tertiary-large.scss +61 -0
- package/tokens/v0_75/_md-comp-fab-tertiary-small.scss +61 -0
- package/tokens/v0_75/_md-comp-fab-tertiary.scss +61 -0
- package/tokens/v0_75/_md-comp-filled-button-tonal.scss +84 -0
- package/tokens/v0_75/_md-comp-filled-button.scss +87 -0
- package/tokens/v0_75/_md-comp-filled-card.scss +56 -0
- package/tokens/v0_75/_md-comp-filled-icon-button.scss +72 -0
- package/tokens/v0_75/_md-comp-filled-text-field.scss +142 -0
- package/tokens/v0_75/_md-comp-filled-tonal-button.scss +88 -0
- package/tokens/v0_75/_md-comp-filled-tonal-icon-button.scss +83 -0
- package/tokens/v0_75/_md-comp-filter-chip.scss +172 -0
- package/tokens/v0_75/_md-comp-full-screen-dialog.scss +131 -0
- package/tokens/v0_75/_md-comp-icon-button.scss +79 -0
- package/tokens/v0_75/_md-comp-input-chip.scss +112 -0
- package/tokens/v0_75/_md-comp-linear-progress-indicator.scss +39 -0
- package/tokens/v0_75/_md-comp-list.scss +205 -0
- package/tokens/v0_75/_md-comp-menu.scss +113 -0
- package/tokens/v0_75/_md-comp-navigation-bar.scss +131 -0
- package/tokens/v0_75/_md-comp-navigation-drawer.scss +137 -0
- package/tokens/v0_75/_md-comp-navigation-rail.scss +136 -0
- package/tokens/v0_75/_md-comp-outlined-button.scss +80 -0
- package/tokens/v0_75/_md-comp-outlined-card.scss +62 -0
- package/tokens/v0_75/_md-comp-outlined-icon-button.scss +68 -0
- package/tokens/v0_75/_md-comp-outlined-segmented-button.scss +96 -0
- package/tokens/v0_75/_md-comp-outlined-text-field.scss +136 -0
- package/tokens/v0_75/_md-comp-primary-navigation-tab.scss +116 -0
- package/tokens/v0_75/_md-comp-radio-button.scss +58 -0
- package/tokens/v0_75/_md-comp-rich-tooltip.scss +98 -0
- package/tokens/v0_75/_md-comp-secondary-navigation-tab.scss +75 -0
- package/tokens/v0_75/_md-comp-slider.scss +129 -0
- package/tokens/v0_75/_md-comp-snackbar.scss +77 -0
- package/tokens/v0_75/_md-comp-suggestion-chip.scss +90 -0
- package/tokens/v0_75/_md-comp-switch.scss +92 -0
- package/tokens/v0_75/_md-comp-text-button.scss +75 -0
- package/tokens/v0_75/_md-comp-top-app-bar-compact-centered.scss +53 -0
- package/tokens/v0_75/_md-comp-top-app-bar-compact.scss +43 -0
- package/tokens/v0_75/_md-comp-top-app-bar-large.scss +57 -0
- package/tokens/v0_75/_md-comp-top-app-bar-medium.scss +56 -0
- package/tokens/v0_75/_md-comp-top-app-bar-small-centered.scss +60 -0
- package/tokens/v0_75/_md-comp-top-app-bar-small.scss +58 -0
- package/tokens/v0_75/_md-ref-palette.scss +186 -0
- package/tokens/v0_75/_md-ref-typeface.scss +25 -0
- package/tokens/v0_75/_md-sys-color.scss +86 -0
- package/tokens/v0_75/_md-sys-elevation.scss +30 -0
- package/tokens/v0_75/_md-sys-motion.scss +61 -0
- package/tokens/v0_75/_md-sys-shape.scss +29 -0
- package/tokens/v0_75/_md-sys-state.scss +19 -0
- package/tokens/v0_75/_md-sys-typescale.scss +252 -0
- package/tokens/v0_93/_index.scss +184 -0
- package/tokens/v0_93/_md-comp-assist-chip.scss +98 -0
- package/tokens/v0_93/_md-comp-badge.scss +51 -0
- package/tokens/v0_93/_md-comp-banner.scss +99 -0
- package/tokens/v0_93/_md-comp-bottom-app-bar.scss +36 -0
- package/tokens/v0_93/_md-comp-checkbox.scss +119 -0
- package/tokens/v0_93/_md-comp-circular-progress-indicator.scss +37 -0
- package/tokens/v0_93/_md-comp-date-input-modal.scss +76 -0
- package/tokens/v0_93/_md-comp-date-picker-docked.scss +210 -0
- package/tokens/v0_93/_md-comp-date-picker-modal.scss +254 -0
- package/tokens/v0_93/_md-comp-dialog.scss +101 -0
- package/tokens/v0_93/_md-comp-divider.scss +25 -0
- package/tokens/v0_93/_md-comp-elevated-button.scss +83 -0
- package/tokens/v0_93/_md-comp-elevated-card.scss +59 -0
- package/tokens/v0_93/_md-comp-extended-fab-branded.scss +77 -0
- package/tokens/v0_93/_md-comp-extended-fab-primary.scss +80 -0
- package/tokens/v0_93/_md-comp-extended-fab-secondary.scss +83 -0
- package/tokens/v0_93/_md-comp-extended-fab-surface.scss +81 -0
- package/tokens/v0_93/_md-comp-extended-fab-tertiary.scss +80 -0
- package/tokens/v0_93/_md-comp-fab-branded-large.scss +59 -0
- package/tokens/v0_93/_md-comp-fab-branded.scss +58 -0
- package/tokens/v0_93/_md-comp-fab-primary-large.scss +61 -0
- package/tokens/v0_93/_md-comp-fab-primary-small.scss +61 -0
- package/tokens/v0_93/_md-comp-fab-primary.scss +61 -0
- package/tokens/v0_93/_md-comp-fab-secondary-large.scss +63 -0
- package/tokens/v0_93/_md-comp-fab-secondary-small.scss +62 -0
- package/tokens/v0_93/_md-comp-fab-secondary.scss +63 -0
- package/tokens/v0_93/_md-comp-fab-surface-large.scss +62 -0
- package/tokens/v0_93/_md-comp-fab-surface-small.scss +62 -0
- package/tokens/v0_93/_md-comp-fab-surface.scss +62 -0
- package/tokens/v0_93/_md-comp-fab-tertiary-large.scss +61 -0
- package/tokens/v0_93/_md-comp-fab-tertiary-small.scss +61 -0
- package/tokens/v0_93/_md-comp-fab-tertiary.scss +61 -0
- package/tokens/v0_93/_md-comp-filled-autocomplete.scss +235 -0
- package/tokens/v0_93/_md-comp-filled-button.scss +87 -0
- package/tokens/v0_93/_md-comp-filled-card.scss +59 -0
- package/tokens/v0_93/_md-comp-filled-icon-button.scss +72 -0
- package/tokens/v0_93/_md-comp-filled-menu-button.scss +89 -0
- package/tokens/v0_93/_md-comp-filled-select.scss +243 -0
- package/tokens/v0_93/_md-comp-filled-text-field.scss +146 -0
- package/tokens/v0_93/_md-comp-filled-tonal-button.scss +88 -0
- package/tokens/v0_93/_md-comp-filled-tonal-icon-button.scss +83 -0
- package/tokens/v0_93/_md-comp-filter-chip.scss +172 -0
- package/tokens/v0_93/_md-comp-full-screen-dialog.scss +131 -0
- package/tokens/v0_93/_md-comp-icon-button.scss +66 -0
- package/tokens/v0_93/_md-comp-input-chip.scss +112 -0
- package/tokens/v0_93/_md-comp-linear-progress-indicator.scss +39 -0
- package/tokens/v0_93/_md-comp-list.scss +205 -0
- package/tokens/v0_93/_md-comp-menu.scss +113 -0
- package/tokens/v0_93/_md-comp-navigation-bar.scss +97 -0
- package/tokens/v0_93/_md-comp-navigation-drawer.scss +137 -0
- package/tokens/v0_93/_md-comp-navigation-rail.scss +132 -0
- package/tokens/v0_93/_md-comp-outlined-autocomplete.scss +223 -0
- package/tokens/v0_93/_md-comp-outlined-button.scss +80 -0
- package/tokens/v0_93/_md-comp-outlined-card.scss +65 -0
- package/tokens/v0_93/_md-comp-outlined-icon-button.scss +68 -0
- package/tokens/v0_93/_md-comp-outlined-menu-button.scss +83 -0
- package/tokens/v0_93/_md-comp-outlined-segmented-button.scss +97 -0
- package/tokens/v0_93/_md-comp-outlined-select.scss +231 -0
- package/tokens/v0_93/_md-comp-outlined-text-field.scss +140 -0
- package/tokens/v0_93/_md-comp-plain-tooltip.scss +46 -0
- package/tokens/v0_93/_md-comp-primary-navigation-tab.scss +110 -0
- package/tokens/v0_93/_md-comp-radio-button.scss +58 -0
- package/tokens/v0_93/_md-comp-rich-tooltip.scss +98 -0
- package/tokens/v0_93/_md-comp-search-bar.scss +84 -0
- package/tokens/v0_93/_md-comp-search-view.scss +79 -0
- package/tokens/v0_93/_md-comp-secondary-navigation-tab.scss +78 -0
- package/tokens/v0_93/_md-comp-sheet-bottom.scss +41 -0
- package/tokens/v0_93/_md-comp-sheet-side.scss +75 -0
- package/tokens/v0_93/_md-comp-slider.scss +105 -0
- package/tokens/v0_93/_md-comp-snackbar.scss +91 -0
- package/tokens/v0_93/_md-comp-standard-menu-button.scss +82 -0
- package/tokens/v0_93/_md-comp-suggestion-chip.scss +90 -0
- package/tokens/v0_93/_md-comp-switch.scss +126 -0
- package/tokens/v0_93/_md-comp-text-button.scss +75 -0
- package/tokens/v0_93/_md-comp-time-input.scss +184 -0
- package/tokens/v0_93/_md-comp-time-picker.scss +235 -0
- package/tokens/v0_93/_md-comp-top-app-bar-large.scss +57 -0
- package/tokens/v0_93/_md-comp-top-app-bar-medium.scss +56 -0
- package/tokens/v0_93/_md-comp-top-app-bar-small-centered.scss +60 -0
- package/tokens/v0_93/_md-comp-top-app-bar-small.scss +58 -0
- package/tokens/v0_93/_md-ref-palette.scss +95 -0
- package/tokens/v0_93/_md-ref-typeface.scss +20 -0
- package/tokens/v0_93/_md-sys-color.scss +1006 -0
- package/tokens/v0_93/_md-sys-elevation.scss +30 -0
- package/tokens/v0_93/_md-sys-motion.scss +51 -0
- package/tokens/v0_93/_md-sys-shape.scss +26 -0
- package/tokens/v0_93/_md-sys-state.scss +19 -0
- package/tokens/v0_93/_md-sys-typescale.scss +204 -0
- package/types/aria.d.ts +48 -0
- package/types/keys.d.ts +57 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { MDCChipAnimationEventDetail, MDCChipInteractionEventDetail, MDCChipNavigationEventDetail } from '../../chip/lib/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* MDCChipSetInteractionEventDetail provides detail about the interaction event.
|
|
9
|
+
*/
|
|
10
|
+
export interface MDCChipSetInteractionEventDetail {
|
|
11
|
+
chipID: string;
|
|
12
|
+
chipIndex: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* MDCChipSetRemovalEventDetail provides detail about the removal event.
|
|
16
|
+
*/
|
|
17
|
+
export interface MDCChipSetRemovalEventDetail {
|
|
18
|
+
chipID: string;
|
|
19
|
+
chipIndex: number;
|
|
20
|
+
isComplete: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* MDCChipSetSelectionEventDetail provides detail about the selection event.
|
|
24
|
+
*/
|
|
25
|
+
export interface MDCChipSetSelectionEventDetail {
|
|
26
|
+
chipID: string;
|
|
27
|
+
chipIndex: number;
|
|
28
|
+
isSelected: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* ChipInteractionEvent is the custom event for the interaction event.
|
|
32
|
+
*/
|
|
33
|
+
export declare type ChipInteractionEvent = CustomEvent<MDCChipInteractionEventDetail>;
|
|
34
|
+
/**
|
|
35
|
+
* ChipNavigationEvent is the custom event for the navigation event.
|
|
36
|
+
*/
|
|
37
|
+
export declare type ChipNavigationEvent = CustomEvent<MDCChipNavigationEventDetail>;
|
|
38
|
+
/**
|
|
39
|
+
* ChipAnimationEvent is the custom event for the animation event.
|
|
40
|
+
*/
|
|
41
|
+
export declare type ChipAnimationEvent = CustomEvent<MDCChipAnimationEventDetail>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {MDCChipAnimationEventDetail, MDCChipInteractionEventDetail, MDCChipNavigationEventDetail} from '../../chip/lib/types.js';\n\n/**\n * MDCChipSetInteractionEventDetail provides detail about the interaction event.\n */\nexport interface MDCChipSetInteractionEventDetail {\n chipID: string;\n chipIndex: number;\n}\n\n/**\n * MDCChipSetRemovalEventDetail provides detail about the removal event.\n */\nexport interface MDCChipSetRemovalEventDetail {\n chipID: string;\n chipIndex: number;\n isComplete: boolean;\n}\n\n/**\n * MDCChipSetSelectionEventDetail provides detail about the selection event.\n */\nexport interface MDCChipSetSelectionEventDetail {\n chipID: string;\n chipIndex: number;\n isSelected: boolean;\n}\n\n/**\n * ChipInteractionEvent is the custom event for the interaction event.\n */\nexport type ChipInteractionEvent = CustomEvent<MDCChipInteractionEventDetail>;\n\n/**\n * ChipNavigationEvent is the custom event for the navigation event.\n */\nexport type ChipNavigationEvent = CustomEvent<MDCChipNavigationEventDetail>;\n\n/**\n * ChipAnimationEvent is the custom event for the animation event.\n */\nexport type ChipAnimationEvent = CustomEvent<MDCChipAnimationEventDetail>;\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* AnimationFrame provides a user-friendly abstraction around requesting
|
|
8
|
+
* and canceling animation frames.
|
|
9
|
+
*/
|
|
10
|
+
export declare class AnimationFrame {
|
|
11
|
+
private readonly rafIDs;
|
|
12
|
+
/**
|
|
13
|
+
* Requests an animation frame. Cancels any existing frame with the same key.
|
|
14
|
+
* @param {string} key The key for this callback.
|
|
15
|
+
* @param {FrameRequestCallback} callback The callback to be executed.
|
|
16
|
+
*/
|
|
17
|
+
request(key: string, callback: FrameRequestCallback): void;
|
|
18
|
+
/**
|
|
19
|
+
* Cancels a queued callback with the given key.
|
|
20
|
+
* @param {string} key The key for this callback.
|
|
21
|
+
*/
|
|
22
|
+
cancel(key: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Cancels all queued callback.
|
|
25
|
+
*/
|
|
26
|
+
cancelAll(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the queue of unexecuted callback keys.
|
|
29
|
+
*/
|
|
30
|
+
getQueue(): string[];
|
|
31
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* AnimationFrame provides a user-friendly abstraction around requesting
|
|
8
|
+
* and canceling animation frames.
|
|
9
|
+
*/
|
|
10
|
+
export class AnimationFrame {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.rafIDs = new Map();
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Requests an animation frame. Cancels any existing frame with the same key.
|
|
16
|
+
* @param {string} key The key for this callback.
|
|
17
|
+
* @param {FrameRequestCallback} callback The callback to be executed.
|
|
18
|
+
*/
|
|
19
|
+
request(key, callback) {
|
|
20
|
+
this.cancel(key);
|
|
21
|
+
const frameID = requestAnimationFrame((frame) => {
|
|
22
|
+
this.rafIDs.delete(key);
|
|
23
|
+
// Callback must come *after* the key is deleted so that nested calls to
|
|
24
|
+
// request with the same key are not deleted.
|
|
25
|
+
callback(frame);
|
|
26
|
+
});
|
|
27
|
+
this.rafIDs.set(key, frameID);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Cancels a queued callback with the given key.
|
|
31
|
+
* @param {string} key The key for this callback.
|
|
32
|
+
*/
|
|
33
|
+
cancel(key) {
|
|
34
|
+
const rafID = this.rafIDs.get(key);
|
|
35
|
+
if (rafID) {
|
|
36
|
+
cancelAnimationFrame(rafID);
|
|
37
|
+
this.rafIDs.delete(key);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Cancels all queued callback.
|
|
42
|
+
*/
|
|
43
|
+
cancelAll() {
|
|
44
|
+
// Need to use forEach because it's the only iteration method supported
|
|
45
|
+
// by IE11. Suppress the underscore because we don't need it.
|
|
46
|
+
// tslint:disable-next-line:enforce-name-casing
|
|
47
|
+
this.rafIDs.forEach((_, key) => {
|
|
48
|
+
this.cancel(key);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Returns the queue of unexecuted callback keys.
|
|
53
|
+
*/
|
|
54
|
+
getQueue() {
|
|
55
|
+
const queue = [];
|
|
56
|
+
// Need to use forEach because it's the only iteration method supported
|
|
57
|
+
// by IE11. Suppress the underscore because we don't need it.
|
|
58
|
+
// tslint:disable-next-line:enforce-name-casing
|
|
59
|
+
this.rafIDs.forEach((_, key) => {
|
|
60
|
+
queue.push(key);
|
|
61
|
+
});
|
|
62
|
+
return queue;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=animationframe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animationframe.js","sourceRoot":"","sources":["animationframe.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,OAAO,cAAc;IAA3B;QACmB,WAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IAuDtD,CAAC;IArDC;;;;OAIG;IACH,OAAO,CAAC,GAAW,EAAE,QAA8B;QACjD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjB,MAAM,OAAO,GAAG,qBAAqB,CAAC,CAAC,KAAK,EAAE,EAAE;YAC9C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACxB,wEAAwE;YACxE,6CAA6C;YAC7C,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAChC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,GAAW;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,KAAK,EAAE;YACT,oBAAoB,CAAC,KAAK,CAAC,CAAC;YAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACzB;IACH,CAAC;IAED;;OAEG;IACH,SAAS;QACP,uEAAuE;QACvE,6DAA6D;QAC7D,+CAA+C;QAC/C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;YAC7B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,uEAAuE;QACvE,6DAA6D;QAC7D,+CAA+C;QAC/C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;YAC7B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QACH,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * AnimationFrame provides a user-friendly abstraction around requesting\n * and canceling animation frames.\n */\nexport class AnimationFrame {\n private readonly rafIDs = new Map<string, number>();\n\n /**\n * Requests an animation frame. Cancels any existing frame with the same key.\n * @param {string} key The key for this callback.\n * @param {FrameRequestCallback} callback The callback to be executed.\n */\n request(key: string, callback: FrameRequestCallback) {\n this.cancel(key);\n const frameID = requestAnimationFrame((frame) => {\n this.rafIDs.delete(key);\n // Callback must come *after* the key is deleted so that nested calls to\n // request with the same key are not deleted.\n callback(frame);\n });\n this.rafIDs.set(key, frameID);\n }\n\n /**\n * Cancels a queued callback with the given key.\n * @param {string} key The key for this callback.\n */\n cancel(key: string) {\n const rafID = this.rafIDs.get(key);\n if (rafID) {\n cancelAnimationFrame(rafID);\n this.rafIDs.delete(key);\n }\n }\n\n /**\n * Cancels all queued callback.\n */\n cancelAll() {\n // Need to use forEach because it's the only iteration method supported\n // by IE11. Suppress the underscore because we don't need it.\n // tslint:disable-next-line:enforce-name-casing\n this.rafIDs.forEach((_, key) => {\n this.cancel(key);\n });\n }\n\n /**\n * Returns the queue of unexecuted callback keys.\n */\n getQueue(): string[] {\n const queue: string[] = [];\n // Need to use forEach because it's the only iteration method supported\n // by IE11. Suppress the underscore because we don't need it.\n // tslint:disable-next-line:enforce-name-casing\n this.rafIDs.forEach((_, key) => {\n queue.push(key);\n });\n return queue;\n }\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* A value for the `aria-haspopup` ARIA attribute.
|
|
8
|
+
*/
|
|
9
|
+
export declare type AriaHasPopup = 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
10
|
+
/**
|
|
11
|
+
* A property decorator proxies an aria attribute to an internal node
|
|
12
|
+
*
|
|
13
|
+
* This decorator is only intended for use with ARIA attributes, such as `role`
|
|
14
|
+
* and `aria-label` due to screenreader needs.
|
|
15
|
+
*
|
|
16
|
+
* Upon first render, `@ariaProperty` will remove the attribute from the host
|
|
17
|
+
* element to prevent screenreaders from reading the host instead of the
|
|
18
|
+
* internal node.
|
|
19
|
+
*
|
|
20
|
+
* This decorator should only be used for non-Symbol public fields decorated
|
|
21
|
+
* with `@property`, or on a setter with an optional getter.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* class MyElement {
|
|
26
|
+
* @ariaProperty
|
|
27
|
+
* @property({ type: String, attribute: 'aria-label' })
|
|
28
|
+
* ariaLabel!: string;
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
* @category Decorator
|
|
32
|
+
* @ExportDecoratedItems
|
|
33
|
+
*/
|
|
34
|
+
export declare function ariaProperty(protoOrDescriptor: {}, name?: string, descriptor?: PropertyDescriptor): any;
|
|
35
|
+
/**
|
|
36
|
+
* A temporary alias for the time of AriaMixin properties type migration from
|
|
37
|
+
* (string|undefined) to (string|null).
|
|
38
|
+
*/
|
|
39
|
+
export declare type AnyDuringAriaMigration = any;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* TypeScript version of the decorator
|
|
8
|
+
* @see https://www.typescriptlang.org/docs/handbook/decorators.html#property-decorators
|
|
9
|
+
*/
|
|
10
|
+
function tsDecorator(prototype, name, descriptor) {
|
|
11
|
+
const constructor = prototype.constructor;
|
|
12
|
+
if (!descriptor) {
|
|
13
|
+
/**
|
|
14
|
+
* lit uses internal properties with two leading underscores to
|
|
15
|
+
* provide storage for accessors
|
|
16
|
+
*/
|
|
17
|
+
const litInternalPropertyKey = `__${name}`;
|
|
18
|
+
descriptor =
|
|
19
|
+
constructor.getPropertyDescriptor(name, litInternalPropertyKey);
|
|
20
|
+
if (!descriptor) {
|
|
21
|
+
throw new Error('@ariaProperty must be used after a @property decorator');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// descriptor must exist at this point, reassign so typescript understands
|
|
25
|
+
const propDescriptor = descriptor;
|
|
26
|
+
let attribute = '';
|
|
27
|
+
if (!propDescriptor.set) {
|
|
28
|
+
throw new Error(`@ariaProperty requires a setter for ${name}`);
|
|
29
|
+
}
|
|
30
|
+
// TODO(b/202853219): Remove this check when internal tooling is
|
|
31
|
+
// compatible
|
|
32
|
+
// tslint:disable-next-line:no-any bail if applied to internal generated class
|
|
33
|
+
if (prototype.dispatchWizEvent) {
|
|
34
|
+
return descriptor;
|
|
35
|
+
}
|
|
36
|
+
const wrappedDescriptor = {
|
|
37
|
+
configurable: true,
|
|
38
|
+
enumerable: true,
|
|
39
|
+
set(value) {
|
|
40
|
+
if (attribute === '') {
|
|
41
|
+
const options = constructor.getPropertyOptions(name);
|
|
42
|
+
// if attribute is not a string, use `name` instead
|
|
43
|
+
attribute =
|
|
44
|
+
typeof options.attribute === 'string' ? options.attribute : name;
|
|
45
|
+
}
|
|
46
|
+
if (this.hasAttribute(attribute)) {
|
|
47
|
+
this.removeAttribute(attribute);
|
|
48
|
+
}
|
|
49
|
+
propDescriptor.set.call(this, value);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
if (propDescriptor.get) {
|
|
53
|
+
wrappedDescriptor.get = function () {
|
|
54
|
+
return propDescriptor.get.call(this);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return wrappedDescriptor;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A property decorator proxies an aria attribute to an internal node
|
|
61
|
+
*
|
|
62
|
+
* This decorator is only intended for use with ARIA attributes, such as `role`
|
|
63
|
+
* and `aria-label` due to screenreader needs.
|
|
64
|
+
*
|
|
65
|
+
* Upon first render, `@ariaProperty` will remove the attribute from the host
|
|
66
|
+
* element to prevent screenreaders from reading the host instead of the
|
|
67
|
+
* internal node.
|
|
68
|
+
*
|
|
69
|
+
* This decorator should only be used for non-Symbol public fields decorated
|
|
70
|
+
* with `@property`, or on a setter with an optional getter.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* class MyElement {
|
|
75
|
+
* @ariaProperty
|
|
76
|
+
* @property({ type: String, attribute: 'aria-label' })
|
|
77
|
+
* ariaLabel!: string;
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
* @category Decorator
|
|
81
|
+
* @ExportDecoratedItems
|
|
82
|
+
*/
|
|
83
|
+
export function ariaProperty(protoOrDescriptor, name,
|
|
84
|
+
// tslint:disable-next-line:no-any any is required as a return type from decorators
|
|
85
|
+
descriptor) {
|
|
86
|
+
if (name !== undefined) {
|
|
87
|
+
return tsDecorator(protoOrDescriptor, name, descriptor);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
throw new Error('@ariaProperty only supports TypeScript Decorators');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=aria-property.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aria-property.js","sourceRoot":"","sources":["aria-property.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH;;;GAGG;AACH,SAAS,WAAW,CAChB,SAAa,EAAE,IAAY,EAAE,UAA+B;IAC9D,MAAM,WAAW,GACZ,SAAS,CAAC,WAAmD,CAAC;IACnE,IAAI,CAAC,UAAU,EAAE;QACf;;;WAGG;QACH,MAAM,sBAAsB,GAAG,KAAK,IAAI,EAAE,CAAC;QAC3C,UAAU;YACN,WAAW,CAAC,qBAAqB,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;QACpE,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;SAC3E;KACF;IAED,0EAA0E;IAC1E,MAAM,cAAc,GAAG,UAAU,CAAC;IAClC,IAAI,SAAS,GAAG,EAAE,CAAC;IAEnB,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,uCAAuC,IAAI,EAAE,CAAC,CAAC;KAChE;IAGD,gEAAgE;IAChE,aAAa;IACb,8EAA8E;IAC9E,IAAK,SAAiB,CAAC,gBAAgB,EAAE;QACvC,OAAO,UAAU,CAAC;KACnB;IAED,MAAM,iBAAiB,GAAuB;QAC5C,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,IAAI;QAChB,GAAG,CAAwB,KAAc;YACvC,IAAI,SAAS,KAAK,EAAE,EAAE;gBACpB,MAAM,OAAO,GAAG,WAAW,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;gBACrD,mDAAmD;gBACnD,SAAS;oBACL,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;aACtE;YACD,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE;gBAChC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;aACjC;YACD,cAAc,CAAC,GAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACxC,CAAC;KACF,CAAC;IAEF,IAAI,cAAc,CAAC,GAAG,EAAE;QACtB,iBAAiB,CAAC,GAAG,GAAG;YACtB,OAAO,cAAc,CAAC,GAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,CAAC,CAAC;KACH;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,YAAY,CACxB,iBAAqB,EAAE,IAAa;AACpC,mFAAmF;AACnF,UAA+B;IACjC,IAAI,IAAI,KAAK,SAAS,EAAE;QACtB,OAAO,WAAW,CAAC,iBAAiB,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;KACzD;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;KACtE;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {PropertyDeclaration, ReactiveElement} from 'lit';\n\n/**\n * A value for the `aria-haspopup` ARIA attribute.\n */\nexport type AriaHasPopup =\n 'false'|'true'|'menu'|'listbox'|'tree'|'grid'|'dialog';\n\n/**\n * Expose protected statics on ReactiveElement\n */\ninterface ReactiveElementInternals {\n getPropertyDescriptor(name: PropertyKey, key: string): PropertyDescriptor;\n getPropertyOptions(name: PropertyKey): PropertyDeclaration;\n}\n\n/**\n * TypeScript version of the decorator\n * @see https://www.typescriptlang.org/docs/handbook/decorators.html#property-decorators\n */\nfunction tsDecorator(\n prototype: {}, name: string, descriptor?: PropertyDescriptor) {\n const constructor =\n (prototype.constructor as unknown as ReactiveElementInternals);\n if (!descriptor) {\n /**\n * lit uses internal properties with two leading underscores to\n * provide storage for accessors\n */\n const litInternalPropertyKey = `__${name}`;\n descriptor =\n constructor.getPropertyDescriptor(name, litInternalPropertyKey);\n if (!descriptor) {\n throw new Error('@ariaProperty must be used after a @property decorator');\n }\n }\n\n // descriptor must exist at this point, reassign so typescript understands\n const propDescriptor = descriptor;\n let attribute = '';\n\n if (!propDescriptor.set) {\n throw new Error(`@ariaProperty requires a setter for ${name}`);\n }\n\n\n // TODO(b/202853219): Remove this check when internal tooling is\n // compatible\n // tslint:disable-next-line:no-any bail if applied to internal generated class\n if ((prototype as any).dispatchWizEvent) {\n return descriptor;\n }\n\n const wrappedDescriptor: PropertyDescriptor = {\n configurable: true,\n enumerable: true,\n set(this: ReactiveElement, value: unknown) {\n if (attribute === '') {\n const options = constructor.getPropertyOptions(name);\n // if attribute is not a string, use `name` instead\n attribute =\n typeof options.attribute === 'string' ? options.attribute : name;\n }\n if (this.hasAttribute(attribute)) {\n this.removeAttribute(attribute);\n }\n propDescriptor.set!.call(this, value);\n }\n };\n\n if (propDescriptor.get) {\n wrappedDescriptor.get = function(this: ReactiveElement) {\n return propDescriptor.get!.call(this);\n };\n }\n\n return wrappedDescriptor;\n}\n\n/**\n * A property decorator proxies an aria attribute to an internal node\n *\n * This decorator is only intended for use with ARIA attributes, such as `role`\n * and `aria-label` due to screenreader needs.\n *\n * Upon first render, `@ariaProperty` will remove the attribute from the host\n * element to prevent screenreaders from reading the host instead of the\n * internal node.\n *\n * This decorator should only be used for non-Symbol public fields decorated\n * with `@property`, or on a setter with an optional getter.\n *\n * @example\n * ```ts\n * class MyElement {\n * @ariaProperty\n * @property({ type: String, attribute: 'aria-label' })\n * ariaLabel!: string;\n * }\n * ```\n * @category Decorator\n * @ExportDecoratedItems\n */\nexport function ariaProperty(\n protoOrDescriptor: {}, name?: string,\n // tslint:disable-next-line:no-any any is required as a return type from decorators\n descriptor?: PropertyDescriptor): any {\n if (name !== undefined) {\n return tsDecorator(protoOrDescriptor, name, descriptor);\n } else {\n throw new Error('@ariaProperty only supports TypeScript Decorators');\n }\n}\n\n/**\n * A temporary alias for the time of AriaMixin properties type migration from\n * (string|undefined) to (string|null).\n */\n// tslint:disable:ban-types\n// tslint:disable-next-line:no-any\nexport type AnyDuringAriaMigration = any;"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export declare class MDCFoundation<AdapterType extends {} = {}> {
|
|
7
|
+
protected adapter: AdapterType;
|
|
8
|
+
static get cssClasses(): {
|
|
9
|
+
[key: string]: string;
|
|
10
|
+
};
|
|
11
|
+
static get strings(): {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
};
|
|
14
|
+
static get numbers(): {
|
|
15
|
+
[key: string]: number;
|
|
16
|
+
};
|
|
17
|
+
static get defaultAdapter(): {};
|
|
18
|
+
constructor(adapter?: AdapterType);
|
|
19
|
+
init(): void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The constructor for MDCFoundation.
|
|
24
|
+
*/
|
|
25
|
+
export interface MDCFoundationConstructor<AdapterType extends object = any> {
|
|
26
|
+
new (adapter: AdapterType): MDCFoundation<AdapterType>;
|
|
27
|
+
readonly prototype: MDCFoundation<AdapterType>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The deprecated constructor for MDCFoundation.
|
|
31
|
+
*/
|
|
32
|
+
export interface MDCFoundationDeprecatedConstructor<AdapterType extends object = any> {
|
|
33
|
+
readonly cssClasses: Record<string, string>;
|
|
34
|
+
readonly strings: Record<string, string>;
|
|
35
|
+
readonly numbers: Record<string, number>;
|
|
36
|
+
readonly defaultAdapter: AdapterType;
|
|
37
|
+
new (adapter?: Partial<AdapterType>): MDCFoundation<AdapterType>;
|
|
38
|
+
readonly prototype: MDCFoundation<AdapterType>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves the AdapaterType from the provided MDCFoundation generic type.
|
|
42
|
+
*/
|
|
43
|
+
export declare type MDCFoundationAdapter<T> = T extends MDCFoundation<infer A> ? A : never;
|
|
44
|
+
export default MDCFoundation;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export class MDCFoundation {
|
|
7
|
+
constructor(adapter = {}) {
|
|
8
|
+
this.adapter = adapter;
|
|
9
|
+
}
|
|
10
|
+
static get cssClasses() {
|
|
11
|
+
// Classes extending MDCFoundation should implement this method to return an
|
|
12
|
+
// object which exports every CSS class the foundation class needs as a
|
|
13
|
+
// property. e.g. {ACTIVE: 'mdc-component--active'}
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
static get strings() {
|
|
17
|
+
// Classes extending MDCFoundation should implement this method to return an
|
|
18
|
+
// object which exports all semantic strings as constants. e.g. {ARIA_ROLE:
|
|
19
|
+
// 'tablist'}
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
static get numbers() {
|
|
23
|
+
// Classes extending MDCFoundation should implement this method to return an
|
|
24
|
+
// object which exports all of its semantic numbers as constants.
|
|
25
|
+
// e.g. {ANIMATION_DELAY_MS: 350}
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
static get defaultAdapter() {
|
|
29
|
+
// Classes extending MDCFoundation may choose to implement this getter in
|
|
30
|
+
// order to provide a convenient way of viewing the necessary methods of an
|
|
31
|
+
// adapter. In the future, this could also be used for adapter validation.
|
|
32
|
+
return {};
|
|
33
|
+
}
|
|
34
|
+
init() {
|
|
35
|
+
// Subclasses should override this method to perform initialization routines
|
|
36
|
+
// (registering events, etc.)
|
|
37
|
+
}
|
|
38
|
+
destroy() {
|
|
39
|
+
// Subclasses should override this method to perform de-initialization
|
|
40
|
+
// routines (de-registering events, etc.)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.
|
|
44
|
+
export default MDCFoundation;
|
|
45
|
+
//# sourceMappingURL=foundation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foundation.js","sourceRoot":"","sources":["foundation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,OAAO,aAAa;IA6BxB,YAAsB,UAAuB,EAAiB;QAAxC,YAAO,GAAP,OAAO,CAAiC;IAAG,CAAC;IA5BlE,MAAM,KAAK,UAAU;QACnB,4EAA4E;QAC5E,uEAAuE;QACvE,mDAAmD;QACnD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,OAAO;QAChB,4EAA4E;QAC5E,2EAA2E;QAC3E,aAAa;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,OAAO;QAChB,4EAA4E;QAC5E,iEAAiE;QACjE,iCAAiC;QACjC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,cAAc;QACvB,yEAAyE;QACzE,2EAA2E;QAC3E,0EAA0E;QAC1E,OAAO,EAAE,CAAC;IACZ,CAAC;IAID,IAAI;QACF,4EAA4E;QAC5E,6BAA6B;IAC/B,CAAC;IAED,OAAO;QACL,sEAAsE;QACtE,yCAAyC;IAC3C,CAAC;CACF;AA8BD,iHAAiH;AACjH,eAAe,aAAa,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport class MDCFoundation<AdapterType extends {} = {}> {\n static get cssClasses(): {[key: string]: string} {\n // Classes extending MDCFoundation should implement this method to return an\n // object which exports every CSS class the foundation class needs as a\n // property. e.g. {ACTIVE: 'mdc-component--active'}\n return {};\n }\n\n static get strings(): {[key: string]: string} {\n // Classes extending MDCFoundation should implement this method to return an\n // object which exports all semantic strings as constants. e.g. {ARIA_ROLE:\n // 'tablist'}\n return {};\n }\n\n static get numbers(): {[key: string]: number} {\n // Classes extending MDCFoundation should implement this method to return an\n // object which exports all of its semantic numbers as constants.\n // e.g. {ANIMATION_DELAY_MS: 350}\n return {};\n }\n\n static get defaultAdapter(): {} {\n // Classes extending MDCFoundation may choose to implement this getter in\n // order to provide a convenient way of viewing the necessary methods of an\n // adapter. In the future, this could also be used for adapter validation.\n return {};\n }\n\n constructor(protected adapter: AdapterType = {} as AdapterType) {}\n\n init() {\n // Subclasses should override this method to perform initialization routines\n // (registering events, etc.)\n }\n\n destroy() {\n // Subclasses should override this method to perform de-initialization\n // routines (de-registering events, etc.)\n }\n}\n\n/**\n * The constructor for MDCFoundation.\n */\nexport interface MDCFoundationConstructor<AdapterType extends object = any> {\n new(adapter: AdapterType): MDCFoundation<AdapterType>;\n readonly prototype: MDCFoundation<AdapterType>;\n}\n\n/**\n * The deprecated constructor for MDCFoundation.\n */\nexport interface MDCFoundationDeprecatedConstructor<\n AdapterType extends object = any> {\n readonly cssClasses: Record<string, string>;\n readonly strings: Record<string, string>;\n readonly numbers: Record<string, number>;\n readonly defaultAdapter: AdapterType;\n\n new(adapter?: Partial<AdapterType>): MDCFoundation<AdapterType>;\n readonly prototype: MDCFoundation<AdapterType>;\n}\n\n/**\n * Retrieves the AdapaterType from the provided MDCFoundation generic type.\n */\nexport type MDCFoundationAdapter<T> =\n T extends MDCFoundation<infer A>? A : never;\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFoundation;\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Observer function type.
|
|
8
|
+
*/
|
|
9
|
+
export interface Observer {
|
|
10
|
+
(value: any, old: any): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Specifies an observer callback that is run when the decorated property
|
|
14
|
+
* changes. The observer receives the current and old value as arguments.
|
|
15
|
+
*/
|
|
16
|
+
export declare const observer: (observer: Observer) => (proto: any, propName: PropertyKey) => void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Specifies an observer callback that is run when the decorated property
|
|
8
|
+
* changes. The observer receives the current and old value as arguments.
|
|
9
|
+
*/
|
|
10
|
+
export const observer = (observer) =>
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
+
(proto, propName) => {
|
|
13
|
+
// if we haven't wrapped `updated` in this class, do so
|
|
14
|
+
if (!proto.constructor
|
|
15
|
+
._observers) {
|
|
16
|
+
proto.constructor._observers = new Map();
|
|
17
|
+
const userUpdated = proto.updated;
|
|
18
|
+
proto.updated = function (changedProperties) {
|
|
19
|
+
userUpdated.call(this, changedProperties);
|
|
20
|
+
changedProperties.forEach((v, k) => {
|
|
21
|
+
const observers = this.constructor
|
|
22
|
+
._observers;
|
|
23
|
+
const observer = observers.get(k);
|
|
24
|
+
if (observer !== undefined) {
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
|
+
observer.call(this, this[k], v);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
// clone any existing observers (superclasses)
|
|
31
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
32
|
+
}
|
|
33
|
+
else if (!proto.constructor.hasOwnProperty('_observers')) {
|
|
34
|
+
const observers = proto.constructor._observers;
|
|
35
|
+
proto.constructor._observers = new Map();
|
|
36
|
+
observers.forEach(
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
(v, k) => proto.constructor._observers.set(k, v));
|
|
39
|
+
}
|
|
40
|
+
// set this method
|
|
41
|
+
proto.constructor._observers.set(propName, observer);
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=observer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observer.js","sourceRoot":"","sources":["observer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsBH;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,QAAkB,EAAE,EAAE;AAC3C,8DAA8D;AAC9D,CAAC,KAAU,EAAE,QAAqB,EAAE,EAAE;IACpC,uDAAuD;IACvD,IAAI,CAAE,KAAK,CAAC,WAAiD;SACnD,UAAU,EAAE;QACpB,KAAK,CAAC,WAAW,CAAC,UAAU,GAAG,IAAI,GAAG,EAAyB,CAAC;QAChE,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC;QAClC,KAAK,CAAC,OAAO,GAAG,UACW,iBAAiC;YAC1D,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;YAC1C,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBACjC,MAAM,SAAS,GACV,IAAI,CAAC,WAAiD;qBAClD,UAAU,CAAC;gBACpB,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBAClC,IAAI,QAAQ,KAAK,SAAS,EAAE;oBAC1B,8DAA8D;oBAC9D,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAG,IAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;iBAC1C;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QACF,8CAA8C;QAC9C,iDAAiD;KAClD;SAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE;QAC1D,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC;QAC/C,KAAK,CAAC,WAAW,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;QACzC,SAAS,CAAC,OAAO;QACb,8DAA8D;QAC9D,CAAC,CAAM,EAAE,CAAc,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KACzE;IACD,kBAAkB;IAClB,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACvD,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Style preference for leading underscores.\n// tslint:disable:strip-private-property-underscore\n// tslint:disable:no-any\n\nimport {PropertyValues, ReactiveElement} from 'lit';\n\n/**\n * Observer function type.\n */\nexport interface Observer {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (value: any, old: any): void;\n}\n\ntype ReactiveElementClass = typeof ReactiveElement;\ninterface ReactiveElementClassWithObservers extends ReactiveElementClass {\n // tslint:disable-next-line:enforce-name-casing\n _observers: Map<PropertyKey, Observer>;\n}\n\n/**\n * Specifies an observer callback that is run when the decorated property\n * changes. The observer receives the current and old value as arguments.\n */\nexport const observer = (observer: Observer) =>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (proto: any, propName: PropertyKey) => {\n // if we haven't wrapped `updated` in this class, do so\n if (!(proto.constructor as ReactiveElementClassWithObservers)\n ._observers) {\n proto.constructor._observers = new Map<PropertyKey, Observer>();\n const userUpdated = proto.updated;\n proto.updated = function(\n this: ReactiveElement, changedProperties: PropertyValues) {\n userUpdated.call(this, changedProperties);\n changedProperties.forEach((v, k) => {\n const observers =\n (this.constructor as ReactiveElementClassWithObservers)\n ._observers;\n const observer = observers.get(k);\n if (observer !== undefined) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n observer.call(this, (this as any)[k], v);\n }\n });\n };\n // clone any existing observers (superclasses)\n // eslint-disable-next-line no-prototype-builtins\n } else if (!proto.constructor.hasOwnProperty('_observers')) {\n const observers = proto.constructor._observers;\n proto.constructor._observers = new Map();\n observers.forEach(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (v: any, k: PropertyKey) => proto.constructor._observers.set(k, v));\n }\n // set this method\n proto.constructor._observers.set(propName, observer);\n };\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export const deepActiveElementPath = (doc = window.document) => {
|
|
7
|
+
let activeElement = doc.activeElement;
|
|
8
|
+
const path = [];
|
|
9
|
+
if (!activeElement) {
|
|
10
|
+
return path;
|
|
11
|
+
}
|
|
12
|
+
while (activeElement) {
|
|
13
|
+
path.push(activeElement);
|
|
14
|
+
if (activeElement.shadowRoot) {
|
|
15
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return path;
|
|
22
|
+
};
|
|
23
|
+
export const doesElementContainFocus = (element) => {
|
|
24
|
+
const activePath = deepActiveElementPath();
|
|
25
|
+
if (!activePath.length) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
const deepActiveElement = activePath[activePath.length - 1];
|
|
29
|
+
const focusEv = new Event('check-if-focused', { bubbles: true, composed: true });
|
|
30
|
+
let composedPath = [];
|
|
31
|
+
const listener = (ev) => {
|
|
32
|
+
composedPath = ev.composedPath();
|
|
33
|
+
};
|
|
34
|
+
document.body.addEventListener('check-if-focused', listener);
|
|
35
|
+
deepActiveElement.dispatchEvent(focusEv);
|
|
36
|
+
document.body.removeEventListener('check-if-focused', listener);
|
|
37
|
+
return composedPath.indexOf(element) !== -1;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,QAAQ,EAAa,EAAE;IACxE,IAAI,aAAa,GAAG,GAAG,CAAC,aAAa,CAAC;IACtC,MAAM,IAAI,GAAc,EAAE,CAAC;IAE3B,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,aAAa,EAAE;QACpB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzB,IAAI,aAAa,CAAC,UAAU,EAAE;YAC5B,aAAa,GAAG,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC;SACxD;aAAM;YACL,MAAM;SACP;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,OAAoB,EAAW,EAAE;IACvE,MAAM,UAAU,GAAG,qBAAqB,EAAE,CAAC;IAE3C,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;QACtB,OAAO,KAAK,CAAC;KACd;IAED,MAAM,iBAAiB,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC5D,MAAM,OAAO,GACT,IAAI,KAAK,CAAC,kBAAkB,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;IACnE,IAAI,YAAY,GAAkB,EAAE,CAAC;IACrC,MAAM,QAAQ,GAAG,CAAC,EAAS,EAAE,EAAE;QAC7B,YAAY,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC;IACnC,CAAC,CAAC;IAEF,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;IAC7D,iBAAiB,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACzC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;IAEhE,OAAO,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9C,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const deepActiveElementPath = (doc = window.document): Element[] => {\n let activeElement = doc.activeElement;\n const path: Element[] = [];\n\n if (!activeElement) {\n return path;\n }\n\n while (activeElement) {\n path.push(activeElement);\n if (activeElement.shadowRoot) {\n activeElement = activeElement.shadowRoot.activeElement;\n } else {\n break;\n }\n }\n\n return path;\n};\n\nexport const doesElementContainFocus = (element: HTMLElement): boolean => {\n const activePath = deepActiveElementPath();\n\n if (!activePath.length) {\n return false;\n }\n\n const deepActiveElement = activePath[activePath.length - 1];\n const focusEv =\n new Event('check-if-focused', {bubbles: true, composed: true});\n let composedPath: EventTarget[] = [];\n const listener = (ev: Event) => {\n composedPath = ev.composedPath();\n };\n\n document.body.addEventListener('check-if-focused', listener);\n deepActiveElement.dispatchEvent(focusEv);\n document.body.removeEventListener('check-if-focused', listener);\n\n return composedPath.indexOf(element) !== -1;\n};\n"]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Google LLC
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
@use 'sass:list';
|
|
7
|
+
@use 'sass:map';
|
|
8
|
+
@use 'sass:meta';
|
|
9
|
+
|
|
10
|
+
$interval: 4px !default;
|
|
11
|
+
$minimum-scale: minimum !default;
|
|
12
|
+
$maximum-scale: maximum !default;
|
|
13
|
+
$supported-scales: (default, minimum, maximum) !default;
|
|
14
|
+
$supported-properties: (height, size, margin-top, margin-bottom, top) !default;
|
|
15
|
+
$default-scale: 0 !default;
|
|
16
|
+
|
|
17
|
+
///
|
|
18
|
+
/// Returns component property value based on given density config and density scale.
|
|
19
|
+
///
|
|
20
|
+
/// @param {Map} $density-config - Density configuration for component.
|
|
21
|
+
/// @param {Number | String} $density-scale - Density scale value for component. Examples: `-3`, `0` or `minimum`.
|
|
22
|
+
/// @param {Map} $property-name - Density scale map for the target component.
|
|
23
|
+
///
|
|
24
|
+
/// @example
|
|
25
|
+
/// mdc-density-prop-value(
|
|
26
|
+
/// $density-config: (
|
|
27
|
+
/// height: (
|
|
28
|
+
/// default: 36px,
|
|
29
|
+
/// maximum: 40px,
|
|
30
|
+
/// minimum: 24px,
|
|
31
|
+
/// ),
|
|
32
|
+
/// ),
|
|
33
|
+
/// $density-scale: minimum,
|
|
34
|
+
/// $property-name: height,
|
|
35
|
+
/// )
|
|
36
|
+
/// // 24px
|
|
37
|
+
///
|
|
38
|
+
/// @example
|
|
39
|
+
/// mdc-density-prop-value(
|
|
40
|
+
/// $density-config: (
|
|
41
|
+
/// height: (
|
|
42
|
+
/// default: 40px,
|
|
43
|
+
/// maximum: 60px,
|
|
44
|
+
/// minimum: 24px,
|
|
45
|
+
/// ),
|
|
46
|
+
/// ),
|
|
47
|
+
/// $density-scale: -2,
|
|
48
|
+
/// $property-name: height,
|
|
49
|
+
/// )
|
|
50
|
+
/// // 32px
|
|
51
|
+
///
|
|
52
|
+
/// @example
|
|
53
|
+
/// mdc-density-prop-value(
|
|
54
|
+
/// $density-config: (
|
|
55
|
+
/// height: (
|
|
56
|
+
/// default: 36px,
|
|
57
|
+
/// maximum: 40px,
|
|
58
|
+
/// minimum: 24px,
|
|
59
|
+
/// ),
|
|
60
|
+
/// width: (
|
|
61
|
+
/// default: 56px,
|
|
62
|
+
/// maximum: 64px,
|
|
63
|
+
/// minimum: 48px,
|
|
64
|
+
/// ),
|
|
65
|
+
/// ),
|
|
66
|
+
/// $density-scale: minimum,
|
|
67
|
+
/// $property-name: width,
|
|
68
|
+
/// )
|
|
69
|
+
/// // 48px
|
|
70
|
+
///
|
|
71
|
+
@function prop-value($density-config, $density-scale, $property-name) {
|
|
72
|
+
@if (
|
|
73
|
+
meta.type-of($density-scale) ==
|
|
74
|
+
'string' and
|
|
75
|
+
list.index($list: $supported-scales, $value: $density-scale) ==
|
|
76
|
+
null
|
|
77
|
+
) {
|
|
78
|
+
@error "mdc-density: Supported density scales #{$supported-scales}, but received #{$density-scale}.";
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@if (
|
|
82
|
+
list.index($list: $supported-properties, $value: $property-name) == null
|
|
83
|
+
) {
|
|
84
|
+
@error "mdc-density: Supported density properties #{$supported-properties}," +
|
|
85
|
+
"but received #{$property-name}.";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
$value: null;
|
|
89
|
+
$property-scale-map: map.get($density-config, $property-name);
|
|
90
|
+
|
|
91
|
+
@if map.has-key($property-scale-map, $density-scale) {
|
|
92
|
+
$value: map.get($property-scale-map, $density-scale);
|
|
93
|
+
} @else {
|
|
94
|
+
$value: map.get($property-scale-map, default) + $density-scale * $interval;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
$min-value: map.get($property-scale-map, $minimum-scale);
|
|
98
|
+
$max-value: map.get($property-scale-map, $maximum-scale);
|
|
99
|
+
|
|
100
|
+
@if ($value < $min-value or $value > $max-value) {
|
|
101
|
+
@error "mdc-density: #{$property-name} must be between #{$min-value} and " +
|
|
102
|
+
"#{$max-value} (inclusive), but received #{$value}.";
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@return $value;
|
|
106
|
+
}
|