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
- // Material 3 chip geometry and roles follow Compose Chip.kt and *ChipTokens.kt.
2
1
  @use "../abstract/base" as base;
3
2
  @use "../abstract/variables" as v;
4
3
  @use "../abstract/functions" as f;
@@ -14,326 +13,262 @@ $component: "#{base.$prefix}-chip";
14
13
  $container: "#{base.$prefix}-chips";
15
14
 
16
15
  .#{$component} {
17
- --#{base.$prefix}-chip-label-color: #{t.color("on-surface-variant")};
18
- --#{base.$prefix}-chip-leading-color: #{t.color("primary")};
19
- --#{base.$prefix}-chip-trailing-color: #{t.color("on-surface-variant")};
20
- --#{base.$prefix}-chip-checkmark-color: currentColor;
21
- display: inline-flex;
22
- align-items: center;
23
- position: relative;
24
- box-sizing: border-box;
25
- height: v.chip("height");
26
- max-width: 100%;
27
- // The outline is drawn over the container, as Compose draws a chip's border, so
28
- // it takes no room: as a 1px border it moved every padding 1px further in than
29
- // M3 measures (the remove icon sat 9px from the edge).
30
- border: 0;
31
- outline: 1px solid t.color("outline-variant");
32
- outline-offset: -1px;
33
- border-radius: v.chip("border-radius");
34
- background: transparent;
35
- color: var(--#{base.$prefix}-chip-label-color);
36
- user-select: none;
37
- @include m.typography("label-large");
38
- transition: background-color v.motion("duration-short4") v.motion("easing-standard"),
39
- box-shadow v.motion("duration-short4") v.motion("easing-standard");
16
+ --#{base.$prefix}-chip-label-color: #{t.color("on-surface-variant")};
17
+ --#{base.$prefix}-chip-leading-color: #{t.color("primary")};
18
+ --#{base.$prefix}-chip-trailing-color: #{t.color("on-surface-variant")};
19
+ --#{base.$prefix}-chip-checkmark-color: currentColor;
20
+ display: inline-flex;
21
+ align-items: center;
22
+ position: relative;
23
+ box-sizing: border-box;
24
+ height: v.chip("height");
25
+ max-width: 100%;
26
+ border: 0;
27
+ outline: 1px solid t.color("outline-variant");
28
+ outline-offset: -1px;
29
+ border-radius: v.chip("border-radius");
30
+ background: transparent;
31
+ color: var(--#{base.$prefix}-chip-label-color);
32
+ user-select: none;
33
+ @include m.typography("label-large");
34
+ transition: background-color v.motion("duration-short4") v.motion("easing-standard"),
35
+ box-shadow v.motion("duration-short4") v.motion("easing-standard");
40
36
 
41
- &--assist { @include assist.tokens; }
42
- &--filter { @include filter.tokens; }
43
- &--input { @include input.tokens; }
44
- &--suggestion { @include suggestion.tokens; }
37
+ &--assist { @include assist.tokens; }
38
+ &--filter { @include filter.tokens; }
39
+ &--input { @include input.tokens; }
40
+ &--suggestion { @include suggestion.tokens; }
45
41
 
46
- &__action, &__remove, &__trailing-action {
47
- appearance: none;
48
- position: relative;
49
- display: inline-flex;
50
- align-items: center;
51
- justify-content: center;
52
- flex-shrink: 0;
53
- box-sizing: border-box;
54
- height: 100%;
55
- border: 0;
56
- background: transparent;
57
- color: inherit;
58
- font: inherit;
59
- cursor: pointer;
60
- margin: 0;
61
- border-radius: inherit;
62
- &:disabled { cursor: default; }
63
- // md.comp.focus-ring: 3dp at a 2dp outward offset (it was 2px).
64
- &:focus-visible { outline: 3px solid t.color("secondary"); outline-offset: 2px; }
65
- }
66
- // The 8dp between an icon and the label is the icon's margin, not the action's
67
- // gap, so it can open and close with the icon.
68
- &__action {
69
- flex-shrink: 1;
70
- min-width: 0;
71
- padding: 0 16px;
72
- }
73
- &--leading &__action { padding-inline-start: 8px; }
74
- &--trailing &__action { padding-inline-end: 8px; }
75
- &--input &__action { padding-inline: 12px; }
76
- &--input.#{$component}--leading &__action { padding-inline-start: 8px; }
77
- &--input.#{$component}--trailing &__action { padding-inline-end: 8px; }
78
- &--input.#{$component}--avatar &__action { padding-inline-start: 4px; }
79
- // The remove icon sits 8dp from the label (the action's end padding) and 8dp from
80
- // the chip's edge (site, Compose): 18 + 8, the icon at the start.
81
- // A filter chip's trailing button takes the same place and target.
82
- &__remove, &__trailing-action {
83
- width: calc(#{v.chip("icon-size")} + 8px);
84
- padding: 0;
85
- padding-inline-end: 8px;
86
- justify-content: flex-start;
87
- // The start corners only, without the arm: one aggregated arm below
88
- // carries the mirrored form for both subjects at a shorter prelude
89
- // than a per-subject arm (abstract/_direction.scss).
90
- @include d.corners($start-start: 0, $end-start: 0, $arm: false);
91
- color: var(--#{base.$prefix}-chip-trailing-color);
92
- }
93
- // Both mirrored forms in one arm at one prelude, after the rule whose
94
- // corners it replaces; `inherit` restates the chip's radius before the
95
- // end corners are zeroed. The subject list is bare, so a mark on the chip
96
- // root reaches it. Nothing of this in the logical form, where the two
97
- // start corners mirror natively.
98
- @include d.arms-at-root(
99
- ":where(.#{base.$prefix}-rtl, :host(.#{base.$prefix}-rtl), [dir='rtl'])" +
100
- " :is(.#{$component}__remove, .#{$component}__trailing-action):not(.#{base.$prefix}-ltr *)"
101
- ) {
102
- border-radius: inherit;
103
- border-top-right-radius: 0;
104
- border-bottom-right-radius: 0;
105
- }
106
- // m3.material.io, Chips: "Secondary actions (such as a trailing icon button
107
- // for Remove) must have a 48x48dp interaction target that doesn't interfere
108
- // with the chip's primary action (such as Edit or Drag). To achieve this,
109
- // apply a minimum width of 88dp to the chip, or 42dp to the label text." The
110
- // target runs its 48px back from the chip's end, so the chip is at least 88
111
- // wide and the label at least 42: content and floor then meet exactly (input:
112
- // 12 + 42 + 8 + 26 = 88), the primary action keeps the first 40px and the
113
- // secondary control the last 48, without a gap between them.
114
- &:has(> &__remove, > &__trailing-action) { min-width: 88px; }
115
- &:has(> &__remove, > &__trailing-action) &__label { min-width: 42px; }
116
- &__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
117
- &__leading-icon, &__trailing-icon, &__checkmark {
118
- display: inline-flex;
119
- width: v.chip("icon-size");
120
- height: v.chip("icon-size");
121
- flex-shrink: 0;
122
- align-items: center;
123
- justify-content: center;
124
- &[hidden] { display: none; }
125
- }
126
- &__leading-icon, &__checkmark { margin-inline-end: 8px; }
127
- &__trailing-icon { margin-inline-start: 8px; }
128
- // A leading icon or checkmark that comes and goes with the selection expands and
129
- // fades in, and collapses and fades out (Compose AnimatingChipContent: the size on
130
- // the fast spatial spring, the fade in on slow effects, out on fast effects).
131
- // `hidden` still decides; allow-discrete keeps it displayed while it closes.
132
- //
133
- // Only under --motion, which the chip sets on its first change after it was made:
134
- // @starting-style also applies to an element's first render, so without it every
135
- // chip grew its icons on page load. A chip appears finished and animates what
136
- // changes after.
137
- &--motion &__action {
138
- transition: m.spring(padding-inline-start, fast-spatial), m.spring(padding-inline-end, fast-spatial);
139
- }
140
- &__leading-icon, &__checkmark { overflow: hidden; }
141
- &--motion &__leading-icon, &--motion &__checkmark {
142
- transition: m.spring(width, fast-spatial), m.spring(margin-inline-end, fast-spatial),
143
- m.spring(opacity, slow-effects), display m.spring-duration(fast-spatial) allow-discrete;
144
- @starting-style { width: 0; margin-inline-end: 0; opacity: 0; }
145
- &[hidden] {
146
- width: 0;
147
- margin-inline-end: 0;
148
- opacity: 0;
149
- transition: m.spring(width, fast-spatial), m.spring(margin-inline-end, fast-spatial),
150
- m.spring(opacity, fast-effects), display m.spring-duration(fast-spatial) allow-discrete;
151
- }
152
- }
153
- &__leading-icon { color: var(--#{base.$prefix}-chip-leading-color); }
154
- &__trailing-icon { color: var(--#{base.$prefix}-chip-trailing-color); }
155
- &__checkmark { color: var(--#{base.$prefix}-chip-checkmark-color); }
156
- &__leading-icon svg, &__trailing-icon svg, &__checkmark svg, &__remove svg, &__trailing-action svg { width: 18px; height: 18px; }
157
- &--avatar &__leading-icon { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; }
158
- &--disabled.#{$component}--avatar &__leading-icon { opacity: 0.38; }
159
- &--avatar &__leading-icon :is(svg, img) { width: 24px; height: 24px; object-fit: cover; }
42
+ &__action, &__remove, &__trailing-action {
43
+ appearance: none;
44
+ position: relative;
45
+ display: inline-flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ flex-shrink: 0;
49
+ box-sizing: border-box;
50
+ height: 100%;
51
+ border: 0;
52
+ background: transparent;
53
+ color: inherit;
54
+ font: inherit;
55
+ cursor: pointer;
56
+ margin: 0;
57
+ border-radius: inherit;
58
+ &:disabled { cursor: default; }
59
+ &:focus-visible { outline: 3px solid t.color("secondary"); outline-offset: 2px; }
60
+ }
61
+ &__action {
62
+ flex-shrink: 1;
63
+ min-width: 0;
64
+ padding: 0 16px;
65
+ }
66
+ &--leading &__action { padding-inline-start: 8px; }
67
+ &--trailing &__action { padding-inline-end: 8px; }
68
+ &--input &__action { padding-inline: 12px; }
69
+ &--input.#{$component}--leading &__action { padding-inline-start: 8px; }
70
+ &--input.#{$component}--trailing &__action { padding-inline-end: 8px; }
71
+ &--input.#{$component}--avatar &__action { padding-inline-start: 4px; }
72
+ &__remove, &__trailing-action {
73
+ width: calc(#{v.chip("icon-size")} + 8px);
74
+ padding: 0;
75
+ padding-inline-end: 8px;
76
+ justify-content: flex-start;
77
+ @include d.corners($start-start: 0, $end-start: 0, $arm: false);
78
+ color: var(--#{base.$prefix}-chip-trailing-color);
79
+ }
80
+ @include d.arms-at-root(
81
+ ":where(.#{base.$prefix}-rtl, :host(.#{base.$prefix}-rtl), [dir='rtl'])" +
82
+ " :is(.#{$component}__remove, .#{$component}__trailing-action):not(.#{base.$prefix}-ltr *)"
83
+ ) {
84
+ border-radius: inherit;
85
+ border-top-right-radius: 0;
86
+ border-bottom-right-radius: 0;
87
+ }
88
+ &:has(> &__remove, > &__trailing-action) { min-width: 88px; }
89
+ &:has(> &__remove, > &__trailing-action) &__label { min-width: 42px; }
90
+ &__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
91
+ &__leading-icon, &__trailing-icon, &__checkmark {
92
+ display: inline-flex;
93
+ width: v.chip("icon-size");
94
+ height: v.chip("icon-size");
95
+ flex-shrink: 0;
96
+ align-items: center;
97
+ justify-content: center;
98
+ &[hidden] { display: none; }
99
+ }
100
+ &__leading-icon, &__checkmark { margin-inline-end: 8px; }
101
+ &__trailing-icon { margin-inline-start: 8px; }
102
+ &--motion &__action {
103
+ transition: m.spring(padding-inline-start, fast-spatial), m.spring(padding-inline-end, fast-spatial);
104
+ }
105
+ &__leading-icon, &__checkmark { overflow: hidden; }
106
+ &--motion &__leading-icon, &--motion &__checkmark {
107
+ transition: m.spring(width, fast-spatial), m.spring(margin-inline-end, fast-spatial),
108
+ m.spring(opacity, slow-effects), display m.spring-duration(fast-spatial) allow-discrete;
109
+ @starting-style { width: 0; margin-inline-end: 0; opacity: 0; }
110
+ &[hidden] {
111
+ width: 0;
112
+ margin-inline-end: 0;
113
+ opacity: 0;
114
+ transition: m.spring(width, fast-spatial), m.spring(margin-inline-end, fast-spatial),
115
+ m.spring(opacity, fast-effects), display m.spring-duration(fast-spatial) allow-discrete;
116
+ }
117
+ }
118
+ &__leading-icon { color: var(--#{base.$prefix}-chip-leading-color); }
119
+ &__trailing-icon { color: var(--#{base.$prefix}-chip-trailing-color); }
120
+ &__checkmark { color: var(--#{base.$prefix}-chip-checkmark-color); }
121
+ &__leading-icon svg, &__trailing-icon svg, &__checkmark svg, &__remove svg, &__trailing-action svg { width: 18px; height: 18px; }
122
+ &--avatar &__leading-icon { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; }
123
+ &--disabled.#{$component}--avatar &__leading-icon { opacity: 0.38; }
124
+ &--avatar &__leading-icon :is(svg, img) { width: 24px; height: 24px; object-fit: cover; }
160
125
 
161
- &--selected {
162
- background: t.color("secondary-container");
163
- outline-color: transparent;
164
- --#{base.$prefix}-chip-label-color: #{t.color("on-secondary-container")};
165
- --#{base.$prefix}-chip-leading-color: #{t.color("on-secondary-container")};
166
- --#{base.$prefix}-chip-trailing-color: #{t.color("on-secondary-container")};
167
- }
168
- &--input:not(.#{$component}--disabled) {
169
- &.#{$component}--selected, &:hover, &:has(:focus-visible), &:focus-visible, &:active {
170
- --#{base.$prefix}-chip-leading-color: #{t.color("primary")};
171
- --#{base.$prefix}-chip-checkmark-color: #{t.color("primary")};
172
- }
173
- }
174
- &--elevated {
175
- outline-color: transparent;
176
- background: t.color("surface-container-low");
177
- box-shadow: f.get-elevation(1);
178
- &.#{$component}--selected { background: t.color("secondary-container"); }
179
- &:hover:not(.#{$component}--disabled) { box-shadow: f.get-elevation(2); }
180
- &:active:not(.#{$component}--disabled) { box-shadow: f.get-elevation(1); }
181
- }
182
- &--filter.#{$component}--selected:not(.#{$component}--elevated):hover:not(.#{$component}--disabled) { box-shadow: f.get-elevation(1); }
183
- &--filter.#{$component}--selected:not(.#{$component}--elevated):active:not(.#{$component}--disabled) { box-shadow: none; }
184
- // A focused chip: a button inside it, or, in a chip set's grid, the cell itself.
185
- // --pointer-focus: a cell focused by a click, which draws no keyboard focus. The
186
- // chip sets it where the browser would still match :focus-visible.
187
- &:is(:has(:focus-visible), :focus-visible):not(.#{$component}--disabled):not(.#{$component}--selected):not(.#{$component}--elevated):not(.#{$component}--pointer-focus) { outline-color: t.color("on-surface-variant"); }
188
- &--assist:is(:has(:focus-visible), :focus-visible):not(.#{$component}--disabled):not(.#{$component}--elevated):not(.#{$component}--pointer-focus) { outline-color: t.color("on-surface"); }
189
- // A focused cell draws the focus ring itself: its outline is the chip's stroke, so
190
- // the ring is a ::before 2dp outside the chip, 3dp wide.
191
- &:focus-visible:not(.#{$component}--pointer-focus)::before {
192
- content: "";
193
- position: absolute;
194
- inset: -5px;
195
- border: 3px solid t.color("secondary");
196
- border-radius: calc(#{v.chip("border-radius")} + 5px);
197
- pointer-events: none;
198
- }
199
- &::after {
200
- content: "";
201
- position: absolute;
202
- inset: 0;
203
- border-radius: inherit;
204
- background: currentColor;
205
- pointer-events: none;
206
- opacity: 0;
207
- }
208
- &:hover:not(.#{$component}--disabled)::after { opacity: v.state("hover-state-layer-opacity"); }
209
- // Keyboard focus only: a click leaves no focus layer.
210
- &:is(:has(:focus-visible), :focus-visible):not(.#{$component}--disabled):not(.#{$component}--pointer-focus)::after { opacity: v.state("focus-state-layer-opacity"); }
211
- // A press on a rippled action is the ripple's to draw; the remove and
212
- // trailing buttons have none, so a press on them keeps the layer.
213
- &:active:not(.#{$component}--disabled):not(:has(> .#{$component}__action:active > .#{base.$prefix}-ripple))::after { opacity: v.state("pressed-state-layer-opacity"); }
214
- // Dragged (Compose DraggedContainerElevation Level4, DraggedStateLayerOpacity),
215
- // set while an app drags a draggable chip.
216
- &--dragged { box-shadow: f.get-elevation(4); }
217
- &--dragged:not(.#{$component}--disabled)::after { opacity: v.state("dragged-state-layer-opacity"); }
218
- &--disabled {
219
- outline-color: t.alpha("on-surface", 0.12);
220
- box-shadow: none;
221
- --#{base.$prefix}-chip-label-color: #{t.alpha("on-surface", 0.38)};
222
- --#{base.$prefix}-chip-leading-color: #{t.alpha("on-surface", 0.38)};
223
- --#{base.$prefix}-chip-trailing-color: #{t.alpha("on-surface", 0.38)};
224
- &.#{$component}--selected, &.#{$component}--elevated { background: t.alpha("on-surface", 0.12); outline-color: transparent; }
225
- .#{base.$prefix}-ripple { display: none; }
226
- }
227
- // 48dp touch targets on every pointer (site): the action reaches 8dp above and
228
- // below the 32dp chip, and the remove button's 48 x 48 runs back from the chip's
229
- // end over the label's end, so it never sticks out past the chip -- centred on
230
- // the icon it overflowed by 7px, which a scrolling chip set would scroll to. It
231
- // was only under pointer: coarse, only vertically, and the remove button 32 wide.
232
- &__action::before { content: ""; position: absolute; inset-inline: 0; inset-block: -8px; }
233
- &__remove::before, &__trailing-action::before {
234
- content: "";
235
- position: absolute;
236
- top: 50%;
237
- // The 48dp box runs back from the chip's end edge, as on main. The
238
- // end inset goes through the direction switch, so the artefacts a
239
- // consumer bundler lowers carry the physical side with its arm and
240
- // no :lang() lowering can drag the box off the end edge.
241
- @include d.end(0);
242
- width: 48px;
243
- height: 48px;
244
- transform: translateY(-50%);
245
- }
126
+ &--selected {
127
+ background: t.color("secondary-container");
128
+ outline-color: transparent;
129
+ --#{base.$prefix}-chip-label-color: #{t.color("on-secondary-container")};
130
+ --#{base.$prefix}-chip-leading-color: #{t.color("on-secondary-container")};
131
+ --#{base.$prefix}-chip-trailing-color: #{t.color("on-secondary-container")};
132
+ }
133
+ &--input:not(.#{$component}--disabled) {
134
+ &.#{$component}--selected, &:hover, &:has(:focus-visible), &:focus-visible, &:active {
135
+ --#{base.$prefix}-chip-leading-color: #{t.color("primary")};
136
+ --#{base.$prefix}-chip-checkmark-color: #{t.color("primary")};
137
+ }
138
+ }
139
+ &--elevated {
140
+ outline-color: transparent;
141
+ background: t.color("surface-container-low");
142
+ box-shadow: f.get-elevation(1);
143
+ &.#{$component}--selected { background: t.color("secondary-container"); }
144
+ &:hover:not(.#{$component}--disabled) { box-shadow: f.get-elevation(2); }
145
+ &:active:not(.#{$component}--disabled) { box-shadow: f.get-elevation(1); }
146
+ }
147
+ &--filter.#{$component}--selected:not(.#{$component}--elevated):hover:not(.#{$component}--disabled) { box-shadow: f.get-elevation(1); }
148
+ &--filter.#{$component}--selected:not(.#{$component}--elevated):active:not(.#{$component}--disabled) { box-shadow: none; }
149
+ &:is(:has(:focus-visible), :focus-visible):not(.#{$component}--disabled):not(.#{$component}--selected):not(.#{$component}--elevated):not(.#{$component}--pointer-focus) { outline-color: t.color("on-surface-variant"); }
150
+ &--assist:is(:has(:focus-visible), :focus-visible):not(.#{$component}--disabled):not(.#{$component}--elevated):not(.#{$component}--pointer-focus) { outline-color: t.color("on-surface"); }
151
+ &:focus-visible:not(.#{$component}--pointer-focus)::before {
152
+ content: "";
153
+ position: absolute;
154
+ inset: -5px;
155
+ border: 3px solid t.color("secondary");
156
+ border-radius: calc(#{v.chip("border-radius")} + 5px);
157
+ pointer-events: none;
158
+ }
159
+ &::after {
160
+ content: "";
161
+ position: absolute;
162
+ inset: 0;
163
+ border-radius: inherit;
164
+ background: currentColor;
165
+ pointer-events: none;
166
+ opacity: 0;
167
+ }
168
+ &:hover:not(.#{$component}--disabled)::after { opacity: v.state("hover-state-layer-opacity"); }
169
+ &:is(:has(:focus-visible), :focus-visible):not(.#{$component}--disabled):not(.#{$component}--pointer-focus)::after { opacity: v.state("focus-state-layer-opacity"); }
170
+ &:active:not(.#{$component}--disabled):not(:has(> .#{$component}__action:active > .#{base.$prefix}-ripple))::after { opacity: v.state("pressed-state-layer-opacity"); }
171
+ &--dragged { box-shadow: f.get-elevation(4); }
172
+ &--dragged:not(.#{$component}--disabled)::after { opacity: v.state("dragged-state-layer-opacity"); }
173
+ &--disabled {
174
+ outline-color: t.alpha("on-surface", 0.12);
175
+ box-shadow: none;
176
+ --#{base.$prefix}-chip-label-color: #{t.alpha("on-surface", 0.38)};
177
+ --#{base.$prefix}-chip-leading-color: #{t.alpha("on-surface", 0.38)};
178
+ --#{base.$prefix}-chip-trailing-color: #{t.alpha("on-surface", 0.38)};
179
+ &.#{$component}--selected, &.#{$component}--elevated { background: t.alpha("on-surface", 0.12); outline-color: transparent; }
180
+ .#{base.$prefix}-ripple { display: none; }
181
+ }
182
+ &__action::before { content: ""; position: absolute; inset-inline: 0; inset-block: -8px; }
183
+ &__remove::before, &__trailing-action::before {
184
+ content: "";
185
+ position: absolute;
186
+ top: 50%;
187
+ @include d.end(0);
188
+ width: 48px;
189
+ height: 48px;
190
+ transform: translateY(-50%);
191
+ }
246
192
  }
247
193
 
248
- // Chips container
249
194
  .#{$container} {
250
- display: flex;
251
- flex-wrap: wrap;
252
- gap: v.spacing("2");
253
- width: 100%;
254
- min-height: fit-content;
255
- height: auto;
195
+ display: flex;
196
+ flex-wrap: wrap;
197
+ gap: v.spacing("2");
198
+ width: 100%;
199
+ min-height: fit-content;
200
+ height: auto;
256
201
 
257
- // Label styling
258
- &__label {
259
- @include m.typography("label-medium");
260
- font-size: 16px;
261
- color: t.color("on-surface-variant");
262
- // margin-bottom: v.spacing("2");
263
- display: block;
264
- width: 100%;
265
- }
202
+ &__label {
203
+ @include m.typography("label-medium");
204
+ font-size: 16px;
205
+ color: t.color("on-surface-variant");
206
+ display: block;
207
+ width: 100%;
208
+ }
266
209
 
267
- // Layout with label
268
- &--with-label {
269
- display: flex;
270
- flex-direction: column;
210
+ &--with-label {
211
+ display: flex;
212
+ flex-direction: column;
271
213
 
272
- // When label is at the end
273
- &.#{$container}--label-end {
274
- flex-direction: column-reverse;
214
+ &.#{$container}--label-end {
215
+ flex-direction: column-reverse;
275
216
 
276
- .#{$container}__label {
277
- margin-bottom: 0;
278
- margin-top: v.spacing("2");
279
- }
280
- }
281
- }
217
+ .#{$container}__label {
218
+ margin-bottom: 0;
219
+ margin-top: v.spacing("2");
220
+ }
221
+ }
222
+ }
282
223
 
283
- // Container for chips
284
- &__container {
285
- display: flex;
286
- flex-wrap: wrap;
287
- gap: v.spacing("2");
288
- width: 100%;
289
- }
224
+ &__container {
225
+ display: flex;
226
+ flex-wrap: wrap;
227
+ gap: v.spacing("2");
228
+ width: 100%;
229
+ }
290
230
 
291
- // Important: Scrollable state only affects the container, not the chip icons
292
- &--scrollable {
293
- .#{$container}__container {
294
- flex-wrap: nowrap;
295
- overflow-x: auto;
296
- overflow-y: visible; // Don't clip chips vertically
297
- -webkit-overflow-scrolling: touch;
298
- scroll-behavior: smooth;
299
- padding-bottom: v.spacing("2");
231
+ &--scrollable {
232
+ .#{$container}__container {
233
+ flex-wrap: nowrap;
234
+ overflow-x: auto;
235
+ overflow-y: visible;
236
+ -webkit-overflow-scrolling: touch;
237
+ scroll-behavior: smooth;
238
+ padding-bottom: v.spacing("2");
300
239
 
301
- // Enhanced scrollable behavior
302
- position: relative;
303
- white-space: nowrap;
240
+ position: relative;
241
+ white-space: nowrap;
304
242
 
305
- // Improved scrollbar styling
306
- &::-webkit-scrollbar {
307
- height: 4px;
308
- }
243
+ &::-webkit-scrollbar {
244
+ height: 4px;
245
+ }
309
246
 
310
- &::-webkit-scrollbar-thumb {
311
- background-color: t.alpha("on-surface", 0.2);
312
- border-radius: 4px;
313
- }
247
+ &::-webkit-scrollbar-thumb {
248
+ background-color: t.alpha("on-surface", 0.2);
249
+ border-radius: 4px;
250
+ }
314
251
 
315
- &::-webkit-scrollbar-track {
316
- background-color: t.alpha("on-surface", 0.05);
317
- border-radius: 4px;
318
- }
252
+ &::-webkit-scrollbar-track {
253
+ background-color: t.alpha("on-surface", 0.05);
254
+ border-radius: 4px;
255
+ }
319
256
 
320
- // Style for Firefox
321
- scrollbar-width: thin;
322
- scrollbar-color: t.alpha("on-surface", 0.2)
323
- t.alpha("on-surface", 0.05);
257
+ scrollbar-width: thin;
258
+ scrollbar-color: t.alpha("on-surface", 0.2)
259
+ t.alpha("on-surface", 0.05);
324
260
 
325
- // Ensure chip visibility without affecting internal structure
326
- .#{$component} {
327
- flex-shrink: 0; // Prevent chips from shrinking
328
- }
329
- }
330
- }
261
+ .#{$component} {
262
+ flex-shrink: 0;
263
+ }
264
+ }
265
+ }
331
266
 
332
- &--vertical {
333
- .#{$container}__container {
334
- flex-direction: column;
335
- align-items: flex-start;
336
- gap: v.spacing("2");
337
- }
338
- }
267
+ &--vertical {
268
+ .#{$container}__container {
269
+ flex-direction: column;
270
+ align-items: flex-start;
271
+ gap: v.spacing("2");
272
+ }
273
+ }
339
274
  }