@material/web 1.0.0-pre.3 → 1.0.0-pre.5
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/badge/lib/_badge.scss +2 -10
- package/button/lib/_elevated-button.scss +5 -30
- package/button/lib/_elevation.scss +1 -16
- package/button/lib/_filled-button.scss +4 -31
- package/button/lib/_icon.scss +1 -0
- package/button/lib/_outlined-button.scss +6 -23
- package/button/lib/_shared.scss +20 -54
- package/button/lib/_text-button.scss +8 -34
- package/button/lib/_tonal-button.scss +5 -28
- package/button/lib/button.d.ts +2 -0
- package/button/lib/button.js +5 -1
- 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/filled-styles.css.js +1 -1
- package/button/lib/filled-styles.css.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/shared-styles.css.js +1 -1
- package/button/lib/shared-styles.css.js.map +1 -1
- package/button/lib/text-styles.css.js +1 -1
- package/button/lib/text-styles.css.js.map +1 -1
- package/button/lib/tonal-styles.css.js +1 -1
- package/button/lib/tonal-styles.css.js.map +1 -1
- package/checkbox/lib/_checkbox.scss +1 -2
- package/checkbox/lib/checkbox-styles.css.js +1 -1
- package/checkbox/lib/checkbox-styles.css.js.map +1 -1
- package/chips/_assist-chip.scss +6 -0
- package/chips/_suggestion-chip.scss +6 -0
- package/chips/assist-chip.d.ts +20 -0
- package/chips/assist-chip.js +24 -0
- package/chips/assist-chip.js.map +1 -0
- package/chips/lib/_assist-chip.scss +27 -0
- package/chips/lib/_shared.scss +183 -0
- package/chips/lib/_suggestion-chip.scss +30 -0
- package/chips/lib/assist-chip.d.ts +11 -0
- package/chips/lib/assist-chip.js +12 -0
- package/chips/lib/assist-chip.js.map +1 -0
- package/chips/lib/assist-styles.css.js +9 -0
- package/chips/lib/assist-styles.css.js.map +1 -0
- package/{list/lib/listitem/list-item-private-styles.scss → chips/lib/assist-styles.scss} +2 -2
- package/chips/lib/chip.d.ts +29 -0
- package/chips/lib/chip.js +110 -0
- package/chips/lib/chip.js.map +1 -0
- package/chips/lib/shared-styles.css.js +9 -0
- package/chips/lib/shared-styles.css.js.map +1 -0
- package/{autocomplete → chips}/lib/shared-styles.scss +1 -1
- package/chips/lib/suggestion-chip.d.ts +11 -0
- package/chips/lib/suggestion-chip.js +12 -0
- package/chips/lib/suggestion-chip.js.map +1 -0
- package/chips/lib/suggestion-styles.css.js +9 -0
- package/chips/lib/suggestion-styles.css.js.map +1 -0
- package/{menu/lib/menuitem/menu-item-private-styles.scss → chips/lib/suggestion-styles.scss} +2 -2
- package/chips/suggestion-chip.d.ts +20 -0
- package/chips/suggestion-chip.js +24 -0
- package/chips/suggestion-chip.js.map +1 -0
- 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/lib/_dialog.scss +7 -5
- package/dialog/lib/_tokens.scss +1 -2
- package/dialog/lib/dialog-styles.css.js +1 -1
- package/dialog/lib/dialog-styles.css.js.map +1 -1
- package/dialog/lib/dialog.js +1 -1
- package/dialog/lib/dialog.js.map +1 -1
- package/elevation/lib/_elevation.scss +1 -21
- package/elevation/lib/elevation-styles.css.js +1 -1
- package/elevation/lib/elevation-styles.css.js.map +1 -1
- package/fab/lib/_fab-extended.scss +3 -10
- package/fab/lib/_fab.scss +0 -3
- package/fab/lib/_shared.scss +3 -25
- 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-shared-styles.css.js +1 -1
- package/fab/lib/fab-shared-styles.css.js.map +1 -1
- package/fab/lib/fab-shared.d.ts +0 -1
- package/fab/lib/fab-shared.js +1 -7
- package/fab/lib/fab-shared.js.map +1 -1
- package/field/lib/_content.scss +91 -13
- package/field/lib/_filled-field.scss +19 -57
- package/field/lib/_label.scss +1 -2
- package/field/lib/_md-comp-filled-field.scss +123 -64
- package/field/lib/_md-comp-outlined-field.scss +100 -59
- package/field/lib/_outlined-field.scss +13 -11
- package/field/lib/_shared.scss +21 -17
- package/field/lib/field.d.ts +6 -2
- package/field/lib/field.js +80 -62
- package/field/lib/field.js.map +1 -1
- package/field/lib/filled-field.d.ts +0 -5
- package/field/lib/filled-field.js +2 -41
- 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.js +1 -1
- 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/focus/lib/_focus-ring.scss +13 -7
- package/focus/lib/_md-comp-focus-ring.scss +1 -2
- package/focus/lib/focus-ring-styles.css.js +1 -1
- package/focus/lib/focus-ring-styles.css.js.map +1 -1
- package/icon/lib/_icon.scss +1 -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/iconbutton/lib/_filled-icon-button.scss +1 -12
- package/iconbutton/lib/_filled-tonal-icon-button.scss +1 -12
- package/iconbutton/lib/_outlined-icon-button.scss +1 -13
- package/iconbutton/lib/_shared.scss +10 -6
- package/iconbutton/lib/_standard-icon-button.scss +5 -12
- package/iconbutton/lib/filled-styles.css.js +1 -1
- package/iconbutton/lib/filled-styles.css.js.map +1 -1
- package/iconbutton/lib/filled-tonal-styles.css.js +1 -1
- package/iconbutton/lib/filled-tonal-styles.css.js.map +1 -1
- package/iconbutton/lib/icon-button.js +0 -2
- package/iconbutton/lib/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/shared-styles.css.js +1 -1
- package/iconbutton/lib/shared-styles.css.js.map +1 -1
- package/iconbutton/lib/standard-styles.css.js +1 -1
- package/iconbutton/lib/standard-styles.css.js.map +1 -1
- package/list/lib/_list.scss +34 -17
- package/list/lib/list-styles.css.js +1 -1
- package/list/lib/list-styles.css.js.map +1 -1
- package/list/lib/listitem/_list-item.scss +312 -124
- 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.d.ts +8 -6
- package/list/lib/listitem/list-item.js +26 -27
- package/list/lib/listitem/list-item.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/menu/lib/_menu.scss +26 -8
- package/menu/lib/menu-styles.css.js +1 -1
- package/menu/lib/menu-styles.css.js.map +1 -1
- package/menu/lib/menu.d.ts +22 -9
- package/menu/lib/menu.js +76 -27
- package/menu/lib/menu.js.map +1 -1
- package/menu/lib/menuitem/_menu-item.scss +39 -79
- 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.js +1 -1
- package/menu/lib/menuitem/menu-item.js.map +1 -1
- package/menu/lib/menuitemlink/menu-item-link.js +2 -1
- package/menu/lib/menuitemlink/menu-item-link.js.map +1 -1
- package/menu/lib/shared.d.ts +16 -0
- package/menu/lib/shared.js +16 -0
- package/menu/lib/shared.js.map +1 -1
- package/menu/lib/submenuitem/sub-menu-item.d.ts +4 -1
- package/menu/lib/submenuitem/sub-menu-item.js +9 -3
- package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
- package/menu/lib/surfacePositionController.d.ts +10 -2
- package/menu/lib/surfacePositionController.js +6 -2
- package/menu/lib/surfacePositionController.js.map +1 -1
- package/menu/lib/typeaheadController.d.ts +5 -0
- package/menu/lib/typeaheadController.js +7 -3
- package/menu/lib/typeaheadController.js.map +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/sub-menu-item.js +1 -2
- package/menu/sub-menu-item.js.map +1 -1
- package/navigationbar/lib/_navigation-bar.scss +1 -4
- package/navigationdrawer/lib/_navigation-drawer-modal.scss +0 -3
- package/navigationdrawer/lib/_navigation-drawer.scss +0 -3
- package/navigationdrawer/lib/_shared.scss +0 -9
- package/navigationtab/lib/_navigation-tab.scss +4 -10
- package/navigationtab/lib/navigation-tab-styles.css.js +1 -1
- package/navigationtab/lib/navigation-tab-styles.css.js.map +1 -1
- package/package.json +1 -1
- package/radio/lib/_radio.scss +1 -2
- package/radio/lib/radio-styles.css.js +1 -1
- package/radio/lib/radio-styles.css.js.map +1 -1
- package/segmentedbutton/lib/_shared.scss +0 -2
- package/segmentedbuttonset/lib/outlined-styles.css.js +1 -1
- package/segmentedbuttonset/lib/outlined-styles.css.js.map +1 -1
- package/slider/lib/_slider.scss +1 -4
- package/slider/lib/_tokens.scss +2 -8
- package/slider/lib/slider-styles.css.js +1 -1
- package/slider/lib/slider-styles.css.js.map +1 -1
- package/textfield/lib/_filled-text-field.scss +99 -103
- package/textfield/lib/_icon.scss +11 -55
- package/textfield/lib/_input.scss +4 -6
- package/textfield/lib/_outlined-text-field.scss +88 -95
- package/textfield/lib/filled-styles.css.js +1 -1
- package/textfield/lib/filled-styles.css.js.map +1 -1
- package/textfield/lib/outlined-styles.css.js +1 -1
- package/textfield/lib/outlined-styles.css.js.map +1 -1
- package/textfield/lib/shared-styles.css.js +1 -1
- package/textfield/lib/shared-styles.css.js.map +1 -1
- package/tokens/_index.scss +101 -2
- package/tokens/_md-comp-assist-chip.scss +68 -0
- package/tokens/_md-comp-badge.scss +34 -0
- package/tokens/_md-comp-banner.scss +23 -0
- package/tokens/_md-comp-bottom-app-bar.scss +21 -0
- package/tokens/_md-comp-carousel-item.scss +23 -0
- package/tokens/_md-comp-checkbox.scss +21 -0
- package/tokens/_md-comp-circular-progress-indicator.scss +22 -0
- package/tokens/_md-comp-data-table.scss +23 -0
- package/tokens/_md-comp-date-input-modal.scss +23 -0
- package/tokens/_md-comp-date-picker-docked.scss +25 -0
- package/tokens/_md-comp-date-picker-modal.scss +25 -0
- package/tokens/_md-comp-dialog.scss +43 -0
- package/tokens/_md-comp-divider.scss +17 -0
- package/tokens/_md-comp-elevated-button.scss +58 -0
- package/tokens/_md-comp-elevated-card.scss +23 -0
- package/tokens/_md-comp-extended-fab-branded.scss +38 -0
- package/tokens/_md-comp-extended-fab-primary.scss +38 -0
- package/tokens/_md-comp-extended-fab-secondary.scss +41 -0
- package/tokens/_md-comp-extended-fab-surface.scss +38 -0
- package/tokens/_md-comp-extended-fab-tertiary.scss +41 -0
- package/tokens/_md-comp-fab-branded-large.scss +23 -0
- package/tokens/_md-comp-fab-branded.scss +23 -0
- package/tokens/_md-comp-fab-primary-large.scss +23 -0
- package/tokens/_md-comp-fab-primary-small.scss +23 -0
- package/tokens/_md-comp-fab-primary.scss +23 -0
- package/tokens/_md-comp-fab-secondary-large.scss +23 -0
- package/tokens/_md-comp-fab-secondary-small.scss +23 -0
- package/tokens/_md-comp-fab-secondary.scss +23 -0
- package/tokens/_md-comp-fab-surface-large.scss +23 -0
- package/tokens/_md-comp-fab-surface-small.scss +23 -0
- package/tokens/_md-comp-fab-surface.scss +23 -0
- package/tokens/_md-comp-fab-tertiary-large.scss +23 -0
- package/tokens/_md-comp-fab-tertiary-small.scss +23 -0
- package/tokens/_md-comp-fab-tertiary.scss +23 -0
- package/tokens/_md-comp-filled-autocomplete.scss +25 -0
- package/tokens/_md-comp-filled-button.scss +58 -0
- package/tokens/_md-comp-filled-card.scss +23 -0
- package/tokens/_md-comp-filled-icon-button.scss +21 -0
- package/tokens/_md-comp-filled-menu-button.scss +25 -0
- package/tokens/_md-comp-filled-select.scss +25 -0
- package/tokens/_md-comp-filled-text-field.scss +46 -0
- package/tokens/_md-comp-filled-tonal-button.scss +59 -0
- package/tokens/_md-comp-filled-tonal-icon-button.scss +24 -0
- package/tokens/_md-comp-filter-chip.scss +38 -0
- package/tokens/_md-comp-full-screen-dialog.scss +25 -0
- package/tokens/_md-comp-icon-button.scss +21 -0
- package/tokens/_md-comp-input-chip.scss +38 -0
- package/tokens/_md-comp-linear-progress-indicator.scss +22 -0
- package/tokens/_md-comp-list.scss +58 -0
- package/tokens/_md-comp-menu.scss +21 -0
- package/tokens/_md-comp-navigation-bar.scss +25 -0
- package/tokens/_md-comp-navigation-drawer.scss +25 -0
- package/tokens/_md-comp-navigation-rail.scss +25 -0
- package/tokens/_md-comp-outlined-autocomplete.scss +28 -0
- package/tokens/_md-comp-outlined-button.scss +56 -0
- package/tokens/_md-comp-outlined-card.scss +23 -0
- package/tokens/_md-comp-outlined-icon-button.scss +21 -0
- package/tokens/_md-comp-outlined-menu-button.scss +23 -0
- package/tokens/_md-comp-outlined-segmented-button.scss +38 -0
- package/tokens/_md-comp-outlined-select.scss +25 -0
- package/tokens/_md-comp-outlined-text-field.scss +44 -0
- package/tokens/_md-comp-plain-tooltip.scss +21 -0
- package/tokens/_md-comp-primary-navigation-tab.scss +41 -0
- package/tokens/_md-comp-radio-button.scss +19 -0
- package/tokens/_md-comp-rich-tooltip.scss +25 -0
- package/tokens/_md-comp-scrim.scss +17 -0
- package/tokens/_md-comp-search-bar.scss +25 -0
- package/tokens/_md-comp-search-view.scss +23 -0
- package/tokens/_md-comp-secondary-navigation-tab.scss +41 -0
- package/tokens/_md-comp-sheet-bottom.scss +21 -0
- package/tokens/_md-comp-sheet-floating.scss +21 -0
- package/tokens/_md-comp-sheet-side.scss +25 -0
- package/tokens/_md-comp-slider.scss +38 -0
- package/tokens/_md-comp-snackbar.scss +25 -0
- package/tokens/_md-comp-standard-menu-button.scss +23 -0
- package/tokens/_md-comp-suggestion-chip.scss +72 -0
- package/tokens/_md-comp-switch.scss +21 -0
- package/tokens/_md-comp-text-button.scss +56 -0
- package/tokens/_md-comp-time-input.scss +25 -0
- package/tokens/_md-comp-time-picker.scss +25 -0
- package/tokens/_md-comp-top-app-bar-large.scss +23 -0
- package/tokens/_md-comp-top-app-bar-medium.scss +23 -0
- package/tokens/_md-comp-top-app-bar-small-centered.scss +26 -0
- package/tokens/_md-comp-top-app-bar-small.scss +23 -0
- package/tokens/_md-ref-palette.scss +12 -0
- package/tokens/_md-ref-typeface.scss +12 -0
- package/tokens/_md-sys-color.scss +25 -0
- package/tokens/_md-sys-elevation.scss +30 -0
- package/tokens/_md-sys-motion.scss +12 -0
- package/tokens/_md-sys-shape.scss +12 -0
- package/tokens/_md-sys-state.scss +12 -0
- package/tokens/_md-sys-typescale.scss +17 -0
- package/tokens/{v0_160 → v0_161}/_md-comp-assist-chip.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-badge.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-banner.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-bottom-app-bar.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-carousel-item.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-checkbox.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-circular-progress-indicator.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-data-table.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-date-input-modal.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-date-picker-docked.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-date-picker-modal.scss +3 -3
- package/tokens/{v0_160 → v0_161}/_md-comp-dialog.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-divider.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-elevated-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-elevated-card.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-extended-fab-branded.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-extended-fab-primary.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-extended-fab-secondary.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-extended-fab-surface.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-extended-fab-tertiary.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-branded-large.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-branded.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-primary-large.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-primary-small.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-primary.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-secondary-large.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-secondary-small.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-secondary.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-surface-large.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-surface-small.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-surface.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-tertiary-large.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-tertiary-small.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-fab-tertiary.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-autocomplete.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-card.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-icon-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-menu-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-select.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-text-field.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-tonal-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filled-tonal-icon-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-filter-chip.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-full-screen-dialog.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-icon-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-input-chip.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-linear-progress-indicator.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-list.scss +1 -1
- package/tokens/v0_161/_md-comp-menu.scss +37 -0
- package/tokens/{v0_160 → v0_161}/_md-comp-navigation-bar.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-navigation-drawer.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-navigation-rail.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-autocomplete.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-card.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-icon-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-menu-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-segmented-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-select.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-outlined-text-field.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-plain-tooltip.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-primary-navigation-tab.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-radio-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-rich-tooltip.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-scrim.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-search-bar.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-search-view.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-secondary-navigation-tab.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-sheet-bottom.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-sheet-floating.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-sheet-side.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-slider.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-snackbar.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-standard-menu-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-suggestion-chip.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-switch.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-text-button.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-time-input.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-time-picker.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-top-app-bar-large.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-top-app-bar-medium.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-top-app-bar-small-centered.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-comp-top-app-bar-small.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-ref-palette.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-ref-typeface.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-sys-color.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-sys-elevation.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-sys-motion.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-sys-shape.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-sys-state.scss +1 -1
- package/tokens/{v0_160 → v0_161}/_md-sys-typescale.scss +1 -1
- package/autocomplete/_filled-autocomplete.scss +0 -6
- package/autocomplete/_outlined-autocomplete.scss +0 -6
- package/autocomplete/autocomplete-item.d.ts +0 -19
- package/autocomplete/autocomplete-item.js +0 -22
- package/autocomplete/autocomplete-item.js.map +0 -1
- package/autocomplete/autocomplete-list.d.ts +0 -19
- package/autocomplete/autocomplete-list.js +0 -23
- package/autocomplete/autocomplete-list.js.map +0 -1
- package/autocomplete/autocomplete-surface.d.ts +0 -19
- package/autocomplete/autocomplete-surface.js +0 -23
- package/autocomplete/autocomplete-surface.js.map +0 -1
- package/autocomplete/filled-autocomplete.d.ts +0 -28
- package/autocomplete/filled-autocomplete.js +0 -46
- package/autocomplete/filled-autocomplete.js.map +0 -1
- package/autocomplete/lib/_filled-autocomplete.scss +0 -189
- package/autocomplete/lib/_outlined-autocomplete.scss +0 -178
- package/autocomplete/lib/_shared.scss +0 -25
- package/autocomplete/lib/autocomplete.d.ts +0 -54
- package/autocomplete/lib/autocomplete.js +0 -265
- package/autocomplete/lib/autocomplete.js.map +0 -1
- package/autocomplete/lib/autocompleteitem/autocomplete-item.d.ts +0 -11
- package/autocomplete/lib/autocompleteitem/autocomplete-item.js +0 -14
- package/autocomplete/lib/autocompleteitem/autocomplete-item.js.map +0 -1
- package/autocomplete/lib/autocompleteitem/harness.d.ts +0 -11
- package/autocomplete/lib/autocompleteitem/harness.js +0 -12
- package/autocomplete/lib/autocompleteitem/harness.js.map +0 -1
- package/autocomplete/lib/autocompletelist/_autocomplete-list.scss +0 -13
- package/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.js +0 -9
- package/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.js.map +0 -1
- package/autocomplete/lib/autocompletelist/autocomplete-list-styles.scss +0 -10
- package/autocomplete/lib/autocompletelist/autocomplete-list.d.ts +0 -14
- package/autocomplete/lib/autocompletelist/autocomplete-list.js +0 -21
- package/autocomplete/lib/autocompletelist/autocomplete-list.js.map +0 -1
- package/autocomplete/lib/autocompletelist/harness.d.ts +0 -11
- package/autocomplete/lib/autocompletelist/harness.js +0 -12
- package/autocomplete/lib/autocompletelist/harness.js.map +0 -1
- package/autocomplete/lib/autocompletesurface/_autocomplete-surface.scss +0 -13
- package/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.js +0 -9
- package/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.js.map +0 -1
- package/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.scss +0 -10
- package/autocomplete/lib/autocompletesurface/autocomplete-surface.d.ts +0 -13
- package/autocomplete/lib/autocompletesurface/autocomplete-surface.js +0 -21
- package/autocomplete/lib/autocompletesurface/autocomplete-surface.js.map +0 -1
- package/autocomplete/lib/filled-styles.css.d.ts +0 -1
- package/autocomplete/lib/filled-styles.css.js +0 -9
- package/autocomplete/lib/filled-styles.css.js.map +0 -1
- package/autocomplete/lib/filled-styles.scss +0 -10
- package/autocomplete/lib/outlined-styles.css.d.ts +0 -1
- package/autocomplete/lib/outlined-styles.css.js +0 -9
- package/autocomplete/lib/outlined-styles.css.js.map +0 -1
- package/autocomplete/lib/outlined-styles.scss +0 -10
- package/autocomplete/lib/shared-styles.css.js +0 -9
- package/autocomplete/lib/shared-styles.css.js.map +0 -1
- package/autocomplete/outlined-autocomplete.d.ts +0 -28
- package/autocomplete/outlined-autocomplete.js +0 -46
- package/autocomplete/outlined-autocomplete.js.map +0 -1
- package/chips/action/delete-action.d.ts +0 -18
- package/chips/action/delete-action.js +0 -20
- package/chips/action/delete-action.js.map +0 -1
- package/chips/action/lib/action.d.ts +0 -47
- package/chips/action/lib/action.js +0 -162
- package/chips/action/lib/action.js.map +0 -1
- package/chips/action/lib/constants.d.ts +0 -62
- package/chips/action/lib/constants.js +0 -69
- package/chips/action/lib/constants.js.map +0 -1
- package/chips/action/lib/delete-action.d.ts +0 -20
- package/chips/action/lib/delete-action.js +0 -65
- package/chips/action/lib/delete-action.js.map +0 -1
- package/chips/action/lib/events.d.ts +0 -14
- package/chips/action/lib/events.js +0 -16
- package/chips/action/lib/events.js.map +0 -1
- package/chips/action/lib/link-action.d.ts +0 -19
- package/chips/action/lib/link-action.js +0 -55
- package/chips/action/lib/link-action.js.map +0 -1
- package/chips/action/lib/presentational-action.d.ts +0 -15
- package/chips/action/lib/presentational-action.js +0 -30
- package/chips/action/lib/presentational-action.js.map +0 -1
- package/chips/action/lib/primary-action.d.ts +0 -28
- package/chips/action/lib/primary-action.js +0 -88
- package/chips/action/lib/primary-action.js.map +0 -1
- package/chips/action/lib/selectable-action.d.ts +0 -17
- package/chips/action/lib/selectable-action.js +0 -67
- package/chips/action/lib/selectable-action.js.map +0 -1
- package/chips/action/lib/types.d.ts +0 -23
- package/chips/action/lib/types.js +0 -7
- package/chips/action/lib/types.js.map +0 -1
- package/chips/action/link-action.d.ts +0 -18
- package/chips/action/link-action.js +0 -20
- package/chips/action/link-action.js.map +0 -1
- package/chips/action/presentational-action.d.ts +0 -18
- package/chips/action/presentational-action.js +0 -20
- package/chips/action/presentational-action.js.map +0 -1
- package/chips/action/primary-action.d.ts +0 -18
- package/chips/action/primary-action.js +0 -20
- package/chips/action/primary-action.js.map +0 -1
- package/chips/action/selectable-action.d.ts +0 -18
- package/chips/action/selectable-action.js +0 -20
- package/chips/action/selectable-action.js.map +0 -1
- package/chips/chip/lib/_assist-chip-theme.scss +0 -99
- package/chips/chip/lib/_chip-theme.scss +0 -1285
- package/chips/chip/lib/_chip.scss +0 -444
- package/chips/chip/lib/_filter-chip-theme.scss +0 -130
- package/chips/chip/lib/_input-chip-theme.scss +0 -91
- package/chips/chip/lib/_suggestion-chip-theme.scss +0 -92
- package/chips/chip/lib/action-chip.d.ts +0 -18
- package/chips/chip/lib/action-chip.js +0 -39
- package/chips/chip/lib/action-chip.js.map +0 -1
- package/chips/chip/lib/adapter.d.ts +0 -50
- package/chips/chip/lib/adapter.js +0 -7
- package/chips/chip/lib/adapter.js.map +0 -1
- package/chips/chip/lib/animationframe.d.ts +0 -31
- package/chips/chip/lib/animationframe.js +0 -66
- package/chips/chip/lib/animationframe.js.map +0 -1
- package/chips/chip/lib/chip.d.ts +0 -43
- package/chips/chip/lib/chip.js +0 -134
- package/chips/chip/lib/chip.js.map +0 -1
- package/chips/chip/lib/constants.d.ts +0 -43
- package/chips/chip/lib/constants.js +0 -48
- package/chips/chip/lib/constants.js.map +0 -1
- package/chips/chip/lib/foundation.d.ts +0 -41
- package/chips/chip/lib/foundation.js +0 -255
- package/chips/chip/lib/foundation.js.map +0 -1
- package/chips/chip/lib/link-chip.d.ts +0 -21
- package/chips/chip/lib/link-chip.js +0 -53
- package/chips/chip/lib/link-chip.js.map +0 -1
- package/chips/chip/lib/presentational-chip.d.ts +0 -18
- package/chips/chip/lib/presentational-chip.js +0 -39
- package/chips/chip/lib/presentational-chip.js.map +0 -1
- package/chips/chip/lib/selectable-chip.d.ts +0 -22
- package/chips/chip/lib/selectable-chip.js +0 -57
- package/chips/chip/lib/selectable-chip.js.map +0 -1
- package/chips/chip/lib/types.d.ts +0 -42
- package/chips/chip/lib/types.js +0 -7
- package/chips/chip/lib/types.js.map +0 -1
- package/chips/chipset/lib/_chip-set-theme.scss +0 -50
- package/chips/chipset/lib/_chip-set.scss +0 -48
- package/chips/chipset/lib/adapter.d.ts +0 -45
- package/chips/chipset/lib/adapter.js +0 -7
- package/chips/chipset/lib/adapter.js.map +0 -1
- package/chips/chipset/lib/constants.d.ts +0 -26
- package/chips/chipset/lib/constants.js +0 -30
- package/chips/chipset/lib/constants.js.map +0 -1
- package/chips/chipset/lib/foundation.d.ts +0 -68
- package/chips/chipset/lib/foundation.js +0 -314
- package/chips/chipset/lib/foundation.js.map +0 -1
- package/chips/chipset/lib/types.d.ts +0 -41
- package/chips/chipset/lib/types.js +0 -7
- package/chips/chipset/lib/types.js.map +0 -1
- 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 -40
- package/list/lib/avatar/list-item-avatar-styles.css.d.ts +0 -1
- 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 -10
- 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 -71
- package/list/lib/icon/list-item-icon-styles.css.d.ts +0 -1
- 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 -10
- 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 -63
- package/list/lib/image/list-item-image-styles.css.d.ts +0 -1
- 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 -10
- 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.d.ts +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 -71
- 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 -10
- 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/menusurface/_menu-surface.scss +0 -6
- package/menusurface/lib/_md-comp-menu-surface.scss +0 -31
- package/menusurface/lib/_menu-surface.scss +0 -122
- package/menusurface/lib/adapter.d.ts +0 -46
- package/menusurface/lib/adapter.js +0 -7
- package/menusurface/lib/adapter.js.map +0 -1
- package/menusurface/lib/constants.d.ts +0 -71
- package/menusurface/lib/constants.js +0 -83
- package/menusurface/lib/constants.js.map +0 -1
- package/menusurface/lib/foundation.d.ts +0 -176
- package/menusurface/lib/foundation.js +0 -544
- package/menusurface/lib/foundation.js.map +0 -1
- package/menusurface/lib/menu-surface-styles.css.d.ts +0 -1
- package/menusurface/lib/menu-surface-styles.css.js +0 -9
- package/menusurface/lib/menu-surface-styles.css.js.map +0 -1
- package/menusurface/lib/menu-surface-styles.scss +0 -10
- package/menusurface/lib/menu-surface.d.ts +0 -62
- package/menusurface/lib/menu-surface.js +0 -347
- package/menusurface/lib/menu-surface.js.map +0 -1
- package/menusurface/lib/types.d.ts +0 -19
- package/menusurface/lib/types.js +0 -7
- package/menusurface/lib/types.js.map +0 -1
- package/menusurface/menu-surface.d.ts +0 -14
- package/menusurface/menu-surface.js +0 -17
- package/menusurface/menu-surface.js.map +0 -1
- package/sass/_elevation.scss +0 -159
- package/sass/_resolvers.scss +0 -16
- package/sass/_typography.scss +0 -39
- package/tokens/v0_160/_md-comp-menu.scss +0 -121
- /package/{autocomplete/lib/autocompletelist/autocomplete-list-styles.css.d.ts → chips/lib/assist-styles.css.d.ts} +0 -0
- /package/{autocomplete → chips}/lib/shared-styles.css.d.ts +0 -0
- /package/{autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.d.ts → chips/lib/suggestion-styles.css.d.ts} +0 -0
- /package/tokens/{v0_160 → v0_161}/_index.scss +0 -0
- /package/tokens/{v0_160 → v0_161}/index.test.css.d.ts +0 -0
- /package/tokens/{v0_160 → v0_161}/index.test.css.js +0 -0
- /package/tokens/{v0_160 → v0_161}/index.test.css.js.map +0 -0
- /package/tokens/{v0_160 → v0_161}/index.test.scss +0 -0
- /package/tokens/{v0_160 → v0_161}/lib.test.css.d.ts +0 -0
- /package/tokens/{v0_160 → v0_161}/lib.test.css.js +0 -0
- /package/tokens/{v0_160 → v0_161}/lib.test.css.js.map +0 -0
- /package/tokens/{v0_160 → v0_161}/lib.test.scss +0 -0
package/field/lib/field.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { __decorate, __metadata } from "tslib";
|
|
7
7
|
import { html, LitElement, nothing } from 'lit';
|
|
8
|
-
import { property,
|
|
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
|
/**
|
|
12
12
|
* A field component.
|
|
13
13
|
*/
|
|
@@ -18,6 +18,7 @@ export class Field extends LitElement {
|
|
|
18
18
|
this.error = false;
|
|
19
19
|
this.focused = false;
|
|
20
20
|
this.populated = false;
|
|
21
|
+
this.resizable = false;
|
|
21
22
|
this.required = false;
|
|
22
23
|
/**
|
|
23
24
|
* Whether or not the field has leading content.
|
|
@@ -28,7 +29,6 @@ export class Field extends LitElement {
|
|
|
28
29
|
*/
|
|
29
30
|
this.hasEnd = false;
|
|
30
31
|
this.isAnimating = false;
|
|
31
|
-
this.labelAnimationSignal = createAnimationSignal();
|
|
32
32
|
}
|
|
33
33
|
update(props) {
|
|
34
34
|
// Client-side property updates
|
|
@@ -55,27 +55,30 @@ export class Field extends LitElement {
|
|
|
55
55
|
'with-start': this.hasStart,
|
|
56
56
|
'with-end': this.hasEnd,
|
|
57
57
|
'populated': this.populated,
|
|
58
|
+
'resizable': this.resizable,
|
|
58
59
|
'required': this.required,
|
|
59
60
|
'no-label': !this.label,
|
|
60
61
|
};
|
|
61
62
|
return html `
|
|
62
63
|
<div class="field ${classMap(classes)}">
|
|
63
|
-
<div class="container">
|
|
64
|
+
<div class="container-overflow">
|
|
65
|
+
${outline}
|
|
64
66
|
${this.renderBackground?.()}
|
|
65
67
|
${this.renderIndicator?.()}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
<div class="container">
|
|
69
|
+
<div class="start">
|
|
70
|
+
<slot name="start"></slot>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="middle">
|
|
73
|
+
${restingLabel}
|
|
74
|
+
${outline ? nothing : floatingLabel}
|
|
75
|
+
<div class="content">
|
|
76
|
+
<slot></slot>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
<div class="end">
|
|
80
|
+
<slot name="end"></slot>
|
|
75
81
|
</div>
|
|
76
|
-
</div>
|
|
77
|
-
<div class="end">
|
|
78
|
-
<slot name="end"></slot>
|
|
79
82
|
</div>
|
|
80
83
|
</div>
|
|
81
84
|
|
|
@@ -93,13 +96,13 @@ export class Field extends LitElement {
|
|
|
93
96
|
renderLabel(isFloating) {
|
|
94
97
|
let visible;
|
|
95
98
|
if (isFloating) {
|
|
96
|
-
// Floating label is visible when focused/populated
|
|
97
|
-
|
|
98
|
-
visible = (this.focused || this.populated) && !this.isAnimating;
|
|
99
|
+
// Floating label is visible when focused/populated or when animating.
|
|
100
|
+
visible = this.focused || this.populated || this.isAnimating;
|
|
99
101
|
}
|
|
100
102
|
else {
|
|
101
|
-
// Resting label is visible when unfocused
|
|
102
|
-
|
|
103
|
+
// Resting label is visible when unfocused. It is never visible while
|
|
104
|
+
// animating.
|
|
105
|
+
visible = !this.focused && !this.populated && !this.isAnimating;
|
|
103
106
|
}
|
|
104
107
|
const classes = {
|
|
105
108
|
'hidden': !visible,
|
|
@@ -115,7 +118,7 @@ export class Field extends LitElement {
|
|
|
115
118
|
>${labelText}</span>
|
|
116
119
|
`;
|
|
117
120
|
}
|
|
118
|
-
|
|
121
|
+
animateLabelIfNeeded({ wasFocused, wasPopulated }) {
|
|
119
122
|
if (!this.label) {
|
|
120
123
|
return;
|
|
121
124
|
}
|
|
@@ -127,18 +130,12 @@ export class Field extends LitElement {
|
|
|
127
130
|
return;
|
|
128
131
|
}
|
|
129
132
|
this.isAnimating = true;
|
|
130
|
-
|
|
133
|
+
this.labelAnimation?.cancel();
|
|
131
134
|
// Only one label is visible at a time for clearer text rendering.
|
|
132
|
-
// The
|
|
133
|
-
// animation, it will either remain visible (if
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
const keyframes = await this.getLabelKeyframes();
|
|
137
|
-
if (signal.aborted) {
|
|
138
|
-
// Don't animate if this animation was requested to stop while getting
|
|
139
|
-
// the label element or calculating keyframes
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
135
|
+
// The floating label is visible and used during animation. At the end of
|
|
136
|
+
// the animation, it will either remain visible (if floating) or hide and
|
|
137
|
+
// the resting label will be shown.
|
|
138
|
+
//
|
|
142
139
|
// We don't use forward filling because if the dimensions of the text field
|
|
143
140
|
// change (leading icon removed, density changes, etc), then the animation
|
|
144
141
|
// will be inaccurate.
|
|
@@ -146,42 +143,55 @@ export class Field extends LitElement {
|
|
|
146
143
|
// Re-calculating the animation each time will prevent any visual glitches
|
|
147
144
|
// from appearing.
|
|
148
145
|
// TODO(b/241113345): use animation tokens
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
// Cancel if requested (another animation starts playing).
|
|
152
|
-
animation.cancel();
|
|
153
|
-
});
|
|
154
|
-
animation.addEventListener('finish', () => {
|
|
146
|
+
this.labelAnimation = this.floatingLabelEl?.animate(this.getLabelKeyframes(), { duration: 150, easing: EASING.STANDARD });
|
|
147
|
+
this.labelAnimation?.addEventListener('finish', () => {
|
|
155
148
|
// At the end of the animation, update the visible label.
|
|
156
149
|
this.isAnimating = false;
|
|
157
|
-
this.labelAnimationSignal.finish();
|
|
158
150
|
});
|
|
159
151
|
}
|
|
160
|
-
|
|
161
|
-
const floatingLabelEl =
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
152
|
+
getLabelKeyframes() {
|
|
153
|
+
const { floatingLabelEl, restingLabelEl } = this;
|
|
154
|
+
if (!floatingLabelEl || !restingLabelEl) {
|
|
155
|
+
return [];
|
|
156
|
+
}
|
|
157
|
+
const { x: floatingX, y: floatingY, height: floatingHeight } = floatingLabelEl.getBoundingClientRect();
|
|
158
|
+
const { x: restingX, y: restingY, height: restingHeight } = restingLabelEl.getBoundingClientRect();
|
|
159
|
+
const floatingScrollWidth = floatingLabelEl.scrollWidth;
|
|
160
|
+
const restingScrollWidth = restingLabelEl.scrollWidth;
|
|
165
161
|
// Scale by width ratio instead of font size since letter-spacing will scale
|
|
166
162
|
// incorrectly. Using the width we can better approximate the adjusted
|
|
167
|
-
// scale and compensate for tracking.
|
|
168
|
-
|
|
169
|
-
const
|
|
163
|
+
// scale and compensate for tracking and overflow.
|
|
164
|
+
// (use scrollWidth instead of width to account for clipped labels)
|
|
165
|
+
const scale = restingScrollWidth / floatingScrollWidth;
|
|
166
|
+
const xDelta = restingX - floatingX;
|
|
170
167
|
// The line-height of the resting and floating label are different. When
|
|
171
|
-
// we move the
|
|
168
|
+
// we move the floating label down to the resting label's position, it won't
|
|
172
169
|
// exactly match because of this. We need to adjust by half of what the
|
|
173
|
-
// final scaled
|
|
174
|
-
const yDelta =
|
|
175
|
-
Math.round((
|
|
176
|
-
// Create the two transforms:
|
|
177
|
-
// above), and
|
|
170
|
+
// final scaled floating label's height will be.
|
|
171
|
+
const yDelta = restingY - floatingY +
|
|
172
|
+
Math.round((restingHeight - floatingHeight * scale) / 2);
|
|
173
|
+
// Create the two transforms: floating to resting (using the calculations
|
|
174
|
+
// above), and resting to floating (re-setting the transform to initial
|
|
178
175
|
// values).
|
|
179
|
-
const
|
|
180
|
-
const
|
|
176
|
+
const restTransform = `translateX(${xDelta}px) translateY(${yDelta}px) scale(${scale})`;
|
|
177
|
+
const floatTransform = `translateX(0) translateY(0) scale(1)`;
|
|
178
|
+
// Constrain the floating labels width to a scaled percentage of the
|
|
179
|
+
// resting label's width. This will prevent long clipped labels from
|
|
180
|
+
// overflowing the container.
|
|
181
|
+
const restingClientWidth = restingLabelEl.clientWidth;
|
|
182
|
+
const isRestingClipped = restingScrollWidth > restingClientWidth;
|
|
183
|
+
const width = isRestingClipped ? `${restingClientWidth / scale}px` : '';
|
|
181
184
|
if (this.focused || this.populated) {
|
|
182
|
-
return [
|
|
185
|
+
return [
|
|
186
|
+
{ transform: restTransform, width }, { transform: floatTransform, width }
|
|
187
|
+
];
|
|
183
188
|
}
|
|
184
|
-
return [
|
|
189
|
+
return [
|
|
190
|
+
{ transform: floatTransform, width }, { transform: restTransform, width }
|
|
191
|
+
];
|
|
192
|
+
}
|
|
193
|
+
getSurfacePositionClientRect() {
|
|
194
|
+
return this.containerEl.getBoundingClientRect();
|
|
185
195
|
}
|
|
186
196
|
}
|
|
187
197
|
__decorate([
|
|
@@ -204,6 +214,10 @@ __decorate([
|
|
|
204
214
|
property({ type: Boolean }),
|
|
205
215
|
__metadata("design:type", Object)
|
|
206
216
|
], Field.prototype, "populated", void 0);
|
|
217
|
+
__decorate([
|
|
218
|
+
property({ type: Boolean }),
|
|
219
|
+
__metadata("design:type", Object)
|
|
220
|
+
], Field.prototype, "resizable", void 0);
|
|
207
221
|
__decorate([
|
|
208
222
|
property({ type: Boolean }),
|
|
209
223
|
__metadata("design:type", Object)
|
|
@@ -221,11 +235,15 @@ __decorate([
|
|
|
221
235
|
__metadata("design:type", Object)
|
|
222
236
|
], Field.prototype, "isAnimating", void 0);
|
|
223
237
|
__decorate([
|
|
224
|
-
|
|
225
|
-
__metadata("design:type",
|
|
238
|
+
query('.label.floating'),
|
|
239
|
+
__metadata("design:type", HTMLElement)
|
|
226
240
|
], Field.prototype, "floatingLabelEl", void 0);
|
|
227
241
|
__decorate([
|
|
228
|
-
|
|
229
|
-
__metadata("design:type",
|
|
242
|
+
query('.label.resting'),
|
|
243
|
+
__metadata("design:type", HTMLElement)
|
|
230
244
|
], Field.prototype, "restingLabelEl", void 0);
|
|
245
|
+
__decorate([
|
|
246
|
+
query('.container'),
|
|
247
|
+
__metadata("design:type", HTMLElement)
|
|
248
|
+
], Field.prototype, "containerEl", void 0);
|
|
231
249
|
//# sourceMappingURL=field.js.map
|
package/field/lib/field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiC,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,qBAAqB,EAAE,MAAM,EAAC,MAAM,2BAA2B,CAAC;AAExE;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU;IAArC;;QAC6B,aA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C,EAAE,EAAC,SAAS,EAAE,aAAa,EAAC,CAAC,CAAC;IACnE,CAAC;CACF;AAvNC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;uCAAkB;AAC5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;oCAAe;AACzC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;sCAAiB;AAC3C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;oCAAgB;AACzC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;wCAAmB;AAC7C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;uCAAkB;AAK5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;uCAAkB;AAK5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;qCAAgB;AAE1C;IAAC,KAAK,EAAE;;0CAA6B;AAErC;IAAC,UAAU,CAAC,iBAAiB,CAAC;;8CAC0B;AACxD;IAAC,UAAU,CAAC,gBAAgB,CAAC;;6CAC0B","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing, PropertyValues, TemplateResult} from 'lit';\nimport {property, queryAsync, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {createAnimationSignal, EASING} from '../../motion/animation.js';\n\n/**\n * A field component.\n */\nexport class Field extends LitElement {\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) error = false;\n @property({type: Boolean}) focused = false;\n @property({type: String}) label?: string;\n @property({type: Boolean}) populated = false;\n @property({type: Boolean}) required = false;\n\n /**\n * Whether or not the field has leading content.\n */\n @property({type: Boolean}) hasStart = false;\n\n /**\n * Whether or not the field has trailing content.\n */\n @property({type: Boolean}) hasEnd = false;\n\n @state() private isAnimating = false;\n private readonly labelAnimationSignal = createAnimationSignal();\n @queryAsync('.label.floating')\n private readonly floatingLabelEl!: Promise<HTMLElement>;\n @queryAsync('.label.resting')\n private readonly restingLabelEl!: Promise<HTMLElement>;\n\n protected override update(props: PropertyValues<Field>) {\n // Client-side property updates\n\n // When disabling, remove focus styles if focused.\n if (this.disabled && this.focused) {\n props.set('focused', true);\n this.focused = false;\n }\n\n // Animate if focused or populated change.\n this.animateLabelIfNeeded({\n wasFocused: props.get('focused'),\n wasPopulated: props.get('populated')\n });\n\n super.update(props);\n }\n\n protected override render() {\n const floatingLabel = this.renderLabel(/*isFloating*/ true);\n const restingLabel = this.renderLabel(/*isFloating*/ false);\n const outline = this.renderOutline?.(floatingLabel);\n const classes = {\n 'disabled': this.disabled,\n 'error': this.error && !this.disabled,\n 'focused': this.focused,\n 'with-start': this.hasStart,\n 'with-end': this.hasEnd,\n 'populated': this.populated,\n 'required': this.required,\n 'no-label': !this.label,\n };\n\n return html`\n <div class=\"field ${classMap(classes)}\">\n <div class=\"container\">\n ${this.renderBackground?.()}\n ${this.renderIndicator?.()}\n ${outline}\n <div class=\"start\">\n <slot name=\"start\"></slot>\n </div>\n <div class=\"middle\">\n ${restingLabel}\n ${outline ? nothing : floatingLabel}\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"end\">\n <slot name=\"end\"></slot>\n </div>\n </div>\n\n <div class=\"supporting-text\">\n <div class=\"supporting-text-start\">\n <slot name=\"supporting-text\"></slot>\n </div>\n <div class=\"supporting-text-end\">\n <slot name=\"supporting-text-end\"></slot>\n </div>\n </div>\n </div>\n `;\n }\n\n protected renderBackground?(): TemplateResult;\n protected renderIndicator?(): TemplateResult;\n protected renderOutline?(floatingLabel: TemplateResult): TemplateResult;\n\n private renderLabel(isFloating: boolean) {\n let visible: boolean;\n if (isFloating) {\n // Floating label is visible when focused/populated. It is never visible\n // while animating.\n visible = (this.focused || this.populated) && !this.isAnimating;\n } else {\n // Resting label is visible when unfocused or while animating.\n visible = !(this.focused || this.populated) || this.isAnimating;\n }\n\n const classes = {\n 'hidden': !visible,\n 'floating': isFloating,\n 'resting': !isFloating,\n };\n\n let labelText = this.label ?? '';\n // Add '*' if a label is present and the field is required\n labelText += this.required && labelText ? '*' : '';\n\n return html`\n <span class=\"label ${classMap(classes)}\"\n aria-hidden=${!visible}\n >${labelText}</span>\n `;\n }\n\n private async animateLabelIfNeeded({wasFocused, wasPopulated}: {\n wasFocused?: boolean,\n wasPopulated?: boolean\n }) {\n if (!this.label) {\n return;\n }\n\n wasFocused ??= this.focused;\n wasPopulated ??= this.populated;\n const wasFloating = wasFocused || wasPopulated;\n const shouldBeFloating = this.focused || this.populated;\n if (wasFloating === shouldBeFloating) {\n return;\n }\n\n this.isAnimating = true;\n const signal = this.labelAnimationSignal.start();\n\n // Only one label is visible at a time for clearer text rendering.\n // The resting label is visible and used during animation. At the end of the\n // animation, it will either remain visible (if resting) or hide and the\n // floating label will be shown.\n const labelEl = await this.restingLabelEl;\n const keyframes = await this.getLabelKeyframes();\n if (signal.aborted) {\n // Don't animate if this animation was requested to stop while getting\n // the label element or calculating keyframes\n return;\n }\n\n // We don't use forward filling because if the dimensions of the text field\n // change (leading icon removed, density changes, etc), then the animation\n // will be inaccurate.\n //\n // Re-calculating the animation each time will prevent any visual glitches\n // from appearing.\n // TODO(b/241113345): use animation tokens\n const animation =\n labelEl.animate(keyframes, {duration: 150, easing: EASING.STANDARD});\n\n signal.addEventListener('abort', () => {\n // Cancel if requested (another animation starts playing).\n animation.cancel();\n });\n\n animation.addEventListener('finish', () => {\n // At the end of the animation, update the visible label.\n this.isAnimating = false;\n this.labelAnimationSignal.finish();\n });\n }\n\n private async getLabelKeyframes() {\n const floatingLabelEl = await this.floatingLabelEl;\n const restingLabelEl = await this.restingLabelEl;\n const {\n x: floatingX,\n y: floatingY,\n width: floatingWidth,\n height: floatingHeight\n } = floatingLabelEl.getBoundingClientRect();\n const {\n x: restingX,\n y: restingY,\n width: restingWidth,\n height: restingHeight\n } = restingLabelEl.getBoundingClientRect();\n // Scale by width ratio instead of font size since letter-spacing will scale\n // incorrectly. Using the width we can better approximate the adjusted\n // scale and compensate for tracking.\n const scale = floatingWidth / restingWidth;\n const xDelta = floatingX - restingX;\n // The line-height of the resting and floating label are different. When\n // we move the resting label up to the floating label's position, it won't\n // exactly match because of this. We need to adjust by half of what the\n // final scaled resting label's height will be.\n const yDelta = floatingY - restingY +\n Math.round((floatingHeight - restingHeight * scale) / 2);\n\n // Create the two transforms: resting to floating (using the calculations\n // above), and floating to resting (re-setting the transform to initial\n // values).\n const floatTransform = `translateX(${xDelta}px) translateY(calc(-50% + ${\n yDelta}px)) scale(${scale})`;\n const restTransform = `translateX(0) translateY(-50%) scale(1)`;\n\n if (this.focused || this.populated) {\n return [{transform: restTransform}, {transform: floatTransform}];\n }\n\n return [{transform: floatTransform}, {transform: restTransform}];\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiC,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU;IAArC;;QAC6B,aAAQ,GAAG,KAAK,CAAC;QACjB,UAAK,GAAG,KAAK,CAAC;QACd,YAAO,GAAG,KAAK,CAAC;QAEhB,cAAS,GAAG,KAAK,CAAC;QAClB,cAAS,GAAG,KAAK,CAAC;QAClB,aAAQ,GAAG,KAAK,CAAC;QAE5C;;WAEG;QACwB,aAAQ,GAAG,KAAK,CAAC;QAE5C;;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C,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;uCAAkB;AAC5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;oCAAe;AACzC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;sCAAiB;AAC3C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;oCAAgB;AACzC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;wCAAmB;AAC7C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;wCAAmB;AAC7C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;uCAAkB;AAK5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;uCAAkB;AAK5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;qCAAgB;AAE1C;IAAC,KAAK,EAAE;;0CAA6B;AAErC;IAAC,KAAK,CAAC,iBAAiB,CAAC;8BAAoC,WAAW;8CAAM;AAC9E;IAAC,KAAK,CAAC,gBAAgB,CAAC;8BAAmC,WAAW;6CAAM;AAC5E;IAAC,KAAK,CAAC,YAAY,CAAC;8BAAgC,WAAW;0CAAM","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing, PropertyValues, TemplateResult} from 'lit';\nimport {property, query, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {SurfacePositionTarget} from '../../menu/lib/surfacePositionController.js';\n\nimport {EASING} from '../../motion/animation.js';\n\n/**\n * A field component.\n */\nexport class Field extends LitElement implements SurfacePositionTarget {\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) error = false;\n @property({type: Boolean}) focused = false;\n @property({type: String}) label?: string;\n @property({type: Boolean}) populated = false;\n @property({type: Boolean}) resizable = false;\n @property({type: Boolean}) required = false;\n\n /**\n * Whether or not the field has leading content.\n */\n @property({type: Boolean}) hasStart = false;\n\n /**\n * Whether or not the field has trailing content.\n */\n @property({type: Boolean}) hasEnd = false;\n\n @state() private isAnimating = false;\n private labelAnimation?: Animation;\n @query('.label.floating') private readonly floatingLabelEl!: HTMLElement|null;\n @query('.label.resting') private readonly restingLabelEl!: HTMLElement|null;\n @query('.container') private readonly containerEl!: HTMLElement|null;\n\n protected override update(props: PropertyValues<Field>) {\n // Client-side property updates\n\n // When disabling, remove focus styles if focused.\n if (this.disabled && this.focused) {\n props.set('focused', true);\n this.focused = false;\n }\n\n // Animate if focused or populated change.\n this.animateLabelIfNeeded({\n wasFocused: props.get('focused'),\n wasPopulated: props.get('populated')\n });\n\n super.update(props);\n }\n\n protected override render() {\n const floatingLabel = this.renderLabel(/*isFloating*/ true);\n const restingLabel = this.renderLabel(/*isFloating*/ false);\n const outline = this.renderOutline?.(floatingLabel);\n const classes = {\n 'disabled': this.disabled,\n 'error': this.error && !this.disabled,\n 'focused': this.focused,\n 'with-start': this.hasStart,\n 'with-end': this.hasEnd,\n 'populated': this.populated,\n 'resizable': this.resizable,\n 'required': this.required,\n 'no-label': !this.label,\n };\n\n return html`\n <div class=\"field ${classMap(classes)}\">\n <div class=\"container-overflow\">\n ${outline}\n ${this.renderBackground?.()}\n ${this.renderIndicator?.()}\n <div class=\"container\">\n <div class=\"start\">\n <slot name=\"start\"></slot>\n </div>\n <div class=\"middle\">\n ${restingLabel}\n ${outline ? nothing : floatingLabel}\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"end\">\n <slot name=\"end\"></slot>\n </div>\n </div>\n </div>\n\n <div class=\"supporting-text\">\n <div class=\"supporting-text-start\">\n <slot name=\"supporting-text\"></slot>\n </div>\n <div class=\"supporting-text-end\">\n <slot name=\"supporting-text-end\"></slot>\n </div>\n </div>\n </div>\n `;\n }\n\n protected renderBackground?(): TemplateResult;\n protected renderIndicator?(): TemplateResult;\n protected renderOutline?(floatingLabel: TemplateResult): TemplateResult;\n\n private renderLabel(isFloating: boolean) {\n let visible: boolean;\n if (isFloating) {\n // Floating label is visible when focused/populated or when animating.\n visible = this.focused || this.populated || this.isAnimating;\n } else {\n // Resting label is visible when unfocused. It is never visible while\n // animating.\n visible = !this.focused && !this.populated && !this.isAnimating;\n }\n\n const classes = {\n 'hidden': !visible,\n 'floating': isFloating,\n 'resting': !isFloating,\n };\n\n let labelText = this.label ?? '';\n // Add '*' if a label is present and the field is required\n labelText += this.required && labelText ? '*' : '';\n\n return html`\n <span class=\"label ${classMap(classes)}\"\n aria-hidden=${!visible}\n >${labelText}</span>\n `;\n }\n\n private animateLabelIfNeeded({wasFocused, wasPopulated}: {\n wasFocused?: boolean,\n wasPopulated?: boolean\n }) {\n if (!this.label) {\n return;\n }\n\n wasFocused ??= this.focused;\n wasPopulated ??= this.populated;\n const wasFloating = wasFocused || wasPopulated;\n const shouldBeFloating = this.focused || this.populated;\n if (wasFloating === shouldBeFloating) {\n return;\n }\n\n this.isAnimating = true;\n this.labelAnimation?.cancel();\n\n // Only one label is visible at a time for clearer text rendering.\n // The floating label is visible and used during animation. At the end of\n // the animation, it will either remain visible (if floating) or hide and\n // the resting label will be shown.\n //\n // We don't use forward filling because if the dimensions of the text field\n // change (leading icon removed, density changes, etc), then the animation\n // will be inaccurate.\n //\n // Re-calculating the animation each time will prevent any visual glitches\n // from appearing.\n // TODO(b/241113345): use animation tokens\n this.labelAnimation = this.floatingLabelEl?.animate(\n this.getLabelKeyframes(), {duration: 150, easing: EASING.STANDARD});\n\n this.labelAnimation?.addEventListener('finish', () => {\n // At the end of the animation, update the visible label.\n this.isAnimating = false;\n });\n }\n\n private getLabelKeyframes() {\n const {floatingLabelEl, restingLabelEl} = this;\n if (!floatingLabelEl || !restingLabelEl) {\n return [];\n }\n\n const {x: floatingX, y: floatingY, height: floatingHeight} =\n floatingLabelEl.getBoundingClientRect();\n const {x: restingX, y: restingY, height: restingHeight} =\n restingLabelEl.getBoundingClientRect();\n const floatingScrollWidth = floatingLabelEl.scrollWidth;\n const restingScrollWidth = restingLabelEl.scrollWidth;\n // Scale by width ratio instead of font size since letter-spacing will scale\n // incorrectly. Using the width we can better approximate the adjusted\n // scale and compensate for tracking and overflow.\n // (use scrollWidth instead of width to account for clipped labels)\n const scale = restingScrollWidth / floatingScrollWidth;\n const xDelta = restingX - floatingX;\n // The line-height of the resting and floating label are different. When\n // we move the floating label down to the resting label's position, it won't\n // exactly match because of this. We need to adjust by half of what the\n // final scaled floating label's height will be.\n const yDelta = restingY - floatingY +\n Math.round((restingHeight - floatingHeight * scale) / 2);\n\n // Create the two transforms: floating to resting (using the calculations\n // above), and resting to floating (re-setting the transform to initial\n // values).\n const restTransform =\n `translateX(${xDelta}px) translateY(${yDelta}px) scale(${scale})`;\n const floatTransform = `translateX(0) translateY(0) scale(1)`;\n\n // Constrain the floating labels width to a scaled percentage of the\n // resting label's width. This will prevent long clipped labels from\n // overflowing the container.\n const restingClientWidth = restingLabelEl.clientWidth;\n const isRestingClipped = restingScrollWidth > restingClientWidth;\n const width = isRestingClipped ? `${restingClientWidth / scale}px` : '';\n if (this.focused || this.populated) {\n return [\n {transform: restTransform, width}, {transform: floatTransform, width}\n ];\n }\n\n return [\n {transform: floatTransform, width}, {transform: restTransform, width}\n ];\n }\n\n getSurfacePositionClientRect() {\n return this.containerEl!.getBoundingClientRect();\n }\n}\n"]}
|
|
@@ -3,16 +3,11 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { PropertyValues } from 'lit';
|
|
7
6
|
import { Field } from './field.js';
|
|
8
7
|
/**
|
|
9
8
|
* A filled field component.
|
|
10
9
|
*/
|
|
11
10
|
export declare class FilledField extends Field {
|
|
12
|
-
private strokeTransformOrigin;
|
|
13
|
-
constructor();
|
|
14
11
|
protected renderBackground(): import("lit-html").TemplateResult<1>;
|
|
15
12
|
protected renderIndicator(): import("lit-html").TemplateResult<1>;
|
|
16
|
-
protected update(props: PropertyValues<FilledField>): void;
|
|
17
|
-
private updateStrokeTransformOrigin;
|
|
18
13
|
}
|
|
@@ -3,59 +3,20 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { __decorate, __metadata } from "tslib";
|
|
7
6
|
import { html } from 'lit';
|
|
8
|
-
import { state } from 'lit/decorators.js';
|
|
9
|
-
import { styleMap } from 'lit/directives/style-map.js';
|
|
10
7
|
import { Field } from './field.js';
|
|
11
8
|
/**
|
|
12
9
|
* A filled field component.
|
|
13
10
|
*/
|
|
14
11
|
export class FilledField extends Field {
|
|
15
|
-
constructor() {
|
|
16
|
-
super();
|
|
17
|
-
this.strokeTransformOrigin = '';
|
|
18
|
-
this.addEventListener('click', event => {
|
|
19
|
-
if (!this.disabled) {
|
|
20
|
-
this.updateStrokeTransformOrigin(event);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
12
|
renderBackground() {
|
|
25
13
|
return html `
|
|
14
|
+
<div class="background"></div>
|
|
26
15
|
<div class="state-layer"></div>
|
|
27
16
|
`;
|
|
28
17
|
}
|
|
29
18
|
renderIndicator() {
|
|
30
|
-
|
|
31
|
-
return html `
|
|
32
|
-
<div class="active-indicator" style="${styleMap(strokeStyle)}"></div>
|
|
33
|
-
`;
|
|
34
|
-
}
|
|
35
|
-
update(props) {
|
|
36
|
-
// Upon losing focus, the stroke resets to expanding from the center, such
|
|
37
|
-
// as when re-focusing with a keyboard.
|
|
38
|
-
const unfocusing = props.has('focused') && !this.focused;
|
|
39
|
-
if (unfocusing) {
|
|
40
|
-
this.updateStrokeTransformOrigin();
|
|
41
|
-
}
|
|
42
|
-
super.update(props);
|
|
43
|
-
}
|
|
44
|
-
updateStrokeTransformOrigin(event) {
|
|
45
|
-
let transformOrigin = '';
|
|
46
|
-
if (event) {
|
|
47
|
-
// Can't use instanceof TouchEvent since Firefox does not provide the
|
|
48
|
-
// constructor globally.
|
|
49
|
-
const isTouchEvent = 'touches' in event;
|
|
50
|
-
const eventX = isTouchEvent ? event.touches[0].clientX : event.clientX;
|
|
51
|
-
const rootRect = this.getBoundingClientRect();
|
|
52
|
-
transformOrigin = `${eventX - rootRect.x}px`;
|
|
53
|
-
}
|
|
54
|
-
this.strokeTransformOrigin = transformOrigin;
|
|
19
|
+
return html `<div class="active-indicator"></div>`;
|
|
55
20
|
}
|
|
56
21
|
}
|
|
57
|
-
__decorate([
|
|
58
|
-
state(),
|
|
59
|
-
__metadata("design:type", Object)
|
|
60
|
-
], FilledField.prototype, "strokeTransformOrigin", void 0);
|
|
61
22
|
//# sourceMappingURL=filled-field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filled-field.js","sourceRoot":"","sources":["filled-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"filled-field.js","sourceRoot":"","sources":["filled-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACjB,gBAAgB;QACjC,OAAO,IAAI,CAAA;;;KAGV,CAAC;IACJ,CAAC;IAEkB,eAAe;QAChC,OAAO,IAAI,CAAA,sCAAsC,CAAC;IACpD,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html} from 'lit';\n\nimport {Field} from './field.js';\n\n/**\n * A filled field component.\n */\nexport class FilledField extends Field {\n protected override renderBackground() {\n return html`\n <div class=\"background\"></div>\n <div class=\"state-layer\"></div>\n `;\n }\n\n protected override renderIndicator() {\n return html`<div class=\"active-indicator\"></div>`;\n }\n}\n"]}
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { css } from 'lit';
|
|
7
|
-
export const styles = css `:host{--_container-shape-start-start: var(--md-filled-field-container-shape-start-start, var(--md-filled-field-container-shape, 4px));--_container-shape-start-end: var(--md-filled-field-container-shape-start-end, var(--md-filled-field-container-shape, 4px));--_container-shape-end-end: var(--md-filled-field-container-shape-end-end, var(--md-filled-field-container-shape, 0px));--_container-shape-end-start: var(--md-filled-field-container-shape-end-start, var(--md-filled-field-container-shape, 0px));--_active-indicator-color: var(--md-filled-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-field-active-indicator-height, 1px);--_container-color: var(--md-filled-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_disabled-active-indicator-color: var(--md-filled-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-active-indicator-height: var(--md-filled-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-field-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-container-opacity: var(--md-filled-field-disabled-container-opacity, 0.04);--_disabled-label-text-color: var(--md-filled-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-filled-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-filled-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-icon-opacity: var(--md-filled-field-disabled-leading-icon-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-filled-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-filled-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-icon-opacity: var(--md-filled-field-disabled-trailing-icon-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-active-indicator-color: var(--md-filled-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-label-text-color: var(--md-filled-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-filled-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-filled-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-label-text-color: var(--md-filled-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-filled-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-state-layer-opacity: var(--md-filled-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-filled-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-filled-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-filled-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-filled-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-field-focus-active-indicator-height, 2px);--_focus-label-text-color: var(--md-filled-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-filled-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-filled-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-active-indicator-height: var(--md-filled-field-hover-active-indicator-height, 1px);--_hover-label-text-color: var(--md-filled-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-icon-color: var(--md-filled-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-state-layer-opacity: var(--md-filled-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filled-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-filled-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-populated-line-height: var(--md-filled-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-filled-field-label-text-type, 400 1rem / 1.5rem Roboto);--_leading-icon-color: var(--md-filled-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-filled-field-leading-icon-size, 24px);--_supporting-text-color: var(--md-filled-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-type: var(--md-filled-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_trailing-icon-color: var(--md-filled-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-filled-field-trailing-icon-size, 24px);--_container-padding-horizontal: var(--md-filled-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-field-container-padding-vertical, 16px);--_content-color: var(--md-filled-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-color: var(--md-filled-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-filled-field-disabled-content-opacity, 0.38);--_error-content-color: var(--md-filled-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-content-color: var(--md-filled-field-error-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-content-color: var(--md-filled-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-content-color: var(--md-filled-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-content-color: var(--md-filled-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_supporting-text-padding: var(--md-filled-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-filled-field-supporting-text-padding-top, 4px);--_with-label-container-padding-vertical: var(--md-filled-field-with-label-container-padding-vertical, 8px)}.container{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);overflow:hidden;z-index:0}.container::before{background:var(--_container-color)}.container::after{visibility:hidden}.container::before,.container::after{border-radius:inherit;content:"";display:flex;height:100%;position:absolute;width:100%;z-index:-1}.label.floating{position:absolute;top:0}.state-layer{border-radius:inherit;height:100%;position:absolute;width:100%;visibility:hidden;z-index:-1}.field:not(.disabled):hover .state-layer{visibility:visible}.active-indicator{inset:auto 0 0 0;pointer-events:none;position:absolute;width:100%}.active-indicator::before,.active-indicator::after{border-bottom:var(--_active-indicator-height) solid var(--_active-indicator-color);inset:auto 0 0 0;content:"";position:absolute;width:100%}.active-indicator::after{opacity:0;transform:scaleX(0);transform-origin:inherit;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1),transform 0s ease 150ms}.focused .active-indicator::after{opacity:1;transform:scaleX(1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}.field:not(.with-start) .start{padding-inline-start:var(--_container-padding-horizontal)}.field:not(.with-end) .end{padding-inline-end:var(--_container-padding-horizontal)}.field:not(.no-label) .container{padding-bottom:var(--_with-label-container-padding-vertical);padding-top:var(--_with-label-container-padding-vertical)}.field:not(.no-label) .middle{padding-top:var(--_label-text-populated-line-height)}:hover .active-indicator::before{border-bottom-color:var(--_hover-active-indicator-color);border-bottom-width:var(--_hover-active-indicator-height)}.active-indicator::after{border-bottom-color:var(--_focus-active-indicator-color);border-bottom-width:var(--_focus-active-indicator-height)}:hover .state-layer{background:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.disabled .active-indicator::before{border-bottom-color:var(--_disabled-active-indicator-color);border-bottom-width:var(--_disabled-active-indicator-height);opacity:var(--_disabled-active-indicator-opacity)}.disabled .container::before{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.error .active-indicator::before{border-bottom-color:var(--_error-active-indicator-color)}.error:hover .active-indicator::before{border-bottom-color:var(--_error-hover-active-indicator-color)}.error:hover .state-layer{background:var(--_error-hover-state-layer-color);opacity:var(--_error-hover-state-layer-opacity)}.error .active-indicator::after{border-bottom-color:var(--_error-focus-active-indicator-color)}/*# sourceMappingURL=filled-styles.css.map */
|
|
7
|
+
export const styles = css `:host{--_container-shape-start-start: var(--md-filled-field-container-shape-start-start, var(--md-filled-field-container-shape, 4px));--_container-shape-start-end: var(--md-filled-field-container-shape-start-end, var(--md-filled-field-container-shape, 4px));--_container-shape-end-end: var(--md-filled-field-container-shape-end-end, var(--md-filled-field-container-shape, 0px));--_container-shape-end-start: var(--md-filled-field-container-shape-end-start, var(--md-filled-field-container-shape, 0px));--_active-indicator-color: var(--md-filled-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-field-active-indicator-height, 1px);--_container-color: var(--md-filled-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_container-padding-horizontal: var(--md-filled-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-field-container-padding-vertical, 16px);--_content-color: var(--md-filled-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_content-type: var(--md-filled-field-content-type, 400 1rem / 1.5rem Roboto);--_disabled-active-indicator-color: var(--md-filled-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-active-indicator-height: var(--md-filled-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-field-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-container-opacity: var(--md-filled-field-disabled-container-opacity, 0.04);--_disabled-content-color: var(--md-filled-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-filled-field-disabled-content-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-filled-field-disabled-label-text-opacity, 0.38);--_disabled-leading-content-color: var(--md-filled-field-disabled-leading-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-content-opacity: var(--md-filled-field-disabled-leading-content-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-filled-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-content-color: var(--md-filled-field-disabled-trailing-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-content-opacity: var(--md-filled-field-disabled-trailing-content-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-content-color: var(--md-filled-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-active-indicator-color: var(--md-filled-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-content-color: var(--md-filled-field-error-focus-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-label-text-color: var(--md-filled-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-content-color: var(--md-filled-field-error-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-content-color: var(--md-filled-field-error-focus-trailing-content-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-content-color: var(--md-filled-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-label-text-color: var(--md-filled-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-content-color: var(--md-filled-field-error-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-state-layer-opacity: var(--md-filled-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-content-color: var(--md-filled-field-error-hover-trailing-content-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-filled-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-content-color: var(--md-filled-field-error-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-content-color: var(--md-filled-field-error-trailing-content-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-field-focus-active-indicator-height, 2px);--_focus-content-color: var(--md-filled-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-label-text-color: var(--md-filled-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-content-color: var(--md-filled-field-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-content-color: var(--md-filled-field-focus-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-active-indicator-height: var(--md-filled-field-hover-active-indicator-height, 1px);--_hover-content-color: var(--md-filled-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-label-text-color: var(--md-filled-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-content-color: var(--md-filled-field-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-state-layer-opacity: var(--md-filled-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-content-color: var(--md-filled-field-hover-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-filled-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-populated-line-height: var(--md-filled-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-filled-field-label-text-type, 400 1rem / 1.5rem Roboto);--_leading-content-color: var(--md-filled-field-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-color: var(--md-filled-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-padding: var(--md-filled-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-filled-field-supporting-text-padding-top, 4px);--_supporting-text-type: var(--md-filled-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_trailing-content-color: var(--md-filled-field-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_with-label-container-padding-vertical: var(--md-filled-field-with-label-container-padding-vertical, 8px)}.background,.state-layer{border-radius:inherit;inset:0;pointer-events:none;position:absolute}.background{background:var(--_container-color)}.state-layer{visibility:hidden}.field:not(.disabled):hover .state-layer{visibility:visible}.label.floating{position:absolute;top:0}.active-indicator{inset:auto 0 0 0;pointer-events:none;position:absolute;width:100%}.active-indicator::before,.active-indicator::after{border-bottom:var(--_active-indicator-height) solid var(--_active-indicator-color);inset:auto 0 0 0;content:"";position:absolute;width:100%}.active-indicator::after{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .active-indicator::after{opacity:1}.field:not(.with-start) .start{padding-inline-start:var(--_container-padding-horizontal)}.field:not(.with-end) .end{padding-inline-end:var(--_container-padding-horizontal)}.field:not(.no-label) .container{padding-bottom:var(--_with-label-container-padding-vertical);padding-top:var(--_with-label-container-padding-vertical)}.field:not(.no-label) .middle{padding-top:var(--_label-text-populated-line-height)}:hover .active-indicator::before{border-bottom-color:var(--_hover-active-indicator-color);border-bottom-width:var(--_hover-active-indicator-height)}.active-indicator::after{border-bottom-color:var(--_focus-active-indicator-color);border-bottom-width:var(--_focus-active-indicator-height)}:hover .state-layer{background:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.disabled .active-indicator::before{border-bottom-color:var(--_disabled-active-indicator-color);border-bottom-width:var(--_disabled-active-indicator-height);opacity:var(--_disabled-active-indicator-opacity)}.disabled .background{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.error .active-indicator::before{border-bottom-color:var(--_error-active-indicator-color)}.error:hover .active-indicator::before{border-bottom-color:var(--_error-hover-active-indicator-color)}.error:hover .state-layer{background:var(--_error-hover-state-layer-color);opacity:var(--_error-hover-state-layer-opacity)}.error .active-indicator::after{border-bottom-color:var(--_error-focus-active-indicator-color)}/*# sourceMappingURL=filled-styles.css.map */
|
|
8
8
|
`;
|
|
9
9
|
//# sourceMappingURL=filled-styles.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filled-styles.css.js","sourceRoot":"","sources":["filled-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_container-shape-start-start: var(--md-filled-field-container-shape-start-start, var(--md-filled-field-container-shape, 4px));--_container-shape-start-end: var(--md-filled-field-container-shape-start-end, var(--md-filled-field-container-shape, 4px));--_container-shape-end-end: var(--md-filled-field-container-shape-end-end, var(--md-filled-field-container-shape, 0px));--_container-shape-end-start: var(--md-filled-field-container-shape-end-start, var(--md-filled-field-container-shape, 0px));--_active-indicator-color: var(--md-filled-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-field-active-indicator-height, 1px);--_container-color: var(--md-filled-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_disabled-active-indicator-color: var(--md-filled-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-active-indicator-height: var(--md-filled-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-field-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-container-opacity: var(--md-filled-field-disabled-container-opacity, 0.04);--_disabled-label-text-color: var(--md-filled-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-filled-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-filled-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-icon-opacity: var(--md-filled-field-disabled-leading-icon-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-filled-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-filled-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-icon-opacity: var(--md-filled-field-disabled-trailing-icon-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-active-indicator-color: var(--md-filled-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-label-text-color: var(--md-filled-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-filled-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-filled-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-label-text-color: var(--md-filled-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-filled-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-state-layer-opacity: var(--md-filled-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-filled-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-filled-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-filled-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-filled-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-field-focus-active-indicator-height, 2px);--_focus-label-text-color: var(--md-filled-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-filled-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-filled-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-active-indicator-height: var(--md-filled-field-hover-active-indicator-height, 1px);--_hover-label-text-color: var(--md-filled-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-icon-color: var(--md-filled-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-state-layer-opacity: var(--md-filled-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filled-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-filled-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-populated-line-height: var(--md-filled-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-filled-field-label-text-type, 400 1rem / 1.5rem Roboto);--_leading-icon-color: var(--md-filled-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-filled-field-leading-icon-size, 24px);--_supporting-text-color: var(--md-filled-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-type: var(--md-filled-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_trailing-icon-color: var(--md-filled-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-filled-field-trailing-icon-size, 24px);--_container-padding-horizontal: var(--md-filled-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-field-container-padding-vertical, 16px);--_content-color: var(--md-filled-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-color: var(--md-filled-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-filled-field-disabled-content-opacity, 0.38);--_error-content-color: var(--md-filled-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-content-color: var(--md-filled-field-error-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-content-color: var(--md-filled-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-content-color: var(--md-filled-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-content-color: var(--md-filled-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_supporting-text-padding: var(--md-filled-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-filled-field-supporting-text-padding-top, 4px);--_with-label-container-padding-vertical: var(--md-filled-field-with-label-container-padding-vertical, 8px)}.container{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);overflow:hidden;z-index:0}.container::before{background:var(--_container-color)}.container::after{visibility:hidden}.container::before,.container::after{border-radius:inherit;content:\"\";display:flex;height:100%;position:absolute;width:100%;z-index:-1}.label.floating{position:absolute;top:0}.state-layer{border-radius:inherit;height:100%;position:absolute;width:100%;visibility:hidden;z-index:-1}.field:not(.disabled):hover .state-layer{visibility:visible}.active-indicator{inset:auto 0 0 0;pointer-events:none;position:absolute;width:100%}.active-indicator::before,.active-indicator::after{border-bottom:var(--_active-indicator-height) solid var(--_active-indicator-color);inset:auto 0 0 0;content:\"\";position:absolute;width:100%}.active-indicator::after{opacity:0;transform:scaleX(0);transform-origin:inherit;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1),transform 0s ease 150ms}.focused .active-indicator::after{opacity:1;transform:scaleX(1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}.field:not(.with-start) .start{padding-inline-start:var(--_container-padding-horizontal)}.field:not(.with-end) .end{padding-inline-end:var(--_container-padding-horizontal)}.field:not(.no-label) .container{padding-bottom:var(--_with-label-container-padding-vertical);padding-top:var(--_with-label-container-padding-vertical)}.field:not(.no-label) .middle{padding-top:var(--_label-text-populated-line-height)}:hover .active-indicator::before{border-bottom-color:var(--_hover-active-indicator-color);border-bottom-width:var(--_hover-active-indicator-height)}.active-indicator::after{border-bottom-color:var(--_focus-active-indicator-color);border-bottom-width:var(--_focus-active-indicator-height)}:hover .state-layer{background:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.disabled .active-indicator::before{border-bottom-color:var(--_disabled-active-indicator-color);border-bottom-width:var(--_disabled-active-indicator-height);opacity:var(--_disabled-active-indicator-opacity)}.disabled .container::before{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.error .active-indicator::before{border-bottom-color:var(--_error-active-indicator-color)}.error:hover .active-indicator::before{border-bottom-color:var(--_error-hover-active-indicator-color)}.error:hover .state-layer{background:var(--_error-hover-state-layer-color);opacity:var(--_error-hover-state-layer-opacity)}.error .active-indicator::after{border-bottom-color:var(--_error-focus-active-indicator-color)}/*# sourceMappingURL=filled-styles.css.map */\n`;\n "]}
|
|
1
|
+
{"version":3,"file":"filled-styles.css.js","sourceRoot":"","sources":["filled-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_container-shape-start-start: var(--md-filled-field-container-shape-start-start, var(--md-filled-field-container-shape, 4px));--_container-shape-start-end: var(--md-filled-field-container-shape-start-end, var(--md-filled-field-container-shape, 4px));--_container-shape-end-end: var(--md-filled-field-container-shape-end-end, var(--md-filled-field-container-shape, 0px));--_container-shape-end-start: var(--md-filled-field-container-shape-end-start, var(--md-filled-field-container-shape, 0px));--_active-indicator-color: var(--md-filled-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-field-active-indicator-height, 1px);--_container-color: var(--md-filled-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_container-padding-horizontal: var(--md-filled-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-field-container-padding-vertical, 16px);--_content-color: var(--md-filled-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_content-type: var(--md-filled-field-content-type, 400 1rem / 1.5rem Roboto);--_disabled-active-indicator-color: var(--md-filled-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-active-indicator-height: var(--md-filled-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-field-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-container-opacity: var(--md-filled-field-disabled-container-opacity, 0.04);--_disabled-content-color: var(--md-filled-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-filled-field-disabled-content-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-filled-field-disabled-label-text-opacity, 0.38);--_disabled-leading-content-color: var(--md-filled-field-disabled-leading-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-content-opacity: var(--md-filled-field-disabled-leading-content-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-filled-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-content-color: var(--md-filled-field-disabled-trailing-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-content-opacity: var(--md-filled-field-disabled-trailing-content-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-content-color: var(--md-filled-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-active-indicator-color: var(--md-filled-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-content-color: var(--md-filled-field-error-focus-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-label-text-color: var(--md-filled-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-content-color: var(--md-filled-field-error-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-content-color: var(--md-filled-field-error-focus-trailing-content-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-content-color: var(--md-filled-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-label-text-color: var(--md-filled-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-content-color: var(--md-filled-field-error-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-state-layer-opacity: var(--md-filled-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-content-color: var(--md-filled-field-error-hover-trailing-content-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-filled-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-content-color: var(--md-filled-field-error-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-content-color: var(--md-filled-field-error-trailing-content-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-field-focus-active-indicator-height, 2px);--_focus-content-color: var(--md-filled-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-label-text-color: var(--md-filled-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-content-color: var(--md-filled-field-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-content-color: var(--md-filled-field-focus-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-active-indicator-height: var(--md-filled-field-hover-active-indicator-height, 1px);--_hover-content-color: var(--md-filled-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-label-text-color: var(--md-filled-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-content-color: var(--md-filled-field-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-state-layer-opacity: var(--md-filled-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-content-color: var(--md-filled-field-hover-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-filled-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-populated-line-height: var(--md-filled-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-filled-field-label-text-type, 400 1rem / 1.5rem Roboto);--_leading-content-color: var(--md-filled-field-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-color: var(--md-filled-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-padding: var(--md-filled-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-filled-field-supporting-text-padding-top, 4px);--_supporting-text-type: var(--md-filled-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_trailing-content-color: var(--md-filled-field-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_with-label-container-padding-vertical: var(--md-filled-field-with-label-container-padding-vertical, 8px)}.background,.state-layer{border-radius:inherit;inset:0;pointer-events:none;position:absolute}.background{background:var(--_container-color)}.state-layer{visibility:hidden}.field:not(.disabled):hover .state-layer{visibility:visible}.label.floating{position:absolute;top:0}.active-indicator{inset:auto 0 0 0;pointer-events:none;position:absolute;width:100%}.active-indicator::before,.active-indicator::after{border-bottom:var(--_active-indicator-height) solid var(--_active-indicator-color);inset:auto 0 0 0;content:\"\";position:absolute;width:100%}.active-indicator::after{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .active-indicator::after{opacity:1}.field:not(.with-start) .start{padding-inline-start:var(--_container-padding-horizontal)}.field:not(.with-end) .end{padding-inline-end:var(--_container-padding-horizontal)}.field:not(.no-label) .container{padding-bottom:var(--_with-label-container-padding-vertical);padding-top:var(--_with-label-container-padding-vertical)}.field:not(.no-label) .middle{padding-top:var(--_label-text-populated-line-height)}:hover .active-indicator::before{border-bottom-color:var(--_hover-active-indicator-color);border-bottom-width:var(--_hover-active-indicator-height)}.active-indicator::after{border-bottom-color:var(--_focus-active-indicator-color);border-bottom-width:var(--_focus-active-indicator-height)}:hover .state-layer{background:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.disabled .active-indicator::before{border-bottom-color:var(--_disabled-active-indicator-color);border-bottom-width:var(--_disabled-active-indicator-height);opacity:var(--_disabled-active-indicator-opacity)}.disabled .background{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.error .active-indicator::before{border-bottom-color:var(--_error-active-indicator-color)}.error:hover .active-indicator::before{border-bottom-color:var(--_error-hover-active-indicator-color)}.error:hover .state-layer{background:var(--_error-hover-state-layer-color);opacity:var(--_error-hover-state-layer-opacity)}.error .active-indicator::after{border-bottom-color:var(--_error-focus-active-indicator-color)}/*# sourceMappingURL=filled-styles.css.map */\n`;\n "]}
|
|
@@ -16,7 +16,7 @@ export class OutlinedField extends Field {
|
|
|
16
16
|
<div class="outline-notch">
|
|
17
17
|
<div class="outline-panel-inactive"></div>
|
|
18
18
|
<div class="outline-panel-active"></div>
|
|
19
|
-
|
|
19
|
+
<div class="outline-label">${floatingLabel}</div>
|
|
20
20
|
</div>
|
|
21
21
|
<div class="outline-end"></div>
|
|
22
22
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outlined-field.js","sourceRoot":"","sources":["outlined-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAiB,MAAM,KAAK,CAAC;AAEzC,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACnB,aAAa,CAAC,aAA6B;QAC5D,OAAO,IAAI,CAAA;;;;;;
|
|
1
|
+
{"version":3,"file":"outlined-field.js","sourceRoot":"","sources":["outlined-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAiB,MAAM,KAAK,CAAC;AAEzC,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACnB,aAAa,CAAC,aAA6B;QAC5D,OAAO,IAAI,CAAA;;;;;;uCAMwB,aAAa;;;;KAI/C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, TemplateResult} from 'lit';\n\nimport {Field} from './field.js';\n\n/**\n * An outlined field component.\n */\nexport class OutlinedField extends Field {\n protected override renderOutline(floatingLabel: TemplateResult) {\n return html`\n <div class=\"outline\">\n <div class=\"outline-start\"></div>\n <div class=\"outline-notch\">\n <div class=\"outline-panel-inactive\"></div>\n <div class=\"outline-panel-active\"></div>\n <div class=\"outline-label\">${floatingLabel}</div>\n </div>\n <div class=\"outline-end\"></div>\n </div>\n `;\n }\n}\n"]}
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { css } from 'lit';
|
|
7
|
-
export const styles = css `:host{--_container-shape-start-start: var(--md-outlined-field-container-shape-start-start, var(--md-outlined-field-container-shape, 4px));--_container-shape-start-end: var(--md-outlined-field-container-shape-start-end, var(--md-outlined-field-container-shape, 4px));--_container-shape-end-end: var(--md-outlined-field-container-shape-end-end, var(--md-outlined-field-container-shape, 4px));--_container-shape-end-start: var(--md-outlined-field-container-shape-end-start, var(--md-outlined-field-container-shape, 4px));--_disabled-label-text-color: var(--md-outlined-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-outlined-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-outlined-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-icon-opacity: var(--md-outlined-field-disabled-leading-icon-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-field-disabled-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-outline-opacity: var(--md-outlined-field-disabled-outline-opacity, 0.12);--_disabled-outline-width: var(--md-outlined-field-disabled-outline-width, 1px);--_disabled-supporting-text-color: var(--md-outlined-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-outlined-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-outlined-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-icon-opacity: var(--md-outlined-field-disabled-trailing-icon-opacity, 0.38);--_error-focus-label-text-color: var(--md-outlined-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-outlined-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-outline-color: var(--md-outlined-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_error-focus-supporting-text-color: var(--md-outlined-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-outlined-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-label-text-color: var(--md-outlined-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-outlined-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-outline-color: var(--md-outlined-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-supporting-text-color: var(--md-outlined-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-outlined-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-outlined-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-outlined-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-outline-color: var(--md-outlined-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_error-supporting-text-color: var(--md-outlined-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-outlined-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-label-text-color: var(--md-outlined-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-outlined-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-outline-color: var(--md-outlined-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-width: var(--md-outlined-field-focus-outline-width, 2px);--_focus-supporting-text-color: var(--md-outlined-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-outlined-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-label-text-color: var(--md-outlined-field-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-leading-icon-color: var(--md-outlined-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-outline-color: var(--md-outlined-field-hover-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-outline-width: var(--md-outlined-field-hover-outline-width, 1px);--_hover-supporting-text-color: var(--md-outlined-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-outlined-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-outlined-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-populated-line-height: var(--md-outlined-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-outlined-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-outlined-field-label-text-type, 400 1rem / 1.5rem Roboto);--_leading-icon-color: var(--md-outlined-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-outlined-field-leading-icon-size, 24px);--_outline-color: var(--md-outlined-field-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-field-outline-width, 1px);--_supporting-text-color: var(--md-outlined-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-type: var(--md-outlined-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_trailing-icon-color: var(--md-outlined-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-outlined-field-trailing-icon-size, 24px);--_container-padding-horizontal: var(--md-outlined-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-outlined-field-container-padding-vertical, 16px);--_content-color: var(--md-outlined-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-color: var(--md-outlined-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-outlined-field-disabled-content-opacity, 0.38);--_error-content-color: var(--md-outlined-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-content-color: var(--md-outlined-field-error-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-content-color: var(--md-outlined-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-content-color: var(--md-outlined-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-content-color: var(--md-outlined-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_label-text-padding-bottom: var(--md-outlined-field-label-text-padding-bottom, 8px);--_outline-label-padding: var(--md-outlined-field-outline-label-padding, 4px);--_supporting-text-padding: var(--md-outlined-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-outlined-field-supporting-text-padding-top, 4px)}.outline{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);border-color:var(--_outline-color);color:var(--_outline-color);display:flex;pointer-events:none;height:100%;position:absolute;width:100%}.outline-start::before,.outline-start::after,.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after,.outline-end::before,.outline-end::after{border:inherit;content:"";inset:0;position:absolute}.outline-start,.outline-end{border:inherit;border-radius:inherit;box-sizing:border-box;position:relative}.outline-start::before,.outline-start::after,.outline-end::before,.outline-end::after{border-bottom-style:solid;border-top-style:solid}.outline-start::after,.outline-end::after{opacity:0;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.focused .outline-start::after,.focused .outline-end::after{opacity:1}.outline-start::before,.outline-start::after{border-inline-start-style:solid;border-inline-end-style:none;border-start-start-radius:inherit;border-start-end-radius:0;border-end-start-radius:inherit;border-end-end-radius:0;margin-inline-end:var(--_outline-label-padding)}.outline-end{flex-grow:1;margin-inline-start:calc(-1*var(--_outline-label-padding))}.outline-end::before,.outline-end::after{border-inline-start-style:none;border-inline-end-style:solid;border-start-start-radius:0;border-start-end-radius:inherit;border-end-start-radius:0;border-end-end-radius:inherit}.outline-notch{align-items:flex-start;border:inherit;display:flex;margin-inline-start:calc(-1*var(--_outline-label-padding));margin-inline-end:var(--_outline-label-padding);max-width:calc(100% - 2*var(--_container-padding-horizontal));padding:0 var(--_outline-label-padding);position:relative}.no-label .outline-notch{display:none}.outline-panel-inactive,.outline-panel-active{border:inherit;border-bottom-style:solid;inset:0;position:absolute}.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after{border-top-style:solid;border-bottom:none;bottom:auto;transform:scaleX(1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}.outline-panel-inactive::before,.outline-panel-active::before{right:50%;transform-origin:top left}.outline-panel-inactive::after,.outline-panel-active::after{left:50%;transform-origin:top right}.populated .outline-panel-inactive::before,.populated .outline-panel-inactive::after,.populated .outline-panel-active::before,.populated .outline-panel-active::after,.focused .outline-panel-inactive::before,.focused .outline-panel-inactive::after,.focused .outline-panel-active::before,.focused .outline-panel-active::after{transform:scaleX(0)}.outline-panel-active{opacity:0;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.focused .outline-panel-active{opacity:1}.label.floating{transform:translateY(calc(-100% + var(--_label-text-padding-bottom)))}.outline-start,.field:not(.with-start) .start{padding-inline-start:max(var(--_container-padding-horizontal),max(var(--_container-shape-start-start),var(--_container-shape-end-start)) + var(--_outline-label-padding))}.field:not(.with-end) .end{padding-inline-end:max(var(--_container-padding-horizontal),max(var(--_container-shape-start-end),var(--_container-shape-end-end)))}.outline-start::before,.outline-end::before,.outline-panel-inactive,.outline-panel-inactive::before,.outline-panel-inactive::after{border-width:var(--_outline-width)}:hover .outline{border-color:var(--_hover-outline-color);color:var(--_hover-outline-color)}:hover .outline-start::before,:hover .outline-end::before,:hover .outline-panel-inactive,:hover .outline-panel-inactive::before,:hover .outline-panel-inactive::after{border-width:var(--_hover-outline-width)}.focused .outline{border-color:var(--_focus-outline-color);color:var(--_focus-outline-color)}.outline-start::after,.outline-end::after,.outline-panel-active,.outline-panel-active::before,.outline-panel-active::after{border-width:var(--_focus-outline-width)}.disabled .outline{border-color:var(--_disabled-outline-color);color:var(--_disabled-outline-color)}.disabled .outline-start,.disabled .outline-end,.disabled .outline-panel-inactive{opacity:var(--_disabled-outline-opacity)}.disabled .outline-start::before,.disabled .outline-end::before,.disabled .outline-panel-inactive,.disabled .outline-panel-inactive::before,.disabled .outline-panel-inactive::after{border-width:var(--_disabled-outline-width)}.error .outline{border-color:var(--_error-outline-color);color:var(--_error-outline-color)}.error:hover .outline{border-color:var(--_error-hover-outline-color);color:var(--_error-hover-outline-color)}.error.focused .outline{border-color:var(--_error-focus-outline-color);color:var(--_error-focus-outline-color)}/*# sourceMappingURL=outlined-styles.css.map */
|
|
7
|
+
export const styles = css `:host{--_container-shape-start-start: var(--md-outlined-field-container-shape-start-start, var(--md-outlined-field-container-shape, 4px));--_container-shape-start-end: var(--md-outlined-field-container-shape-start-end, var(--md-outlined-field-container-shape, 4px));--_container-shape-end-end: var(--md-outlined-field-container-shape-end-end, var(--md-outlined-field-container-shape, 4px));--_container-shape-end-start: var(--md-outlined-field-container-shape-end-start, var(--md-outlined-field-container-shape, 4px));--_container-padding-horizontal: var(--md-outlined-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-outlined-field-container-padding-vertical, 16px);--_content-color: var(--md-outlined-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_content-type: var(--md-outlined-field-content-type, 400 1rem / 1.5rem Roboto);--_disabled-content-color: var(--md-outlined-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-outlined-field-disabled-content-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-outlined-field-disabled-label-text-opacity, 0.38);--_disabled-leading-content-color: var(--md-outlined-field-disabled-leading-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-content-opacity: var(--md-outlined-field-disabled-leading-content-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-field-disabled-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-outline-opacity: var(--md-outlined-field-disabled-outline-opacity, 0.12);--_disabled-outline-width: var(--md-outlined-field-disabled-outline-width, 1px);--_disabled-supporting-text-color: var(--md-outlined-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-outlined-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-content-color: var(--md-outlined-field-disabled-trailing-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-content-opacity: var(--md-outlined-field-disabled-trailing-content-opacity, 0.38);--_error-content-color: var(--md-outlined-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-content-color: var(--md-outlined-field-error-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-label-text-color: var(--md-outlined-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-content-color: var(--md-outlined-field-error-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-outline-color: var(--md-outlined-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_error-focus-supporting-text-color: var(--md-outlined-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-content-color: var(--md-outlined-field-error-focus-trailing-content-color, var(--md-sys-color-error, #b3261e));--_error-hover-content-color: var(--md-outlined-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-label-text-color: var(--md-outlined-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-content-color: var(--md-outlined-field-error-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-outline-color: var(--md-outlined-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-supporting-text-color: var(--md-outlined-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-content-color: var(--md-outlined-field-error-hover-trailing-content-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-outlined-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-content-color: var(--md-outlined-field-error-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-outline-color: var(--md-outlined-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_error-supporting-text-color: var(--md-outlined-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-content-color: var(--md-outlined-field-error-trailing-content-color, var(--md-sys-color-error, #b3261e));--_focus-content-color: var(--md-outlined-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-label-text-color: var(--md-outlined-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-content-color: var(--md-outlined-field-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-outline-color: var(--md-outlined-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-width: var(--md-outlined-field-focus-outline-width, 2px);--_focus-supporting-text-color: var(--md-outlined-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-content-color: var(--md-outlined-field-focus-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-content-color: var(--md-outlined-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-label-text-color: var(--md-outlined-field-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-leading-content-color: var(--md-outlined-field-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-outline-color: var(--md-outlined-field-hover-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-outline-width: var(--md-outlined-field-hover-outline-width, 1px);--_hover-supporting-text-color: var(--md-outlined-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-content-color: var(--md-outlined-field-hover-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-outlined-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-padding-bottom: var(--md-outlined-field-label-text-padding-bottom, 8px);--_label-text-populated-line-height: var(--md-outlined-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-outlined-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-outlined-field-label-text-type, 400 1rem / 1.5rem Roboto);--_leading-content-color: var(--md-outlined-field-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_outline-color: var(--md-outlined-field-outline-color, var(--md-sys-color-outline, #79747e));--_outline-label-padding: var(--md-outlined-field-outline-label-padding, 4px);--_outline-width: var(--md-outlined-field-outline-width, 1px);--_supporting-text-color: var(--md-outlined-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-padding: var(--md-outlined-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-outlined-field-supporting-text-padding-top, 4px);--_supporting-text-type: var(--md-outlined-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_trailing-content-color: var(--md-outlined-field-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f))}.outline{border-color:var(--_outline-color);border-radius:inherit;color:var(--_outline-color);display:flex;pointer-events:none;height:100%;position:absolute;width:100%}.outline-start::before,.outline-start::after,.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after,.outline-end::before,.outline-end::after{border:inherit;content:"";inset:0;position:absolute}.outline-start,.outline-end{border:inherit;border-radius:inherit;box-sizing:border-box;position:relative}.outline-start::before,.outline-start::after,.outline-end::before,.outline-end::after{border-bottom-style:solid;border-top-style:solid}.outline-start::after,.outline-end::after{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .outline-start::after,.focused .outline-end::after{opacity:1}.outline-start::before,.outline-start::after{border-inline-start-style:solid;border-inline-end-style:none;border-start-start-radius:inherit;border-start-end-radius:0;border-end-start-radius:inherit;border-end-end-radius:0;margin-inline-end:var(--_outline-label-padding)}.outline-end{flex-grow:1;margin-inline-start:calc(-1*var(--_outline-label-padding))}.outline-end::before,.outline-end::after{border-inline-start-style:none;border-inline-end-style:solid;border-start-start-radius:0;border-start-end-radius:inherit;border-end-start-radius:0;border-end-end-radius:inherit}.outline-notch{align-items:flex-start;border:inherit;display:flex;margin-inline-start:calc(-1*var(--_outline-label-padding));margin-inline-end:var(--_outline-label-padding);max-width:calc(100% - 2*var(--_container-padding-horizontal));padding:0 var(--_outline-label-padding);position:relative}.no-label .outline-notch{display:none}.outline-panel-inactive,.outline-panel-active{border:inherit;border-bottom-style:solid;inset:0;position:absolute}.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after{border-top-style:solid;border-bottom:none;bottom:auto;transform:scaleX(1);transition:transform 150ms cubic-bezier(0.2, 0, 0, 1)}.outline-panel-inactive::before,.outline-panel-active::before{right:50%;transform-origin:top left}.outline-panel-inactive::after,.outline-panel-active::after{left:50%;transform-origin:top right}.populated .outline-panel-inactive::before,.populated .outline-panel-inactive::after,.populated .outline-panel-active::before,.populated .outline-panel-active::after,.focused .outline-panel-inactive::before,.focused .outline-panel-inactive::after,.focused .outline-panel-active::before,.focused .outline-panel-active::after{transform:scaleX(0)}.outline-panel-active{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .outline-panel-active{opacity:1}.outline-label{display:flex;max-width:100%;transform:translateY(calc(-100% + var(--_label-text-padding-bottom)))}.outline-start,.field:not(.with-start) .start{padding-inline-start:max(var(--_container-padding-horizontal),max(var(--_container-shape-start-start),var(--_container-shape-end-start)) + var(--_outline-label-padding))}.field:not(.with-end) .end{padding-inline-end:max(var(--_container-padding-horizontal),max(var(--_container-shape-start-end),var(--_container-shape-end-end)))}.outline-start::before,.outline-end::before,.outline-panel-inactive,.outline-panel-inactive::before,.outline-panel-inactive::after{border-width:var(--_outline-width)}:hover .outline{border-color:var(--_hover-outline-color);color:var(--_hover-outline-color)}:hover .outline-start::before,:hover .outline-end::before,:hover .outline-panel-inactive,:hover .outline-panel-inactive::before,:hover .outline-panel-inactive::after{border-width:var(--_hover-outline-width)}.focused .outline{border-color:var(--_focus-outline-color);color:var(--_focus-outline-color)}.outline-start::after,.outline-end::after,.outline-panel-active,.outline-panel-active::before,.outline-panel-active::after{border-width:var(--_focus-outline-width)}.disabled .outline{border-color:var(--_disabled-outline-color);color:var(--_disabled-outline-color)}.disabled .outline-start,.disabled .outline-end,.disabled .outline-panel-inactive{opacity:var(--_disabled-outline-opacity)}.disabled .outline-start::before,.disabled .outline-end::before,.disabled .outline-panel-inactive,.disabled .outline-panel-inactive::before,.disabled .outline-panel-inactive::after{border-width:var(--_disabled-outline-width)}.error .outline{border-color:var(--_error-outline-color);color:var(--_error-outline-color)}.error:hover .outline{border-color:var(--_error-hover-outline-color);color:var(--_error-hover-outline-color)}.error.focused .outline{border-color:var(--_error-focus-outline-color);color:var(--_error-focus-outline-color)}/*# sourceMappingURL=outlined-styles.css.map */
|
|
8
8
|
`;
|
|
9
9
|
//# sourceMappingURL=outlined-styles.css.js.map
|