@material/web 2.4.1 → 2.4.2-nightly.082faad.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/button/internal/button.d.ts +2 -21
- package/button/internal/button.js +4 -43
- package/button/internal/button.js.map +1 -1
- package/button/internal/elevated-styles.d.ts +2 -0
- package/button/internal/elevated-styles.js +1 -0
- package/button/internal/elevated-styles.js.map +1 -1
- package/button/internal/filled-styles.d.ts +2 -0
- package/button/internal/filled-styles.js +1 -0
- package/button/internal/filled-styles.js.map +1 -1
- package/button/internal/filled-tonal-styles.d.ts +2 -0
- package/button/internal/filled-tonal-styles.js +1 -0
- package/button/internal/filled-tonal-styles.js.map +1 -1
- package/button/internal/outlined-styles.d.ts +2 -0
- package/button/internal/outlined-styles.js +1 -0
- package/button/internal/outlined-styles.js.map +1 -1
- package/button/internal/shared-elevation-styles.d.ts +2 -0
- package/button/internal/shared-elevation-styles.js +1 -0
- package/button/internal/shared-elevation-styles.js.map +1 -1
- package/button/internal/shared-styles.d.ts +2 -0
- package/button/internal/shared-styles.js +1 -0
- package/button/internal/shared-styles.js.map +1 -1
- package/button/internal/text-styles.d.ts +2 -0
- package/button/internal/text-styles.js +1 -0
- package/button/internal/text-styles.js.map +1 -1
- package/checkbox/internal/checkbox-styles.d.ts +2 -0
- package/checkbox/internal/checkbox-styles.js +1 -0
- package/checkbox/internal/checkbox-styles.js.map +1 -1
- package/chips/internal/assist-styles.d.ts +2 -0
- package/chips/internal/assist-styles.js +1 -0
- package/chips/internal/assist-styles.js.map +1 -1
- package/chips/internal/chip-set-styles.d.ts +2 -0
- package/chips/internal/chip-set-styles.js +1 -0
- package/chips/internal/chip-set-styles.js.map +1 -1
- package/chips/internal/elevated-styles.d.ts +2 -0
- package/chips/internal/elevated-styles.js +1 -0
- package/chips/internal/elevated-styles.js.map +1 -1
- package/chips/internal/filter-styles.d.ts +2 -0
- package/chips/internal/filter-styles.js +1 -0
- package/chips/internal/filter-styles.js.map +1 -1
- package/chips/internal/input-styles.d.ts +2 -0
- package/chips/internal/input-styles.js +1 -0
- package/chips/internal/input-styles.js.map +1 -1
- package/chips/internal/selectable-styles.d.ts +2 -0
- package/chips/internal/selectable-styles.js +1 -0
- package/chips/internal/selectable-styles.js.map +1 -1
- package/chips/internal/shared-styles.d.ts +2 -0
- package/chips/internal/shared-styles.js +1 -0
- package/chips/internal/shared-styles.js.map +1 -1
- package/chips/internal/suggestion-styles.d.ts +2 -0
- package/chips/internal/suggestion-styles.js +1 -0
- package/chips/internal/suggestion-styles.js.map +1 -1
- package/chips/internal/trailing-icon-styles.d.ts +2 -0
- package/chips/internal/trailing-icon-styles.js +1 -0
- package/chips/internal/trailing-icon-styles.js.map +1 -1
- package/dialog/internal/dialog-styles.d.ts +2 -0
- package/dialog/internal/dialog-styles.js +1 -0
- package/dialog/internal/dialog-styles.js.map +1 -1
- package/divider/internal/divider-styles.d.ts +2 -0
- package/divider/internal/divider-styles.js +1 -0
- package/divider/internal/divider-styles.js.map +1 -1
- package/elevation/internal/elevation-styles.d.ts +2 -0
- package/elevation/internal/elevation-styles.js +1 -0
- package/elevation/internal/elevation-styles.js.map +1 -1
- package/fab/internal/fab-branded-styles.d.ts +2 -0
- package/fab/internal/fab-branded-styles.js +1 -0
- package/fab/internal/fab-branded-styles.js.map +1 -1
- package/fab/internal/fab-styles.d.ts +2 -0
- package/fab/internal/fab-styles.js +1 -0
- package/fab/internal/fab-styles.js.map +1 -1
- package/fab/internal/forced-colors-styles.d.ts +2 -0
- package/fab/internal/forced-colors-styles.js +1 -0
- package/fab/internal/forced-colors-styles.js.map +1 -1
- package/fab/internal/shared-styles.d.ts +2 -0
- package/fab/internal/shared-styles.js +1 -0
- package/fab/internal/shared-styles.js.map +1 -1
- package/field/internal/field.js +12 -1
- package/field/internal/field.js.map +1 -1
- package/field/internal/filled-styles.d.ts +2 -0
- package/field/internal/filled-styles.js +1 -0
- package/field/internal/filled-styles.js.map +1 -1
- package/field/internal/outlined-styles.d.ts +2 -0
- package/field/internal/outlined-styles.js +1 -0
- package/field/internal/outlined-styles.js.map +1 -1
- package/field/internal/shared-styles.d.ts +2 -0
- package/field/internal/shared-styles.js +1 -0
- package/field/internal/shared-styles.js.map +1 -1
- package/focus/internal/focus-ring-styles.d.ts +2 -0
- package/focus/internal/focus-ring-styles.js +1 -0
- package/focus/internal/focus-ring-styles.js.map +1 -1
- package/icon/internal/icon-styles.d.ts +2 -0
- package/icon/internal/icon-styles.js +1 -0
- package/icon/internal/icon-styles.js.map +1 -1
- package/iconbutton/internal/filled-styles.d.ts +2 -0
- package/iconbutton/internal/filled-styles.js +1 -0
- package/iconbutton/internal/filled-styles.js.map +1 -1
- package/iconbutton/internal/filled-tonal-styles.d.ts +2 -0
- package/iconbutton/internal/filled-tonal-styles.js +1 -0
- package/iconbutton/internal/filled-tonal-styles.js.map +1 -1
- package/iconbutton/internal/icon-button.d.ts +2 -32
- package/iconbutton/internal/icon-button.js +33 -84
- package/iconbutton/internal/icon-button.js.map +1 -1
- package/iconbutton/internal/outlined-styles.d.ts +2 -0
- package/iconbutton/internal/outlined-styles.js +1 -0
- package/iconbutton/internal/outlined-styles.js.map +1 -1
- package/iconbutton/internal/shared-styles.d.ts +2 -0
- package/iconbutton/internal/shared-styles.js +1 -0
- package/iconbutton/internal/shared-styles.js.map +1 -1
- package/iconbutton/internal/standard-styles.d.ts +2 -0
- package/iconbutton/internal/standard-styles.js +1 -0
- package/iconbutton/internal/standard-styles.js.map +1 -1
- package/internal/events/dispatch-hooks.js +10 -1
- package/internal/events/dispatch-hooks.js.map +1 -1
- package/labs/badge/internal/badge-styles.d.ts +2 -0
- package/labs/badge/internal/badge-styles.js +1 -0
- package/labs/badge/internal/badge-styles.js.map +1 -1
- package/labs/behaviors/form-associated.d.ts +10 -8
- package/labs/behaviors/form-associated.js +4 -4
- package/labs/behaviors/form-associated.js.map +1 -1
- package/{internal/controller → labs/behaviors}/form-submitter.d.ts +10 -16
- package/labs/behaviors/form-submitter.js +87 -0
- package/labs/behaviors/form-submitter.js.map +1 -0
- package/labs/card/internal/elevated-styles.d.ts +2 -0
- package/labs/card/internal/elevated-styles.js +1 -0
- package/labs/card/internal/elevated-styles.js.map +1 -1
- package/labs/card/internal/filled-styles.d.ts +2 -0
- package/labs/card/internal/filled-styles.js +1 -0
- package/labs/card/internal/filled-styles.js.map +1 -1
- package/labs/card/internal/outlined-styles.d.ts +2 -0
- package/labs/card/internal/outlined-styles.js +1 -0
- package/labs/card/internal/outlined-styles.js.map +1 -1
- package/labs/card/internal/shared-styles.d.ts +2 -0
- package/labs/card/internal/shared-styles.js +1 -0
- package/labs/card/internal/shared-styles.js.map +1 -1
- package/labs/item/internal/item-styles.d.ts +2 -0
- package/labs/item/internal/item-styles.js +1 -0
- package/labs/item/internal/item-styles.js.map +1 -1
- package/labs/navigationbar/internal/navigation-bar-styles.d.ts +2 -0
- package/labs/navigationbar/internal/navigation-bar-styles.js +1 -0
- package/labs/navigationbar/internal/navigation-bar-styles.js.map +1 -1
- package/labs/navigationdrawer/internal/navigation-drawer-modal-styles.d.ts +2 -0
- package/labs/navigationdrawer/internal/navigation-drawer-modal-styles.js +1 -0
- package/labs/navigationdrawer/internal/navigation-drawer-modal-styles.js.map +1 -1
- package/labs/navigationdrawer/internal/navigation-drawer-styles.d.ts +2 -0
- package/labs/navigationdrawer/internal/navigation-drawer-styles.js +1 -0
- package/labs/navigationdrawer/internal/navigation-drawer-styles.js.map +1 -1
- package/labs/navigationdrawer/internal/shared-styles.d.ts +2 -0
- package/labs/navigationdrawer/internal/shared-styles.js +1 -0
- package/labs/navigationdrawer/internal/shared-styles.js.map +1 -1
- package/labs/navigationtab/internal/navigation-tab-styles.d.ts +2 -0
- package/labs/navigationtab/internal/navigation-tab-styles.js +1 -0
- package/labs/navigationtab/internal/navigation-tab-styles.js.map +1 -1
- package/labs/segmentedbutton/internal/outlined-styles.d.ts +2 -0
- package/labs/segmentedbutton/internal/outlined-styles.js +1 -0
- package/labs/segmentedbutton/internal/outlined-styles.js.map +1 -1
- package/labs/segmentedbutton/internal/shared-styles.d.ts +2 -0
- package/labs/segmentedbutton/internal/shared-styles.js +1 -0
- package/labs/segmentedbutton/internal/shared-styles.js.map +1 -1
- package/labs/segmentedbuttonset/internal/outlined-styles.d.ts +2 -0
- package/labs/segmentedbuttonset/internal/outlined-styles.js +1 -0
- package/labs/segmentedbuttonset/internal/outlined-styles.js.map +1 -1
- package/labs/segmentedbuttonset/internal/shared-styles.d.ts +2 -0
- package/labs/segmentedbuttonset/internal/shared-styles.js +1 -0
- package/labs/segmentedbuttonset/internal/shared-styles.js.map +1 -1
- package/list/internal/list-styles.d.ts +2 -0
- package/list/internal/list-styles.js +1 -0
- package/list/internal/list-styles.js.map +1 -1
- package/list/internal/listitem/_list-item.scss +3 -0
- package/list/internal/listitem/list-item-styles.css +1 -1
- package/list/internal/listitem/list-item-styles.css.map +1 -1
- package/list/internal/listitem/list-item-styles.d.ts +2 -0
- package/list/internal/listitem/list-item-styles.js +2 -1
- package/list/internal/listitem/list-item-styles.js.map +1 -1
- package/menu/internal/menu-styles.d.ts +2 -0
- package/menu/internal/menu-styles.js +1 -0
- package/menu/internal/menu-styles.js.map +1 -1
- package/menu/internal/menuitem/_menu-item.scss +3 -0
- package/menu/internal/menuitem/menu-item-styles.css +1 -1
- package/menu/internal/menuitem/menu-item-styles.css.map +1 -1
- package/menu/internal/menuitem/menu-item-styles.d.ts +2 -0
- package/menu/internal/menuitem/menu-item-styles.js +2 -1
- package/menu/internal/menuitem/menu-item-styles.js.map +1 -1
- package/menu/internal/submenu/sub-menu-styles.d.ts +2 -0
- package/menu/internal/submenu/sub-menu-styles.js +1 -0
- package/menu/internal/submenu/sub-menu-styles.js.map +1 -1
- package/package.json +23 -1
- package/progress/internal/circular-progress-styles.d.ts +2 -0
- package/progress/internal/circular-progress-styles.js +1 -0
- package/progress/internal/circular-progress-styles.js.map +1 -1
- package/progress/internal/linear-progress-styles.d.ts +2 -0
- package/progress/internal/linear-progress-styles.js +1 -0
- package/progress/internal/linear-progress-styles.js.map +1 -1
- package/radio/internal/radio-styles.d.ts +2 -0
- package/radio/internal/radio-styles.js +1 -0
- package/radio/internal/radio-styles.js.map +1 -1
- package/ripple/internal/ripple-styles.d.ts +2 -0
- package/ripple/internal/ripple-styles.js +1 -0
- package/ripple/internal/ripple-styles.js.map +1 -1
- package/sass/ext/_assert.scss +82 -0
- package/sass/ext/_list_ext.scss +114 -0
- package/sass/ext/_map_ext.scss +222 -0
- package/sass/ext/_string_ext.scss +153 -0
- package/sass/ext/_throw.scss +83 -0
- package/sass/ext/_type.scss +66 -0
- package/{internal/sass → sass/ext}/_var.scss +86 -96
- package/sass/ext/tests.css +1 -0
- package/sass/ext/tests.css.map +1 -0
- package/sass/ext/tests.scss +18 -0
- package/select/internal/filled-select-styles.d.ts +2 -0
- package/select/internal/filled-select-styles.js +1 -0
- package/select/internal/filled-select-styles.js.map +1 -1
- package/select/internal/outlined-select-styles.d.ts +2 -0
- package/select/internal/outlined-select-styles.js +1 -0
- package/select/internal/outlined-select-styles.js.map +1 -1
- package/select/internal/shared-styles.d.ts +2 -0
- package/select/internal/shared-styles.js +1 -0
- package/select/internal/shared-styles.js.map +1 -1
- package/slider/internal/_slider.scss +1 -0
- package/slider/internal/forced-colors-styles.d.ts +2 -0
- package/slider/internal/forced-colors-styles.js +1 -0
- package/slider/internal/forced-colors-styles.js.map +1 -1
- package/slider/internal/slider-styles.css +1 -1
- package/slider/internal/slider-styles.css.map +1 -1
- package/slider/internal/slider-styles.d.ts +2 -0
- package/slider/internal/slider-styles.js +2 -1
- package/slider/internal/slider-styles.js.map +1 -1
- package/switch/internal/switch-styles.d.ts +2 -0
- package/switch/internal/switch-styles.js +1 -0
- package/switch/internal/switch-styles.js.map +1 -1
- package/tabs/internal/_tab.scss +0 -1
- package/tabs/internal/primary-tab-styles.d.ts +2 -0
- package/tabs/internal/primary-tab-styles.js +1 -0
- package/tabs/internal/primary-tab-styles.js.map +1 -1
- package/tabs/internal/secondary-tab-styles.d.ts +2 -0
- package/tabs/internal/secondary-tab-styles.js +1 -0
- package/tabs/internal/secondary-tab-styles.js.map +1 -1
- package/tabs/internal/tab-styles.css.map +1 -1
- package/tabs/internal/tab-styles.d.ts +2 -0
- package/tabs/internal/tab-styles.js +1 -0
- package/tabs/internal/tab-styles.js.map +1 -1
- package/tabs/internal/tabs-styles.d.ts +2 -0
- package/tabs/internal/tabs-styles.js +1 -0
- package/tabs/internal/tabs-styles.js.map +1 -1
- package/textfield/internal/filled-styles.d.ts +2 -0
- package/textfield/internal/filled-styles.js +1 -0
- package/textfield/internal/filled-styles.js.map +1 -1
- package/textfield/internal/outlined-styles.d.ts +2 -0
- package/textfield/internal/outlined-styles.js +1 -0
- package/textfield/internal/outlined-styles.js.map +1 -1
- package/textfield/internal/shared-styles.d.ts +2 -0
- package/textfield/internal/shared-styles.js +1 -0
- package/textfield/internal/shared-styles.js.map +1 -1
- package/tokens/versions/v30_0/sass/_index.scss +239 -0
- package/tokens/versions/v30_0/sass/_md-comp-app-bar-large-flexible.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-app-bar-large.scss +35 -0
- package/tokens/versions/v30_0/sass/_md-comp-app-bar-medium-flexible.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-app-bar-medium.scss +35 -0
- package/tokens/versions/v30_0/sass/_md-comp-app-bar-small.scss +42 -0
- package/tokens/versions/v30_0/sass/_md-comp-app-bar.scss +59 -0
- package/tokens/versions/v30_0/sass/_md-comp-assist-chip.scss +134 -0
- package/tokens/versions/v30_0/sass/_md-comp-badge.scss +53 -0
- package/tokens/versions/v30_0/sass/_md-comp-banner.scss +147 -0
- package/tokens/versions/v30_0/sass/_md-comp-banners-basic.scss +86 -0
- package/tokens/versions/v30_0/sass/_md-comp-banners-rich.scss +89 -0
- package/tokens/versions/v30_0/sass/_md-comp-banners.scss +43 -0
- package/tokens/versions/v30_0/sass/_md-comp-bottom-app-bar.scss +37 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-elevated.scss +125 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-filled.scss +125 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-group-connected-large.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-group-connected-medium.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-group-connected-small.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-group-connected-xlarge.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-group-connected-xsmall.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-group-standard-large.scss +29 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-group-standard-medium.scss +29 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-group-standard-small.scss +29 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-group-standard-xlarge.scss +29 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-group-standard-xsmall.scss +29 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-large.scss +51 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-medium.scss +51 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-outlined.scss +124 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-small.scss +51 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-text.scss +60 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-tonal.scss +125 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-xlarge.scss +51 -0
- package/tokens/versions/v30_0/sass/_md-comp-button-xsmall.scss +51 -0
- package/tokens/versions/v30_0/sass/_md-comp-button.scss +163 -0
- package/tokens/versions/v30_0/sass/_md-comp-carousel-item.scss +79 -0
- package/tokens/versions/v30_0/sass/_md-comp-checkbox.scss +216 -0
- package/tokens/versions/v30_0/sass/_md-comp-circular-progress-indicator.scss +52 -0
- package/tokens/versions/v30_0/sass/_md-comp-data-table.scss +110 -0
- package/tokens/versions/v30_0/sass/_md-comp-date-input-modal.scss +80 -0
- package/tokens/versions/v30_0/sass/_md-comp-date-picker-docked.scss +241 -0
- package/tokens/versions/v30_0/sass/_md-comp-date-picker-modal.scss +295 -0
- package/tokens/versions/v30_0/sass/_md-comp-dialog.scss +157 -0
- package/tokens/versions/v30_0/sass/_md-comp-divider.scss +23 -0
- package/tokens/versions/v30_0/sass/_md-comp-drag-handle.scss +54 -0
- package/tokens/versions/v30_0/sass/_md-comp-elevated-button.scss +112 -0
- package/tokens/versions/v30_0/sass/_md-comp-elevated-card.scss +75 -0
- package/tokens/versions/v30_0/sass/_md-comp-extended-fab-branded.scss +100 -0
- package/tokens/versions/v30_0/sass/_md-comp-extended-fab-large.scss +36 -0
- package/tokens/versions/v30_0/sass/_md-comp-extended-fab-medium.scss +36 -0
- package/tokens/versions/v30_0/sass/_md-comp-extended-fab-primary-container.scss +61 -0
- package/tokens/versions/v30_0/sass/_md-comp-extended-fab-primary.scss +174 -0
- package/tokens/versions/v30_0/sass/_md-comp-extended-fab-secondary-container.scss +61 -0
- package/tokens/versions/v30_0/sass/_md-comp-extended-fab-secondary.scss +174 -0
- package/tokens/versions/v30_0/sass/_md-comp-extended-fab-small.scss +36 -0
- package/tokens/versions/v30_0/sass/_md-comp-extended-fab-surface.scss +108 -0
- package/tokens/versions/v30_0/sass/_md-comp-extended-fab-tertiary-container.scss +61 -0
- package/tokens/versions/v30_0/sass/_md-comp-extended-fab-tertiary.scss +174 -0
- package/tokens/versions/v30_0/sass/_md-comp-extended-fab.scss +36 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-branded-large.scss +79 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-branded.scss +75 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-large.scss +27 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-medium.scss +27 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-menu-primary-close-button.scss +51 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-menu-primary-container.scss +59 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-menu-secondary-close-button.scss +51 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-menu-secondary-container.scss +59 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-menu-tertiary-close-button.scss +51 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-menu-tertiary-container.scss +59 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-menu.scss +53 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-primary-container.scss +53 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-primary-large.scss +77 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-primary-small.scss +77 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-primary.scss +131 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-secondary-container.scss +53 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-secondary-large.scss +77 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-secondary-small.scss +77 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-secondary.scss +131 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-small.scss +27 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-surface-large.scss +83 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-surface.scss +83 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-tertiary-container.scss +53 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-tertiary-large.scss +77 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-tertiary-small.scss +77 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab-tertiary.scss +131 -0
- package/tokens/versions/v30_0/sass/_md-comp-fab.scss +27 -0
- package/tokens/versions/v30_0/sass/_md-comp-filled-autocomplete.scss +279 -0
- package/tokens/versions/v30_0/sass/_md-comp-filled-button.scss +128 -0
- package/tokens/versions/v30_0/sass/_md-comp-filled-card.scss +75 -0
- package/tokens/versions/v30_0/sass/_md-comp-filled-icon-button.scss +102 -0
- package/tokens/versions/v30_0/sass/_md-comp-filled-menu-button.scss +118 -0
- package/tokens/versions/v30_0/sass/_md-comp-filled-select.scss +269 -0
- package/tokens/versions/v30_0/sass/_md-comp-filled-text-field.scss +221 -0
- package/tokens/versions/v30_0/sass/_md-comp-filled-tonal-button.scss +108 -0
- package/tokens/versions/v30_0/sass/_md-comp-filled-tonal-icon-button.scss +102 -0
- package/tokens/versions/v30_0/sass/_md-comp-filter-chip.scss +276 -0
- package/tokens/versions/v30_0/sass/_md-comp-full-screen-dialog.scss +199 -0
- package/tokens/versions/v30_0/sass/_md-comp-icon-button-filled.scss +82 -0
- package/tokens/versions/v30_0/sass/_md-comp-icon-button-large.scss +52 -0
- package/tokens/versions/v30_0/sass/_md-comp-icon-button-medium.scss +52 -0
- package/tokens/versions/v30_0/sass/_md-comp-icon-button-outlined.scss +86 -0
- package/tokens/versions/v30_0/sass/_md-comp-icon-button-small.scss +52 -0
- package/tokens/versions/v30_0/sass/_md-comp-icon-button-standard.scss +72 -0
- package/tokens/versions/v30_0/sass/_md-comp-icon-button-tonal.scss +82 -0
- package/tokens/versions/v30_0/sass/_md-comp-icon-button-xlarge.scss +52 -0
- package/tokens/versions/v30_0/sass/_md-comp-icon-button-xsmall.scss +52 -0
- package/tokens/versions/v30_0/sass/_md-comp-icon-button.scss +193 -0
- package/tokens/versions/v30_0/sass/_md-comp-input-chip.scss +300 -0
- package/tokens/versions/v30_0/sass/_md-comp-linear-progress-indicator.scss +60 -0
- package/tokens/versions/v30_0/sass/_md-comp-list-expand.scss +36 -0
- package/tokens/versions/v30_0/sass/_md-comp-list-reorder.scss +45 -0
- package/tokens/versions/v30_0/sass/_md-comp-list-reveal.scss +50 -0
- package/tokens/versions/v30_0/sass/_md-comp-list.scss +408 -0
- package/tokens/versions/v30_0/sass/_md-comp-loading-indicator.scss +38 -0
- package/tokens/versions/v30_0/sass/_md-comp-menu.scss +218 -0
- package/tokens/versions/v30_0/sass/_md-comp-menus-standard.scss +188 -0
- package/tokens/versions/v30_0/sass/_md-comp-menus-vibrant.scss +160 -0
- package/tokens/versions/v30_0/sass/_md-comp-menus.scss +141 -0
- package/tokens/versions/v30_0/sass/_md-comp-nav-bar-item-horizontal.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-nav-bar-item-vertical.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-nav-bar.scss +68 -0
- package/tokens/versions/v30_0/sass/_md-comp-nav-rail-collapsed.scss +35 -0
- package/tokens/versions/v30_0/sass/_md-comp-nav-rail-expanded.scss +47 -0
- package/tokens/versions/v30_0/sass/_md-comp-nav-rail-item-horizontal.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-nav-rail-item-vertical.scss +33 -0
- package/tokens/versions/v30_0/sass/_md-comp-nav-rail-item.scss +39 -0
- package/tokens/versions/v30_0/sass/_md-comp-nav-rail.scss +48 -0
- package/tokens/versions/v30_0/sass/_md-comp-navigation-bar.scss +150 -0
- package/tokens/versions/v30_0/sass/_md-comp-navigation-drawer.scss +187 -0
- package/tokens/versions/v30_0/sass/_md-comp-navigation-rail.scss +233 -0
- package/tokens/versions/v30_0/sass/_md-comp-outlined-autocomplete.scss +275 -0
- package/tokens/versions/v30_0/sass/_md-comp-outlined-button.scss +108 -0
- package/tokens/versions/v30_0/sass/_md-comp-outlined-card.scss +87 -0
- package/tokens/versions/v30_0/sass/_md-comp-outlined-menu-button.scss +117 -0
- package/tokens/versions/v30_0/sass/_md-comp-outlined-segmented-button.scss +121 -0
- package/tokens/versions/v30_0/sass/_md-comp-outlined-select.scss +266 -0
- package/tokens/versions/v30_0/sass/_md-comp-outlined-text-field.scss +216 -0
- package/tokens/versions/v30_0/sass/_md-comp-plain-tooltip.scss +45 -0
- package/tokens/versions/v30_0/sass/_md-comp-primary-navigation-tab.scss +130 -0
- package/tokens/versions/v30_0/sass/_md-comp-progress-indicator-circular.scss +47 -0
- package/tokens/versions/v30_0/sass/_md-comp-progress-indicator-linear.scss +65 -0
- package/tokens/versions/v30_0/sass/_md-comp-progress-indicator.scss +48 -0
- package/tokens/versions/v30_0/sass/_md-comp-radio-button.scss +72 -0
- package/tokens/versions/v30_0/sass/_md-comp-rich-tooltip.scss +113 -0
- package/tokens/versions/v30_0/sass/_md-comp-scrim.scss +23 -0
- package/tokens/versions/v30_0/sass/_md-comp-search-bar.scss +102 -0
- package/tokens/versions/v30_0/sass/_md-comp-search-view.scss +84 -0
- package/tokens/versions/v30_0/sass/_md-comp-secondary-navigation-tab.scss +104 -0
- package/tokens/versions/v30_0/sass/_md-comp-sheet-bottom.scss +52 -0
- package/tokens/versions/v30_0/sass/_md-comp-sheet-floating.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-sheet-side.scss +96 -0
- package/tokens/versions/v30_0/sass/_md-comp-slider-large.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-slider-medium.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-slider-small.scss +27 -0
- package/tokens/versions/v30_0/sass/_md-comp-slider-xlarge.scss +31 -0
- package/tokens/versions/v30_0/sass/_md-comp-slider-xsmall.scss +27 -0
- package/tokens/versions/v30_0/sass/_md-comp-slider.scss +307 -0
- package/tokens/versions/v30_0/sass/_md-comp-snackbar.scss +115 -0
- package/tokens/versions/v30_0/sass/_md-comp-split-button-large.scss +43 -0
- package/tokens/versions/v30_0/sass/_md-comp-split-button-medium.scss +43 -0
- package/tokens/versions/v30_0/sass/_md-comp-split-button-small.scss +43 -0
- package/tokens/versions/v30_0/sass/_md-comp-split-button-xlarge.scss +43 -0
- package/tokens/versions/v30_0/sass/_md-comp-split-button-xsmall.scss +45 -0
- package/tokens/versions/v30_0/sass/_md-comp-standard-menu-button.scss +103 -0
- package/tokens/versions/v30_0/sass/_md-comp-suggestion-chip.scss +134 -0
- package/tokens/versions/v30_0/sass/_md-comp-switch.scss +191 -0
- package/tokens/versions/v30_0/sass/_md-comp-text-button.scss +94 -0
- package/tokens/versions/v30_0/sass/_md-comp-time-input.scss +206 -0
- package/tokens/versions/v30_0/sass/_md-comp-time-picker.scss +257 -0
- package/tokens/versions/v30_0/sass/_md-comp-toolbar-docked.scss +36 -0
- package/tokens/versions/v30_0/sass/_md-comp-toolbar-floating-fab.scss +51 -0
- package/tokens/versions/v30_0/sass/_md-comp-toolbar-floating.scss +75 -0
- package/tokens/versions/v30_0/sass/_md-comp-toolbar-standard.scss +87 -0
- package/tokens/versions/v30_0/sass/_md-comp-toolbar-vibrant.scss +87 -0
- package/tokens/versions/v30_0/sass/_md-comp-top-app-bar-large.scss +62 -0
- package/tokens/versions/v30_0/sass/_md-comp-top-app-bar-medium.scss +62 -0
- package/tokens/versions/v30_0/sass/_md-comp-top-app-bar-small-centered.scss +72 -0
- package/tokens/versions/v30_0/sass/_md-comp-top-app-bar-small.scss +70 -0
- package/tokens/versions/v30_0/sass/_md-ref-palette.scss +495 -0
- package/tokens/versions/v30_0/sass/_md-ref-typeface.scss +27 -0
- package/tokens/versions/v30_0/sass/_md-sys-color.scss +209 -0
- package/tokens/versions/v30_0/sass/_md-sys-color__dark.scss +209 -0
- package/tokens/versions/v30_0/sass/_md-sys-color__dark__high-contrast.scss +209 -0
- package/tokens/versions/v30_0/sass/_md-sys-color__dark__medium-contrast.scss +209 -0
- package/tokens/versions/v30_0/sass/_md-sys-color__high-contrast.scss +209 -0
- package/tokens/versions/v30_0/sass/_md-sys-color__medium-contrast.scss +209 -0
- package/tokens/versions/v30_0/sass/_md-sys-elevation.scss +35 -0
- package/tokens/versions/v30_0/sass/_md-sys-motion.scss +107 -0
- package/tokens/versions/v30_0/sass/_md-sys-shape.scss +67 -0
- package/tokens/versions/v30_0/sass/_md-sys-state-focus-indicator.scss +23 -0
- package/tokens/versions/v30_0/sass/_md-sys-state.scss +27 -0
- package/tokens/versions/v30_0/sass/_md-sys-typescale-emphasized.scss +559 -0
- package/tokens/versions/v30_0/sass/_md-sys-typescale.scss +571 -0
- package/typography/md-typescale-styles.d.ts +2 -0
- package/typography/md-typescale-styles.js +1 -0
- package/typography/md-typescale-styles.js.map +1 -1
- package/internal/controller/form-submitter.js +0 -69
- package/internal/controller/form-submitter.js.map +0 -1
- package/internal/sass/_string-ext.scss +0 -195
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2023 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { isServer } from 'lit';
|
|
7
|
-
import { internals, } from '../../labs/behaviors/element-internals.js';
|
|
8
|
-
/**
|
|
9
|
-
* Sets up an element's constructor to enable form submission. The element
|
|
10
|
-
* instance should be form associated and have a `type` property.
|
|
11
|
-
*
|
|
12
|
-
* A click listener is added to each element instance. If the click is not
|
|
13
|
-
* default prevented, it will submit the element's form, if any.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* class MyElement extends mixinElementInternals(LitElement) {
|
|
18
|
-
* static {
|
|
19
|
-
* setupFormSubmitter(MyElement);
|
|
20
|
-
* }
|
|
21
|
-
*
|
|
22
|
-
* static formAssociated = true;
|
|
23
|
-
*
|
|
24
|
-
* type: FormSubmitterType = 'submit';
|
|
25
|
-
* }
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* @param ctor The form submitter element's constructor.
|
|
29
|
-
*/
|
|
30
|
-
export function setupFormSubmitter(ctor) {
|
|
31
|
-
if (isServer) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
ctor.addInitializer((instance) => {
|
|
35
|
-
const submitter = instance;
|
|
36
|
-
submitter.addEventListener('click', async (event) => {
|
|
37
|
-
const { type, [internals]: elementInternals } = submitter;
|
|
38
|
-
const { form } = elementInternals;
|
|
39
|
-
if (!form || type === 'button') {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
// Wait a full task for event bubbling to complete.
|
|
43
|
-
await new Promise((resolve) => {
|
|
44
|
-
setTimeout(resolve);
|
|
45
|
-
});
|
|
46
|
-
if (event.defaultPrevented) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (type === 'reset') {
|
|
50
|
-
form.reset();
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
// form.requestSubmit(submitter) does not work with form associated custom
|
|
54
|
-
// elements. This patches the dispatched submit event to add the correct
|
|
55
|
-
// `submitter`.
|
|
56
|
-
// See https://github.com/WICG/webcomponents/issues/814
|
|
57
|
-
form.addEventListener('submit', (submitEvent) => {
|
|
58
|
-
Object.defineProperty(submitEvent, 'submitter', {
|
|
59
|
-
configurable: true,
|
|
60
|
-
enumerable: true,
|
|
61
|
-
get: () => submitter,
|
|
62
|
-
});
|
|
63
|
-
}, { capture: true, once: true });
|
|
64
|
-
elementInternals.setFormValue(submitter.value);
|
|
65
|
-
form.requestSubmit();
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=form-submitter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"form-submitter.js","sourceRoot":"","sources":["form-submitter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,QAAQ,EAAkB,MAAM,KAAK,CAAC;AAE9C,OAAO,EACL,SAAS,GAEV,MAAM,2CAA2C,CAAC;AAgDnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAA8B;IAC/D,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO;IACT,CAAC;IAEA,IAA0C,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE;QACtE,MAAM,SAAS,GAAG,QAAyB,CAAC;QAC5C,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAClD,MAAM,EAAC,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,gBAAgB,EAAC,GAAG,SAAS,CAAC;YACxD,MAAM,EAAC,IAAI,EAAC,GAAG,gBAAgB,CAAC;YAChC,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC/B,OAAO;YACT,CAAC;YAED,mDAAmD;YACnD,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;gBAClC,UAAU,CAAC,OAAO,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;YAEH,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;gBAC3B,OAAO;YACT,CAAC;YAED,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;gBACrB,IAAI,CAAC,KAAK,EAAE,CAAC;gBACb,OAAO;YACT,CAAC;YAED,0EAA0E;YAC1E,wEAAwE;YACxE,eAAe;YACf,uDAAuD;YACvD,IAAI,CAAC,gBAAgB,CACnB,QAAQ,EACR,CAAC,WAAW,EAAE,EAAE;gBACd,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE;oBAC9C,YAAY,EAAE,IAAI;oBAClB,UAAU,EAAE,IAAI;oBAChB,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS;iBACrB,CAAC,CAAC;YACL,CAAC,EACD,EAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAC5B,CAAC;YAEF,gBAAgB,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC/C,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {isServer, ReactiveElement} from 'lit';\n\nimport {\n internals,\n WithElementInternals,\n} from '../../labs/behaviors/element-internals.js';\n\n/**\n * A string indicating the form submission behavior of the element.\n *\n * - submit: The element submits the form. This is the default value if the\n * attribute is not specified, or if it is dynamically changed to an empty or\n * invalid value.\n * - reset: The element resets the form.\n * - button: The element does nothing.\n */\nexport type FormSubmitterType = 'button' | 'submit' | 'reset';\n\n/**\n * An element that can submit or reset a `<form>`, similar to\n * `<button type=\"submit\">`.\n */\nexport interface FormSubmitter extends ReactiveElement, WithElementInternals {\n /**\n * A string indicating the form submission behavior of the element.\n *\n * - submit: The element submits the form. This is the default value if the\n * attribute is not specified, or if it is dynamically changed to an empty or\n * invalid value.\n * - reset: The element resets the form.\n * - button: The element does nothing.\n */\n type: FormSubmitterType;\n\n /**\n * The HTML name to use in form submission. When combined with a `value`, the\n * submitting button's name/value will be added to the form.\n *\n * Names must reflect to a `name` attribute for form integration.\n */\n name: string;\n\n /**\n * The value of the button. When combined with a `name`, the submitting\n * button's name/value will be added to the form.\n */\n value: string;\n}\n\ntype FormSubmitterConstructor =\n | (new () => FormSubmitter)\n | (abstract new () => FormSubmitter);\n\n/**\n * Sets up an element's constructor to enable form submission. The element\n * instance should be form associated and have a `type` property.\n *\n * A click listener is added to each element instance. If the click is not\n * default prevented, it will submit the element's form, if any.\n *\n * @example\n * ```ts\n * class MyElement extends mixinElementInternals(LitElement) {\n * static {\n * setupFormSubmitter(MyElement);\n * }\n *\n * static formAssociated = true;\n *\n * type: FormSubmitterType = 'submit';\n * }\n * ```\n *\n * @param ctor The form submitter element's constructor.\n */\nexport function setupFormSubmitter(ctor: FormSubmitterConstructor) {\n if (isServer) {\n return;\n }\n\n (ctor as unknown as typeof ReactiveElement).addInitializer((instance) => {\n const submitter = instance as FormSubmitter;\n submitter.addEventListener('click', async (event) => {\n const {type, [internals]: elementInternals} = submitter;\n const {form} = elementInternals;\n if (!form || type === 'button') {\n return;\n }\n\n // Wait a full task for event bubbling to complete.\n await new Promise<void>((resolve) => {\n setTimeout(resolve);\n });\n\n if (event.defaultPrevented) {\n return;\n }\n\n if (type === 'reset') {\n form.reset();\n return;\n }\n\n // form.requestSubmit(submitter) does not work with form associated custom\n // elements. This patches the dispatched submit event to add the correct\n // `submitter`.\n // See https://github.com/WICG/webcomponents/issues/814\n form.addEventListener(\n 'submit',\n (submitEvent) => {\n Object.defineProperty(submitEvent, 'submitter', {\n configurable: true,\n enumerable: true,\n get: () => submitter,\n });\n },\n {capture: true, once: true},\n );\n\n elementInternals.setFormValue(submitter.value);\n form.requestSubmit();\n });\n });\n}\n"]}
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2021 Google LLC
|
|
3
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
// go/keep-sorted start
|
|
7
|
-
@use 'sass:list';
|
|
8
|
-
@use 'sass:string';
|
|
9
|
-
// go/keep-sorted end
|
|
10
|
-
|
|
11
|
-
/// Checks if a string starts with a given prefix.
|
|
12
|
-
///
|
|
13
|
-
/// @example - scss
|
|
14
|
-
/// @debug has-prefix('var(--foo)', 'var('); // true
|
|
15
|
-
///
|
|
16
|
-
/// @param {String} $string - The string to test.
|
|
17
|
-
/// @param {String} $prefix - The prefix to check.
|
|
18
|
-
/// @return {Boolean} True if the string starts with the given prefix.
|
|
19
|
-
@function has-prefix($string, $prefix) {
|
|
20
|
-
@return string.slice($string, 1, string.length($prefix)) == $prefix;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/// Checks if a string ends with a given suffix.
|
|
24
|
-
///
|
|
25
|
-
/// @example - scss
|
|
26
|
-
/// @debug has-suffix('var(--foo)', ')'); // true
|
|
27
|
-
///
|
|
28
|
-
/// @param {String} $string - The string to test.
|
|
29
|
-
/// @param {String} $suffix - The suffix to check.
|
|
30
|
-
/// @return {Boolean} True if the string ends with the given suffix.
|
|
31
|
-
@function has-suffix($string, $suffix) {
|
|
32
|
-
@return string.slice($string, -1 * string.length($suffix)) == $suffix;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/// Trims a repeating prefix from the start of a string.
|
|
36
|
-
///
|
|
37
|
-
/// @example - scss
|
|
38
|
-
/// @debug trim-repeating-prefix(' foo bar ', ' '); // "foo bar "
|
|
39
|
-
///
|
|
40
|
-
/// @param {String} $string - The string to trim.
|
|
41
|
-
/// @param {String} $prefix - The repeating prefix string to trim.
|
|
42
|
-
/// @return {String} The string with the prefix trimmed from the start.
|
|
43
|
-
@function trim-repeating-prefix($string, $prefix) {
|
|
44
|
-
@while has-prefix($string, $prefix) {
|
|
45
|
-
$string: trim-prefix($string, $prefix);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@return $string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/// Trims a prefix from the start of a string.
|
|
52
|
-
///
|
|
53
|
-
/// @example - scss
|
|
54
|
-
/// @debug trim-prefix('var(--foo)', 'var('); // "--foo)"
|
|
55
|
-
///
|
|
56
|
-
/// @param {String} $string - The string to trim.
|
|
57
|
-
/// @param {String} $prefix - The prefix string to trim.
|
|
58
|
-
/// @return {String} The string with the prefix trimmed from the start.
|
|
59
|
-
@function trim-prefix($string, $prefix) {
|
|
60
|
-
@if has-prefix($string, $prefix) {
|
|
61
|
-
$string: string.slice($string, string.length($prefix) + 1);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@return $string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/// Trims a repeating suffix from the end of a string.
|
|
68
|
-
///
|
|
69
|
-
/// @example - scss
|
|
70
|
-
/// @debug trim-repeating-suffix(' foo bar ', ' '); // " foo bar"
|
|
71
|
-
/// @debug trim-repeating-suffix('var(--foo)', ')'); // "var(--foo"
|
|
72
|
-
///
|
|
73
|
-
/// @param {String} $string - The string to trim.
|
|
74
|
-
/// @param {String} $suffix - The repeating suffix string to trim.
|
|
75
|
-
/// @return {String} The string with the suffix trimmed from the end.
|
|
76
|
-
@function trim-repeating-suffix($string, $suffix) {
|
|
77
|
-
@while has-suffix($string, $suffix) {
|
|
78
|
-
$string: trim-suffix($string, $suffix);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@return $string;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/// Trims a suffix from the end of a string.
|
|
85
|
-
///
|
|
86
|
-
/// @example - scss
|
|
87
|
-
/// @debug trim-suffix('var(--foo)', ')'); // "var(--foo"
|
|
88
|
-
///
|
|
89
|
-
/// @param {String} $string - The string to trim.
|
|
90
|
-
/// @param {String} $suffix - The suffix string to trim.
|
|
91
|
-
/// @return {String} The string with the suffix trimmed from the end.
|
|
92
|
-
@function trim-suffix($string, $suffix) {
|
|
93
|
-
@if has-suffix($string, $suffix) {
|
|
94
|
-
$string: string.slice($string, 1, -1 * string.length($suffix) - 1);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@return $string;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/// Trims a repeating prefix and suffix from the start and end of a string.
|
|
101
|
-
///
|
|
102
|
-
/// If a suffix is not provided, the prefix is used as the suffix to trim.
|
|
103
|
-
///
|
|
104
|
-
/// @example - scss
|
|
105
|
-
/// @debug trim-repeating(' foo bar ', ' '); // "foo bar"
|
|
106
|
-
///
|
|
107
|
-
/// @param {String} $string - The string to trim.
|
|
108
|
-
/// @param {String} $prefix - The repeating prefix string to trim.
|
|
109
|
-
/// @param {String} $suffix [$prefix] - The repeating suffix string to trim.
|
|
110
|
-
/// @return {String} The string with the prefix and suffix trimmed.
|
|
111
|
-
@function trim-repeating($string, $prefix, $suffix: $prefix) {
|
|
112
|
-
@return trim-repeating-prefix(
|
|
113
|
-
trim-repeating-suffix($string, $suffix),
|
|
114
|
-
$prefix
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/// Trims a prefix and suffix from the start and end of a string.
|
|
119
|
-
///
|
|
120
|
-
/// If a suffix is not provided, the prefix is used as the suffix to trim.
|
|
121
|
-
///
|
|
122
|
-
/// @example - scss
|
|
123
|
-
/// @debug trim('var(--foo)', 'var(', ')'); // "--foo"
|
|
124
|
-
///
|
|
125
|
-
/// @param {String} $string - The string to trim.
|
|
126
|
-
/// @param {String} $prefix - The prefix string to trim.
|
|
127
|
-
/// @param {String} $suffix [$prefix] - The suffix string to trim.
|
|
128
|
-
/// @return {String} The string with the prefix and suffix trimmed.
|
|
129
|
-
@function trim($string, $prefix, $suffix: $prefix) {
|
|
130
|
-
@return trim-prefix(trim-suffix($string, $suffix), $prefix);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/// Returns a new string with the first match of a pattern replaced by a
|
|
134
|
-
/// replacement.
|
|
135
|
-
///
|
|
136
|
-
/// @example - scss
|
|
137
|
-
/// @debug trim('foo bar baz', 'bar', 'quux'); // "foo quux baz"
|
|
138
|
-
///
|
|
139
|
-
/// @param {String} $string - The string to be searched.
|
|
140
|
-
/// @param {String} $pattern - The pattern to search for.
|
|
141
|
-
/// @param {String} $replacement - The value to replace the pattern.
|
|
142
|
-
/// @return {String} The string with the first match of pattern replaced by the
|
|
143
|
-
/// replacement or the initial string itself.
|
|
144
|
-
@function replace($string, $pattern, $replacement) {
|
|
145
|
-
$pattern-index: string.index($string, $pattern);
|
|
146
|
-
@if not $pattern-index {
|
|
147
|
-
@return $string;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
$before: string.slice($string, 1, $pattern-index - 1);
|
|
151
|
-
$after: string.slice($string, string.length($pattern) + $pattern-index);
|
|
152
|
-
|
|
153
|
-
@return $before + $replacement + $after;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/// Divides a string into an ordered list of substrings.
|
|
157
|
-
///
|
|
158
|
-
/// @example - scss
|
|
159
|
-
/// @debug split("1px 2px 3px 4px"); // (1px 2px 3px 4px)
|
|
160
|
-
/// @debug split("1px, 2px, 3px, 4px"); // (1px 2px 3px 4px)
|
|
161
|
-
/// @debug split("1px/2px/3px/4px"); // (1px 2px 3px 4px)
|
|
162
|
-
///
|
|
163
|
-
/// @param {String} $str - The string to split
|
|
164
|
-
/// @return {List} The list of substrings
|
|
165
|
-
@function split($str) {
|
|
166
|
-
$list: ();
|
|
167
|
-
$item: '';
|
|
168
|
-
// list separator precedence is comma, slash, space
|
|
169
|
-
$separator: ' ';
|
|
170
|
-
@if string.index($str, ',') {
|
|
171
|
-
$separator: ',';
|
|
172
|
-
} @else if string.index($str, '/') {
|
|
173
|
-
$separator: '/';
|
|
174
|
-
}
|
|
175
|
-
@for $i from 1 through string.length($str) {
|
|
176
|
-
$chr: string.slice($str, $i, $i);
|
|
177
|
-
@if $chr == $separator {
|
|
178
|
-
@if $item != '' {
|
|
179
|
-
// remove surrounding whitespace
|
|
180
|
-
$item: string.unquote(trim($item, ' '));
|
|
181
|
-
$list: list.append($list, $item);
|
|
182
|
-
}
|
|
183
|
-
$item: '';
|
|
184
|
-
} @else {
|
|
185
|
-
$item: $item + $chr;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
// append final item
|
|
189
|
-
@if $item != '' {
|
|
190
|
-
// remove surrounding whitespace
|
|
191
|
-
$item: string.unquote(trim($item, ' '));
|
|
192
|
-
$list: list.append($list, $item);
|
|
193
|
-
}
|
|
194
|
-
@return $list;
|
|
195
|
-
}
|