@expressivecss/expressive 0.9.1 → 0.10.1

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 (190) hide show
  1. package/CHANGELOG.md +184 -1
  2. package/README.md +178 -25
  3. package/dist/css/expressive.css +428 -1222
  4. package/dist/css/expressive.css.map +1 -1
  5. package/dist/css/expressive.min.css +1 -1
  6. package/dist/css/expressive.min.css.map +1 -1
  7. package/dist/fonts/material-symbols-outlined.woff2 +0 -0
  8. package/dist/fonts/material-symbols-rounded.woff2 +0 -0
  9. package/dist/fonts/material-symbols-sharp.woff2 +0 -0
  10. package/dist/js/chunks/chunk-7MM4VJJO.mjs +509 -0
  11. package/dist/js/chunks/chunk-7MM4VJJO.mjs.map +7 -0
  12. package/dist/js/chunks/chunk-7UXHSYIA.mjs +183 -0
  13. package/dist/js/chunks/chunk-7UXHSYIA.mjs.map +7 -0
  14. package/dist/js/chunks/chunk-A3BJA7V4.mjs +28 -0
  15. package/dist/js/chunks/chunk-A3BJA7V4.mjs.map +7 -0
  16. package/dist/js/chunks/chunk-AOGFNMXS.mjs +691 -0
  17. package/dist/js/chunks/chunk-AOGFNMXS.mjs.map +7 -0
  18. package/dist/js/chunks/chunk-D4UZ4HFN.mjs +560 -0
  19. package/dist/js/chunks/chunk-D4UZ4HFN.mjs.map +7 -0
  20. package/dist/js/chunks/chunk-EP3CVKB5.mjs +88 -0
  21. package/dist/js/chunks/chunk-EP3CVKB5.mjs.map +7 -0
  22. package/dist/js/chunks/chunk-G576EP5O.mjs +459 -0
  23. package/dist/js/chunks/chunk-G576EP5O.mjs.map +7 -0
  24. package/dist/js/chunks/chunk-GY2Z5CJ2.mjs +320 -0
  25. package/dist/js/chunks/chunk-GY2Z5CJ2.mjs.map +7 -0
  26. package/dist/js/chunks/chunk-JKNPQQWY.mjs +191 -0
  27. package/dist/js/chunks/chunk-JKNPQQWY.mjs.map +7 -0
  28. package/dist/js/chunks/chunk-JNPIWFJT.mjs +365 -0
  29. package/dist/js/chunks/chunk-JNPIWFJT.mjs.map +7 -0
  30. package/dist/js/chunks/chunk-JODJAGFS.mjs +267 -0
  31. package/dist/js/chunks/chunk-JODJAGFS.mjs.map +7 -0
  32. package/dist/js/chunks/chunk-JR24UB4X.mjs +100 -0
  33. package/dist/js/chunks/chunk-JR24UB4X.mjs.map +7 -0
  34. package/dist/js/chunks/chunk-KR44BSYQ.mjs +55 -0
  35. package/dist/js/chunks/chunk-KR44BSYQ.mjs.map +7 -0
  36. package/dist/js/chunks/chunk-LZVBJ33S.mjs +102 -0
  37. package/dist/js/chunks/chunk-LZVBJ33S.mjs.map +7 -0
  38. package/dist/js/chunks/chunk-MISGHDUU.mjs +326 -0
  39. package/dist/js/chunks/chunk-MISGHDUU.mjs.map +7 -0
  40. package/dist/js/chunks/chunk-N3UHGN3N.mjs +175 -0
  41. package/dist/js/chunks/chunk-N3UHGN3N.mjs.map +7 -0
  42. package/dist/js/chunks/chunk-PIIAEYAJ.mjs +85 -0
  43. package/dist/js/chunks/chunk-PIIAEYAJ.mjs.map +7 -0
  44. package/dist/js/chunks/chunk-QSQ24FYT.mjs +59 -0
  45. package/dist/js/chunks/chunk-QSQ24FYT.mjs.map +7 -0
  46. package/dist/js/chunks/chunk-QYCYP443.mjs +1111 -0
  47. package/dist/js/chunks/chunk-QYCYP443.mjs.map +7 -0
  48. package/dist/js/chunks/chunk-SLFNPY5M.mjs +78 -0
  49. package/dist/js/chunks/chunk-SLFNPY5M.mjs.map +7 -0
  50. package/dist/js/chunks/chunk-TK6PX2GC.mjs +663 -0
  51. package/dist/js/chunks/chunk-TK6PX2GC.mjs.map +7 -0
  52. package/dist/js/chunks/chunk-TYM6U5DY.mjs +76 -0
  53. package/dist/js/chunks/chunk-TYM6U5DY.mjs.map +7 -0
  54. package/dist/js/chunks/chunk-TZZ24ZQS.mjs +154 -0
  55. package/dist/js/chunks/chunk-TZZ24ZQS.mjs.map +7 -0
  56. package/dist/js/chunks/chunk-VAS6JQ6P.mjs +94 -0
  57. package/dist/js/chunks/chunk-VAS6JQ6P.mjs.map +7 -0
  58. package/dist/js/chunks/chunk-WWPAPHMA.mjs +1 -0
  59. package/dist/js/chunks/chunk-WWPAPHMA.mjs.map +7 -0
  60. package/dist/js/chunks/chunk-XDB3G6RL.mjs +114 -0
  61. package/dist/js/chunks/chunk-XDB3G6RL.mjs.map +7 -0
  62. package/dist/js/chunks/chunk-XO5WX3TK.mjs +226 -0
  63. package/dist/js/chunks/chunk-XO5WX3TK.mjs.map +7 -0
  64. package/dist/js/chunks/chunk-YFXEJ7GR.mjs +286 -0
  65. package/dist/js/chunks/chunk-YFXEJ7GR.mjs.map +7 -0
  66. package/dist/js/chunks/chunk-ZAOYQ6SY.mjs +7 -0
  67. package/dist/js/chunks/chunk-ZAOYQ6SY.mjs.map +7 -0
  68. package/dist/js/chunks/chunk-ZIZVUWRL.mjs +120 -0
  69. package/dist/js/chunks/chunk-ZIZVUWRL.mjs.map +7 -0
  70. package/dist/js/chunks/chunk-ZZBZI2XN.mjs +338 -0
  71. package/dist/js/chunks/chunk-ZZBZI2XN.mjs.map +7 -0
  72. package/dist/js/expressive.cjs +747 -754
  73. package/dist/js/expressive.cjs.map +4 -4
  74. package/dist/js/expressive.js +747 -754
  75. package/dist/js/expressive.js.map +4 -4
  76. package/dist/js/expressive.min.js +11 -15
  77. package/dist/js/expressive.min.js.map +4 -4
  78. package/dist/js/expressive.mjs +83 -7490
  79. package/dist/js/expressive.mjs.map +4 -4
  80. package/dist/js/internal/behaviors/bottomSheets.mjs +9 -0
  81. package/dist/js/internal/behaviors/bottomSheets.mjs.map +7 -0
  82. package/dist/js/internal/behaviors/dialogs.mjs +8 -0
  83. package/dist/js/internal/behaviors/dialogs.mjs.map +7 -0
  84. package/dist/js/internal/behaviors/forms.mjs +8 -0
  85. package/dist/js/internal/behaviors/forms.mjs.map +7 -0
  86. package/dist/js/internal/behaviors/sheetDrag.mjs +8 -0
  87. package/dist/js/internal/behaviors/sheetDrag.mjs.map +7 -0
  88. package/dist/js/internal/behaviors/sideSheets.mjs +9 -0
  89. package/dist/js/internal/behaviors/sideSheets.mjs.map +7 -0
  90. package/dist/js/internal/components/appBar.mjs +8 -0
  91. package/dist/js/internal/components/appBar.mjs.map +7 -0
  92. package/dist/js/internal/components/autocomplete.mjs +10 -0
  93. package/dist/js/internal/components/autocomplete.mjs.map +7 -0
  94. package/dist/js/internal/components/buttonGroup.mjs +8 -0
  95. package/dist/js/internal/components/buttonGroup.mjs.map +7 -0
  96. package/dist/js/internal/components/buttons.mjs +9 -0
  97. package/dist/js/internal/components/buttons.mjs.map +7 -0
  98. package/dist/js/internal/components/cards.mjs +13 -0
  99. package/dist/js/internal/components/cards.mjs.map +7 -0
  100. package/dist/js/internal/components/carousel.mjs +9 -0
  101. package/dist/js/internal/components/carousel.mjs.map +7 -0
  102. package/dist/js/internal/components/characterCounter.mjs +8 -0
  103. package/dist/js/internal/components/characterCounter.mjs.map +7 -0
  104. package/dist/js/internal/components/chips.mjs +11 -0
  105. package/dist/js/internal/components/chips.mjs.map +7 -0
  106. package/dist/js/internal/components/datepicker.mjs +12 -0
  107. package/dist/js/internal/components/datepicker.mjs.map +7 -0
  108. package/dist/js/internal/components/expandingCard.mjs +11 -0
  109. package/dist/js/internal/components/expandingCard.mjs.map +7 -0
  110. package/dist/js/internal/components/index.mjs +88 -0
  111. package/dist/js/internal/components/index.mjs.map +7 -0
  112. package/dist/js/internal/components/lightbox.mjs +9 -0
  113. package/dist/js/internal/components/lightbox.mjs.map +7 -0
  114. package/dist/js/internal/components/menu.mjs +9 -0
  115. package/dist/js/internal/components/menu.mjs.map +7 -0
  116. package/dist/js/internal/components/navigationRail.mjs +8 -0
  117. package/dist/js/internal/components/navigationRail.mjs.map +7 -0
  118. package/dist/js/internal/components/registry.mjs +33 -0
  119. package/dist/js/internal/components/registry.mjs.map +7 -0
  120. package/dist/js/internal/components/scrollspy.mjs +8 -0
  121. package/dist/js/internal/components/scrollspy.mjs.map +7 -0
  122. package/dist/js/internal/components/select.mjs +10 -0
  123. package/dist/js/internal/components/select.mjs.map +7 -0
  124. package/dist/js/internal/components/slider.mjs +9 -0
  125. package/dist/js/internal/components/slider.mjs.map +7 -0
  126. package/dist/js/internal/components/snackbar.mjs +8 -0
  127. package/dist/js/internal/components/snackbar.mjs.map +7 -0
  128. package/dist/js/internal/components/tabs.mjs +10 -0
  129. package/dist/js/internal/components/tabs.mjs.map +7 -0
  130. package/dist/js/internal/components/timepicker.mjs +10 -0
  131. package/dist/js/internal/components/timepicker.mjs.map +7 -0
  132. package/dist/js/internal/components/tooltip.mjs +9 -0
  133. package/dist/js/internal/components/tooltip.mjs.map +7 -0
  134. package/dist/js/internal/core/component.mjs +7 -0
  135. package/dist/js/internal/core/component.mjs.map +7 -0
  136. package/dist/js/internal/core/utils.mjs +7 -0
  137. package/dist/js/internal/core/utils.mjs.map +7 -0
  138. package/dist/js/internal/plugins/dockedDisplayPlugin.mjs +8 -0
  139. package/dist/js/internal/plugins/dockedDisplayPlugin.mjs.map +7 -0
  140. package/dist/js/modular.mjs +113 -0
  141. package/dist/js/modular.mjs.map +7 -0
  142. package/dist/types/behaviors/sheetDrag.d.ts +1 -1
  143. package/dist/types/components/appBar.d.ts +1 -1
  144. package/dist/types/components/autocomplete.d.ts +9 -0
  145. package/dist/types/components/buttons.d.ts +4 -39
  146. package/dist/types/components/carousel.d.ts +10 -1
  147. package/dist/types/components/chips.d.ts +1 -0
  148. package/dist/types/components/datepicker.d.ts +7 -0
  149. package/dist/types/components/index.d.ts +0 -2
  150. package/dist/types/components/lightbox.d.ts +12 -0
  151. package/dist/types/components/menu.d.ts +3 -0
  152. package/dist/types/components/registry.d.ts +0 -4
  153. package/dist/types/components/select.d.ts +4 -0
  154. package/dist/types/components/slider.d.ts +2 -1
  155. package/dist/types/components/snackbar.d.ts +4 -2
  156. package/dist/types/components/tabs.d.ts +2 -1
  157. package/dist/types/components/timepicker.d.ts +5 -3
  158. package/dist/types/components/tooltip.d.ts +5 -3
  159. package/dist/types/index.d.ts +1 -8
  160. package/dist/types/modular.d.ts +28 -0
  161. package/package.json +16 -4
  162. package/src/sass/README.md +8 -0
  163. package/src/sass/components/_badges.scss +1 -6
  164. package/src/sass/components/_button-groups.scss +5 -1
  165. package/src/sass/components/_buttons.scss +8 -287
  166. package/src/sass/components/_chips.scss +17 -2
  167. package/src/sass/components/_dialog.scss +9 -4
  168. package/src/sass/components/_fab-menu.scss +11 -9
  169. package/src/sass/components/_icon-buttons.scss +0 -5
  170. package/src/sass/components/_index.scss +0 -5
  171. package/src/sass/components/_menu.scss +2 -2
  172. package/src/sass/components/_navigation-rail.scss +1 -1
  173. package/src/sass/components/_panes.scss +50 -78
  174. package/src/sass/components/_progress.scss +73 -13
  175. package/src/sass/components/_scrim.scss +4 -4
  176. package/src/sass/components/_side-sheet.scss +22 -12
  177. package/src/sass/components/_toolbar.scss +1 -4
  178. package/src/sass/components/_tooltip.scss +20 -2
  179. package/src/sass/components/forms/_input-fields.scss +5 -1
  180. package/src/sass/components/forms/_select.scss +1 -0
  181. package/src/sass/components/forms/_slider.scss +81 -25
  182. package/src/sass/custom.scss +38 -0
  183. package/src/sass/utilities/_helpers.scss +18 -0
  184. package/src/sass/utilities/_spacing.scss +8 -1
  185. package/dist/types/components/navigationDrawer.d.ts +0 -110
  186. package/src/sass/components/_banners.scss +0 -298
  187. package/src/sass/components/_bottom-app-bar.scss +0 -180
  188. package/src/sass/components/_floating-sheet.scss +0 -86
  189. package/src/sass/components/_navigation-drawer.scss +0 -476
  190. package/src/sass/components/_segmented-buttons.scss +0 -188
@@ -1,298 +0,0 @@
1
- @use "../abstracts" as *;
2
-
3
- // Banners.
4
- //
5
- // Anatomy is the HTML. A .banner is the container. A <p> is the message. An
6
- // optional leading #{$icon} leads it, an optional .actions holds the buttons,
7
- // and an optional trailing .icon-button dismisses it. .rich adds a heading
8
- // above the message and takes an <img> instead of an icon.
9
- //
10
- // A banner is persistent and in flow: it stays until the user acts on it, and
11
- // it pushes the page down rather than covering it. That is the whole
12
- // difference from a snackbar, which is transient, floats over the page and
13
- // dismisses itself. Nothing here is scripted - dismissing a banner is removing
14
- // it, which is the page's business, not the framework's.
15
- //
16
- // The action row is .actions and never a <nav> (SEMANTICS rule 4): these are
17
- // commands, not destinations. No composite role is declared, so none is
18
- // withheld. And a .banner is not `role="banner"` - that landmark is the page
19
- // header, and semantics.json blocks the confusion in both spellings.
20
- //
21
- // Tokens follow M3 Expressive, md.comp.banners.* (DSP 34.0.21), which is three
22
- // families: `banners` for the colours both variants share, `banners.basic` and
23
- // `banners.rich` for their geometry.
24
- //
25
- // standard surface-container container, on-surface text and icon
26
- // vibrant primary-container container, on-primary-container text
27
- // close primary, whichever variant it sits in
28
- // basic 56dp tall, 4dp insets, 28dp corners (0 when .square)
29
- // 48dp icon container around a 24dp icon
30
- // body-medium text, 14dp above and below
31
- // actions 8dp apart with 8dp on either side of the row
32
- // basic mobile 112dp tall, 8dp top inset, actions on their own line
33
- // rich 28dp corners, 12dp insets, 24dp icon or an 80dp square image
34
- // title body-medium at weight 500, 14dp above and below
35
- // actions 12dp under the message
36
- //
37
- // Several token values go unspent, and every one of them is unspendable rather
38
- // than forgotten.
39
- //
40
- // Three describe something this does not draw. `basic.two-lines.*` (a 64dp
41
- // container with 8dp text insets) needs a line count, which CSS cannot see, so
42
- // the container grows past 56dp on its own instead. `basic.centered.body-text
43
- // .trailing-space` belongs to a centered basic variant that is not shipped. And
44
- // both `body-text.trailing-space: 48px` values reserve room for the close
45
- // button; here the button occupies that room itself, in flow in the basic row
46
- // and in its own grid column in the rich one, so the reserve tracks the button
47
- // rather than a constant.
48
- //
49
- // The rest are one gap M3 names twice, from either side, where spending both
50
- // would double it. `rich.leading-element.trailing-space` restates
51
- // `rich.icon-text-space` / `rich.image-text-space`; the *-text-space one is
52
- // written. `basic.actions-close-button-space` (8dp, 4dp on mobile) restates
53
- // `basic.actions.trailing-space` - the same two numbers - and the padding is
54
- // written. `rich.body-text.text-actions-space: 8px` and
55
- // `rich.actions.top-space: 12px` both name the gap under the message; the
56
- // larger is written, since actions 8dp under body text read as part of it.
57
- // `rich.actions.{leading,trailing,bottom}-space` and
58
- // `rich.leading-element.bottom-space` are all 12dp, which is the container's
59
- // own inset, already spent by its padding.
60
- //
61
- // One token is renamed on the way in. M3's `basic.body-text.leading-space` is
62
- // 0dp - the icon container carries the inset - and the 16dp / 12dp pair lives
63
- // under `basic.{round,square}.no-icon.body-text.leading-space`. The custom
64
- // property is named for the case it serves, not for the 0dp token it is not.
65
- .banner {
66
- --md-comp-banners-color: var(--md-sys-color-surface-container);
67
- --md-comp-banners-body-text-color: var(--md-sys-color-on-surface);
68
- --md-comp-banners-title-text-color: var(--md-sys-color-on-surface);
69
- --md-comp-banners-icon-color: var(--md-sys-color-on-surface);
70
- --md-comp-banners-close-button-color: var(--md-sys-color-primary);
71
-
72
- box-sizing: border-box;
73
- color: var(--md-comp-banners-body-text-color);
74
- background-color: var(--md-comp-banners-color);
75
- @include typescale("body-medium");
76
-
77
- // The close button is the one control M3 colours from the banner family
78
- // rather than from its own. The action buttons are ordinary text buttons and
79
- // are left alone - `primary` clears 5:1 on both container colours.
80
- //
81
- // The `:not()` is load-bearing, not defensive. `_icon-buttons.scss` sets this
82
- // very token for the disabled state at the same (0,2,0) specificity, and
83
- // banners is forwarded after it, so an unscoped override wins the tie and
84
- // repaints a disabled close button at full-strength primary. Scoped, the rule
85
- // simply stops matching and the disabled colour stands.
86
- > .icon-button:not(:disabled, [disabled], [aria-disabled="true"], .disabled) {
87
- --md-comp-icon-button-color: var(--md-comp-banners-close-button-color);
88
- }
89
- }
90
-
91
- // The two colour variants. Standard is the default, so only vibrant is a class.
92
- .banner.vibrant {
93
- --md-comp-banners-color: var(--md-sys-color-primary-container);
94
- --md-comp-banners-body-text-color: var(--md-sys-color-on-primary-container);
95
- --md-comp-banners-title-text-color: var(--md-sys-color-on-primary-container);
96
- --md-comp-banners-icon-color: var(--md-sys-color-on-primary-container);
97
- }
98
-
99
- // Basic: one row of icon, message, actions and close. Every layout rule is
100
- // scoped away from .rich rather than left to the cascade, so the two variants
101
- // tie on specificity and neither can quietly reach into the other.
102
- .banner:not(.rich) {
103
- --md-comp-banners-basic-height: 56px;
104
- --md-comp-banners-basic-shape: 28px;
105
- --md-comp-banners-basic-leading-space: 4px;
106
- --md-comp-banners-basic-trailing-space: 4px;
107
- --md-comp-banners-basic-top-space: 4px;
108
- --md-comp-banners-basic-bottom-space: 4px;
109
- --md-comp-banners-basic-icon-container-size: 48px;
110
- --md-comp-banners-basic-icon-size: 24px;
111
- --md-comp-banners-basic-body-text-top-space: 14px;
112
- --md-comp-banners-basic-body-text-bottom-space: 14px;
113
- --md-comp-banners-basic-no-icon-body-text-leading-space: 16px;
114
- --md-comp-banners-basic-actions-between-space: 8px;
115
- --md-comp-banners-basic-actions-leading-space: 8px;
116
- --md-comp-banners-basic-actions-trailing-space: 8px;
117
-
118
- display: flex;
119
- align-items: center;
120
- min-block-size: var(--md-comp-banners-basic-height);
121
- padding-block: var(--md-comp-banners-basic-top-space)
122
- var(--md-comp-banners-basic-bottom-space);
123
- padding-inline: var(--md-comp-banners-basic-leading-space)
124
- var(--md-comp-banners-basic-trailing-space);
125
- border-radius: var(--md-comp-banners-basic-shape);
126
-
127
- > #{$icon} {
128
- flex: 0 0 auto;
129
- display: inline-flex;
130
- align-items: center;
131
- justify-content: center;
132
- inline-size: var(--md-comp-banners-basic-icon-container-size);
133
- block-size: var(--md-comp-banners-basic-icon-container-size);
134
- font-size: var(--md-comp-banners-basic-icon-size);
135
- line-height: var(--md-comp-banners-basic-icon-size);
136
- color: var(--md-comp-banners-icon-color);
137
- }
138
-
139
- // `flex-basis: 0`, not `auto`. A wrapped flex container breaks lines on an
140
- // item's *hypothetical* size - what it would be before shrinking - so a
141
- // message long enough to fill the row takes a line of its own and leaves the
142
- // icon stranded on the one above it. From zero it contributes nothing to that
143
- // decision and grows into whatever the row has left, which is also what puts
144
- // the actions hard against the trailing edge.
145
- > p {
146
- flex: 1 1 0;
147
- min-inline-size: 0;
148
- margin: 0;
149
- padding-block: var(--md-comp-banners-basic-body-text-top-space)
150
- var(--md-comp-banners-basic-body-text-bottom-space);
151
- color: inherit;
152
- }
153
-
154
- // The message pays for its own leading inset only when nothing leads it: the
155
- // icon's 48dp container already carries one.
156
- > p:first-child {
157
- padding-inline-start: var(--md-comp-banners-basic-no-icon-body-text-leading-space);
158
- }
159
-
160
- > .icon-button {
161
- flex: 0 0 auto;
162
- }
163
-
164
- > .actions {
165
- display: flex;
166
- flex: 0 0 auto;
167
- align-items: center;
168
- gap: var(--md-comp-banners-basic-actions-between-space);
169
- padding-inline: var(--md-comp-banners-basic-actions-leading-space)
170
- var(--md-comp-banners-basic-actions-trailing-space);
171
- }
172
-
173
- // Compact: the row is too narrow to hold the actions beside the message, so
174
- // they take a line of their own under it. Wrapping is switched on here and
175
- // nowhere else, and `order` puts the actions after the close button, which is
176
- // what makes them the only thing that can wrap.
177
- @include bp-down("medium") {
178
- --md-comp-banners-basic-height: 112px;
179
- --md-comp-banners-basic-top-space: 8px;
180
- --md-comp-banners-basic-actions-trailing-space: 4px;
181
-
182
- flex-wrap: wrap;
183
-
184
- > .actions {
185
- order: 1;
186
- flex-basis: 100%;
187
- justify-content: flex-end;
188
- }
189
-
190
- // The 112dp mobile height is the two-row arrangement's, so it is owed only
191
- // to a banner that has a second row. Without actions the row stays 56dp and
192
- // a one-line message does not float in the middle of an empty half.
193
- &:not(:has(> .actions)) {
194
- --md-comp-banners-basic-height: 56px;
195
- }
196
- }
197
- }
198
-
199
- // Square corners, which M3 uses for a banner sitting flush under an app bar.
200
- // The message's leading inset shrinks with the corner it is clearing.
201
- .banner:not(.rich).square {
202
- --md-comp-banners-basic-shape: 0;
203
- --md-comp-banners-basic-no-icon-body-text-leading-space: 12px;
204
- }
205
-
206
- // Rich: a leading element beside a heading, a message and an action row. Named
207
- // areas rather than auto-placement, so the markup can omit any of the four and
208
- // order the rest however it reads best - a missing area collapses its track.
209
- .banner.rich {
210
- --md-comp-banners-rich-shape: 28px;
211
- --md-comp-banners-rich-leading-space: 12px;
212
- --md-comp-banners-rich-trailing-space: 12px;
213
- --md-comp-banners-rich-top-space: 12px;
214
- --md-comp-banners-rich-bottom-space: 12px;
215
- --md-comp-banners-rich-icon-size: 24px;
216
- --md-comp-banners-rich-icon-text-space: 4px;
217
- --md-comp-banners-rich-image-size: 80px;
218
- --md-comp-banners-rich-image-text-space: 8px;
219
- --md-comp-banners-rich-leading-element-leading-space: 4px;
220
- --md-comp-banners-rich-with-image-leading-space: 20px;
221
- --md-comp-banners-rich-title-text-top-space: 14px;
222
- --md-comp-banners-rich-title-text-bottom-space: 14px;
223
- --md-comp-banners-rich-actions-between-space: 8px;
224
- --md-comp-banners-rich-actions-top-space: 12px;
225
-
226
- display: grid;
227
- grid-template-columns: auto minmax(0, 1fr) auto;
228
- grid-template-areas:
229
- "lead title close"
230
- "lead body close"
231
- "lead actions actions";
232
- padding-block: var(--md-comp-banners-rich-top-space)
233
- var(--md-comp-banners-rich-bottom-space);
234
- padding-inline: var(--md-comp-banners-rich-leading-space)
235
- var(--md-comp-banners-rich-trailing-space);
236
- border-radius: var(--md-comp-banners-rich-shape);
237
-
238
- > #{$icon} {
239
- grid-area: lead;
240
- align-self: start;
241
- margin-inline: var(--md-comp-banners-rich-leading-element-leading-space)
242
- var(--md-comp-banners-rich-icon-text-space);
243
- font-size: var(--md-comp-banners-rich-icon-size);
244
- inline-size: var(--md-comp-banners-rich-icon-size);
245
- block-size: var(--md-comp-banners-rich-icon-size);
246
- line-height: var(--md-comp-banners-rich-icon-size);
247
- color: var(--md-comp-banners-icon-color);
248
- }
249
-
250
- // md.comp.banners.rich.image.shape is corner.none, so the square is square.
251
- > img {
252
- grid-area: lead;
253
- align-self: start;
254
- // The token is measured from the container edge, and the container has
255
- // already spent its own leading space, so the margin is the difference.
256
- margin-inline: calc(
257
- var(--md-comp-banners-rich-with-image-leading-space) -
258
- var(--md-comp-banners-rich-leading-space)
259
- )
260
- var(--md-comp-banners-rich-image-text-space);
261
- inline-size: var(--md-comp-banners-rich-image-size);
262
- block-size: var(--md-comp-banners-rich-image-size);
263
- border-radius: 0;
264
- object-fit: cover;
265
- }
266
-
267
- > :is(h1, h2, h3, h4, h5, h6) {
268
- grid-area: title;
269
- margin: 0;
270
- padding-block: var(--md-comp-banners-rich-title-text-top-space)
271
- var(--md-comp-banners-rich-title-text-bottom-space);
272
- color: var(--md-comp-banners-title-text-color);
273
- // md.sys.typescale.emphasized.body-medium: body-medium at weight 500. The
274
- // emphasized set is not in the token layer, so the weight is written here.
275
- @include typescale("body-medium");
276
- font-weight: 500;
277
- }
278
-
279
- > p {
280
- grid-area: body;
281
- margin: 0;
282
- color: inherit;
283
- }
284
-
285
- > .actions {
286
- grid-area: actions;
287
- display: flex;
288
- align-items: center;
289
- justify-content: flex-end;
290
- gap: var(--md-comp-banners-rich-actions-between-space);
291
- margin-block-start: var(--md-comp-banners-rich-actions-top-space);
292
- }
293
-
294
- > .icon-button {
295
- grid-area: close;
296
- align-self: start;
297
- }
298
- }
@@ -1,180 +0,0 @@
1
- @use "../abstracts" as *;
2
-
3
- // Bottom app bar. A row of *commands* at the bottom edge, with an optional
4
- // FAB — the counterpart of the top app bar, not of the navigation bar.
5
- //
6
- // It is not `nav.navigation-bar`, and the difference is the whole reason this
7
- // component exists twice over. A navigation bar holds 3–5 destinations that do
8
- // not change per screen; a bottom app bar holds the actions of the screen you
9
- // are already on. So this is not a <nav> and takes no landmark (rule 4), and
10
- // M3 says never show the two at once. The retired version of this component
11
- // keyed on `footer:has(> nav:only-child)` — an element, which both claimed the
12
- // landmark and put the two one markup slip apart. The host is a class now, and
13
- // `semantics.json` forbids writing it on a <nav>.
14
- //
15
- // Anatomy is the HTML. Direct <a> / <button> children with a single icon are
16
- // the actions; a `.button.extra.circle` child is the FAB and is pushed to the
17
- // end. `.icon-button` styles itself and opts out, as it does in every host.
18
- //
19
- // M3 Expressive's toolbar (`.toolbar.docked`) is the newer answer to the same
20
- // problem and holds the same commands in a 64dp bar. Both ship; this one is
21
- // the app-bar-shaped 80dp version the spec still publishes tokens for.
22
- //
23
- // Tokens (md.comp.bottom-app-bar.*, DSP 34.0.21 — the container is all of it;
24
- // the actions are icon buttons and the FAB is a FAB):
25
- // --md-comp-bottom-app-bar-container-color surface-container
26
- // --md-comp-bottom-app-bar-container-height 80dp, one height with or
27
- // without a FAB (with-fab's 72dp
28
- // is deprecated), content centred
29
- // --md-comp-bottom-app-bar-container-shape 0
30
- // --md-comp-bottom-app-bar-icon-color on-surface-variant
31
- // --md-comp-bottom-app-bar-icon-size 24dp
32
- // --md-comp-bottom-app-bar-action-size 48dp target
33
- // --md-comp-bottom-app-bar-leading-space 4dp — 16dp to the glyph, less
34
- // --md-comp-bottom-app-bar-trailing-space the 12dp the target insets
35
- // --md-comp-bottom-app-bar-fab-container-color secondary-container, per
36
- // BottomAppBarDefaults, not the
37
- // free-standing FAB's primary
38
- // --md-comp-bottom-app-bar-fab-trailing-space 16dp from the container edge,
39
- // measured from the edge and not
40
- // added to the container's own
41
- // trailing space
42
- // --md-comp-bottom-app-bar-z 997, the navigation bar's rung
43
- .bottom-app-bar {
44
- --md-comp-bottom-app-bar-container-color: var(--md-sys-color-surface-container);
45
- --md-comp-bottom-app-bar-container-height: 80px;
46
- --md-comp-bottom-app-bar-container-shape: 0;
47
- --md-comp-bottom-app-bar-icon-color: var(--md-sys-color-on-surface-variant);
48
- --md-comp-bottom-app-bar-icon-size: 24px;
49
- --md-comp-bottom-app-bar-action-size: 48px;
50
- --md-comp-bottom-app-bar-leading-space: 4px;
51
- --md-comp-bottom-app-bar-trailing-space: 4px;
52
- --md-comp-bottom-app-bar-fab-container-color: var(--md-sys-color-secondary-container);
53
- --md-comp-bottom-app-bar-fab-trailing-space: 16px;
54
- --md-comp-bottom-app-bar-z: 997;
55
-
56
- box-sizing: border-box;
57
- display: flex;
58
- // No gap: the actions are 48dp targets and abut, which is Compose's
59
- // `Arrangement.Start` and puts their glyph centres 48dp apart. The top app
60
- // bar spaces its actions the same way.
61
- align-items: center;
62
- width: 100%;
63
- min-height: var(--md-comp-bottom-app-bar-container-height);
64
- margin: 0;
65
- padding-inline: var(--md-comp-bottom-app-bar-leading-space)
66
- var(--md-comp-bottom-app-bar-trailing-space);
67
- border-radius: var(--md-comp-bottom-app-bar-container-shape);
68
- background-color: var(--md-comp-bottom-app-bar-container-color);
69
- color: var(--md-sys-color-on-surface);
70
- @include z-depth("2");
71
-
72
- // Icon-only actions. Same shape as the top app bar's: a bare control with a
73
- // single icon becomes a 48dp target. Anything that styles itself — the
74
- // common button, the icon button, the FAB — is left alone.
75
- > :is(a, button):not(.button, .icon-button):not(.circle):not(.extra):has(> #{$icon}:only-child) {
76
- display: inline-flex;
77
- flex: 0 0 auto;
78
- align-items: center;
79
- justify-content: center;
80
- width: var(--md-comp-bottom-app-bar-action-size);
81
- height: var(--md-comp-bottom-app-bar-action-size);
82
- margin: 0;
83
- padding: 0;
84
- border: 0;
85
- border-radius: 50%;
86
- background: transparent;
87
- color: var(--md-comp-bottom-app-bar-icon-color);
88
- cursor: pointer;
89
- appearance: none;
90
- font: inherit;
91
- text-decoration: none;
92
- @include focus-visible;
93
-
94
- > #{$icon} {
95
- display: block;
96
- width: var(--md-comp-bottom-app-bar-icon-size);
97
- height: var(--md-comp-bottom-app-bar-icon-size);
98
- font-size: var(--md-comp-bottom-app-bar-icon-size);
99
- line-height: var(--md-comp-bottom-app-bar-icon-size);
100
- }
101
-
102
- &:hover {
103
- background-color: color-mix(in oklab, currentColor state-opacity("hover"), transparent);
104
- }
105
-
106
- &:active {
107
- background-color: color-mix(in oklab, currentColor state-opacity("pressed"), transparent);
108
- }
109
-
110
- &:disabled,
111
- &.disabled {
112
- pointer-events: none;
113
- color: color-mix(in oklab, var(--md-sys-color-on-surface) 38%, transparent);
114
- background: transparent;
115
- }
116
- }
117
-
118
- // The FAB. `margin-inline-start: auto` is the spacer, so the bar needs no
119
- // filler element between the actions and it. Flat and secondary-container:
120
- // the bar is already at level 2, and a second shadow inside it reads as a
121
- // sticker. Specificity beats the FAB's own `:where()`-scoped block.
122
- > :is(a, button).extra.circle,
123
- > :is(a, button).large.circle {
124
- margin-inline-start: auto;
125
- // 16dp from the container edge. The bar's own trailing space is already
126
- // spent, so this is the remainder - Compose's `16.dp - HorizontalPadding`.
127
- margin-inline-end: calc(
128
- var(--md-comp-bottom-app-bar-fab-trailing-space) -
129
- var(--md-comp-bottom-app-bar-trailing-space)
130
- );
131
- background-color: var(--md-comp-bottom-app-bar-fab-container-color);
132
- color: var(--md-sys-color-on-secondary-container);
133
- box-shadow: none;
134
-
135
- &:hover {
136
- box-shadow: none;
137
- background-color: color-mix(
138
- in oklab,
139
- var(--md-sys-color-on-secondary-container) state-opacity("hover"),
140
- var(--md-comp-bottom-app-bar-fab-container-color)
141
- );
142
- }
143
-
144
- // Focus and pressed are separate states with separate opacities, the way
145
- // `abstracts/_mixins` keeps them. `:focus`, not `:focus-visible`: the FAB's
146
- // own block in `_buttons.scss` paints a `primary-container` tint on plain
147
- // `:focus`, and leaving that uncovered would flash the wrong colour family
148
- // at a mouse click. The ring is `focus-visible`'s job and the base rule
149
- // already carries it.
150
- &:focus {
151
- background-color: color-mix(
152
- in oklab,
153
- var(--md-sys-color-on-secondary-container) state-opacity("focus"),
154
- var(--md-comp-bottom-app-bar-fab-container-color)
155
- );
156
- }
157
-
158
- &:active {
159
- background-color: color-mix(
160
- in oklab,
161
- var(--md-sys-color-on-secondary-container) state-opacity("pressed"),
162
- var(--md-comp-bottom-app-bar-fab-container-color)
163
- );
164
- }
165
- }
166
- }
167
-
168
- // Pinned to the bottom edge. Same z rung as nav.navigation-bar.fixed: the two
169
- // are alternatives, never neighbours, so neither needs to sit above the other.
170
- .bottom-app-bar.fixed {
171
- position: fixed;
172
- inset: auto 0 0 0;
173
- z-index: var(--md-comp-bottom-app-bar-z);
174
- // The bar grows by the inset rather than spending its own height on it.
175
- // Under `border-box` the padding would otherwise come out of the 80dp the
176
- // token block and the docs both promise, and the actions would sit in
177
- // whatever was left.
178
- min-height: calc(var(--md-comp-bottom-app-bar-container-height) + env(safe-area-inset-bottom, 0px));
179
- padding-bottom: env(safe-area-inset-bottom, 0px);
180
- }
@@ -1,86 +0,0 @@
1
- @use "../abstracts" as *;
2
-
3
- // Floating sheets.
4
- //
5
- // The third member of M3's sheet family (`md.comp.sheet.floating`). A
6
- // dialog.floating-sheet is the surface, detached from every window edge
7
- // instead of docked to one. showModal() is the modal variant (scrim,
8
- // page inert); show() is the standard variant (no scrim, the page stays
9
- // interactive and the sheet floats above it).
10
- //
11
- // It is a <dialog>, so every dialog slot already applies - heading, body,
12
- // optional <hr> and extra content, and a last-child form[method=dialog]
13
- // as the action row. Only the container differs, and the sheet states it
14
- // by re-pointing the basic-dialog container tokens at its own.
15
- //
16
- // The token set is small on purpose: md.comp.sheet.floating publishes
17
- // exactly three values (DSP 34.0.21) and nothing about placement.
18
- // container surface-container-low, 28dp corners, elevation 1
19
- // inset 24dp from every edge; the sheet centres in what is left
20
- //
21
- // There are deliberately no edge modifiers. `.bottom` and `.left` /
22
- // `.right` already select a bottom or side sheet, so a floating sheet
23
- // that borrowed those names would pick up two sheets' rules at once.
24
- // Author placement with `inset` / `margin` when a corner is wanted.
25
-
26
- dialog.floating-sheet {
27
- --md-comp-floating-sheet-container-color: var(--md-sys-color-surface-container-low);
28
- --md-comp-floating-sheet-container-shape: 28px;
29
- --md-comp-floating-sheet-container-max-width: 400px;
30
- --md-comp-floating-sheet-inset: 24px;
31
-
32
- // The surface is the dialog's; the sheet only swaps what it owns.
33
- --md-comp-basic-dialog-container-color: var(--md-comp-floating-sheet-container-color);
34
- --md-comp-basic-dialog-container-shape: var(--md-comp-floating-sheet-container-shape);
35
-
36
- box-sizing: border-box;
37
- position: fixed;
38
- inset: var(--md-comp-floating-sheet-inset);
39
- width: min(
40
- var(--md-comp-floating-sheet-container-max-width),
41
- calc(100% - 2 * var(--md-comp-floating-sheet-inset))
42
- );
43
- min-width: 0;
44
- max-width: var(--md-comp-floating-sheet-container-max-width);
45
- // `inset` sets both block edges, and an `auto` height between two fixed
46
- // edges is *solved*, not shrink-wrapped - the sheet would fill the window
47
- // whatever it holds. `fit-content` makes all three non-auto, which is the
48
- // case where auto margins centre instead.
49
- height: fit-content;
50
- // A percentage max-height resolves against the containing block, which is
51
- // the whole viewport - not the box `inset` leaves. At 100% a tall sheet
52
- // grew to viewport height, went over-constrained, and auto margins split
53
- // the overflow as -24px top and bottom: the inset disappeared exactly when
54
- // the sheet was large enough to need it.
55
- max-height: calc(100% - 2 * var(--md-comp-floating-sheet-inset));
56
- margin: auto;
57
- @include z-depth("1");
58
- opacity: 1;
59
- scale: 1;
60
- transition: opacity 200ms ease, scale 200ms ease;
61
-
62
- // Non-modal `show()` is not in the top layer - sit above page content
63
- // and below snackbars (z-index 10000).
64
- &:not(:modal) {
65
- z-index: 1100;
66
- }
67
-
68
- // Standard: no scrim. Modal keeps the basic-dialog backdrop.
69
- &:not(:modal)::backdrop {
70
- background: none;
71
- backdrop-filter: none;
72
- }
73
- }
74
-
75
- @starting-style {
76
- dialog.floating-sheet[open] {
77
- opacity: 0;
78
- scale: 0.9;
79
- }
80
- }
81
-
82
- @media (prefers-reduced-motion: reduce) {
83
- dialog.floating-sheet {
84
- transition: none;
85
- }
86
- }