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,4 +1,3 @@
1
- // src/components/timepicker/_styles.scss
2
1
  @use 'sass:map';
3
2
  @use '../../styles/abstract/base' as base;
4
3
  @use '../../styles/abstract/variables' as v;
@@ -9,526 +8,456 @@
9
8
  $component: '#{base.$prefix}-time-picker';
10
9
 
11
10
  .#{$component} {
12
- // Base styles
13
- position: relative;
14
- display: inline-block;
15
-
16
- // A native modal <dialog>: the browser centres it in the top layer and
17
- // draws ::backdrop; the scrim is scrim at 0.32, as for every M3 dialog.
18
- &__dialog {
19
- box-sizing: border-box;
20
- margin: auto;
21
- padding: 0;
22
- border: 0;
23
- min-width: 280px;
24
- max-width: 328px;
25
- max-height: 520px;
26
- background-color: t.color('surface-container-high');
27
- color: t.color('on-surface');
28
- border-radius: f.get-shape('extra-large');
29
- @include m.elevation(3);
30
-
31
- &[open] {
32
- display: flex;
33
- flex-direction: column;
34
- animation: #{$component}-appear 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
35
- }
36
-
37
- &::backdrop { background: t.alpha('scrim', 0.32); }
38
-
39
- // Horizontal (landscape): the time and AM/PM stack beside the dial, and
40
- // AM/PM lies flat, 216x38dp.
41
- &--horizontal {
42
- min-width: 520px;
43
- min-height: 360px;
44
-
45
- .#{$component}__content {
46
- flex-direction: row;
47
- align-items: center;
48
- }
49
-
50
- .#{$component}__input-container {
51
- flex-direction: column;
52
- align-items: center;
53
- }
54
-
55
- .#{$component}__period {
56
- flex-direction: row;
57
- width: 216px;
58
- height: 38px;
59
- margin: 12px 0 0;
60
- }
61
-
62
- .#{$component}__period-pm {
63
- border-block-start: 0;
64
- border-inline-start: 1px solid t.color('outline');
65
- }
66
-
67
- .#{$component}__dial {
68
- margin-inline-start: 24px;
69
- }
70
- }
71
-
72
- // Time formats
73
- &--24h {
74
- .#{$component}__period {
75
- display: none;
76
- }
77
- }
78
- }
79
-
80
- // Title
81
- // M3 TimePickerTokens: HeadlineFont is LabelMedium, HeadlineColor is
82
- // OnSurfaceVariant. The colour already matched; the type scale did not.
83
- &__title {
84
- padding: 24px 24px 16px;
85
- @include m.typography('label-medium');
86
- color: t.color('on-surface-variant');
87
- }
88
-
89
- // Content container
90
- &__content {
91
- flex: 1;
92
- padding: 0 24px;
93
- overflow: hidden;
94
- display: flex;
95
- flex-direction: column;
96
- align-items: center;
97
- }
98
-
99
- // The time row: the fields, then AM/PM 12dp after them.
100
- &__input-container {
101
- display: flex;
102
- align-items: flex-start;
103
- justify-content: center;
104
- margin: 0 0 24px 0;
105
- }
106
-
107
- // The fields and separators read left to right in any direction, as a time is
108
- // written (Compose keeps them LTR); AM/PM follows the page's direction.
109
- &__selectors {
110
- display: flex;
111
- align-items: flex-start;
112
- direction: ltr;
113
- }
114
-
115
- &__time-input-field {
116
- display: flex;
117
- flex-direction: column;
118
- }
119
-
120
- // Dial mode's boxes (TimeSelector): 96x80dp, Display Large, corner small.
121
- // Input mode's fields (TimeInput) are 96x72dp in Display Medium, below.
122
- &__hours,
123
- &__minutes,
124
- &__seconds {
125
- box-sizing: border-box;
126
- width: 96px;
127
- height: 80px;
128
- margin: 0;
129
- padding: 0;
130
- border: 0;
131
- border-radius: f.get-shape('small');
132
- text-align: center;
133
- cursor: pointer;
134
- @include m.typography('display-large');
135
-
136
- // Input mode: TimeFieldContainerColor surface-container-highest with an
137
- // on-surface label; focused, primary-container and on-primary-container
138
- // inside a 2dp primary outline. The selected colours never showed before:
139
- // this rule overrode them.
140
- &[type="number"] {
141
- height: 72px;
142
- @include m.typography('display-medium');
143
- background-color: t.color('surface-container-highest');
144
- color: t.color('on-surface');
145
- cursor: text;
146
-
147
- &:focus {
148
- outline: 2px solid t.color('primary');
149
- outline-offset: -2px;
150
- background-color: t.color('primary-container');
151
- color: t.color('on-primary-container');
152
- }
153
-
154
- // Remove spinner arrows
155
- -moz-appearance: textfield;
156
- &::-webkit-outer-spin-button,
157
- &::-webkit-inner-spin-button {
158
- -webkit-appearance: none;
159
- margin: 0;
160
- }
161
- }
162
-
163
- // Dial mode: the boxes are radios. TimeSelector tokens: an 8dp
164
- // surface-container-highest container with an on-surface label, filled
165
- // primary-container when selected; state layers in the label colour.
166
- &:not([type="number"]) {
167
- --#{$component}-container: #{t.color('surface-container-highest')};
168
- --#{$component}-label: #{t.color('on-surface')};
169
- background-color: color-mix(in srgb, var(--#{$component}-label) var(--#{$component}-layer, 0%), var(--#{$component}-container));
170
- color: var(--#{$component}-label);
171
-
172
- &:hover { --#{$component}-layer: 8%; }
173
- &:focus-visible, &:active { --#{$component}-layer: 10%; }
174
-
175
- &[data-active="true"] {
176
- --#{$component}-container: #{t.color('primary-container')};
177
- --#{$component}-label: #{t.color('on-primary-container')};
178
- }
179
-
180
- // md.comp.focus-ring
181
- &:focus { outline: none; }
182
- &:focus-visible { outline: 3px solid t.color('secondary'); outline-offset: 2px; }
183
- }
184
- }
185
-
186
- // Input mode names its fields below them, in Body Small on-surface-variant.
187
- &__input-label {
188
- margin-top: 4px;
189
- @include m.typography('body-small');
190
- color: t.color('on-surface-variant');
191
- }
192
-
193
- // The colon: 24dp wide, as tall as the boxes, on-surface.
194
- &__separator {
195
- display: flex;
196
- align-items: center;
197
- justify-content: center;
198
- width: 24px;
199
- height: 80px;
200
- @include m.typography('display-large');
201
- color: t.color('on-surface');
202
- }
203
-
204
- // Period selector (AM/PM): 52x80dp beside the time (52x72 in input mode),
205
- // corner small with a 1dp outline and a divider; unselected is transparent.
206
- &__period {
207
- box-sizing: border-box;
208
- display: flex;
209
- flex-direction: column;
210
- flex-shrink: 0;
211
- width: 52px;
212
- height: 80px;
213
- margin-inline-start: 12px;
214
- border-radius: f.get-shape('small');
215
- overflow: hidden;
216
- // PeriodSelectorOutlineColor is Outline, not OutlineVariant.
217
- border: 1px solid t.color('outline');
218
-
219
- &-am,
220
- &-pm {
221
- display: flex;
222
- flex: 1;
223
- align-items: center;
224
- justify-content: center;
225
- cursor: pointer;
226
- @include m.typography('title-medium');
227
- // PeriodSelectorUnselectedLabelTextColor. It was inherited before, so an
228
- // unselected period took the dialog's on-surface.
229
- color: t.color('on-surface-variant');
230
-
231
- // Improve focus styles for keyboard navigation
232
- &:focus-visible {
233
- outline: 2px solid t.color('primary');
234
- outline-offset: -2px;
235
- }
236
-
237
- &:hover {
238
- background-color: t.alpha('on-surface-variant', 0.08);
239
- }
240
-
241
- &:active {
242
- background-color: t.alpha('on-surface-variant', v.state('pressed-state-layer-opacity'));
243
- }
244
-
245
- // No time in this half of the day is inside minTime/maxTime.
246
- &[aria-disabled="true"] {
247
- opacity: 0.38;
248
- cursor: default;
249
- pointer-events: none;
250
- }
251
- }
252
-
253
- &-pm {
254
- border-block-start: 1px solid t.color('outline');
255
- }
256
-
257
- // PeriodSelectorSelectedContainerColor is TertiaryContainer and its label
258
- // OnTertiaryContainer. The primary pair it used belongs to the time
259
- // selector, which is why AM/PM and the hour field looked alike.
260
- &--selected {
261
- background-color: t.color('tertiary-container');
262
- color: t.color('on-tertiary-container');
263
-
264
- &:hover {
265
- background-color: color-mix(in srgb, t.color('on-tertiary-container') 8%, t.color('tertiary-container'));
266
- }
267
- }
268
- }
269
-
270
- // Clock dial
271
- &__dial {
272
- display: flex;
273
- align-items: center;
274
- justify-content: center;
275
- position: relative;
276
- margin: 0 auto 24px;
277
- width: 256px;
278
- height: 256px;
279
-
280
- }
281
-
282
- // The DOM dial, m3.material.io's clock dial: a 256dp surface-container-
283
- // highest face with Body Large numbers, a 2dp primary track, an 8dp centre dot and
284
- // a 48dp primary handle; under the handle the numbers read on-primary. One
285
- // animated angle and radius place the track, the handle and that clipped copy, so
286
- // they move together on the default spatial spring. A drag moves them directly.
287
- &__dial-face {
288
- position: relative;
289
- width: 256px;
290
- height: 256px;
291
- border-radius: 50%;
292
- background-color: t.color('surface-container-highest');
293
- color: t.color('on-surface');
294
- touch-action: none;
295
- cursor: pointer;
296
- user-select: none;
297
- -webkit-tap-highlight-color: transparent;
298
- transition: m.spring(--#{$component}-angle, default-spatial);
299
- transition-property: --#{$component}-angle, --#{$component}-radius;
300
-
301
- &--dragging { transition: none; }
302
- &--swap .#{$component}__dial-numbers:not(.#{$component}__dial-numbers--selected) { animation: #{$component}-swap 175ms linear; }
303
- }
304
-
305
- &__dial-numbers {
306
- position: absolute;
307
- inset: 0;
308
- border-radius: 50%;
309
-
310
- &--selected {
311
- color: t.color('on-primary');
312
- pointer-events: none;
313
- clip-path: circle(24px at calc(50% + sin(var(--#{$component}-angle)) * var(--#{$component}-radius)) calc(50% - cos(var(--#{$component}-angle)) * var(--#{$component}-radius)));
314
- }
315
- }
316
-
317
- &__dial-number {
318
- position: absolute;
319
- top: 50%;
320
- left: 50%;
321
- box-sizing: border-box;
322
- width: 48px;
323
- height: 48px;
324
- margin: -24px 0 0 -24px;
325
- display: flex;
326
- align-items: center;
327
- justify-content: center;
328
- border-radius: 50%;
329
- transform: translate(var(--#{$component}-x), var(--#{$component}-y));
330
- @include m.typography('body-large');
331
-
332
- &--inner { @include m.typography('body-medium'); }
333
-
334
- // md.comp.focus-ring on the focused number.
335
- &:focus-visible { outline: 3px solid t.color('secondary'); outline-offset: 2px; }
336
-
337
- // Outside minTime/maxTime or off the step: M3's disabled content,
338
- // at 38%.
339
- &[aria-disabled="true"] { opacity: 0.38; cursor: default; }
340
- }
341
-
342
- &__dial-track {
343
- position: absolute;
344
- left: calc(50% - 1px);
345
- bottom: 50%;
346
- width: 2px;
347
- height: var(--#{$component}-radius);
348
- background-color: t.color('primary');
349
- transform-origin: 50% 100%;
350
- transform: rotate(var(--#{$component}-angle));
351
- pointer-events: none;
352
- }
353
-
354
- &__dial-centre {
355
- position: absolute;
356
- inset: calc(50% - 4px);
357
- border-radius: 50%;
358
- background-color: t.color('primary');
359
- pointer-events: none;
360
- }
361
-
362
- &__dial-handle {
363
- position: absolute;
364
- width: 48px;
365
- height: 48px;
366
- left: calc(50% + sin(var(--#{$component}-angle)) * var(--#{$component}-radius) - 24px);
367
- top: calc(50% - cos(var(--#{$component}-angle)) * var(--#{$component}-radius) - 24px);
368
- border-radius: 50%;
369
- background-color: t.color('primary');
370
- pointer-events: none;
371
-
372
- // Between two labels (a minute like 07) the handle shows a dot.
373
- &--between::after {
374
- content: '';
375
- position: absolute;
376
- inset: calc(50% - 2px);
377
- border-radius: 50%;
378
- background-color: t.color('on-primary');
379
- }
380
- }
381
-
382
- // Actions footer
383
- &__actions {
384
- display: flex;
385
- align-items: center;
386
- justify-content: space-between;
387
- padding: 16px 24px 24px;
388
- }
389
-
390
- &__toggle-type {
391
- font: inherit;
392
- background: transparent;
393
- border: none;
394
- padding: 8px;
395
- border-radius: 50%;
396
- cursor: pointer;
397
- color: t.color('on-surface-variant');
398
-
399
- // Improve touch target sizes on mobile
400
- @media (max-width: 599px) {
401
- min-height: 48px;
402
- min-width: 48px;
403
- }
404
-
405
- // Improve focus styles for keyboard navigation
406
- &:focus-visible {
407
- outline: 2px solid t.color('primary');
408
- outline-offset: 2px;
409
- }
410
-
411
- &:hover {
412
- background-color: t.alpha('on-surface', 0.08);
413
- }
414
-
415
- &:active {
416
- background-color: t.alpha('on-surface', v.state('pressed-state-layer-opacity'));
417
- }
418
-
419
- svg {
420
- width: 24px;
421
- height: 24px;
422
- display: block;
423
- }
424
- }
425
-
426
- &__action-buttons {
427
- display: flex;
428
- gap: 8px;
429
- }
430
-
431
- &__cancel,
432
- &__confirm {
433
- padding: 10px 12px;
434
- border: none;
435
- background: transparent;
436
- border-radius: f.get-shape('small');
437
- cursor: pointer;
438
- @include m.typography('label-large');
439
- color: t.color('primary');
440
-
441
- // Improve touch target sizes on mobile
442
- @media (max-width: 599px) {
443
- min-height: 48px;
444
- padding: 12px 16px;
445
- }
446
-
447
- // Improve focus styles for keyboard navigation
448
- &:focus-visible {
449
- outline: 2px solid t.color('primary');
450
- outline-offset: 2px;
451
- }
452
-
453
- &:hover {
454
- background-color: t.alpha('primary', 0.08);
455
- }
456
-
457
- &:active {
458
- background-color: t.alpha('primary', v.state('pressed-state-layer-opacity'));
459
- }
460
- }
461
-
462
- // Responsive adjustments
463
- @media (max-width: 599px) {
464
- &__dialog {
465
- width: 100%;
466
- max-width: 100%;
467
- min-height: 460px;
468
- border-radius: 0;
469
- margin: 0;
470
-
471
- &--horizontal {
472
- flex-direction: column;
473
-
474
- .#{$component}__content {
475
- flex-direction: column;
476
- }
477
-
478
- .#{$component}__dial {
479
- margin-inline-start: 0;
480
- }
481
- }
482
- }
483
-
484
- &__input-container {
485
- margin: 16px 0;
486
- }
487
-
488
- }
489
-
490
- // Accessibility
491
- &__sr-only {
492
- position: absolute;
493
- width: 1px;
494
- height: 1px;
495
- padding: 0;
496
- margin: -1px;
497
- overflow: hidden;
498
- clip: rect(0, 0, 0, 0);
499
- white-space: nowrap;
500
- border: 0;
501
- }
502
- }
503
-
504
- // Input mode: fields and AM/PM are 72dp tall.
11
+ position: relative;
12
+ display: inline-block;
13
+
14
+ &__dialog {
15
+ box-sizing: border-box;
16
+ margin: auto;
17
+ padding: 0;
18
+ border: 0;
19
+ min-width: 280px;
20
+ max-width: 328px;
21
+ max-height: 520px;
22
+ background-color: t.color('surface-container-high');
23
+ color: t.color('on-surface');
24
+ border-radius: f.get-shape('extra-large');
25
+ @include m.elevation(3);
26
+
27
+ &[open] {
28
+ display: flex;
29
+ flex-direction: column;
30
+ animation: #{$component}-appear 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
31
+ }
32
+
33
+ &::backdrop { background: t.alpha('scrim', 0.32); }
34
+
35
+ &--horizontal {
36
+ min-width: 520px;
37
+ min-height: 360px;
38
+
39
+ .#{$component}__content {
40
+ flex-direction: row;
41
+ align-items: center;
42
+ }
43
+
44
+ .#{$component}__input-container {
45
+ flex-direction: column;
46
+ align-items: center;
47
+ }
48
+
49
+ .#{$component}__period {
50
+ flex-direction: row;
51
+ width: 216px;
52
+ height: 38px;
53
+ margin: 12px 0 0;
54
+ }
55
+
56
+ .#{$component}__period-pm {
57
+ border-block-start: 0;
58
+ border-inline-start: 1px solid t.color('outline');
59
+ }
60
+
61
+ .#{$component}__dial {
62
+ margin-inline-start: 24px;
63
+ }
64
+ }
65
+
66
+ &--24h {
67
+ .#{$component}__period {
68
+ display: none;
69
+ }
70
+ }
71
+ }
72
+
73
+ &__title {
74
+ padding: 24px 24px 16px;
75
+ @include m.typography('label-medium');
76
+ color: t.color('on-surface-variant');
77
+ }
78
+
79
+ &__content {
80
+ flex: 1;
81
+ padding: 0 24px;
82
+ overflow: hidden;
83
+ display: flex;
84
+ flex-direction: column;
85
+ align-items: center;
86
+ }
87
+
88
+ &__input-container {
89
+ display: flex;
90
+ align-items: flex-start;
91
+ justify-content: center;
92
+ margin: 0 0 24px 0;
93
+ }
94
+
95
+ &__selectors {
96
+ display: flex;
97
+ align-items: flex-start;
98
+ direction: ltr;
99
+ }
100
+
101
+ &__time-input-field {
102
+ display: flex;
103
+ flex-direction: column;
104
+ }
105
+
106
+ &__hours,
107
+ &__minutes,
108
+ &__seconds {
109
+ box-sizing: border-box;
110
+ width: 96px;
111
+ height: 80px;
112
+ margin: 0;
113
+ padding: 0;
114
+ border: 0;
115
+ border-radius: f.get-shape('small');
116
+ text-align: center;
117
+ cursor: pointer;
118
+ @include m.typography('display-large');
119
+
120
+ &[type="number"] {
121
+ height: 72px;
122
+ @include m.typography('display-medium');
123
+ background-color: t.color('surface-container-highest');
124
+ color: t.color('on-surface');
125
+ cursor: text;
126
+
127
+ &:focus {
128
+ outline: 2px solid t.color('primary');
129
+ outline-offset: -2px;
130
+ background-color: t.color('primary-container');
131
+ color: t.color('on-primary-container');
132
+ }
133
+
134
+ -moz-appearance: textfield;
135
+ &::-webkit-outer-spin-button,
136
+ &::-webkit-inner-spin-button {
137
+ -webkit-appearance: none;
138
+ margin: 0;
139
+ }
140
+ }
141
+
142
+ &:not([type="number"]) {
143
+ --#{$component}-container: #{t.color('surface-container-highest')};
144
+ --#{$component}-label: #{t.color('on-surface')};
145
+ background-color: color-mix(in srgb, var(--#{$component}-label) var(--#{$component}-layer, 0%), var(--#{$component}-container));
146
+ color: var(--#{$component}-label);
147
+
148
+ &:hover { --#{$component}-layer: 8%; }
149
+ &:focus-visible, &:active { --#{$component}-layer: 10%; }
150
+
151
+ &[data-active="true"] {
152
+ --#{$component}-container: #{t.color('primary-container')};
153
+ --#{$component}-label: #{t.color('on-primary-container')};
154
+ }
155
+
156
+ &:focus { outline: none; }
157
+ &:focus-visible { outline: 3px solid t.color('secondary'); outline-offset: 2px; }
158
+ }
159
+ }
160
+
161
+ &__input-label {
162
+ margin-top: 4px;
163
+ @include m.typography('body-small');
164
+ color: t.color('on-surface-variant');
165
+ }
166
+
167
+ &__separator {
168
+ display: flex;
169
+ align-items: center;
170
+ justify-content: center;
171
+ width: 24px;
172
+ height: 80px;
173
+ @include m.typography('display-large');
174
+ color: t.color('on-surface');
175
+ }
176
+
177
+ &__period {
178
+ box-sizing: border-box;
179
+ display: flex;
180
+ flex-direction: column;
181
+ flex-shrink: 0;
182
+ width: 52px;
183
+ height: 80px;
184
+ margin-inline-start: 12px;
185
+ border-radius: f.get-shape('small');
186
+ overflow: hidden;
187
+ border: 1px solid t.color('outline');
188
+
189
+ &-am,
190
+ &-pm {
191
+ display: flex;
192
+ flex: 1;
193
+ align-items: center;
194
+ justify-content: center;
195
+ cursor: pointer;
196
+ @include m.typography('title-medium');
197
+ color: t.color('on-surface-variant');
198
+
199
+ &:focus-visible {
200
+ outline: 2px solid t.color('primary');
201
+ outline-offset: -2px;
202
+ }
203
+
204
+ &:hover {
205
+ background-color: t.alpha('on-surface-variant', 0.08);
206
+ }
207
+
208
+ &:active {
209
+ background-color: t.alpha('on-surface-variant', v.state('pressed-state-layer-opacity'));
210
+ }
211
+
212
+ &[aria-disabled="true"] {
213
+ opacity: 0.38;
214
+ cursor: default;
215
+ pointer-events: none;
216
+ }
217
+ }
218
+
219
+ &-pm {
220
+ border-block-start: 1px solid t.color('outline');
221
+ }
222
+
223
+ &--selected {
224
+ background-color: t.color('tertiary-container');
225
+ color: t.color('on-tertiary-container');
226
+
227
+ &:hover {
228
+ background-color: color-mix(in srgb, t.color('on-tertiary-container') 8%, t.color('tertiary-container'));
229
+ }
230
+ }
231
+ }
232
+
233
+ &__dial {
234
+ display: flex;
235
+ align-items: center;
236
+ justify-content: center;
237
+ position: relative;
238
+ margin: 0 auto 24px;
239
+ width: 256px;
240
+ height: 256px;
241
+
242
+ }
243
+
244
+ &__dial-face {
245
+ position: relative;
246
+ width: 256px;
247
+ height: 256px;
248
+ border-radius: 50%;
249
+ background-color: t.color('surface-container-highest');
250
+ color: t.color('on-surface');
251
+ touch-action: none;
252
+ cursor: pointer;
253
+ user-select: none;
254
+ -webkit-tap-highlight-color: transparent;
255
+ transition: m.spring(--#{$component}-angle, default-spatial);
256
+ transition-property: --#{$component}-angle, --#{$component}-radius;
257
+
258
+ &--dragging { transition: none; }
259
+ &--swap .#{$component}__dial-numbers:not(.#{$component}__dial-numbers--selected) { animation: #{$component}-swap 175ms linear; }
260
+ }
261
+
262
+ &__dial-numbers {
263
+ position: absolute;
264
+ inset: 0;
265
+ border-radius: 50%;
266
+
267
+ &--selected {
268
+ color: t.color('on-primary');
269
+ pointer-events: none;
270
+ clip-path: circle(24px at calc(50% + sin(var(--#{$component}-angle)) * var(--#{$component}-radius)) calc(50% - cos(var(--#{$component}-angle)) * var(--#{$component}-radius)));
271
+ }
272
+ }
273
+
274
+ &__dial-number {
275
+ position: absolute;
276
+ top: 50%;
277
+ left: 50%;
278
+ box-sizing: border-box;
279
+ width: 48px;
280
+ height: 48px;
281
+ margin: -24px 0 0 -24px;
282
+ display: flex;
283
+ align-items: center;
284
+ justify-content: center;
285
+ border-radius: 50%;
286
+ transform: translate(var(--#{$component}-x), var(--#{$component}-y));
287
+ @include m.typography('body-large');
288
+
289
+ &--inner { @include m.typography('body-medium'); }
290
+
291
+ &:focus-visible { outline: 3px solid t.color('secondary'); outline-offset: 2px; }
292
+
293
+ &[aria-disabled="true"] { opacity: 0.38; cursor: default; }
294
+ }
295
+
296
+ &__dial-track {
297
+ position: absolute;
298
+ left: calc(50% - 1px);
299
+ bottom: 50%;
300
+ width: 2px;
301
+ height: var(--#{$component}-radius);
302
+ background-color: t.color('primary');
303
+ transform-origin: 50% 100%;
304
+ transform: rotate(var(--#{$component}-angle));
305
+ pointer-events: none;
306
+ }
307
+
308
+ &__dial-centre {
309
+ position: absolute;
310
+ inset: calc(50% - 4px);
311
+ border-radius: 50%;
312
+ background-color: t.color('primary');
313
+ pointer-events: none;
314
+ }
315
+
316
+ &__dial-handle {
317
+ position: absolute;
318
+ width: 48px;
319
+ height: 48px;
320
+ left: calc(50% + sin(var(--#{$component}-angle)) * var(--#{$component}-radius) - 24px);
321
+ top: calc(50% - cos(var(--#{$component}-angle)) * var(--#{$component}-radius) - 24px);
322
+ border-radius: 50%;
323
+ background-color: t.color('primary');
324
+ pointer-events: none;
325
+
326
+ &--between::after {
327
+ content: '';
328
+ position: absolute;
329
+ inset: calc(50% - 2px);
330
+ border-radius: 50%;
331
+ background-color: t.color('on-primary');
332
+ }
333
+ }
334
+
335
+ &__actions {
336
+ display: flex;
337
+ align-items: center;
338
+ justify-content: space-between;
339
+ padding: 16px 24px 24px;
340
+ }
341
+
342
+ &__toggle-type {
343
+ font: inherit;
344
+ background: transparent;
345
+ border: none;
346
+ padding: 8px;
347
+ border-radius: 50%;
348
+ cursor: pointer;
349
+ color: t.color('on-surface-variant');
350
+
351
+ @media (max-width: 599px) {
352
+ min-height: 48px;
353
+ min-width: 48px;
354
+ }
355
+
356
+ &:focus-visible {
357
+ outline: 2px solid t.color('primary');
358
+ outline-offset: 2px;
359
+ }
360
+
361
+ &:hover {
362
+ background-color: t.alpha('on-surface', 0.08);
363
+ }
364
+
365
+ &:active {
366
+ background-color: t.alpha('on-surface', v.state('pressed-state-layer-opacity'));
367
+ }
368
+
369
+ svg {
370
+ width: 24px;
371
+ height: 24px;
372
+ display: block;
373
+ }
374
+ }
375
+
376
+ &__action-buttons {
377
+ display: flex;
378
+ gap: 8px;
379
+ }
380
+
381
+ &__cancel,
382
+ &__confirm {
383
+ padding: 10px 12px;
384
+ border: none;
385
+ background: transparent;
386
+ border-radius: f.get-shape('small');
387
+ cursor: pointer;
388
+ @include m.typography('label-large');
389
+ color: t.color('primary');
390
+
391
+ @media (max-width: 599px) {
392
+ min-height: 48px;
393
+ padding: 12px 16px;
394
+ }
395
+
396
+ &:focus-visible {
397
+ outline: 2px solid t.color('primary');
398
+ outline-offset: 2px;
399
+ }
400
+
401
+ &:hover {
402
+ background-color: t.alpha('primary', 0.08);
403
+ }
404
+
405
+ &:active {
406
+ background-color: t.alpha('primary', v.state('pressed-state-layer-opacity'));
407
+ }
408
+ }
409
+
410
+ @media (max-width: 599px) {
411
+ &__dialog {
412
+ width: 100%;
413
+ max-width: 100%;
414
+ min-height: 460px;
415
+ border-radius: 0;
416
+ margin: 0;
417
+
418
+ &--horizontal {
419
+ flex-direction: column;
420
+
421
+ .#{$component}__content {
422
+ flex-direction: column;
423
+ }
424
+
425
+ .#{$component}__dial {
426
+ margin-inline-start: 0;
427
+ }
428
+ }
429
+ }
430
+
431
+ &__input-container {
432
+ margin: 16px 0;
433
+ }
434
+
435
+ }
436
+ }
437
+
505
438
  .#{$component}__dialog--input {
506
- .#{$component}__separator { height: 72px; }
507
- .#{$component}__period { height: 72px; }
439
+ .#{$component}__separator { height: 72px; }
440
+ .#{$component}__period { height: 72px; }
508
441
  }
509
442
 
510
- // 24-hour dial, vertical: the two boxes widen to 114dp (Compose), there being no
511
- // AM/PM beside them.
512
443
  .#{$component}__dialog--dial.#{$component}__dialog--24h.#{$component}__dialog--vertical .#{$component}__selectors:not(:has(.#{$component}__seconds)) :is(.#{$component}__hours, .#{$component}__minutes) {
513
- width: 114px;
444
+ width: 114px;
514
445
  }
515
446
 
516
447
  @keyframes #{$component}-appear {
517
- from { opacity: 0; transform: translateY(20px) scale(0.9); }
448
+ from { opacity: 0; transform: translateY(20px) scale(0.9); }
518
449
  }
519
450
 
520
451
 
521
- // The dial's angle and radius animate as values, so the hand, the handle and the
522
- // clipped labels move together on one spring.
523
452
  @property --#{$component}-angle { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
524
453
  @property --#{$component}-radius { syntax: '<length>'; inherits: true; initial-value: 101px; }
525
454
 
526
455
  @keyframes #{$component}-swap {
527
- from { opacity: 0; }
456
+ from { opacity: 0; }
528
457
  }
529
458
 
530
459
  @media (prefers-reduced-motion: reduce) {
531
- .#{$component}__dialog[open] { animation: none; }
532
- .#{$component}__dial-face { transition: none; }
533
- .#{$component}__dial-face--swap .#{$component}__dial-numbers { animation: none; }
460
+ .#{$component}__dialog[open] { animation: none; }
461
+ .#{$component}__dial-face { transition: none; }
462
+ .#{$component}__dial-face--swap .#{$component}__dial-numbers { animation: none; }
534
463
  }