@expressivecss/expressive 0.3.0 → 0.4.0

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 (74) hide show
  1. package/README.md +1 -1
  2. package/dist/css/expressive.css +1011 -1339
  3. package/dist/css/expressive.css.map +1 -1
  4. package/dist/css/expressive.min.css +1 -1
  5. package/dist/css/expressive.min.css.map +1 -1
  6. package/dist/js/expressive.cjs +701 -853
  7. package/dist/js/expressive.cjs.map +4 -4
  8. package/dist/js/expressive.js +701 -853
  9. package/dist/js/expressive.js.map +4 -4
  10. package/dist/js/expressive.min.js +10 -20
  11. package/dist/js/expressive.min.js.map +4 -4
  12. package/dist/js/expressive.mjs +701 -854
  13. package/dist/js/expressive.mjs.map +4 -4
  14. package/dist/types/components/autocomplete.d.ts +2 -9
  15. package/dist/types/components/buttons.d.ts +2 -2
  16. package/dist/types/components/cards.d.ts +3 -6
  17. package/dist/types/components/carousel.d.ts +3 -3
  18. package/dist/types/components/characterCounter.d.ts +3 -5
  19. package/dist/types/components/chips.d.ts +2 -2
  20. package/dist/types/components/collapsible.d.ts +6 -23
  21. package/dist/types/components/datepicker.d.ts +2 -8
  22. package/dist/types/components/dropdown.d.ts +11 -2
  23. package/dist/types/components/index.d.ts +0 -1
  24. package/dist/types/components/lightbox.d.ts +2 -2
  25. package/dist/types/components/parallax.d.ts +2 -8
  26. package/dist/types/components/pushpin.d.ts +2 -2
  27. package/dist/types/components/range.d.ts +2 -2
  28. package/dist/types/components/registry.d.ts +0 -4
  29. package/dist/types/components/scrollspy.d.ts +26 -50
  30. package/dist/types/components/select.d.ts +20 -6
  31. package/dist/types/components/sidenav.d.ts +40 -55
  32. package/dist/types/components/slider.d.ts +2 -2
  33. package/dist/types/components/tabs.d.ts +2 -2
  34. package/dist/types/components/tapTarget.d.ts +2 -2
  35. package/dist/types/components/timepicker.d.ts +2 -4
  36. package/dist/types/components/tooltip.d.ts +2 -2
  37. package/dist/types/core/component.d.ts +4 -4
  38. package/dist/types/index.d.ts +1 -1
  39. package/package.json +2 -2
  40. package/src/sass/README.md +2 -6
  41. package/src/sass/abstracts/_breakpoints.scss +0 -16
  42. package/src/sass/abstracts/_variables.scss +0 -21
  43. package/src/sass/base/_grid.scss +0 -19
  44. package/src/sass/components/_badges.scss +1 -1
  45. package/src/sass/components/_buttons.scss +22 -54
  46. package/src/sass/components/_cards.scss +50 -123
  47. package/src/sass/components/_carousel.scss +4 -6
  48. package/src/sass/components/_collapsible.scss +13 -15
  49. package/src/sass/components/_collection.scss +9 -27
  50. package/src/sass/components/_datepicker.scss +1 -15
  51. package/src/sass/components/_dropdown.scss +110 -14
  52. package/src/sass/components/_index.scss +1 -0
  53. package/src/sass/components/_modal.scss +13 -31
  54. package/src/sass/components/_navbar.scss +9 -6
  55. package/src/sass/components/_page-footer.scss +134 -15
  56. package/src/sass/components/_parallax.scss +7 -28
  57. package/src/sass/components/_preloader.scss +145 -300
  58. package/src/sass/components/_scrollspy.scss +18 -0
  59. package/src/sass/components/_sidenav.scss +226 -120
  60. package/src/sass/components/_table_of_contents.scss +30 -14
  61. package/src/sass/components/_tabs.scss +54 -35
  62. package/src/sass/components/_tapTarget.scss +2 -6
  63. package/src/sass/components/_toast.scss +10 -11
  64. package/src/sass/components/_toolbar.scss +2 -2
  65. package/src/sass/components/_tooltip.scss +4 -9
  66. package/src/sass/components/_transitions.scss +0 -5
  67. package/src/sass/components/forms/_index.scss +0 -5
  68. package/src/sass/components/forms/_input-fields.scss +49 -52
  69. package/src/sass/components/forms/_select.scss +175 -60
  70. package/src/sass/components/forms/_switches.scss +21 -8
  71. package/src/sass/utilities/_helpers.scss +1 -3
  72. package/src/sass/utilities/_typescale.scss +0 -5
  73. package/src/sass/utilities/_visibility.scss +2 -2
  74. package/dist/types/components/modal.d.ts +0 -45
@@ -3,9 +3,10 @@
3
3
  // Cards.
4
4
  //
5
5
  // Anatomy is the HTML. An <article> is an elevated card. A heading is the
6
- // headline, a <p> is supporting text, a direct <nav> is the action row,
6
+ // headline, a <p> is supporting text, a direct <nav> (not .tabs) is the
7
+ // action row,
7
8
  // <img> / <figure> is media. Helpers switch the M3 variant (filled, outlined)
8
- // or the layout (horizontal). .card and .card-panel stay as aliases.
9
+ // or the layout (horizontal).
9
10
  //
10
11
  // Tokens follow https://m3.material.io/components/cards/specs
11
12
  // container surface, 12dp corners
@@ -16,7 +17,7 @@
16
17
  // body body-medium / on-surface-variant
17
18
  // padding 16dp
18
19
 
19
- $_card: "article, .card, .card-panel";
20
+ $_card: "article";
20
21
 
21
22
  :where(#{$_card}) {
22
23
  --md-comp-elevated-card-container-color: var(--md-sys-color-surface);
@@ -88,7 +89,8 @@ article > header {
88
89
  color: inherit;
89
90
  }
90
91
 
91
- article > nav {
92
+ // Action row. nav.tabs is a tab bar, not actions — leave it to _tabs.scss.
93
+ article > nav:not(.tabs) {
92
94
  display: flex;
93
95
  flex-wrap: wrap;
94
96
  align-items: center;
@@ -132,8 +134,7 @@ article > figure > figcaption {
132
134
  }
133
135
 
134
136
  // Horizontal: media on the start, body stacked beside it.
135
- article.horizontal,
136
- .card.horizontal {
137
+ article.horizontal {
137
138
  display: flex;
138
139
  flex-direction: row;
139
140
  align-items: stretch;
@@ -141,8 +142,7 @@ article.horizontal,
141
142
 
142
143
  > img,
143
144
  > picture,
144
- > figure,
145
- > .card-image {
145
+ > figure {
146
146
  flex: 0 0 40%;
147
147
  max-width: 40%;
148
148
  width: 40%;
@@ -151,8 +151,7 @@ article.horizontal,
151
151
 
152
152
  > img,
153
153
  > picture img,
154
- > figure img,
155
- > .card-image img {
154
+ > figure img {
156
155
  height: 100%;
157
156
  object-fit: cover;
158
157
  }
@@ -165,55 +164,56 @@ article.horizontal,
165
164
  }
166
165
  }
167
166
 
168
- // Fixed heights (Materialize sizes, still useful for uniform grids).
169
- article.small, .card.small { height: 300px; }
170
- article.medium, .card.medium { height: 400px; }
171
- article.large, .card.large { height: 500px; }
167
+ // Fixed heights for uniform grids.
168
+ article.small { height: 300px; }
169
+ article.medium { height: 400px; }
170
+ article.large { height: 500px; }
172
171
 
173
- article.small, article.medium, article.large,
174
- .card.small, .card.medium, .card.large {
172
+ article.small, article.medium, article.large {
175
173
  display: flex;
176
174
  flex-direction: column;
177
175
 
178
- > img, > picture, > figure, > .card-image {
176
+ > img, > picture, > figure {
179
177
  flex: 0 1 60%;
180
178
  min-height: 0;
181
179
  overflow: hidden;
182
180
  }
183
181
 
184
- > img, > figure img, > .card-image img {
182
+ > img, > figure img {
185
183
  height: 100%;
186
184
  }
187
185
 
188
- > p, > .card-content {
186
+ > p {
189
187
  flex: 1 1 auto;
190
188
  min-height: 0;
191
189
  overflow: hidden;
192
190
  }
193
191
 
194
- > nav, > .card-action {
192
+ > nav:not(.tabs) {
195
193
  margin-top: auto;
196
194
  }
197
195
  }
198
196
 
199
197
  article.horizontal.small,
200
198
  article.horizontal.medium,
201
- article.horizontal.large,
202
- .card.horizontal.small,
203
- .card.horizontal.medium,
204
- .card.horizontal.large {
199
+ article.horizontal.large {
205
200
  flex-direction: row;
206
201
 
207
- > img, > picture, > figure, > .card-image {
202
+ > img, > picture, > figure {
208
203
  flex: 0 0 40%;
209
204
  max-height: none;
210
205
  }
211
206
  }
212
207
 
213
- // Reveal overlay. aside is the semantic name; .card-reveal is the JS alias.
214
- article > aside,
215
- .card-reveal {
216
- display: none;
208
+ // Reveal overlay. aside is the panel. Parked under the card (translateY 100%)
209
+ // and clipped by overflow:hidden. Open is aria-expanded="true" → slide up
210
+ // to cover. Do not use inset:0 as the closed geometry and then
211
+ // translateY(-100%): that slides the panel *off* the card, and isOpen stays
212
+ // true so a second click is a no-op.
213
+ article > aside {
214
+ --md-comp-card-reveal-duration: 300ms;
215
+ --md-comp-card-reveal-easing: ease;
216
+
217
217
  position: absolute;
218
218
  inset: 0;
219
219
  z-index: 3;
@@ -222,107 +222,34 @@ article > aside,
222
222
  overflow-y: auto;
223
223
  background-color: var(--md-sys-color-surface);
224
224
  color: var(--md-sys-color-on-surface);
225
+ transform: translateY(100%);
226
+ visibility: hidden;
227
+ pointer-events: none;
228
+ transition:
229
+ transform var(--md-comp-card-reveal-duration) var(--md-comp-card-reveal-easing),
230
+ visibility 0s var(--md-comp-card-reveal-duration);
225
231
  }
226
232
 
227
- article.sticky > nav,
228
- .card.sticky-action > .card-action {
229
- position: relative;
230
- z-index: 4;
231
- background-color: inherit;
232
- }
233
-
234
- article.sticky > aside,
235
- .card.sticky-action > .card-reveal {
236
- bottom: auto;
237
- height: calc(100% - 52px);
238
- }
239
-
240
- // Simple padded surface. Same tokens as a card with no slots.
241
- .card-panel {
242
- padding: 16px;
243
- margin: $element-top-margin 0 $element-bottom-margin 0;
244
- }
245
-
246
- // --- Legacy slots (.card-*) so existing markup keeps working --------------
247
-
248
- .card-title {
249
- font-family: var(--md-sys-typescale-title-medium-font-family-name);
250
- font-size: var(--md-sys-typescale-title-medium-font-size);
251
- font-weight: var(--md-sys-typescale-title-medium-font-weight);
252
- line-height: var(--md-sys-typescale-title-medium-line-height);
253
- letter-spacing: var(--md-sys-typescale-title-medium-letter-spacing);
254
- }
255
-
256
- .card .card-image {
257
- position: relative;
258
-
259
- img {
260
- display: block;
261
- width: 100%;
262
- object-fit: cover;
263
- }
264
-
265
- .card-title {
266
- position: absolute;
267
- bottom: 0;
268
- left: 0;
269
- max-width: 100%;
270
- padding: 16px;
271
- color: var(--md-sys-color-on-surface);
272
- background: color-mix(in oklab, var(--md-sys-color-surface) 72%, transparent);
273
- }
274
-
275
- .activator {
276
- position: absolute;
277
- inset: 0;
278
- cursor: pointer;
279
- }
280
-
281
- img.activator {
282
- position: relative;
283
- }
284
- }
285
-
286
- .card .card-content {
287
- padding: 16px;
288
- border-radius: 0;
289
-
290
- p { margin: 0; }
291
-
292
- .card-title {
293
- display: block;
294
- margin-bottom: 8px;
295
-
296
- &.activator { cursor: pointer; }
297
- }
233
+ article > aside[aria-expanded="true"] {
234
+ transform: translateY(0);
235
+ visibility: visible;
236
+ pointer-events: auto;
237
+ transition: transform var(--md-comp-card-reveal-duration) var(--md-comp-card-reveal-easing);
298
238
  }
299
239
 
300
- .card .card-action {
301
- display: flex;
302
- flex-wrap: wrap;
303
- align-items: center;
304
- gap: 8px;
305
- padding: 4px 8px 8px;
306
-
307
- a:not(.button):not(.btn):not(.btn-floating) {
308
- @include btn-flat;
309
- height: auto;
310
- padding: 8px 12px;
311
- min-height: 40px;
240
+ @media (prefers-reduced-motion: reduce) {
241
+ article > aside {
242
+ transition: none;
312
243
  }
313
244
  }
314
245
 
315
- .card .card-stacked {
316
- display: flex;
317
- flex-direction: column;
318
- flex: 1;
319
- min-width: 0;
320
-
321
- .card-content { flex-grow: 1; }
246
+ article.sticky > nav {
247
+ position: relative;
248
+ z-index: 4;
249
+ background-color: inherit;
322
250
  }
323
251
 
324
- .card .card-image .activator {
325
- cursor: pointer;
252
+ article.sticky > aside {
253
+ bottom: auto;
254
+ height: calc(100% - 52px);
326
255
  }
327
-
328
- .no-padding { padding: 0 !important; }
@@ -2,7 +2,7 @@
2
2
 
3
3
  // Carousel. Two layouts, one class:
4
4
  // .carousel 3D coverflow (JS)
5
- // .carousel.flat linear snap track (CSS). .carousel-slider is an alias.
5
+ // .carousel.flat linear snap track (CSS).
6
6
  //
7
7
  // Anatomy: direct children move. .carousel-item is optional. Indicators and
8
8
  // .carousel-fixed-item are chrome, not slides.
@@ -69,7 +69,7 @@
69
69
  }
70
70
 
71
71
  // Coverflow. JS writes transform / opacity / visibility on each item.
72
- .carousel:not(.flat):not(.carousel-slider) {
72
+ .carousel:not(.flat) {
73
73
  perspective: 500px;
74
74
  transform-style: preserve-3d;
75
75
  transform-origin: 0% 50%;
@@ -90,8 +90,7 @@
90
90
  // Linear track. The outer box clips and holds chrome (dots, fixed item).
91
91
  // Slides live in .carousel-track so they can scroll without taking the
92
92
  // controls with them — abspos children of an overflow:auto box scroll too.
93
- .carousel.flat,
94
- .carousel.carousel-slider {
93
+ .carousel.flat {
95
94
  overflow: hidden;
96
95
  perspective: none;
97
96
  transform: none;
@@ -149,8 +148,7 @@
149
148
  }
150
149
 
151
150
  @media (prefers-reduced-motion: reduce) {
152
- .carousel.flat > .carousel-track,
153
- .carousel.carousel-slider > .carousel-track {
151
+ .carousel.flat > .carousel-track {
154
152
  scroll-behavior: auto;
155
153
  }
156
154
  }
@@ -5,8 +5,7 @@
5
5
  // omit it (or add .expandable) so several can stay open. The `open`
6
6
  // attribute is the preselected section.
7
7
  //
8
- // <ul>/<li> + .collapsible-header / .collapsible-body stay as aliases.
9
- // .collapsible-accordion is the default and does nothing extra.
8
+ // JS wraps non-summary children in a div so height can clip.
10
9
  //
11
10
  // Tokens:
12
11
  // --md-comp-collapsible-shape 12px
@@ -48,11 +47,11 @@
48
47
  color: var(--md-sys-color-on-surface);
49
48
  @include z-depth("1");
50
49
 
51
- > :is(details, li) + :is(details, li) {
50
+ > details + details {
52
51
  border-top: 1px solid var(--md-comp-collapsible-outline-color);
53
52
  }
54
53
 
55
- :is(summary, .collapsible-header) {
54
+ summary {
56
55
  display: flex;
57
56
  align-items: center;
58
57
  box-sizing: border-box;
@@ -102,7 +101,7 @@
102
101
  }
103
102
  }
104
103
 
105
- :is(details[open] > summary, .active > .collapsible-header)::after {
104
+ details[open] > summary::after {
106
105
  transform: rotate(180deg);
107
106
  transition-timing-function: var(--md-comp-collapsible-easing-open);
108
107
  }
@@ -111,9 +110,9 @@
111
110
  flex-grow: 1;
112
111
  }
113
112
 
114
- // Shared body for the <ul> alias and for <details> (JS wraps the
115
- // latter). Text stays painted and is clipped as the row shrinks.
116
- .collapsible-body {
113
+ // JS wraps non-summary children. Text stays painted and is clipped
114
+ // as the row shrinks.
115
+ details > :not(summary) {
117
116
  display: grid;
118
117
  grid-template-rows: 0fr;
119
118
  box-sizing: border-box;
@@ -128,19 +127,18 @@
128
127
  }
129
128
  }
130
129
 
131
- .active > .collapsible-body,
132
- details[open] > .collapsible-body {
130
+ details[open] > :not(summary) {
133
131
  grid-template-rows: 1fr;
134
132
  transition-timing-function: var(--md-comp-collapsible-easing-open);
135
133
  }
136
134
 
137
135
  // UA `display: none` on closed details children. Keep our wrapper as
138
136
  // a grid so 0fr can clip instead of popping the copy away.
139
- details:not([open]) > .collapsible-body {
137
+ details:not([open]) > :not(summary) {
140
138
  display: grid;
141
139
  }
142
140
 
143
- &.no-icon :is(summary, .collapsible-header)::after {
141
+ &.no-icon summary::after {
144
142
  content: none;
145
143
  }
146
144
 
@@ -150,7 +148,7 @@
150
148
  background: transparent;
151
149
  @include z-depth("0");
152
150
 
153
- > :is(details, li) {
151
+ > details {
154
152
  margin-inline: var(--md-comp-collapsible-popout-inset);
155
153
  overflow: hidden;
156
154
  border: 0;
@@ -161,11 +159,11 @@
161
159
  @include z-depth("1");
162
160
  }
163
161
 
164
- > :is(details, li) + :is(details, li) {
162
+ > details + details {
165
163
  border-top: 0;
166
164
  }
167
165
 
168
- > :is(details[open], li.active) {
166
+ > details[open] {
169
167
  margin-block: var(--md-comp-collapsible-popout-gap);
170
168
  margin-inline: 0;
171
169
  transition-timing-function: var(--md-comp-collapsible-easing-open);
@@ -4,8 +4,7 @@
4
4
  // as the first child of an item is the header. An <a> may be the item
5
5
  // (old <div class="collection"> markup) or live inside an <li>.
6
6
  //
7
- // Aliases: .collection-item, .collection-header, .with-header, .avatar,
8
- // .title, .secondary-content. .flush drops the boxed outline.
7
+ // .flush drops the boxed outline.
9
8
  //
10
9
  // Tokens:
11
10
  // --md-comp-collection-shape 12px
@@ -40,7 +39,7 @@
40
39
  border-top: 1px solid var(--md-comp-collection-outline-color);
41
40
  }
42
41
 
43
- > :is(li, a, .collection-item, .collection-header) {
42
+ > :is(li, a) {
44
43
  display: grid;
45
44
  grid-template-columns: auto 1fr auto;
46
45
  grid-template-rows: auto auto;
@@ -96,14 +95,14 @@
96
95
  grid-row: 2;
97
96
  }
98
97
 
99
- > :is(.secondary-content, .badge) {
98
+ > :is(a:last-child, .badge) {
100
99
  grid-column: 3;
101
100
  grid-row: 1 / -1;
102
101
  align-self: center;
103
102
  justify-self: end;
104
103
  }
105
104
 
106
- > a:not(.secondary-content, .btn, .btn-floating, .badge) {
105
+ > a:not(.badge) {
107
106
  grid-column: 1 / -1;
108
107
  display: flex;
109
108
  align-items: center;
@@ -118,12 +117,11 @@
118
117
  }
119
118
  }
120
119
 
121
- > :is(li, .collection-item):is(.avatar, :has(> .circle)),
122
- > a:has(> .circle) {
120
+ > :is(li, a):has(> .circle) {
123
121
  min-height: 72px;
124
122
  }
125
123
 
126
- > :is(.collection-header, li:has(> :is(h1, h2, h3, h4, h5, h6))) {
124
+ > li:has(> :is(h1, h2, h3, h4, h5, h6)) {
127
125
  min-height: 0;
128
126
  padding-block: 12px;
129
127
 
@@ -135,12 +133,12 @@
135
133
  }
136
134
 
137
135
  > a,
138
- > li > a:not(.secondary-content, .btn, .btn-floating) {
136
+ > li > a {
139
137
  @include focus-visible;
140
138
  }
141
139
 
142
140
  > a:hover,
143
- > li:has(> a:not(.secondary-content, .btn, .btn-floating):hover) {
141
+ > li:has(> a:hover) {
144
142
  background-color: color-mix(in oklab, var(--md-sys-color-on-surface) 8%, transparent);
145
143
  }
146
144
 
@@ -149,7 +147,7 @@
149
147
  background-color: var(--md-sys-color-secondary-container);
150
148
  color: var(--md-sys-color-on-secondary-container);
151
149
 
152
- .secondary-content:not(.btn, .btn-floating) {
150
+ > a:last-child {
153
151
  color: var(--md-sys-color-on-secondary-container);
154
152
  }
155
153
 
@@ -163,16 +161,6 @@
163
161
  color: color-mix(in oklab, var(--md-sys-color-on-surface) 38%, transparent);
164
162
  }
165
163
 
166
- .secondary-content {
167
- float: none;
168
- margin-inline-start: auto;
169
- @include focus-visible;
170
-
171
- &:not(.btn, .btn-floating) {
172
- color: var(--md-sys-color-primary);
173
- }
174
- }
175
-
176
164
  span.badge {
177
165
  float: none;
178
166
  margin-block: 0;
@@ -185,12 +173,6 @@
185
173
  }
186
174
  }
187
175
 
188
- // Keep the hook public so pages that used it outside a collection still
189
- // color the trailing action. Layout (no float) is owned by .collection.
190
- .secondary-content:not(.btn, .btn-floating) {
191
- color: var(--md-sys-color-primary);
192
- }
193
-
194
176
  .collapsible .collection {
195
177
  margin: 0;
196
178
  border: none;
@@ -1,14 +1,5 @@
1
1
  @use "../abstracts" as *;
2
2
 
3
- /* Modal */
4
- // @removed since v2.2.1
5
- /*.datepicker-modal {
6
- max-width: 325px;
7
- // @removed since v2.2.1-dev regarding Material M3 standards
8
- min-width: 300px;
9
- max-height: none;
10
- }*/
11
-
12
3
  .datepicker-container {
13
4
  display: flex;
14
5
  flex-direction: column;
@@ -27,7 +18,7 @@
27
18
  display: flex;
28
19
  }
29
20
 
30
- .select-wrapper {
21
+ .field:has(> .hide-select) {
31
22
  input {
32
23
  height: 49px;
33
24
  margin: 4px 0 0 0;
@@ -50,11 +41,6 @@
50
41
  }
51
42
  }
52
43
 
53
- .select-dropdown {
54
- padding: 0;
55
- vertical-align: middle;
56
- }
57
-
58
44
  .select-year input,
59
45
  .select-month input {
60
46
  background-color: transparent;