material 3.7.2 → 3.8.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.
Files changed (313) hide show
  1. package/NOTICE +223 -0
  2. package/README.md +5 -3
  3. package/dist/components/extended-fab/types.d.ts +3 -0
  4. package/dist/components/fab/types.d.ts +3 -0
  5. package/dist/components/slider/features/controller.js +24 -8
  6. package/dist/elements/css/card.css +1 -1
  7. package/dist/elements/css/card.js +1 -1
  8. package/dist/elements/css/dialog.css +1 -1
  9. package/dist/elements/css/dialog.js +1 -1
  10. package/dist/elements/css/menu.css +1 -1
  11. package/dist/elements/css/menu.js +1 -1
  12. package/dist/elements/css/select.css +1 -1
  13. package/dist/elements/css/select.js +1 -1
  14. package/dist/elements/css/slider.css +1 -1
  15. package/dist/elements/css/slider.js +1 -1
  16. package/dist/elements/css/tabs.css +1 -1
  17. package/dist/elements/css/tabs.js +1 -1
  18. package/dist/elements/css/timepicker.css +1 -1
  19. package/dist/elements/css/timepicker.js +1 -1
  20. package/dist/elements/extended-fab.d.ts +1 -0
  21. package/dist/elements/fab.d.ts +1 -0
  22. package/dist/elements/preupgrade/badge.css +1 -1
  23. package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
  24. package/dist/elements/preupgrade/bottom-sheet.css +1 -1
  25. package/dist/elements/preupgrade/button-group.css +1 -1
  26. package/dist/elements/preupgrade/button.css +1 -1
  27. package/dist/elements/preupgrade/card.css +1 -1
  28. package/dist/elements/preupgrade/carousel.css +1 -1
  29. package/dist/elements/preupgrade/checkbox.css +1 -1
  30. package/dist/elements/preupgrade/chips.css +1 -1
  31. package/dist/elements/preupgrade/datepicker.css +1 -1
  32. package/dist/elements/preupgrade/dialog.css +1 -1
  33. package/dist/elements/preupgrade/divider.css +1 -1
  34. package/dist/elements/preupgrade/drawer.css +1 -1
  35. package/dist/elements/preupgrade/extended-fab.css +1 -1
  36. package/dist/elements/preupgrade/fab-menu.css +1 -1
  37. package/dist/elements/preupgrade/fab.css +1 -1
  38. package/dist/elements/preupgrade/icon-button.css +1 -1
  39. package/dist/elements/preupgrade/list.css +1 -1
  40. package/dist/elements/preupgrade/loading-indicator.css +1 -1
  41. package/dist/elements/preupgrade/menu.css +1 -1
  42. package/dist/elements/preupgrade/navigation-bar.css +1 -1
  43. package/dist/elements/preupgrade/navigation-rail.css +1 -1
  44. package/dist/elements/preupgrade/progress.css +1 -1
  45. package/dist/elements/preupgrade/radios.css +1 -1
  46. package/dist/elements/preupgrade/search.css +1 -1
  47. package/dist/elements/preupgrade/select.css +1 -1
  48. package/dist/elements/preupgrade/side-sheet.css +1 -1
  49. package/dist/elements/preupgrade/slider.css +1 -1
  50. package/dist/elements/preupgrade/snackbar.css +1 -1
  51. package/dist/elements/preupgrade/split-button.css +1 -1
  52. package/dist/elements/preupgrade/switch.css +1 -1
  53. package/dist/elements/preupgrade/tabs.css +1 -1
  54. package/dist/elements/preupgrade/text-field.css +1 -1
  55. package/dist/elements/preupgrade/timepicker.css +1 -1
  56. package/dist/elements/preupgrade/toolbar.css +1 -1
  57. package/dist/elements/preupgrade/tooltip.css +1 -1
  58. package/dist/elements/preupgrade/top-app-bar.css +1 -1
  59. package/dist/elements/preupgrade.css +1 -1
  60. package/dist/styles/badge.css +1 -1
  61. package/dist/styles/base-lite.css +2 -2
  62. package/dist/styles/base.css +2 -2
  63. package/dist/styles/bottom-app-bar.css +1 -1
  64. package/dist/styles/bottom-sheet.css +1 -1
  65. package/dist/styles/button-group.css +1 -1
  66. package/dist/styles/button.css +1 -1
  67. package/dist/styles/card.css +2 -2
  68. package/dist/styles/carousel.css +1 -1
  69. package/dist/styles/checkbox.css +1 -1
  70. package/dist/styles/chips.css +1 -1
  71. package/dist/styles/contrast.css +2 -2
  72. package/dist/styles/datepicker.css +1 -1
  73. package/dist/styles/dialog.css +2 -2
  74. package/dist/styles/divider.css +1 -1
  75. package/dist/styles/drawer.css +1 -1
  76. package/dist/styles/extended-fab.css +1 -1
  77. package/dist/styles/fab-menu.css +1 -1
  78. package/dist/styles/fab.css +1 -1
  79. package/dist/styles/icon-button.css +1 -1
  80. package/dist/styles/list.css +1 -1
  81. package/dist/styles/loading-indicator.css +1 -1
  82. package/dist/styles/menu.css +2 -2
  83. package/dist/styles/navigation-bar.css +1 -1
  84. package/dist/styles/navigation-rail.css +1 -1
  85. package/dist/styles/progress.css +1 -1
  86. package/dist/styles/radios.css +1 -1
  87. package/dist/styles/search.css +1 -1
  88. package/dist/styles/select.css +2 -2
  89. package/dist/styles/side-sheet.css +1 -1
  90. package/dist/styles/slider.css +2 -2
  91. package/dist/styles/snackbar.css +1 -1
  92. package/dist/styles/split-button.css +1 -1
  93. package/dist/styles/switch.css +1 -1
  94. package/dist/styles/tabs.css +2 -2
  95. package/dist/styles/text-field.css +1 -1
  96. package/dist/styles/timepicker.css +2 -2
  97. package/dist/styles/toolbar.css +1 -1
  98. package/dist/styles/tooltip.css +1 -1
  99. package/dist/styles/top-app-bar.css +1 -1
  100. package/dist/styles/typography.css +1 -1
  101. package/dist/styles/utilities.css +1 -1
  102. package/dist/styles.css +2 -2
  103. package/dist/theme/image.d.ts +2 -0
  104. package/dist/theme/image.js +5 -0
  105. package/dist/theme/index.d.ts +23 -0
  106. package/dist/theme/index.js +32 -0
  107. package/dist/theme/roles.js +68 -0
  108. package/dist/theme/variants.d.ts +9 -0
  109. package/dist/theme/variants.js +17 -0
  110. package/dist/theme/vendor/contrast/contrast.js +72 -0
  111. package/dist/theme/vendor/dislike/dislike_analyzer.js +31 -0
  112. package/dist/theme/vendor/dynamiccolor/color_spec_2021.d.ts +63 -0
  113. package/dist/theme/vendor/dynamiccolor/color_spec_2021.js +663 -0
  114. package/dist/theme/vendor/dynamiccolor/contrast_curve.js +42 -0
  115. package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +24 -0
  116. package/dist/theme/vendor/dynamiccolor/dynamic_color.js +264 -0
  117. package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +87 -0
  118. package/dist/theme/vendor/dynamiccolor/dynamic_scheme.js +418 -0
  119. package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.d.ts +124 -0
  120. package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.js +311 -0
  121. package/dist/theme/vendor/dynamiccolor/tone_delta_pair.js +27 -0
  122. package/dist/theme/vendor/dynamiccolor/variant.js +28 -0
  123. package/dist/theme/vendor/hct/cam16.js +249 -0
  124. package/dist/theme/vendor/hct/hct.d.ts +23 -0
  125. package/dist/theme/vendor/hct/hct.js +86 -0
  126. package/dist/theme/vendor/hct/hct_solver.js +390 -0
  127. package/dist/theme/vendor/hct/viewing_conditions.js +73 -0
  128. package/dist/theme/vendor/palettes/tonal_palette.js +114 -0
  129. package/dist/theme/vendor/quantize/lab_point_provider.js +31 -0
  130. package/dist/theme/vendor/quantize/quantizer_celebi.js +25 -0
  131. package/dist/theme/vendor/quantize/quantizer_map.js +31 -0
  132. package/dist/theme/vendor/quantize/quantizer_wsmeans.js +178 -0
  133. package/dist/theme/vendor/quantize/quantizer_wu.js +342 -0
  134. package/dist/theme/vendor/scheme/scheme_content.js +30 -0
  135. package/dist/theme/vendor/scheme/scheme_expressive.js +30 -0
  136. package/dist/theme/vendor/scheme/scheme_fidelity.js +30 -0
  137. package/dist/theme/vendor/scheme/scheme_monochrome.js +30 -0
  138. package/dist/theme/vendor/scheme/scheme_neutral.js +30 -0
  139. package/dist/theme/vendor/scheme/scheme_tonal_spot.js +30 -0
  140. package/dist/theme/vendor/scheme/scheme_vibrant.js +30 -0
  141. package/dist/theme/vendor/score/score.js +100 -0
  142. package/dist/theme/vendor/temperature/temperature_cache.js +198 -0
  143. package/dist/theme/vendor/utils/color_utils.js +173 -0
  144. package/dist/theme/vendor/utils/image_utils.js +72 -0
  145. package/dist/theme/vendor/utils/math_utils.js +75 -0
  146. package/dist/theme/vendor/utils/string_utils.js +61 -0
  147. package/dist/themes/autumn-contrast.css +2 -2
  148. package/dist/themes/autumn.css +2 -2
  149. package/dist/themes/baseline-contrast.css +2 -2
  150. package/dist/themes/baseline.css +2 -2
  151. package/dist/themes/brownbeige-contrast.css +2 -2
  152. package/dist/themes/brownbeige.css +2 -2
  153. package/dist/themes/content-contrast.css +2 -2
  154. package/dist/themes/content.css +2 -2
  155. package/dist/themes/desert-contrast.css +2 -2
  156. package/dist/themes/desert.css +2 -2
  157. package/dist/themes/expressive-contrast.css +2 -2
  158. package/dist/themes/expressive.css +2 -2
  159. package/dist/themes/fidelity-contrast.css +2 -2
  160. package/dist/themes/fidelity.css +2 -2
  161. package/dist/themes/forest-contrast.css +2 -2
  162. package/dist/themes/forest.css +2 -2
  163. package/dist/themes/fruit-salad-contrast.css +2 -2
  164. package/dist/themes/fruit-salad.css +2 -2
  165. package/dist/themes/highcontrast-contrast.css +2 -2
  166. package/dist/themes/highcontrast.css +2 -2
  167. package/dist/themes/monochrome-contrast.css +2 -2
  168. package/dist/themes/monochrome.css +2 -2
  169. package/dist/themes/neutral-contrast.css +2 -2
  170. package/dist/themes/neutral.css +2 -2
  171. package/dist/themes/ocean-contrast.css +2 -2
  172. package/dist/themes/ocean.css +2 -2
  173. package/dist/themes/rainbow-contrast.css +2 -2
  174. package/dist/themes/rainbow.css +2 -2
  175. package/dist/themes/sageivory-contrast.css +2 -2
  176. package/dist/themes/sageivory.css +2 -2
  177. package/dist/themes/spring-contrast.css +2 -2
  178. package/dist/themes/spring.css +2 -2
  179. package/dist/themes/summer-contrast.css +2 -2
  180. package/dist/themes/summer.css +2 -2
  181. package/dist/themes/sunset-contrast.css +2 -2
  182. package/dist/themes/sunset.css +2 -2
  183. package/dist/themes/tealcaramel-contrast.css +2 -2
  184. package/dist/themes/tealcaramel.css +2 -2
  185. package/dist/themes/vibrant-contrast.css +2 -2
  186. package/dist/themes/vibrant.css +2 -2
  187. package/package.json +15 -1
  188. package/src/styles/abstract/_base.scss +0 -1
  189. package/src/styles/abstract/_direction.scss +121 -152
  190. package/src/styles/abstract/_emit.scss +7 -16
  191. package/src/styles/abstract/_floating-placement.scss +9 -10
  192. package/src/styles/abstract/_functions.scss +64 -79
  193. package/src/styles/abstract/_mixins.scss +355 -459
  194. package/src/styles/abstract/_theme.scss +122 -136
  195. package/src/styles/abstract/_variables.scss +320 -390
  196. package/src/styles/abstract/chips/_assist.scss +2 -3
  197. package/src/styles/abstract/chips/_filter.scss +2 -3
  198. package/src/styles/abstract/chips/_input.scss +2 -3
  199. package/src/styles/abstract/chips/_suggestion.scss +2 -3
  200. package/src/styles/base/_body-theme.scss +10 -15
  201. package/src/styles/base/_document.scss +10 -33
  202. package/src/styles/base/_reset.scss +20 -40
  203. package/src/styles/base/_tokens.scss +6 -21
  204. package/src/styles/base/_typescale-tokens.scss +12 -16
  205. package/src/styles/base/_typography.scss +28 -37
  206. package/src/styles/components/_badge.scss +171 -193
  207. package/src/styles/components/_bottom-app-bar.scss +72 -90
  208. package/src/styles/components/_bottom-sheet.scss +188 -232
  209. package/src/styles/components/_button-group.scss +140 -189
  210. package/src/styles/components/_button.scss +382 -478
  211. package/src/styles/components/_card.scss +349 -473
  212. package/src/styles/components/_carousel.scss +134 -156
  213. package/src/styles/components/_checkbox.scss +208 -249
  214. package/src/styles/components/_chips.scss +239 -304
  215. package/src/styles/components/_datepicker.scss +172 -222
  216. package/src/styles/components/_dialog.scss +428 -553
  217. package/src/styles/components/_divider.scss +37 -46
  218. package/src/styles/components/_drawer.scss +571 -678
  219. package/src/styles/components/_extended-fab.scss +263 -294
  220. package/src/styles/components/_fab-menu.scss +225 -267
  221. package/src/styles/components/_fab.scss +197 -218
  222. package/src/styles/components/_icon-button.scss +483 -588
  223. package/src/styles/components/_list.scss +115 -144
  224. package/src/styles/components/_loading-indicator.scss +23 -29
  225. package/src/styles/components/_menu.scss +543 -699
  226. package/src/styles/components/_navigation-bar.scss +189 -234
  227. package/src/styles/components/_navigation-rail.scss +256 -312
  228. package/src/styles/components/_progress.scss +60 -85
  229. package/src/styles/components/_radios.scss +170 -207
  230. package/src/styles/components/_search.scss +369 -455
  231. package/src/styles/components/_select.scss +78 -185
  232. package/src/styles/components/_side-sheet.scss +234 -292
  233. package/src/styles/components/_slider.scss +289 -367
  234. package/src/styles/components/_snackbar.scss +149 -198
  235. package/src/styles/components/_split-button.scss +139 -228
  236. package/src/styles/components/_switch.scss +282 -349
  237. package/src/styles/components/_tabs.scss +350 -547
  238. package/src/styles/components/_text-field.scss +788 -980
  239. package/src/styles/components/_timepicker.scss +435 -506
  240. package/src/styles/components/_toolbar.scss +178 -242
  241. package/src/styles/components/_tooltip.scss +152 -197
  242. package/src/styles/components/_top-app-bar.scss +206 -230
  243. package/src/styles/elements/_badge.scss +42 -61
  244. package/src/styles/elements/_bottom-app-bar.scss +14 -20
  245. package/src/styles/elements/_bottom-sheet.scss +0 -3
  246. package/src/styles/elements/_button-group.scss +80 -80
  247. package/src/styles/elements/_button.scss +72 -88
  248. package/src/styles/elements/_card.scss +48 -57
  249. package/src/styles/elements/_carousel.scss +2 -5
  250. package/src/styles/elements/_checkbox.scss +32 -43
  251. package/src/styles/elements/_chips.scss +18 -22
  252. package/src/styles/elements/_config.scss +11 -26
  253. package/src/styles/elements/_datepicker.scss +17 -22
  254. package/src/styles/elements/_dialog.scss +0 -3
  255. package/src/styles/elements/_divider.scss +11 -13
  256. package/src/styles/elements/_drawer.scss +9 -14
  257. package/src/styles/elements/_extended-fab.scss +36 -40
  258. package/src/styles/elements/_fab-menu.scss +21 -25
  259. package/src/styles/elements/_fab.scss +17 -20
  260. package/src/styles/elements/_field.scss +93 -114
  261. package/src/styles/elements/_icon-button.scss +34 -38
  262. package/src/styles/elements/_index.scss +0 -4
  263. package/src/styles/elements/_list.scss +19 -26
  264. package/src/styles/elements/_loading-indicator.scss +6 -9
  265. package/src/styles/elements/_menu.scss +0 -3
  266. package/src/styles/elements/_navigation-bar.scss +5 -9
  267. package/src/styles/elements/_navigation-rail.scss +10 -15
  268. package/src/styles/elements/_progress.scss +15 -18
  269. package/src/styles/elements/_radios.scss +24 -49
  270. package/src/styles/elements/_search.scss +19 -24
  271. package/src/styles/elements/_select.scss +4 -9
  272. package/src/styles/elements/_side-sheet.scss +0 -3
  273. package/src/styles/elements/_slider.scss +15 -35
  274. package/src/styles/elements/_snackbar.scss +0 -3
  275. package/src/styles/elements/_split-button.scss +33 -39
  276. package/src/styles/elements/_switch.scss +50 -90
  277. package/src/styles/elements/_tabs.scss +9 -13
  278. package/src/styles/elements/_text-field.scss +150 -178
  279. package/src/styles/elements/_timepicker.scss +0 -3
  280. package/src/styles/elements/_toolbar.scss +30 -35
  281. package/src/styles/elements/_tooltip.scss +0 -3
  282. package/src/styles/elements/_top-app-bar.scss +38 -45
  283. package/src/styles/main.scss +0 -15
  284. package/src/styles/themes/_autumn.scss +258 -258
  285. package/src/styles/themes/_base-theme.scss +112 -134
  286. package/src/styles/themes/_baseline.scss +291 -314
  287. package/src/styles/themes/_brownbeige.scss +270 -250
  288. package/src/styles/themes/_content.scss +268 -248
  289. package/src/styles/themes/_desert.scss +270 -250
  290. package/src/styles/themes/_expressive.scss +270 -250
  291. package/src/styles/themes/_fidelity.scss +268 -248
  292. package/src/styles/themes/_forest.scss +260 -259
  293. package/src/styles/themes/_fruit-salad.scss +270 -250
  294. package/src/styles/themes/_highcontrast.scss +183 -172
  295. package/src/styles/themes/_index.scss +0 -1
  296. package/src/styles/themes/_monochrome.scss +254 -234
  297. package/src/styles/themes/_neutral.scss +270 -250
  298. package/src/styles/themes/_ocean.scss +260 -259
  299. package/src/styles/themes/_rainbow.scss +270 -250
  300. package/src/styles/themes/_sageivory.scss +270 -250
  301. package/src/styles/themes/_spring.scss +256 -255
  302. package/src/styles/themes/_summer.scss +270 -250
  303. package/src/styles/themes/_sunset.scss +260 -259
  304. package/src/styles/themes/_tealcaramel.scss +270 -250
  305. package/src/styles/themes/_vibrant.scss +270 -250
  306. package/src/styles/utilities/_colors.scss +44 -50
  307. package/src/styles/utilities/_flexbox.scss +48 -59
  308. package/src/styles/utilities/_layout.scss +516 -591
  309. package/src/styles/utilities/_ripple.scss +61 -70
  310. package/src/styles/utilities/_spacing.scss +120 -127
  311. package/src/styles/utilities/_typography.scss +45 -58
  312. package/src/styles/utilities/_visibility.scss +61 -76
  313. 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,219 +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
- // Without the base reset: a button's UA padding would remain.
217
- padding: 0;
218
- color: t.color('on-surface-variant'); @include m.typography('body-large'); cursor: pointer;
219
- &::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'); }
220
- &:hover::before { background: t.alpha('on-surface', 0.08); }
221
- &[aria-pressed='true'] { color: t.color('on-primary'); &::before { background: t.color('primary'); } }
222
- &:focus-visible { outline: none; &::before { outline: 2px solid t.color('primary'); outline-offset: 2px; } }
223
- }
224
- &__fields { display: grid; gap: 16px; padding: 24px; }
225
- &__field { display: flex; flex-direction: column; }
226
- &__footer { display: flex; justify-content: flex-end; gap: 8px; padding: 4px 12px; }
227
- // The chevrons point the way the months go: mirrored right to left.
228
- &__prev svg, &__next svg { transform: var(--#{$component}-flip); }
229
- &__cancel, &__confirm, &__save { @include m.typography('label-large'); padding: 0 12px; color: t.color('primary'); }
230
- &__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; }
231
181
  }
232
182
 
233
183
  @keyframes #{$component}-appear { from { opacity: 0; } to { opacity: 1; } }