@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,507 @@
|
|
|
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
|
+
@use 'sass:string';
|
|
10
|
+
@use './custom-properties';
|
|
11
|
+
|
|
12
|
+
/// A flat Map of keys and their values. Keys may be set to any static CSS
|
|
13
|
+
/// value, or another key's name to resolve to that key's value.
|
|
14
|
+
///
|
|
15
|
+
/// @example - scss
|
|
16
|
+
/// $_store: (
|
|
17
|
+
/// primary: purple, // keys may be set to CSS values...
|
|
18
|
+
/// button-color: primary, // ...or resolve to another key's value
|
|
19
|
+
/// );
|
|
20
|
+
///
|
|
21
|
+
/// @type {Map}
|
|
22
|
+
$_store: ();
|
|
23
|
+
/// A flat Map of relationship links between keys. While key values may
|
|
24
|
+
/// resolve to another key's value in the key store, the store does not
|
|
25
|
+
/// preserve or infer relationships between keys.
|
|
26
|
+
///
|
|
27
|
+
/// Instead, this link Map records the original relationship between keys as
|
|
28
|
+
/// their values are updated and potentially overridden with customizations.
|
|
29
|
+
///
|
|
30
|
+
/// @example - scss
|
|
31
|
+
/// // Given these keys...
|
|
32
|
+
/// $primary: purple;
|
|
33
|
+
/// $button-color: $primary; // ...button-color is linked to the primary key
|
|
34
|
+
///
|
|
35
|
+
/// // A key store with value customizations may look like this:
|
|
36
|
+
/// $_store: (
|
|
37
|
+
/// primary: amber,
|
|
38
|
+
/// button-color: teal, // the relationship is lost with a customization
|
|
39
|
+
/// );
|
|
40
|
+
///
|
|
41
|
+
/// // The links Map preserves the relationship for custom property
|
|
42
|
+
/// // generation, while the store Map is only focused on values.
|
|
43
|
+
/// $_links: (
|
|
44
|
+
/// button-color: primary,
|
|
45
|
+
/// );
|
|
46
|
+
///
|
|
47
|
+
/// @type {Map}
|
|
48
|
+
$_links: ();
|
|
49
|
+
/// A map of key options. If a key has options, it will have an entry in this
|
|
50
|
+
/// variable with a Map value with options for the key.
|
|
51
|
+
///
|
|
52
|
+
/// @example - scss
|
|
53
|
+
/// // Option structure
|
|
54
|
+
/// $_options: (
|
|
55
|
+
/// key-name: (
|
|
56
|
+
/// // An additional prefix to add when generating the varname of a
|
|
57
|
+
/// // key's custom property
|
|
58
|
+
/// // --mdc-<prefix>-key-name
|
|
59
|
+
/// custom-property-prefix: prefix
|
|
60
|
+
/// )
|
|
61
|
+
/// );
|
|
62
|
+
///
|
|
63
|
+
/// @type {Map}
|
|
64
|
+
$_options: ();
|
|
65
|
+
|
|
66
|
+
/// Indicates whether or not the provided value is a registered key.
|
|
67
|
+
///
|
|
68
|
+
/// @param {String} $key - One or more key parts to check
|
|
69
|
+
/// @return {Bool} True if the key is registered, or false if it is not.
|
|
70
|
+
@function is-key($key...) {
|
|
71
|
+
$key: combine($key...);
|
|
72
|
+
@return map.has-key($_store, $key);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/// Retrieves a List of all keys matching the provided key group prefix.
|
|
76
|
+
///
|
|
77
|
+
/// @example - scss
|
|
78
|
+
/// $keys: get-keys(typography);
|
|
79
|
+
/// // (typography-headline,
|
|
80
|
+
/// // typography-body,
|
|
81
|
+
/// // typography-body-font,
|
|
82
|
+
/// // typography-body-size)
|
|
83
|
+
///
|
|
84
|
+
/// @param {String} $group - Optional group prefix to search by. If ommitted,
|
|
85
|
+
/// all registered keys will be returned.
|
|
86
|
+
/// @return {List} A List of all keys matching the group prefix.
|
|
87
|
+
@function get-keys($group: '') {
|
|
88
|
+
$keys: ();
|
|
89
|
+
@each $key in map.keys($_store) {
|
|
90
|
+
@if string.index($key, $group) == 1 {
|
|
91
|
+
$keys: list.append($keys, $key);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@return $keys;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/// Registers a Map of keys and their values with the key store. Key values may
|
|
99
|
+
/// either be CSS values or other key strings.
|
|
100
|
+
///
|
|
101
|
+
/// @example - scss
|
|
102
|
+
/// @include set-values((
|
|
103
|
+
/// primary: teal,
|
|
104
|
+
/// label-color: primary
|
|
105
|
+
/// ));
|
|
106
|
+
///
|
|
107
|
+
/// Options may also be added for each key by providing an `$options` parameter.
|
|
108
|
+
///
|
|
109
|
+
/// @example - scss
|
|
110
|
+
/// @include set-values(
|
|
111
|
+
/// $key-map,
|
|
112
|
+
/// $options: (
|
|
113
|
+
/// // An additional prefix to add when generating the varname of a
|
|
114
|
+
/// // key's custom property
|
|
115
|
+
/// // --mdc-<prefix>-key-name
|
|
116
|
+
/// custom-property-prefix: prefix
|
|
117
|
+
/// )
|
|
118
|
+
/// );
|
|
119
|
+
///
|
|
120
|
+
/// Note that this mixin only sets key values. If a key points to another key,
|
|
121
|
+
/// it does not link those keys when custom properties are emitted. Use
|
|
122
|
+
/// `add-link()` or `register-theme()` to create links between keys.
|
|
123
|
+
///
|
|
124
|
+
/// @see {mixin} set-value
|
|
125
|
+
/// @see {mixin} add-link
|
|
126
|
+
/// @see {mixin} register-theme
|
|
127
|
+
///
|
|
128
|
+
/// @param {Map} $key-map - A Map of keys to register.
|
|
129
|
+
/// @param {Map} $options [null] - Optional Map of options to add for each key.
|
|
130
|
+
@mixin set-values($key-map, $options: null) {
|
|
131
|
+
$unused: set-values($key-map, $options: $options);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/// Function version of `set-values()`.
|
|
135
|
+
///
|
|
136
|
+
/// Mixins cannot be invoked within functions in Sass. Use this when
|
|
137
|
+
/// `set-values()` must be used within a function. The return value may be
|
|
138
|
+
/// discarded or re-assigned to the `$key-map` provided.
|
|
139
|
+
///
|
|
140
|
+
/// @example - scss
|
|
141
|
+
/// @function foo() {
|
|
142
|
+
/// $unused: set-values((primary: teal));
|
|
143
|
+
/// }
|
|
144
|
+
///
|
|
145
|
+
/// @function bar() {
|
|
146
|
+
/// $key-map: (primary: teal);
|
|
147
|
+
/// $key-map: set-values($key-map);
|
|
148
|
+
/// }
|
|
149
|
+
///
|
|
150
|
+
/// @see {mixin} set-values
|
|
151
|
+
///
|
|
152
|
+
/// @return {Map} `$key-map`, unmodified, for convenience.
|
|
153
|
+
@function set-values($key-map, $options: null) {
|
|
154
|
+
@each $key, $value in $key-map {
|
|
155
|
+
$key: set-value($key, $value, $options: $options);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@return $key-map;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/// Sets the value of a key. Key values may either be CSS values or other key
|
|
162
|
+
/// strings.
|
|
163
|
+
///
|
|
164
|
+
/// @example - scss
|
|
165
|
+
/// @include set-value(primary, teal);
|
|
166
|
+
/// @include set-value(label-color, primary);
|
|
167
|
+
///
|
|
168
|
+
/// Options may also be added for each key by providing an `$options` parameter.
|
|
169
|
+
///
|
|
170
|
+
/// @example - scss
|
|
171
|
+
/// @include set-value(key-name, teal, $options: (
|
|
172
|
+
/// // An additional prefix to add when generating the varname of a
|
|
173
|
+
/// // key's custom property
|
|
174
|
+
/// // --mdc-<prefix>-key-name
|
|
175
|
+
/// custom-property-prefix: prefix
|
|
176
|
+
/// ));
|
|
177
|
+
///
|
|
178
|
+
/// Note that this mixin only sets the key's value. If the key points to another
|
|
179
|
+
/// key, it does not link those keys when custom properties are emitted. Use
|
|
180
|
+
/// `add-link()` or `register-theme()` to create links between keys.
|
|
181
|
+
///
|
|
182
|
+
/// @see {mixin} add-link
|
|
183
|
+
/// @see {mixin} register-theme
|
|
184
|
+
///
|
|
185
|
+
/// @param {String} $key - The key to set a value for.
|
|
186
|
+
/// @param {*} $value - The value of the key.
|
|
187
|
+
/// @param {Map} $options [null] - Optional Map of options to add for each key.
|
|
188
|
+
@mixin set-value($key, $value, $options: null) {
|
|
189
|
+
$unused: set-value($key, $value, $options: $options);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/// Function version of `set-value()`.
|
|
193
|
+
///
|
|
194
|
+
/// Mixins cannot be invoked within functions in Sass. Use this when
|
|
195
|
+
/// `set-value()` must be used within a function. The return value may be
|
|
196
|
+
/// discarded or re-assigned to the `$key` provided.
|
|
197
|
+
///
|
|
198
|
+
/// @example - scss
|
|
199
|
+
/// @function foo() {
|
|
200
|
+
/// $unused: set-value(primary, teal);
|
|
201
|
+
/// }
|
|
202
|
+
///
|
|
203
|
+
/// @function bar() {
|
|
204
|
+
/// $key: primary;
|
|
205
|
+
/// $key: set-value($key, teal);
|
|
206
|
+
/// }
|
|
207
|
+
///
|
|
208
|
+
/// @see {mixin} set-value
|
|
209
|
+
///
|
|
210
|
+
/// @return {String} `$key`, unmodified, for convenience.
|
|
211
|
+
@function set-value($key, $value, $options: null) {
|
|
212
|
+
// Use !global to avoid shadowing
|
|
213
|
+
// https://sass-lang.com/documentation/variables#shadowing
|
|
214
|
+
$_store: map.set($_store, $key, $value) !global;
|
|
215
|
+
@if $options {
|
|
216
|
+
$_options: map.set($_options, $key, $options) !global;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@return $key;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/// Add a link between two keys.
|
|
223
|
+
///
|
|
224
|
+
/// When keys are linked and chained custom properties are emitted, the value
|
|
225
|
+
/// of `$key` will always include the `var()` function of its linked key, even
|
|
226
|
+
/// if it overrides its linked key's value.
|
|
227
|
+
///
|
|
228
|
+
/// @example - scss
|
|
229
|
+
/// @include add-link(label-color, primary);
|
|
230
|
+
/// @include set-values((
|
|
231
|
+
/// primary: teal,
|
|
232
|
+
/// label-color: amber
|
|
233
|
+
/// ));
|
|
234
|
+
///
|
|
235
|
+
/// .primary {
|
|
236
|
+
/// @include theme.property(color, primary);
|
|
237
|
+
/// }
|
|
238
|
+
///
|
|
239
|
+
/// .label-color {
|
|
240
|
+
/// @include theme.property(color, label-color);
|
|
241
|
+
/// }
|
|
242
|
+
///
|
|
243
|
+
/// @example - css
|
|
244
|
+
/// .primary {
|
|
245
|
+
/// color: var(--primary, teal);
|
|
246
|
+
/// }
|
|
247
|
+
///
|
|
248
|
+
/// .label-color {
|
|
249
|
+
/// color: var(--label-color, var(--primary, amber));
|
|
250
|
+
/// }
|
|
251
|
+
///
|
|
252
|
+
///
|
|
253
|
+
/// If a key does not already have a value set, its value will be set to the
|
|
254
|
+
/// linked key provided.
|
|
255
|
+
///
|
|
256
|
+
/// @param {String} $key - The key to add a link to.
|
|
257
|
+
/// @param {String} $link - The name to link to `$key`.
|
|
258
|
+
/// @throw When attempting to change the link of a key that has already been
|
|
259
|
+
/// linked.
|
|
260
|
+
@mixin add-link($key, $link) {
|
|
261
|
+
$unused: add-link($key, $link);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/// Function version of `add-link()`.
|
|
265
|
+
///
|
|
266
|
+
/// Mixins cannot be invoked within functions in Sass. Use this when
|
|
267
|
+
/// `add-link()` must be used within a function. The return value may be
|
|
268
|
+
/// discarded or re-assigned to the `$key` provided.
|
|
269
|
+
///
|
|
270
|
+
/// @example - scss
|
|
271
|
+
/// @function foo() {
|
|
272
|
+
/// $unused: add-link(label-color, primary);
|
|
273
|
+
/// }
|
|
274
|
+
///
|
|
275
|
+
/// @function bar() {
|
|
276
|
+
/// $key: label-color;
|
|
277
|
+
/// $key: set-value($key, primary);
|
|
278
|
+
/// }
|
|
279
|
+
///
|
|
280
|
+
/// @see {mixin} `add-link()`
|
|
281
|
+
///
|
|
282
|
+
/// @return {String} `$key` for convenience.
|
|
283
|
+
@function add-link($key, $link) {
|
|
284
|
+
@if map.has-key($_links, $key) {
|
|
285
|
+
@error '#{$key} already has a link';
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// Use !global to avoid shadowing
|
|
289
|
+
// https://sass-lang.com/documentation/variables#shadowing
|
|
290
|
+
$_links: map.set($_links, $key, $link) !global;
|
|
291
|
+
@if not map.has-key($_store, $key) {
|
|
292
|
+
$key: set-value($key, $link);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
@return $key;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/// Resolve a key to its CSS value. This may be a static CSS value or a dynamic
|
|
299
|
+
/// `var()` value.
|
|
300
|
+
///
|
|
301
|
+
/// The value that this function returns may change depending on configuration
|
|
302
|
+
/// options if a key's value points to another key.
|
|
303
|
+
///
|
|
304
|
+
/// To always retrieve the static CSS value a key resolves to, even if it points
|
|
305
|
+
/// to another key, provide `$deep: true` as a parameter to the function.
|
|
306
|
+
///
|
|
307
|
+
/// @param {String...} $key - One or more key parts to resolve to a CSS value.
|
|
308
|
+
/// @param {Bool} $deep [false] - Set to true as a named parameter to always
|
|
309
|
+
/// resolve the key to its static CSS value and not a dynamic `var()` value.
|
|
310
|
+
/// @return {*} The value the key resolves to. This may be `null` if the key
|
|
311
|
+
/// (or the key it points to) has not been registered.
|
|
312
|
+
@function resolve($key...) {
|
|
313
|
+
$deep: map.get(meta.keywords($key), deep);
|
|
314
|
+
$key: combine($key...);
|
|
315
|
+
|
|
316
|
+
$value: map.get($_store, $key);
|
|
317
|
+
@if is-key($value) {
|
|
318
|
+
$value: resolve($value);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
@return $value;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/// Register a `$theme` Map variable's keys. This should only be done once in
|
|
325
|
+
/// the `theme-styles()` mixin with the canonical `$theme` Map to initialize
|
|
326
|
+
/// default values and linked keys.
|
|
327
|
+
///
|
|
328
|
+
/// @example - scss
|
|
329
|
+
/// @mixin theme-styles($theme: button-filled-theme.$light-theme) {
|
|
330
|
+
/// @include keys.register-theme($theme, button-filled);
|
|
331
|
+
/// @include button-filled-theme.theme($theme);
|
|
332
|
+
/// }
|
|
333
|
+
///
|
|
334
|
+
/// A component's `$theme` Map may have shared keys (such as color, shape, and
|
|
335
|
+
/// typography) that need linked before user customization with the `theme()`
|
|
336
|
+
/// mixin.
|
|
337
|
+
///
|
|
338
|
+
/// The `register-theme()` mixin handles adding these links with `add-link()`
|
|
339
|
+
/// dynamically from a canonical `$theme` configuration provided by a trusted
|
|
340
|
+
/// source in `theme-styles()`. Subsequent calls to `theme()` will not invoke
|
|
341
|
+
/// `register-theme()` or change the linked keys' registration.
|
|
342
|
+
///
|
|
343
|
+
/// @param {Map} $theme - The theme Map to register keys for.
|
|
344
|
+
/// @param {String} $prefix [null] - Optional prefix to prepend before each key.
|
|
345
|
+
/// @param {Map} $options [null] - Optional Map of options to add for each key.
|
|
346
|
+
@mixin register-theme($theme, $prefix: null, $options: null) {
|
|
347
|
+
// The first $theme Map received in theme-styles() should be used to
|
|
348
|
+
// register keys.
|
|
349
|
+
// Subsequent calls to theme() to customize key values will not be
|
|
350
|
+
// wrapped within theme-styles() and will not change the registered
|
|
351
|
+
// key values (or more importantly, their links), since
|
|
352
|
+
// customizations may be simple one-offs.
|
|
353
|
+
@each $key, $value in $theme {
|
|
354
|
+
@if $value != null {
|
|
355
|
+
$key: combine($prefix, $key);
|
|
356
|
+
@include set-value($key, $value, $options: $options);
|
|
357
|
+
@if is-key($value) {
|
|
358
|
+
@include add-link($key, $link: $value);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/// Create and resolve custom properties from a user-provided `$theme` Map
|
|
365
|
+
/// variable. The created custom properties are returned in a Map that matches
|
|
366
|
+
/// the key structure of `$theme`.
|
|
367
|
+
///
|
|
368
|
+
/// This function should be used within a `theme()` mixin after validation and
|
|
369
|
+
/// before providing any values to subsequent mixins. This will ensure that all
|
|
370
|
+
/// values are custom properties to support runtime theming.
|
|
371
|
+
///
|
|
372
|
+
/// @example - scss
|
|
373
|
+
/// $light-theme: (
|
|
374
|
+
/// label-color: on-primary
|
|
375
|
+
/// );
|
|
376
|
+
///
|
|
377
|
+
/// @mixin theme($theme) {
|
|
378
|
+
/// $theme: keys.create-theme-properties($theme, button-filled);
|
|
379
|
+
/// /*(
|
|
380
|
+
/// label-color: (
|
|
381
|
+
/// varname: --mdc-button-filled-label-color,
|
|
382
|
+
/// fallback: (
|
|
383
|
+
/// varname: --mdc-theme-on-primary,
|
|
384
|
+
/// fallback: white,
|
|
385
|
+
/// )
|
|
386
|
+
/// )
|
|
387
|
+
/// )*/
|
|
388
|
+
/// }
|
|
389
|
+
///
|
|
390
|
+
/// @param {Map} $theme - The theme Map to create custom properties for.
|
|
391
|
+
/// @param {String} $prefix [null] - Optional prefix to prepend for each key's
|
|
392
|
+
/// custom property.
|
|
393
|
+
/// @return {Map} A similar `$theme` Map whose values are replaced with the
|
|
394
|
+
/// newly created and resolved custom properties.
|
|
395
|
+
@function create-theme-properties($theme, $prefix: null) {
|
|
396
|
+
$theme-with-props: ();
|
|
397
|
+
@each $name, $value in $theme {
|
|
398
|
+
@if $value != null {
|
|
399
|
+
@if is-key($value) {
|
|
400
|
+
$value: create-custom-property($value);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
$key: combine($prefix, $name);
|
|
404
|
+
|
|
405
|
+
@if _is-map($value) {
|
|
406
|
+
@each $k, $v in $value {
|
|
407
|
+
$theme-with-props: map.set(
|
|
408
|
+
$theme-with-props,
|
|
409
|
+
$name,
|
|
410
|
+
$k,
|
|
411
|
+
custom-properties.create(_create-varname(combine($key, $k)), $v)
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
} @else {
|
|
415
|
+
$theme-with-props: map.set(
|
|
416
|
+
$theme-with-props,
|
|
417
|
+
$name,
|
|
418
|
+
custom-properties.create(_create-varname($key), $value)
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
@return $theme-with-props;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/// Create a custom property for a key that represents the key's linked
|
|
428
|
+
/// relationships and final resolved static value.
|
|
429
|
+
///
|
|
430
|
+
/// This function ignores customization options and is intended to return the
|
|
431
|
+
/// most accurate data structure representation of a key. Customization options
|
|
432
|
+
/// (such as custom property configuration) will change how the returned value
|
|
433
|
+
/// is emitted.
|
|
434
|
+
///
|
|
435
|
+
/// @param {$tring...} $key - One or more key parts to create a custom property
|
|
436
|
+
/// for.
|
|
437
|
+
/// @return {Map} A custom property Map for the key.
|
|
438
|
+
@function create-custom-property($key...) {
|
|
439
|
+
$key: combine($key...);
|
|
440
|
+
$prop: custom-properties.create(_create-varname($key));
|
|
441
|
+
$link: map.get($_links, $key);
|
|
442
|
+
@if $link {
|
|
443
|
+
$prop: custom-properties.set-fallback($prop, create-custom-property($link));
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
@return custom-properties.set-fallback($prop, resolve($key, $deep: true));
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
@mixin declare-custom-properties($theme, $prefix: null) {
|
|
450
|
+
$theme: create-theme-properties($theme, $prefix);
|
|
451
|
+
|
|
452
|
+
@each $key, $value in $theme {
|
|
453
|
+
@if _is-map($value) {
|
|
454
|
+
@each $k, $v in $value {
|
|
455
|
+
@include custom-properties.declaration($v);
|
|
456
|
+
}
|
|
457
|
+
} @else {
|
|
458
|
+
@include custom-properties.declaration($value);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/// Creates a custom property varname for a key. This function will add a key's
|
|
464
|
+
/// option's `custom-property-prefix` if it exists.
|
|
465
|
+
///
|
|
466
|
+
/// @param {String...} $key - One or more key parts to create a varname for.
|
|
467
|
+
/// @return {String} The key's custom property varname.
|
|
468
|
+
@function _create-varname($key...) {
|
|
469
|
+
$key: combine($key...);
|
|
470
|
+
$prefix: map.get($_options, $key, custom-property-prefix);
|
|
471
|
+
@if $prefix {
|
|
472
|
+
$key: combine($prefix, $key);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
@return custom-properties.create-varname($key);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/// Combines one or more key parts into a key.
|
|
479
|
+
///
|
|
480
|
+
/// @example - scss
|
|
481
|
+
/// $key: combine(body, font-size);
|
|
482
|
+
/// // body-font-size
|
|
483
|
+
///
|
|
484
|
+
/// @param {String...} $parts - Arbitrary number of string key parts to combine.
|
|
485
|
+
/// @return {String} A combined key string.
|
|
486
|
+
@function combine($parts...) {
|
|
487
|
+
// Allow extra keywords to be passed to other functions without impacting this
|
|
488
|
+
// function, which does not expect any keywords.
|
|
489
|
+
$unused: meta.keywords($parts);
|
|
490
|
+
$key: '';
|
|
491
|
+
@each $part in $parts {
|
|
492
|
+
@if $part {
|
|
493
|
+
@if $key == '' {
|
|
494
|
+
$key: $part;
|
|
495
|
+
} @else {
|
|
496
|
+
$key: #{$key}-#{$part};
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
@return $key;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
@function _is-map($map) {
|
|
505
|
+
@return meta.type-of($map) == 'map' and not
|
|
506
|
+
custom-properties.is-custom-prop($map);
|
|
507
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Google LLC
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
@use 'sass:list';
|
|
7
|
+
@use 'sass:map';
|
|
8
|
+
|
|
9
|
+
// A collection of extensions to the sass:map module
|
|
10
|
+
// https://sass-lang.com/documentation/modules/map
|
|
11
|
+
|
|
12
|
+
/// Splits a Map into two separate Maps: one without the provided keys and one
|
|
13
|
+
/// exclusively with the provided keys.
|
|
14
|
+
///
|
|
15
|
+
/// @example - scss
|
|
16
|
+
/// $map: (
|
|
17
|
+
/// focus: blue,
|
|
18
|
+
/// focus-within: blue,
|
|
19
|
+
/// hover: teal,
|
|
20
|
+
/// active: green,
|
|
21
|
+
/// );
|
|
22
|
+
///
|
|
23
|
+
/// $pair: split($map, focus, focus-within);
|
|
24
|
+
/// // (
|
|
25
|
+
/// // (hover: teal, active: green),
|
|
26
|
+
/// // (focus: blue, focus-within: blue)
|
|
27
|
+
/// // );
|
|
28
|
+
///
|
|
29
|
+
/// @param {Map} $map - The Map to split.
|
|
30
|
+
/// @param {String...} $keys - Keys to split the Map by.
|
|
31
|
+
/// @return {List} A List pair with two new Maps: the first with the keys
|
|
32
|
+
/// removed and the second exclusively with the keys.
|
|
33
|
+
@function split($map, $keys...) {
|
|
34
|
+
$map1: ();
|
|
35
|
+
$map2: ();
|
|
36
|
+
@each $key, $value in $map {
|
|
37
|
+
@if list.index($keys, $key) {
|
|
38
|
+
$map2: map.set($map2, $key, $value);
|
|
39
|
+
} @else {
|
|
40
|
+
$map1: map.set($map1, $key, $value);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@return ($map1, $map2);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/// Picks provided keys from a Map.
|
|
48
|
+
///
|
|
49
|
+
/// @example - scss
|
|
50
|
+
/// $map: (
|
|
51
|
+
/// focus: blue,
|
|
52
|
+
/// focus-within: blue,
|
|
53
|
+
/// hover: teal,
|
|
54
|
+
/// active: green,
|
|
55
|
+
/// );
|
|
56
|
+
///
|
|
57
|
+
/// pick($map, hover, active);
|
|
58
|
+
/// // (hover: teal, active: green),
|
|
59
|
+
///
|
|
60
|
+
/// pick($map, (hover, active)...);
|
|
61
|
+
/// // (hover: teal, active: green),
|
|
62
|
+
///
|
|
63
|
+
/// @param {Map} $map - The Map to pick.
|
|
64
|
+
/// @param {String...} $keys - Keys to pick from the Map.
|
|
65
|
+
/// @return {List} Map with only the keys provided.
|
|
66
|
+
@function pick($map, $keys...) {
|
|
67
|
+
@return list.nth(split($map, $keys...), 2);
|
|
68
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Google LLC
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
@use 'sass:list';
|
|
7
|
+
@use 'sass:meta';
|
|
8
|
+
@use 'sass:string';
|
|
9
|
+
|
|
10
|
+
/// Replaces all name instances in the provided string with values from the
|
|
11
|
+
/// provided replacement Map whose keys correspond to the name instances.
|
|
12
|
+
/// Returns a new string with the replacements applied.
|
|
13
|
+
///
|
|
14
|
+
/// @example
|
|
15
|
+
/// replace-string('calc(x + y)', (x: 16px, y: 50%)); // 'calc(16px + 50%)'
|
|
16
|
+
///
|
|
17
|
+
/// @example
|
|
18
|
+
/// $foo: custom-properties.create-var(custom-properties.create(--foo, 8px));
|
|
19
|
+
/// replace-string('calc(foo)', (foo: $foo)); // 'calc(var(--foo, 8px))';
|
|
20
|
+
///
|
|
21
|
+
/// @access private
|
|
22
|
+
/// @param {String} $string - The string to make replacements on.
|
|
23
|
+
/// @param {Map} $replace-map - A Map of name/value replacements. The keys of
|
|
24
|
+
/// the Map are names that will be replaced in the string with the keys'
|
|
25
|
+
/// respective values.
|
|
26
|
+
/// @return {String} The string with replacements made, if any.
|
|
27
|
+
@function replace-string($string, $replace-map) {
|
|
28
|
+
@if meta.type-of($replace-map) != 'map' {
|
|
29
|
+
@error 'mdc-theme: Invalid replacement #{$replace-map}. Must be a Map.';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@each $name, $replacement in $replace-map {
|
|
33
|
+
// Since the replacement values may contain the name themselves (such as
|
|
34
|
+
// a custom property: name "foo" and value "var(--foo)"), gather the indices
|
|
35
|
+
// first before replacing.
|
|
36
|
+
$indices: ();
|
|
37
|
+
$substring: $string;
|
|
38
|
+
$prev-index: null;
|
|
39
|
+
$index: string.index($substring, $name);
|
|
40
|
+
@while $index {
|
|
41
|
+
$substring: string.slice($substring, $index + string.length($name));
|
|
42
|
+
|
|
43
|
+
@if $prev-index {
|
|
44
|
+
// Add previous index's value to switch from "substring index" to
|
|
45
|
+
// absolute string index. Also add length - 1 since slice removes
|
|
46
|
+
// the entire word as well as lists being 1 indexed
|
|
47
|
+
$index: $index + $prev-index + string.length($name) - 1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Use list.join() to "prepend" the index to the start of the list. This
|
|
51
|
+
// allows us to iterate "backwards" later.
|
|
52
|
+
$indices: list.join($index, $indices);
|
|
53
|
+
$prev-index: $index;
|
|
54
|
+
$index: string.index($substring, $name);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Since we "prepended" the indices, the list is sorted backwards, with the
|
|
58
|
+
// last index first. Replacing values last index to first index removes the
|
|
59
|
+
// need for us to adjust the indices as we replace them.
|
|
60
|
+
@each $index in $indices {
|
|
61
|
+
$before: string.slice($string, 1, $index - 1);
|
|
62
|
+
$after: string.slice($string, $index + string.length($name));
|
|
63
|
+
$string: $before + $replacement + $after;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@return $string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/// Replaces all value instances in the provided list with values from the
|
|
71
|
+
/// provided replacement Map whose keys correspond to the name instances.
|
|
72
|
+
/// Returns a new list with the replacements applied.
|
|
73
|
+
///
|
|
74
|
+
/// @example
|
|
75
|
+
/// replace-list(0 value, (value: 16px)); // (0 16px)
|
|
76
|
+
///
|
|
77
|
+
/// @see {mixin} replace-string
|
|
78
|
+
///
|
|
79
|
+
/// @access private
|
|
80
|
+
/// @param {List} $list - The list to make replacements on.
|
|
81
|
+
/// @param {Map} $replace-map - A Map of name/value replacements. The keys of
|
|
82
|
+
/// the Map are names that will be replaced in the list with the keys'
|
|
83
|
+
/// respective values.
|
|
84
|
+
/// property value replacements instead of the `var()` declaration.
|
|
85
|
+
/// @return {List} A new list with replacements made, if any.
|
|
86
|
+
@function replace-list($list, $replace-map) {
|
|
87
|
+
$separator: list.separator($list);
|
|
88
|
+
$replaced-list: ();
|
|
89
|
+
@each $value in $list {
|
|
90
|
+
@if meta.type-of($value) == 'string' {
|
|
91
|
+
$replaced-list: list.append(
|
|
92
|
+
$replaced-list,
|
|
93
|
+
replace-string($value, $replace-map),
|
|
94
|
+
$separator
|
|
95
|
+
);
|
|
96
|
+
} @else if meta.type-of($value) == 'list' {
|
|
97
|
+
$replaced-list: list.append(
|
|
98
|
+
$replaced-list,
|
|
99
|
+
replace-list($value, $replace-map),
|
|
100
|
+
$separator
|
|
101
|
+
);
|
|
102
|
+
} @else {
|
|
103
|
+
$replaced-list: list.append($replaced-list, $value, $separator);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@return $replaced-list;
|
|
108
|
+
}
|