@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
@@ -2,14 +2,17 @@
2
2
 
3
3
  // Text fields.
4
4
  //
5
- // Anatomy is the HTML. .field (or .input-field) is the container. The
6
- // <label> after the control is the floating label. A leading <i> is the
7
- // leading icon. <small> is supporting text. .outlined / .border is the
8
- // outlined variant; the default is filled.
5
+ // Anatomy is the HTML. .field is the container. The <label> after the
6
+ // control is the floating label. A leading <i> (or .prefix) is the
7
+ // leading icon; .suffix (or a second / trailing <i>) is the trailing
8
+ // icon. Icons come before the control in the documented markup, so
9
+ // trailing cannot be selected with :last-child — that left .suffix
10
+ // in flow above the well. <small> is supporting text. .outlined is
11
+ // the outlined variant; the default is filled.
9
12
  //
10
13
  // Tokens follow https://m3.material.io/components/text-fields/specs
11
- // filled surface-variant well, 4dp top corners, 1dp/2dp bottom indicator
12
- // outlined 1dp/2dp outline, 4dp corners
14
+ // filled surface-variant well, 1rem corners, 1dp/2dp bottom indicator
15
+ // outlined 1dp/2dp outline, 1rem corners
13
16
  // height 56dp
14
17
  // label body-large rest, body-small floated
15
18
  // input body-large / on-surface
@@ -34,21 +37,23 @@ $_text-inputs: "input:not([type]):not(.browser-default), input[type=text]:not(.b
34
37
  font-family: $font-stack;
35
38
  }
36
39
 
37
- .field,
38
- .input-field {
39
- --md-comp-filled-text-field-container-color: var(--md-sys-color-surface-variant);
40
+ .field {
41
+ --md-comp-filled-text-field-container-color: var(--md-sys-color-surface-container-highest);
42
+ --md-comp-filled-text-field-container-shape: 1rem;
40
43
  --md-comp-filled-text-field-caret-color: var(--md-sys-color-primary);
41
44
  --input-color: var(--md-comp-filled-text-field-caret-color);
42
45
 
43
46
  position: relative;
44
47
  clear: both;
45
48
 
46
- input:not([type="range"]),
49
+ // Checkboxes / radios inside a field (multi-select menu) are not text
50
+ // fields — do not give them the 56dp well.
51
+ input:not([type="range"], [type="checkbox"], [type="radio"], [type="file"]),
47
52
  textarea {
48
53
  box-sizing: border-box;
49
54
  padding: 20px 16px 8px;
50
55
  border: none;
51
- border-radius: 4px 4px 0 0;
56
+ border-radius: var(--md-comp-filled-text-field-container-shape);
52
57
  border-bottom: 1px solid var(--md-sys-color-on-surface-variant);
53
58
  background-color: var(--md-comp-filled-text-field-container-color);
54
59
  caret-color: var(--input-color);
@@ -67,16 +72,16 @@ $_text-inputs: "input:not([type]):not(.browser-default), input[type=text]:not(.b
67
72
  }
68
73
 
69
74
  &:focus:not([readonly]) + label,
70
- &:focus:not([readonly]) + span:not(.supporting-text, .character-counter) {
75
+ &:focus:not([readonly]) + span:not(.supporting-text, .character-counter, .caret) {
71
76
  color: var(--input-color);
72
77
  }
73
78
 
74
79
  &:focus:not([readonly]) + label,
75
80
  &:not([placeholder=" "]) + label,
76
81
  &:not(:placeholder-shown) + label,
77
- &:focus:not([readonly]) + span:not(.supporting-text, .character-counter),
78
- &:not([placeholder=" "]) + span:not(.supporting-text, .character-counter),
79
- &:not(:placeholder-shown) + span:not(.supporting-text, .character-counter) {
82
+ &:focus:not([readonly]) + span:not(.supporting-text, .character-counter, .caret),
83
+ &:not([placeholder=" "]) + span:not(.supporting-text, .character-counter, .caret),
84
+ &:not(:placeholder-shown) + span:not(.supporting-text, .character-counter, .caret) {
80
85
  transform: scale(calc(12 / 16));
81
86
  top: 8px;
82
87
  }
@@ -119,7 +124,7 @@ $_text-inputs: "input:not([type]):not(.browser-default), input[type=text]:not(.b
119
124
  }
120
125
 
121
126
  > label,
122
- > span:not(.supporting-text, .character-counter, .file-path) {
127
+ > span:not(.supporting-text, .character-counter, .file-path, .caret) {
123
128
  color: var(--md-sys-color-on-surface-variant);
124
129
  user-select: none;
125
130
  position: absolute;
@@ -152,10 +157,11 @@ $_text-inputs: "input:not([type]):not(.browser-default), input[type=text]:not(.b
152
157
  font-family: $font-stack;
153
158
  }
154
159
 
155
- > i:first-child:not(.suffix),
156
- > .prefix {
160
+ // Shared icon box. Position is set on the leading / trailing rules;
161
+ // a lone <i> matches several of the :is() items and must not pick
162
+ // a side here.
163
+ > i:is(.prefix, .suffix, :first-of-type, :last-of-type, :last-child) {
157
164
  position: absolute;
158
- left: 12px;
159
165
  top: 16px;
160
166
  display: flex;
161
167
  align-items: center;
@@ -165,53 +171,44 @@ $_text-inputs: "input:not([type]):not(.browser-default), input[type=text]:not(.b
165
171
  line-height: 24px;
166
172
  color: var(--md-sys-color-on-surface-variant);
167
173
  user-select: none;
174
+ }
175
+
176
+ > i:first-of-type:not(.suffix):not(:last-child),
177
+ > i.prefix {
178
+ left: 12px;
168
179
  pointer-events: none;
169
180
  }
170
181
 
171
- > .suffix,
172
- > i.suffix {
173
- position: absolute;
182
+ > i.suffix,
183
+ > i:last-of-type:not(:first-of-type),
184
+ > i:last-child:not(:first-child):not(.prefix) {
174
185
  right: 12px;
175
- top: 16px;
176
- display: flex;
177
- align-items: center;
178
- font-size: 24px;
179
- width: 24px;
180
- height: 24px;
181
- line-height: 24px;
182
- color: var(--md-sys-color-on-surface-variant);
183
- user-select: none;
184
186
  }
185
187
 
186
- > i:first-child:not(.suffix) ~ input,
187
- > i:first-child:not(.suffix) ~ textarea,
188
- > .prefix ~ input,
189
- > .prefix ~ textarea {
190
- padding-left: 52px;
191
- }
188
+ &:has(> i:first-of-type:not(.suffix):not(:last-child), > i.prefix) {
189
+ > :is(input, textarea) {
190
+ padding-left: 52px;
191
+ }
192
192
 
193
- > .suffix ~ input,
194
- > .suffix ~ textarea,
195
- > i.suffix ~ input,
196
- > i.suffix ~ textarea {
197
- padding-right: 52px;
193
+ > :is(label, span:not(.supporting-text, .character-counter, .file-path, .caret)) {
194
+ left: 52px;
195
+ }
198
196
  }
199
197
 
200
- > i:first-child:not(.suffix) ~ label,
201
- > i:first-child:not(.suffix) ~ span:not(.supporting-text, .character-counter),
202
- > .prefix ~ label {
203
- left: 52px;
198
+ &:has(> i.suffix, > i:last-of-type:not(:first-of-type), > i:last-child:not(:first-child):not(.prefix)) {
199
+ > :is(input, textarea) {
200
+ padding-right: 52px;
201
+ }
204
202
  }
205
203
 
206
- &.outlined,
207
- &.border {
204
+ &.outlined {
208
205
  > input,
209
206
  > textarea {
210
207
  padding-top: 8px;
211
208
  padding-bottom: 8px;
212
209
  background-color: transparent;
213
210
  border: 1px solid var(--md-sys-color-outline);
214
- border-radius: 4px;
211
+ border-radius: var(--md-comp-filled-text-field-container-shape);
215
212
 
216
213
  &:focus:not([readonly]) {
217
214
  border-width: 2px;
@@ -223,9 +220,9 @@ $_text-inputs: "input:not([type]):not(.browser-default), input[type=text]:not(.b
223
220
  &:focus:not([readonly]) + label,
224
221
  &:not([placeholder=" "]) + label,
225
222
  &:not(:placeholder-shown) + label,
226
- &:focus:not([readonly]) + span:not(.supporting-text, .character-counter),
227
- &:not([placeholder=" "]) + span:not(.supporting-text, .character-counter),
228
- &:not(:placeholder-shown) + span:not(.supporting-text, .character-counter) {
223
+ &:focus:not([readonly]) + span:not(.supporting-text, .character-counter, .caret),
224
+ &:not([placeholder=" "]) + span:not(.supporting-text, .character-counter, .caret),
225
+ &:not(:placeholder-shown) + span:not(.supporting-text, .character-counter, .caret) {
229
226
  top: -8px;
230
227
  left: 16px;
231
228
  margin-left: -4px;
@@ -253,7 +250,7 @@ $_text-inputs: "input:not([type]):not(.browser-default), input[type=text]:not(.b
253
250
  }
254
251
 
255
252
  .searchbar {
256
- .prefix {
253
+ > i:first-child {
257
254
  position: absolute;
258
255
  padding-left: 1rem;
259
256
  top: 0;
@@ -296,8 +293,8 @@ textarea {
296
293
  li {
297
294
  .highlight { color: var(--md-sys-color-on-surface); }
298
295
  img {
299
- height: $dropdown-item-height - 10;
300
- width: $dropdown-item-height - 10;
296
+ height: $menu-item-height - 10;
297
+ width: $menu-item-height - 10;
301
298
  margin: 5px 15px;
302
299
  }
303
300
  }