@expressivecss/expressive 0.3.0 → 0.5.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 (96) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/README.md +4 -9
  3. package/dist/css/expressive.css +3183 -2150
  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 +1254 -1567
  8. package/dist/js/expressive.cjs.map +4 -4
  9. package/dist/js/expressive.js +1254 -1567
  10. package/dist/js/expressive.js.map +4 -4
  11. package/dist/js/expressive.min.js +12 -22
  12. package/dist/js/expressive.min.js.map +4 -4
  13. package/dist/js/expressive.mjs +1254 -1568
  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 +13 -20
  18. package/dist/types/components/buttons.d.ts +2 -2
  19. package/dist/types/components/cards.d.ts +3 -6
  20. package/dist/types/components/carousel.d.ts +3 -3
  21. package/dist/types/components/characterCounter.d.ts +3 -5
  22. package/dist/types/components/chips.d.ts +2 -2
  23. package/dist/types/components/datepicker.d.ts +2 -8
  24. package/dist/types/components/index.d.ts +3 -6
  25. package/dist/types/components/lightbox.d.ts +2 -2
  26. package/dist/types/components/{dropdown.d.ts → menu.d.ts} +48 -38
  27. package/dist/types/components/navigationRail.d.ts +53 -0
  28. package/dist/types/components/parallax.d.ts +2 -8
  29. package/dist/types/components/range.d.ts +5 -2
  30. package/dist/types/components/registry.d.ts +7 -19
  31. package/dist/types/components/scrollspy.d.ts +26 -50
  32. package/dist/types/components/select.d.ts +28 -14
  33. package/dist/types/components/sidenav.d.ts +40 -55
  34. package/dist/types/components/slider.d.ts +2 -2
  35. package/dist/types/components/{toasts.d.ts → snackbar.d.ts} +28 -25
  36. package/dist/types/components/tabs.d.ts +2 -2
  37. package/dist/types/components/timepicker.d.ts +2 -4
  38. package/dist/types/components/tooltip.d.ts +2 -2
  39. package/dist/types/core/component.d.ts +4 -4
  40. package/dist/types/index.d.ts +3 -1
  41. package/package.json +4 -3
  42. package/src/sass/README.md +13 -15
  43. package/src/sass/abstracts/_breakpoints.scss +14 -19
  44. package/src/sass/abstracts/_mixins.scss +3 -3
  45. package/src/sass/abstracts/_variables.scss +27 -23
  46. package/src/sass/base/_global.scss +1 -1
  47. package/src/sass/base/_grid.scss +64 -133
  48. package/src/sass/base/_index.scss +1 -1
  49. package/src/sass/components/_badges.scss +76 -61
  50. package/src/sass/components/_bottom-sheet.scss +137 -0
  51. package/src/sass/components/_buttons.scss +22 -54
  52. package/src/sass/components/_cards.scss +54 -127
  53. package/src/sass/components/_carousel.scss +4 -6
  54. package/src/sass/components/_chips.scss +6 -5
  55. package/src/sass/components/_datepicker.scss +1 -15
  56. package/src/sass/components/_dialog.scss +268 -0
  57. package/src/sass/components/_index.scss +9 -7
  58. package/src/sass/components/_list.scss +253 -0
  59. package/src/sass/components/_menu.scss +341 -0
  60. package/src/sass/components/_navbar.scss +68 -117
  61. package/src/sass/components/_navigation-bar.scss +165 -0
  62. package/src/sass/components/_navigation-rail.scss +308 -0
  63. package/src/sass/components/_page-footer.scss +138 -15
  64. package/src/sass/components/_parallax.scss +7 -28
  65. package/src/sass/components/_preloader.scss +145 -300
  66. package/src/sass/components/_scrollspy.scss +18 -0
  67. package/src/sass/components/_side-sheet.scss +193 -0
  68. package/src/sass/components/_sidenav.scss +281 -146
  69. package/src/sass/components/{_toast.scss → _snackbar.scss} +43 -43
  70. package/src/sass/components/_table_of_contents.scss +30 -14
  71. package/src/sass/components/_tabs.scss +43 -50
  72. package/src/sass/components/_toolbar.scss +93 -27
  73. package/src/sass/components/_tooltip.scss +5 -10
  74. package/src/sass/components/_transitions.scss +0 -5
  75. package/src/sass/components/forms/_fieldset.scss +1 -1
  76. package/src/sass/components/forms/_index.scss +0 -5
  77. package/src/sass/components/forms/_input-fields.scss +52 -55
  78. package/src/sass/components/forms/_range.scss +423 -98
  79. package/src/sass/components/forms/_select.scss +177 -60
  80. package/src/sass/components/forms/_switches.scss +21 -8
  81. package/src/sass/tokens/_reference.scss +37 -13
  82. package/src/sass/tokens/_theme.scss +5 -13
  83. package/src/sass/utilities/_colors.scss +16 -74
  84. package/src/sass/utilities/_helpers.scss +1 -3
  85. package/src/sass/utilities/_typescale.scss +0 -5
  86. package/src/sass/utilities/_visibility.scss +10 -2
  87. package/dist/types/components/collapsible.d.ts +0 -96
  88. package/dist/types/components/modal.d.ts +0 -45
  89. package/dist/types/components/pushpin.d.ts +0 -51
  90. package/dist/types/components/tapTarget.d.ts +0 -57
  91. package/src/sass/components/_collapsible.scss +0 -181
  92. package/src/sass/components/_collection.scss +0 -198
  93. package/src/sass/components/_dropdown.scss +0 -129
  94. package/src/sass/components/_modal.scss +0 -208
  95. package/src/sass/components/_pushpin.scss +0 -11
  96. package/src/sass/components/_tapTarget.scss +0 -191
@@ -1,129 +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. .dropdown-content is an alias (FormSelect and Autocomplete
9
- // still generate it).
10
- //
11
- // Tokens follow https://m3.material.io/components/menus/specs
12
- // container surface, 4dp corners, elevation 2, 112–280dp
13
- // item 48dp, 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
- [popover] {
19
- outline: none;
20
- padding: 0;
21
- border: none;
22
- }
23
-
24
- .dropdown-content,
25
- menu[id] {
26
- --md-comp-menu-container-color: var(--md-sys-color-surface);
27
- --md-comp-menu-container-shape: 4px;
28
- --md-comp-menu-item-container-height: 48px;
29
-
30
- box-sizing: border-box;
31
- display: none;
32
- position: absolute;
33
- left: 0;
34
- top: 0;
35
- z-index: 9999;
36
- min-width: 112px;
37
- margin: 0;
38
- padding: 8px 0;
39
- list-style: none;
40
- overflow-y: auto;
41
- opacity: 0;
42
- user-select: none;
43
- transform-origin: 0 0;
44
- background-color: var(--md-comp-menu-container-color);
45
- border-radius: var(--md-comp-menu-container-shape);
46
- color: var(--md-sys-color-on-surface);
47
- @include z-depth("2");
48
-
49
- > li {
50
- margin: 0;
51
- padding: 0;
52
- width: 100%;
53
- min-height: var(--md-comp-menu-item-container-height);
54
- cursor: pointer;
55
- text-align: left;
56
-
57
- > a,
58
- > button,
59
- > span {
60
- display: flex;
61
- align-items: center;
62
- gap: 12px;
63
- box-sizing: border-box;
64
- width: 100%;
65
- min-height: var(--md-comp-menu-item-container-height);
66
- margin: 0;
67
- padding: 0 12px;
68
- border: 0;
69
- background: none;
70
- color: var(--md-sys-color-on-surface);
71
- text-decoration: none;
72
- cursor: pointer;
73
- @include typescale("label-large");
74
- font-family: $font-stack;
75
- }
76
-
77
- > a > i,
78
- > button > i,
79
- > i {
80
- flex: 0 0 24px;
81
- font-size: 24px;
82
- width: 24px;
83
- height: 24px;
84
- line-height: 24px;
85
- color: var(--md-sys-color-on-surface-variant);
86
- }
87
- }
88
-
89
- > li:not(.disabled, .divider):hover,
90
- > li.active {
91
- background-color: color-mix(in oklab, var(--md-sys-color-on-surface) 8%, transparent);
92
- }
93
-
94
- > li.disabled {
95
- pointer-events: none;
96
- opacity: 0.38;
97
- }
98
-
99
- > hr,
100
- > li.divider {
101
- display: block;
102
- width: 100%;
103
- height: 1px;
104
- min-height: 0;
105
- margin: 8px 0;
106
- padding: 0;
107
- border: 0;
108
- background-color: var(--md-sys-color-outline-variant);
109
- cursor: default;
110
- }
111
- }
112
-
113
- body.keyboard-focused {
114
- .dropdown-content > li:focus,
115
- menu[id] > li:focus {
116
- background-color: color-mix(in oklab, var(--md-sys-color-on-surface) 10%, transparent);
117
- }
118
- }
119
-
120
- .input-field.col .dropdown-content [type="checkbox"] + label {
121
- top: 1px;
122
- left: 0;
123
- height: 18px;
124
- transform: none;
125
- }
126
-
127
- .dropdown-trigger {
128
- cursor: pointer;
129
- }
@@ -1,208 +0,0 @@
1
- @use "../abstracts" as *;
2
-
3
- // Dialogs.
4
- //
5
- // Anatomy is the HTML. A <dialog> is a basic dialog. A heading is the
6
- // headline, a <p> (or a wrapping <div>) is supporting text, and the last
7
- // child <form method="dialog"> or <nav> is the action row. .modal and
8
- // .modal-header / .modal-content / .modal-footer stay as aliases.
9
- //
10
- // Tokens follow https://m3.material.io/components/dialogs/specs
11
- // container surface, 28dp corners, 280–560dp, elevation 3
12
- // headline headline-small / on-surface
13
- // body body-medium / on-surface-variant
14
- // icon 24dp, on-secondary
15
- // actions end-aligned, 8dp gap
16
- // scrim 32% + 12px blur
17
- // padding 24dp
18
-
19
- dialog,
20
- .modal {
21
- --md-comp-basic-dialog-container-color: var(--md-sys-color-surface);
22
- --md-comp-basic-dialog-container-shape: 28px;
23
- --md-comp-basic-dialog-container-min-width: 280px;
24
- --md-comp-basic-dialog-container-max-width: 560px;
25
- --md-comp-basic-dialog-sheet-width: 400px;
26
- --md-comp-basic-dialog-scrim-blur: 12px;
27
-
28
- box-sizing: border-box;
29
- width: min(var(--md-comp-basic-dialog-container-max-width), calc(100% - 48px));
30
- min-width: min(var(--md-comp-basic-dialog-container-min-width), calc(100% - 48px));
31
- max-height: min(70vh, calc(100% - 48px));
32
- margin: auto;
33
- padding: 0;
34
- border: none;
35
- border-radius: var(--md-comp-basic-dialog-container-shape);
36
- background-color: var(--md-comp-basic-dialog-container-color);
37
- color: var(--md-sys-color-on-surface);
38
- outline: none;
39
- @include z-depth("3");
40
-
41
- &::backdrop {
42
- background-color: color-mix(in oklab, var(--md-sys-color-scrim) 32%, transparent);
43
- backdrop-filter: blur(var(--md-comp-basic-dialog-scrim-blur));
44
- }
45
- }
46
-
47
- // showModal() puts the dialog in the top layer but does not lock the
48
- // document scroller. :modal is the modal-only match — a modeless
49
- // dialog.show() must not freeze the page.
50
- html:has(dialog:modal) {
51
- overflow: hidden;
52
- }
53
-
54
- dialog[open],
55
- .modal[open] {
56
- display: flex;
57
- flex-direction: column;
58
- overflow: hidden;
59
- overscroll-behavior: contain;
60
- }
61
-
62
- // Optional leading icon (M3 basic dialog).
63
- dialog > i:first-child {
64
- flex: 0 0 auto;
65
- align-self: center;
66
- margin: 24px 24px 0;
67
- font-size: 24px;
68
- width: 24px;
69
- height: 24px;
70
- line-height: 24px;
71
- color: var(--md-sys-color-secondary);
72
- }
73
-
74
- dialog > :is(h1, h2, h3, h4, h5, h6),
75
- .modal-header {
76
- flex: 0 0 auto;
77
- margin: 0;
78
- padding: 24px 24px 16px;
79
- font-family: var(--md-sys-typescale-headline-small-font-family-name);
80
- font-size: var(--md-sys-typescale-headline-small-font-size);
81
- font-weight: var(--md-sys-typescale-headline-small-font-weight);
82
- line-height: var(--md-sys-typescale-headline-small-line-height);
83
- letter-spacing: var(--md-sys-typescale-headline-small-letter-spacing);
84
- color: var(--md-sys-color-on-surface);
85
- }
86
-
87
- dialog > i:first-child + :is(h1, h2, h3, h4, h5, h6) {
88
- padding-top: 16px;
89
- text-align: center;
90
- }
91
-
92
- dialog > p,
93
- dialog > div,
94
- .modal-content {
95
- flex: 1 1 auto;
96
- min-height: 0;
97
- overflow: auto;
98
- overscroll-behavior: contain;
99
- margin: 0;
100
- padding: 0 24px 16px;
101
- font-family: var(--md-sys-typescale-body-medium-font-family-name);
102
- font-size: var(--md-sys-typescale-body-medium-font-size);
103
- font-weight: var(--md-sys-typescale-body-medium-font-weight);
104
- line-height: var(--md-sys-typescale-body-medium-line-height);
105
- letter-spacing: var(--md-sys-typescale-body-medium-letter-spacing);
106
- color: color-mix(in oklab, currentColor 72%, transparent);
107
- }
108
-
109
- dialog > :is(h1, h2, h3, h4, h5, h6) + p,
110
- .modal-header + .modal-content {
111
- padding-top: 0;
112
- }
113
-
114
- // Action row. form[method=dialog] is the native close mechanism.
115
- dialog > :is(form, nav):last-child,
116
- .modal-footer {
117
- display: flex;
118
- flex-wrap: wrap;
119
- justify-content: flex-end;
120
- align-items: center;
121
- gap: 8px;
122
- flex: 0 0 auto;
123
- margin: 0;
124
- padding: 8px 16px 16px;
125
- border: 0;
126
- background: none;
127
- }
128
-
129
- .modal-close {
130
- cursor: pointer;
131
- }
132
-
133
- // Full-screen (M3). Takes the viewport; no corners.
134
- // UA `dialog:modal` sets max-width: calc(100% - 2em - 6px). Without
135
- // clearing it, width: 100% is capped and a strip of scrim shows on the
136
- // right. Bottom sheet already overrides this.
137
- dialog.max,
138
- .modal.max {
139
- width: 100%;
140
- max-width: none;
141
- height: 100%;
142
- min-width: 0;
143
- max-height: none;
144
- margin: 0;
145
- border-radius: 0;
146
- }
147
-
148
- // Sheets. Docked to one edge; the inner corners keep the dialog shape,
149
- // the edge against the viewport is square. `left` / `right` also float
150
- // via the helper utilities (`!important`), so sheets reset that.
151
- dialog.bottom,
152
- dialog.bottom-sheet,
153
- .modal.bottom-sheet {
154
- width: 100%;
155
- min-width: 0;
156
- max-width: none;
157
- max-height: 50%;
158
- margin: auto 0 0;
159
- border-radius: var(--md-comp-basic-dialog-container-shape)
160
- var(--md-comp-basic-dialog-container-shape) 0 0;
161
- }
162
-
163
- dialog.top,
164
- dialog.top-sheet,
165
- .modal.top-sheet {
166
- width: 100%;
167
- min-width: 0;
168
- max-width: none;
169
- max-height: 50%;
170
- margin: 0 0 auto;
171
- border-radius: 0 0 var(--md-comp-basic-dialog-container-shape)
172
- var(--md-comp-basic-dialog-container-shape);
173
- }
174
-
175
- dialog.left,
176
- dialog.left-sheet,
177
- .modal.left-sheet,
178
- dialog.right,
179
- dialog.right-sheet,
180
- .modal.right-sheet {
181
- float: none !important;
182
- width: min(var(--md-comp-basic-dialog-sheet-width), 85%);
183
- max-width: none;
184
- height: auto;
185
- max-height: none;
186
- min-width: 0;
187
- min-height: 0;
188
- margin: 0;
189
- inset-block: 0;
190
- }
191
-
192
- dialog.left,
193
- dialog.left-sheet,
194
- .modal.left-sheet {
195
- inset-inline-start: 0;
196
- inset-inline-end: auto;
197
- border-radius: 0 var(--md-comp-basic-dialog-container-shape)
198
- var(--md-comp-basic-dialog-container-shape) 0;
199
- }
200
-
201
- dialog.right,
202
- dialog.right-sheet,
203
- .modal.right-sheet {
204
- inset-inline-start: auto;
205
- inset-inline-end: 0;
206
- border-radius: var(--md-comp-basic-dialog-container-shape) 0 0
207
- var(--md-comp-basic-dialog-container-shape);
208
- }
@@ -1,11 +0,0 @@
1
- @use "../abstracts" as *;
2
-
3
- // Paired with components/pushpin.ts, which swaps these classes on scroll.
4
-
5
- .pin-top, .pin-bottom {
6
- position: relative;
7
- }
8
-
9
- .pinned {
10
- position: fixed !important;
11
- }
@@ -1,191 +0,0 @@
1
- @use "../abstracts" as *;
2
-
3
- // Tap target (Feature Discovery). A circular spotlight centered on an
4
- // origin. JS writes --md-comp-tap-target-x/y/origin-size and data-edge;
5
- // this file does the rest.
6
- //
7
- // Tokens:
8
- // --md-comp-tap-target-size 480px
9
- // --md-comp-tap-target-z 1000
10
- // --md-comp-tap-target-container-color
11
- // --md-comp-tap-target-supporting-color
12
- // --md-comp-tap-target-duration 300ms
13
- // --md-comp-tap-target-easing soft ease-in-out
14
- //
15
- // .feature-discovery is an alias of .tap-target.
16
-
17
- .tap-target-wrapper {
18
- --md-comp-tap-target-size: 480px;
19
- --md-comp-tap-target-z: 1000;
20
- --md-comp-tap-target-container-color: var(--md-sys-color-primary-container);
21
- --md-comp-tap-target-supporting-color: var(--md-sys-color-on-primary-container);
22
- --md-comp-tap-target-duration: 300ms;
23
- --md-comp-tap-target-easing: cubic-bezier(0.65, 0, 0.35, 1);
24
- --md-comp-tap-target-x: 50%;
25
- --md-comp-tap-target-y: 50%;
26
- --md-comp-tap-target-origin-size: 56px;
27
-
28
- box-sizing: border-box;
29
- position: fixed;
30
- inset: auto;
31
- left: var(--md-comp-tap-target-x);
32
- top: var(--md-comp-tap-target-y);
33
- translate: -50% -50%;
34
- width: var(--md-comp-tap-target-size);
35
- height: var(--md-comp-tap-target-size);
36
- margin: 0;
37
- padding: 0;
38
- overflow: visible;
39
- border: 0;
40
- background: transparent;
41
- color: var(--md-comp-tap-target-supporting-color);
42
- visibility: hidden;
43
- pointer-events: none;
44
- z-index: var(--md-comp-tap-target-z);
45
- transition:
46
- visibility 0s var(--md-comp-tap-target-duration),
47
- overlay var(--md-comp-tap-target-duration) allow-discrete,
48
- display var(--md-comp-tap-target-duration) allow-discrete;
49
- }
50
-
51
- .tap-target-wrapper:is(.open, :popover-open) {
52
- visibility: visible;
53
- pointer-events: none;
54
- transition-delay: 0s;
55
-
56
- .tap-target,
57
- .feature-discovery {
58
- transform: scale(1);
59
- opacity: 1;
60
- }
61
-
62
- .tap-target-wave::before {
63
- transform: scale(1);
64
- }
65
-
66
- .tap-target-wave::after {
67
- visibility: visible;
68
- animation: pulse-animation 1s cubic-bezier(0.24, 0, 0.38, 1) infinite;
69
- }
70
- }
71
-
72
- .tap-target,
73
- .feature-discovery {
74
- position: absolute;
75
- inset: 0;
76
- display: grid;
77
- box-sizing: border-box;
78
- width: 100%;
79
- height: 100%;
80
- overflow: hidden;
81
- border-radius: 50%;
82
- background-color: var(--md-comp-tap-target-container-color);
83
- color: var(--md-comp-tap-target-supporting-color);
84
- opacity: 0;
85
- transform: scale(0);
86
- transition:
87
- transform var(--md-comp-tap-target-duration) var(--md-comp-tap-target-easing),
88
- opacity var(--md-comp-tap-target-duration) var(--md-comp-tap-target-easing);
89
- @include z-depth("3");
90
- @include typescale("body-medium");
91
- }
92
-
93
- .tap-target-content {
94
- position: relative;
95
- z-index: 1;
96
- display: grid;
97
- align-content: start;
98
- gap: 8px;
99
- box-sizing: border-box;
100
- max-width: min(18rem, 52%);
101
- padding: calc(var(--md-comp-tap-target-origin-size) * 0.5 + 20px);
102
- pointer-events: auto;
103
-
104
- > :is(h1, h2, h3, h4, h5, h6) {
105
- margin: 0;
106
- color: inherit;
107
- @include typescale("title-medium");
108
- }
109
-
110
- > p {
111
- margin: 0;
112
- color: inherit;
113
- }
114
- }
115
-
116
- .tap-target-wrapper[data-edge^="top"] .tap-target-content {
117
- align-self: end;
118
- }
119
-
120
- .tap-target-wrapper[data-edge^="bottom"] .tap-target-content {
121
- align-self: start;
122
- }
123
-
124
- .tap-target-wrapper[data-edge$="left"] .tap-target-content {
125
- justify-self: end;
126
- }
127
-
128
- .tap-target-wrapper[data-edge$="right"] .tap-target-content {
129
- justify-self: start;
130
- }
131
-
132
- .tap-target-wrapper[data-edge$="center"] .tap-target-content {
133
- justify-self: center;
134
- max-width: min(22rem, 80%);
135
- text-align: center;
136
- }
137
-
138
- .tap-target-wave {
139
- position: absolute;
140
- top: 50%;
141
- left: 50%;
142
- z-index: 0;
143
- width: calc(var(--md-comp-tap-target-origin-size) * 2);
144
- height: calc(var(--md-comp-tap-target-origin-size) * 2);
145
- translate: -50% -50%;
146
- border-radius: 50%;
147
- pointer-events: none;
148
-
149
- &::before,
150
- &::after {
151
- content: "";
152
- position: absolute;
153
- inset: 0;
154
- display: block;
155
- border-radius: 50%;
156
- background-color: var(--md-sys-color-surface);
157
- }
158
-
159
- &::before {
160
- transform: scale(0);
161
- transition: transform var(--md-comp-tap-target-duration)
162
- var(--md-comp-tap-target-easing);
163
- }
164
-
165
- &::after {
166
- visibility: hidden;
167
- z-index: -1;
168
- }
169
- }
170
-
171
- // Raised only on the non-popover path so a static origin stays above the
172
- // circle. Never set position here — a FAB may already be fixed.
173
- .tap-target-origin {
174
- z-index: calc(var(--md-comp-tap-target-z, 1000) + 2);
175
- }
176
-
177
- @include bp-down("small") {
178
- .tap-target-wrapper {
179
- --md-comp-tap-target-size: 360px;
180
- }
181
- }
182
-
183
- @media (prefers-reduced-motion: reduce) {
184
- .tap-target-wrapper {
185
- --md-comp-tap-target-duration: 0s;
186
- }
187
-
188
- .tap-target-wrapper:is(.open, :popover-open) .tap-target-wave::after {
189
- animation: none;
190
- }
191
- }