@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
@@ -1,36 +1,154 @@
1
1
  @use "../abstracts" as *;
2
2
 
3
+ // Navigation drawer.
4
+ //
5
+ // Overlay is a modal <dialog> (JS wraps a <ul class="sidenav"> in
6
+ // dialog.sidenav-overlay, or the author writes <dialog class="sidenav">).
7
+ // showModal() puts it on the top layer; ::backdrop is the scrim; Escape
8
+ // and a scrim tap close it. Drag writes --md-comp-nav-drawer-shift;
9
+ // this file does the slide.
10
+ //
11
+ // .sidenav-fixed is a breakpoint, not a JS open(): at `large` the host
12
+ // is display: contents so the list is a docked sidebar. Below that it
13
+ // is the same overlay drawer as any other sidenav.
14
+ //
15
+ // Tokens:
16
+ // --md-comp-nav-drawer-width 300px
17
+ // --md-comp-nav-drawer-item-height 48px
18
+ // --md-comp-nav-drawer-duration 250ms
19
+ // --md-comp-nav-drawer-easing
20
+ // --md-comp-nav-drawer-shift 0px (JS, px from fully open)
21
+ // --md-comp-nav-drawer-open 1 (JS, 0–1 scrim opacity)
22
+ // --md-comp-nav-drawer-font-size 14px
23
+ // --md-comp-nav-drawer-padding 16px
24
+ // --md-comp-nav-drawer-line-height item height
25
+
26
+ :root {
27
+ --md-comp-nav-drawer-width: 300px;
28
+ }
29
+
30
+ dialog.sidenav-overlay,
31
+ dialog.sidenav {
32
+ --md-comp-nav-drawer-item-height: 48px;
33
+ --md-comp-nav-drawer-duration: 250ms;
34
+ --md-comp-nav-drawer-easing: ease;
35
+ --md-comp-nav-drawer-shift: 0px;
36
+ --md-comp-nav-drawer-open: 1;
37
+ --md-comp-nav-drawer-font-size: 14px;
38
+ --md-comp-nav-drawer-padding: 16px;
39
+ --md-comp-nav-drawer-line-height: var(--md-comp-nav-drawer-item-height);
40
+
41
+ box-sizing: border-box;
42
+ width: var(--md-comp-nav-drawer-width);
43
+ min-width: 0;
44
+ max-width: none;
45
+ max-height: none;
46
+ height: 100dvh;
47
+ margin: 0;
48
+ padding: 0;
49
+ border: none;
50
+ border-radius: 0;
51
+ inset: 0 auto 0 0;
52
+ overflow: hidden;
53
+ color: var(--md-sys-color-on-surface);
54
+ background-color: var(--md-sys-color-surface);
55
+ outline: none;
56
+ @include z-depth("1");
57
+
58
+ transform: translateX(calc(-100% + var(--md-comp-nav-drawer-shift)));
59
+ transition:
60
+ transform var(--md-comp-nav-drawer-duration) var(--md-comp-nav-drawer-easing),
61
+ display var(--md-comp-nav-drawer-duration) allow-discrete,
62
+ overlay var(--md-comp-nav-drawer-duration) allow-discrete;
63
+
64
+ &:modal {
65
+ display: flex;
66
+ flex-direction: column;
67
+ transform: translateX(var(--md-comp-nav-drawer-shift));
68
+ }
69
+
70
+ &.right-aligned {
71
+ inset: 0 0 0 auto;
72
+ transform: translateX(calc(100% - var(--md-comp-nav-drawer-shift)));
73
+
74
+ &:modal {
75
+ transform: translateX(calc(-1 * var(--md-comp-nav-drawer-shift)));
76
+ }
77
+ }
78
+
79
+ &.dragging {
80
+ transition: none;
81
+ }
82
+
83
+ &::backdrop {
84
+ background-color: color-mix(in oklab, var(--md-sys-color-scrim) 32%, transparent);
85
+ opacity: var(--md-comp-nav-drawer-open, 1);
86
+ backdrop-filter: none;
87
+ transition:
88
+ opacity var(--md-comp-nav-drawer-duration) var(--md-comp-nav-drawer-easing),
89
+ display var(--md-comp-nav-drawer-duration) allow-discrete,
90
+ overlay var(--md-comp-nav-drawer-duration) allow-discrete;
91
+ }
92
+ }
93
+
94
+ @starting-style {
95
+ :is(dialog.sidenav-overlay, dialog.sidenav):modal {
96
+ transform: translateX(-100%);
97
+ }
98
+
99
+ :is(dialog.sidenav-overlay, dialog.sidenav).right-aligned:modal {
100
+ transform: translateX(100%);
101
+ }
102
+
103
+ :is(dialog.sidenav-overlay, dialog.sidenav):modal::backdrop {
104
+ opacity: 0;
105
+ }
106
+ }
107
+
108
+ @media (prefers-reduced-motion: reduce) {
109
+ dialog.sidenav-overlay,
110
+ dialog.sidenav {
111
+ transition: none;
112
+
113
+ &::backdrop {
114
+ transition: none;
115
+ }
116
+ }
117
+ }
118
+
119
+ // Docked sidebar: the host must not be a box, or it would steal the
120
+ // list's position:fixed. Closed, so it is not :modal and does not
121
+ // lock the page.
122
+ @include bp-up("large") {
123
+ dialog.sidenav-overlay:has(> .sidenav-fixed):not(:modal) {
124
+ display: contents;
125
+ }
126
+ }
127
+
3
128
  .sidenav {
4
- --sidenav-width: 300px;
5
- --sidenav-font-size: 14px;
6
- --sidenav-padding: 16px;
7
- --sidenav-item-height: 48px;
8
- --sidenav-line-height: var(--sidenav-item-height);
129
+ --md-comp-nav-drawer-item-height: 48px;
130
+ --md-comp-nav-drawer-font-size: 14px;
131
+ --md-comp-nav-drawer-padding: 16px;
132
+ --md-comp-nav-drawer-line-height: var(--md-comp-nav-drawer-item-height);
9
133
 
134
+ box-sizing: border-box;
10
135
  position: fixed;
11
- width: var(--sidenav-width);
12
- left: 0;
13
- top: 0;
136
+ width: var(--md-comp-nav-drawer-width);
137
+ inset: 0 auto 0 0;
14
138
  margin: 0;
15
- transform: translateX(-100%);
16
- height: 100vh;
17
139
  padding: 0;
140
+ height: 100dvh;
18
141
  z-index: 999;
19
142
  overflow-y: auto;
20
- will-change: transform;
21
- backface-visibility: hidden;
22
- transform: translateX(-105%);
143
+ overscroll-behavior: contain;
23
144
  user-select: none;
24
-
25
- color: var(--md-sys-color-on-secondary-container);
145
+ color: var(--md-sys-color-on-surface);
26
146
  background-color: var(--md-sys-color-surface);
147
+ transform: translateX(-100%);
27
148
  @include z-depth("1");
28
149
 
29
- // Right Align
30
150
  &.right-aligned {
31
- right: 0;
32
- transform: translateX(105%);
33
- left: auto;
151
+ inset: 0 0 0 auto;
34
152
  transform: translateX(100%);
35
153
  }
36
154
 
@@ -38,93 +156,79 @@
38
156
  margin: 0;
39
157
  }
40
158
 
41
- /* Hover only on top row */
42
- /*a:hover {
43
- //color: red;
44
- //background-color: var(--md-sys-color-on-secondary-container);
45
- //md.sys.color.on-secondary-container
46
- }*/
47
- a:focus {
48
- background-color: rgba(0, 0, 0, 0.12);
159
+ li {
160
+ list-style: none;
161
+ display: grid;
162
+ align-content: center;
49
163
  }
50
164
 
51
- li.active > a:not(.collapsible-header):not(.btn):not(.btn-large):not(.btn-small):not(.btn-flat):not(.btn-large):not(.btn-floating) {
52
- //color: var(--md-sys-color-on-secondary-container); //var(--md-sys-color-on-secondary-container);
53
- //background-color: var(--md-sys-color-secondary-container);
165
+ li.active > a:not(.button, .circle, .extra) {
54
166
  background-color: color-mix(in oklab, var(--md-sys-color-secondary) 10%, transparent);
55
167
  }
56
168
 
57
- .collapsible-body > ul { padding-left: 10px; }
58
-
59
- li {
60
- list-style: none;
61
- display: grid;
62
- align-content: center;
169
+ details > div > ul {
170
+ padding-left: 10px;
63
171
  }
172
+
64
173
  li > a {
65
- /* https://stackoverflow.com/questions/5848090/full-width-hover-background-for-nested-lists */
66
- //padding-left: calc(100% + var(--sidenav-padding));
67
- //margin-left: -100%;
68
- margin: 0 12px;
69
- padding: 0 var(--sidenav-padding);
70
- //padding-left: var(--sidenav-padding);
71
- // Truncate too long text
72
- /*
73
- min-width: 0;
74
- white-space: nowrap;
75
- overflow: hidden;
76
- text-overflow: ellipsis;
77
- */
78
174
  display: flex;
79
- height: var(--sidenav-item-height);
80
- font-size: var(--sidenav-font-size);
81
- font-weight: 500;
82
175
  align-items: center;
176
+ margin: 0 12px;
177
+ padding: 0 var(--md-comp-nav-drawer-padding);
178
+ height: var(--md-comp-nav-drawer-item-height);
83
179
  overflow: hidden;
84
180
  border-radius: 100px;
181
+ font-size: var(--md-comp-nav-drawer-font-size);
182
+ font-weight: 500;
85
183
 
86
- &:not(.btn):not(.button):not(.btn-flat):not(.btn-large):not(.btn-floating) {
184
+ &:not(.button, .circle, .extra) {
87
185
  color: var(--md-sys-color-on-secondary-container);
186
+
88
187
  &:hover {
89
- //color: var(--md-sys-color-on-secondary-container);
90
- //md.sys.color.on-secondary-container
91
188
  background-color: color-mix(in oklab, var(--md-sys-color-on-surface) 8%, transparent);
92
189
  }
190
+
191
+ @include focus-visible;
93
192
  }
94
193
 
95
- &.btn, &.button, &.btn-large, &.btn-flat, &.btn-floating {
194
+ &.button,
195
+ &.circle,
196
+ &.extra {
96
197
  margin: 10px 15px;
97
198
  }
98
199
 
99
- /* TODO: Use special class in future like "mw-icon" */
100
- & > .material-icons, & > .material-symbols-outlined,
101
- & > .material-symbols-rounded, & > .material-symbols-sharp {
200
+ > :is(
201
+ .material-symbols,
202
+ .material-symbols-outlined,
203
+ .material-symbols-rounded,
204
+ .material-symbols-sharp,
205
+ .material-icons
206
+ ) {
102
207
  display: inline-flex;
103
- vertical-align: middle;
208
+ flex-shrink: 0;
104
209
  margin-right: 12px;
105
210
  }
106
211
  }
107
212
 
108
213
  .divider {
109
- margin: calc(var(--sidenav-padding) * 0.5) 0 0 0;
214
+ margin: calc(var(--md-comp-nav-drawer-padding) * 0.5) 0 0;
110
215
  }
111
216
 
112
217
  .subheader {
113
218
  cursor: initial;
114
219
  pointer-events: none;
115
- color: red;
116
- font-size: var(--sidenav-font-size);
220
+ color: var(--md-sys-color-on-surface-variant);
221
+ font-size: var(--md-comp-nav-drawer-font-size);
117
222
  font-weight: 500;
118
- line-height: var(--sidenav-line-height);
223
+ line-height: var(--md-comp-nav-drawer-line-height);
119
224
  }
120
225
 
121
- // Remove this? is very custom
122
226
  .user-view {
123
227
  position: relative;
124
- padding: calc(var(--sidenav-padding) * 2) calc(var(--sidenav-padding) * 2) 0;
125
- margin-bottom: calc(var(--sidenav-padding) * 0.5);
228
+ padding: calc(var(--md-comp-nav-drawer-padding) * 2) calc(var(--md-comp-nav-drawer-padding) * 2) 0;
229
+ margin-bottom: calc(var(--md-comp-nav-drawer-padding) * 0.5);
126
230
 
127
- & > a {
231
+ > a {
128
232
  height: auto;
129
233
  padding: 0;
130
234
 
@@ -136,14 +240,13 @@
136
240
  .background {
137
241
  overflow: hidden;
138
242
  position: absolute;
139
- top: 0;
140
- right: 0;
141
- bottom: 0;
142
- left: 0;
243
+ inset: 0;
143
244
  z-index: -1;
144
245
  }
145
246
 
146
- .circle, .name, .email {
247
+ .circle,
248
+ .name,
249
+ .email {
147
250
  display: block;
148
251
  }
149
252
 
@@ -154,8 +257,8 @@
154
257
 
155
258
  .name,
156
259
  .email {
157
- font-size: var(--sidenav-font-size);
158
- line-height: calc(var(--sidenav-line-height) * 0.5);
260
+ font-size: var(--md-comp-nav-drawer-font-size);
261
+ line-height: calc(var(--md-comp-nav-drawer-line-height) * 0.5);
159
262
  }
160
263
 
161
264
  .name {
@@ -170,77 +273,85 @@
170
273
  }
171
274
  }
172
275
 
173
- // Touch interaction
174
- .drag-target {
276
+ // Overlay only: the dialog is the panel, so the list fills it. When the
277
+ // host is `display: contents` (a docked .sidenav-fixed) this must not
278
+ // apply — static positioning would drop the list into the header flow
279
+ // and it would read as part of the app bar.
280
+ dialog.sidenav-overlay:modal > .sidenav {
281
+ position: static;
282
+ inset: auto;
283
+ width: 100%;
175
284
  height: 100%;
176
- position: fixed;
177
- top: 0;
178
- left: 0;
179
- z-index: 998;
180
-
181
- &.right-aligned {
182
- right: 0;
183
- }
285
+ transform: none;
286
+ box-shadow: none;
287
+ background-color: transparent;
288
+ z-index: auto;
184
289
  }
185
290
 
186
- // Fixed Sidenav shown
187
291
  .sidenav.sidenav-fixed {
188
- left: 0;
189
- transform: translateX(0);
190
- position: fixed;
292
+ transform: none;
191
293
 
192
294
  &.right-aligned {
193
- right: 0;
194
- left: auto;
295
+ transform: none;
195
296
  }
196
297
  }
197
298
 
198
- // Fixed Sidenav hide on smaller
199
299
  @include bp-down("large") {
200
- .sidenav {
201
- &.sidenav-fixed {
202
- transform: translateX(-105%);
300
+ // Uninitialized / no-js: keep a fixed drawer off-canvas. Once JS wraps
301
+ // it, the host's display:none hides the closed drawer and this must
302
+ // not also hide the list inside an open dialog.
303
+ .sidenav.sidenav-fixed {
304
+ transform: translateX(-100%);
203
305
 
204
- &.right-aligned {
205
- transform: translateX(105%);
206
- }
207
- }
208
- > a {
209
- padding: 0 var(--sidenav-padding);
210
- }
211
- .user-view {
212
- padding: var(--sidenav-padding) var(--sidenav-padding) 0;
306
+ &.right-aligned {
307
+ transform: translateX(100%);
213
308
  }
214
309
  }
215
- }
216
310
 
217
- .sidenav .collapsible-body {
218
- padding: 0;
311
+ .sidenav .user-view {
312
+ padding: var(--md-comp-nav-drawer-padding) var(--md-comp-nav-drawer-padding) 0;
313
+ }
219
314
  }
220
315
 
221
- .sidenav-overlay {
316
+ .drag-target {
222
317
  position: fixed;
223
- top: 0;
224
- left: 0;
225
- right: 0;
226
- opacity: 0;
227
- height: 120vh;
228
- background-color: rgba(0, 0, 0, .5);
229
- z-index: 997;
230
- display: none;
318
+ inset: 0 auto 0 0;
319
+ width: var(--md-comp-nav-drawer-drag-width, 10px);
320
+ height: 100%;
321
+ z-index: 998;
322
+ touch-action: pan-y;
323
+
324
+ &.right-aligned {
325
+ inset: 0 0 0 auto;
326
+ }
327
+ }
328
+
329
+ @include bp-up("large") {
330
+ .drag-target[data-fixed] {
331
+ display: none;
332
+ pointer-events: none;
333
+ }
334
+ }
335
+
336
+ .sidenav details > :not(summary) {
337
+ padding: 0;
231
338
  }
232
339
 
233
- // Sidenav collapsible styling (Taken from Collapsible.scss)
234
340
  .sidenav,
235
341
  .sidenav.sidenav-fixed {
236
342
  .collapsible {
343
+ overflow: visible;
237
344
  border: none;
345
+ border-radius: 0;
346
+ background: transparent;
238
347
  box-shadow: none;
239
348
  }
240
- .collapsible-header {
349
+
350
+ summary {
241
351
  border: none;
242
352
  }
243
- .collapsible-body {
353
+
354
+ details > :not(summary) {
244
355
  border: none;
245
356
  }
246
357
  }
@@ -4,6 +4,14 @@
4
4
  position: relative;
5
5
  height: 400px;
6
6
  width: 100%;
7
+ // Same 12px as .responsive-img / .lightboxed. Applied to the slide
8
+ // stack, not the slider: init() adds 40px under the slides for the
9
+ // indicators, so a radius on the outer box never meets the photo.
10
+ // Fullscreen stays square so it can meet the viewport edges.
11
+ &:not(.fullscreen) .slides,
12
+ &:not(.fullscreen) .slides li {
13
+ border-radius: 12px;
14
+ }
7
15
 
8
16
  // Fullscreen slider
9
17
  &.fullscreen {
@@ -1,7 +1,21 @@
1
1
  @use "../abstracts" as *;
2
2
 
3
+ // Table of contents. Paired with .scrollspy sections. The current link
4
+ // is .active and aria-current="true".
5
+ //
6
+ // Tokens:
7
+ // --md-comp-toc-label-color
8
+ // --md-comp-toc-active-color
9
+ // --md-comp-toc-indicator
10
+
3
11
  .table-of-contents {
12
+ --md-comp-toc-label-color: var(--md-sys-color-on-surface-variant);
13
+ --md-comp-toc-active-color: var(--md-sys-color-primary);
14
+ --md-comp-toc-indicator: 2px;
15
+
4
16
  list-style: none;
17
+ margin: 0;
18
+ padding: 0;
5
19
 
6
20
  &.fixed {
7
21
  position: fixed;
@@ -12,23 +26,25 @@
12
26
  }
13
27
 
14
28
  a {
15
- display: inline-block;
16
- font-weight: 400;
17
- color: var(--md-sys-color-secondary);
18
- padding-left: 16px;
19
- height: 2rem;
20
- line-height: 2rem;
21
- border-left: 1px solid var(--md-sys-color-outline-variant);
22
-
29
+ display: inline-flex;
30
+ align-items: center;
31
+ box-sizing: border-box;
32
+ min-height: 2rem;
33
+ padding-inline-start: 16px;
34
+ border-inline-start: var(--md-comp-toc-indicator) solid transparent;
35
+ color: var(--md-comp-toc-label-color);
36
+ text-decoration: none;
37
+ @include typescale("label-large");
38
+ @include focus-visible;
39
+
23
40
  &:hover {
24
- color: var(--md-sys-color-on-background);
25
- padding-left: 15px;
41
+ color: var(--md-comp-toc-active-color);
26
42
  }
27
- &.active {
28
- color: var(--md-sys-color-primary);
43
+
44
+ &:is(.active, [aria-current="true"]) {
45
+ color: var(--md-comp-toc-active-color);
29
46
  font-weight: 500;
30
- padding-left: 14px;
31
- border-left: 2px solid var(--md-sys-color-primary);
47
+ border-inline-start-color: var(--md-comp-toc-active-color);
32
48
  }
33
49
  }
34
50
  }