@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
@@ -0,0 +1,193 @@
1
+ @use "../abstracts" as *;
2
+
3
+ // Side sheets.
4
+ //
5
+ // Anatomy is the HTML. A dialog.side-sheet (or .right / .left) is the
6
+ // surface, docked to the trailing edge by default. showModal() is the
7
+ // modal variant (scrim, rounded inner corners). show() is the standard
8
+ // variant (no scrim, a divider on the inner edge, page stays interactive).
9
+ //
10
+ // A <header> is the top bar: an optional back button, a heading, and a
11
+ // close control (form[method=dialog] with an icon button). Body content
12
+ // is a <div> or <p>. A last-child form[method=dialog] is the action row.
13
+ //
14
+ // Tokens follow https://m3.material.io/components/side-sheets
15
+ // container surface-container-low, 400dp, full height
16
+ // standard coplanar, 1dp outline-variant rule on the inner edge
17
+ // modal 28dp inner corners, elevation 1, scrim
18
+ // header 64dp, title-large, 24dp inset, 48dp icon buttons
19
+ // actions 16dp pad, outline-variant rule above
20
+ //
21
+ // Standard is for large windows next to the main pane. Modal is for
22
+ // compact/medium, or whenever the sheet should interrupt.
23
+
24
+ $_sheet: "dialog.side-sheet, dialog.right, dialog.right-sheet, dialog.left, dialog.left-sheet";
25
+
26
+ #{$_sheet} {
27
+ --md-comp-side-sheet-container-color: var(--md-sys-color-surface-container-low);
28
+ --md-comp-side-sheet-container-shape: 28px;
29
+ --md-comp-side-sheet-container-width: 400px;
30
+ --md-comp-side-sheet-shift: 0px;
31
+
32
+ box-sizing: border-box;
33
+ position: fixed;
34
+ float: none !important;
35
+ inset-block: 0;
36
+ inset-inline-start: auto;
37
+ inset-inline-end: 0;
38
+ width: min(var(--md-comp-side-sheet-container-width), 85%);
39
+ max-width: var(--md-comp-side-sheet-container-width);
40
+ height: auto;
41
+ max-height: none;
42
+ min-width: 0;
43
+ min-height: 0;
44
+ margin: 0;
45
+ padding: 0;
46
+ border: none;
47
+ background-color: var(--md-comp-side-sheet-container-color);
48
+ color: var(--md-sys-color-on-surface);
49
+ outline: none;
50
+ translate: var(--md-comp-side-sheet-shift) 0;
51
+ transition: translate 280ms ease, border-radius 200ms ease;
52
+
53
+ &:not(:modal) {
54
+ z-index: 1100;
55
+ border-radius: 0;
56
+ box-shadow: none;
57
+ // Standard: attached to the page, inner edge is a divider.
58
+ border-inline-start: 1px solid var(--md-sys-color-outline-variant);
59
+ }
60
+
61
+ &:modal {
62
+ border-radius: var(--md-comp-side-sheet-container-shape) 0 0
63
+ var(--md-comp-side-sheet-container-shape);
64
+ @include z-depth("1");
65
+ }
66
+
67
+ &:not(:modal)::backdrop {
68
+ background: none;
69
+ backdrop-filter: none;
70
+ }
71
+
72
+ // Leading-edge dock.
73
+ &.left,
74
+ &.left-sheet,
75
+ &.start {
76
+ inset-inline-start: 0;
77
+ inset-inline-end: auto;
78
+
79
+ &:not(:modal) {
80
+ border-inline-start: 0;
81
+ border-inline-end: 1px solid var(--md-sys-color-outline-variant);
82
+ }
83
+
84
+ &:modal {
85
+ border-radius: 0 var(--md-comp-side-sheet-container-shape)
86
+ var(--md-comp-side-sheet-container-shape) 0;
87
+ }
88
+ }
89
+
90
+ > header {
91
+ display: flex;
92
+ align-items: center;
93
+ gap: 12px;
94
+ flex: 0 0 auto;
95
+ box-sizing: border-box;
96
+ min-height: 64px;
97
+ margin: 0;
98
+ padding: 8px 12px 8px 24px;
99
+ background: none;
100
+ box-shadow: none;
101
+ }
102
+
103
+ > header:has(> :is(button, a):first-child) {
104
+ padding-inline-start: 8px;
105
+ }
106
+
107
+ > header > :is(h1, h2, h3, h4, h5, h6) {
108
+ flex: 1 1 auto;
109
+ min-width: 0;
110
+ margin: 0;
111
+ padding: 0;
112
+ color: var(--md-sys-color-on-surface);
113
+ @include typescale("title-large");
114
+ }
115
+
116
+ > header > form {
117
+ display: flex;
118
+ flex: 0 0 auto;
119
+ align-items: center;
120
+ margin: 0;
121
+ padding: 0;
122
+ border: 0;
123
+ background: none;
124
+ box-shadow: none;
125
+ }
126
+
127
+ > header :is(button, a.button) {
128
+ flex: 0 0 48px;
129
+ box-sizing: border-box;
130
+ width: 48px;
131
+ height: 48px;
132
+ min-width: 48px;
133
+ padding: 0;
134
+ border: none;
135
+ border-radius: 50%;
136
+ background-color: transparent;
137
+ color: var(--md-sys-color-on-surface-variant);
138
+ box-shadow: none;
139
+
140
+ > i {
141
+ font-size: 24px;
142
+ width: 24px;
143
+ height: 24px;
144
+ line-height: 24px;
145
+ }
146
+
147
+ &:hover {
148
+ background-color: color-mix(in oklab, var(--md-sys-color-on-surface) 8%, transparent);
149
+ }
150
+
151
+ &:focus-visible {
152
+ outline: 3px solid var(--md-sys-color-secondary);
153
+ outline-offset: 2px;
154
+ }
155
+ }
156
+
157
+ > :is(form, nav):last-child {
158
+ justify-content: flex-start;
159
+ gap: 8px;
160
+ padding: 16px 24px;
161
+ border-block-start: 1px solid var(--md-sys-color-outline-variant);
162
+ }
163
+ }
164
+
165
+ // :is() so [open] applies to every alternative. `#{$_sheet}[open]` only
166
+ // suffixes the last selector and would paint a closed .side-sheet.
167
+ :is(#{$_sheet}):not([open]) {
168
+ display: none;
169
+ }
170
+
171
+ :is(#{$_sheet})[open] {
172
+ display: flex;
173
+ flex-direction: column;
174
+ }
175
+
176
+ @starting-style {
177
+ dialog.side-sheet[open],
178
+ dialog.right[open],
179
+ dialog.right-sheet[open] {
180
+ translate: 100% 0;
181
+ }
182
+
183
+ dialog.left[open],
184
+ dialog.left-sheet[open] {
185
+ translate: -100% 0;
186
+ }
187
+ }
188
+
189
+ @media (prefers-reduced-motion: reduce) {
190
+ #{$_sheet} {
191
+ transition: none;
192
+ }
193
+ }