@expressivecss/expressive 0.2.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 (80) hide show
  1. package/README.md +8 -8
  2. package/dist/css/expressive.css +1915 -1566
  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 +1338 -1528
  7. package/dist/js/expressive.cjs.map +4 -4
  8. package/dist/js/expressive.js +1338 -1528
  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 +1338 -1529
  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 +19 -43
  16. package/dist/types/components/cards.d.ts +3 -6
  17. package/dist/types/components/carousel.d.ts +42 -48
  18. package/dist/types/components/characterCounter.d.ts +3 -5
  19. package/dist/types/components/chips.d.ts +4 -4
  20. package/dist/types/components/collapsible.d.ts +28 -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 +7 -37
  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 +25 -26
  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 +3 -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 +6 -5
  45. package/src/sass/components/_breadcrumb.scss +93 -16
  46. package/src/sass/components/_buttons.scss +212 -145
  47. package/src/sass/components/_cards.scss +50 -123
  48. package/src/sass/components/_carousel.scss +128 -63
  49. package/src/sass/components/_chips.scss +1 -1
  50. package/src/sass/components/_collapsible.scss +158 -60
  51. package/src/sass/components/_collection.scss +146 -80
  52. package/src/sass/components/_datepicker.scss +1 -15
  53. package/src/sass/components/_dropdown.scss +110 -14
  54. package/src/sass/components/_icons-material-design.scss +77 -4
  55. package/src/sass/components/_index.scss +1 -0
  56. package/src/sass/components/_lightbox.scss +4 -0
  57. package/src/sass/components/_modal.scss +13 -31
  58. package/src/sass/components/_navbar.scss +24 -6
  59. package/src/sass/components/_page-footer.scss +134 -15
  60. package/src/sass/components/_pagination.scss +131 -25
  61. package/src/sass/components/_parallax.scss +96 -21
  62. package/src/sass/components/_preloader.scss +145 -300
  63. package/src/sass/components/_scrollspy.scss +18 -0
  64. package/src/sass/components/_sidenav.scss +230 -119
  65. package/src/sass/components/_slider.scss +8 -0
  66. package/src/sass/components/_table_of_contents.scss +30 -14
  67. package/src/sass/components/_tabs.scss +54 -35
  68. package/src/sass/components/_tapTarget.scss +128 -45
  69. package/src/sass/components/_toast.scss +10 -11
  70. package/src/sass/components/_toolbar.scss +2 -2
  71. package/src/sass/components/_tooltip.scss +4 -9
  72. package/src/sass/components/_transitions.scss +0 -5
  73. package/src/sass/components/forms/_index.scss +0 -5
  74. package/src/sass/components/forms/_input-fields.scss +49 -52
  75. package/src/sass/components/forms/_select.scss +175 -60
  76. package/src/sass/components/forms/_switches.scss +21 -8
  77. package/src/sass/utilities/_helpers.scss +1 -3
  78. package/src/sass/utilities/_typescale.scss +0 -5
  79. package/src/sass/utilities/_visibility.scss +2 -2
  80. 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; }
@@ -1,95 +1,160 @@
1
1
  @use "../abstracts" as *;
2
2
 
3
+ // Carousel. Two layouts, one class:
4
+ // .carousel 3D coverflow (JS)
5
+ // .carousel.flat linear snap track (CSS).
6
+ //
7
+ // Anatomy: direct children move. .carousel-item is optional. Indicators and
8
+ // .carousel-fixed-item are chrome, not slides.
9
+ //
10
+ // Tokens:
11
+ // --md-comp-carousel-height 400px (--carousel-height still wins)
12
+ // --md-comp-carousel-shape 12px
13
+ // --md-comp-carousel-gap 0
14
+
3
15
  .carousel {
4
- --carousel-height: 400px;
16
+ --md-comp-carousel-height: 400px;
17
+ --md-comp-carousel-shape: 12px;
18
+ --md-comp-carousel-gap: 0px;
5
19
 
6
20
  overflow: hidden;
7
21
  position: relative;
8
22
  width: 100%;
9
- height: var(--carousel-height);
10
- perspective: 500px;
11
- transform-style: preserve-3d;
12
- transform-origin: 0% 50%;
23
+ height: var(--carousel-height, var(--md-comp-carousel-height));
24
+ border-radius: var(--md-comp-carousel-shape);
13
25
 
14
- &.carousel-slider {
15
- top: 0;
16
- left: 0;
26
+ .carousel-item > img,
27
+ .carousel-item > video {
28
+ display: block;
29
+ width: 100%;
30
+ height: 100%;
31
+ object-fit: cover;
32
+ }
17
33
 
18
- .carousel-fixed-item {
19
- position: absolute;
20
- left: 0;
21
- right: 0;
22
- bottom: 20px;
23
- z-index: 1;
34
+ .indicators {
35
+ display: flex;
36
+ justify-content: center;
37
+ align-items: center;
38
+ gap: 8px;
39
+ list-style: none;
40
+ position: absolute;
41
+ inset: auto 0 0;
42
+ z-index: 2;
43
+ margin: 0;
44
+ padding: 16px 0;
45
+ border: 0;
46
+ background: none;
24
47
 
25
- &.with-indicators {
26
- bottom: 68px;
27
- }
28
- }
48
+ .indicator-item {
49
+ appearance: none;
50
+ box-sizing: border-box;
51
+ display: block;
52
+ width: 8px;
53
+ height: 8px;
54
+ margin: 0;
55
+ padding: 0;
56
+ border: 0;
57
+ border-radius: 50%;
58
+ background-color: color-mix(in oklab, var(--md-sys-color-on-surface) 45%, transparent);
59
+ cursor: pointer;
60
+ transition: background-color 0.2s ease-out;
29
61
 
30
- .carousel-item {
31
- width: 100%;
32
- height: 100%;
33
- min-height: var(--carousel-height);
34
- position: absolute;
35
- top: 0;
36
- left: 0;
37
-
38
- h2 {
39
- font-size: 24px;
40
- font-weight: 500;
41
- line-height: 32px;
62
+ &:is(.active, [aria-current="true"]) {
63
+ background-color: var(--md-sys-color-primary);
42
64
  }
43
65
 
44
- p {
45
- font-size: 15px;
46
- }
66
+ @include focus-visible;
47
67
  }
48
68
  }
69
+ }
49
70
 
50
- .carousel-item {
71
+ // Coverflow. JS writes transform / opacity / visibility on each item.
72
+ .carousel:not(.flat) {
73
+ perspective: 500px;
74
+ transform-style: preserve-3d;
75
+ transform-origin: 0% 50%;
76
+ touch-action: pan-y;
77
+
78
+ > .carousel-item {
51
79
  visibility: hidden;
52
- width: calc(var(--carousel-height) * 0.5);
53
- height: calc(var(--carousel-height) * 0.5);
54
80
  position: absolute;
55
81
  top: 0;
56
82
  left: 0;
83
+ width: calc(var(--carousel-height, var(--md-comp-carousel-height)) * 0.5);
84
+ height: calc(var(--carousel-height, var(--md-comp-carousel-height)) * 0.5);
85
+ overflow: hidden;
86
+ border-radius: var(--md-comp-carousel-shape);
87
+ }
88
+ }
89
+
90
+ // Linear track. The outer box clips and holds chrome (dots, fixed item).
91
+ // Slides live in .carousel-track so they can scroll without taking the
92
+ // controls with them — abspos children of an overflow:auto box scroll too.
93
+ .carousel.flat {
94
+ overflow: hidden;
95
+ perspective: none;
96
+ transform: none;
97
+
98
+ > .carousel-track {
99
+ display: flex;
100
+ gap: var(--md-comp-carousel-gap);
101
+ box-sizing: border-box;
102
+ width: 100%;
103
+ height: 100%;
104
+ overflow-x: auto;
105
+ overflow-y: hidden;
106
+ scroll-snap-type: x mandatory;
107
+ scroll-behavior: smooth;
108
+ touch-action: pan-x;
109
+ scrollbar-width: none;
57
110
 
58
- & > img {
59
- width: 100%;
111
+ &::-webkit-scrollbar {
112
+ display: none;
60
113
  }
61
114
  }
62
115
 
63
- .indicators {
64
- padding-left: 0;
65
- list-style-type: none;
116
+ .carousel-track > .carousel-item {
117
+ flex: 0 0 100%;
118
+ width: 100%;
119
+ height: 100%;
120
+ min-height: 0;
121
+ position: relative;
122
+ visibility: visible;
123
+ scroll-snap-align: start;
124
+ scroll-snap-stop: always;
125
+ }
126
+
127
+ .carousel-fixed-item {
66
128
  position: absolute;
67
- text-align: center;
68
- left: 0;
69
- right: 0;
70
- bottom: 0;
71
- margin: 0;
129
+ inset: auto 0 20px;
130
+ z-index: 1;
72
131
 
73
- .indicator-item {
74
- display: inline-block;
75
- position: relative;
76
- cursor: pointer;
77
- height: 8px;
78
- width: 8px;
79
- margin: 24px 4px;
80
- background-color: rgba(255, 255, 255, 0.45);
81
- transition: background-color .3s;
82
- border-radius: 50%;
132
+ &.with-indicators {
133
+ bottom: 68px;
134
+ }
135
+ }
83
136
 
84
- &.active {
85
- background-color: var(--md-ref-palette-primary100);
86
- }
137
+ .carousel-item {
138
+ h2 {
139
+ @include typescale("headline-small");
140
+ margin: 0 0 8px;
141
+ }
142
+
143
+ p {
144
+ @include typescale("body-medium");
145
+ margin: 0;
87
146
  }
88
147
  }
148
+ }
89
149
 
90
- // Lightbox compatibility
91
- &.scrolling .carousel-item .lightboxed,
92
- .carousel-item:not(.active) .lightboxed {
93
- pointer-events: none;
150
+ @media (prefers-reduced-motion: reduce) {
151
+ .carousel.flat > .carousel-track {
152
+ scroll-behavior: auto;
94
153
  }
95
154
  }
155
+
156
+ // Lightbox: do not open a boxed image while the track is moving.
157
+ .carousel.scrolling .carousel-item .lightboxed,
158
+ .carousel-item:not(.active) .lightboxed {
159
+ pointer-events: none;
160
+ }
@@ -43,7 +43,7 @@
43
43
  border-radius: 12px;
44
44
  }
45
45
 
46
- .chip > .material-icons {
46
+ .chip > :is(.material-symbols, .material-symbols-outlined, .material-symbols-rounded, .material-symbols-sharp, .material-icons) {
47
47
  font-size: var(--font-size-icon);
48
48
  color: var(--md-sys-color-on-surface-variant);
49
49
  }