@shortfuse/materialdesignweb 0.2.0 → 0.5.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/.browserslistrc +2 -1
- package/.eslintrc.json +188 -30
- package/.stylelintrc.json +643 -2
- package/.vscode/launch.json +20 -5
- package/.vscode/settings.json +3 -0
- package/CHANGELOG.md +36 -0
- package/README.md +82 -2
- package/adapters/datatable/column.js +176 -0
- package/adapters/datatable/index.js +253 -437
- package/adapters/dom/index.js +586 -0
- package/adapters/list/index.js +36 -113
- package/adapters/search/index.js +153 -180
- package/components/appbar/_spec.scss +165 -0
- package/components/appbar/_theme.scss +0 -0
- package/components/appbar/index.scss +2 -0
- package/components/banner/_spec.scss +83 -0
- package/components/banner/_theme.scss +0 -0
- package/components/banner/index.scss +2 -0
- package/components/bottomnav/README.md +4 -4
- package/components/bottomnav/_spec.scss +149 -0
- package/components/bottomnav/_theme.scss +0 -0
- package/components/bottomnav/index.js +100 -120
- package/components/bottomnav/index.scss +2 -0
- package/components/bottomnav/item.js +88 -0
- package/components/button/README.md +16 -22
- package/components/button/_spec.scss +162 -0
- package/components/button/_theme.scss +42 -0
- package/components/button/index.eta +32 -0
- package/components/button/index.js +37 -48
- package/components/button/index.pug +18 -0
- package/components/button/index.scss +2 -0
- package/components/card/_spec.scss +241 -0
- package/components/card/_theme.scss +0 -0
- package/components/card/index.scss +2 -0
- package/components/chip/_spec.scss +111 -0
- package/components/chip/_theme.scss +105 -0
- package/components/chip/index.js +23 -0
- package/components/chip/index.scss +2 -0
- package/components/chip/item.js +20 -0
- package/components/datatable/_spec.scss +225 -0
- package/components/datatable/_theme.scss +128 -0
- package/components/datatable/cell.js +44 -0
- package/components/datatable/columnheader.js +46 -0
- package/components/datatable/index.js +339 -443
- package/components/datatable/index.scss +2 -0
- package/components/datatable/row.js +48 -0
- package/components/datatable/rowheader.js +18 -0
- package/components/dialog/_spec.scss +203 -0
- package/components/dialog/_theme.scss +7 -0
- package/components/dialog/index.js +512 -437
- package/components/dialog/index.scss +2 -0
- package/components/divider/_spec.scss +11 -0
- package/components/divider/_theme.scss +0 -0
- package/components/divider/index.scss +2 -0
- package/components/elevation/_spec.scss +9 -0
- package/components/elevation/_theme.scss +0 -0
- package/components/elevation/index.scss +2 -0
- package/components/fab/{style.scss → _spec.scss} +104 -79
- package/components/fab/_theme.scss +0 -0
- package/components/fab/index.js +85 -79
- package/components/fab/index.scss +2 -0
- package/components/grid/_spec.scss +169 -0
- package/components/grid/_theme.scss +0 -0
- package/components/grid/index.scss +2 -0
- package/components/layout/_mixins.scss +11 -0
- package/components/layout/_spec.scss +916 -0
- package/components/layout/_theme.scss +19 -0
- package/components/layout/index.js +454 -0
- package/components/layout/index.scss +2 -0
- package/components/list/_spec.scss +363 -0
- package/components/list/_theme.scss +102 -0
- package/components/list/content.js +106 -0
- package/components/list/index.js +234 -79
- package/components/list/index.scss +2 -0
- package/components/list/item.js +167 -0
- package/components/list/secondary.js +45 -0
- package/components/menu/_spec.scss +329 -0
- package/components/menu/_theme.scss +0 -0
- package/components/menu/index.js +636 -651
- package/components/menu/index.scss +2 -0
- package/components/menu/item.js +231 -0
- package/components/progress/_spec.scss +156 -0
- package/components/progress/_theme.scss +0 -0
- package/components/progress/index.js +29 -13
- package/components/progress/index.scss +2 -0
- package/components/selection/_spec.scss +376 -0
- package/components/selection/_theme.scss +134 -0
- package/components/selection/index.eta +60 -0
- package/components/selection/index.js +70 -0
- package/components/selection/index.pug +30 -0
- package/components/selection/index.scss +2 -0
- package/components/selection/input.js +54 -0
- package/components/selection/radiogroup.js +40 -0
- package/components/slider/{style.scss → _spec.scss} +31 -34
- package/components/slider/_theme.scss +0 -0
- package/components/slider/index.scss +2 -0
- package/components/snackbar/_spec.scss +150 -0
- package/components/snackbar/_theme.scss +0 -0
- package/components/snackbar/index.js +293 -206
- package/components/snackbar/index.scss +2 -0
- package/components/tab/_spec.scss +220 -0
- package/components/tab/_theme.scss +0 -0
- package/components/tab/content.js +210 -0
- package/components/tab/index.js +229 -213
- package/components/tab/index.scss +2 -0
- package/components/tab/item.js +88 -0
- package/components/tab/list.js +196 -0
- package/components/tab/panel.js +54 -0
- package/components/textfield/README.md +4 -4
- package/components/textfield/_spec.scss +763 -0
- package/components/textfield/_theme.scss +264 -0
- package/components/textfield/index.eta +74 -0
- package/components/textfield/index.js +132 -138
- package/components/textfield/index.pug +30 -0
- package/components/textfield/index.scss +2 -0
- package/components/tooltip/_spec.scss +185 -0
- package/components/tooltip/_theme.scss +0 -0
- package/components/tooltip/index.scss +2 -0
- package/components/type/_spec.scss +227 -0
- package/components/type/_theme.scss +0 -0
- package/components/type/index.scss +2 -0
- package/core/_breakpoint.scss +189 -0
- package/core/_elevation.scss +78 -0
- package/core/_length.scss +8 -0
- package/core/_motion.scss +31 -0
- package/core/_platform.scss +12 -0
- package/core/_type.scss +128 -0
- package/core/aria/attributes.js +141 -0
- package/core/aria/button.js +49 -0
- package/core/aria/keyboard.js +92 -0
- package/core/aria/rovingtabindex.js +175 -0
- package/core/aria/tab.js +59 -0
- package/core/document/index.js +39 -0
- package/core/dom.js +180 -0
- package/core/overlay/_spec.scss +28 -0
- package/core/overlay/_theme.scss +147 -0
- package/core/overlay/index.js +95 -0
- package/core/overlay/index.scss +2 -0
- package/core/ripple/_spec.scss +196 -0
- package/core/ripple/_theme.scss +20 -0
- package/core/ripple/index.js +286 -0
- package/core/ripple/index.scss +2 -0
- package/core/theme/_aliases.scss +15 -0
- package/core/theme/_config.scss +8 -0
- package/core/theme/_functions.scss +22 -0
- package/{components/theming/palettes.scss → core/theme/_palettes.scss} +173 -151
- package/core/theme/_spec.scss +0 -0
- package/core/theme/_theme.scss +268 -0
- package/core/theme/index.js +50 -0
- package/core/theme/index.scss +4 -0
- package/core/throttler.js +42 -0
- package/core/transition/index.js +465 -0
- package/docs/_flex.scss +28 -0
- package/docs/_menuoptions.js +183 -0
- package/docs/_partials/_androidnavbar.eta +5 -0
- package/docs/_partials/_androidstatusbar.eta +13 -0
- package/docs/_partials/_appbar.eta +27 -0
- package/docs/_partials/_buttontest.eta +31 -0
- package/docs/_partials/_header.eta +146 -0
- package/docs/_partials/_navlistitem.eta +16 -0
- package/docs/_partials/_target.eta +1 -0
- package/docs/_sample-utils.js +88 -0
- package/docs/{src/storage.js → _storage.js} +0 -0
- package/docs/docs.scss +331 -0
- package/docs/framework.scss +26 -0
- package/docs/index.eta +12 -0
- package/docs/index.js +7 -0
- package/docs/pages/appbar.eta +108 -0
- package/docs/pages/appbar.js +0 -0
- package/docs/pages/bottomnav.eta +188 -0
- package/docs/pages/bottomnav.js +118 -0
- package/docs/pages/button.eta +124 -0
- package/docs/pages/button.js +224 -0
- package/docs/pages/card.eta +90 -0
- package/docs/pages/card.js +175 -0
- package/docs/pages/chip.eta +122 -0
- package/docs/pages/chip.js +80 -0
- package/docs/pages/color.eta +143 -0
- package/docs/pages/color.js +261 -0
- package/docs/pages/datatable.eta +323 -0
- package/docs/pages/datatable.js +160 -0
- package/docs/pages/dialog.eta +184 -0
- package/docs/{src/components → pages}/dialog.js +35 -48
- package/docs/pages/dom.eta +26 -0
- package/docs/pages/dom.js +140 -0
- package/docs/pages/elevation.eta +35 -0
- package/docs/pages/elevation.js +0 -0
- package/docs/pages/fab.eta +99 -0
- package/docs/{src/components → pages}/fab.js +6 -13
- package/docs/pages/grid.eta +135 -0
- package/docs/pages/grid.js +128 -0
- package/docs/pages/layout.eta +8 -0
- package/docs/pages/layout.js +0 -0
- package/docs/pages/list.eta +465 -0
- package/docs/pages/list.js +8 -0
- package/docs/pages/menu.eta +274 -0
- package/docs/{src/components → pages}/menu.js +26 -42
- package/docs/pages/overlay.eta +69 -0
- package/docs/pages/overlay.js +3 -0
- package/docs/pages/progress.eta +23 -0
- package/docs/{src/components → pages}/progress.js +2 -4
- package/docs/pages/ripple.eta +27 -0
- package/docs/pages/ripple.js +3 -0
- package/docs/pages/search.eta +242 -0
- package/docs/pages/search.js +226 -0
- package/docs/pages/selection.eta +107 -0
- package/docs/pages/selection.js +12 -0
- package/docs/pages/slider.eta +23 -0
- package/docs/pages/slider.js +0 -0
- package/docs/pages/snackbar.eta +83 -0
- package/docs/{src/components → pages}/snackbar.js +31 -36
- package/docs/pages/tab.eta +407 -0
- package/docs/pages/tab.js +152 -0
- package/docs/pages/textfield.eta +487 -0
- package/docs/{src/components → pages}/textfield.js +41 -45
- package/docs/pages/tooltip.eta +92 -0
- package/docs/pages/tooltip.js +0 -0
- package/docs/pages/transition.eta +117 -0
- package/docs/pages/transition.js +52 -0
- package/docs/pages/type.eta +31 -0
- package/docs/pages/type.js +0 -0
- package/docs/postrender.js +41 -0
- package/docs/prerender.js +16 -0
- package/docs/pwa/_dialogs.eta +143 -0
- package/docs/pwa/_menus.eta +16 -0
- package/docs/pwa/pwa-prerender.js +3 -0
- package/docs/pwa/pwa.eta +478 -0
- package/docs/pwa/pwa.js +298 -0
- package/docs/pwa/pwa.scss +31 -0
- package/docs/themes/theme-colored.scss +15 -0
- package/docs/themes/theme-default.scss +3 -0
- package/index.scss +27 -0
- package/jsconfig.json +8 -2
- package/package.json +54 -27
- package/scripts/deploy-docs.sh +9 -0
- package/templates/index.eta +2 -0
- package/templates/index.pug +3 -0
- package/tsconfig.json +16 -0
- package/utils/function.js +3 -0
- package/webpack.config.js +224 -68
- package/_index.scss +0 -4
- package/components/all-components.scss +0 -21
- package/components/bottomnav/style.scss +0 -190
- package/components/bottomnav/theming.scss +0 -76
- package/components/button/style.scss +0 -315
- package/components/button/theming.scss +0 -134
- package/components/card/style.scss +0 -175
- package/components/card/theming.scss +0 -43
- package/components/common/dom.js +0 -51
- package/components/common/functions.scss +0 -174
- package/components/common/mixins.scss +0 -122
- package/components/common/motion.scss +0 -36
- package/components/common/type.scss +0 -104
- package/components/common/variables.scss +0 -46
- package/components/datatable/style.scss +0 -257
- package/components/datatable/theming.scss +0 -119
- package/components/dialog/style.scss +0 -159
- package/components/dialog/theming.scss +0 -29
- package/components/divider/style.scss +0 -7
- package/components/divider/theming.scss +0 -20
- package/components/elevation/style.scss +0 -32
- package/components/layout/style.scss +0 -223
- package/components/list/style.scss +0 -358
- package/components/list/theming.scss +0 -83
- package/components/menu/style.scss +0 -280
- package/components/menu/theming.scss +0 -80
- package/components/navdrawer/index.js +0 -200
- package/components/navdrawer/style.scss +0 -595
- package/components/navdrawer/theming.scss +0 -62
- package/components/progress/style.scss +0 -136
- package/components/ripple/index.js +0 -63
- package/components/ripple/ripple.scss +0 -122
- package/components/selection/style.scss +0 -320
- package/components/selection/theming.scss +0 -98
- package/components/snackbar/style.scss +0 -212
- package/components/switch/style.scss +0 -3
- package/components/tab/style.scss +0 -275
- package/components/tab/theming.scss +0 -34
- package/components/template/theming.scss +0 -31
- package/components/textfield/style.scss +0 -795
- package/components/textfield/theming.scss +0 -256
- package/components/theming/globals.scss +0 -25
- package/components/theming/theming.scss +0 -559
- package/components/toolbar/style.scss +0 -190
- package/components/toolbar/theming.scss +0 -32
- package/components/tooltip/style.scss +0 -135
- package/components/type/style.scss +0 -167
- package/components/type/theming.scss +0 -25
- package/docs/bottomnav.html +0 -1
- package/docs/bottomnav.min.js +0 -2
- package/docs/bottomnav.min.js.map +0 -1
- package/docs/button.html +0 -1
- package/docs/button.min.js +0 -2
- package/docs/button.min.js.map +0 -1
- package/docs/card.html +0 -1
- package/docs/card.min.js +0 -2
- package/docs/card.min.js.map +0 -1
- package/docs/components.min.css +0 -1
- package/docs/components.min.js +0 -2
- package/docs/components.min.js.map +0 -1
- package/docs/datatable.html +0 -1
- package/docs/datatable.min.js +0 -2
- package/docs/datatable.min.js.map +0 -1
- package/docs/dialog.html +0 -1
- package/docs/dialog.min.js +0 -2
- package/docs/dialog.min.js.map +0 -1
- package/docs/docs.min.css +0 -1
- package/docs/docs.min.js +0 -2
- package/docs/docs.min.js.map +0 -1
- package/docs/elevation.html +0 -1
- package/docs/elevation.min.js +0 -2
- package/docs/elevation.min.js.map +0 -1
- package/docs/fab.html +0 -1
- package/docs/fab.min.js +0 -2
- package/docs/fab.min.js.map +0 -1
- package/docs/index.html +0 -1
- package/docs/index.min.js +0 -2
- package/docs/index.min.js.map +0 -1
- package/docs/layout.html +0 -1
- package/docs/layout.min.js +0 -2
- package/docs/layout.min.js.map +0 -1
- package/docs/list.html +0 -1
- package/docs/list.min.js +0 -2
- package/docs/list.min.js.map +0 -1
- package/docs/menu.html +0 -1
- package/docs/menu.min.js +0 -2
- package/docs/menu.min.js.map +0 -1
- package/docs/navdrawer.html +0 -1
- package/docs/navdrawer.min.js +0 -2
- package/docs/navdrawer.min.js.map +0 -1
- package/docs/prerender.min.js +0 -2
- package/docs/prerender.min.js.map +0 -1
- package/docs/progress.html +0 -1
- package/docs/progress.min.js +0 -2
- package/docs/progress.min.js.map +0 -1
- package/docs/search.html +0 -1
- package/docs/search.min.js +0 -2
- package/docs/search.min.js.map +0 -1
- package/docs/selection.html +0 -1
- package/docs/selection.min.js +0 -2
- package/docs/selection.min.js.map +0 -1
- package/docs/slider.html +0 -1
- package/docs/slider.min.js +0 -2
- package/docs/slider.min.js.map +0 -1
- package/docs/snackbar.html +0 -1
- package/docs/snackbar.min.js +0 -2
- package/docs/snackbar.min.js.map +0 -1
- package/docs/src/components/bottomnav.js +0 -16
- package/docs/src/components/bottomnav.pug +0 -112
- package/docs/src/components/button.js +0 -156
- package/docs/src/components/button.pug +0 -194
- package/docs/src/components/card.js +0 -136
- package/docs/src/components/card.pug +0 -133
- package/docs/src/components/datatable.js +0 -183
- package/docs/src/components/datatable.pug +0 -324
- package/docs/src/components/dialog.pug +0 -138
- package/docs/src/components/elevation.js +0 -3
- package/docs/src/components/elevation.pug +0 -17
- package/docs/src/components/fab.pug +0 -84
- package/docs/src/components/layout.js +0 -116
- package/docs/src/components/layout.pug +0 -104
- package/docs/src/components/list.js +0 -15
- package/docs/src/components/list.pug +0 -293
- package/docs/src/components/menu.pug +0 -292
- package/docs/src/components/navdrawer.js +0 -112
- package/docs/src/components/navdrawer.pug +0 -113
- package/docs/src/components/progress.pug +0 -17
- package/docs/src/components/search.js +0 -206
- package/docs/src/components/search.pug +0 -149
- package/docs/src/components/selection.js +0 -6
- package/docs/src/components/selection.pug +0 -116
- package/docs/src/components/slider.js +0 -3
- package/docs/src/components/slider.pug +0 -19
- package/docs/src/components/snackbar.pug +0 -145
- package/docs/src/components/tab.js +0 -137
- package/docs/src/components/tab.pug +0 -329
- package/docs/src/components/textfield.pug +0 -416
- package/docs/src/components/toolbar.js +0 -6
- package/docs/src/components/toolbar.pug +0 -86
- package/docs/src/components/tooltip.js +0 -6
- package/docs/src/components/tooltip.pug +0 -76
- package/docs/src/components/type.js +0 -6
- package/docs/src/components/type.pug +0 -34
- package/docs/src/components.scss +0 -1
- package/docs/src/docs.scss +0 -284
- package/docs/src/index.js +0 -3
- package/docs/src/index.pug +0 -6
- package/docs/src/menuoptions.js +0 -136
- package/docs/src/mixins.pug +0 -139
- package/docs/src/prerender.js +0 -26
- package/docs/src/sample-utils.js +0 -108
- package/docs/src/targetHandler.js +0 -50
- package/docs/src/theming.ie11.scss +0 -18
- package/docs/src/theming.scss +0 -18
- package/docs/tab.html +0 -1
- package/docs/tab.min.js +0 -2
- package/docs/tab.min.js.map +0 -1
- package/docs/textfield.html +0 -2
- package/docs/textfield.min.js +0 -2
- package/docs/textfield.min.js.map +0 -1
- package/docs/theming.ie11.min.css +0 -1
- package/docs/theming.ie11.min.js +0 -2
- package/docs/theming.ie11.min.js.map +0 -1
- package/docs/theming.min.css +0 -1
- package/docs/theming.min.js +0 -2
- package/docs/theming.min.js.map +0 -1
- package/docs/toolbar.html +0 -1
- package/docs/toolbar.min.js +0 -2
- package/docs/toolbar.min.js.map +0 -1
- package/docs/tooltip.html +0 -1
- package/docs/tooltip.min.js +0 -2
- package/docs/tooltip.min.js.map +0 -1
- package/docs/type.html +0 -1
- package/docs/type.min.js +0 -2
- package/docs/type.min.js.map +0 -1
- package/index.js +0 -16
|
@@ -0,0 +1,763 @@
|
|
|
1
|
+
// https://material.io/design/components/text-fields.html
|
|
2
|
+
// https://material.io/archive/guidelines/components/text-fields.html
|
|
3
|
+
|
|
4
|
+
@use '../../core/_elevation.scss' as elevation;
|
|
5
|
+
@use '../../core/_length.scss' as *;
|
|
6
|
+
@use '../../core/_motion.scss' as motion;
|
|
7
|
+
@use '../../core/_platform.scss' as platform;
|
|
8
|
+
@use '../../core/_type.scss' as type;
|
|
9
|
+
|
|
10
|
+
$border-line-height: 1px !default;
|
|
11
|
+
$border-line-height__focused: 2px !default;
|
|
12
|
+
|
|
13
|
+
$textarea-padding-horizontal: 16px !default;
|
|
14
|
+
$outline-start-width: 10px !default;
|
|
15
|
+
$outline-end-width: 8px !default;
|
|
16
|
+
|
|
17
|
+
$input-top-alignment: calc(#{dp(8 + 4)} + #{sp(12)} + 0.125em) !default; // Extra 1/8em for font alignment
|
|
18
|
+
$input-bottom-alignment: 8px !default;
|
|
19
|
+
$input-dense-reduction: 8px !default;
|
|
20
|
+
$input-top-alignment-dense: calc(#{dp(8 + 2)} + #{sp(12)} + 0.125em) !default;
|
|
21
|
+
$input-bottom-alignment-dense: 4px !default;
|
|
22
|
+
|
|
23
|
+
// CSS Grid Layout
|
|
24
|
+
// 1 | 2 | 3 | 4 | 5 | 6 | 7
|
|
25
|
+
// -------------------------------------------------------------
|
|
26
|
+
// 1: Gap | | Label ----------------------------------- | Gap
|
|
27
|
+
// 1: Gap | Icon | Prefix | Input | Dropdown Button | Suffix | Gap
|
|
28
|
+
// 1: Border -----------------------------------------------------
|
|
29
|
+
// 2: Gap | | Helper/Error | Gap
|
|
30
|
+
// 2: Dropdown ---------------------------------------------------
|
|
31
|
+
|
|
32
|
+
.mdw-textfield {
|
|
33
|
+
display: grid;
|
|
34
|
+
position: relative;
|
|
35
|
+
align-items: baseline;
|
|
36
|
+
grid-template-columns: 12px auto auto 1fr auto auto 8px;
|
|
37
|
+
grid-template-rows: auto auto;
|
|
38
|
+
|
|
39
|
+
padding: 8px 0;
|
|
40
|
+
|
|
41
|
+
transition-duration: motion.$simpleDuration;
|
|
42
|
+
transition-timing-function: motion.$standardEasing;
|
|
43
|
+
|
|
44
|
+
&[mdw-solo],
|
|
45
|
+
&[mdw-solo][mdw-dense] {
|
|
46
|
+
grid-template-columns: 0 auto auto 1fr auto auto 0;
|
|
47
|
+
|
|
48
|
+
padding: 0;
|
|
49
|
+
|
|
50
|
+
.mdw-textfield__input {
|
|
51
|
+
align-self: center;
|
|
52
|
+
|
|
53
|
+
margin: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.mdw-textfield__border {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:not([mdw-solo]) {
|
|
62
|
+
@include type.addRules('subtitle');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.mdw-textfield::before {
|
|
67
|
+
// 8dp margin
|
|
68
|
+
// 12sp label
|
|
69
|
+
// 4dp margin
|
|
70
|
+
// 1em input
|
|
71
|
+
// 16dp margin
|
|
72
|
+
// = 56dp at 16sp
|
|
73
|
+
|
|
74
|
+
content: "";
|
|
75
|
+
|
|
76
|
+
display: inline-block;
|
|
77
|
+
|
|
78
|
+
grid-column: 4;
|
|
79
|
+
grid-row: 1;
|
|
80
|
+
|
|
81
|
+
box-sizing: content-box; // Don't allow global override
|
|
82
|
+
block-size: 1em;
|
|
83
|
+
margin-block: dp(8 + 4) 16px;
|
|
84
|
+
padding-block-start: sp(12);
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.mdw-textfield[mdw-dense]::before {
|
|
89
|
+
margin-block: 8px 12px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.mdw-textfield[mdw-solo],
|
|
93
|
+
.mdw-textfield[mdw-solo][mdw-dense],
|
|
94
|
+
.mdw-textfield[mdw-outlined] {
|
|
95
|
+
.mdw-textfield__prefix,
|
|
96
|
+
.mdw-textfield__suffix,
|
|
97
|
+
.mdw-textfield__icon {
|
|
98
|
+
align-self: center;
|
|
99
|
+
|
|
100
|
+
margin-block: 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
textarea.mdw-textfield__input {
|
|
104
|
+
& ~ .mdw-textfield__prefix,
|
|
105
|
+
& ~ .mdw-textfield__suffix {
|
|
106
|
+
align-self: flex-start;
|
|
107
|
+
|
|
108
|
+
margin-block: 0;
|
|
109
|
+
|
|
110
|
+
transform: translateY(calc((8px + sp(12) + 4px + 1em + 16px) * 0.5)) translateY(-50%);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.mdw-textfield__prefix,
|
|
116
|
+
.mdw-textfield__suffix {
|
|
117
|
+
grid-row: 1;
|
|
118
|
+
|
|
119
|
+
pointer-events: none;
|
|
120
|
+
|
|
121
|
+
transition-duration: motion.$simpleDuration;
|
|
122
|
+
transition-property: color;
|
|
123
|
+
transition-timing-function: motion.$standardEasing;
|
|
124
|
+
will-change: color;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.mdw-textfield__prefix {
|
|
128
|
+
grid-column: 3;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.mdw-textfield__suffix {
|
|
132
|
+
grid-column: 6;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.mdw-textfield__prefix::after,
|
|
136
|
+
.mdw-textfield__suffix::before {
|
|
137
|
+
content: "";
|
|
138
|
+
|
|
139
|
+
display: inline-block;
|
|
140
|
+
|
|
141
|
+
inline-size: 4px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.mdw-textfield__outline-gap {
|
|
145
|
+
// Using transform would create a new composition layer and cause subpixel rendering issues
|
|
146
|
+
position: absolute;
|
|
147
|
+
inset-block: $border-line-height__focused 0;
|
|
148
|
+
inset-inline: dp(12);
|
|
149
|
+
|
|
150
|
+
grid-column: 2;
|
|
151
|
+
grid-row: 1;
|
|
152
|
+
|
|
153
|
+
margin-block: -$border-line-height__focused #{-$border-line-height};
|
|
154
|
+
|
|
155
|
+
.mdw-textfield[mdw-outlined] & {
|
|
156
|
+
position: relative;
|
|
157
|
+
inset: auto;
|
|
158
|
+
|
|
159
|
+
max-inline-size: calc(100% - 24px);
|
|
160
|
+
margin-block: -$border-line-height;
|
|
161
|
+
|
|
162
|
+
color: inherit;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&::before,
|
|
166
|
+
&::after {
|
|
167
|
+
content: none;
|
|
168
|
+
|
|
169
|
+
position: absolute;
|
|
170
|
+
inset-block-start: 0;
|
|
171
|
+
|
|
172
|
+
border-block-start-style: solid;
|
|
173
|
+
border-block-start-width: $border-line-height;
|
|
174
|
+
|
|
175
|
+
transition-delay: 1ms;
|
|
176
|
+
transition-duration: motion.$simpleDuration * 0.5;
|
|
177
|
+
transition-property: left, right;
|
|
178
|
+
transition-timing-function: motion.$standardEasing;
|
|
179
|
+
|
|
180
|
+
border-color: inherit;
|
|
181
|
+
|
|
182
|
+
.mdw-textfield[mdw-outlined] & {
|
|
183
|
+
content: "";
|
|
184
|
+
|
|
185
|
+
// Height must exactly match parent to avoid subpixel rendering issues
|
|
186
|
+
inset-block-end: 0;
|
|
187
|
+
|
|
188
|
+
border-block-start-style: solid;
|
|
189
|
+
border-block-end-style: solid;
|
|
190
|
+
|
|
191
|
+
&:not(:focus) {
|
|
192
|
+
border-style: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
border-block-start-color: currentColor;
|
|
196
|
+
border-block-end-color: transparent;
|
|
197
|
+
border-radius: 0;
|
|
198
|
+
color: inherit;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.mdw-textfield__border {
|
|
204
|
+
display: flex;
|
|
205
|
+
position: relative;
|
|
206
|
+
align-self: stretch;
|
|
207
|
+
grid-column-start: 1;
|
|
208
|
+
grid-column-end: span 7;
|
|
209
|
+
grid-row: 1;
|
|
210
|
+
|
|
211
|
+
box-sizing: border-box;
|
|
212
|
+
min-inline-size: 100%; // Fixes FireFox Grid bug
|
|
213
|
+
border-block-start-style: none;
|
|
214
|
+
border-block-end-style: solid;
|
|
215
|
+
border-width: $border-line-height;
|
|
216
|
+
border-start-start-radius: 4px;
|
|
217
|
+
border-start-end-radius: 4px;
|
|
218
|
+
border-end-start-radius: 0;
|
|
219
|
+
border-end-end-radius: 0;
|
|
220
|
+
border-inline-start-style: none;
|
|
221
|
+
border-inline-end-style: none;
|
|
222
|
+
|
|
223
|
+
cursor: pointer;
|
|
224
|
+
-webkit-tap-highlight-color: transparent;
|
|
225
|
+
|
|
226
|
+
transition-delay: 1ms;
|
|
227
|
+
transition-duration: motion.$simpleDuration;
|
|
228
|
+
transition-property: color, border-color;
|
|
229
|
+
transition-timing-function: motion.$standardEasing;
|
|
230
|
+
|
|
231
|
+
border-block-start-color: transparent;
|
|
232
|
+
border-block-end-color: currentColor;
|
|
233
|
+
border-inline-start-color: transparent;
|
|
234
|
+
border-inline-end-color: transparent;
|
|
235
|
+
|
|
236
|
+
.mdw-textfield[mdw-outlined] & {
|
|
237
|
+
border-block-start-style: solid;
|
|
238
|
+
border-block-end-style: solid;
|
|
239
|
+
border-end-start-radius: 4px;
|
|
240
|
+
|
|
241
|
+
border-end-end-radius: 4px;
|
|
242
|
+
border-inline-start-style: solid;
|
|
243
|
+
border-inline-end-style: solid;
|
|
244
|
+
|
|
245
|
+
transition: none;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.mdw-textfield__input:focus ~ & {
|
|
249
|
+
pointer-events: none;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.mdw-textfield__input:disabled ~ & {
|
|
253
|
+
cursor: not-allowed;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
&::before,
|
|
257
|
+
&::after {
|
|
258
|
+
content: "";
|
|
259
|
+
|
|
260
|
+
position: absolute;
|
|
261
|
+
inset-block-end: -$border-line-height__focused;
|
|
262
|
+
inset-inline: 0;
|
|
263
|
+
|
|
264
|
+
block-size: 100%;
|
|
265
|
+
border-block-end-style: solid;
|
|
266
|
+
border-width: $border-line-height__focused;
|
|
267
|
+
|
|
268
|
+
transition-delay: 1ms;
|
|
269
|
+
transition-duration: motion.$collapseDuration;
|
|
270
|
+
transition-property: transform;
|
|
271
|
+
transition-timing-function: motion.$accelerateEasing;
|
|
272
|
+
will-change: transform;
|
|
273
|
+
|
|
274
|
+
transform: scaleX(0) translateY(-$border-line-height * 0.5);
|
|
275
|
+
|
|
276
|
+
border-radius: inherit;
|
|
277
|
+
color: transparent;
|
|
278
|
+
|
|
279
|
+
.mdw-textfield[mdw-outlined] & {
|
|
280
|
+
content: "";
|
|
281
|
+
|
|
282
|
+
position: relative;
|
|
283
|
+
inset: auto;
|
|
284
|
+
|
|
285
|
+
transition: none;
|
|
286
|
+
will-change: auto;
|
|
287
|
+
|
|
288
|
+
transform: none;
|
|
289
|
+
|
|
290
|
+
color: inherit;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.mdw-textfield[mdw-outlined] &::after {
|
|
295
|
+
flex-grow: 1;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.mdw-textfield[mdw-outlined] &::before {
|
|
299
|
+
min-inline-size: $outline-start-width - $border-line-height;
|
|
300
|
+
margin-block-start: -$border-line-height;
|
|
301
|
+
margin-inline: -$border-line-height 0;
|
|
302
|
+
border-block-start-style: solid;
|
|
303
|
+
border-block-end-style: solid;
|
|
304
|
+
border-width: inherit;
|
|
305
|
+
border-start-start-radius: inherit;
|
|
306
|
+
border-start-end-radius: 0;
|
|
307
|
+
border-end-start-radius: inherit;
|
|
308
|
+
border-end-end-radius: 0;
|
|
309
|
+
border-inline-start-style: solid;
|
|
310
|
+
border-inline-end-style: none;
|
|
311
|
+
|
|
312
|
+
border-block-start-color: currentColor;
|
|
313
|
+
border-block-end-color: transparent;
|
|
314
|
+
border-inline-start-color: currentColor;
|
|
315
|
+
border-inline-end-color: transparent;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.mdw-textfield[mdw-outlined] &::after {
|
|
319
|
+
min-inline-size: $outline-end-width - $border-line-height;
|
|
320
|
+
margin-block-start: -$border-line-height;
|
|
321
|
+
margin-inline: 0 #{-$border-line-height};
|
|
322
|
+
border-block-start-style: solid;
|
|
323
|
+
border-block-end-style: solid;
|
|
324
|
+
border-width: inherit;
|
|
325
|
+
border-start-start-radius: 0;
|
|
326
|
+
border-start-end-radius: inherit;
|
|
327
|
+
border-end-start-radius: 0;
|
|
328
|
+
border-end-end-radius: inherit;
|
|
329
|
+
border-inline-start-style: none;
|
|
330
|
+
border-inline-end-style: solid;
|
|
331
|
+
|
|
332
|
+
border-block-start-color: currentColor;
|
|
333
|
+
border-block-end-color: transparent;
|
|
334
|
+
border-inline-start-color: transparent;
|
|
335
|
+
border-inline-end-color: currentColor;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.mdw-textfield__label {
|
|
340
|
+
position: absolute;
|
|
341
|
+
inset-inline: 0;
|
|
342
|
+
align-self: flex-start;
|
|
343
|
+
overflow-x: hidden;
|
|
344
|
+
overflow-y: hidden;
|
|
345
|
+
|
|
346
|
+
margin: 0;
|
|
347
|
+
padding: 0;
|
|
348
|
+
|
|
349
|
+
pointer-events: none; // allow clickthrough
|
|
350
|
+
|
|
351
|
+
transition-duration: motion.$shapeChangeDuration;
|
|
352
|
+
transition-property: top, transform, font-size;
|
|
353
|
+
transition-timing-function: motion.$standardEasing;
|
|
354
|
+
will-change: top, transform, font-size;
|
|
355
|
+
|
|
356
|
+
text-overflow: ellipsis;
|
|
357
|
+
white-space: nowrap;
|
|
358
|
+
|
|
359
|
+
.mdw-textfield[mdw-outlined] & {
|
|
360
|
+
position: relative; // reflow DOM
|
|
361
|
+
|
|
362
|
+
padding: 0 4px;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
&::before {
|
|
366
|
+
// Add upper 8dp from text-top to top for positioning
|
|
367
|
+
// Add lower 8dp from baseline to keep vertically centered
|
|
368
|
+
@include type.addRules('caption');
|
|
369
|
+
content: "";
|
|
370
|
+
|
|
371
|
+
display: inline-block;
|
|
372
|
+
vertical-align: -8px;
|
|
373
|
+
|
|
374
|
+
box-sizing: content-box; // Don't allow global override
|
|
375
|
+
block-size: 1em;
|
|
376
|
+
margin-block-start: 8px;
|
|
377
|
+
padding-block-start: 8px;
|
|
378
|
+
|
|
379
|
+
.mdw-textfield[mdw-outlined] & {
|
|
380
|
+
content: none;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.mdw-textfield__signifier {
|
|
386
|
+
align-self: center;
|
|
387
|
+
grid-column: 2;
|
|
388
|
+
grid-row: 1;
|
|
389
|
+
|
|
390
|
+
margin-block: 8px;
|
|
391
|
+
|
|
392
|
+
&::after {
|
|
393
|
+
content: "";
|
|
394
|
+
|
|
395
|
+
display: inline-block;
|
|
396
|
+
|
|
397
|
+
inline-size: 8px;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
& ~ .mdw-textfield__border .mdw-textfield__outline-gap {
|
|
401
|
+
margin-inline: dp(24 + 8) 0;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.mdw-textfield[mdw-outlined] & ~ .mdw-textfield__border {
|
|
405
|
+
&::before {
|
|
406
|
+
padding-inline: 0 dp(24 + 8);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.mdw-textfield__outline-gap {
|
|
410
|
+
max-inline-size: calc(100% - #{dp(24 + 24 + 8)});
|
|
411
|
+
margin-inline-start: 0;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.mdw-textfield[mdw-outlined] {
|
|
417
|
+
&,
|
|
418
|
+
&[mdw-dense], {
|
|
419
|
+
.mdw-textfield__input,
|
|
420
|
+
textfield.mdw-textfield__input,
|
|
421
|
+
.mdw-textfield__prefix,
|
|
422
|
+
.mdw-textfield__suffix {
|
|
423
|
+
margin-block: calc(#{sp(6)} + 2px); // Half of label + 2px // Equidistant from border
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.mdw-textfield__input {
|
|
429
|
+
grid-column-start: 4;
|
|
430
|
+
grid-column-end: span 2;
|
|
431
|
+
grid-row: 1;
|
|
432
|
+
|
|
433
|
+
box-sizing: border-box;
|
|
434
|
+
min-inline-size: 0; // Firefox CSS Grid fix
|
|
435
|
+
inline-size: 100%;
|
|
436
|
+
border: none;
|
|
437
|
+
padding: 0;
|
|
438
|
+
|
|
439
|
+
-moz-appearance: none;
|
|
440
|
+
-webkit-appearance: none;
|
|
441
|
+
appearance: none;
|
|
442
|
+
outline: none;
|
|
443
|
+
-webkit-tap-highlight-color: transparent;
|
|
444
|
+
|
|
445
|
+
z-index: 1;
|
|
446
|
+
|
|
447
|
+
background: none;
|
|
448
|
+
box-shadow: none; // Firefox :invalid styling
|
|
449
|
+
|
|
450
|
+
font-weight: inherit;
|
|
451
|
+
font-size: inherit;
|
|
452
|
+
line-height: inherit;
|
|
453
|
+
font-family: inherit;
|
|
454
|
+
letter-spacing: inherit;
|
|
455
|
+
|
|
456
|
+
.mdw-textfield[mdw-outlined] & {
|
|
457
|
+
align-self: center;
|
|
458
|
+
|
|
459
|
+
margin-block: calc(#{sp(6)} + 2px); // Half of label + 2px // Equidistant from border
|
|
460
|
+
border-inline-start: 2px solid transparent;
|
|
461
|
+
border-inline-end: none;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
&::placeholder {
|
|
465
|
+
transition-delay: 1ms;
|
|
466
|
+
transition-duration: motion.$simpleDuration;
|
|
467
|
+
transition-property: color;
|
|
468
|
+
transition-timing-function: motion.$standardEasing;
|
|
469
|
+
will-change: color;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
&:not(:focus) {
|
|
473
|
+
cursor: pointer;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
&:disabled {
|
|
477
|
+
cursor: not-allowed;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.mdw-textfield__input,
|
|
482
|
+
.mdw-textfield__prefix,
|
|
483
|
+
.mdw-textfield__suffix {
|
|
484
|
+
align-self: flex-start;
|
|
485
|
+
|
|
486
|
+
margin-block: $input-top-alignment $input-bottom-alignment;
|
|
487
|
+
|
|
488
|
+
// margin-top: $input-top-alignment-dense;
|
|
489
|
+
// margin-bottom: $input-bottom-alignment-dense;
|
|
490
|
+
.mdw-textfield[mdw-dense] > & {
|
|
491
|
+
// margin-top: $input-top-alignment-dense;
|
|
492
|
+
// margin-bottom: $input-bottom-alignment-dense;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
textarea.mdw-textfield__input {
|
|
497
|
+
-ms-overflow-style: -ms-autohiding-scrollbar;
|
|
498
|
+
overflow-y: auto;
|
|
499
|
+
-webkit-overflow-scrolling: touch;
|
|
500
|
+
|
|
501
|
+
min-block-size: 1em; // Avoid clipping on resize
|
|
502
|
+
min-inline-size: 100%; // Always fill container horizontally
|
|
503
|
+
max-inline-size: 100%; // Don't allow resize beyond bounds
|
|
504
|
+
inline-size: 100% !important; // Unfortunately required
|
|
505
|
+
margin-block: $input-top-alignment $input-bottom-alignment;
|
|
506
|
+
padding-inline: 0 $textarea-padding-horizontal;
|
|
507
|
+
|
|
508
|
+
// margin-top: $input-top-alignment-dense;
|
|
509
|
+
// margin-bottom: $input-bottom-alignment-dense;
|
|
510
|
+
.mdw-textfield[mdw-dense] > & {
|
|
511
|
+
margin-block: $input-top-alignment-dense $input-bottom-alignment-dense;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.mdw-textfield[mdw-autosize] > & {
|
|
515
|
+
min-block-size: 1em;
|
|
516
|
+
|
|
517
|
+
resize: none;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
select.mdw-textfield__input {
|
|
522
|
+
padding-inline: 0 24px;
|
|
523
|
+
|
|
524
|
+
cursor: pointer;
|
|
525
|
+
|
|
526
|
+
option {
|
|
527
|
+
-moz-appearance: none;
|
|
528
|
+
-webkit-appearance: none;
|
|
529
|
+
appearance: none;
|
|
530
|
+
|
|
531
|
+
font-weight: inherit;
|
|
532
|
+
font-size: inherit;
|
|
533
|
+
font-family: inherit;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.mdw-textfield__error-text {
|
|
538
|
+
opacity: 0;
|
|
539
|
+
transform: translateY(-25%);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
.mdw-textfield__helper-text,
|
|
543
|
+
.mdw-textfield__error-text {
|
|
544
|
+
@include type.textTopToTop(4);
|
|
545
|
+
@include type.addRules('caption');
|
|
546
|
+
grid-column: 3;
|
|
547
|
+
grid-column-end: span 4;
|
|
548
|
+
grid-row: 2;
|
|
549
|
+
overflow: hidden;
|
|
550
|
+
|
|
551
|
+
text-overflow: ellipsis;
|
|
552
|
+
white-space: nowrap;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.mdw-textfield__icon {
|
|
556
|
+
display: flex;
|
|
557
|
+
align-self: center;
|
|
558
|
+
grid-column: 5;
|
|
559
|
+
grid-row: 1;
|
|
560
|
+
|
|
561
|
+
block-size: 24px;
|
|
562
|
+
inline-size: 24px;
|
|
563
|
+
|
|
564
|
+
&[mdw-dropdown] {
|
|
565
|
+
pointer-events: none;
|
|
566
|
+
|
|
567
|
+
&::after {
|
|
568
|
+
content: "";
|
|
569
|
+
|
|
570
|
+
// Triangle shape
|
|
571
|
+
inline-size: 0;
|
|
572
|
+
margin-block-start: 10px;
|
|
573
|
+
margin-inline: auto;
|
|
574
|
+
border-block-start: 5px solid currentColor;
|
|
575
|
+
border-inline-start: 5px solid transparent;
|
|
576
|
+
border-inline-end: 5px solid transparent;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.mdw-textfield__dropdown {
|
|
582
|
+
position: absolute;
|
|
583
|
+
grid-column: 1;
|
|
584
|
+
grid-column-end: span 7;
|
|
585
|
+
grid-row: 2;
|
|
586
|
+
overflow: hidden;
|
|
587
|
+
|
|
588
|
+
max-block-size: 0;
|
|
589
|
+
max-inline-size: 100%;
|
|
590
|
+
inline-size: 100%;
|
|
591
|
+
margin-block: 0 8px;
|
|
592
|
+
|
|
593
|
+
border-start-start-radius: 0;
|
|
594
|
+
border-start-end-radius: 0;
|
|
595
|
+
border-end-start-radius: 4px;
|
|
596
|
+
border-end-end-radius: 4px;
|
|
597
|
+
|
|
598
|
+
transition-duration: motion.$collapseDuration;
|
|
599
|
+
transition-property: box-shadow, max-height;
|
|
600
|
+
transition-timing-function: motion.$accelerateEasing;
|
|
601
|
+
|
|
602
|
+
z-index: 2;
|
|
603
|
+
|
|
604
|
+
box-shadow: none;
|
|
605
|
+
|
|
606
|
+
.mdw-textfield[mdw-outlined] & {
|
|
607
|
+
margin-block-start: 8px;
|
|
608
|
+
|
|
609
|
+
border-start-start-radius: 4px;
|
|
610
|
+
border-start-end-radius: 4px;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
&:active,
|
|
614
|
+
&[mdw-show],
|
|
615
|
+
input:focus ~ & {
|
|
616
|
+
&:not([mdw-hide]) {
|
|
617
|
+
transition-duration: motion.$expandDuration;
|
|
618
|
+
transition-timing-function: motion.$decelerateEasing;
|
|
619
|
+
|
|
620
|
+
box-shadow: elevation.boxShadow(24);
|
|
621
|
+
|
|
622
|
+
&[mdw-type="list"] {
|
|
623
|
+
max-block-size: 300px;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
&[mdw-type="list"] {
|
|
629
|
+
-ms-overflow-style: -ms-autohiding-scrollbar;
|
|
630
|
+
overflow-y: auto;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.mdw-textfield__label {
|
|
636
|
+
@include type.addRules('subtitle');
|
|
637
|
+
|
|
638
|
+
inset-block-start: 50%;
|
|
639
|
+
|
|
640
|
+
transform: translateY(-50%);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.mdw-textfield__outline-gap {
|
|
644
|
+
&::before {
|
|
645
|
+
inset-inline: 0 50%;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
&::after {
|
|
649
|
+
inset-inline: 50% 0;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
// Floating states:
|
|
654
|
+
// HTMLSelectElement, :focus, :autofill, or has texted (unfocused with placeholder)
|
|
655
|
+
|
|
656
|
+
select.mdw-textfield__input ~ .mdw-textfield__border,
|
|
657
|
+
.mdw-textfield__input:focus ~ .mdw-textfield__border,
|
|
658
|
+
.mdw-textfield__input:-webkit-autofill ~ .mdw-textfield__border,
|
|
659
|
+
.mdw-textfield__input:not(:placeholder-shown):not(:focus) ~ .mdw-textfield__border {
|
|
660
|
+
.mdw-textfield__label {
|
|
661
|
+
@include type.addRules('caption');
|
|
662
|
+
inset-block-start: 0;
|
|
663
|
+
|
|
664
|
+
transform: translateY(0);
|
|
665
|
+
|
|
666
|
+
.mdw-textfield[mdw-outlined] & {
|
|
667
|
+
transform: translateY(-50%);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
.mdw-textfield__outline-gap {
|
|
672
|
+
&::before {
|
|
673
|
+
inset-inline: 0 100%;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
&::after {
|
|
677
|
+
inset-inline: 100% 0;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
// Invalid state
|
|
683
|
+
.mdw-textfield:active > .mdw-textfield__input:not(:disabled),
|
|
684
|
+
.mdw-textfield > .mdw-textfield__input:not(:disabled):focus {
|
|
685
|
+
&:invalid {
|
|
686
|
+
& ~ .mdw-textfield__border .mdw-textfield__outline-gap {
|
|
687
|
+
animation-name: labelShake;
|
|
688
|
+
animation-duration: motion.$shapeChangeDuration;
|
|
689
|
+
animation-timing-function: linear;
|
|
690
|
+
animation-delay: motion.$simpleDuration;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
// Focus
|
|
696
|
+
.mdw-textfield:not([mdw-outlined]) {
|
|
697
|
+
&:active > .mdw-textfield__input:not(:disabled),
|
|
698
|
+
& > .mdw-textfield__input:not(:disabled):focus {
|
|
699
|
+
& ~ .mdw-textfield__border::before,
|
|
700
|
+
&:invalid ~ .mdw-textfield__border::after {
|
|
701
|
+
transition-duration: motion.$expandDuration;
|
|
702
|
+
transition-timing-function: motion.$decelerateEasing;
|
|
703
|
+
|
|
704
|
+
transform: scaleX(1) translateY(-$border-line-height * 0.5);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
// Border change on outlined active or focus
|
|
710
|
+
.mdw-textfield[mdw-outlined]:active > .mdw-textfield__input:not(:disabled) ~ .mdw-textfield__border,
|
|
711
|
+
.mdw-textfield[mdw-outlined] > .mdw-textfield__input:not(:disabled):focus ~ .mdw-textfield__border {
|
|
712
|
+
border-width: $border-line-height__focused;
|
|
713
|
+
|
|
714
|
+
&::before {
|
|
715
|
+
min-inline-size: $outline-start-width - $border-line-height__focused;
|
|
716
|
+
margin-block-start: -$border-line-height__focused;
|
|
717
|
+
margin-inline: -$border-line-height__focused 0;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
&::after {
|
|
721
|
+
min-inline-size: $outline-end-width - $border-line-height__focused;
|
|
722
|
+
margin-block-start: -$border-line-height__focused;
|
|
723
|
+
margin-inline: 0 -$border-line-height__focused;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.mdw-textfield__outline-gap {
|
|
727
|
+
margin-block: -$border-line-height__focused;
|
|
728
|
+
|
|
729
|
+
&::before,
|
|
730
|
+
&::after {
|
|
731
|
+
border-block-start-width: $border-line-height__focused;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
// Invalid
|
|
737
|
+
.mdw-textfield__input:focus:invalid ~ .mdw-textfield__error-text {
|
|
738
|
+
transition-duration: motion.$fadeInDuration;
|
|
739
|
+
transition-property: transform, opacity;
|
|
740
|
+
transition-timing-function: motion.$decelerateEasing;
|
|
741
|
+
will-change: transform, opacity;
|
|
742
|
+
|
|
743
|
+
opacity: 1;
|
|
744
|
+
transform: translateY(0);
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
@keyframes labelShake {
|
|
748
|
+
0% {
|
|
749
|
+
transform: translateX(0);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
33% {
|
|
753
|
+
transform: translateX(4px);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
66% {
|
|
757
|
+
transform: translateX(-4px);
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
100% {
|
|
761
|
+
transform: translateX(0);
|
|
762
|
+
}
|
|
763
|
+
}
|