@expressivecss/expressive 0.4.0 → 0.6.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 (69) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/README.md +4 -9
  3. package/dist/css/expressive.css +2617 -951
  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/js/expressive.cjs +643 -804
  8. package/dist/js/expressive.cjs.map +4 -4
  9. package/dist/js/expressive.js +643 -804
  10. package/dist/js/expressive.js.map +4 -4
  11. package/dist/js/expressive.min.js +11 -11
  12. package/dist/js/expressive.min.js.map +4 -4
  13. package/dist/js/expressive.mjs +643 -804
  14. package/dist/js/expressive.mjs.map +4 -4
  15. package/dist/types/behaviors/bottomSheets.d.ts +18 -0
  16. package/dist/types/behaviors/sideSheets.d.ts +18 -0
  17. package/dist/types/components/autocomplete.d.ts +11 -11
  18. package/dist/types/components/index.d.ts +3 -5
  19. package/dist/types/components/{dropdown.d.ts → menu.d.ts} +38 -37
  20. package/dist/types/components/navigationRail.d.ts +53 -0
  21. package/dist/types/components/range.d.ts +3 -0
  22. package/dist/types/components/registry.d.ts +7 -15
  23. package/dist/types/components/select.d.ts +12 -12
  24. package/dist/types/components/{toasts.d.ts → snackbar.d.ts} +28 -25
  25. package/dist/types/index.d.ts +3 -1
  26. package/package.json +3 -2
  27. package/src/sass/README.md +13 -11
  28. package/src/sass/abstracts/_breakpoints.scss +14 -3
  29. package/src/sass/abstracts/_mixins.scss +3 -3
  30. package/src/sass/abstracts/_variables.scss +27 -2
  31. package/src/sass/base/_global.scss +1 -1
  32. package/src/sass/base/_grid.scss +66 -116
  33. package/src/sass/base/_index.scss +1 -1
  34. package/src/sass/components/_badges.scss +80 -60
  35. package/src/sass/components/_bottom-sheet.scss +137 -0
  36. package/src/sass/components/_cards.scss +4 -4
  37. package/src/sass/components/_chips.scss +6 -5
  38. package/src/sass/components/_dialog.scss +268 -0
  39. package/src/sass/components/_index.scss +9 -7
  40. package/src/sass/components/_list.scss +253 -0
  41. package/src/sass/components/_menu.scss +341 -0
  42. package/src/sass/components/_navbar.scss +65 -117
  43. package/src/sass/components/_navigation-bar.scss +165 -0
  44. package/src/sass/components/_navigation-rail.scss +308 -0
  45. package/src/sass/components/_page-footer.scss +7 -3
  46. package/src/sass/components/_panes.scss +294 -0
  47. package/src/sass/components/_side-sheet.scss +193 -0
  48. package/src/sass/components/_sidenav.scss +78 -49
  49. package/src/sass/components/{_toast.scss → _snackbar.scss} +35 -34
  50. package/src/sass/components/_tabs.scss +1 -27
  51. package/src/sass/components/_toolbar.scss +91 -25
  52. package/src/sass/components/_tooltip.scss +1 -1
  53. package/src/sass/components/forms/_fieldset.scss +1 -1
  54. package/src/sass/components/forms/_input-fields.scss +3 -3
  55. package/src/sass/components/forms/_range.scss +423 -98
  56. package/src/sass/components/forms/_select.scss +19 -17
  57. package/src/sass/tokens/_reference.scss +37 -13
  58. package/src/sass/tokens/_theme.scss +5 -13
  59. package/src/sass/utilities/_colors.scss +16 -74
  60. package/src/sass/utilities/_visibility.scss +8 -0
  61. package/dist/types/components/collapsible.d.ts +0 -79
  62. package/dist/types/components/pushpin.d.ts +0 -51
  63. package/dist/types/components/tapTarget.d.ts +0 -57
  64. package/src/sass/components/_collapsible.scss +0 -179
  65. package/src/sass/components/_collection.scss +0 -180
  66. package/src/sass/components/_dropdown.scss +0 -225
  67. package/src/sass/components/_modal.scss +0 -190
  68. package/src/sass/components/_pushpin.scss +0 -11
  69. package/src/sass/components/_tapTarget.scss +0 -187
@@ -1,179 +0,0 @@
1
- @use "../abstracts" as *;
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
-
26
- .collapsible {
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);
48
- @include z-depth("1");
49
-
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;
71
-
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
- }
102
- }
103
-
104
- details[open] > summary::after {
105
- transform: rotate(180deg);
106
- transition-timing-function: var(--md-comp-collapsible-easing-open);
107
- }
108
-
109
- .collapsible-header-content {
110
- flex-grow: 1;
111
- }
112
-
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);
123
-
124
- > * {
125
- min-height: 0;
126
- overflow: hidden;
127
- }
128
- }
129
-
130
- details[open] > :not(summary) {
131
- grid-template-rows: 1fr;
132
- transition-timing-function: var(--md-comp-collapsible-easing-open);
133
- }
134
-
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");
150
-
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
- }
161
-
162
- > details + details {
163
- border-top: 0;
164
- }
165
-
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
- }
172
- }
173
- }
174
-
175
- @media (prefers-reduced-motion: reduce) {
176
- .collapsible {
177
- --md-comp-collapsible-duration: 0s;
178
- }
179
- }
@@ -1,180 +0,0 @@
1
- @use "../abstracts" as *;
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
-
20
- .collection {
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;
31
- overflow: hidden;
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
- }
41
-
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);
50
- margin: 0;
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
- }
66
-
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
- }
77
-
78
- > .title {
79
- grid-column: 2;
80
- grid-row: 1;
81
- min-width: 0;
82
- @include typescale("title-medium");
83
- }
84
-
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");
92
- }
93
-
94
- > .title ~ p {
95
- grid-row: 2;
96
- }
97
-
98
- > :is(a:last-child, .badge) {
99
- grid-column: 3;
100
- grid-row: 1 / -1;
101
- align-self: center;
102
- justify-self: end;
103
- }
104
-
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;
116
- }
117
- }
118
- }
119
-
120
- > :is(li, a):has(> .circle) {
121
- min-height: 72px;
122
- }
123
-
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");
132
- }
133
- }
134
-
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
- }
144
-
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);
152
- }
153
-
154
- span.badge:not(.new) {
155
- color: var(--md-sys-color-on-secondary-container);
156
- }
157
- }
158
-
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
- }
163
-
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
- }
174
- }
175
-
176
- .collapsible .collection {
177
- margin: 0;
178
- border: none;
179
- border-radius: 0;
180
- }
@@ -1,225 +0,0 @@
1
- @use "../abstracts" as *;
2
-
3
- // Menus.
4
- //
5
- // Anatomy is the HTML. A <menu id> is the surface; each <li> is an item,
6
- // an <hr> is a divider, and an <i> inside the item is the leading icon.
7
- // The trigger is still .dropdown-trigger[data-target] — that is the JS
8
- // contract.
9
- //
10
- // Tokens follow https://m3.material.io/components/menus/specs
11
- // plus the 1rem surface / stadium items used by fields and select.
12
- // container surface, 1rem corners, elevation 2, 112–280dp
13
- // item 48dp, 2rem corners, label-large / on-surface, 12dp inset
14
- // leading icon 24dp, on-surface-variant
15
- // divider 1dp outline-variant
16
- // state layer 8% hover / 10% selected
17
-
18
- $_menu-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10 6l6 6-6 6'/%3E%3C/svg%3E");
19
-
20
- [popover] {
21
- outline: none;
22
- padding: 0;
23
- border: none;
24
- }
25
-
26
- menu[id] {
27
- --md-comp-menu-container-color: var(--md-sys-color-surface);
28
- --md-comp-menu-container-shape: 1rem;
29
- --md-comp-menu-item-container-height: 48px;
30
-
31
- box-sizing: border-box;
32
- display: none;
33
- position: absolute;
34
- left: 0;
35
- top: 0;
36
- z-index: 9999;
37
- min-width: 112px;
38
- margin: 0;
39
- padding: 8px 0;
40
- list-style: none;
41
- overflow-y: auto;
42
- opacity: 0;
43
- user-select: none;
44
- transform-origin: 0 0;
45
- background-color: var(--md-comp-menu-container-color);
46
- border-radius: var(--md-comp-menu-container-shape);
47
- color: var(--md-sys-color-on-surface);
48
- @include z-depth("2");
49
-
50
- > li {
51
- box-sizing: border-box;
52
- margin: 0;
53
- padding: 0;
54
- width: 100%;
55
- min-height: var(--md-comp-menu-item-container-height);
56
- cursor: pointer;
57
- text-align: left;
58
-
59
- > a,
60
- > button,
61
- > span {
62
- display: flex;
63
- align-items: center;
64
- gap: 12px;
65
- box-sizing: border-box;
66
- width: 100%;
67
- min-height: var(--md-comp-menu-item-container-height);
68
- margin: 0;
69
- padding: 0 12px;
70
- border: 0;
71
- background: none;
72
- color: var(--md-sys-color-on-surface);
73
- text-decoration: none;
74
- cursor: pointer;
75
-
76
- &:hover,
77
- &:focus {
78
- background: none;
79
- }
80
- @include typescale("label-large");
81
- font-family: $font-stack;
82
- }
83
-
84
- > a > i,
85
- > button > i,
86
- > i {
87
- flex: 0 0 24px;
88
- font-size: 24px;
89
- width: 24px;
90
- height: 24px;
91
- line-height: 24px;
92
- color: var(--md-sys-color-on-surface-variant);
93
- }
94
- }
95
-
96
- > li:not(.disabled, .divider, .optgroup) {
97
- width: calc(100% - 16px);
98
- margin-inline: 8px;
99
- border-radius: 2rem;
100
- }
101
-
102
- > li:not(.disabled, .divider):hover,
103
- > li.active {
104
- background-color: color-mix(in oklab, var(--md-sys-color-on-surface) 8%, transparent);
105
- }
106
-
107
- > li.disabled {
108
- pointer-events: none;
109
- opacity: 0.38;
110
- }
111
-
112
- > hr,
113
- > li.divider {
114
- display: block;
115
- width: 100%;
116
- height: 1px;
117
- min-height: 0;
118
- margin: 8px 0;
119
- padding: 0;
120
- border: 0;
121
- background-color: var(--md-sys-color-outline-variant);
122
- cursor: default;
123
- }
124
-
125
- // Nested flyouts sit outside the list box; do not clip them.
126
- &:has(> li > menu) {
127
- overflow: visible;
128
- }
129
-
130
- li:has(> menu) {
131
- position: relative;
132
- }
133
-
134
- li:has(> menu) > :is(a, button, span)::after {
135
- content: "";
136
- flex: 0 0 24px;
137
- width: 24px;
138
- height: 24px;
139
- margin-inline-start: auto;
140
- background-color: var(--md-sys-color-on-surface-variant);
141
- mask: $_menu-chevron center / 24px no-repeat;
142
- }
143
- }
144
-
145
- // Nested menu. Optional, desktop-first. No second Dropdown instance —
146
- // a <menu> inside an <li> is a flyout. Hover / :focus-within on fine
147
- // pointers; .open is the tap / keyboard switch.
148
- menu[id] li > menu {
149
- --md-comp-menu-container-color: var(--md-sys-color-surface);
150
- --md-comp-menu-container-shape: 1rem;
151
- --md-comp-menu-item-container-height: 48px;
152
-
153
- box-sizing: border-box;
154
- display: none;
155
- position: absolute;
156
- inset-block-start: 0;
157
- inset-inline-start: 100%;
158
- z-index: 1;
159
- min-width: 112px;
160
- margin: 0;
161
- padding: 8px 0;
162
- list-style: none;
163
- overflow: visible;
164
- opacity: 1;
165
- transform: none;
166
- background-color: var(--md-comp-menu-container-color);
167
- border-radius: var(--md-comp-menu-container-shape);
168
- color: var(--md-sys-color-on-surface);
169
- @include z-depth("2");
170
-
171
- > li {
172
- box-sizing: border-box;
173
- min-height: var(--md-comp-menu-item-container-height);
174
- }
175
-
176
- > li:not(.disabled, .divider, .optgroup) {
177
- width: calc(100% - 16px);
178
- margin-inline: 8px;
179
- border-radius: 2rem;
180
- }
181
-
182
- > li:not(.disabled, .divider):hover,
183
- > li.active {
184
- background-color: color-mix(in oklab, var(--md-sys-color-on-surface) 8%, transparent);
185
- }
186
-
187
- > li > :is(a, button, span) {
188
- display: flex;
189
- align-items: center;
190
- gap: 12px;
191
- box-sizing: border-box;
192
- width: 100%;
193
- min-height: var(--md-comp-menu-item-container-height);
194
- padding: 0 12px;
195
- color: var(--md-sys-color-on-surface);
196
- text-decoration: none;
197
- @include typescale("label-large");
198
- font-family: $font-stack;
199
- }
200
- }
201
-
202
- @media (hover: hover) and (pointer: fine) {
203
- menu[id] li:is(:hover, :focus-within) > menu {
204
- display: block;
205
- }
206
- }
207
-
208
- menu[id] li.open > menu {
209
- display: block;
210
- }
211
-
212
- menu[id] li.submenu-start > menu {
213
- inset-inline-start: auto;
214
- inset-inline-end: 100%;
215
- }
216
-
217
- body.keyboard-focused {
218
- menu[id] > li:focus {
219
- background-color: color-mix(in oklab, var(--md-sys-color-on-surface) 10%, transparent);
220
- }
221
- }
222
-
223
- .dropdown-trigger {
224
- cursor: pointer;
225
- }