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
- // src/styles/components/_toolbar.scss
2
- //
3
- // M3 Expressive toolbars (m3.material.io toolbars specs and guidelines;
4
- // Compose DockedToolbarTokens and FloatingToolbarTokens):
5
- // - docked: 64dp, full width, square corners, no shadow, 16dp at each end,
6
- // items spread across the width or centred 32dp apart
7
- // - floating: 64dp pill, 8dp padding, items 4dp apart, elevation level 1,
8
- // 16dp from the window edge (24dp when vertical), a FAB 8dp away
9
- // - standard on surface container, vibrant on primary container
10
1
  @use '../../styles/abstract/base' as base;
11
2
  @use '../../styles/abstract/variables' as v;
12
3
  @use '../../styles/abstract/functions' as f;
@@ -17,242 +8,187 @@
17
8
  $component: '#{base.$prefix}-toolbar';
18
9
 
19
10
  .#{$component} {
20
- --#{$component}-container: #{t.color('surface-container')};
21
- --#{$component}-content: #{t.color('on-surface-variant')};
22
- // The window-edge margin of a placed floating toolbar
23
- --#{$component}-margin: 16px;
24
- // The direction multiplier: 1 left-to-right at the root, -1 under the
25
- // direction arm. Declared here, not only used as a var() fallback, because a
26
- // custom property inherits: a nested LTR instance must not read its RTL
27
- // parent's -1.
28
- --#{$component}-dir: 1;
29
-
30
- display: flex;
31
- align-items: center;
32
- gap: 8px;
33
- box-sizing: border-box;
34
- transition: transform v.motion('spring-fast-spatial-duration') v.motion('spring-fast-spatial-easing');
35
-
36
- &__bar {
37
- display: flex;
38
- align-items: center;
39
- justify-content: center;
40
- box-sizing: border-box;
41
- min-height: 64px;
42
- color: var(--#{$component}-content);
43
-
44
- > * {
45
- flex-shrink: 0;
46
- }
47
- }
48
-
49
- &__fab {
50
- display: flex;
51
- }
52
-
53
- // Docked: the whole width is the container, the FAB included
54
- &--docked {
55
- // Docked, the toolbar meets the window edges
56
- --#{$component}-margin: 0px;
57
- width: 100%;
58
- min-height: 64px;
59
- padding-inline: 16px;
60
- background-color: var(--#{$component}-container);
61
- border-radius: var(--#{$component}-shape, #{v.shape('none')});
62
-
63
- .#{$component}__bar {
64
- flex: 1;
65
- justify-content: space-between;
66
- }
67
- }
68
-
69
- &--center .#{$component}__bar {
70
- justify-content: center;
71
- gap: 32px;
72
- }
73
-
74
- // Floating: the bar is the pill; the FAB sits beside it
75
- &--floating {
76
- width: fit-content;
77
-
78
- .#{$component}__bar {
79
- gap: 4px;
80
- padding: 8px;
81
- background-color: var(--#{$component}-container);
82
- border-radius: var(--#{$component}-shape, #{v.shape('full')});
83
- }
84
- }
85
-
86
- &--elevated .#{$component}__bar {
87
- @include m.elevation(1);
88
- }
89
-
90
- &--vertical {
91
- --#{$component}-margin: 24px;
92
- flex-direction: column;
93
-
94
- .#{$component}__bar {
95
- flex-direction: column;
96
- min-height: 0;
97
- min-width: 64px;
98
- }
99
- }
100
-
101
- // Vibrant: primary container, and the item colours of FloatingToolbarTokens,
102
- // set as the items' custom properties so they reach into the elements'
103
- // shadow roots. "Toggle tonal button: Surface container / On surface"
104
- // (m3.material.io toolbars specs); filled buttons keep primary.
105
- &--vibrant {
106
- --#{$component}-container: #{t.color('primary-container')};
107
- --#{$component}-content: #{t.color('on-primary-container')};
108
- --#{base.$prefix}-icon-button-standard-color: #{t.color('on-primary-container')};
109
- --#{base.$prefix}-button-text-color: #{t.color('on-primary-container')};
110
- --#{base.$prefix}-icon-button-selected-container: #{t.color('surface-container')};
111
- --#{base.$prefix}-icon-button-selected-color: #{t.color('on-surface')};
112
- }
113
-
114
- // Placements, in a positioned container
115
- &--bottom,
116
- &--top,
117
- &--start,
118
- &--end {
119
- position: absolute;
120
- z-index: f.get-z-index('fixed');
121
- }
122
-
123
- // Placed, a floating toolbar keeps its margin from the window edges
124
- &--bottom,
125
- &--top {
126
- inset-inline: 0;
127
- margin-inline: auto;
128
- max-width: calc(100% - 2 * var(--#{$component}-margin));
129
- }
130
-
131
- &--bottom {
132
- bottom: 0;
133
- }
134
-
135
- &--top {
136
- top: 0;
137
- }
138
-
139
- &--start,
140
- &--end {
141
- inset-block: 0;
142
- margin-block: auto;
143
- height: fit-content;
144
- max-height: calc(100% - 2 * var(--#{$component}-margin));
145
- }
146
-
147
- // The placement class sits on this root, which the runtime may also mark:
148
- // the self form covers a marker on the toolbar itself
149
- // (abstract/_direction.scss).
150
- &--start {
151
- @include d.start(var(--#{$component}-margin), $self: true);
152
- }
153
-
154
- &--end {
155
- @include d.end(var(--#{$component}-margin), $self: true);
156
- }
157
-
158
- &--floating.#{$component}--bottom {
159
- bottom: var(--#{$component}-margin);
160
- }
161
-
162
- &--floating.#{$component}--top {
163
- top: var(--#{$component}-margin);
164
- }
165
-
166
- // Off screen, past the edge it is placed at
167
- &--hidden {
168
- @include m.rtl($self: true) {
169
- --#{$component}-dir: -1;
170
- }
171
-
172
- &.#{$component}--bottom {
173
- transform: translateY(calc(100% + var(--#{$component}-margin)));
174
- }
175
-
176
- &.#{$component}--docked.#{$component}--bottom {
177
- transform: translateY(100%);
178
- }
179
-
180
- &.#{$component}--top {
181
- transform: translateY(calc(-100% - var(--#{$component}-margin)));
182
- }
183
-
184
- // The edge it leaves is physical: start and end trade sides in right-to-left,
185
- // where the root's multiplier is -1.
186
- &.#{$component}--start {
187
- transform: translateX(calc(-1 * var(--#{$component}-dir) * (100% + var(--#{$component}-margin))));
188
- }
189
-
190
- &.#{$component}--end {
191
- transform: translateX(calc(var(--#{$component}-dir) * (100% + var(--#{$component}-margin))));
192
- }
193
-
194
- // In the flow there is no edge to leave by
195
- &:not(.#{$component}--bottom, .#{$component}--top, .#{$component}--start, .#{$component}--end) {
196
- visibility: hidden;
197
- }
198
- }
199
-
200
- @include m.reduced-motion {
201
- transition-duration: 0.01ms;
202
- }
203
-
204
- @include m.high-contrast {
205
- &--docked,
206
- &--floating .#{$component}__bar {
207
- outline: 1px solid currentColor;
208
- }
209
- }
210
- }
211
-
212
- // A toolbar shows a selected item through its colour alone: the m3 toolbars
213
- // specs give a selected toggle item colour roles and the toolbar token set
214
- // has no item shape tokens, while a standalone toggle icon button morphs
215
- // round to square when selected (icon buttons specs) and "their square
216
- // shape conflicts with the fully-rounded shape of the floating toolbar
217
- // container". So the morph targets of a round item are pinned to its round
218
- // radius, selected and pressed. (Pressed is this library's reading of the
219
- // report — round stays round — not something the toolbars spec asks for.)
220
- // The pins are each item's own resting round radius, half the container
221
- // height per size (styles/components/_icon-button.scss, which owns them),
222
- // and they reach only the bar's direct items:
223
- // - a round icon button that is a child of the bar in the same tree (a
224
- // factory toolbar's items and overflow button, and the <m-toolbar>
225
- // element's own overflow button): a size changed later swaps the size
226
- // class, and the selector follows;
227
- // - an icon-button host assigned to the bar's default slot (an
228
- // <m-icon-button> slotted into an <m-toolbar>), behind its own shadow
229
- // root where no descendant selector reaches: ::slotted() matches it where
230
- // it is assigned, by the marker attribute every icon-button host of this
231
- // library carries whatever its tag prefix (src/elements/icon-button.ts,
232
- // src/elements/define.ts — the sheet cannot spell a tag the page chose),
233
- // and [size=…] follows a size changed after insertion, the size attribute
234
- // being the host's public size (the element exposes no size property to
235
- // drift from it). The default tag is matched as well, so markup that
236
- // reaches the browser without the marker by any path — an adapter not
237
- // writing it, hand-written HTML, a cached page from an older server
238
- // render — still pins under the default prefix, as before the marker; a
239
- // custom prefix cannot be spelled and needs the marker. :is() weighs its
240
- // most specific argument, so the compound keeps the bare attribute's
241
- // (0,1,0). Another library's icon button keeps the standalone
242
- // morphs.
243
- // Anything deeper — an icon button in the overflow menu's content, a dialog
244
- // or menu opened from the bar, a composite child — matches neither selector
245
- // and keeps the standalone morphs.
11
+ --#{$component}-container: #{t.color('surface-container')};
12
+ --#{$component}-content: #{t.color('on-surface-variant')};
13
+ --#{$component}-margin: 16px;
14
+ --#{$component}-dir: 1;
15
+
16
+ display: flex;
17
+ align-items: center;
18
+ gap: 8px;
19
+ box-sizing: border-box;
20
+ transition: transform v.motion('spring-fast-spatial-duration') v.motion('spring-fast-spatial-easing');
21
+
22
+ &__bar {
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ box-sizing: border-box;
27
+ min-height: 64px;
28
+ color: var(--#{$component}-content);
29
+
30
+ > * {
31
+ flex-shrink: 0;
32
+ }
33
+ }
34
+
35
+ &__fab {
36
+ display: flex;
37
+ }
38
+
39
+ &--docked {
40
+ --#{$component}-margin: 0px;
41
+ width: 100%;
42
+ min-height: 64px;
43
+ padding-inline: 16px;
44
+ background-color: var(--#{$component}-container);
45
+ border-radius: var(--#{$component}-shape, #{v.shape('none')});
46
+
47
+ .#{$component}__bar {
48
+ flex: 1;
49
+ justify-content: space-between;
50
+ }
51
+ }
52
+
53
+ &--center .#{$component}__bar {
54
+ justify-content: center;
55
+ gap: 32px;
56
+ }
57
+
58
+ &--floating {
59
+ width: fit-content;
60
+
61
+ .#{$component}__bar {
62
+ gap: 4px;
63
+ padding: 8px;
64
+ background-color: var(--#{$component}-container);
65
+ border-radius: var(--#{$component}-shape, #{v.shape('full')});
66
+ }
67
+ }
68
+
69
+ &--elevated .#{$component}__bar {
70
+ @include m.elevation(1);
71
+ }
72
+
73
+ &--vertical {
74
+ --#{$component}-margin: 24px;
75
+ flex-direction: column;
76
+
77
+ .#{$component}__bar {
78
+ flex-direction: column;
79
+ min-height: 0;
80
+ min-width: 64px;
81
+ }
82
+ }
83
+
84
+ &--vibrant {
85
+ --#{$component}-container: #{t.color('primary-container')};
86
+ --#{$component}-content: #{t.color('on-primary-container')};
87
+ --#{base.$prefix}-icon-button-standard-color: #{t.color('on-primary-container')};
88
+ --#{base.$prefix}-button-text-color: #{t.color('on-primary-container')};
89
+ --#{base.$prefix}-icon-button-selected-container: #{t.color('surface-container')};
90
+ --#{base.$prefix}-icon-button-selected-color: #{t.color('on-surface')};
91
+ }
92
+
93
+ &--bottom,
94
+ &--top,
95
+ &--start,
96
+ &--end {
97
+ position: absolute;
98
+ z-index: f.get-z-index('fixed');
99
+ }
100
+
101
+ &--bottom,
102
+ &--top {
103
+ inset-inline: 0;
104
+ margin-inline: auto;
105
+ max-width: calc(100% - 2 * var(--#{$component}-margin));
106
+ }
107
+
108
+ &--bottom {
109
+ bottom: 0;
110
+ }
111
+
112
+ &--top {
113
+ top: 0;
114
+ }
115
+
116
+ &--start,
117
+ &--end {
118
+ inset-block: 0;
119
+ margin-block: auto;
120
+ height: fit-content;
121
+ max-height: calc(100% - 2 * var(--#{$component}-margin));
122
+ }
123
+
124
+ &--start {
125
+ @include d.start(var(--#{$component}-margin), $self: true);
126
+ }
127
+
128
+ &--end {
129
+ @include d.end(var(--#{$component}-margin), $self: true);
130
+ }
131
+
132
+ &--floating.#{$component}--bottom {
133
+ bottom: var(--#{$component}-margin);
134
+ }
135
+
136
+ &--floating.#{$component}--top {
137
+ top: var(--#{$component}-margin);
138
+ }
139
+
140
+ &--hidden {
141
+ @include m.rtl($self: true) {
142
+ --#{$component}-dir: -1;
143
+ }
144
+
145
+ &.#{$component}--bottom {
146
+ transform: translateY(calc(100% + var(--#{$component}-margin)));
147
+ }
148
+
149
+ &.#{$component}--docked.#{$component}--bottom {
150
+ transform: translateY(100%);
151
+ }
152
+
153
+ &.#{$component}--top {
154
+ transform: translateY(calc(-100% - var(--#{$component}-margin)));
155
+ }
156
+
157
+ &.#{$component}--start {
158
+ transform: translateX(calc(-1 * var(--#{$component}-dir) * (100% + var(--#{$component}-margin))));
159
+ }
160
+
161
+ &.#{$component}--end {
162
+ transform: translateX(calc(var(--#{$component}-dir) * (100% + var(--#{$component}-margin))));
163
+ }
164
+
165
+ &:not(.#{$component}--bottom, .#{$component}--top, .#{$component}--start, .#{$component}--end) {
166
+ visibility: hidden;
167
+ }
168
+ }
169
+
170
+ @include m.reduced-motion {
171
+ transition-duration: 0.01ms;
172
+ }
173
+
174
+ @include m.high-contrast {
175
+ &--docked,
176
+ &--floating .#{$component}__bar {
177
+ outline: 1px solid currentColor;
178
+ }
179
+ }
180
+ }
181
+
246
182
  .#{base.$prefix}-toolbar .#{base.$prefix}-toolbar__bar > .#{base.$prefix}-icon-button--round,
247
183
  slot:not([name])::slotted(:is([data-mtrl-icon-button], m-icon-button)) {
248
- --#{base.$prefix}-icon-button-shape-selected: 20px;
249
- --#{base.$prefix}-icon-button-shape-pressed: 20px;
184
+ --#{base.$prefix}-icon-button-shape-selected: 20px;
185
+ --#{base.$prefix}-icon-button-shape-pressed: 20px;
250
186
  }
251
187
 
252
188
  @each $size, $radius in ("xs": 16px, "m": 28px, "l": 48px, "xl": 68px) {
253
- .#{base.$prefix}-toolbar .#{base.$prefix}-toolbar__bar > .#{base.$prefix}-icon-button--round.#{base.$prefix}-icon-button--#{$size},
254
- slot:not([name])::slotted(:is([data-mtrl-icon-button], m-icon-button)[size=#{$size}]) {
255
- --#{base.$prefix}-icon-button-shape-selected: #{$radius};
256
- --#{base.$prefix}-icon-button-shape-pressed: #{$radius};
257
- }
189
+ .#{base.$prefix}-toolbar .#{base.$prefix}-toolbar__bar > .#{base.$prefix}-icon-button--round.#{base.$prefix}-icon-button--#{$size},
190
+ slot:not([name])::slotted(:is([data-mtrl-icon-button], m-icon-button)[size=#{$size}]) {
191
+ --#{base.$prefix}-icon-button-shape-selected: #{$radius};
192
+ --#{base.$prefix}-icon-button-shape-pressed: #{$radius};
193
+ }
258
194
  }