@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,81 +1,179 @@
1
1
  @use "../abstracts" as *;
2
2
 
3
+ // Collapsible. Anatomy is the HTML: a .collapsible of <details> with
4
+ // <summary> headers. Same `name` on each <details> is an accordion;
5
+ // omit it (or add .expandable) so several can stay open. The `open`
6
+ // attribute is the preselected section.
7
+ //
8
+ // JS wraps non-summary children in a div so height can clip.
9
+ //
10
+ // Tokens:
11
+ // --md-comp-collapsible-shape 12px
12
+ // --md-comp-collapsible-container-color surface
13
+ // --md-comp-collapsible-outline-color outline-variant
14
+ // --md-comp-collapsible-header-padding 1rem
15
+ // --md-comp-collapsible-body-padding 0 1rem
16
+ // --md-comp-collapsible-duration 500ms
17
+ // --md-comp-collapsible-easing-open ease-in-out cubic
18
+ // --md-comp-collapsible-easing-close ease-in-out cubic
19
+ // --md-comp-collapsible-icon-size 24px
20
+ // --md-comp-collapsible-popout-inset 24px
21
+ // --md-comp-collapsible-popout-gap 16px
22
+ //
23
+ // Nest descendants inside this block. A list-suffixed selector only
24
+ // attaches the suffix to the last item (same bug as the icon sizes).
25
+
3
26
  .collapsible {
4
- padding-left: 0;
5
- list-style-type: none;
6
- border-top: 1px solid var(--md-sys-color-outline-variant);
7
- border-right: 1px solid var(--md-sys-color-outline-variant);
8
- border-left: 1px solid var(--md-sys-color-outline-variant);
9
- margin: $element-top-margin 0 $element-bottom-margin 0;
27
+ --md-comp-collapsible-shape: 12px;
28
+ --md-comp-collapsible-container-color: var(--md-sys-color-surface);
29
+ --md-comp-collapsible-outline-color: var(--md-sys-color-outline-variant);
30
+ --md-comp-collapsible-header-padding: 1rem;
31
+ --md-comp-collapsible-body-padding: 0 1rem;
32
+ --md-comp-collapsible-duration: 500ms;
33
+ --md-comp-collapsible-easing-open: cubic-bezier(0.65, 0, 0.35, 1);
34
+ --md-comp-collapsible-easing-close: cubic-bezier(0.65, 0, 0.35, 1);
35
+ --md-comp-collapsible-icon-size: 24px;
36
+ --md-comp-collapsible-popout-inset: 24px;
37
+ --md-comp-collapsible-popout-gap: 16px;
38
+
39
+ box-sizing: border-box;
40
+ padding: 0;
41
+ margin: $element-top-margin 0 $element-bottom-margin;
42
+ list-style: none;
43
+ overflow: hidden;
44
+ border: 1px solid var(--md-comp-collapsible-outline-color);
45
+ border-radius: var(--md-comp-collapsible-shape);
46
+ background-color: var(--md-comp-collapsible-container-color);
47
+ color: var(--md-sys-color-on-surface);
10
48
  @include z-depth("1");
11
- }
12
49
 
13
- .collapsible-header {
14
- display: flex;
15
- cursor: pointer;
16
- -webkit-tap-highlight-color: transparent;
17
- line-height: 1.5;
18
- padding: 1rem;
19
- border-bottom: 1px solid var(--md-sys-color-outline-variant);
50
+ > details + details {
51
+ border-top: 1px solid var(--md-comp-collapsible-outline-color);
52
+ }
53
+
54
+ summary {
55
+ display: flex;
56
+ align-items: center;
57
+ box-sizing: border-box;
58
+ width: 100%;
59
+ margin: 0;
60
+ padding: var(--md-comp-collapsible-header-padding);
61
+ border: 0;
62
+ background: none;
63
+ color: inherit;
64
+ font: inherit;
65
+ font-weight: inherit;
66
+ line-height: 1.5;
67
+ text-align: start;
68
+ list-style: none;
69
+ cursor: pointer;
70
+ -webkit-tap-highlight-color: transparent;
20
71
 
21
- &:focus {
22
- outline: 0
72
+ &::-webkit-details-marker {
73
+ display: none;
74
+ }
75
+
76
+ @include focus-visible;
77
+
78
+ > i {
79
+ width: 2rem;
80
+ margin-right: 1rem;
81
+ font-size: 1.6rem;
82
+ line-height: 1;
83
+ text-align: center;
84
+ }
85
+
86
+ &::after {
87
+ content: "expand_more";
88
+ flex-shrink: 0;
89
+ margin-inline-start: auto;
90
+ font-family: var(--md-icon-font);
91
+ font-size: var(--md-comp-collapsible-icon-size);
92
+ font-variation-settings:
93
+ "FILL" var(--md-icon-fill),
94
+ "wght" var(--md-icon-weight),
95
+ "GRAD" var(--md-icon-grade),
96
+ "opsz" var(--md-icon-optical-size);
97
+ line-height: 1;
98
+ -webkit-font-smoothing: antialiased;
99
+ transition: transform var(--md-comp-collapsible-duration)
100
+ var(--md-comp-collapsible-easing-close);
101
+ }
23
102
  }
24
103
 
25
- i {
26
- width: 2rem;
27
- font-size: 1.6rem;
28
- display: inline-block;
29
- text-align: center;
30
- margin-right: 1rem;
104
+ details[open] > summary::after {
105
+ transform: rotate(180deg);
106
+ transition-timing-function: var(--md-comp-collapsible-easing-open);
31
107
  }
32
- }
33
108
 
34
- .collapsible-header::after {
35
- content: '\e5cf';
36
- margin-left: .5rem;
37
- font-family: 'Material Symbols Outlined', 'Material Symbols Rounded', 'Material Symbols Sharp', 'Material Icons';
38
- font-size: 25px;
39
- line-height: .9;
40
- -webkit-font-smoothing: antialiased;
41
- }
109
+ .collapsible-header-content {
110
+ flex-grow: 1;
111
+ }
42
112
 
43
- .active .collapsible-header::after {
44
- content: '\e5ce';
45
- }
113
+ // JS wraps non-summary children. Text stays painted and is clipped
114
+ // as the row shrinks.
115
+ details > :not(summary) {
116
+ display: grid;
117
+ grid-template-rows: 0fr;
118
+ box-sizing: border-box;
119
+ padding: var(--md-comp-collapsible-body-padding);
120
+ overflow: hidden;
121
+ transition: grid-template-rows var(--md-comp-collapsible-duration)
122
+ var(--md-comp-collapsible-easing-close);
46
123
 
47
- .keyboard-focused .collapsible-header:focus {
48
- background-color: rgba(0, 0, 0, 0.12);
49
- }
124
+ > * {
125
+ min-height: 0;
126
+ overflow: hidden;
127
+ }
128
+ }
50
129
 
51
- .collapsible-header-content {
52
- flex-grow: 1;
53
- }
130
+ details[open] > :not(summary) {
131
+ grid-template-rows: 1fr;
132
+ transition-timing-function: var(--md-comp-collapsible-easing-open);
133
+ }
54
134
 
55
- .collapsible-body {
56
- max-height: 0;
57
- border-bottom: 1px solid var(--md-sys-color-outline-variant);
58
- box-sizing: border-box;
59
- padding: 0 2rem;
60
- overflow: hidden;
61
- }
135
+ // UA `display: none` on closed details children. Keep our wrapper as
136
+ // a grid so 0fr can clip instead of popping the copy away.
137
+ details:not([open]) > :not(summary) {
138
+ display: grid;
139
+ }
140
+
141
+ &.no-icon summary::after {
142
+ content: none;
143
+ }
144
+
145
+ &.popout {
146
+ overflow: visible;
147
+ border: 0;
148
+ background: transparent;
149
+ @include z-depth("0");
62
150
 
63
- // Popout Collapsible
151
+ > details {
152
+ margin-inline: var(--md-comp-collapsible-popout-inset);
153
+ overflow: hidden;
154
+ border: 0;
155
+ border-radius: var(--md-comp-collapsible-shape);
156
+ background-color: var(--md-comp-collapsible-container-color);
157
+ transition: margin var(--md-comp-collapsible-duration)
158
+ var(--md-comp-collapsible-easing-close);
159
+ @include z-depth("1");
160
+ }
64
161
 
65
- .collapsible.popout {
66
- border: none;
67
- box-shadow: none;
162
+ > details + details {
163
+ border-top: 0;
164
+ }
68
165
 
69
- > li {
70
- box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
71
- // transform: scaleX(.92);
72
- margin: 0 24px;
73
- transition: margin .35s cubic-bezier(0.250, 0.460, 0.450, 0.940);
166
+ > details[open] {
167
+ margin-block: var(--md-comp-collapsible-popout-gap);
168
+ margin-inline: 0;
169
+ transition-timing-function: var(--md-comp-collapsible-easing-open);
170
+ @include z-depth("2");
171
+ }
74
172
  }
173
+ }
75
174
 
76
- > li.active {
77
- box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
78
- margin: 16px 0;
79
- // transform: scaleX(1);
175
+ @media (prefers-reduced-motion: reduce) {
176
+ .collapsible {
177
+ --md-comp-collapsible-duration: 0s;
80
178
  }
81
179
  }
@@ -1,114 +1,180 @@
1
1
  @use "../abstracts" as *;
2
2
 
3
+ // Collection. Anatomy is the HTML: a .collection of list items. A heading
4
+ // as the first child of an item is the header. An <a> may be the item
5
+ // (old <div class="collection"> markup) or live inside an <li>.
6
+ //
7
+ // .flush drops the boxed outline.
8
+ //
9
+ // Tokens:
10
+ // --md-comp-collection-shape 12px
11
+ // --md-comp-collection-container-color surface
12
+ // --md-comp-collection-outline-color outline-variant
13
+ // --md-comp-collection-item-height 56px
14
+ // --md-comp-collection-item-padding 16px
15
+ // --md-comp-collection-avatar-size 40px
16
+ //
17
+ // Nest descendants inside this block. A list-suffixed selector only
18
+ // attaches the suffix to the last item (same bug as the icon sizes).
19
+
3
20
  .collection {
4
- padding-left: 0;
5
- list-style-type: none;
6
- margin: $element-top-margin 0 $element-bottom-margin 0;
7
- border: 1px solid var(--md-sys-color-outline-variant);
8
- border-radius: 2px;
21
+ --md-comp-collection-shape: 12px;
22
+ --md-comp-collection-container-color: var(--md-sys-color-surface);
23
+ --md-comp-collection-outline-color: var(--md-sys-color-outline-variant);
24
+ --md-comp-collection-item-height: 56px;
25
+ --md-comp-collection-item-padding: 16px;
26
+ --md-comp-collection-avatar-size: 40px;
27
+
28
+ box-sizing: border-box;
29
+ padding: 0;
30
+ margin: $element-top-margin 0 $element-bottom-margin;
9
31
  overflow: hidden;
10
- position: relative;
32
+ list-style: none;
33
+ border: 1px solid var(--md-comp-collection-outline-color);
34
+ border-radius: var(--md-comp-collection-shape);
35
+ background-color: var(--md-comp-collection-container-color);
36
+ color: var(--md-sys-color-on-surface);
37
+
38
+ > * + * {
39
+ border-top: 1px solid var(--md-comp-collection-outline-color);
40
+ }
11
41
 
12
- .collection-item {
13
- background-color: transparent;
14
- line-height: 1.5rem;
15
- padding: 10px 20px;
42
+ > :is(li, a) {
43
+ display: grid;
44
+ grid-template-columns: auto 1fr auto;
45
+ grid-template-rows: auto auto;
46
+ align-items: center;
47
+ column-gap: 16px;
48
+ box-sizing: border-box;
49
+ min-height: var(--md-comp-collection-item-height);
16
50
  margin: 0;
17
- border-bottom: 1px solid var(--md-sys-color-outline-variant);
18
-
19
- // Avatar Collection
20
- &.avatar {
21
- min-height: 84px;
22
- padding-left: 72px;
23
- position: relative;
24
-
25
- // Don't style circles inside preloader classes.
26
- &:not(.circle-clipper) > .circle,
27
- :not(.circle-clipper) > .circle {
28
- position: absolute;
29
- width: 42px;
30
- height: 42px;
31
- overflow: hidden;
32
- left: 15px;
33
- display: inline-block;
34
- vertical-align: middle;
35
- }
36
-
37
- i.circle {
38
- font-size: 18px;
39
- line-height: 42px;
40
- color: #fff;
41
- background-color: var(--md-sys-color-shadow);
42
- text-align: center;
43
- }
44
-
51
+ padding: 8px var(--md-comp-collection-item-padding);
52
+ background-color: transparent;
53
+ color: inherit;
54
+ text-decoration: none;
55
+ transition: background-color 0.2s ease-out;
56
+
57
+ > :is(img, i).circle {
58
+ grid-column: 1;
59
+ grid-row: 1 / -1;
60
+ box-sizing: border-box;
61
+ width: var(--md-comp-collection-avatar-size);
62
+ height: var(--md-comp-collection-avatar-size);
63
+ overflow: hidden;
64
+ object-fit: cover;
65
+ }
45
66
 
46
- .title {
47
- font-size: 16px;
48
- }
67
+ > i.circle {
68
+ display: inline-flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ font-size: 20px;
72
+ line-height: 1;
73
+ color: var(--md-sys-color-on-primary-container);
74
+ background-color: var(--md-sys-color-primary-container);
75
+ text-align: center;
76
+ }
49
77
 
50
- p {
51
- margin: 0;
52
- }
78
+ > .title {
79
+ grid-column: 2;
80
+ grid-row: 1;
81
+ min-width: 0;
82
+ @include typescale("title-medium");
83
+ }
53
84
 
54
- .secondary-content {
55
- position: absolute;
56
- top: 16px;
57
- right: 16px;
58
- }
85
+ > p {
86
+ grid-column: 2;
87
+ grid-row: 1;
88
+ min-width: 0;
89
+ margin: 0;
90
+ color: var(--md-sys-color-on-surface-variant);
91
+ @include typescale("body-medium");
59
92
  }
60
93
 
61
- &:last-child {
62
- border-bottom: none;
94
+ > .title ~ p {
95
+ grid-row: 2;
63
96
  }
64
97
 
65
- &.active {
66
- background-color: var(--md-sys-color-primary);
67
- color: var(--md-sys-color-on-primary);
98
+ > :is(a:last-child, .badge) {
99
+ grid-column: 3;
100
+ grid-row: 1 / -1;
101
+ align-self: center;
102
+ justify-self: end;
103
+ }
68
104
 
69
- .secondary-content {
70
- color: var(--md-sys-color-on-primary);
105
+ > a:not(.badge) {
106
+ grid-column: 1 / -1;
107
+ display: flex;
108
+ align-items: center;
109
+ gap: 16px;
110
+ min-width: 0;
111
+ color: inherit;
112
+ text-decoration: none;
113
+
114
+ > .badge {
115
+ margin-inline-start: auto;
71
116
  }
72
117
  }
73
118
  }
74
119
 
75
- a.collection-item {
76
- display: block;
77
- transition: .25s;
78
- color: var(--md-sys-color-primary);
120
+ > :is(li, a):has(> .circle) {
121
+ min-height: 72px;
122
+ }
79
123
 
80
- &:not(.active) {
81
- &:hover {
82
- background-color: rgba(0, 0, 0, 0.04);
83
- }
124
+ > li:has(> :is(h1, h2, h3, h4, h5, h6)) {
125
+ min-height: 0;
126
+ padding-block: 12px;
127
+
128
+ > :is(h1, h2, h3, h4, h5, h6) {
129
+ grid-column: 1 / -1;
130
+ margin: 0;
131
+ @include typescale("title-medium");
84
132
  }
85
133
  }
86
134
 
87
- &.with-header {
88
- .collection-header {
89
- background-color: transparent;
90
- border-bottom: 1px solid var(--md-sys-color-outline-variant);
91
- padding: 10px 20px;
92
- }
135
+ > a,
136
+ > li > a {
137
+ @include focus-visible;
138
+ }
139
+
140
+ > a:hover,
141
+ > li:has(> a:hover) {
142
+ background-color: color-mix(in oklab, var(--md-sys-color-on-surface) 8%, transparent);
143
+ }
93
144
 
94
- .collection-item {
95
- padding-left: 30px;
145
+ > :is(.active, [aria-current="page"]),
146
+ > li:has(> [aria-current="page"]) {
147
+ background-color: var(--md-sys-color-secondary-container);
148
+ color: var(--md-sys-color-on-secondary-container);
149
+
150
+ > a:last-child {
151
+ color: var(--md-sys-color-on-secondary-container);
96
152
  }
97
153
 
98
- .collection-item.avatar {
99
- padding-left: 72px;
154
+ span.badge:not(.new) {
155
+ color: var(--md-sys-color-on-secondary-container);
100
156
  }
101
157
  }
102
158
 
103
- }
159
+ > :is(.disabled, [aria-disabled="true"]) {
160
+ pointer-events: none;
161
+ color: color-mix(in oklab, var(--md-sys-color-on-surface) 38%, transparent);
162
+ }
104
163
 
105
- // Made less specific to allow easier overriding
106
- .secondary-content {
107
- float: right;
108
- color: var(--md-sys-color-primary);
164
+ span.badge {
165
+ float: none;
166
+ margin-block: 0;
167
+ margin-inline-start: auto;
168
+ }
169
+
170
+ &.flush {
171
+ border: 0;
172
+ border-radius: 0;
173
+ }
109
174
  }
110
175
 
111
176
  .collapsible .collection {
112
177
  margin: 0;
113
178
  border: none;
114
- }
179
+ border-radius: 0;
180
+ }
@@ -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;