@expressivecss/expressive 0.7.0 → 0.9.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 (122) hide show
  1. package/CHANGELOG.md +1313 -1
  2. package/README.md +76 -30
  3. package/dist/css/expressive.css +4896 -1777
  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/fonts/LICENSE-material-symbols +93 -0
  8. package/dist/fonts/LICENSE-noto-sans +93 -0
  9. package/dist/fonts/LICENSE-roboto +93 -0
  10. package/dist/fonts/material-symbols-outlined.woff2 +0 -0
  11. package/dist/fonts/material-symbols-rounded.woff2 +0 -0
  12. package/dist/fonts/material-symbols-sharp.woff2 +0 -0
  13. package/dist/fonts/noto-sans-latin-400.woff2 +0 -0
  14. package/dist/fonts/noto-sans-latin-500.woff2 +0 -0
  15. package/dist/fonts/roboto-latin-400.woff2 +0 -0
  16. package/dist/fonts/roboto-latin-500.woff2 +0 -0
  17. package/dist/js/expressive.cjs +1673 -1338
  18. package/dist/js/expressive.cjs.map +4 -4
  19. package/dist/js/expressive.js +1673 -1338
  20. package/dist/js/expressive.js.map +4 -4
  21. package/dist/js/expressive.min.js +13 -13
  22. package/dist/js/expressive.min.js.map +4 -4
  23. package/dist/js/expressive.mjs +1673 -1338
  24. package/dist/js/expressive.mjs.map +4 -4
  25. package/dist/types/behaviors/bottomSheets.d.ts +19 -11
  26. package/dist/types/behaviors/sheetDrag.d.ts +40 -0
  27. package/dist/types/behaviors/sideSheets.d.ts +2 -9
  28. package/dist/types/components/appBar.d.ts +26 -0
  29. package/dist/types/components/autocomplete.d.ts +15 -3
  30. package/dist/types/components/buttonGroup.d.ts +39 -0
  31. package/dist/types/components/buttons.d.ts +5 -1
  32. package/dist/types/components/cards.d.ts +11 -13
  33. package/dist/types/components/carousel.d.ts +87 -53
  34. package/dist/types/components/chips.d.ts +21 -1
  35. package/dist/types/components/expandingCard.d.ts +31 -0
  36. package/dist/types/components/index.d.ts +23 -20
  37. package/dist/types/components/lightbox.d.ts +1 -0
  38. package/dist/types/components/menu.d.ts +11 -1
  39. package/dist/types/components/{sidenav.d.ts → navigationDrawer.d.ts} +16 -16
  40. package/dist/types/components/registry.d.ts +18 -8
  41. package/dist/types/components/slider.d.ts +26 -85
  42. package/dist/types/components/snackbar.d.ts +20 -5
  43. package/dist/types/components/tabs.d.ts +12 -0
  44. package/dist/types/components/timepicker.d.ts +12 -10
  45. package/dist/types/components/tooltip.d.ts +1 -0
  46. package/dist/types/core/utils.d.ts +64 -53
  47. package/dist/types/index.d.ts +8 -9
  48. package/package.json +39 -3
  49. package/src/sass/README.md +61 -11
  50. package/src/sass/abstracts/_breakpoints.scss +17 -19
  51. package/src/sass/abstracts/_mixins.scss +155 -21
  52. package/src/sass/abstracts/_variables.scss +69 -5
  53. package/src/sass/base/_fonts.scss +63 -0
  54. package/src/sass/base/_global.scss +6 -24
  55. package/src/sass/base/_grid.scss +15 -12
  56. package/src/sass/base/_normalize.scss +34 -38
  57. package/src/sass/base/_typography.scss +4 -18
  58. package/src/sass/components/_badges.scss +3 -5
  59. package/src/sass/components/_banners.scss +298 -0
  60. package/src/sass/components/_bottom-app-bar.scss +180 -0
  61. package/src/sass/components/_bottom-sheet.scss +12 -4
  62. package/src/sass/components/_button-groups.scss +358 -0
  63. package/src/sass/components/_buttons.scss +245 -92
  64. package/src/sass/components/_cards.scss +514 -78
  65. package/src/sass/components/_carousel.scss +562 -68
  66. package/src/sass/components/_chips.scss +64 -5
  67. package/src/sass/components/_datepicker.scss +24 -24
  68. package/src/sass/components/_dialog.scss +17 -11
  69. package/src/sass/components/_drag-handle.scss +130 -0
  70. package/src/sass/components/_expanding-card.scss +226 -0
  71. package/src/sass/components/_fab-menu.scss +232 -0
  72. package/src/sass/components/_floating-sheet.scss +86 -0
  73. package/src/sass/components/_icon-buttons.scss +172 -0
  74. package/src/sass/components/_icons-material-design.scss +22 -10
  75. package/src/sass/components/_index.scss +22 -6
  76. package/src/sass/components/_list.scss +16 -13
  77. package/src/sass/components/_loading-indicator.scss +106 -0
  78. package/src/sass/components/_menu.scss +335 -61
  79. package/src/sass/components/_navbar.scss +245 -45
  80. package/src/sass/components/_navigation-bar.scss +22 -11
  81. package/src/sass/components/{_sidenav.scss → _navigation-drawer.scss} +123 -33
  82. package/src/sass/components/_navigation-rail.scss +31 -23
  83. package/src/sass/components/_page-footer.scss +19 -16
  84. package/src/sass/components/_pagination.scss +24 -6
  85. package/src/sass/components/_panes.scss +52 -11
  86. package/src/sass/components/{_preloader.scss → _progress.scss} +11 -3
  87. package/src/sass/components/_scrim.scss +37 -0
  88. package/src/sass/components/_search.scss +259 -0
  89. package/src/sass/components/_segmented-buttons.scss +188 -0
  90. package/src/sass/components/_side-sheet.scss +2 -2
  91. package/src/sass/components/_snackbar.scss +20 -15
  92. package/src/sass/components/_split-button.scss +196 -0
  93. package/src/sass/components/_tabs.scss +7 -8
  94. package/src/sass/components/_timepicker.scss +67 -58
  95. package/src/sass/components/_toolbar.scss +206 -80
  96. package/src/sass/components/_transitions.scss +8 -1
  97. package/src/sass/components/forms/_checkboxes.scss +49 -12
  98. package/src/sass/components/forms/_fieldset.scss +4 -4
  99. package/src/sass/components/forms/_file-input.scss +8 -1
  100. package/src/sass/components/forms/_index.scss +1 -1
  101. package/src/sass/components/forms/_input-fields.scss +50 -44
  102. package/src/sass/components/forms/_radio-buttons.scss +42 -10
  103. package/src/sass/components/forms/_select.scss +38 -1
  104. package/src/sass/components/forms/{_range.scss → _slider.scss} +8 -9
  105. package/src/sass/components/forms/_switches.scss +6 -7
  106. package/src/sass/expressive.scss +5 -0
  107. package/src/sass/tokens/_index.scss +4 -1
  108. package/src/sass/tokens/_reference.scss +70 -61
  109. package/src/sass/tokens/_state.scss +24 -0
  110. package/src/sass/tokens/_theme.scss +6 -3
  111. package/src/sass/tokens/_vibrant.scss +76 -0
  112. package/src/sass/utilities/_colors.scss +14 -1
  113. package/src/sass/utilities/_helpers.scss +5 -5
  114. package/src/sass/utilities/_visibility.scss +48 -26
  115. package/dist/types/behaviors/waves.d.ts +0 -15
  116. package/dist/types/components/parallax.d.ts +0 -16
  117. package/dist/types/components/range.d.ts +0 -43
  118. package/dist/types/core/bounding.d.ts +0 -6
  119. package/dist/types/core/edges.d.ts +0 -6
  120. package/src/sass/components/_parallax.scss +0 -104
  121. package/src/sass/components/_pulse.scss +0 -37
  122. package/src/sass/components/_slider.scss +0 -129
@@ -67,14 +67,14 @@
67
67
  padding: 8px var(--md-comp-list-item-padding);
68
68
  @include typescale("body-large");
69
69
 
70
- > :is(i, img, input):first-child {
70
+ > :is(#{$icon}, img, input):first-child {
71
71
  grid-column: 1;
72
72
  grid-row: 1 / -1;
73
73
  align-self: center;
74
74
  flex-shrink: 0;
75
75
  }
76
76
 
77
- > i:first-child:not(.circle) {
77
+ > #{$icon}:first-child:not(.circle) {
78
78
  font-size: var(--md-comp-list-leading-icon-size);
79
79
  width: var(--md-comp-list-leading-icon-size);
80
80
  height: var(--md-comp-list-leading-icon-size);
@@ -88,14 +88,14 @@
88
88
  border-radius: 8px;
89
89
  }
90
90
 
91
- > :is(img, i).circle {
91
+ > :is(img, #{$icon}).circle {
92
92
  width: var(--md-comp-list-avatar-size);
93
93
  height: var(--md-comp-list-avatar-size);
94
94
  border-radius: 50%;
95
95
  object-fit: cover;
96
96
  }
97
97
 
98
- > i.circle {
98
+ > #{$icon}.circle {
99
99
  display: inline-flex;
100
100
  align-items: center;
101
101
  justify-content: center;
@@ -105,8 +105,11 @@
105
105
  color: var(--md-sys-color-on-primary-container);
106
106
  }
107
107
 
108
+ // $icon-label, not a bare `span`: the canonical icon is a <span> too, so
109
+ // this rule used to pull the leading icon out of column 1 and into the
110
+ // text column - the icon rules above went dead and this one over-matched.
108
111
  > div:not(.meta),
109
- > span {
112
+ > #{$icon-label} {
110
113
  grid-column: 2;
111
114
  min-width: 0;
112
115
  }
@@ -120,14 +123,14 @@
120
123
  @include typescale("body-medium");
121
124
  }
122
125
 
123
- > :is(i, kbd, button, time, .meta, .badge, .button, a):last-child:not(:first-child) {
126
+ > :is(#{$icon}, kbd, button, time, .meta, .badge, .button, a):last-child:not(:first-child) {
124
127
  grid-column: 3;
125
128
  grid-row: 1 / -1;
126
129
  justify-self: end;
127
130
  align-self: center;
128
131
  }
129
132
 
130
- > i:last-child:not(:first-child) {
133
+ > #{$icon}:last-child:not(:first-child) {
131
134
  font-size: var(--md-comp-list-trailing-icon-size);
132
135
  width: var(--md-comp-list-trailing-icon-size);
133
136
  height: var(--md-comp-list-trailing-icon-size);
@@ -146,8 +149,8 @@
146
149
  padding: 0;
147
150
  }
148
151
 
149
- > button:last-child:not(:first-child):not(.button),
150
- > a:last-child:not(:first-child):not(.button):has(> i:only-child) {
152
+ > button:last-child:not(:first-child):not(.button, .icon-button),
153
+ > a:last-child:not(:first-child):not(.button, .icon-button):has(> #{$icon}:only-child) {
151
154
  display: inline-flex;
152
155
  align-items: center;
153
156
  justify-content: center;
@@ -181,7 +184,7 @@
181
184
  > li:not(.active):not([aria-selected="true"]):not([aria-current]):not(:has(> [aria-current])):not(:has([aria-selected="true"])):not(:has(:checked)):hover {
182
185
  background-color: color-mix(
183
186
  in oklab,
184
- var(--md-sys-color-on-surface) 8%,
187
+ var(--md-sys-color-on-surface) state-opacity("hover"),
185
188
  var(--md-comp-list-item-container-color)
186
189
  );
187
190
  }
@@ -195,7 +198,7 @@
195
198
  background-color: var(--md-comp-list-selected-container-color);
196
199
  color: var(--md-comp-list-selected-color);
197
200
 
198
- i,
201
+ #{$icon},
199
202
  p,
200
203
  kbd,
201
204
  time,
@@ -203,8 +206,8 @@
203
206
  color: inherit;
204
207
  }
205
208
 
206
- > i:first-child,
207
- > :is(a, label):only-child > i:first-child {
209
+ > #{$icon}:first-child,
210
+ > :is(a, label):only-child > #{$icon}:first-child {
208
211
  --md-icon-fill: 1;
209
212
  }
210
213
  }
@@ -0,0 +1,106 @@
1
+ @use "sass:list";
2
+ @use "sass:math";
3
+ @use "../abstracts" as *;
4
+
5
+ // Loading indicator. M3 Expressive's indicator for short waits (under ~5s):
6
+ // a shape that morphs while it rotates. One element, CSS-only.
7
+ //
8
+ // <span class="loading-indicator" role="status" aria-label="Loading">
9
+ // <span class="loading-indicator contained" role="status" aria-label="Loading">
10
+ //
11
+ // It supersedes the indeterminate *circular* case of `.progress` — see the
12
+ // docs page. `.progress` keeps every determinate case and both linear bars.
13
+ //
14
+ // Tokens (M3 md.comp.loading-indicator.*):
15
+ // --md-comp-loading-indicator-active-indicator-size 38px
16
+ // --md-comp-loading-indicator-container-size 48px
17
+ // --md-comp-loading-indicator-active-indicator-color primary
18
+ // --md-comp-loading-indicator-container-color transparent
19
+ //
20
+ // `--md-comp-loading-indicator-duration` is ours, not M3's - the spec states
21
+ // the motion, not a duration token.
22
+
23
+ // The morph shapes. M3 cycles seven named shapes (soft burst, four cookies, a
24
+ // pentagon, a pill); these are four cookies plus a circle, which is the part
25
+ // of the vocabulary one formula can generate. M3 draws each shape as a rounded
26
+ // polygon and interpolates vertex by vertex; `clip-path` interpolates the same
27
+ // way, but only between polygons with the same vertex count. So every shape
28
+ // here is 24 points on a polar curve
29
+ // `r = 50% * (1 - depth * (1 - cos(petals * a)) / 2)`: depth 0 is a circle,
30
+ // and 24 divides 4, 6, 8 and 12 so every cusp lands on a vertex.
31
+ // Corners are unrounded — a 24-gon reads as the shape, not as a polygon. The
32
+ // docs call these cookies, which is M3's word for them; `depth: 0` is the
33
+ // circle the cycle opens on, so the function is named for the curve instead.
34
+ $_points: 24;
35
+
36
+ // Two decimals is 0.005% of a 38px box - a fiftieth of a pixel. Full float
37
+ // precision costs ~2KB across the five shapes and buys nothing visible.
38
+ @function _pct($v) {
39
+ @return math.div(math.round($v * 100), 100);
40
+ }
41
+
42
+ @function _petal-shape($petals, $depth) {
43
+ $pts: ();
44
+ @for $i from 0 through $_points - 1 {
45
+ $a: math.div($i * 2 * math.$pi, $_points);
46
+ $r: 50% * (1 - math.div($depth * (1 - math.cos($petals * $a)), 2));
47
+ $pts: list.append($pts, _pct(50% + $r * math.cos($a)) _pct(50% + $r * math.sin($a)), comma);
48
+ }
49
+ @return polygon($pts);
50
+ }
51
+
52
+ .loading-indicator {
53
+ --md-comp-loading-indicator-active-indicator-size: 38px;
54
+ --md-comp-loading-indicator-container-size: 48px;
55
+ --md-comp-loading-indicator-active-indicator-color: var(--md-sys-color-primary);
56
+ --md-comp-loading-indicator-container-color: transparent;
57
+ --md-comp-loading-indicator-duration: 3000ms;
58
+
59
+ box-sizing: border-box;
60
+ display: inline-flex;
61
+ align-items: center;
62
+ justify-content: center;
63
+ width: var(--md-comp-loading-indicator-container-size);
64
+ height: var(--md-comp-loading-indicator-container-size);
65
+ border-radius: 50%;
66
+ background-color: var(--md-comp-loading-indicator-container-color);
67
+ vertical-align: middle;
68
+
69
+ &::before {
70
+ content: "";
71
+ display: block;
72
+ width: var(--md-comp-loading-indicator-active-indicator-size);
73
+ height: var(--md-comp-loading-indicator-active-indicator-size);
74
+ background-color: var(--md-comp-loading-indicator-active-indicator-color);
75
+ clip-path: _petal-shape(0, 0);
76
+ animation:
77
+ loading-indicator-morph var(--md-comp-loading-indicator-duration) ease-in-out infinite,
78
+ loading-indicator-spin var(--md-comp-loading-indicator-duration) linear infinite;
79
+ }
80
+
81
+ // Contained. M3 pairs the container with `on-secondary-container` for the
82
+ // indicator, not `primary` — the container is the louder surface.
83
+ &.contained {
84
+ --md-comp-loading-indicator-container-color: var(--md-sys-color-secondary-container);
85
+ --md-comp-loading-indicator-active-indicator-color: var(--md-sys-color-on-secondary-container);
86
+ }
87
+ }
88
+
89
+ @keyframes loading-indicator-morph {
90
+ 0%,
91
+ 100% { clip-path: _petal-shape(0, 0); }
92
+ 20% { clip-path: _petal-shape(4, 0.32); }
93
+ 40% { clip-path: _petal-shape(6, 0.26); }
94
+ 60% { clip-path: _petal-shape(8, 0.2); }
95
+ 80% { clip-path: _petal-shape(12, 0.14); }
96
+ }
97
+
98
+ @keyframes loading-indicator-spin {
99
+ to { transform: rotate(1turn); }
100
+ }
101
+
102
+ @media (prefers-reduced-motion: reduce) {
103
+ .loading-indicator::before {
104
+ animation: none;
105
+ }
106
+ }