material 3.7.1 → 3.7.3

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.
Files changed (276) hide show
  1. package/README.md +2 -2
  2. package/dist/components/slider/features/controller.js +24 -8
  3. package/dist/elements/css/bottom-app-bar.css +1 -1
  4. package/dist/elements/css/bottom-app-bar.js +1 -1
  5. package/dist/elements/css/card.css +1 -1
  6. package/dist/elements/css/card.js +1 -1
  7. package/dist/elements/css/checkbox.css +1 -1
  8. package/dist/elements/css/checkbox.js +1 -1
  9. package/dist/elements/css/datepicker.css +1 -1
  10. package/dist/elements/css/datepicker.js +1 -1
  11. package/dist/elements/css/dialog.css +1 -1
  12. package/dist/elements/css/dialog.js +1 -1
  13. package/dist/elements/css/menu.css +1 -1
  14. package/dist/elements/css/menu.js +1 -1
  15. package/dist/elements/css/radios.css +1 -1
  16. package/dist/elements/css/radios.js +1 -1
  17. package/dist/elements/css/select.css +1 -1
  18. package/dist/elements/css/select.js +1 -1
  19. package/dist/elements/css/slider.css +1 -1
  20. package/dist/elements/css/slider.js +1 -1
  21. package/dist/elements/css/tabs.css +1 -1
  22. package/dist/elements/css/tabs.js +1 -1
  23. package/dist/elements/css/text-field.css +1 -1
  24. package/dist/elements/css/text-field.js +1 -1
  25. package/dist/elements/css/timepicker.css +1 -1
  26. package/dist/elements/css/timepicker.js +1 -1
  27. package/dist/elements/css/top-app-bar.css +1 -1
  28. package/dist/elements/css/top-app-bar.js +1 -1
  29. package/dist/elements/preupgrade/badge.css +1 -1
  30. package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
  31. package/dist/elements/preupgrade/bottom-sheet.css +1 -1
  32. package/dist/elements/preupgrade/button-group.css +1 -1
  33. package/dist/elements/preupgrade/button.css +1 -1
  34. package/dist/elements/preupgrade/card.css +1 -1
  35. package/dist/elements/preupgrade/carousel.css +1 -1
  36. package/dist/elements/preupgrade/checkbox.css +1 -1
  37. package/dist/elements/preupgrade/chips.css +1 -1
  38. package/dist/elements/preupgrade/datepicker.css +1 -1
  39. package/dist/elements/preupgrade/dialog.css +1 -1
  40. package/dist/elements/preupgrade/divider.css +1 -1
  41. package/dist/elements/preupgrade/drawer.css +1 -1
  42. package/dist/elements/preupgrade/extended-fab.css +1 -1
  43. package/dist/elements/preupgrade/fab-menu.css +1 -1
  44. package/dist/elements/preupgrade/fab.css +1 -1
  45. package/dist/elements/preupgrade/icon-button.css +1 -1
  46. package/dist/elements/preupgrade/list.css +1 -1
  47. package/dist/elements/preupgrade/loading-indicator.css +1 -1
  48. package/dist/elements/preupgrade/menu.css +1 -1
  49. package/dist/elements/preupgrade/navigation-bar.css +1 -1
  50. package/dist/elements/preupgrade/navigation-rail.css +1 -1
  51. package/dist/elements/preupgrade/progress.css +1 -1
  52. package/dist/elements/preupgrade/radios.css +1 -1
  53. package/dist/elements/preupgrade/search.css +1 -1
  54. package/dist/elements/preupgrade/select.css +1 -1
  55. package/dist/elements/preupgrade/side-sheet.css +1 -1
  56. package/dist/elements/preupgrade/slider.css +1 -1
  57. package/dist/elements/preupgrade/snackbar.css +1 -1
  58. package/dist/elements/preupgrade/split-button.css +1 -1
  59. package/dist/elements/preupgrade/switch.css +1 -1
  60. package/dist/elements/preupgrade/tabs.css +1 -1
  61. package/dist/elements/preupgrade/text-field.css +1 -1
  62. package/dist/elements/preupgrade/timepicker.css +1 -1
  63. package/dist/elements/preupgrade/toolbar.css +1 -1
  64. package/dist/elements/preupgrade/tooltip.css +1 -1
  65. package/dist/elements/preupgrade/top-app-bar.css +1 -1
  66. package/dist/elements/preupgrade.css +1 -1
  67. package/dist/styles/badge.css +1 -1
  68. package/dist/styles/base-lite.css +1 -1
  69. package/dist/styles/base.css +1 -1
  70. package/dist/styles/bottom-app-bar.css +2 -2
  71. package/dist/styles/bottom-sheet.css +1 -1
  72. package/dist/styles/button-group.css +1 -1
  73. package/dist/styles/button.css +1 -1
  74. package/dist/styles/card.css +2 -2
  75. package/dist/styles/carousel.css +1 -1
  76. package/dist/styles/checkbox.css +2 -2
  77. package/dist/styles/chips.css +1 -1
  78. package/dist/styles/contrast.css +1 -1
  79. package/dist/styles/datepicker.css +2 -2
  80. package/dist/styles/dialog.css +2 -2
  81. package/dist/styles/divider.css +1 -1
  82. package/dist/styles/drawer.css +1 -1
  83. package/dist/styles/extended-fab.css +1 -1
  84. package/dist/styles/fab-menu.css +1 -1
  85. package/dist/styles/fab.css +1 -1
  86. package/dist/styles/icon-button.css +1 -1
  87. package/dist/styles/list.css +1 -1
  88. package/dist/styles/loading-indicator.css +1 -1
  89. package/dist/styles/menu.css +2 -2
  90. package/dist/styles/navigation-bar.css +1 -1
  91. package/dist/styles/navigation-rail.css +1 -1
  92. package/dist/styles/progress.css +1 -1
  93. package/dist/styles/radios.css +2 -2
  94. package/dist/styles/search.css +1 -1
  95. package/dist/styles/select.css +2 -2
  96. package/dist/styles/side-sheet.css +1 -1
  97. package/dist/styles/slider.css +2 -2
  98. package/dist/styles/snackbar.css +1 -1
  99. package/dist/styles/split-button.css +1 -1
  100. package/dist/styles/switch.css +1 -1
  101. package/dist/styles/tabs.css +2 -2
  102. package/dist/styles/text-field.css +2 -2
  103. package/dist/styles/timepicker.css +2 -2
  104. package/dist/styles/toolbar.css +1 -1
  105. package/dist/styles/tooltip.css +1 -1
  106. package/dist/styles/top-app-bar.css +2 -2
  107. package/dist/styles/typography.css +1 -1
  108. package/dist/styles/utilities.css +1 -1
  109. package/dist/styles.css +2 -2
  110. package/dist/themes/autumn-contrast.css +1 -1
  111. package/dist/themes/autumn.css +1 -1
  112. package/dist/themes/baseline-contrast.css +1 -1
  113. package/dist/themes/baseline.css +1 -1
  114. package/dist/themes/brownbeige-contrast.css +1 -1
  115. package/dist/themes/brownbeige.css +1 -1
  116. package/dist/themes/content-contrast.css +1 -1
  117. package/dist/themes/content.css +1 -1
  118. package/dist/themes/desert-contrast.css +1 -1
  119. package/dist/themes/desert.css +1 -1
  120. package/dist/themes/expressive-contrast.css +1 -1
  121. package/dist/themes/expressive.css +1 -1
  122. package/dist/themes/fidelity-contrast.css +1 -1
  123. package/dist/themes/fidelity.css +1 -1
  124. package/dist/themes/forest-contrast.css +1 -1
  125. package/dist/themes/forest.css +1 -1
  126. package/dist/themes/fruit-salad-contrast.css +1 -1
  127. package/dist/themes/fruit-salad.css +1 -1
  128. package/dist/themes/highcontrast-contrast.css +1 -1
  129. package/dist/themes/highcontrast.css +1 -1
  130. package/dist/themes/monochrome-contrast.css +1 -1
  131. package/dist/themes/monochrome.css +1 -1
  132. package/dist/themes/neutral-contrast.css +1 -1
  133. package/dist/themes/neutral.css +1 -1
  134. package/dist/themes/ocean-contrast.css +1 -1
  135. package/dist/themes/ocean.css +1 -1
  136. package/dist/themes/rainbow-contrast.css +1 -1
  137. package/dist/themes/rainbow.css +1 -1
  138. package/dist/themes/sageivory-contrast.css +1 -1
  139. package/dist/themes/sageivory.css +1 -1
  140. package/dist/themes/spring-contrast.css +1 -1
  141. package/dist/themes/spring.css +1 -1
  142. package/dist/themes/summer-contrast.css +1 -1
  143. package/dist/themes/summer.css +1 -1
  144. package/dist/themes/sunset-contrast.css +1 -1
  145. package/dist/themes/sunset.css +1 -1
  146. package/dist/themes/tealcaramel-contrast.css +1 -1
  147. package/dist/themes/tealcaramel.css +1 -1
  148. package/dist/themes/vibrant-contrast.css +1 -1
  149. package/dist/themes/vibrant.css +1 -1
  150. package/package.json +2 -1
  151. package/src/styles/abstract/_base.scss +0 -1
  152. package/src/styles/abstract/_direction.scss +121 -152
  153. package/src/styles/abstract/_emit.scss +7 -16
  154. package/src/styles/abstract/_floating-placement.scss +9 -10
  155. package/src/styles/abstract/_functions.scss +64 -79
  156. package/src/styles/abstract/_mixins.scss +355 -459
  157. package/src/styles/abstract/_theme.scss +122 -136
  158. package/src/styles/abstract/_variables.scss +320 -390
  159. package/src/styles/abstract/chips/_assist.scss +2 -3
  160. package/src/styles/abstract/chips/_filter.scss +2 -3
  161. package/src/styles/abstract/chips/_input.scss +2 -3
  162. package/src/styles/abstract/chips/_suggestion.scss +2 -3
  163. package/src/styles/base/_body-theme.scss +10 -15
  164. package/src/styles/base/_document.scss +10 -33
  165. package/src/styles/base/_reset.scss +20 -40
  166. package/src/styles/base/_tokens.scss +6 -21
  167. package/src/styles/base/_typescale-tokens.scss +12 -16
  168. package/src/styles/base/_typography.scss +28 -37
  169. package/src/styles/components/_badge.scss +171 -193
  170. package/src/styles/components/_bottom-app-bar.scss +72 -88
  171. package/src/styles/components/_bottom-sheet.scss +188 -232
  172. package/src/styles/components/_button-group.scss +140 -189
  173. package/src/styles/components/_button.scss +382 -478
  174. package/src/styles/components/_card.scss +349 -473
  175. package/src/styles/components/_carousel.scss +134 -156
  176. package/src/styles/components/_checkbox.scss +208 -247
  177. package/src/styles/components/_chips.scss +239 -304
  178. package/src/styles/components/_datepicker.scss +172 -220
  179. package/src/styles/components/_dialog.scss +428 -553
  180. package/src/styles/components/_divider.scss +37 -46
  181. package/src/styles/components/_drawer.scss +571 -678
  182. package/src/styles/components/_extended-fab.scss +263 -294
  183. package/src/styles/components/_fab-menu.scss +225 -267
  184. package/src/styles/components/_fab.scss +197 -218
  185. package/src/styles/components/_icon-button.scss +483 -588
  186. package/src/styles/components/_list.scss +115 -144
  187. package/src/styles/components/_loading-indicator.scss +23 -29
  188. package/src/styles/components/_menu.scss +543 -699
  189. package/src/styles/components/_navigation-bar.scss +189 -234
  190. package/src/styles/components/_navigation-rail.scss +256 -312
  191. package/src/styles/components/_progress.scss +60 -85
  192. package/src/styles/components/_radios.scss +170 -205
  193. package/src/styles/components/_search.scss +369 -455
  194. package/src/styles/components/_select.scss +78 -185
  195. package/src/styles/components/_side-sheet.scss +234 -292
  196. package/src/styles/components/_slider.scss +289 -367
  197. package/src/styles/components/_snackbar.scss +149 -198
  198. package/src/styles/components/_split-button.scss +139 -228
  199. package/src/styles/components/_switch.scss +282 -349
  200. package/src/styles/components/_tabs.scss +350 -547
  201. package/src/styles/components/_text-field.scss +788 -978
  202. package/src/styles/components/_timepicker.scss +435 -506
  203. package/src/styles/components/_toolbar.scss +178 -242
  204. package/src/styles/components/_tooltip.scss +152 -197
  205. package/src/styles/components/_top-app-bar.scss +206 -224
  206. package/src/styles/elements/_badge.scss +42 -61
  207. package/src/styles/elements/_bottom-app-bar.scss +14 -20
  208. package/src/styles/elements/_bottom-sheet.scss +0 -3
  209. package/src/styles/elements/_button-group.scss +80 -80
  210. package/src/styles/elements/_button.scss +72 -88
  211. package/src/styles/elements/_card.scss +48 -57
  212. package/src/styles/elements/_carousel.scss +2 -5
  213. package/src/styles/elements/_checkbox.scss +32 -43
  214. package/src/styles/elements/_chips.scss +18 -22
  215. package/src/styles/elements/_config.scss +11 -26
  216. package/src/styles/elements/_datepicker.scss +17 -22
  217. package/src/styles/elements/_dialog.scss +0 -3
  218. package/src/styles/elements/_divider.scss +11 -13
  219. package/src/styles/elements/_drawer.scss +9 -14
  220. package/src/styles/elements/_extended-fab.scss +36 -40
  221. package/src/styles/elements/_fab-menu.scss +21 -25
  222. package/src/styles/elements/_fab.scss +17 -20
  223. package/src/styles/elements/_field.scss +93 -114
  224. package/src/styles/elements/_icon-button.scss +34 -38
  225. package/src/styles/elements/_index.scss +0 -4
  226. package/src/styles/elements/_list.scss +19 -26
  227. package/src/styles/elements/_loading-indicator.scss +6 -9
  228. package/src/styles/elements/_menu.scss +0 -3
  229. package/src/styles/elements/_navigation-bar.scss +5 -9
  230. package/src/styles/elements/_navigation-rail.scss +10 -15
  231. package/src/styles/elements/_progress.scss +15 -18
  232. package/src/styles/elements/_radios.scss +24 -49
  233. package/src/styles/elements/_search.scss +19 -24
  234. package/src/styles/elements/_select.scss +4 -9
  235. package/src/styles/elements/_side-sheet.scss +0 -3
  236. package/src/styles/elements/_slider.scss +15 -35
  237. package/src/styles/elements/_snackbar.scss +0 -3
  238. package/src/styles/elements/_split-button.scss +33 -39
  239. package/src/styles/elements/_switch.scss +50 -90
  240. package/src/styles/elements/_tabs.scss +9 -13
  241. package/src/styles/elements/_text-field.scss +150 -178
  242. package/src/styles/elements/_timepicker.scss +0 -3
  243. package/src/styles/elements/_toolbar.scss +30 -35
  244. package/src/styles/elements/_tooltip.scss +0 -3
  245. package/src/styles/elements/_top-app-bar.scss +38 -45
  246. package/src/styles/main.scss +0 -15
  247. package/src/styles/themes/_autumn.scss +240 -258
  248. package/src/styles/themes/_base-theme.scss +96 -128
  249. package/src/styles/themes/_baseline.scss +273 -314
  250. package/src/styles/themes/_brownbeige.scss +242 -250
  251. package/src/styles/themes/_content.scss +240 -248
  252. package/src/styles/themes/_desert.scss +242 -250
  253. package/src/styles/themes/_expressive.scss +242 -250
  254. package/src/styles/themes/_fidelity.scss +240 -248
  255. package/src/styles/themes/_forest.scss +242 -259
  256. package/src/styles/themes/_fruit-salad.scss +242 -250
  257. package/src/styles/themes/_highcontrast.scss +164 -172
  258. package/src/styles/themes/_index.scss +0 -1
  259. package/src/styles/themes/_monochrome.scss +226 -234
  260. package/src/styles/themes/_neutral.scss +242 -250
  261. package/src/styles/themes/_ocean.scss +242 -259
  262. package/src/styles/themes/_rainbow.scss +242 -250
  263. package/src/styles/themes/_sageivory.scss +242 -250
  264. package/src/styles/themes/_spring.scss +238 -255
  265. package/src/styles/themes/_summer.scss +242 -250
  266. package/src/styles/themes/_sunset.scss +242 -259
  267. package/src/styles/themes/_tealcaramel.scss +242 -250
  268. package/src/styles/themes/_vibrant.scss +242 -250
  269. package/src/styles/utilities/_colors.scss +44 -50
  270. package/src/styles/utilities/_flexbox.scss +48 -59
  271. package/src/styles/utilities/_layout.scss +516 -591
  272. package/src/styles/utilities/_ripple.scss +61 -70
  273. package/src/styles/utilities/_spacing.scss +120 -127
  274. package/src/styles/utilities/_typography.scss +45 -58
  275. package/src/styles/utilities/_visibility.scss +61 -76
  276. package/dist/package.json +0 -488
@@ -1,12 +1,3 @@
1
- // Compose DatePickerModalTokens: 360px container, 120px header, 40px date state
2
- // layers, 36x72px year state layers, extra-large corners and elevation level 3.
3
- //
4
- // The single-side insets go through the direction switch
5
- // (abstract/_direction.scss): the runtime-adopted sheets keep the logical
6
- // `inset-inline-*` properties, and the artefacts a consumer bundler lowers
7
- // carry the physical side with a direction arm, so the bundler's :lang()
8
- // lowering cannot pin the trigger, the docked calendar or the full-screen
9
- // buttons to the left-to-right side of a right-to-left page.
10
1
  @use '../abstract/base' as base;
11
2
  @use '../abstract/variables' as v;
12
3
  @use '../abstract/mixins' as m;
@@ -15,217 +6,178 @@
15
6
 
16
7
  $component: '#{base.$prefix}-datepicker';
17
8
  .#{$component} {
18
- position: relative;
19
- display: inline-flex;
20
- flex-direction: column;
21
- width: 100%;
22
- max-width: 360px;
23
- // Where it shrinks to fit (an element's host), 280px as the text field,
24
- // not its input's platform-dependent width.
25
- contain: inline-size;
26
- contain-intrinsic-inline-size: v.text-field('width');
27
- color: t.color('on-surface');
28
- // The physical range band, its bleed into the grid padding, and the chevron
29
- // flip: left-to-right at the root, right-to-left under the direction arm.
30
- // The defaults are declared here, not only used as var() fallbacks, because
31
- // a custom property inherits: a nested LTR instance must not read its RTL
32
- // parent's values. The bleed is a value here rather than a physical-pair arm
33
- // on the ::before: the arm's `:not(.mtrl-ltr *)` cut sits after the
34
- // pseudo-element, which no combinator can match, so an LTR instance in an
35
- // RTL page would take the RTL band. These are flipped values, not properties
36
- // a bundler lowers, so the arm is written directly and rides in both forms
37
- // (abstract/_mixins.scss rtl).
38
- --#{$component}-start: 100% 0;
39
- --#{$component}-end: 0 0;
40
- --#{$component}-bleed-first-left: auto;
41
- --#{$component}-bleed-first-right: 100%;
42
- --#{$component}-bleed-last-left: 100%;
43
- --#{$component}-bleed-last-right: auto;
44
- --#{$component}-flip: none;
45
- @include m.rtl($self: true) {
46
- --#{$component}-start: 0 0;
47
- --#{$component}-end: 100% 0;
48
- --#{$component}-bleed-first-left: 100%;
49
- --#{$component}-bleed-first-right: auto;
50
- --#{$component}-bleed-last-left: auto;
51
- --#{$component}-bleed-last-right: 100%;
52
- --#{$component}-flip: scaleX(-1);
53
- }
54
- &__anchor { display: flex; position: relative; }
55
- &__label { @include m.typography('body-small'); margin-block-end: 4px; }
56
- &__input {
57
- box-sizing: border-box;
58
- width: 100%; min-width: 0; height: 56px; padding: 12px 16px;
59
- border: 1px solid t.color('outline'); border-radius: v.shape('extra-small');
60
- background: transparent; color: t.color('on-surface');
61
- @include m.typography('body-large');
62
- &:focus-visible { outline: 2px solid t.color('primary'); outline-offset: -2px; }
63
- &[aria-invalid='true'] { border-color: t.color('error'); }
64
- &:disabled { opacity: 0.38; }
65
- }
66
- &__anchor &__input { padding-inline-end: 56px; }
67
- // Normalize only the icon controls; their own font-size rules follow.
68
- &__trigger, &__mode-toggle, &__prev, &__next, &__close { font: inherit; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
69
- &__trigger { position: absolute; top: 4px; @include d.end(4px); font-size: 24px; }
70
- &__help, &__error { @include m.typography('body-small'); padding: 4px 16px 0; }
71
- &__help { color: t.color('on-surface-variant'); }
72
- &__error { color: t.color('error'); &:empty { display: none; } }
73
- &__calendar {
74
- // The day grid's inline padding, shared by the range band's bleed into it.
75
- --#{$component}-grid-inset: 12px;
76
- box-sizing: border-box; padding: 0; border: 0;
77
- width: 360px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px);
78
- overflow: auto; color: t.color('on-surface'); background: t.color('surface-container-high');
79
- border-radius: v.shape('extra-large'); box-shadow: v.elevation('level-3');
80
- &::backdrop { background: t.alpha('scrim', 0.32); }
81
- }
82
- &--modal { position: fixed; inset: 0; margin: auto; }
83
- // Full screen (m3.material.io: recommended on compact screens; the range picker's
84
- // form): the whole viewport, no corners, level 0 (range-selection.container tokens).
85
- &--fullscreen {
86
- width: 100%; max-width: none; height: 100%; max-height: none;
87
- border-radius: 0; box-shadow: none; overflow: hidden;
88
- .#{$component}__content { height: 100%; }
89
- .#{$component}__modal-header { min-height: 128px; padding: 64px 64px 12px; }
90
- .#{$component}__close {
91
- position: absolute; top: 4px; @include d.start(4px);
92
- }
93
- .#{$component}__save {
94
- position: absolute; top: 8px; @include d.end(12px);
95
- }
96
- .#{$component}__title { margin-bottom: 0; }
97
- .#{$component}__headline { @include m.typography('title-large'); }
98
- .#{$component}__weekdays { padding: 0 var(--#{$component}-grid-inset); }
99
- }
100
- &__list { flex: 1; min-height: 0; position: relative; overflow-y: auto; overscroll-behavior: contain; }
101
- &__subhead { @include m.typography('title-small'); color: t.color('on-surface-variant'); padding: 20px 24px 8px; }
102
- // Docked: corner-large (16dp), where the dialogs are extra-large.
103
- &--docked { border-radius: v.shape('large'); }
104
- &--docked {
105
- position: absolute; inset: auto; top: 100%; @include d.start(0); margin: 8px 0 0; z-index: v.z-index('dropdown');
106
- }
107
- &__content { display: flex; flex-direction: column; }
108
- &__modal-header {
109
- position: relative; box-sizing: border-box; min-height: 120px; padding: 16px 64px 16px 24px;
110
- border-bottom: 1px solid t.color('outline-variant'); color: t.color('on-surface-variant');
111
- }
112
- &--range &__modal-header { min-height: 128px; }
113
- &--range &__headline { @include m.typography('title-large'); }
114
- &__title { @include m.typography('label-large'); margin-bottom: 20px; }
115
- &__headline { @include m.typography('headline-large'); overflow-wrap: anywhere; }
116
- &__mode-toggle {
117
- position: absolute; @include d.end(12px); bottom: 12px; font-size: 24px;
118
- }
119
- // The arms above need the marker on an ancestor, and dir="rtl" may sit on
120
- // this root instead — the runtime resolves the factory root from the
121
- // nearest [dir], itself included (src/core/dom/direction.ts). These
122
- // root-carried forms follow the inline arms, as the split-button's do.
123
- // Nothing of them in the logical form.
124
- @include d.arms-self-only {
125
- .#{$component}__trigger { right: auto; left: 4px; }
126
- .#{$component}__mode-toggle { right: auto; left: 12px; }
127
- }
128
- &--fullscreen {
129
- @include d.arms-self-only {
130
- .#{$component}__close { left: auto; right: 4px; }
131
- .#{$component}__save { right: auto; left: 12px; }
132
- }
133
- }
134
- &--docked {
135
- @include d.arms-self-only { left: auto; right: 0; }
136
- }
137
- // The month and year row is 56dp, as in Compose (48dp buttons, 4dp above and below).
138
- &__header { display: flex; align-items: center; padding: 4px 12px; min-height: 56px; box-sizing: border-box; }
139
- &__navigation { display: flex; flex: 1; }
140
- &__month-selector, &__year-selector { @include m.typography('label-large'); padding: 0 8px; }
141
- &__trigger, &__mode-toggle, &__prev, &__next, &__month-selector, &__year-selector,
142
- &__cancel, &__confirm, &__close, &__save {
143
- box-sizing: border-box; min-width: 48px; min-height: 48px; border: 0; border-radius: v.shape('full');
144
- color: t.color('on-surface-variant'); background: transparent; cursor: pointer;
145
- &:hover:not(:disabled) { background: t.alpha('on-surface', 0.08); }
146
- &:focus-visible { outline: 2px solid t.color('primary'); outline-offset: -2px; background: t.alpha('on-surface', v.state('focus-state-layer-opacity')); }
147
- &:disabled { opacity: 0.38; cursor: default; }
148
- }
149
- &--animate[open] { animation: #{$component}-appear v.motion('duration-short3') v.motion('easing-standard'); }
150
- @media (prefers-reduced-motion: reduce) { &--animate[open] { animation: none; } }
151
- // No bottom padding: the modal is Compose's 568dp, the footer included.
152
- &__days { padding: 0 var(--#{$component}-grid-inset); }
153
- // The months' scroll-snapping track: one month per page, no visible scrollbar.
154
- // Swipe, trackpad and wheel paging are the browser's own.
155
- &__track {
156
- display: flex; overflow-x: auto; overscroll-behavior-x: contain;
157
- scroll-snap-type: x mandatory; scrollbar-width: none;
158
- &::-webkit-scrollbar { display: none; }
159
- > .#{$component}__days { flex: 0 0 100%; box-sizing: border-box; scroll-snap-align: start; scroll-snap-stop: always; }
160
- }
161
- &__weekdays, &__week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
162
- &__weekday, &__cell { display: flex; align-items: center; justify-content: center; height: 48px; min-width: 0; }
163
- &__weekday { @include m.typography('body-large'); }
164
- // The in-range band: a 40dp secondary-container strip, starting and ending at the
165
- // centre of the endpoint circles, square, under the selection (Compose's
166
- // drawRangeBackground); it was rounded to the cell edge. In-range days read
167
- // on-secondary-container.
168
- &__cell--range {
169
- position: relative;
170
- background: linear-gradient(transparent 4px, t.color('secondary-container') 4px, t.color('secondary-container') 44px, transparent 44px) no-repeat;
171
- .#{$component}__day:not(.#{$component}__day--selected) { color: t.color('on-secondary-container'); }
172
- }
173
- &__cell--range-start { background-size: 50% 100%; background-position: var(--#{$component}-start); }
174
- &__cell--range-end { background-size: 50% 100%; background-position: var(--#{$component}-end); }
175
- &__cell--range-start#{&}__cell--range-end { background: none; }
176
- // Where the range wraps to the next week, the band runs on through the grid's inline
177
- // padding to the container edge, as m3.material.io's range picker draws it: the row
178
- // it leaves to the end edge, the row it continues on from the start edge. Under the
179
- // day by tree order: the day's own ::before and ::after are its selection and layer.
180
- &__cell--range:is(:last-child:not(&__cell--range-end), :first-child:not(&__cell--range-start))::before {
181
- content: ''; position: absolute; top: 4px; width: var(--#{$component}-grid-inset); height: 40px;
182
- background: t.color('secondary-container');
183
- }
184
- &__cell--range:last-child::before {
185
- left: var(--#{$component}-bleed-last-left);
186
- right: var(--#{$component}-bleed-last-right);
187
- }
188
- &__cell--range:first-child::before {
189
- left: var(--#{$component}-bleed-first-left);
190
- right: var(--#{$component}-bleed-first-right);
191
- }
192
- &__day {
193
- position: relative; isolation: isolate; width: 100%; height: 48px; padding: 0; border: 0;
194
- background: transparent; color: t.color('on-surface'); cursor: pointer;
195
- @include m.typography('body-large');
196
- // ::before is the 40dp selection (fill, today's ring); ::after is the state layer
197
- // above it: on-surface-variant, on-primary on the selected day, at 0.08 hover and
198
- // 0.10 focus and pressed, with md.comp.focus-ring 2dp outside it.
199
- &::before, &::after { content: ''; position: absolute; z-index: -1; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; box-sizing: border-box; }
200
- --#{$component}-day-layer: #{t.color('on-surface-variant')};
201
- &:hover:not(:disabled)::after { background: color-mix(in srgb, var(--#{$component}-day-layer) #{v.state('hover-state-layer-opacity') * 100%}, transparent); }
202
- &:focus-visible { outline: none; &::after { background: color-mix(in srgb, var(--#{$component}-day-layer) #{v.state('focus-state-layer-opacity') * 100%}, transparent); outline: 3px solid t.color('secondary'); outline-offset: 2px; } }
203
- &:active:not(:disabled)::after { background: color-mix(in srgb, var(--#{$component}-day-layer) #{v.state('pressed-state-layer-opacity') * 100%}, transparent); }
204
- &--outside { color: t.alpha('on-surface', 0.38); }
205
- &--today { color: t.color('primary'); &::before { border: 1px solid t.color('primary'); } }
206
- &--highlight { text-decoration: underline; }
207
- &--selected, &--selected:hover:not(:disabled) { color: t.color('on-primary'); --#{$component}-day-layer: #{t.color('on-primary')}; &::before { background: t.color('primary'); } }
208
- &:disabled { opacity: 0.38; cursor: default; }
209
- }
210
- &__months, &__years { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; padding: 16px 24px; }
211
- // The year list scrolls vertically within the calendar's own height (a weekday row
212
- // and six weeks), so the picker keeps its size.
213
- &__years { position: relative; box-sizing: border-box; height: 336px; overflow-y: auto; overscroll-behavior: contain; }
214
- &__month, &__year {
215
- position: relative; isolation: isolate; min-width: 0; height: 48px; border: 0; background: transparent;
216
- color: t.color('on-surface-variant'); @include m.typography('body-large'); cursor: pointer;
217
- &::before { content: ''; position: absolute; z-index: -1; width: 72px; max-width: 100%; height: 36px; inset: 50% auto auto 50%; transform: translate(-50%, -50%); border-radius: v.shape('full'); }
218
- &:hover::before { background: t.alpha('on-surface', 0.08); }
219
- &[aria-pressed='true'] { color: t.color('on-primary'); &::before { background: t.color('primary'); } }
220
- &:focus-visible { outline: none; &::before { outline: 2px solid t.color('primary'); outline-offset: 2px; } }
221
- }
222
- &__fields { display: grid; gap: 16px; padding: 24px; }
223
- &__field { display: flex; flex-direction: column; }
224
- &__footer { display: flex; justify-content: flex-end; gap: 8px; padding: 4px 12px; }
225
- // The chevrons point the way the months go: mirrored right to left.
226
- &__prev svg, &__next svg { transform: var(--#{$component}-flip); }
227
- &__cancel, &__confirm, &__save { @include m.typography('label-large'); padding: 0 12px; color: t.color('primary'); }
228
- &__sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
9
+ position: relative;
10
+ display: inline-flex;
11
+ flex-direction: column;
12
+ width: 100%;
13
+ max-width: 360px;
14
+ contain: inline-size;
15
+ contain-intrinsic-inline-size: v.text-field('width');
16
+ color: t.color('on-surface');
17
+ --#{$component}-start: 100% 0;
18
+ --#{$component}-end: 0 0;
19
+ --#{$component}-bleed-first-left: auto;
20
+ --#{$component}-bleed-first-right: 100%;
21
+ --#{$component}-bleed-last-left: 100%;
22
+ --#{$component}-bleed-last-right: auto;
23
+ --#{$component}-flip: none;
24
+ @include m.rtl($self: true) {
25
+ --#{$component}-start: 0 0;
26
+ --#{$component}-end: 100% 0;
27
+ --#{$component}-bleed-first-left: 100%;
28
+ --#{$component}-bleed-first-right: auto;
29
+ --#{$component}-bleed-last-left: auto;
30
+ --#{$component}-bleed-last-right: 100%;
31
+ --#{$component}-flip: scaleX(-1);
32
+ }
33
+ &__anchor { display: flex; position: relative; }
34
+ &__label { @include m.typography('body-small'); margin-block-end: 4px; }
35
+ &__input {
36
+ box-sizing: border-box;
37
+ width: 100%; min-width: 0; height: 56px; padding: 12px 16px;
38
+ border: 1px solid t.color('outline'); border-radius: v.shape('extra-small');
39
+ background: transparent; color: t.color('on-surface');
40
+ @include m.typography('body-large');
41
+ &:focus-visible { outline: 2px solid t.color('primary'); outline-offset: -2px; }
42
+ &[aria-invalid='true'] { border-color: t.color('error'); }
43
+ &:disabled { opacity: 0.38; }
44
+ }
45
+ &__anchor &__input { padding-inline-end: 56px; }
46
+ &__trigger, &__mode-toggle, &__prev, &__next, &__close { font: inherit; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
47
+ &__trigger { position: absolute; top: 4px; @include d.end(4px); font-size: 24px; }
48
+ &__help, &__error { @include m.typography('body-small'); padding: 4px 16px 0; }
49
+ &__help { color: t.color('on-surface-variant'); }
50
+ &__error { color: t.color('error'); &:empty { display: none; } }
51
+ &__calendar {
52
+ --#{$component}-grid-inset: 12px;
53
+ box-sizing: border-box; padding: 0; border: 0;
54
+ width: 360px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px);
55
+ overflow: auto; color: t.color('on-surface'); background: t.color('surface-container-high');
56
+ border-radius: v.shape('extra-large'); box-shadow: v.elevation('level-3');
57
+ &::backdrop { background: t.alpha('scrim', 0.32); }
58
+ }
59
+ &--modal { position: fixed; inset: 0; margin: auto; }
60
+ &--fullscreen {
61
+ width: 100%; max-width: none; height: 100%; max-height: none;
62
+ border-radius: 0; box-shadow: none; overflow: hidden;
63
+ .#{$component}__content { height: 100%; }
64
+ .#{$component}__modal-header { min-height: 128px; padding: 64px 64px 12px; }
65
+ .#{$component}__close {
66
+ position: absolute; top: 4px; @include d.start(4px);
67
+ }
68
+ .#{$component}__save {
69
+ position: absolute; top: 8px; @include d.end(12px);
70
+ }
71
+ .#{$component}__title { margin-bottom: 0; }
72
+ .#{$component}__headline { @include m.typography('title-large'); }
73
+ .#{$component}__weekdays { padding: 0 var(--#{$component}-grid-inset); }
74
+ }
75
+ &__list { flex: 1; min-height: 0; position: relative; overflow-y: auto; overscroll-behavior: contain; }
76
+ &__subhead { @include m.typography('title-small'); color: t.color('on-surface-variant'); padding: 20px 24px 8px; }
77
+ &--docked { border-radius: v.shape('large'); }
78
+ &--docked {
79
+ position: absolute; inset: auto; top: 100%; @include d.start(0); margin: 8px 0 0; z-index: v.z-index('dropdown');
80
+ }
81
+ &__content { display: flex; flex-direction: column; }
82
+ &__modal-header {
83
+ position: relative; box-sizing: border-box; min-height: 120px; padding: 16px 64px 16px 24px;
84
+ border-bottom: 1px solid t.color('outline-variant'); color: t.color('on-surface-variant');
85
+ }
86
+ &--range &__modal-header { min-height: 128px; }
87
+ &--range &__headline { @include m.typography('title-large'); }
88
+ &__title { @include m.typography('label-large'); margin-bottom: 20px; }
89
+ &__headline { @include m.typography('headline-large'); overflow-wrap: anywhere; }
90
+ &__mode-toggle {
91
+ position: absolute; @include d.end(12px); bottom: 12px; font-size: 24px;
92
+ }
93
+ @include d.arms-self-only {
94
+ .#{$component}__trigger { right: auto; left: 4px; }
95
+ .#{$component}__mode-toggle { right: auto; left: 12px; }
96
+ }
97
+ &--fullscreen {
98
+ @include d.arms-self-only {
99
+ .#{$component}__close { left: auto; right: 4px; }
100
+ .#{$component}__save { right: auto; left: 12px; }
101
+ }
102
+ }
103
+ &--docked {
104
+ @include d.arms-self-only { left: auto; right: 0; }
105
+ }
106
+ &__header { display: flex; align-items: center; padding: 4px 12px; min-height: 56px; box-sizing: border-box; }
107
+ &__navigation { display: flex; flex: 1; }
108
+ &__month-selector, &__year-selector { @include m.typography('label-large'); padding: 0 8px; }
109
+ &__trigger, &__mode-toggle, &__prev, &__next, &__month-selector, &__year-selector,
110
+ &__cancel, &__confirm, &__close, &__save {
111
+ box-sizing: border-box; min-width: 48px; min-height: 48px; border: 0; border-radius: v.shape('full');
112
+ color: t.color('on-surface-variant'); background: transparent; cursor: pointer;
113
+ &:hover:not(:disabled) { background: t.alpha('on-surface', 0.08); }
114
+ &:focus-visible { outline: 2px solid t.color('primary'); outline-offset: -2px; background: t.alpha('on-surface', v.state('focus-state-layer-opacity')); }
115
+ &:disabled { opacity: 0.38; cursor: default; }
116
+ }
117
+ &--animate[open] { animation: #{$component}-appear v.motion('duration-short3') v.motion('easing-standard'); }
118
+ @media (prefers-reduced-motion: reduce) { &--animate[open] { animation: none; } }
119
+ &__days { padding: 0 var(--#{$component}-grid-inset); }
120
+ &__track {
121
+ display: flex; overflow-x: auto; overscroll-behavior-x: contain;
122
+ scroll-snap-type: x mandatory; scrollbar-width: none;
123
+ &::-webkit-scrollbar { display: none; }
124
+ > .#{$component}__days { flex: 0 0 100%; box-sizing: border-box; scroll-snap-align: start; scroll-snap-stop: always; }
125
+ }
126
+ &__weekdays, &__week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
127
+ &__weekday, &__cell { display: flex; align-items: center; justify-content: center; height: 48px; min-width: 0; }
128
+ &__weekday { @include m.typography('body-large'); }
129
+ &__cell--range {
130
+ position: relative;
131
+ background: linear-gradient(transparent 4px, t.color('secondary-container') 4px, t.color('secondary-container') 44px, transparent 44px) no-repeat;
132
+ .#{$component}__day:not(.#{$component}__day--selected) { color: t.color('on-secondary-container'); }
133
+ }
134
+ &__cell--range-start { background-size: 50% 100%; background-position: var(--#{$component}-start); }
135
+ &__cell--range-end { background-size: 50% 100%; background-position: var(--#{$component}-end); }
136
+ &__cell--range-start#{&}__cell--range-end { background: none; }
137
+ &__cell--range:is(:last-child:not(&__cell--range-end), :first-child:not(&__cell--range-start))::before {
138
+ content: ''; position: absolute; top: 4px; width: var(--#{$component}-grid-inset); height: 40px;
139
+ background: t.color('secondary-container');
140
+ }
141
+ &__cell--range:last-child::before {
142
+ left: var(--#{$component}-bleed-last-left);
143
+ right: var(--#{$component}-bleed-last-right);
144
+ }
145
+ &__cell--range:first-child::before {
146
+ left: var(--#{$component}-bleed-first-left);
147
+ right: var(--#{$component}-bleed-first-right);
148
+ }
149
+ &__day {
150
+ position: relative; isolation: isolate; width: 100%; height: 48px; padding: 0; border: 0;
151
+ background: transparent; color: t.color('on-surface'); cursor: pointer;
152
+ @include m.typography('body-large');
153
+ &::before, &::after { content: ''; position: absolute; z-index: -1; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; box-sizing: border-box; }
154
+ --#{$component}-day-layer: #{t.color('on-surface-variant')};
155
+ &:hover:not(:disabled)::after { background: color-mix(in srgb, var(--#{$component}-day-layer) #{v.state('hover-state-layer-opacity') * 100%}, transparent); }
156
+ &:focus-visible { outline: none; &::after { background: color-mix(in srgb, var(--#{$component}-day-layer) #{v.state('focus-state-layer-opacity') * 100%}, transparent); outline: 3px solid t.color('secondary'); outline-offset: 2px; } }
157
+ &:active:not(:disabled)::after { background: color-mix(in srgb, var(--#{$component}-day-layer) #{v.state('pressed-state-layer-opacity') * 100%}, transparent); }
158
+ &--outside { color: t.alpha('on-surface', 0.38); }
159
+ &--today { color: t.color('primary'); &::before { border: 1px solid t.color('primary'); } }
160
+ &--highlight { text-decoration: underline; }
161
+ &--selected, &--selected:hover:not(:disabled) { color: t.color('on-primary'); --#{$component}-day-layer: #{t.color('on-primary')}; &::before { background: t.color('primary'); } }
162
+ &:disabled { opacity: 0.38; cursor: default; }
163
+ }
164
+ &__months, &__years { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; padding: 16px 24px; }
165
+ &__years { position: relative; box-sizing: border-box; height: 336px; overflow-y: auto; overscroll-behavior: contain; }
166
+ &__month, &__year {
167
+ position: relative; isolation: isolate; min-width: 0; height: 48px; border: 0; background: transparent;
168
+ padding: 0;
169
+ color: t.color('on-surface-variant'); @include m.typography('body-large'); cursor: pointer;
170
+ &::before { content: ''; position: absolute; z-index: -1; width: 72px; max-width: 100%; height: 36px; inset: 50% auto auto 50%; transform: translate(-50%, -50%); border-radius: v.shape('full'); }
171
+ &:hover::before { background: t.alpha('on-surface', 0.08); }
172
+ &[aria-pressed='true'] { color: t.color('on-primary'); &::before { background: t.color('primary'); } }
173
+ &:focus-visible { outline: none; &::before { outline: 2px solid t.color('primary'); outline-offset: 2px; } }
174
+ }
175
+ &__fields { display: grid; gap: 16px; padding: 24px; }
176
+ &__field { display: flex; flex-direction: column; }
177
+ &__footer { display: flex; justify-content: flex-end; gap: 8px; padding: 4px 12px; }
178
+ &__prev svg, &__next svg { transform: var(--#{$component}-flip); }
179
+ &__cancel, &__confirm, &__save { @include m.typography('label-large'); padding: 0 12px; color: t.color('primary'); }
180
+ &__sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
229
181
  }
230
182
 
231
183
  @keyframes #{$component}-appear { from { opacity: 0; } to { opacity: 1; } }