mtrl 0.7.0 → 0.8.0-next.4
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.
- package/dist/components/button/api.d.ts +4 -0
- package/dist/components/button/features/toggle.d.ts +42 -0
- package/dist/components/button/types.d.ts +30 -0
- package/dist/components/button-group/button-group.d.ts +6 -4
- package/dist/components/button-group/config.d.ts +15 -7
- package/dist/components/button-group/constants.d.ts +85 -17
- package/dist/components/button-group/index.d.ts +1 -1
- package/dist/components/button-group/types.d.ts +68 -4
- package/dist/components/carousel/api.d.ts +11 -30
- package/dist/components/carousel/arrangement.d.ts +23 -0
- package/dist/components/carousel/carousel.d.ts +13 -63
- package/dist/components/carousel/config.d.ts +2 -31
- package/dist/components/carousel/constants.d.ts +25 -151
- package/dist/components/carousel/features/index.d.ts +2 -5
- package/dist/components/carousel/features/scroll.d.ts +19 -0
- package/dist/components/carousel/features/slides.d.ts +18 -8
- package/dist/components/carousel/index.d.ts +3 -37
- package/dist/components/carousel/keylines.d.ts +65 -0
- package/dist/components/carousel/strategy.d.ts +36 -0
- package/dist/components/carousel/types.d.ts +36 -242
- package/dist/components/dialog/api.d.ts +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/slider/constants.d.ts +8 -8
- package/dist/components/slider/types.d.ts +4 -1
- package/dist/components/snackbar/api.d.ts +1 -1
- package/dist/components/snackbar/config.d.ts +2 -1
- package/dist/components/snackbar/constants.d.ts +18 -0
- package/dist/components/snackbar/index.d.ts +2 -1
- package/dist/components/snackbar/queue.d.ts +10 -2
- package/dist/components/snackbar/types.d.ts +37 -1
- package/dist/index.cjs +20 -10
- package/dist/index.cjs.map +54 -38
- package/dist/index.js +20 -10
- package/dist/index.js.map +54 -38
- package/dist/package.json +1 -1
- package/dist/styles.css +2 -2
- package/package.json +3 -6
- package/src/styles/abstract/_theme.scss +4 -2
- package/src/styles/abstract/_variables.scss +59 -12
- package/src/styles/components/_button-group.scss +122 -349
- package/src/styles/components/_button.scss +333 -591
- package/src/styles/components/_carousel.scss +131 -611
- package/src/styles/components/_icon-button.scss +23 -23
- package/src/styles/components/_select.scss +9 -1
- package/src/styles/components/_slider.scss +10 -9
- package/src/styles/themes/_index.scss +1 -0
- package/src/styles/themes/_legacy.scss +73 -0
- package/dist/components/carousel/features/drag.d.ts +0 -8
|
@@ -122,7 +122,7 @@ $widths: (
|
|
|
122
122
|
height: get-size("s", container);
|
|
123
123
|
|
|
124
124
|
// Default shape (round - full radius)
|
|
125
|
-
border-radius: 50
|
|
125
|
+
border-radius: var(--#{base.$prefix}-button-shape, 50%);
|
|
126
126
|
|
|
127
127
|
// Smooth transitions for shape morphing
|
|
128
128
|
transition:
|
|
@@ -262,69 +262,69 @@ $widths: (
|
|
|
262
262
|
|
|
263
263
|
// Round is default (50% radius)
|
|
264
264
|
&--round {
|
|
265
|
-
border-radius: 50
|
|
265
|
+
border-radius: var(--#{base.$prefix}-button-shape, 50%);
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
// Square shape with size-specific corner radius
|
|
269
269
|
&--square {
|
|
270
|
-
border-radius: get-size("s", square-radius);
|
|
270
|
+
border-radius: var(--#{base.$prefix}-button-shape, get-size("s", square-radius));
|
|
271
271
|
|
|
272
272
|
&.#{$component}--xs {
|
|
273
|
-
border-radius: get-size("xs", square-radius);
|
|
273
|
+
border-radius: var(--#{base.$prefix}-button-shape, get-size("xs", square-radius));
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
&.#{$component}--m {
|
|
277
|
-
border-radius: get-size("m", square-radius);
|
|
277
|
+
border-radius: var(--#{base.$prefix}-button-shape, get-size("m", square-radius));
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
&.#{$component}--l {
|
|
281
|
-
border-radius: get-size("l", square-radius);
|
|
281
|
+
border-radius: var(--#{base.$prefix}-button-shape, get-size("l", square-radius));
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
&.#{$component}--xl {
|
|
285
|
-
border-radius: get-size("xl", square-radius);
|
|
285
|
+
border-radius: var(--#{base.$prefix}-button-shape, get-size("xl", square-radius));
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
// Shape morph on press - both round and square morph to pressed radius
|
|
290
290
|
&:active {
|
|
291
291
|
&.#{$component}--round {
|
|
292
|
-
border-radius: get-size("s", pressed-radius);
|
|
292
|
+
border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("s", pressed-radius));
|
|
293
293
|
|
|
294
294
|
&.#{$component}--xs {
|
|
295
|
-
border-radius: get-size("xs", pressed-radius);
|
|
295
|
+
border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("xs", pressed-radius));
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
&.#{$component}--m {
|
|
299
|
-
border-radius: get-size("m", pressed-radius);
|
|
299
|
+
border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("m", pressed-radius));
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
&.#{$component}--l {
|
|
303
|
-
border-radius: get-size("l", pressed-radius);
|
|
303
|
+
border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("l", pressed-radius));
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
&.#{$component}--xl {
|
|
307
|
-
border-radius: get-size("xl", pressed-radius);
|
|
307
|
+
border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("xl", pressed-radius));
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
&.#{$component}--square {
|
|
312
|
-
border-radius: get-size("s", pressed-radius);
|
|
312
|
+
border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("s", pressed-radius));
|
|
313
313
|
|
|
314
314
|
&.#{$component}--xs {
|
|
315
|
-
border-radius: get-size("xs", pressed-radius);
|
|
315
|
+
border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("xs", pressed-radius));
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
&.#{$component}--m {
|
|
319
|
-
border-radius: get-size("m", pressed-radius);
|
|
319
|
+
border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("m", pressed-radius));
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
&.#{$component}--l {
|
|
323
|
-
border-radius: get-size("l", pressed-radius);
|
|
323
|
+
border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("l", pressed-radius));
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
&.#{$component}--xl {
|
|
327
|
-
border-radius: get-size("xl", pressed-radius);
|
|
327
|
+
border-radius: var(--#{base.$prefix}-button-shape-pressed, get-size("xl", pressed-radius));
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
}
|
|
@@ -492,28 +492,28 @@ $widths: (
|
|
|
492
492
|
&--selected {
|
|
493
493
|
// Round buttons become square when selected
|
|
494
494
|
&.#{$component}--round:not(:active) {
|
|
495
|
-
border-radius: get-size("s", square-radius);
|
|
495
|
+
border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("s", square-radius));
|
|
496
496
|
|
|
497
497
|
&.#{$component}--xs {
|
|
498
|
-
border-radius: get-size("xs", square-radius);
|
|
498
|
+
border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("xs", square-radius));
|
|
499
499
|
}
|
|
500
500
|
|
|
501
501
|
&.#{$component}--m {
|
|
502
|
-
border-radius: get-size("m", square-radius);
|
|
502
|
+
border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("m", square-radius));
|
|
503
503
|
}
|
|
504
504
|
|
|
505
505
|
&.#{$component}--l {
|
|
506
|
-
border-radius: get-size("l", square-radius);
|
|
506
|
+
border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("l", square-radius));
|
|
507
507
|
}
|
|
508
508
|
|
|
509
509
|
&.#{$component}--xl {
|
|
510
|
-
border-radius: get-size("xl", square-radius);
|
|
510
|
+
border-radius: var(--#{base.$prefix}-button-shape-selected, get-size("xl", square-radius));
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
513
|
|
|
514
514
|
// Square buttons become round when selected
|
|
515
515
|
&.#{$component}--square:not(:active) {
|
|
516
|
-
border-radius: 50
|
|
516
|
+
border-radius: var(--#{base.$prefix}-button-shape-selected, 50%);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
|
|
@@ -53,7 +53,15 @@ $component: "#{base.$prefix}-select";
|
|
|
53
53
|
|
|
54
54
|
// State when menu is open
|
|
55
55
|
&--open {
|
|
56
|
-
z-index:
|
|
56
|
+
z-index: f.get-z-index("menu");
|
|
57
|
+
|
|
58
|
+
// Transparent scrim covering the viewport to block pointer events
|
|
59
|
+
// on elements behind the open dropdown
|
|
60
|
+
&::before {
|
|
61
|
+
content: "";
|
|
62
|
+
position: fixed;
|
|
63
|
+
inset: 0;
|
|
64
|
+
}
|
|
57
65
|
|
|
58
66
|
// These styles handle the focused state when the menu is open
|
|
59
67
|
.#{base.$prefix}-textfield--filled {
|
|
@@ -113,7 +113,8 @@ $component: '#{base.$prefix}-slider';
|
|
|
113
113
|
position: absolute;
|
|
114
114
|
width: 4px;
|
|
115
115
|
height: calc(100% - 8px);
|
|
116
|
-
|
|
116
|
+
// --mtrl-slider-color: the same per-slider override the canvas honours
|
|
117
|
+
background-color: var(--mtrl-slider-color, #{t.color('primary')});
|
|
117
118
|
border-radius: 2px;
|
|
118
119
|
left: 50%;
|
|
119
120
|
top: 50%;
|
|
@@ -121,11 +122,11 @@ $component: '#{base.$prefix}-slider';
|
|
|
121
122
|
transition: background-color 0.15s ease, opacity 0.15s ease, width 0.15s ease;
|
|
122
123
|
|
|
123
124
|
.#{$component}--secondary & {
|
|
124
|
-
background-color: t.color('secondary');
|
|
125
|
+
background-color: var(--mtrl-slider-color, #{t.color('secondary')});
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
.#{$component}--tertiary & {
|
|
128
|
-
background-color: t.color('tertiary');
|
|
129
|
+
background-color: var(--mtrl-slider-color, #{t.color('tertiary')});
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
.#{$component}--error & {
|
|
@@ -152,14 +153,14 @@ $component: '#{base.$prefix}-slider';
|
|
|
152
153
|
|
|
153
154
|
// Hover state
|
|
154
155
|
&:hover::before {
|
|
155
|
-
background-color: t.color('primary');
|
|
156
|
+
background-color: var(--mtrl-slider-color, #{t.color('primary')});
|
|
156
157
|
|
|
157
158
|
.#{$component}--secondary & {
|
|
158
|
-
background-color: t.color('secondary');
|
|
159
|
+
background-color: var(--mtrl-slider-color, #{t.color('secondary')});
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
.#{$component}--tertiary & {
|
|
162
|
-
background-color: t.color('tertiary');
|
|
163
|
+
background-color: var(--mtrl-slider-color, #{t.color('tertiary')});
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
.#{$component}--error & {
|
|
@@ -174,15 +175,15 @@ $component: '#{base.$prefix}-slider';
|
|
|
174
175
|
|
|
175
176
|
// Active state
|
|
176
177
|
&:active::before {
|
|
177
|
-
background-color: t.color('primary');
|
|
178
|
+
background-color: var(--mtrl-slider-color, #{t.color('primary')});
|
|
178
179
|
width: 3px; // Shrink width when active for visual feedback
|
|
179
180
|
|
|
180
181
|
.#{$component}--secondary & {
|
|
181
|
-
background-color: t.color('secondary');
|
|
182
|
+
background-color: var(--mtrl-slider-color, #{t.color('secondary')});
|
|
182
183
|
}
|
|
183
184
|
|
|
184
185
|
.#{$component}--tertiary & {
|
|
185
|
-
background-color: t.color('tertiary');
|
|
186
|
+
background-color: var(--mtrl-slider-color, #{t.color('tertiary')});
|
|
186
187
|
}
|
|
187
188
|
|
|
188
189
|
.#{$component}--error & {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// src/styles/themes/_legacy.scss
|
|
2
|
+
// Legacy: the Radiooooo v3 palette. Values are the v3 ones, set by hand:
|
|
3
|
+
// bar blue on primary, selection orange on tertiary, the salmon selected-mode
|
|
4
|
+
// disc on secondary (the M3 tonal toggle's selected colour), cream surfaces;
|
|
5
|
+
// dark mode uses the v3 blue-grey neutrals.
|
|
6
|
+
@use "../abstract/base" as *;
|
|
7
|
+
@use "base-theme" as *;
|
|
8
|
+
|
|
9
|
+
@include create-theme("legacy") {
|
|
10
|
+
// Key colors (light)
|
|
11
|
+
--#{$prefix}-sys-color-primary: #00489a;
|
|
12
|
+
--#{$prefix}-sys-color-on-primary: #ffffff;
|
|
13
|
+
--#{$prefix}-sys-color-primary-container: #d6e3ff;
|
|
14
|
+
--#{$prefix}-sys-color-on-primary-container: #001b3f;
|
|
15
|
+
--#{$prefix}-sys-color-secondary: #ea9d97;
|
|
16
|
+
--#{$prefix}-sys-color-on-secondary: #ffffff;
|
|
17
|
+
--#{$prefix}-sys-color-secondary-container: #ffdad6;
|
|
18
|
+
--#{$prefix}-sys-color-on-secondary-container: #3b0907;
|
|
19
|
+
--#{$prefix}-sys-color-tertiary: #ff3400;
|
|
20
|
+
--#{$prefix}-sys-color-on-tertiary: #ffffff;
|
|
21
|
+
--#{$prefix}-sys-color-tertiary-container: #ffd9cc;
|
|
22
|
+
--#{$prefix}-sys-color-on-tertiary-container: #3a0c00;
|
|
23
|
+
|
|
24
|
+
// Neutral colors (the v3 cream)
|
|
25
|
+
--#{$prefix}-sys-color-surface: #f7f4f0;
|
|
26
|
+
--#{$prefix}-sys-color-surface-dim: #d9d5d0;
|
|
27
|
+
--#{$prefix}-sys-color-surface-bright: #fbf9f6;
|
|
28
|
+
--#{$prefix}-sys-color-surface-container-lowest: #ffffff;
|
|
29
|
+
--#{$prefix}-sys-color-surface-container-low: #f3efea;
|
|
30
|
+
--#{$prefix}-sys-color-surface-container: #efeae4;
|
|
31
|
+
--#{$prefix}-sys-color-surface-container-high: #e8e3dd;
|
|
32
|
+
--#{$prefix}-sys-color-surface-container-highest: #e1dcd6;
|
|
33
|
+
--#{$prefix}-sys-color-on-surface: #1d1b19;
|
|
34
|
+
--#{$prefix}-sys-color-on-surface-variant: #4a4643;
|
|
35
|
+
--#{$prefix}-sys-color-outline: #7a7571;
|
|
36
|
+
--#{$prefix}-sys-color-outline-variant: #ccc6c0;
|
|
37
|
+
--#{$prefix}-sys-color-surface-rgb: 29, 27, 25;
|
|
38
|
+
|
|
39
|
+
@include status-colors-light();
|
|
40
|
+
|
|
41
|
+
&[data-theme-mode="dark"] {
|
|
42
|
+
// The bars keep the v3 blue in dark mode; buttons lighten for contrast.
|
|
43
|
+
--#{$prefix}-sys-color-primary: #7db4ff;
|
|
44
|
+
--#{$prefix}-sys-color-on-primary: #002a63;
|
|
45
|
+
--#{$prefix}-sys-color-primary-container: #00489a;
|
|
46
|
+
--#{$prefix}-sys-color-on-primary-container: #ffffff;
|
|
47
|
+
--#{$prefix}-sys-color-secondary: #e08e88;
|
|
48
|
+
--#{$prefix}-sys-color-on-secondary: #3b0907;
|
|
49
|
+
--#{$prefix}-sys-color-secondary-container: #7a3a35;
|
|
50
|
+
--#{$prefix}-sys-color-on-secondary-container: #ffdad6;
|
|
51
|
+
--#{$prefix}-sys-color-tertiary: #ff5c2e;
|
|
52
|
+
--#{$prefix}-sys-color-on-tertiary: #ffffff;
|
|
53
|
+
--#{$prefix}-sys-color-tertiary-container: #8a1c00;
|
|
54
|
+
--#{$prefix}-sys-color-on-tertiary-container: #ffd9cc;
|
|
55
|
+
|
|
56
|
+
// v3 dark: blue-grey neutrals (background #262631, bars #363644)
|
|
57
|
+
--#{$prefix}-sys-color-surface: #262631;
|
|
58
|
+
--#{$prefix}-sys-color-surface-dim: #262631;
|
|
59
|
+
--#{$prefix}-sys-color-surface-bright: #4a4a5a;
|
|
60
|
+
--#{$prefix}-sys-color-surface-container-lowest: #1e1e27;
|
|
61
|
+
--#{$prefix}-sys-color-surface-container-low: #2c2c38;
|
|
62
|
+
--#{$prefix}-sys-color-surface-container: #363644;
|
|
63
|
+
--#{$prefix}-sys-color-surface-container-high: #3f3f4e;
|
|
64
|
+
--#{$prefix}-sys-color-surface-container-highest: #4a4a5a;
|
|
65
|
+
--#{$prefix}-sys-color-on-surface: #e6e4ea;
|
|
66
|
+
--#{$prefix}-sys-color-on-surface-variant: #c6c4cc;
|
|
67
|
+
--#{$prefix}-sys-color-outline: #8f8d96;
|
|
68
|
+
--#{$prefix}-sys-color-outline-variant: #45444f;
|
|
69
|
+
--#{$prefix}-sys-color-surface-rgb: 38, 38, 49;
|
|
70
|
+
|
|
71
|
+
@include status-colors-dark();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CarouselConfig } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Adds drag functionality to the carousel component with Material Design 3 scroll behavior support
|
|
4
|
-
*
|
|
5
|
-
* @param {CarouselConfig} config - Carousel configuration
|
|
6
|
-
* @returns {Function} Higher-order function that adds drag navigation feature
|
|
7
|
-
*/
|
|
8
|
-
export declare const withDrag: (config: CarouselConfig) => (component: any) => any;
|