mtrl 0.10.0 → 0.10.2

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 (92) hide show
  1. package/dist/components/bottom-sheet/config.js +1 -1
  2. package/dist/components/chips/api.js +4 -0
  3. package/dist/components/chips/features/controller.js +6 -1
  4. package/dist/components/chips/types.d.ts +10 -0
  5. package/dist/components/dialog/config.js +1 -1
  6. package/dist/components/fab-menu/fab-menu.js +12 -4
  7. package/dist/components/fab-menu/types.d.ts +5 -1
  8. package/dist/components/loading-indicator/constants.js +2 -2
  9. package/dist/components/loading-indicator/features/renderer.js +13 -2
  10. package/dist/components/side-sheet/config.js +1 -1
  11. package/dist/components/tabs/utils.js +3 -2
  12. package/dist/components/timepicker/config.js +1 -1
  13. package/dist/core/shapes/cubic.d.ts +2 -0
  14. package/dist/core/shapes/cubic.js +14 -0
  15. package/dist/core/shapes/index.d.ts +3 -3
  16. package/dist/core/shapes/index.js +3 -3
  17. package/dist/core/shapes/material.d.ts +136 -6
  18. package/dist/core/shapes/material.js +226 -25
  19. package/dist/core/shapes/polygon.d.ts +2 -0
  20. package/dist/core/shapes/polygon.js +27 -10
  21. package/dist/elements/css/fab-menu.js +1 -1
  22. package/dist/elements/fab-menu.js +1 -1
  23. package/dist/elements/preupgrade.css +1 -1
  24. package/dist/index.cjs +0 -0
  25. package/dist/package.json +1 -1
  26. package/dist/styles/badge.css +1 -1
  27. package/dist/styles/base.css +1 -1
  28. package/dist/styles/bottom-app-bar.css +1 -1
  29. package/dist/styles/bottom-sheet.css +1 -1
  30. package/dist/styles/button-group.css +1 -1
  31. package/dist/styles/button.css +1 -1
  32. package/dist/styles/card.css +1 -1
  33. package/dist/styles/carousel.css +1 -1
  34. package/dist/styles/checkbox.css +1 -1
  35. package/dist/styles/chips.css +1 -1
  36. package/dist/styles/datepicker.css +1 -1
  37. package/dist/styles/dialog.css +1 -1
  38. package/dist/styles/divider.css +1 -1
  39. package/dist/styles/drawer.css +1 -1
  40. package/dist/styles/extended-fab.css +1 -1
  41. package/dist/styles/fab-menu.css +2 -2
  42. package/dist/styles/fab.css +1 -1
  43. package/dist/styles/icon-button.css +1 -1
  44. package/dist/styles/list.css +1 -1
  45. package/dist/styles/loading-indicator.css +1 -1
  46. package/dist/styles/menu.css +1 -1
  47. package/dist/styles/navigation-rail.css +1 -1
  48. package/dist/styles/progress.css +1 -1
  49. package/dist/styles/radios.css +1 -1
  50. package/dist/styles/search.css +1 -1
  51. package/dist/styles/segmented-button.css +1 -1
  52. package/dist/styles/select.css +1 -1
  53. package/dist/styles/side-sheet.css +1 -1
  54. package/dist/styles/slider.css +1 -1
  55. package/dist/styles/snackbar.css +1 -1
  56. package/dist/styles/split-button.css +1 -1
  57. package/dist/styles/switch.css +1 -1
  58. package/dist/styles/tabs.css +1 -1
  59. package/dist/styles/textfield.css +1 -1
  60. package/dist/styles/timepicker.css +1 -1
  61. package/dist/styles/toolbar.css +1 -1
  62. package/dist/styles/tooltip.css +1 -1
  63. package/dist/styles/top-app-bar.css +1 -1
  64. package/dist/styles/utilities.css +1 -1
  65. package/dist/styles.css +2 -2
  66. package/dist/themes/autumn.css +1 -1
  67. package/dist/themes/baseline.css +1 -1
  68. package/dist/themes/brownbeige.css +1 -1
  69. package/dist/themes/browngreen.css +1 -1
  70. package/dist/themes/content.css +1 -1
  71. package/dist/themes/desert.css +1 -1
  72. package/dist/themes/expressive.css +1 -1
  73. package/dist/themes/fidelity.css +1 -1
  74. package/dist/themes/forest.css +1 -1
  75. package/dist/themes/fruit-salad.css +1 -1
  76. package/dist/themes/highcontrast.css +1 -1
  77. package/dist/themes/legacy.css +1 -1
  78. package/dist/themes/material.css +1 -1
  79. package/dist/themes/monochrome.css +1 -1
  80. package/dist/themes/neutral.css +1 -1
  81. package/dist/themes/ocean.css +1 -1
  82. package/dist/themes/rainbow.css +1 -1
  83. package/dist/themes/sageivory.css +1 -1
  84. package/dist/themes/spring.css +1 -1
  85. package/dist/themes/summer.css +1 -1
  86. package/dist/themes/sunset.css +1 -1
  87. package/dist/themes/tealcaramel.css +1 -1
  88. package/dist/themes/vibrant.css +1 -1
  89. package/dist/themes/winter.css +1 -1
  90. package/package.json +1 -129
  91. package/src/styles/abstract/_variables.scss +22 -1
  92. package/src/styles/components/_fab-menu.scss +34 -20
@@ -16,6 +16,9 @@
16
16
  $component: '#{base.$prefix}-fab-menu';
17
17
  $fab: '#{base.$prefix}-fab';
18
18
  $spatial: v.motion('spring-fast-spatial-duration') v.motion('spring-fast-spatial-easing');
19
+ // Colours move on the same spring with its progress clamped, as Compose's
20
+ // Color.lerp clamps it: an overshoot never takes a colour past its target
21
+ $spatial-colour: v.motion('spring-fast-spatial-duration') v.motion('spring-fast-spatial-clamped-easing');
19
22
  $effects: v.motion('spring-fast-effects-duration') v.motion('spring-fast-effects-easing');
20
23
  // Where spring-fast-spatial crosses half its progress: the icon swaps there
21
24
  // (the Compose sample swaps it at checkedProgress 0.5)
@@ -80,8 +83,8 @@ $swap: 48ms;
80
83
  width $spatial,
81
84
  height $spatial,
82
85
  border-radius $spatial,
83
- background-color $spatial,
84
- color $spatial,
86
+ background-color $spatial-colour,
87
+ color $spatial-colour,
85
88
  box-shadow $spatial;
86
89
 
87
90
  > * {
@@ -111,7 +114,11 @@ $swap: 48ms;
111
114
  &--list.#{$component}--open .#{$component}__fab {
112
115
  width: 56px;
113
116
  height: 56px;
114
- border-radius: v.shape('full');
117
+ // Half the close button, not the full-shape token: the corner lerps from
118
+ // the FAB's 16/20/28dp to 28dp (Compose FabFinalCornerRadius). Towards
119
+ // 9999px it went round in one frame, and the spring's undershoot on
120
+ // closing took it below 0, a square corner (FLO-348).
121
+ border-radius: 28px;
115
122
  background-color: var(--#{$component}-close);
116
123
  color: var(--#{$component}-on-close);
117
124
 
@@ -149,19 +156,19 @@ $swap: 48ms;
149
156
  transition-delay: 0s;
150
157
  }
151
158
 
152
- // An item: a pill, 56dp high, 24dp at each end, a 24dp icon 8dp from its
153
- // title-medium label. It reveals its width from the end on FastSpatial and
154
- // fades in on FastEffects, after its stagger delay.
159
+ // An item: a pill, 56dp high, revealed by its width from 0 to its
160
+ // content's, measured as the list opens (Compose animates the Row's width
161
+ // inside a CornerFull surface). The width moves on FastSpatial, overshoot
162
+ // included, and the item fades in on FastEffects, after its stagger delay.
155
163
  &__item {
156
164
  position: relative;
157
165
  display: inline-flex;
158
166
  flex-shrink: 0;
159
- align-items: center;
160
- gap: 8px;
167
+ justify-content: flex-end;
161
168
  box-sizing: border-box;
162
- min-width: 56px;
169
+ width: 0;
163
170
  height: 56px;
164
- padding: 0 24px;
171
+ padding: 0;
165
172
  border: none;
166
173
  border-radius: v.shape('full');
167
174
  background-color: var(--#{$component}-item);
@@ -171,16 +178,11 @@ $swap: 48ms;
171
178
  cursor: pointer;
172
179
  overflow: hidden;
173
180
  opacity: 0;
174
- clip-path: inset(0 0 0 100%);
175
181
  transition:
176
182
  opacity $effects,
177
- clip-path $spatial;
183
+ width $spatial;
178
184
  transition-delay: var(--#{$component}-delay, 0ms);
179
185
 
180
- &:dir(rtl) {
181
- clip-path: inset(0 100% 0 0);
182
- }
183
-
184
186
  &:hover {
185
187
  @include m.state-layer(currentColor, 'hover');
186
188
  }
@@ -196,9 +198,23 @@ $swap: 48ms;
196
198
  }
197
199
  }
198
200
 
201
+ // The content keeps its natural width, anchored to the end: while the item
202
+ // is narrower, the start of the label is clipped, as in Compose
203
+ &__item-content {
204
+ display: inline-flex;
205
+ flex-shrink: 0;
206
+ align-items: center;
207
+ justify-content: center;
208
+ gap: 8px;
209
+ box-sizing: border-box;
210
+ min-width: 56px;
211
+ height: 100%;
212
+ padding: 0 24px;
213
+ }
214
+
199
215
  &--open .#{$component}__item {
200
216
  opacity: 1;
201
- clip-path: inset(0);
217
+ width: var(--#{$component}-item-width, auto);
202
218
  }
203
219
 
204
220
  &__item-icon {
@@ -219,9 +235,7 @@ $swap: 48ms;
219
235
  transition: background-color $effects, color $effects;
220
236
  }
221
237
 
222
- &__item,
223
- &__item:dir(rtl) {
224
- clip-path: none;
238
+ &__item {
225
239
  transition: opacity $effects;
226
240
  }
227
241
  }