@material/web 1.0.0-pre.2 → 1.0.0-pre.4
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 +1 -1
- package/README.md +41 -41
- package/autocomplete/autocomplete-item.js.map +1 -1
- package/autocomplete/autocomplete-list.js.map +1 -1
- package/autocomplete/autocomplete-surface.js.map +1 -1
- package/autocomplete/filled-autocomplete.d.ts +0 -2
- package/autocomplete/filled-autocomplete.js +0 -7
- package/autocomplete/filled-autocomplete.js.map +1 -1
- package/autocomplete/lib/_filled-autocomplete.scss +22 -28
- package/autocomplete/lib/_outlined-autocomplete.scss +23 -29
- package/autocomplete/lib/_shared.scss +6 -10
- package/autocomplete/lib/autocomplete.d.ts +2 -2
- package/autocomplete/lib/autocomplete.js +4 -5
- package/autocomplete/lib/autocomplete.js.map +1 -1
- package/autocomplete/lib/autocompletelist/autocomplete-list-styles.scss +2 -0
- package/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.scss +2 -0
- package/autocomplete/lib/filled-styles.css.js +1 -1
- package/autocomplete/lib/filled-styles.css.js.map +1 -1
- package/autocomplete/lib/filled-styles.scss +2 -0
- package/autocomplete/lib/outlined-styles.css.js +1 -1
- package/autocomplete/lib/outlined-styles.css.js.map +1 -1
- package/autocomplete/lib/outlined-styles.scss +2 -0
- package/autocomplete/lib/shared-styles.scss +2 -0
- package/autocomplete/outlined-autocomplete.d.ts +0 -2
- package/autocomplete/outlined-autocomplete.js +0 -7
- package/autocomplete/outlined-autocomplete.js.map +1 -1
- package/badge/badge.js.map +1 -1
- package/badge/lib/_badge.scss +10 -13
- package/badge/lib/badge-styles.css.js +1 -1
- package/badge/lib/badge-styles.css.js.map +1 -1
- package/badge/lib/badge-styles.scss +2 -0
- package/badge/lib/badge.js.map +1 -1
- package/button/elevated-button.js.map +1 -1
- package/button/elevated-link-button.js.map +1 -1
- package/button/filled-button.js.map +1 -1
- package/button/filled-link-button.js.map +1 -1
- package/button/lib/_elevated-button.scss +10 -15
- package/button/lib/_elevation.scss +4 -1
- package/button/lib/_filled-button.scss +12 -14
- package/button/lib/_icon.scss +1 -0
- package/button/lib/_outlined-button.scss +10 -15
- package/button/lib/_shared.scss +14 -19
- package/button/lib/_text-button.scss +12 -14
- package/button/lib/_tonal-button.scss +10 -15
- package/button/lib/button.js.map +1 -1
- package/button/lib/elevated-styles.css.js +1 -1
- package/button/lib/elevated-styles.css.js.map +1 -1
- package/button/lib/elevated-styles.scss +2 -0
- package/button/lib/filled-styles.css.js +1 -1
- package/button/lib/filled-styles.css.js.map +1 -1
- package/button/lib/filled-styles.scss +2 -0
- package/button/lib/link-button.js.map +1 -1
- package/button/lib/outlined-styles.css.js +1 -1
- package/button/lib/outlined-styles.css.js.map +1 -1
- package/button/lib/outlined-styles.scss +2 -0
- package/button/lib/shared-elevation-styles.scss +2 -0
- package/button/lib/shared-styles.css.js +1 -1
- package/button/lib/shared-styles.css.js.map +1 -1
- package/button/lib/shared-styles.scss +2 -0
- package/button/lib/text-styles.css.js +1 -1
- package/button/lib/text-styles.css.js.map +1 -1
- package/button/lib/text-styles.scss +2 -0
- package/button/lib/tonal-styles.css.js +1 -1
- package/button/lib/tonal-styles.css.js.map +1 -1
- package/button/lib/tonal-styles.scss +2 -0
- package/button/outlined-button.js.map +1 -1
- package/button/outlined-link-button.js.map +1 -1
- package/button/text-button.js.map +1 -1
- package/button/text-link-button.js.map +1 -1
- package/button/tonal-button.js.map +1 -1
- package/button/tonal-link-button.js.map +1 -1
- package/checkbox/checkbox.js.map +1 -1
- package/checkbox/lib/_checkbox.scss +26 -31
- package/checkbox/lib/checkbox-styles.css.js +1 -1
- package/checkbox/lib/checkbox-styles.css.js.map +1 -1
- package/checkbox/lib/checkbox-styles.scss +2 -0
- package/checkbox/lib/checkbox.js +6 -6
- package/checkbox/lib/checkbox.js.map +1 -1
- package/checkbox/lib/forced-colors-styles.scss +2 -0
- package/chips/action/delete-action.js.map +1 -1
- package/chips/action/lib/action.js +4 -4
- package/chips/action/lib/action.js.map +1 -1
- package/chips/action/lib/link-action.js +1 -1
- package/chips/action/lib/link-action.js.map +1 -1
- package/chips/action/lib/primary-action.js.map +1 -1
- package/chips/action/lib/selectable-action.js.map +1 -1
- package/chips/action/link-action.js.map +1 -1
- package/chips/action/presentational-action.js.map +1 -1
- package/chips/action/primary-action.js.map +1 -1
- package/chips/action/selectable-action.js.map +1 -1
- package/chips/chip/lib/_assist-chip-theme.scss +4 -0
- package/chips/chip/lib/_chip-theme.scss +29 -40
- package/chips/chip/lib/_chip.scss +2 -0
- package/chips/chip/lib/_filter-chip-theme.scss +4 -0
- package/chips/chip/lib/_input-chip-theme.scss +4 -0
- package/chips/chip/lib/_suggestion-chip-theme.scss +4 -0
- package/chips/chip/lib/chip.js.map +1 -1
- package/chips/chip/lib/foundation.js +4 -4
- package/chips/chip/lib/foundation.js.map +1 -1
- package/chips/chip/lib/link-chip.js.map +1 -1
- package/chips/chip/lib/selectable-chip.js.map +1 -1
- package/chips/chip/lib/types.d.ts +2 -2
- package/chips/chipset/lib/_chip-set-theme.scss +2 -0
- package/chips/chipset/lib/_chip-set.scss +2 -0
- package/chips/chipset/lib/foundation.js +3 -3
- package/chips/chipset/lib/foundation.js.map +1 -1
- package/chips/chipset/lib/types.d.ts +3 -3
- package/controller/events.js +4 -0
- package/controller/events.js.map +1 -1
- package/controller/form-controller.d.ts +1 -1
- package/controller/form-controller.js +21 -29
- package/controller/form-controller.js.map +1 -1
- package/dialog/dialog.js.map +1 -1
- package/dialog/harness.d.ts +2 -2
- package/dialog/harness.js +11 -8
- package/dialog/harness.js.map +1 -1
- package/dialog/lib/_dialog.scss +7 -11
- package/dialog/lib/_tokens.scss +9 -6
- package/dialog/lib/dialog-styles.css.js +1 -1
- package/dialog/lib/dialog-styles.css.js.map +1 -1
- package/dialog/lib/dialog-styles.scss +2 -0
- package/dialog/lib/dialog.js +9 -7
- package/dialog/lib/dialog.js.map +1 -1
- package/divider/divider.js.map +1 -1
- package/divider/lib/_divider.scss +2 -0
- package/divider/lib/divider-styles.scss +2 -0
- package/divider/lib/divider.js.map +1 -1
- package/elevation/elevation.js.map +1 -1
- package/elevation/lib/_elevation.scss +4 -0
- package/elevation/lib/_md-comp-elevation.scss +4 -0
- package/elevation/lib/elevation-styles.scss +2 -0
- package/elevation/lib/elevation.js.map +1 -1
- package/fab/fab-extended.js.map +1 -1
- package/fab/fab.js.map +1 -1
- package/fab/lib/_fab-extended.scss +18 -11
- package/fab/lib/_fab.scss +7 -2
- package/fab/lib/_shared.scss +16 -8
- package/fab/lib/fab-extended-styles.css.js +1 -1
- package/fab/lib/fab-extended-styles.css.js.map +1 -1
- package/fab/lib/fab-extended-styles.scss +2 -0
- package/fab/lib/fab-shared-styles.css.js +1 -1
- package/fab/lib/fab-shared-styles.css.js.map +1 -1
- package/fab/lib/fab-shared-styles.scss +2 -0
- package/fab/lib/fab-shared.d.ts +9 -15
- package/fab/lib/fab-shared.js +21 -33
- package/fab/lib/fab-shared.js.map +1 -1
- package/fab/lib/fab-styles.css.js +1 -1
- package/fab/lib/fab-styles.css.js.map +1 -1
- package/fab/lib/fab-styles.scss +2 -0
- package/field/filled-field.d.ts +1 -1
- package/field/filled-field.js +1 -1
- package/field/filled-field.js.map +1 -1
- package/field/harness.js +1 -1
- package/field/harness.js.map +1 -1
- package/field/lib/_content.scss +120 -57
- package/field/lib/_filled-field.scss +73 -130
- package/field/lib/_label.scss +27 -65
- package/field/lib/_md-comp-filled-field.scss +127 -56
- package/field/lib/_md-comp-outlined-field.scss +104 -52
- package/field/lib/_outlined-field.scss +108 -120
- package/field/lib/_shared.scss +27 -45
- package/field/lib/_supporting-text.scss +25 -52
- package/field/lib/field.d.ts +15 -31
- package/field/lib/field.js +130 -139
- package/field/lib/field.js.map +1 -1
- package/field/lib/filled-field.d.ts +5 -16
- package/field/lib/filled-field.js +8 -70
- package/field/lib/filled-field.js.map +1 -1
- package/field/lib/filled-styles.css.js +1 -1
- package/field/lib/filled-styles.css.js.map +1 -1
- package/field/lib/outlined-field.d.ts +4 -10
- package/field/lib/outlined-field.js +13 -33
- package/field/lib/outlined-field.js.map +1 -1
- package/field/lib/outlined-styles.css.js +1 -1
- package/field/lib/outlined-styles.css.js.map +1 -1
- package/field/lib/shared-styles.css.js +1 -1
- package/field/lib/shared-styles.css.js.map +1 -1
- package/field/outlined-field.d.ts +1 -1
- package/field/outlined-field.js +1 -1
- package/field/outlined-field.js.map +1 -1
- package/focus/focus-ring.js.map +1 -1
- package/focus/lib/_focus-ring.scss +7 -13
- package/focus/lib/_md-comp-focus-ring.scss +4 -0
- package/focus/lib/focus-ring-styles.css.js +1 -1
- package/focus/lib/focus-ring-styles.css.js.map +1 -1
- package/focus/lib/focus-ring-styles.scss +2 -0
- package/focus/lib/focus-ring.js.map +1 -1
- package/icon/icon.js.map +1 -1
- package/icon/lib/_icon.scss +3 -1
- package/icon/lib/_md-comp-icon.scss +1 -2
- package/icon/lib/icon-styles.css.js +1 -1
- package/icon/lib/icon-styles.css.js.map +1 -1
- package/icon/lib/icon-styles.scss +2 -0
- package/iconbutton/filled-icon-button-toggle.js.map +1 -1
- package/iconbutton/filled-icon-button.js.map +1 -1
- package/iconbutton/filled-link-icon-button.js.map +1 -1
- package/iconbutton/filled-tonal-icon-button-toggle.js.map +1 -1
- package/iconbutton/filled-tonal-icon-button.js.map +1 -1
- package/iconbutton/filled-tonal-link-icon-button.js.map +1 -1
- package/iconbutton/lib/_filled-icon-button.scss +19 -19
- package/iconbutton/lib/_filled-tonal-icon-button.scss +19 -19
- package/iconbutton/lib/_outlined-icon-button.scss +20 -16
- package/iconbutton/lib/_shared.scss +8 -8
- package/iconbutton/lib/_standard-icon-button.scss +21 -18
- package/iconbutton/lib/filled-styles.css.js +1 -1
- package/iconbutton/lib/filled-styles.css.js.map +1 -1
- package/iconbutton/lib/filled-styles.scss +2 -0
- package/iconbutton/lib/filled-tonal-styles.css.js +1 -1
- package/iconbutton/lib/filled-tonal-styles.css.js.map +1 -1
- package/iconbutton/lib/filled-tonal-styles.scss +2 -0
- package/iconbutton/lib/icon-button-toggle.js.map +1 -1
- package/iconbutton/lib/icon-button.js.map +1 -1
- package/iconbutton/lib/link-icon-button.js.map +1 -1
- package/iconbutton/lib/outlined-styles.css.js +1 -1
- package/iconbutton/lib/outlined-styles.css.js.map +1 -1
- package/iconbutton/lib/outlined-styles.scss +2 -0
- package/iconbutton/lib/shared-styles.scss +2 -0
- package/iconbutton/lib/standard-styles.css.js +1 -1
- package/iconbutton/lib/standard-styles.css.js.map +1 -1
- package/iconbutton/lib/standard-styles.scss +2 -0
- package/iconbutton/outlined-icon-button-toggle.js.map +1 -1
- package/iconbutton/outlined-icon-button.js.map +1 -1
- package/iconbutton/outlined-link-icon-button.js.map +1 -1
- package/iconbutton/standard-icon-button-toggle.js.map +1 -1
- package/iconbutton/standard-icon-button.js.map +1 -1
- package/iconbutton/standard-link-icon-button.js.map +1 -1
- package/list/lib/_list.scss +25 -11
- package/list/lib/list-styles.scss +2 -0
- package/list/lib/list.js +3 -1
- package/list/lib/list.js.map +1 -1
- package/list/lib/listitem/_list-item.scss +320 -128
- package/list/lib/listitem/list-item-styles.css.js +1 -1
- package/list/lib/listitem/list-item-styles.css.js.map +1 -1
- package/list/lib/listitem/list-item-styles.scss +2 -0
- package/list/lib/listitem/list-item.d.ts +8 -7
- package/list/lib/listitem/list-item.js +25 -27
- package/list/lib/listitem/list-item.js.map +1 -1
- package/list/lib/listitemlink/list-item-link.js.map +1 -1
- package/list/list-item-link.d.ts +18 -0
- package/list/list-item-link.js +19 -2
- package/list/list-item-link.js.map +1 -1
- package/list/list-item.d.ts +19 -0
- package/list/list-item.js +20 -2
- package/list/list-item.js.map +1 -1
- package/list/list.js.map +1 -1
- package/menu/lib/_menu.scss +32 -8
- package/menu/lib/menu-styles.css.js +1 -1
- package/menu/lib/menu-styles.css.js.map +1 -1
- package/menu/lib/menu-styles.scss +2 -0
- package/menu/lib/menu.d.ts +1 -1
- package/menu/lib/menu.js +8 -7
- package/menu/lib/menu.js.map +1 -1
- package/menu/lib/menuitem/_menu-item.scss +44 -76
- package/menu/lib/menuitem/menu-item-styles.css.js +1 -1
- package/menu/lib/menuitem/menu-item-styles.css.js.map +1 -1
- package/menu/lib/menuitem/menu-item-styles.scss +2 -0
- package/menu/lib/menuitem/menu-item.js.map +1 -1
- package/menu/lib/menuitemlink/menu-item-link.js.map +1 -1
- package/menu/lib/shared.d.ts +3 -3
- package/menu/lib/submenuitem/sub-menu-item.d.ts +0 -1
- package/menu/lib/submenuitem/sub-menu-item.js +0 -1
- package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
- package/menu/lib/surfacePositionController.d.ts +1 -1
- package/menu/lib/typeaheadController.d.ts +1 -1
- package/menu/menu-item-link.js +1 -2
- package/menu/menu-item-link.js.map +1 -1
- package/menu/menu-item.js +2 -3
- package/menu/menu-item.js.map +1 -1
- package/menu/menu.js.map +1 -1
- package/menu/sub-menu-item.js +1 -2
- package/menu/sub-menu-item.js.map +1 -1
- package/menusurface/lib/_md-comp-menu-surface.scss +5 -1
- package/menusurface/lib/_menu-surface.scss +4 -0
- package/menusurface/lib/foundation.js +31 -31
- package/menusurface/lib/foundation.js.map +1 -1
- package/menusurface/lib/menu-surface-styles.scss +2 -0
- package/menusurface/lib/menu-surface.d.ts +2 -2
- package/menusurface/lib/menu-surface.js.map +1 -1
- package/menusurface/menu-surface.js.map +1 -1
- package/navigationbar/lib/_navigation-bar.scss +2 -0
- package/navigationbar/lib/constants.d.ts +1 -1
- package/navigationbar/lib/navigation-bar-styles.scss +2 -0
- package/navigationbar/lib/navigation-bar.js.map +1 -1
- package/navigationbar/navigation-bar.js.map +1 -1
- package/navigationdrawer/lib/_navigation-drawer-modal.scss +11 -2
- package/navigationdrawer/lib/_navigation-drawer.scss +10 -5
- package/navigationdrawer/lib/_shared.scss +4 -8
- package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js +1 -1
- package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer-modal-styles.scss +2 -0
- package/navigationdrawer/lib/navigation-drawer-modal.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer-styles.css.js +1 -1
- package/navigationdrawer/lib/navigation-drawer-styles.css.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer-styles.scss +2 -0
- package/navigationdrawer/lib/navigation-drawer.js.map +1 -1
- package/navigationdrawer/lib/shared-styles.scss +2 -0
- package/navigationdrawer/navigation-drawer-modal.js.map +1 -1
- package/navigationdrawer/navigation-drawer.js.map +1 -1
- package/navigationtab/lib/_navigation-tab.scss +26 -22
- package/navigationtab/lib/navigation-tab-styles.css.js +1 -1
- package/navigationtab/lib/navigation-tab-styles.css.js.map +1 -1
- package/navigationtab/lib/navigation-tab-styles.scss +2 -0
- package/navigationtab/lib/navigation-tab.js +4 -4
- package/navigationtab/lib/navigation-tab.js.map +1 -1
- package/navigationtab/navigation-tab.js.map +1 -1
- package/package.json +2 -2
- package/radio/lib/_radio.scss +16 -14
- package/radio/lib/forced-colors-styles.scss +2 -0
- package/radio/lib/radio-styles.css.js +1 -1
- package/radio/lib/radio-styles.css.js.map +1 -1
- package/radio/lib/radio-styles.scss +2 -0
- package/radio/lib/radio.js +21 -21
- package/radio/lib/radio.js.map +1 -1
- package/radio/radio.js.map +1 -1
- package/ripple/directive.d.ts +1 -33
- package/ripple/directive.js +7 -194
- package/ripple/directive.js.map +1 -1
- package/ripple/lib/_md-comp-ripple.scss +20 -19
- package/ripple/lib/_ripple.scss +20 -20
- package/ripple/lib/ripple-styles.css.js +1 -1
- package/ripple/lib/ripple-styles.css.js.map +1 -1
- package/ripple/lib/ripple-styles.scss +2 -0
- package/ripple/lib/ripple.d.ts +50 -48
- package/ripple/lib/ripple.js +214 -76
- package/ripple/lib/ripple.js.map +1 -1
- package/ripple/ripple.d.ts +9 -1
- package/ripple/ripple.js +9 -1
- package/ripple/ripple.js.map +1 -1
- package/sass/_assert.scss +2 -0
- package/sass/_color-scheme.scss +4 -0
- package/sass/_color.scss +4 -0
- package/sass/_elevation.scss +4 -0
- package/sass/_feature-flags.scss +2 -0
- package/sass/_map-ext.scss +2 -0
- package/sass/_resolvers.scss +4 -4
- package/sass/_shape.scss +75 -27
- package/sass/_string-ext.scss +44 -0
- package/sass/_theme.scss +4 -0
- package/sass/_typography.scss +18 -93
- package/sass/_var.scss +4 -0
- package/segmentedbutton/lib/_outlined-segmented-button.scss +4 -0
- package/segmentedbutton/lib/_shared.scss +18 -22
- package/segmentedbutton/lib/outlined-styles.css.js +1 -1
- package/segmentedbutton/lib/outlined-styles.css.js.map +1 -1
- package/segmentedbutton/lib/outlined-styles.scss +2 -0
- package/segmentedbutton/lib/segmented-button.js +4 -4
- package/segmentedbutton/lib/segmented-button.js.map +1 -1
- package/segmentedbutton/lib/shared-styles.css.js +1 -1
- package/segmentedbutton/lib/shared-styles.css.js.map +1 -1
- package/segmentedbutton/lib/shared-styles.scss +2 -0
- package/segmentedbutton/outlined-segmented-button.js.map +1 -1
- package/segmentedbuttonset/lib/_outlined-segmented-button-set.scss +9 -5
- package/segmentedbuttonset/lib/_shared.scss +0 -13
- package/segmentedbuttonset/lib/outlined-styles.css.js +1 -1
- package/segmentedbuttonset/lib/outlined-styles.css.js.map +1 -1
- package/segmentedbuttonset/lib/outlined-styles.scss +2 -0
- package/segmentedbuttonset/lib/segmented-button-set.js.map +1 -1
- package/segmentedbuttonset/lib/shared-styles.scss +2 -0
- package/segmentedbuttonset/outlined-segmented-button-set.js.map +1 -1
- package/{list/lib/listitem/list-item-private-styles.scss → slider/_slider.scss} +1 -3
- package/slider/harness.d.ts +20 -0
- package/slider/harness.js +63 -0
- package/slider/harness.js.map +1 -0
- package/slider/lib/_slider.scss +503 -0
- package/slider/lib/_tokens.scss +66 -0
- package/slider/lib/forced-colors-styles.css.js +9 -0
- package/slider/lib/forced-colors-styles.css.js.map +1 -0
- package/slider/lib/forced-colors-styles.scss +53 -0
- package/slider/lib/slider-styles.css.js +9 -0
- package/slider/lib/slider-styles.css.js.map +1 -0
- package/{menu/lib/menuitem/menu-item-private-styles.scss → slider/lib/slider-styles.scss} +2 -2
- package/slider/lib/slider.d.ts +158 -0
- package/slider/lib/slider.js +575 -0
- package/slider/lib/slider.js.map +1 -0
- package/slider/slider.d.ts +28 -0
- package/slider/slider.js +32 -0
- package/slider/slider.js.map +1 -0
- package/switch/lib/README.md +55 -0
- package/switch/lib/_handle.scss +17 -18
- package/switch/lib/_icon.scss +4 -0
- package/switch/lib/_switch.scss +11 -18
- package/switch/lib/_track.scss +2 -0
- package/switch/lib/switch-styles.css.js +1 -1
- package/switch/lib/switch-styles.css.js.map +1 -1
- package/switch/lib/switch-styles.scss +2 -0
- package/switch/lib/switch.js +9 -9
- package/switch/lib/switch.js.map +1 -1
- package/switch/switch.js.map +1 -1
- package/textfield/filled-text-field.d.ts +1 -1
- package/textfield/filled-text-field.js +1 -2
- package/textfield/filled-text-field.js.map +1 -1
- package/textfield/harness.js +1 -1
- package/textfield/harness.js.map +1 -1
- package/textfield/lib/_filled-text-field.scss +116 -110
- package/textfield/lib/_icon.scss +14 -73
- package/textfield/lib/_input.scss +15 -36
- package/textfield/lib/_outlined-text-field.scss +107 -103
- package/textfield/lib/_shared.scss +10 -29
- package/textfield/lib/filled-forced-colors-styles.scss +2 -0
- package/textfield/lib/filled-styles.css.js +1 -1
- package/textfield/lib/filled-styles.css.js.map +1 -1
- package/textfield/lib/filled-styles.scss +2 -0
- package/textfield/lib/filled-text-field.d.ts +6 -5
- package/textfield/lib/filled-text-field.js +8 -7
- package/textfield/lib/filled-text-field.js.map +1 -1
- package/textfield/lib/outlined-forced-colors-styles.scss +2 -0
- package/textfield/lib/outlined-styles.css.js +1 -1
- package/textfield/lib/outlined-styles.css.js.map +1 -1
- package/textfield/lib/outlined-styles.scss +2 -0
- package/textfield/lib/outlined-text-field.d.ts +6 -5
- package/textfield/lib/outlined-text-field.js +8 -7
- package/textfield/lib/outlined-text-field.js.map +1 -1
- package/textfield/lib/shared-styles.css.js +1 -1
- package/textfield/lib/shared-styles.css.js.map +1 -1
- package/textfield/lib/shared-styles.scss +2 -0
- package/textfield/lib/text-field.d.ts +40 -88
- package/textfield/lib/text-field.js +194 -270
- package/textfield/lib/text-field.js.map +1 -1
- package/textfield/outlined-text-field.d.ts +1 -1
- package/textfield/outlined-text-field.js +1 -2
- package/textfield/outlined-text-field.js.map +1 -1
- package/tokens/_index.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-assist-chip.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-badge.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-banner.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-bottom-app-bar.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-carousel-item.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-checkbox.scss +4 -15
- package/tokens/{v0_152 → v0_160}/_md-comp-circular-progress-indicator.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-data-table.scss +1 -3
- package/tokens/{v0_152 → v0_160}/_md-comp-date-input-modal.scss +10 -10
- package/tokens/{v0_152 → v0_160}/_md-comp-date-picker-docked.scss +23 -23
- package/tokens/{v0_152 → v0_160}/_md-comp-date-picker-modal.scss +34 -34
- package/tokens/{v0_152 → v0_160}/_md-comp-dialog.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-divider.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-elevated-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-elevated-card.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-extended-fab-branded.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-extended-fab-primary.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-extended-fab-secondary.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-extended-fab-surface.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-extended-fab-tertiary.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-branded-large.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-branded.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-primary-large.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-primary-small.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-primary.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-secondary-large.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-secondary-small.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-secondary.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-surface-large.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-surface-small.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-surface.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-tertiary-large.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-tertiary-small.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-tertiary.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-autocomplete.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-card.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-icon-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-menu-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-select.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-text-field.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-tonal-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-tonal-icon-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filter-chip.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-full-screen-dialog.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-icon-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-input-chip.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-linear-progress-indicator.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-list.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-menu.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-navigation-bar.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-navigation-drawer.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-navigation-rail.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-autocomplete.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-card.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-icon-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-menu-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-segmented-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-select.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-text-field.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-plain-tooltip.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-primary-navigation-tab.scss +1 -3
- package/tokens/{v0_152 → v0_160}/_md-comp-radio-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-rich-tooltip.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-scrim.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-search-bar.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-search-view.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-secondary-navigation-tab.scss +1 -3
- package/tokens/{v0_152 → v0_160}/_md-comp-sheet-bottom.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-sheet-floating.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-sheet-side.scss +10 -10
- package/tokens/{v0_152 → v0_160}/_md-comp-slider.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-snackbar.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-standard-menu-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-suggestion-chip.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-switch.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-text-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-time-input.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-time-picker.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-top-app-bar-large.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-top-app-bar-medium.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-top-app-bar-small-centered.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-top-app-bar-small.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-ref-palette.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-ref-typeface.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-sys-color.scss +217 -1
- package/tokens/{v0_152 → v0_160}/_md-sys-elevation.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-sys-motion.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-sys-shape.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-sys-state.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-sys-typescale.scss +1 -1
- package/tokens/v0_161/_index.scss +107 -0
- package/tokens/v0_161/_md-comp-assist-chip.scss +109 -0
- package/tokens/v0_161/_md-comp-badge.scss +58 -0
- package/tokens/v0_161/_md-comp-banner.scss +75 -0
- package/tokens/v0_161/_md-comp-bottom-app-bar.scss +35 -0
- package/tokens/v0_161/_md-comp-carousel-item.scss +65 -0
- package/tokens/v0_161/_md-comp-checkbox.scss +126 -0
- package/tokens/v0_161/_md-comp-circular-progress-indicator.scss +39 -0
- package/tokens/v0_161/_md-comp-data-table.scss +96 -0
- package/tokens/v0_161/_md-comp-date-input-modal.scss +89 -0
- package/tokens/v0_161/_md-comp-date-picker-docked.scss +246 -0
- package/tokens/v0_161/_md-comp-date-picker-modal.scss +305 -0
- package/tokens/v0_161/_md-comp-dialog.scss +123 -0
- package/tokens/v0_161/_md-comp-divider.scss +25 -0
- package/tokens/v0_161/_md-comp-elevated-button.scss +91 -0
- package/tokens/v0_161/_md-comp-elevated-card.scss +59 -0
- package/tokens/v0_161/_md-comp-extended-fab-branded.scss +86 -0
- package/tokens/v0_161/_md-comp-extended-fab-primary.scss +94 -0
- package/tokens/v0_161/_md-comp-extended-fab-secondary.scss +95 -0
- package/tokens/v0_161/_md-comp-extended-fab-surface.scss +90 -0
- package/tokens/v0_161/_md-comp-extended-fab-tertiary.scss +95 -0
- package/tokens/v0_161/_md-comp-fab-branded-large.scss +60 -0
- package/tokens/v0_161/_md-comp-fab-branded.scss +60 -0
- package/tokens/v0_161/_md-comp-fab-primary-large.scss +65 -0
- package/tokens/v0_161/_md-comp-fab-primary-small.scss +65 -0
- package/tokens/v0_161/_md-comp-fab-primary.scss +65 -0
- package/tokens/v0_161/_md-comp-fab-secondary-large.scss +66 -0
- package/tokens/v0_161/_md-comp-fab-secondary-small.scss +66 -0
- package/tokens/v0_161/_md-comp-fab-secondary.scss +66 -0
- package/tokens/v0_161/_md-comp-fab-surface-large.scss +64 -0
- package/tokens/v0_161/_md-comp-fab-surface-small.scss +64 -0
- package/tokens/v0_161/_md-comp-fab-surface.scss +64 -0
- package/tokens/v0_161/_md-comp-fab-tertiary-large.scss +66 -0
- package/tokens/v0_161/_md-comp-fab-tertiary-small.scss +66 -0
- package/tokens/v0_161/_md-comp-fab-tertiary.scss +66 -0
- package/tokens/v0_161/_md-comp-filled-autocomplete.scss +267 -0
- package/tokens/v0_161/_md-comp-filled-button.scss +89 -0
- package/tokens/v0_161/_md-comp-filled-card.scss +58 -0
- package/tokens/v0_161/_md-comp-filled-icon-button.scss +79 -0
- package/tokens/v0_161/_md-comp-filled-menu-button.scss +98 -0
- package/tokens/v0_161/_md-comp-filled-select.scss +272 -0
- package/tokens/v0_161/_md-comp-filled-text-field.scss +189 -0
- package/tokens/v0_161/_md-comp-filled-tonal-button.scss +99 -0
- package/tokens/v0_161/_md-comp-filled-tonal-icon-button.scss +86 -0
- package/tokens/v0_161/_md-comp-filter-chip.scss +209 -0
- package/tokens/v0_161/_md-comp-full-screen-dialog.scss +111 -0
- package/tokens/v0_161/_md-comp-icon-button.scss +70 -0
- package/tokens/v0_161/_md-comp-input-chip.scss +184 -0
- package/tokens/v0_161/_md-comp-linear-progress-indicator.scss +41 -0
- package/tokens/v0_161/_md-comp-list.scss +248 -0
- package/tokens/v0_161/_md-comp-menu.scss +37 -0
- package/tokens/v0_161/_md-comp-navigation-bar.scss +114 -0
- package/tokens/v0_161/_md-comp-navigation-drawer.scss +162 -0
- package/tokens/v0_161/_md-comp-navigation-rail.scss +131 -0
- package/tokens/v0_161/_md-comp-outlined-autocomplete.scss +257 -0
- package/tokens/v0_161/_md-comp-outlined-button.scss +84 -0
- package/tokens/v0_161/_md-comp-outlined-card.scss +65 -0
- package/tokens/v0_161/_md-comp-outlined-icon-button.scss +79 -0
- package/tokens/v0_161/_md-comp-outlined-menu-button.scss +94 -0
- package/tokens/v0_161/_md-comp-outlined-segmented-button.scss +112 -0
- package/tokens/v0_161/_md-comp-outlined-select.scss +262 -0
- package/tokens/v0_161/_md-comp-outlined-text-field.scss +171 -0
- package/tokens/v0_161/_md-comp-plain-tooltip.scss +55 -0
- package/tokens/v0_161/_md-comp-primary-navigation-tab.scss +121 -0
- package/tokens/v0_161/_md-comp-radio-button.scss +68 -0
- package/tokens/v0_161/_md-comp-rich-tooltip.scss +121 -0
- package/tokens/v0_161/_md-comp-scrim.scss +25 -0
- package/tokens/v0_161/_md-comp-search-bar.scss +99 -0
- package/tokens/v0_161/_md-comp-search-view.scss +93 -0
- package/tokens/v0_161/_md-comp-secondary-navigation-tab.scss +84 -0
- package/tokens/v0_161/_md-comp-sheet-bottom.scss +45 -0
- package/tokens/v0_161/_md-comp-sheet-floating.scss +34 -0
- package/tokens/v0_161/_md-comp-sheet-side.scss +91 -0
- package/tokens/v0_161/_md-comp-slider.scss +114 -0
- package/tokens/v0_161/_md-comp-snackbar.scss +127 -0
- package/tokens/v0_161/_md-comp-standard-menu-button.scss +98 -0
- package/tokens/v0_161/_md-comp-suggestion-chip.scss +125 -0
- package/tokens/v0_161/_md-comp-switch.scss +136 -0
- package/tokens/v0_161/_md-comp-text-button.scss +77 -0
- package/tokens/v0_161/_md-comp-time-input.scss +218 -0
- package/tokens/v0_161/_md-comp-time-picker.scss +264 -0
- package/tokens/v0_161/_md-comp-top-app-bar-large.scss +63 -0
- package/tokens/v0_161/_md-comp-top-app-bar-medium.scss +63 -0
- package/tokens/v0_161/_md-comp-top-app-bar-small-centered.scss +66 -0
- package/tokens/v0_161/_md-comp-top-app-bar-small.scss +64 -0
- package/tokens/v0_161/_md-ref-palette.scss +107 -0
- package/tokens/v0_161/_md-ref-typeface.scss +21 -0
- package/tokens/v0_161/_md-sys-color.scss +904 -0
- package/tokens/v0_161/_md-sys-elevation.scss +21 -0
- package/tokens/v0_161/_md-sys-motion.scss +53 -0
- package/tokens/v0_161/_md-sys-shape.scss +30 -0
- package/tokens/v0_161/_md-sys-state.scss +19 -0
- package/tokens/v0_161/_md-sys-typescale.scss +284 -0
- package/tokens/v0_161/index.test.css.js +9 -0
- package/tokens/v0_161/index.test.css.js.map +1 -0
- package/tokens/v0_161/index.test.scss +584 -0
- package/tokens/v0_161/lib.test.css.js +9 -0
- package/tokens/v0_161/lib.test.css.js.map +1 -0
- package/tokens/v0_161/lib.test.scss +663 -0
- package/controller/foundation.d.ts +0 -24
- package/controller/foundation.js +0 -18
- package/controller/foundation.js.map +0 -1
- package/controller/observer-foundation.d.ts +0 -25
- package/controller/observer-foundation.js +0 -37
- package/controller/observer-foundation.js.map +0 -1
- package/controller/observer.d.ts +0 -52
- package/controller/observer.js +0 -149
- package/controller/observer.js.map +0 -1
- package/decorators/bound.d.ts +0 -40
- package/decorators/bound.js +0 -49
- package/decorators/bound.js.map +0 -1
- package/list/lib/avatar/_list-item-avatar.scss +0 -38
- package/list/lib/avatar/list-item-avatar-styles.css.js +0 -9
- package/list/lib/avatar/list-item-avatar-styles.css.js.map +0 -1
- package/list/lib/avatar/list-item-avatar-styles.scss +0 -8
- package/list/lib/avatar/list-item-avatar.d.ts +0 -21
- package/list/lib/avatar/list-item-avatar.js +0 -48
- package/list/lib/avatar/list-item-avatar.js.map +0 -1
- package/list/lib/icon/_list-item-icon.scss +0 -67
- package/list/lib/icon/list-item-icon-styles.css.js +0 -9
- package/list/lib/icon/list-item-icon-styles.css.js.map +0 -1
- package/list/lib/icon/list-item-icon-styles.scss +0 -8
- package/list/lib/icon/list-item-icon.d.ts +0 -9
- package/list/lib/icon/list-item-icon.js +0 -15
- package/list/lib/icon/list-item-icon.js.map +0 -1
- package/list/lib/image/_list-item-image.scss +0 -59
- package/list/lib/image/list-item-image-styles.css.js +0 -9
- package/list/lib/image/list-item-image-styles.css.js.map +0 -1
- package/list/lib/image/list-item-image-styles.scss +0 -8
- package/list/lib/image/list-item-image.d.ts +0 -21
- package/list/lib/image/list-item-image.js +0 -48
- package/list/lib/image/list-item-image.js.map +0 -1
- package/list/lib/listitem/list-item-private-styles.css.js +0 -9
- package/list/lib/listitem/list-item-private-styles.css.js.map +0 -1
- package/list/lib/video/_list-item-video.scss +0 -67
- package/list/lib/video/list-item-video-styles.css.d.ts +0 -1
- package/list/lib/video/list-item-video-styles.css.js +0 -9
- package/list/lib/video/list-item-video-styles.css.js.map +0 -1
- package/list/lib/video/list-item-video-styles.scss +0 -8
- package/list/lib/video/list-item-video.d.ts +0 -53
- package/list/lib/video/list-item-video.js +0 -115
- package/list/lib/video/list-item-video.js.map +0 -1
- package/list/list-item-avatar.d.ts +0 -20
- package/list/list-item-avatar.js +0 -23
- package/list/list-item-avatar.js.map +0 -1
- package/list/list-item-icon.d.ts +0 -20
- package/list/list-item-icon.js +0 -23
- package/list/list-item-icon.js.map +0 -1
- package/list/list-item-image.d.ts +0 -20
- package/list/list-item-image.js +0 -23
- package/list/list-item-image.js.map +0 -1
- package/list/list-item-video.d.ts +0 -20
- package/list/list-item-video.js +0 -23
- package/list/list-item-video.js.map +0 -1
- package/menu/lib/menuitem/menu-item-private-styles.css.d.ts +0 -1
- package/menu/lib/menuitem/menu-item-private-styles.css.js +0 -9
- package/menu/lib/menuitem/menu-item-private-styles.css.js.map +0 -1
- /package/{list/lib/avatar/list-item-avatar-styles.css.d.ts → slider/lib/forced-colors-styles.css.d.ts} +0 -0
- /package/{list/lib/icon/list-item-icon-styles.css.d.ts → slider/lib/slider-styles.css.d.ts} +0 -0
- /package/tokens/{v0_152 → v0_160}/_index.scss +0 -0
- /package/tokens/{v0_152 → v0_160}/index.test.css.d.ts +0 -0
- /package/tokens/{v0_152 → v0_160}/index.test.css.js +0 -0
- /package/tokens/{v0_152 → v0_160}/index.test.css.js.map +0 -0
- /package/tokens/{v0_152 → v0_160}/index.test.scss +0 -0
- /package/tokens/{v0_152 → v0_160}/lib.test.css.d.ts +0 -0
- /package/tokens/{v0_152 → v0_160}/lib.test.css.js +0 -0
- /package/tokens/{v0_152 → v0_160}/lib.test.css.js.map +0 -0
- /package/tokens/{v0_152 → v0_160}/lib.test.scss +0 -0
- /package/{list/lib/image/list-item-image-styles.css.d.ts → tokens/v0_161/index.test.css.d.ts} +0 -0
- /package/{list/lib/listitem/list-item-private-styles.css.d.ts → tokens/v0_161/lib.test.css.d.ts} +0 -0
package/ripple/lib/_ripple.scss
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
//
|
|
5
5
|
|
|
6
|
-
//
|
|
7
|
-
// Selector '.md3-*' should only be used in this project.
|
|
8
|
-
|
|
6
|
+
// go/keep-sorted start
|
|
9
7
|
@use 'sass:map';
|
|
8
|
+
// go/keep-sorted end
|
|
9
|
+
// go/keep-sorted start
|
|
10
10
|
@use '../../sass/theme';
|
|
11
11
|
@use '../../tokens';
|
|
12
12
|
@use './md-comp-ripple';
|
|
13
|
+
// go/keep-sorted end
|
|
13
14
|
|
|
14
15
|
@mixin theme($tokens) {
|
|
15
16
|
$tokens: theme.validate-theme(md-comp-ripple.values(), $tokens);
|
|
@@ -37,19 +38,19 @@
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
:host,
|
|
40
|
-
.
|
|
41
|
+
.surface {
|
|
41
42
|
position: absolute;
|
|
42
43
|
inset: 0;
|
|
43
44
|
pointer-events: none;
|
|
44
45
|
overflow: hidden;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
.
|
|
48
|
+
.surface {
|
|
48
49
|
// TODO(https://bugs.webkit.org/show_bug.cgi?id=247546)
|
|
49
50
|
// Remove Safari workaround for incorrect ripple overflow when addressed.
|
|
50
51
|
// This addresses `hover` and `pressed` state oveflow.
|
|
51
52
|
will-change: transform;
|
|
52
|
-
border-radius: var(--
|
|
53
|
+
border-radius: var(--_shape);
|
|
53
54
|
outline: none;
|
|
54
55
|
-webkit-tap-highlight-color: transparent;
|
|
55
56
|
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
&::before {
|
|
65
|
-
background-color: var(--_hover-
|
|
66
|
+
background-color: var(--_hover-color);
|
|
66
67
|
transition: opacity 15ms linear, background-color 15ms linear;
|
|
67
68
|
inset: 0;
|
|
68
69
|
}
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
// press ripple fade-out
|
|
72
73
|
background: radial-gradient(
|
|
73
74
|
closest-side,
|
|
74
|
-
var(--_pressed-
|
|
75
|
+
var(--_pressed-color) max(calc(100% - 70px), 65%),
|
|
75
76
|
transparent 100%
|
|
76
77
|
);
|
|
77
78
|
transition: opacity 375ms linear;
|
|
@@ -79,33 +80,32 @@
|
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
.
|
|
83
|
-
background-color: var(--_hover-
|
|
84
|
-
opacity: var(--_hover-
|
|
83
|
+
.hovered::before {
|
|
84
|
+
background-color: var(--_hover-color);
|
|
85
|
+
opacity: var(--_hover-opacity);
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
.
|
|
88
|
-
background-color: var(--_focus-
|
|
89
|
-
opacity: var(--_focus-
|
|
88
|
+
.focused::before {
|
|
89
|
+
background-color: var(--_focus-color);
|
|
90
|
+
opacity: var(--_focus-opacity);
|
|
90
91
|
transition-duration: 75ms;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
.
|
|
94
|
+
.pressed::after {
|
|
94
95
|
// press ripple fade-in
|
|
95
|
-
opacity: var(--_pressed-
|
|
96
|
+
opacity: var(--_pressed-opacity);
|
|
96
97
|
transition-duration: 105ms;
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
.
|
|
100
|
+
.unbounded {
|
|
100
101
|
$unbounded: (
|
|
101
|
-
|
|
102
|
+
shape: map.get(tokens.md-sys-shape-values(), 'corner-full'),
|
|
102
103
|
);
|
|
103
104
|
$unbounded: theme.create-theme-vars($unbounded, ripple);
|
|
104
105
|
|
|
105
|
-
--
|
|
106
|
+
--_shape: #{map.get($unbounded, 'shape')};
|
|
106
107
|
}
|
|
107
108
|
|
|
108
|
-
// TODO(b/230630968): create a forced-colors-mode mixin
|
|
109
109
|
@media screen and (forced-colors: active) {
|
|
110
110
|
:host {
|
|
111
111
|
display: none;
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { css } from 'lit';
|
|
7
|
-
export const styles = css `:host{--
|
|
7
|
+
export const styles = css `:host{--_focus-color: var(--md-ripple-focus-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-opacity: var(--md-ripple-focus-opacity, 0.12);--_hover-color: var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-opacity: var(--md-ripple-hover-opacity, 0.08);--_pressed-color: var(--md-ripple-pressed-color, var(--md-sys-color-on-surface, #1c1b1f));--_pressed-opacity: var(--md-ripple-pressed-opacity, 0.12);--_shape: var(--md-ripple-shape, 0px)}:host{display:flex}:host([disabled]){opacity:0}:host,.surface{position:absolute;inset:0;pointer-events:none;overflow:hidden}.surface{will-change:transform;border-radius:var(--_shape);outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.surface::before,.surface::after{position:absolute;opacity:0;pointer-events:none;content:""}.surface::before{background-color:var(--_hover-color);transition:opacity 15ms linear,background-color 15ms linear;inset:0}.surface::after{background:radial-gradient(closest-side, var(--_pressed-color) max(100% - 70px, 65%), transparent 100%);transition:opacity 375ms linear;transform-origin:center center}.hovered::before{background-color:var(--_hover-color);opacity:var(--_hover-opacity)}.focused::before{background-color:var(--_focus-color);opacity:var(--_focus-opacity);transition-duration:75ms}.pressed::after{opacity:var(--_pressed-opacity);transition-duration:105ms}.unbounded{--_shape: var(--md-ripple-shape, 9999px)}@media screen and (forced-colors: active){:host{display:none}}/*# sourceMappingURL=ripple-styles.css.map */
|
|
8
8
|
`;
|
|
9
9
|
//# sourceMappingURL=ripple-styles.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ripple-styles.css.js","sourceRoot":"","sources":["ripple-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--
|
|
1
|
+
{"version":3,"file":"ripple-styles.css.js","sourceRoot":"","sources":["ripple-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_focus-color: var(--md-ripple-focus-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-opacity: var(--md-ripple-focus-opacity, 0.12);--_hover-color: var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-opacity: var(--md-ripple-hover-opacity, 0.08);--_pressed-color: var(--md-ripple-pressed-color, var(--md-sys-color-on-surface, #1c1b1f));--_pressed-opacity: var(--md-ripple-pressed-opacity, 0.12);--_shape: var(--md-ripple-shape, 0px)}:host{display:flex}:host([disabled]){opacity:0}:host,.surface{position:absolute;inset:0;pointer-events:none;overflow:hidden}.surface{will-change:transform;border-radius:var(--_shape);outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.surface::before,.surface::after{position:absolute;opacity:0;pointer-events:none;content:\"\"}.surface::before{background-color:var(--_hover-color);transition:opacity 15ms linear,background-color 15ms linear;inset:0}.surface::after{background:radial-gradient(closest-side, var(--_pressed-color) max(100% - 70px, 65%), transparent 100%);transition:opacity 375ms linear;transform-origin:center center}.hovered::before{background-color:var(--_hover-color);opacity:var(--_hover-opacity)}.focused::before{background-color:var(--_focus-color);opacity:var(--_focus-opacity);transition-duration:75ms}.pressed::after{opacity:var(--_pressed-opacity);transition-duration:105ms}.unbounded{--_shape: var(--md-ripple-shape, 9999px)}@media screen and (forced-colors: active){:host{display:none}}/*# sourceMappingURL=ripple-styles.css.map */\n`;\n "]}
|
package/ripple/lib/ripple.d.ts
CHANGED
|
@@ -3,60 +3,62 @@
|
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { LitElement, PropertyValues
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
7
|
+
/**
|
|
8
|
+
* A ripple component.
|
|
9
|
+
*/
|
|
9
10
|
export declare class Ripple extends LitElement {
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Sets the ripple to be an unbounded circle.
|
|
13
|
+
*/
|
|
11
14
|
unbounded: boolean;
|
|
12
|
-
disabled: boolean;
|
|
13
|
-
protected hovered: boolean;
|
|
14
|
-
protected focused: boolean;
|
|
15
|
-
protected pressed: boolean;
|
|
16
|
-
protected rippleSize: string;
|
|
17
|
-
protected rippleScale: string;
|
|
18
|
-
protected initialSize: number;
|
|
19
|
-
protected pressAnimationSignal: import("../../motion/animation.js").AnimationSignal;
|
|
20
|
-
protected growAnimation: Animation | null;
|
|
21
|
-
protected delayedEndPressHandle: number | null;
|
|
22
|
-
/** @soyTemplate */
|
|
23
|
-
protected render(): TemplateResult;
|
|
24
|
-
/** @soyTemplate */
|
|
25
|
-
protected getRenderRippleClasses(): ClassInfo;
|
|
26
|
-
protected update(changedProps: PropertyValues<this>): void;
|
|
27
|
-
protected getDimensions(): DOMRect;
|
|
28
|
-
protected determineRippleSize(): void;
|
|
29
|
-
protected getNormalizedPointerEventCoords(pointerEvent: PointerEvent): {
|
|
30
|
-
x: number;
|
|
31
|
-
y: number;
|
|
32
|
-
};
|
|
33
|
-
protected getTranslationCoordinates(positionEvent?: Event | null): {
|
|
34
|
-
startPoint: {
|
|
35
|
-
x: number;
|
|
36
|
-
y: number;
|
|
37
|
-
};
|
|
38
|
-
endPoint: {
|
|
39
|
-
x: number;
|
|
40
|
-
y: number;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
protected startPressAnimation(positionEvent?: Event | null): void;
|
|
44
15
|
/**
|
|
45
|
-
*
|
|
16
|
+
* Disables the ripple.
|
|
46
17
|
*/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
private hovered;
|
|
20
|
+
private focused;
|
|
21
|
+
private pressed;
|
|
22
|
+
private readonly mdRoot;
|
|
23
|
+
private rippleSize;
|
|
24
|
+
private rippleScale;
|
|
25
|
+
private initialSize;
|
|
26
|
+
private growAnimation?;
|
|
27
|
+
private state;
|
|
28
|
+
private rippleStartEvent?;
|
|
29
|
+
private checkBoundsAfterContextMenu;
|
|
30
|
+
handlePointerenter(event: PointerEvent): void;
|
|
31
|
+
handlePointerleave(event: PointerEvent): void;
|
|
32
|
+
handleFocusin(): void;
|
|
33
|
+
handleFocusout(): void;
|
|
34
|
+
handlePointerup(event: PointerEvent): void;
|
|
35
|
+
handlePointerdown(event: PointerEvent): Promise<void>;
|
|
36
|
+
handleClick(): void;
|
|
37
|
+
handlePointercancel(event: PointerEvent): void;
|
|
38
|
+
handleContextmenu(): void;
|
|
39
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
40
|
+
protected update(changedProps: PropertyValues<this>): void;
|
|
41
|
+
private getDimensions;
|
|
42
|
+
private determineRippleSize;
|
|
43
|
+
private getNormalizedPointerEventCoords;
|
|
44
|
+
private getTranslationCoordinates;
|
|
45
|
+
private startPressAnimation;
|
|
46
|
+
private endPressAnimation;
|
|
50
47
|
/**
|
|
51
|
-
*
|
|
48
|
+
* Returns `true` if
|
|
49
|
+
* - the ripple element is enabled
|
|
50
|
+
* - the pointer is primary for the input type
|
|
51
|
+
* - the pointer is the pointer that started the interaction, or will start
|
|
52
|
+
* the interaction
|
|
53
|
+
* - the pointer is a touch, or the pointer state has the primary button
|
|
54
|
+
* held, or the pointer is hovering
|
|
52
55
|
*/
|
|
53
|
-
|
|
54
|
-
beginFocus(): void;
|
|
55
|
-
endFocus(): void;
|
|
56
|
+
private shouldReactToEvent;
|
|
56
57
|
/**
|
|
57
|
-
*
|
|
58
|
+
* Check if the event is within the bounds of the element.
|
|
59
|
+
*
|
|
60
|
+
* This is only needed for the "stuck" contextmenu longpress on Chrome.
|
|
58
61
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
endPress(): void;
|
|
62
|
+
private inBounds;
|
|
63
|
+
private isTouch;
|
|
62
64
|
}
|
package/ripple/lib/ripple.js
CHANGED
|
@@ -7,7 +7,7 @@ import { __decorate, __metadata } from "tslib";
|
|
|
7
7
|
import { html, LitElement } from 'lit';
|
|
8
8
|
import { property, query, state } from 'lit/decorators.js';
|
|
9
9
|
import { classMap } from 'lit/directives/class-map.js';
|
|
10
|
-
import {
|
|
10
|
+
import { EASING } from '../../motion/animation.js';
|
|
11
11
|
const PRESS_GROW_MS = 450;
|
|
12
12
|
const MINIMUM_PRESS_MS = 225;
|
|
13
13
|
const INITIAL_ORIGIN_SCALE = 0.2;
|
|
@@ -16,14 +16,72 @@ const SOFT_EDGE_MINIMUM_SIZE = 75;
|
|
|
16
16
|
const SOFT_EDGE_CONTAINER_RATIO = 0.35;
|
|
17
17
|
const PRESS_PSEUDO = '::after';
|
|
18
18
|
const ANIMATION_FILL = 'forwards';
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Interaction states for the ripple.
|
|
21
|
+
*
|
|
22
|
+
* On Touch:
|
|
23
|
+
* - `INACTIVE -> TOUCH_DELAY -> WAITING_FOR_CLICK -> INACTIVE`
|
|
24
|
+
* - `INACTIVE -> TOUCH_DELAY -> HOLDING -> WAITING_FOR_CLICK -> INACTIVE`
|
|
25
|
+
*
|
|
26
|
+
* On Mouse or Pen:
|
|
27
|
+
* - `INACTIVE -> WAITING_FOR_CLICK -> INACTIVE`
|
|
28
|
+
*/
|
|
29
|
+
var State;
|
|
30
|
+
(function (State) {
|
|
31
|
+
/**
|
|
32
|
+
* Initial state of the control, no touch in progress.
|
|
33
|
+
*
|
|
34
|
+
* Transitions:
|
|
35
|
+
* - on touch down: transition to `TOUCH_DELAY`.
|
|
36
|
+
* - on mouse down: transition to `WAITING_FOR_CLICK`.
|
|
37
|
+
*/
|
|
38
|
+
State[State["INACTIVE"] = 0] = "INACTIVE";
|
|
39
|
+
/**
|
|
40
|
+
* Touch down has been received, waiting to determine if it's a swipe or
|
|
41
|
+
* scroll.
|
|
42
|
+
*
|
|
43
|
+
* Transitions:
|
|
44
|
+
* - on touch up: begin press; transition to `WAITING_FOR_CLICK`.
|
|
45
|
+
* - on cancel: transition to `INACTIVE`.
|
|
46
|
+
* - after `TOUCH_DELAY_MS`: begin press; transition to `HOLDING`.
|
|
47
|
+
*/
|
|
48
|
+
State[State["TOUCH_DELAY"] = 1] = "TOUCH_DELAY";
|
|
49
|
+
/**
|
|
50
|
+
* A touch has been deemed to be a press
|
|
51
|
+
*
|
|
52
|
+
* Transitions:
|
|
53
|
+
* - on up: transition to `WAITING_FOR_CLICK`.
|
|
54
|
+
*/
|
|
55
|
+
State[State["HOLDING"] = 2] = "HOLDING";
|
|
56
|
+
/**
|
|
57
|
+
* The user touch has finished, transition into rest state.
|
|
58
|
+
*
|
|
59
|
+
* Transitions:
|
|
60
|
+
* - on click end press; transition to `INACTIVE`.
|
|
61
|
+
*/
|
|
62
|
+
State[State["WAITING_FOR_CLICK"] = 3] = "WAITING_FOR_CLICK";
|
|
63
|
+
})(State || (State = {}));
|
|
64
|
+
/**
|
|
65
|
+
* Delay reacting to touch so that we do not show the ripple for a swipe or
|
|
66
|
+
* scroll interaction.
|
|
67
|
+
*/
|
|
68
|
+
const TOUCH_DELAY_MS = 150;
|
|
69
|
+
/**
|
|
70
|
+
* A ripple component.
|
|
71
|
+
*/
|
|
20
72
|
export class Ripple extends LitElement {
|
|
21
73
|
constructor() {
|
|
22
74
|
super(...arguments);
|
|
23
75
|
// TODO(https://bugs.webkit.org/show_bug.cgi?id=247546)
|
|
24
76
|
// Remove Safari workaround that requires reflecting `unbounded` so
|
|
25
77
|
// it can be styled against.
|
|
78
|
+
/**
|
|
79
|
+
* Sets the ripple to be an unbounded circle.
|
|
80
|
+
*/
|
|
26
81
|
this.unbounded = false;
|
|
82
|
+
/**
|
|
83
|
+
* Disables the ripple.
|
|
84
|
+
*/
|
|
27
85
|
this.disabled = false;
|
|
28
86
|
this.hovered = false;
|
|
29
87
|
this.focused = false;
|
|
@@ -31,28 +89,116 @@ export class Ripple extends LitElement {
|
|
|
31
89
|
this.rippleSize = '';
|
|
32
90
|
this.rippleScale = '';
|
|
33
91
|
this.initialSize = 0;
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
|
|
92
|
+
this.state = State.INACTIVE;
|
|
93
|
+
this.checkBoundsAfterContextMenu = false;
|
|
94
|
+
}
|
|
95
|
+
handlePointerenter(event) {
|
|
96
|
+
if (!this.shouldReactToEvent(event)) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this.hovered = true;
|
|
100
|
+
}
|
|
101
|
+
handlePointerleave(event) {
|
|
102
|
+
if (!this.shouldReactToEvent(event)) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
this.hovered = false;
|
|
106
|
+
// release a held mouse or pen press that moves outside the element
|
|
107
|
+
if (this.state !== State.INACTIVE) {
|
|
108
|
+
this.endPressAnimation();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
handleFocusin() {
|
|
112
|
+
this.focused = true;
|
|
113
|
+
}
|
|
114
|
+
handleFocusout() {
|
|
115
|
+
this.focused = false;
|
|
116
|
+
}
|
|
117
|
+
handlePointerup(event) {
|
|
118
|
+
if (!this.shouldReactToEvent(event)) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (this.state === State.HOLDING) {
|
|
122
|
+
this.state = State.WAITING_FOR_CLICK;
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (this.state === State.TOUCH_DELAY) {
|
|
126
|
+
this.state = State.WAITING_FOR_CLICK;
|
|
127
|
+
this.startPressAnimation(this.rippleStartEvent);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
async handlePointerdown(event) {
|
|
132
|
+
if (!this.shouldReactToEvent(event)) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
this.rippleStartEvent = event;
|
|
136
|
+
if (!this.isTouch(event)) {
|
|
137
|
+
this.state = State.WAITING_FOR_CLICK;
|
|
138
|
+
this.startPressAnimation(event);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
// after a longpress contextmenu event, an extra `pointerdown` can be
|
|
142
|
+
// dispatched to the pressed element. Check that the down is within
|
|
143
|
+
// bounds of the element in this case.
|
|
144
|
+
if (this.checkBoundsAfterContextMenu && !this.inBounds(event)) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
this.checkBoundsAfterContextMenu = false;
|
|
148
|
+
// Wait for a hold after touch delay
|
|
149
|
+
this.state = State.TOUCH_DELAY;
|
|
150
|
+
await new Promise(resolve => {
|
|
151
|
+
setTimeout(resolve, TOUCH_DELAY_MS);
|
|
152
|
+
});
|
|
153
|
+
if (this.state !== State.TOUCH_DELAY) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
this.state = State.HOLDING;
|
|
157
|
+
this.startPressAnimation(event);
|
|
158
|
+
}
|
|
159
|
+
handleClick() {
|
|
160
|
+
// Click is a MouseEvent in Firefox and Safari, so we cannot use
|
|
161
|
+
// `shouldReactToEvent`
|
|
162
|
+
if (this.disabled) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (this.state === State.WAITING_FOR_CLICK) {
|
|
166
|
+
this.endPressAnimation();
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (this.state === State.INACTIVE) {
|
|
170
|
+
// keyboard synthesized click event
|
|
171
|
+
this.startPressAnimation();
|
|
172
|
+
this.endPressAnimation();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
handlePointercancel(event) {
|
|
176
|
+
if (!this.shouldReactToEvent(event)) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
this.endPressAnimation();
|
|
180
|
+
}
|
|
181
|
+
handleContextmenu() {
|
|
182
|
+
if (this.disabled) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this.checkBoundsAfterContextMenu = true;
|
|
186
|
+
this.endPressAnimation();
|
|
37
187
|
}
|
|
38
|
-
/** @soyTemplate */
|
|
39
188
|
render() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
'md3-ripple--hovered': this.hovered,
|
|
46
|
-
'md3-ripple--focused': this.focused,
|
|
47
|
-
'md3-ripple--pressed': this.pressed,
|
|
48
|
-
'md3-ripple--unbounded': this.unbounded,
|
|
189
|
+
const classes = {
|
|
190
|
+
'hovered': this.hovered,
|
|
191
|
+
'focused': this.focused,
|
|
192
|
+
'pressed': this.pressed,
|
|
193
|
+
'unbounded': this.unbounded,
|
|
49
194
|
};
|
|
195
|
+
return html `<div class="surface ${classMap(classes)}"></div>`;
|
|
50
196
|
}
|
|
51
197
|
update(changedProps) {
|
|
52
198
|
if (changedProps.has('disabled') && this.disabled) {
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
199
|
+
this.hovered = false;
|
|
200
|
+
this.focused = false;
|
|
201
|
+
this.pressed = false;
|
|
56
202
|
}
|
|
57
203
|
super.update(changedProps);
|
|
58
204
|
}
|
|
@@ -108,12 +254,13 @@ export class Ripple extends LitElement {
|
|
|
108
254
|
return { startPoint, endPoint };
|
|
109
255
|
}
|
|
110
256
|
startPressAnimation(positionEvent) {
|
|
257
|
+
this.pressed = true;
|
|
258
|
+
this.growAnimation?.cancel();
|
|
111
259
|
this.determineRippleSize();
|
|
112
260
|
const { startPoint, endPoint } = this.getTranslationCoordinates(positionEvent);
|
|
113
261
|
const translateStart = `${startPoint.x}px, ${startPoint.y}px`;
|
|
114
262
|
const translateEnd = `${endPoint.x}px, ${endPoint.y}px`;
|
|
115
|
-
|
|
116
|
-
const growAnimation = this.mdRoot.animate({
|
|
263
|
+
this.growAnimation = this.mdRoot.animate({
|
|
117
264
|
top: [0, 0],
|
|
118
265
|
left: [0, 0],
|
|
119
266
|
height: [this.rippleSize, this.rippleSize],
|
|
@@ -128,73 +275,60 @@ export class Ripple extends LitElement {
|
|
|
128
275
|
easing: EASING.STANDARD,
|
|
129
276
|
fill: ANIMATION_FILL
|
|
130
277
|
});
|
|
131
|
-
growAnimation.addEventListener('finish', () => {
|
|
132
|
-
this.pressAnimationSignal.finish();
|
|
133
|
-
this.growAnimation = null;
|
|
134
|
-
});
|
|
135
|
-
signal.addEventListener('abort', () => {
|
|
136
|
-
growAnimation.cancel();
|
|
137
|
-
this.growAnimation = null;
|
|
138
|
-
});
|
|
139
|
-
this.growAnimation = growAnimation;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* @deprecated Use beginHover
|
|
143
|
-
*/
|
|
144
|
-
startHover(hoverEvent) {
|
|
145
|
-
this.beginHover(hoverEvent);
|
|
146
278
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
279
|
+
async endPressAnimation() {
|
|
280
|
+
const animation = this.growAnimation;
|
|
281
|
+
const pressAnimationPlayState = animation?.currentTime ?? Infinity;
|
|
282
|
+
if (pressAnimationPlayState >= MINIMUM_PRESS_MS) {
|
|
283
|
+
this.pressed = false;
|
|
284
|
+
return;
|
|
150
285
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
286
|
+
await new Promise(resolve => {
|
|
287
|
+
setTimeout(resolve, MINIMUM_PRESS_MS - pressAnimationPlayState);
|
|
288
|
+
});
|
|
289
|
+
if (this.growAnimation !== animation) {
|
|
290
|
+
// A new press animation was started. The old animation was canceled and
|
|
291
|
+
// should not finish the pressed state.
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
this.pressed = false;
|
|
154
295
|
}
|
|
155
296
|
/**
|
|
156
|
-
*
|
|
297
|
+
* Returns `true` if
|
|
298
|
+
* - the ripple element is enabled
|
|
299
|
+
* - the pointer is primary for the input type
|
|
300
|
+
* - the pointer is the pointer that started the interaction, or will start
|
|
301
|
+
* the interaction
|
|
302
|
+
* - the pointer is a touch, or the pointer state has the primary button
|
|
303
|
+
* held, or the pointer is hovering
|
|
157
304
|
*/
|
|
158
|
-
|
|
159
|
-
this.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
this.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
305
|
+
shouldReactToEvent(event) {
|
|
306
|
+
if (this.disabled || !event.isPrimary) {
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
if (this.rippleStartEvent &&
|
|
310
|
+
this.rippleStartEvent.pointerId !== event.pointerId) {
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
if (event.type === 'pointerenter' || event.type === 'pointerleave') {
|
|
314
|
+
return !this.isTouch(event);
|
|
315
|
+
}
|
|
316
|
+
const isPrimaryButton = event.buttons === 1;
|
|
317
|
+
return this.isTouch(event) || isPrimaryButton;
|
|
166
318
|
}
|
|
167
319
|
/**
|
|
168
|
-
*
|
|
320
|
+
* Check if the event is within the bounds of the element.
|
|
321
|
+
*
|
|
322
|
+
* This is only needed for the "stuck" contextmenu longpress on Chrome.
|
|
169
323
|
*/
|
|
170
|
-
|
|
171
|
-
this.
|
|
324
|
+
inBounds({ x, y }) {
|
|
325
|
+
const { top, left, bottom, right } = this.getBoundingClientRect();
|
|
326
|
+
return x >= left && x <= right && y >= top && y <= bottom;
|
|
172
327
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
if (this.delayedEndPressHandle !== null) {
|
|
176
|
-
clearTimeout(this.delayedEndPressHandle);
|
|
177
|
-
this.delayedEndPressHandle = null;
|
|
178
|
-
}
|
|
179
|
-
this.startPressAnimation(positionEvent);
|
|
180
|
-
}
|
|
181
|
-
endPress() {
|
|
182
|
-
const pressAnimationPlayState = this.growAnimation?.currentTime ?? Infinity;
|
|
183
|
-
if (pressAnimationPlayState >= MINIMUM_PRESS_MS) {
|
|
184
|
-
this.pressed = false;
|
|
185
|
-
}
|
|
186
|
-
else {
|
|
187
|
-
this.delayedEndPressHandle = setTimeout(() => {
|
|
188
|
-
this.pressed = false;
|
|
189
|
-
this.delayedEndPressHandle = null;
|
|
190
|
-
}, MINIMUM_PRESS_MS - pressAnimationPlayState);
|
|
191
|
-
}
|
|
328
|
+
isTouch({ pointerType }) {
|
|
329
|
+
return pointerType === 'touch';
|
|
192
330
|
}
|
|
193
331
|
}
|
|
194
|
-
__decorate([
|
|
195
|
-
query('.md3-ripple-surface'),
|
|
196
|
-
__metadata("design:type", HTMLElement)
|
|
197
|
-
], Ripple.prototype, "mdRoot", void 0);
|
|
198
332
|
__decorate([
|
|
199
333
|
property({ type: Boolean, reflect: true }),
|
|
200
334
|
__metadata("design:type", Object)
|
|
@@ -215,4 +349,8 @@ __decorate([
|
|
|
215
349
|
state(),
|
|
216
350
|
__metadata("design:type", Object)
|
|
217
351
|
], Ripple.prototype, "pressed", void 0);
|
|
352
|
+
__decorate([
|
|
353
|
+
query('.surface'),
|
|
354
|
+
__metadata("design:type", HTMLElement)
|
|
355
|
+
], Ripple.prototype, "mdRoot", void 0);
|
|
218
356
|
//# sourceMappingURL=ripple.js.map
|