m3-svelte 5.15.5 → 6.0.1
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/package/buttons/Button.svelte +107 -131
- package/package/buttons/ConnectedButtons.svelte +1 -1
- package/package/buttons/FAB.svelte +21 -20
- package/package/buttons/SplitButton.svelte +20 -19
- package/package/containers/BottomSheet.svelte +7 -7
- package/package/containers/Card.svelte +12 -12
- package/package/containers/Dialog.svelte +21 -44
- package/package/containers/Dialog.svelte.d.ts +0 -8
- package/package/containers/ListItem.svelte +19 -11
- package/package/containers/Menu.svelte +3 -3
- package/package/containers/MenuItem.svelte +7 -6
- package/package/containers/Snackbar.svelte +37 -45
- package/package/containers/Snackbar.svelte.d.ts +4 -17
- package/package/containers/SnackbarItem.svelte +6 -6
- package/package/containers/StandardSideSheet.svelte +5 -2
- package/package/forms/Checkbox.svelte +12 -12
- package/package/forms/Chip.svelte +22 -18
- package/package/forms/CircularProgress.svelte +3 -3
- package/package/forms/CircularProgressEstimate.svelte +2 -2
- package/package/forms/DateField.svelte +18 -18
- package/package/forms/DateFieldOutlined.svelte +27 -27
- package/package/forms/DatePickerDocked.svelte +2 -2
- package/package/forms/LinearProgress.svelte +5 -5
- package/package/forms/LinearProgressEstimate.svelte +4 -4
- package/package/forms/LoadingIndicator.svelte +4 -4
- package/package/forms/RadioAnim1.svelte +9 -9
- package/package/forms/RadioAnim2.svelte +9 -9
- package/package/forms/RadioAnim3.svelte +9 -9
- package/package/forms/Select.svelte +31 -35
- package/package/forms/SelectOutlined.svelte +32 -36
- package/package/forms/Slider.svelte +29 -30
- package/package/forms/Switch.svelte +27 -28
- package/package/forms/TextField.svelte +23 -29
- package/package/forms/TextFieldMultiline.svelte +23 -29
- package/package/forms/TextFieldOutlined.svelte +23 -29
- package/package/forms/TextFieldOutlinedMultiline.svelte +23 -29
- package/package/forms/WavyLinearProgress.svelte +2 -7
- package/package/forms/WavyLinearProgressEstimate.svelte +2 -7
- package/package/forms/_picker/CalendarPicker.svelte +3 -2
- package/package/forms/_picker/FocusPicker.svelte +3 -7
- package/package/forms/_picker/Header.svelte +6 -5
- package/package/forms/_picker/Item.svelte +9 -8
- package/package/index.d.ts +4 -8
- package/package/index.js +4 -7
- package/package/{utils → misc}/Divider.svelte +1 -1
- package/package/misc/Icon.svelte +0 -4
- package/package/misc/Layer.svelte +1 -1
- package/package/{utils → misc}/badge.js +8 -5
- package/package/misc/recommended-styles.css +9 -9
- package/package/misc/styles.css +160 -227
- package/package/misc/tailwind-styles.css +106 -104
- package/package/misc/utils.js +2 -4
- package/package/nav/NavCMLX.svelte +35 -29
- package/package/nav/NavCMLX.svelte.d.ts +1 -1
- package/package/nav/NavCMLXItem.svelte +119 -208
- package/package/nav/NavCMLXItem.svelte.d.ts +4 -7
- package/package/nav/Tabs.svelte +13 -10
- package/package/nav/TabsLink.svelte +13 -10
- package/package/nav/VariableTabs.svelte +12 -9
- package/package/nav/VariableTabsLink.svelte +12 -9
- package/package.json +16 -13
- package/package/containers/NewSnackbar.svelte +0 -113
- package/package/containers/NewSnackbar.svelte.d.ts +0 -7
- package/package/forms/CircularProgressIndeterminate.svelte +0 -62
- package/package/forms/CircularProgressIndeterminate.svelte.d.ts +0 -5
- package/package/forms/LinearProgressIndeterminate.svelte +0 -57
- package/package/forms/LinearProgressIndeterminate.svelte.d.ts +0 -5
- package/package/forms/SliderTicks.svelte +0 -12
- package/package/forms/SliderTicks.svelte.d.ts +0 -18
- /package/package/{utils → misc}/ChipChooser.svelte +0 -0
- /package/package/{utils → misc}/ChipChooser.svelte.d.ts +0 -0
- /package/package/{utils → misc}/Divider.svelte.d.ts +0 -0
- /package/package/{utils → misc}/badge.d.ts +0 -0
|
@@ -18,14 +18,6 @@
|
|
|
18
18
|
buttons: Snippet;
|
|
19
19
|
children: Snippet;
|
|
20
20
|
open: boolean;
|
|
21
|
-
/** @deprecated use closedby instead */
|
|
22
|
-
closeOnEsc?: boolean;
|
|
23
|
-
/** @deprecated use closedby instead */
|
|
24
|
-
closeOnClick?: boolean;
|
|
25
|
-
/** @deprecated listen to `open` state changes instead of onEsc */
|
|
26
|
-
onEsc?: () => void;
|
|
27
|
-
/** @deprecated listen to `open` state changes instead of onClick */
|
|
28
|
-
onClick?: () => void;
|
|
29
21
|
} & HTMLDialogAttributes = $props();
|
|
30
22
|
|
|
31
23
|
let dialog: HTMLDialogElement | undefined = $state();
|
|
@@ -41,33 +33,16 @@
|
|
|
41
33
|
ontoggle={(e) => {
|
|
42
34
|
open = e.newState == "open";
|
|
43
35
|
}}
|
|
44
|
-
oncancel={(e) => {
|
|
45
|
-
if (e.target != e.currentTarget) return;
|
|
46
|
-
if (extra.closeOnEsc && extra.onEsc) {
|
|
47
|
-
extra.onEsc();
|
|
48
|
-
}
|
|
49
|
-
}}
|
|
50
|
-
onclick={(e) => {
|
|
51
|
-
if (e.target != e.currentTarget) return;
|
|
52
|
-
if (extra.closeOnClick && extra.onClick) {
|
|
53
|
-
extra.onClick();
|
|
54
|
-
}
|
|
55
|
-
}}
|
|
56
36
|
bind:this={dialog}
|
|
57
|
-
|
|
58
|
-
(extra.closeOnClick == false && extra.closeOnEsc == false
|
|
59
|
-
? "none"
|
|
60
|
-
: extra.closeOnClick == false
|
|
61
|
-
? "closerequest"
|
|
62
|
-
: "any")}
|
|
37
|
+
{closedby}
|
|
63
38
|
role="alertdialog"
|
|
64
39
|
{...extra}
|
|
65
40
|
>
|
|
66
41
|
{#if icon}
|
|
67
42
|
<Icon {icon} size={24} />
|
|
68
43
|
{/if}
|
|
69
|
-
<p class="headline
|
|
70
|
-
<div class="content
|
|
44
|
+
<p class="headline" class:center={icon}>{headline}</p>
|
|
45
|
+
<div class="content">
|
|
71
46
|
{@render children()}
|
|
72
47
|
</div>
|
|
73
48
|
<form method="dialog" class="buttons">
|
|
@@ -78,14 +53,14 @@
|
|
|
78
53
|
<style>
|
|
79
54
|
@layer tokens {
|
|
80
55
|
:root {
|
|
81
|
-
--m3-dialog-shape: var(--m3-
|
|
56
|
+
--m3-dialog-shape: var(--m3-shape-extra-large);
|
|
82
57
|
}
|
|
83
58
|
}
|
|
84
59
|
dialog {
|
|
85
60
|
display: flex;
|
|
86
61
|
flex-direction: column;
|
|
87
|
-
background-color:
|
|
88
|
-
--
|
|
62
|
+
background-color: var(--m3c-surface-container-high);
|
|
63
|
+
--m3v-background: var(--m3c-surface-container-high);
|
|
89
64
|
border: none;
|
|
90
65
|
border-radius: var(--m3-dialog-shape);
|
|
91
66
|
min-width: 17.5rem;
|
|
@@ -93,7 +68,7 @@
|
|
|
93
68
|
padding: 1.5rem;
|
|
94
69
|
overflow: auto;
|
|
95
70
|
> :global(svg) {
|
|
96
|
-
color:
|
|
71
|
+
color: var(--m3c-secondary);
|
|
97
72
|
|
|
98
73
|
flex-shrink: 0;
|
|
99
74
|
align-self: center;
|
|
@@ -101,7 +76,8 @@
|
|
|
101
76
|
}
|
|
102
77
|
}
|
|
103
78
|
.headline {
|
|
104
|
-
|
|
79
|
+
@apply --m3-headline-small;
|
|
80
|
+
color: var(--m3c-on-surface);
|
|
105
81
|
margin-top: 0;
|
|
106
82
|
margin-bottom: 1rem;
|
|
107
83
|
}
|
|
@@ -109,7 +85,8 @@
|
|
|
109
85
|
text-align: center;
|
|
110
86
|
}
|
|
111
87
|
.content {
|
|
112
|
-
|
|
88
|
+
@apply --m3-body-medium;
|
|
89
|
+
color: var(--m3c-on-surface-variant);
|
|
113
90
|
margin-bottom: 1.5rem;
|
|
114
91
|
}
|
|
115
92
|
.buttons {
|
|
@@ -125,31 +102,31 @@
|
|
|
125
102
|
visibility: hidden;
|
|
126
103
|
pointer-events: none;
|
|
127
104
|
transition:
|
|
128
|
-
opacity var(--m3-
|
|
129
|
-
visibility var(--m3-
|
|
105
|
+
opacity var(--m3-easing-fast),
|
|
106
|
+
visibility var(--m3-easing-fast);
|
|
130
107
|
}
|
|
131
108
|
dialog[open] {
|
|
132
109
|
opacity: 1;
|
|
133
110
|
visibility: visible;
|
|
134
111
|
pointer-events: auto;
|
|
135
112
|
animation:
|
|
136
|
-
dialogIn var(--m3-
|
|
137
|
-
opacity var(--m3-
|
|
113
|
+
dialogIn var(--m3-timing-function-emphasized-decel) 500ms,
|
|
114
|
+
opacity var(--m3-timing-function-emphasized-decel) 100ms backwards;
|
|
138
115
|
}
|
|
139
116
|
dialog[open] .headline {
|
|
140
|
-
animation: opacity var(--m3-
|
|
117
|
+
animation: opacity var(--m3-easing-fast);
|
|
141
118
|
}
|
|
142
119
|
dialog[open] .content {
|
|
143
|
-
animation: opacity var(--m3-
|
|
120
|
+
animation: opacity var(--m3-easing-fast) 50ms backwards;
|
|
144
121
|
}
|
|
145
122
|
dialog[open] .buttons {
|
|
146
123
|
animation:
|
|
147
|
-
buttonsIn var(--m3-
|
|
148
|
-
opacity var(--m3-
|
|
124
|
+
buttonsIn var(--m3-timing-function-emphasized-decel) 500ms,
|
|
125
|
+
opacity var(--m3-easing-fast) 100ms backwards;
|
|
149
126
|
}
|
|
150
127
|
dialog::backdrop {
|
|
151
|
-
background-color:
|
|
152
|
-
animation: opacity var(--m3-
|
|
128
|
+
background-color: --translucent(var(--m3c-scrim), 0.3);
|
|
129
|
+
animation: opacity var(--m3-timing-function-emphasized-decel) 500ms;
|
|
153
130
|
}
|
|
154
131
|
@keyframes dialogIn {
|
|
155
132
|
0% {
|
|
@@ -7,14 +7,6 @@ type $$ComponentProps = {
|
|
|
7
7
|
buttons: Snippet;
|
|
8
8
|
children: Snippet;
|
|
9
9
|
open: boolean;
|
|
10
|
-
/** @deprecated use closedby instead */
|
|
11
|
-
closeOnEsc?: boolean;
|
|
12
|
-
/** @deprecated use closedby instead */
|
|
13
|
-
closeOnClick?: boolean;
|
|
14
|
-
/** @deprecated listen to `open` state changes instead of onEsc */
|
|
15
|
-
onEsc?: () => void;
|
|
16
|
-
/** @deprecated listen to `open` state changes instead of onClick */
|
|
17
|
-
onClick?: () => void;
|
|
18
10
|
} & HTMLDialogAttributes;
|
|
19
11
|
declare const Dialog: import("svelte").Component<$$ComponentProps, {}, "open">;
|
|
20
12
|
type Dialog = ReturnType<typeof Dialog>;
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
<div class="body">
|
|
38
38
|
{#if overline}
|
|
39
39
|
<!-- Renamed to not conflict with Tailwind -->
|
|
40
|
-
<p class="overline-
|
|
40
|
+
<p class="overline-">{overline}</p>
|
|
41
41
|
{/if}
|
|
42
|
-
<p class="headline
|
|
42
|
+
<p class="headline">{headline}</p>
|
|
43
43
|
{#if supporting}
|
|
44
|
-
<p class="supporting
|
|
44
|
+
<p class="supporting">{supporting}</p>
|
|
45
45
|
{/if}
|
|
46
46
|
</div>
|
|
47
47
|
{#if trailing}
|
|
48
|
-
<div class="trailing
|
|
48
|
+
<div class="trailing">
|
|
49
49
|
{@render trailing()}
|
|
50
50
|
</div>
|
|
51
51
|
{/if}
|
|
@@ -93,13 +93,13 @@
|
|
|
93
93
|
cursor: pointer;
|
|
94
94
|
}
|
|
95
95
|
.lines-1 {
|
|
96
|
-
height:
|
|
96
|
+
height: --m3-density(3.5rem);
|
|
97
97
|
}
|
|
98
98
|
.lines-2 {
|
|
99
|
-
height:
|
|
99
|
+
height: --m3-density(4.5rem);
|
|
100
100
|
}
|
|
101
101
|
.lines-3 {
|
|
102
|
-
height:
|
|
102
|
+
height: --m3-density(5.5rem);
|
|
103
103
|
padding-top: 0.75rem;
|
|
104
104
|
padding-bottom: 0.75rem;
|
|
105
105
|
align-items: flex-start;
|
|
@@ -110,7 +110,10 @@
|
|
|
110
110
|
.leading,
|
|
111
111
|
.trailing {
|
|
112
112
|
display: contents;
|
|
113
|
-
color:
|
|
113
|
+
color: var(--m3c-on-surface-variant);
|
|
114
|
+
}
|
|
115
|
+
.trailing {
|
|
116
|
+
@apply --m3-label-small;
|
|
114
117
|
}
|
|
115
118
|
.leading > :global(svg),
|
|
116
119
|
.trailing > :global(svg) {
|
|
@@ -122,11 +125,16 @@
|
|
|
122
125
|
p {
|
|
123
126
|
margin: 0;
|
|
124
127
|
}
|
|
125
|
-
.supporting
|
|
128
|
+
.supporting {
|
|
129
|
+
@apply --m3-body-medium;
|
|
130
|
+
color: var(--m3c-on-surface-variant);
|
|
131
|
+
}
|
|
126
132
|
.overline- {
|
|
127
|
-
|
|
133
|
+
@apply --m3-label-small;
|
|
134
|
+
color: var(--m3c-on-surface-variant);
|
|
128
135
|
}
|
|
129
136
|
.headline {
|
|
130
|
-
|
|
137
|
+
@apply --m3-body-large;
|
|
138
|
+
color: var(--m3c-on-surface);
|
|
131
139
|
}
|
|
132
140
|
</style>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<style>
|
|
12
12
|
@layer tokens {
|
|
13
13
|
:root {
|
|
14
|
-
--m3-menu-shape: var(--m3-
|
|
14
|
+
--m3-menu-shape: var(--m3-shape-extra-small);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
.m3-container {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
border-radius: var(--m3-menu-shape);
|
|
23
23
|
min-width: 7rem;
|
|
24
24
|
max-width: 17.5rem;
|
|
25
|
-
background-color:
|
|
25
|
+
background-color: var(--m3c-surface-container);
|
|
26
26
|
z-index: 2;
|
|
27
|
-
box-shadow: var(--m3-
|
|
27
|
+
box-shadow: var(--m3-elevation-2);
|
|
28
28
|
}
|
|
29
29
|
</style>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
} = $props();
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
|
-
<button type="button" class="item focus-inset
|
|
20
|
+
<button type="button" class="item focus-inset" {disabled} {onclick}>
|
|
21
21
|
<Layer />
|
|
22
22
|
{#if icon == "space"}
|
|
23
23
|
<span class="icon"></span>
|
|
@@ -31,9 +31,10 @@
|
|
|
31
31
|
|
|
32
32
|
<style>
|
|
33
33
|
.item {
|
|
34
|
+
@apply --m3-label-large;
|
|
34
35
|
display: flex;
|
|
35
36
|
align-items: center;
|
|
36
|
-
height:
|
|
37
|
+
height: --m3-density(3rem);
|
|
37
38
|
padding: 0 0.75rem;
|
|
38
39
|
gap: 0.75rem;
|
|
39
40
|
white-space: nowrap;
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
border: none;
|
|
42
43
|
position: relative;
|
|
43
44
|
background-color: transparent;
|
|
44
|
-
color:
|
|
45
|
+
color: var(--m3c-on-surface);
|
|
45
46
|
|
|
46
47
|
cursor: pointer;
|
|
47
48
|
}
|
|
@@ -52,14 +53,14 @@
|
|
|
52
53
|
.icon > :global(svg) {
|
|
53
54
|
width: 1.5rem;
|
|
54
55
|
height: 1.5rem;
|
|
55
|
-
color:
|
|
56
|
+
color: var(--m3c-on-surface-variant);
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
.item:disabled {
|
|
59
|
-
color:
|
|
60
|
+
color: --translucent(var(--m3c-on-surface), 0.38);
|
|
60
61
|
cursor: auto;
|
|
61
62
|
}
|
|
62
63
|
.item:disabled > .icon > :global(svg) {
|
|
63
|
-
color:
|
|
64
|
+
color: --translucent(var(--m3c-on-surface), 0.38);
|
|
64
65
|
}
|
|
65
66
|
</style>
|
|
@@ -1,80 +1,70 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@deprecated use NewSnackbar instead
|
|
4
|
-
-->
|
|
5
1
|
<script module lang="ts">
|
|
6
|
-
export
|
|
7
|
-
message: string
|
|
8
|
-
actions?: Record<string, () => void
|
|
9
|
-
closable?: boolean
|
|
2
|
+
export const snackbar = (
|
|
3
|
+
message: string,
|
|
4
|
+
actions?: Record<string, () => void>,
|
|
5
|
+
closable?: boolean,
|
|
10
6
|
/*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
undefined/unset -> 4s timeout
|
|
8
|
+
2000 -> 2s timeout
|
|
9
|
+
-1 -> no timeout
|
|
14
10
|
*/
|
|
15
|
-
timeout?: number
|
|
11
|
+
timeout?: number,
|
|
12
|
+
) => {
|
|
13
|
+
_show(message, actions, closable, timeout);
|
|
16
14
|
};
|
|
15
|
+
let _show: typeof snackbar;
|
|
17
16
|
</script>
|
|
18
17
|
|
|
19
18
|
<script lang="ts">
|
|
20
|
-
import { onDestroy
|
|
19
|
+
import { onDestroy } from "svelte";
|
|
21
20
|
import { fade } from "svelte/transition";
|
|
22
21
|
import iconX from "@ktibow/iconset-material-symbols/close";
|
|
23
22
|
import Icon from "../misc/Icon.svelte";
|
|
24
23
|
import SnackbarItem from "./SnackbarItem.svelte";
|
|
25
24
|
import Layer from "../misc/Layer.svelte";
|
|
26
|
-
import type { DivAttrs } from "../misc/typing-utils";
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}: {
|
|
35
|
-
config?: SnackbarConfig;
|
|
36
|
-
closeButtonTitle?: string;
|
|
37
|
-
} & DivAttrs = $props();
|
|
38
|
-
export const show = ({ message, actions = {}, closable = false, timeout = 4000 }: SnackbarIn) => {
|
|
39
|
-
snackbar = { message, actions, closable, timeout };
|
|
26
|
+
let { closeTitle = "Close" }: { closeTitle?: string } = $props();
|
|
27
|
+
let shown:
|
|
28
|
+
| { message: string; actions: Record<string, () => void>; closable: boolean }
|
|
29
|
+
| undefined = $state();
|
|
30
|
+
let timeoutId: number;
|
|
31
|
+
_show = (message, actions = {}, closable = false, timeout = 4000) => {
|
|
40
32
|
clearTimeout(timeoutId);
|
|
41
|
-
|
|
33
|
+
shown = { message, actions, closable };
|
|
34
|
+
if (timeout && timeout > 0)
|
|
42
35
|
timeoutId = setTimeout(() => {
|
|
43
|
-
|
|
36
|
+
shown = undefined;
|
|
44
37
|
}, timeout);
|
|
45
38
|
};
|
|
46
|
-
|
|
47
|
-
let snackbar: Required<SnackbarIn> | undefined = $state();
|
|
48
|
-
let timeoutId: number;
|
|
49
39
|
onDestroy(() => {
|
|
50
40
|
clearTimeout(timeoutId);
|
|
51
41
|
});
|
|
52
42
|
</script>
|
|
53
43
|
|
|
54
|
-
{#if
|
|
55
|
-
<div class="holder" out:fade={{ duration: 200 }}
|
|
56
|
-
{#key
|
|
57
|
-
<SnackbarItem
|
|
58
|
-
<p
|
|
59
|
-
{#each Object.entries(
|
|
44
|
+
{#if shown}
|
|
45
|
+
<div class="holder" out:fade={{ duration: 200 }}>
|
|
46
|
+
{#key shown}
|
|
47
|
+
<SnackbarItem>
|
|
48
|
+
<p>{shown.message}</p>
|
|
49
|
+
{#each Object.entries(shown.actions) as [key, action]}
|
|
60
50
|
<button
|
|
61
51
|
type="button"
|
|
62
|
-
class="action
|
|
52
|
+
class="action"
|
|
63
53
|
onclick={() => {
|
|
64
|
-
|
|
54
|
+
shown = undefined;
|
|
65
55
|
action();
|
|
66
56
|
}}
|
|
67
57
|
>
|
|
68
58
|
{key}
|
|
69
59
|
</button>
|
|
70
60
|
{/each}
|
|
71
|
-
{#if
|
|
61
|
+
{#if shown.closable}
|
|
72
62
|
<button
|
|
73
63
|
type="button"
|
|
74
64
|
class="close"
|
|
75
|
-
title={
|
|
65
|
+
title={closeTitle}
|
|
76
66
|
onclick={() => {
|
|
77
|
-
|
|
67
|
+
shown = undefined;
|
|
78
68
|
}}
|
|
79
69
|
>
|
|
80
70
|
<Layer />
|
|
@@ -90,12 +80,13 @@
|
|
|
90
80
|
.holder {
|
|
91
81
|
position: fixed;
|
|
92
82
|
padding-bottom: 1rem;
|
|
93
|
-
bottom: var(--
|
|
83
|
+
bottom: var(--m3v-bottom-offset);
|
|
94
84
|
left: 50%;
|
|
95
85
|
transform: translate(-50%, 0);
|
|
96
86
|
z-index: 3;
|
|
97
87
|
}
|
|
98
88
|
p {
|
|
89
|
+
@apply --m3-body-medium;
|
|
99
90
|
margin-right: auto;
|
|
100
91
|
}
|
|
101
92
|
button {
|
|
@@ -107,6 +98,7 @@
|
|
|
107
98
|
border: none;
|
|
108
99
|
|
|
109
100
|
background-color: transparent;
|
|
101
|
+
color: unset;
|
|
110
102
|
cursor: pointer;
|
|
111
103
|
position: relative;
|
|
112
104
|
}
|
|
@@ -116,11 +108,11 @@
|
|
|
116
108
|
}
|
|
117
109
|
|
|
118
110
|
.action {
|
|
119
|
-
|
|
111
|
+
@apply --m3-label-large;
|
|
112
|
+
color: var(--m3c-inverse-primary);
|
|
120
113
|
padding: 0 0.5rem;
|
|
121
114
|
}
|
|
122
115
|
.close {
|
|
123
|
-
color: var(--m3-scheme-inverse-on-surface);
|
|
124
116
|
padding: 0 0.75rem;
|
|
125
117
|
margin-right: -1rem;
|
|
126
118
|
}
|
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
message: string;
|
|
3
|
-
actions?: Record<string, () => void>;
|
|
4
|
-
closable?: boolean;
|
|
5
|
-
timeout?: number | null;
|
|
6
|
-
};
|
|
7
|
-
import { type ComponentProps } from "svelte";
|
|
8
|
-
import SnackbarItem from "./SnackbarItem.svelte";
|
|
9
|
-
import type { DivAttrs } from "../misc/typing-utils";
|
|
10
|
-
type SnackbarConfig = Omit<ComponentProps<typeof SnackbarItem>, "children">;
|
|
1
|
+
export declare const snackbar: (message: string, actions?: Record<string, () => void>, closable?: boolean, timeout?: number) => void;
|
|
11
2
|
type $$ComponentProps = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
/** @deprecated use NewSnackbar instead */
|
|
16
|
-
declare const Snackbar: import("svelte").Component<$$ComponentProps, {
|
|
17
|
-
show: ({ message, actions, closable, timeout }: SnackbarIn) => void;
|
|
18
|
-
}, "">;
|
|
3
|
+
closeTitle?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const Snackbar: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
19
6
|
type Snackbar = ReturnType<typeof Snackbar>;
|
|
20
7
|
export default Snackbar;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<style>
|
|
13
13
|
@layer tokens {
|
|
14
14
|
:root {
|
|
15
|
-
--m3-snackbar-shape: var(--m3-
|
|
15
|
+
--m3-snackbar-shape: var(--m3-shape-extra-small);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
.m3-container {
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
max-width: 60rem;
|
|
24
24
|
min-height: 3rem;
|
|
25
25
|
border-radius: var(--m3-snackbar-shape);
|
|
26
|
-
box-shadow: var(--m3-
|
|
27
|
-
background-color:
|
|
28
|
-
color:
|
|
26
|
+
box-shadow: var(--m3-elevation-3);
|
|
27
|
+
background-color: var(--m3c-inverse-surface);
|
|
28
|
+
color: var(--m3c-inverse-on-surface);
|
|
29
29
|
animation:
|
|
30
|
-
snackbarIn var(--m3-
|
|
31
|
-
opacity var(--m3-
|
|
30
|
+
snackbarIn var(--m3-timing-function-emphasized-decel) 500ms,
|
|
31
|
+
opacity var(--m3-timing-function-emphasized-decel) 100ms;
|
|
32
32
|
}
|
|
33
33
|
/*@TODO: Fix animation with different shaping or something*/
|
|
34
34
|
@keyframes snackbarIn {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
<div class="m3-container">
|
|
19
19
|
<div class="header">
|
|
20
|
-
<span
|
|
20
|
+
<span>{headline}</span>
|
|
21
21
|
<Button variant="text" iconType="full" onclick={close}>
|
|
22
22
|
<Icon icon={iconX} />
|
|
23
23
|
</Button>
|
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
|
|
38
38
|
padding: 1.5rem;
|
|
39
39
|
}
|
|
40
|
+
.header > span {
|
|
41
|
+
@apply --m3-title-large;
|
|
42
|
+
}
|
|
40
43
|
.header > :global(button.m3-container) {
|
|
41
|
-
color:
|
|
44
|
+
color: var(--m3c-on-surface-variant);
|
|
42
45
|
}
|
|
43
46
|
</style>
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
inset: -0.6875rem;
|
|
47
47
|
width: 2.5rem;
|
|
48
48
|
height: 2.5rem;
|
|
49
|
-
border-radius: var(--m3-
|
|
50
|
-
color:
|
|
49
|
+
border-radius: var(--m3-shape-full);
|
|
50
|
+
color: var(--m3c-on-surface-variant);
|
|
51
51
|
cursor: pointer;
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -56,16 +56,16 @@
|
|
|
56
56
|
inset: 0.6875rem;
|
|
57
57
|
border-radius: 0.125rem;
|
|
58
58
|
border: solid 0.125rem currentColor;
|
|
59
|
-
transition: var(--m3-
|
|
59
|
+
transition: var(--m3-easing-fast);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
svg {
|
|
63
63
|
position: absolute;
|
|
64
64
|
inset: 0;
|
|
65
|
-
color:
|
|
65
|
+
color: var(--m3c-on-primary);
|
|
66
66
|
opacity: 0;
|
|
67
67
|
pointer-events: none;
|
|
68
|
-
transition: var(--m3-
|
|
68
|
+
transition: var(--m3-easing-fast);
|
|
69
69
|
path {
|
|
70
70
|
stroke-dasharray: 20.874 20.874;
|
|
71
71
|
stroke-dashoffset: 20.874;
|
|
@@ -74,26 +74,26 @@
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
:global(input:focus-visible) + .layer-container {
|
|
77
|
-
color:
|
|
77
|
+
color: var(--m3c-on-surface);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
:global(input:checked) + .layer-container {
|
|
81
|
-
color:
|
|
81
|
+
color: var(--m3c-primary);
|
|
82
82
|
}
|
|
83
83
|
:global(input:checked) + .layer-container .checkbox-box {
|
|
84
|
-
background-color:
|
|
84
|
+
background-color: var(--m3c-primary);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
:global(input:checked) ~ svg {
|
|
88
88
|
opacity: 1;
|
|
89
89
|
path {
|
|
90
90
|
stroke-dashoffset: 0;
|
|
91
|
-
transition: stroke-dashoffset var(--m3-
|
|
91
|
+
transition: stroke-dashoffset var(--m3-easing-slow);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
:global(input:disabled) + .layer-container {
|
|
96
|
-
color:
|
|
96
|
+
color: --translucent(var(--m3c-on-surface), 0.38);
|
|
97
97
|
cursor: not-allowed;
|
|
98
98
|
}
|
|
99
99
|
|
|
@@ -101,11 +101,11 @@
|
|
|
101
101
|
color: transparent;
|
|
102
102
|
}
|
|
103
103
|
:global(input:disabled:checked) + .layer-container .checkbox-box {
|
|
104
|
-
background-color:
|
|
104
|
+
background-color: --translucent(var(--m3c-on-surface), 0.38);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
:global(input:disabled) ~ svg {
|
|
108
|
-
color:
|
|
108
|
+
color: var(--m3c-surface);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
.m3-container {
|