@stackific/md3 0.1.1 → 0.1.3

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 (114) hide show
  1. package/README.md +2486 -191
  2. package/dist/internal.md +274 -0
  3. package/dist/md3.css +1 -1
  4. package/dist/md3.js +1 -1
  5. package/package.json +1 -3
  6. package/src/main.js +0 -5
  7. package/src/runtime/elements/dialogs.js +0 -72
  8. package/src/runtime/elements/fields.js +0 -181
  9. package/src/runtime/elements/menus.js +0 -42
  10. package/src/runtime/elements/pages.js +0 -7
  11. package/src/runtime/elements/progress.js +0 -35
  12. package/src/runtime/elements/sliders.js +0 -78
  13. package/src/runtime/elements/snackbars.js +0 -27
  14. package/src/runtime/helpers/ripples.js +0 -46
  15. package/src/runtime/md3.js +0 -141
  16. package/src/runtime/palette.js +0 -64
  17. package/src/runtime/settings/theme.js +0 -194
  18. package/src/runtime/utils.js +0 -165
  19. package/src/styles/_config.scss +0 -142
  20. package/src/styles/_mixins.scss +0 -80
  21. package/src/styles/elements/_badges.scss +0 -65
  22. package/src/styles/elements/_bars.scss +0 -83
  23. package/src/styles/elements/_buttons.scss +0 -119
  24. package/src/styles/elements/_cards.scss +0 -32
  25. package/src/styles/elements/_chips.scss +0 -46
  26. package/src/styles/elements/_dialogs.scss +0 -143
  27. package/src/styles/elements/_dividers.scss +0 -46
  28. package/src/styles/elements/_expansions.scss +0 -19
  29. package/src/styles/elements/_fields.scss +0 -458
  30. package/src/styles/elements/_grids.scss +0 -35
  31. package/src/styles/elements/_icons.scss +0 -70
  32. package/src/styles/elements/_layouts.scss +0 -24
  33. package/src/styles/elements/_lists.scss +0 -76
  34. package/src/styles/elements/_main-layouts.scss +0 -45
  35. package/src/styles/elements/_media.scss +0 -104
  36. package/src/styles/elements/_menus.scss +0 -289
  37. package/src/styles/elements/_navigations.scss +0 -450
  38. package/src/styles/elements/_overlays.scss +0 -34
  39. package/src/styles/elements/_pages.scss +0 -28
  40. package/src/styles/elements/_progress.scss +0 -141
  41. package/src/styles/elements/_selections.scss +0 -248
  42. package/src/styles/elements/_shapes.scss +0 -153
  43. package/src/styles/elements/_sliders.scss +0 -336
  44. package/src/styles/elements/_snackbars.scss +0 -44
  45. package/src/styles/elements/_tables.scss +0 -67
  46. package/src/styles/elements/_tabs.scss +0 -49
  47. package/src/styles/elements/_tooltips.scss +0 -125
  48. package/src/styles/fonts/material-symbols-outlined.woff2 +0 -0
  49. package/src/styles/fonts/material-symbols-rounded.woff2 +0 -0
  50. package/src/styles/fonts/material-symbols-sharp.woff2 +0 -0
  51. package/src/styles/fonts/material-symbols-subset.woff2 +0 -0
  52. package/src/styles/helpers/_alignments.scss +0 -29
  53. package/src/styles/helpers/_blurs.scss +0 -26
  54. package/src/styles/helpers/_colors.scss +0 -39
  55. package/src/styles/helpers/_directions.scss +0 -30
  56. package/src/styles/helpers/_elevates.scss +0 -20
  57. package/src/styles/helpers/_forms.scss +0 -76
  58. package/src/styles/helpers/_margins.scss +0 -39
  59. package/src/styles/helpers/_opacities.scss +0 -18
  60. package/src/styles/helpers/_paddings.scss +0 -35
  61. package/src/styles/helpers/_positions.scss +0 -44
  62. package/src/styles/helpers/_responsive.scss +0 -24
  63. package/src/styles/helpers/_ripples.scss +0 -40
  64. package/src/styles/helpers/_scrolls.scss +0 -7
  65. package/src/styles/helpers/_shadows.scss +0 -22
  66. package/src/styles/helpers/_sizes.scss +0 -34
  67. package/src/styles/helpers/_spaces.scss +0 -22
  68. package/src/styles/helpers/_typography.scss +0 -132
  69. package/src/styles/helpers/_waves.scss +0 -52
  70. package/src/styles/helpers/_zoom.scss +0 -18
  71. package/src/styles/md3.scss +0 -61
  72. package/src/styles/settings/_fonts.scss +0 -41
  73. package/src/styles/settings/_globals.scss +0 -104
  74. package/src/styles/settings/_reset.scss +0 -82
  75. package/src/styles/settings/_theme.scss +0 -126
  76. package/src/styles/settings/_themes.scss +0 -1525
  77. package/src/styles/shapes/arch.svg +0 -1
  78. package/src/styles/shapes/arrow.svg +0 -1
  79. package/src/styles/shapes/boom.svg +0 -1
  80. package/src/styles/shapes/bun.svg +0 -1
  81. package/src/styles/shapes/burst.svg +0 -1
  82. package/src/styles/shapes/circle.svg +0 -1
  83. package/src/styles/shapes/clamshell.svg +0 -1
  84. package/src/styles/shapes/diamond.svg +0 -1
  85. package/src/styles/shapes/fan.svg +0 -1
  86. package/src/styles/shapes/flower.svg +0 -1
  87. package/src/styles/shapes/gem.svg +0 -1
  88. package/src/styles/shapes/ghost-ish.svg +0 -1
  89. package/src/styles/shapes/heart.svg +0 -1
  90. package/src/styles/shapes/leaf-clover4.svg +0 -1
  91. package/src/styles/shapes/leaf-clover8.svg +0 -1
  92. package/src/styles/shapes/loading-indicator.svg +0 -1
  93. package/src/styles/shapes/oval.svg +0 -1
  94. package/src/styles/shapes/pentagon.svg +0 -1
  95. package/src/styles/shapes/pill.svg +0 -1
  96. package/src/styles/shapes/pixel-circle.svg +0 -1
  97. package/src/styles/shapes/pixel-triangle.svg +0 -1
  98. package/src/styles/shapes/puffy-diamond.svg +0 -1
  99. package/src/styles/shapes/puffy.svg +0 -1
  100. package/src/styles/shapes/semicircle.svg +0 -1
  101. package/src/styles/shapes/sided-cookie12.svg +0 -1
  102. package/src/styles/shapes/sided-cookie4.svg +0 -1
  103. package/src/styles/shapes/sided-cookie6.svg +0 -1
  104. package/src/styles/shapes/sided-cookie7.svg +0 -1
  105. package/src/styles/shapes/sided-cookie9.svg +0 -1
  106. package/src/styles/shapes/slanted.svg +0 -1
  107. package/src/styles/shapes/soft-boom.svg +0 -1
  108. package/src/styles/shapes/soft-burst.svg +0 -1
  109. package/src/styles/shapes/square.svg +0 -1
  110. package/src/styles/shapes/sunny.svg +0 -1
  111. package/src/styles/shapes/triangle.svg +0 -1
  112. package/src/styles/shapes/very-sunny.svg +0 -1
  113. package/src/styles/shapes/wavy-circle.svg +0 -1
  114. package/src/styles/shapes/wavy.svg +0 -1
@@ -1,248 +0,0 @@
1
- // .checkbox / .radio / .switch — all three share size-scaling and focus/hover ripples.
2
-
3
- .checkbox,
4
- .radio,
5
- .switch {
6
- --_size: 1.5rem;
7
- inline-size: auto;
8
- block-size: auto;
9
- line-height: normal;
10
- white-space: nowrap;
11
- cursor: pointer;
12
- display: inline-flex;
13
- align-items: center;
14
- }
15
-
16
- .switch {
17
- direction: ltr;
18
- }
19
-
20
- $-selection-sizes: (
21
- "small": 1rem,
22
- "large": 2rem,
23
- "extra": 2.5rem,
24
- );
25
-
26
- @each $name, $value in $-selection-sizes {
27
- :is(.checkbox, .radio, .switch).#{$name} {
28
- --_size: #{$value};
29
- }
30
- }
31
-
32
- :is(.checkbox, .radio) > input {
33
- inline-size: var(--_size);
34
- block-size: var(--_size);
35
- opacity: 0;
36
- }
37
-
38
- .switch > input {
39
- inline-size: 3.25rem;
40
- block-size: 2rem;
41
- opacity: 0;
42
- }
43
-
44
- :is(.checkbox, .radio, .switch) > span {
45
- display: inline-flex;
46
- align-items: center;
47
- color: var(--on-surface);
48
- font-size: 0.875rem;
49
- }
50
-
51
- :is(.checkbox, .radio) > span:not(:empty) {
52
- padding-inline-start: 0.25rem;
53
- }
54
-
55
- :is(.checkbox, .radio, .switch) > span::before,
56
- :is(.checkbox, .radio, .switch) > span > i,
57
- :is(.checkbox, .radio) > span::after {
58
- --_size: inherit;
59
- content: "";
60
- inline-size: var(--_size);
61
- block-size: var(--_size);
62
- box-sizing: border-box;
63
- margin: 0 auto;
64
- outline: none;
65
- color: var(--primary);
66
- position: absolute;
67
- inset: auto auto auto calc(var(--_size, 0) * -1);
68
- border-radius: 50%;
69
- user-select: none;
70
- z-index: 1;
71
- }
72
-
73
- [dir="rtl"] :is(.checkbox, .radio) > span::before,
74
- [dir="rtl"] :is(.checkbox, .radio) > span > i,
75
- [dir="rtl"] :is(.checkbox, .radio) > span::after {
76
- --_size: inherit;
77
- inset: auto calc(var(--_size, 0) * -1) auto auto;
78
- }
79
-
80
- .switch > span::before,
81
- .switch.icon > span > i {
82
- position: absolute;
83
- inset: 50% auto auto 0;
84
- display: inline-flex;
85
- align-items: center;
86
- justify-content: center;
87
- border-radius: 50%;
88
- transition: all var(--speed2);
89
- font-size: calc(var(--_size, 0) - 0.5rem);
90
- user-select: none;
91
- min-inline-size: var(--_size);
92
- min-block-size: var(--_size);
93
- content: "";
94
- color: var(--surface-variant);
95
- background-color: var(--outline);
96
- }
97
-
98
- .switch > span::before,
99
- .switch.icon > span > i {
100
- transform: translate(-3rem, -50%) scale(0.6);
101
- }
102
-
103
- .switch.icon > span > i {
104
- transform: translate(-3rem, -50%) scale(1);
105
- }
106
-
107
- // icon glyphs per control
108
- .checkbox > span::before { content: "check_box_outline_blank"; }
109
- .checkbox > input:checked + span::before {
110
- content: "check_box";
111
- font-variation-settings: "FILL" 1;
112
- }
113
- .checkbox > input:indeterminate + span::before { content: "indeterminate_check_box"; }
114
-
115
- .radio > span::before { content: "radio_button_unchecked"; }
116
- .radio > input:checked + span::before { content: "radio_button_checked"; }
117
-
118
- :is(.radio, .checkbox, .switch).icon > span::before {
119
- content: "" !important;
120
- font-variation-settings: unset !important;
121
- }
122
-
123
- :is(.checkbox, .radio) > span::after {
124
- transition: all var(--speed1);
125
- background-color: currentColor;
126
- box-shadow: 0 0 0 0 currentColor;
127
- opacity: 0;
128
- }
129
-
130
- :is(.checkbox, .radio):is(:hover) > input:not(:disabled) + span::after,
131
- :is(.checkbox, .radio) > input:not(:disabled):is(:focus) + span::after {
132
- box-shadow: 0 0 0 0.5rem currentColor;
133
- opacity: 0.1;
134
- }
135
-
136
- .switch > input:not(:disabled):is(:focus, :hover) + span::before,
137
- .switch.icon > input:not(:disabled):is(:focus, :hover) + span > i {
138
- box-shadow: 0 0 0 0.5rem var(--active);
139
- }
140
-
141
- :is(.checkbox, .radio) > input:checked + span::before,
142
- :is(.checkbox, .radio).icon > input:checked + span > i {
143
- color: var(--primary);
144
- }
145
-
146
- .icon > input:checked + span > i:first-child,
147
- .icon > span > i:last-child {
148
- opacity: 0;
149
- }
150
-
151
- .icon > input:checked + span > i:last-child,
152
- .icon > span > i:first-child {
153
- opacity: 1;
154
- }
155
-
156
- .switch > input:checked + span::after {
157
- border: none;
158
- background-color: var(--primary);
159
- }
160
-
161
- .switch > input:checked + span::before,
162
- .switch.icon > input:checked + span > i {
163
- content: "check";
164
- color: var(--primary);
165
- background-color: var(--on-primary);
166
- transform: translate(-1.75rem, -50%) scale(1);
167
- }
168
-
169
- [dir="rtl"] .switch > input:checked + span::before,
170
- [dir="rtl"] .switch.icon > input:checked + span > i {
171
- transform: translate(-1.75rem, -50%) scale(-1);
172
- }
173
-
174
- .switch > input:active:not(:disabled) + span::before,
175
- .switch.icon > input:active:not(:disabled) + span > i {
176
- transform: translate(-3rem, -50%) scale(1.2);
177
- }
178
-
179
- [dir="rtl"] .switch > input:active:not(:disabled) + span::before,
180
- [dir="rtl"] .switch.icon > input:active:not(:disabled) + span > i {
181
- transform: translate(-3rem, -50%) scale(-1.2);
182
- }
183
-
184
- .switch > input:active:checked:not(:disabled) + span::before,
185
- .switch.icon > input:active:checked:not(:disabled) + span > i {
186
- transform: translate(-1.75rem, -50%) scale(1.2);
187
- }
188
-
189
- [dir="rtl"] .switch > input:active:checked:not(:disabled) + span::before,
190
- [dir="rtl"] .switch.icon > input:active:checked:not(:disabled) + span > i {
191
- transform: translate(-1.75rem, -50%) scale(-1.2);
192
- }
193
-
194
- :is(.checkbox, .radio, .switch) > input:disabled + span {
195
- opacity: 0.5;
196
- cursor: not-allowed;
197
- }
198
-
199
- .switch > span::after {
200
- content: "";
201
- position: absolute;
202
- inset: 50% auto auto 0;
203
- background-color: var(--active);
204
- border: 0.125rem solid var(--outline);
205
- box-sizing: border-box;
206
- inline-size: 3.25rem;
207
- block-size: 2rem;
208
- border-radius: 2rem;
209
- transform: translate(-3.25rem, -50%);
210
- }
211
-
212
- .field > :is(nav, .row) {
213
- flex-grow: 1;
214
- padding: 0 1rem;
215
- }
216
-
217
- .field.round > :is(nav, .row) {
218
- flex-grow: 1;
219
- padding: 0 1.5rem;
220
- }
221
-
222
- [dir="rtl"] .switch {
223
- transform: scale(-1);
224
- }
225
-
226
- [dir="rtl"] .switch > span::before,
227
- [dir="rtl"] .switch.icon > span > i {
228
- transform: translate(-3rem, -50%) scale(-0.6);
229
- }
230
-
231
- [dir="rtl"] .switch.icon > span > i {
232
- transform: translate(-3rem, -50%) scale(-1);
233
- }
234
-
235
- [dir="rtl"] .switch > input:checked + span::before,
236
- [dir="rtl"] .switch.icon > input:checked + span > i {
237
- transform: translate(-1.75rem, -50%) scale(-1);
238
- }
239
-
240
- .switch > :focus-visible + span::after {
241
- outline: 0.125rem solid var(--primary);
242
- outline-offset: 0.25rem;
243
- }
244
-
245
- :is(.checkbox, .radio) > :focus-visible + span::before {
246
- outline: 0.125rem solid var(--primary);
247
- outline-offset: 0.375rem;
248
- }
@@ -1,153 +0,0 @@
1
- // .shape — SVG-masked decorative shape. Each variant points at a sibling SVG
2
- // in src/styles/shapes/ via a relative URL so Vite (and any consumer's
3
- // bundler) fingerprints and emits it alongside md3.css.
4
- // One @each over $-shapes replaces ~40 hand-written mask-image rules in upstream.
5
-
6
- @use "sass:list";
7
-
8
- .shape {
9
- display: flex;
10
- align-items: center;
11
- justify-content: center;
12
- color: var(--on-primary);
13
- background-color: var(--primary);
14
- mask-repeat: no-repeat;
15
- mask-position: center;
16
- mask-size: contain;
17
- border-radius: 0;
18
- block-size: 3.5rem;
19
- inline-size: 3.5rem;
20
- margin: 0 !important;
21
- padding: 0 !important;
22
- border: 0 !important;
23
- }
24
-
25
- .transparent > .shape > i {
26
- filter: invert(1);
27
- }
28
-
29
- $-shape-mask-sizes: (
30
- "tiny-space": 90%,
31
- "space": 80%,
32
- "small-space": 80%,
33
- "medium-space": 70%,
34
- "large-space": 60%,
35
- "extra-space": 50%,
36
- );
37
-
38
- @each $name, $value in $-shape-mask-sizes {
39
- .shape.#{$name} { mask-size: $value; }
40
- }
41
-
42
- $-shape-sizes: (
43
- "tiny": 2.5rem,
44
- "medium": 4.5rem,
45
- "large": 5.5rem,
46
- "extra": 6.5rem,
47
- );
48
-
49
- @each $name, $value in $-shape-sizes {
50
- .shape.#{$name} {
51
- block-size: $value;
52
- inline-size: $value;
53
- }
54
- }
55
-
56
- .shape.max,
57
- .shape > .responsive,
58
- .shape > .responsive > .responsive {
59
- position: absolute;
60
- inset: 0;
61
- block-size: 100%;
62
- inline-size: 100%;
63
- margin: 0 !important;
64
- padding: 0 !important;
65
- border: 0 !important;
66
- }
67
-
68
- .shape > .responsive {
69
- background: inherit;
70
- color: inherit;
71
- }
72
-
73
- $-shape-rotations: (
74
- "": 12s,
75
- "fast": 6s,
76
- "slow": 24s,
77
- );
78
-
79
- @each $name, $duration in $-shape-rotations {
80
- @if $name == "" {
81
- .shape.rotate {
82
- animation: linear to-rotate infinite #{$duration};
83
-
84
- > * {
85
- animation: linear to-rotate infinite #{$duration} reverse;
86
- }
87
- }
88
- } @else {
89
- .shape.#{$name}-rotate {
90
- animation: linear to-rotate infinite #{$duration};
91
-
92
- > * {
93
- animation: linear to-rotate infinite #{$duration} reverse;
94
- }
95
- }
96
- }
97
- }
98
-
99
- :is(button, .button, .chip):has(> .shape) > .responsive {
100
- border: none;
101
- }
102
-
103
- // All shape mask images. Note: `leaft-clover8` is a verbatim typo from upstream
104
- // (the file is `leaf-clover8.svg`) — preserved for 1:1 class-name parity.
105
- // Each entry is (class-name, file-stem). They diverge only for "leaft-clover8"
106
- // → leaf-clover8.svg (verbatim typo from upstream).
107
- $-shapes: (
108
- ("arch", "arch"),
109
- ("arrow", "arrow"),
110
- ("boom", "boom"),
111
- ("bun", "bun"),
112
- ("burst", "burst"),
113
- ("circle", "circle"),
114
- ("clamshell", "clamshell"),
115
- ("diamond", "diamond"),
116
- ("fan", "fan"),
117
- ("flower", "flower"),
118
- ("gem", "gem"),
119
- ("ghost-ish", "ghost-ish"),
120
- ("heart", "heart"),
121
- ("leaf-clover4", "leaf-clover4"),
122
- ("leaft-clover8", "leaf-clover8"),
123
- ("loading-indicator", "loading-indicator"),
124
- ("oval", "oval"),
125
- ("pentagon", "pentagon"),
126
- ("pill", "pill"),
127
- ("pixel-circle", "pixel-circle"),
128
- ("pixel-triangle", "pixel-triangle"),
129
- ("puffy", "puffy"),
130
- ("puffy-diamond", "puffy-diamond"),
131
- ("semicircle", "semicircle"),
132
- ("sided-cookie4", "sided-cookie4"),
133
- ("sided-cookie6", "sided-cookie6"),
134
- ("sided-cookie7", "sided-cookie7"),
135
- ("sided-cookie9", "sided-cookie9"),
136
- ("sided-cookie12", "sided-cookie12"),
137
- ("slanted", "slanted"),
138
- ("soft-boom", "soft-boom"),
139
- ("soft-burst", "soft-burst"),
140
- ("square", "square"),
141
- ("sunny", "sunny"),
142
- ("triangle", "triangle"),
143
- ("very-sunny", "very-sunny"),
144
- );
145
-
146
- @each $entry in $-shapes {
147
- $class: list.nth($entry, 1);
148
- $file: list.nth($entry, 2);
149
-
150
- .shape.#{$class} {
151
- mask-image: url("./shapes/#{$file}.svg");
152
- }
153
- }