m3-svelte 3.6.1 → 4.0.0-beta.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.
- package/package/buttons/Button.svelte +142 -78
- package/package/buttons/Button.svelte.d.ts +17 -34
- package/package/buttons/ConnectedButtons.svelte +26 -0
- package/package/buttons/ConnectedButtons.svelte.d.ts +8 -0
- package/package/buttons/FAB.svelte +30 -15
- package/package/buttons/FAB.svelte.d.ts +14 -25
- package/package/containers/BottomSheet.svelte +33 -27
- package/package/containers/BottomSheet.svelte.d.ts +7 -21
- package/package/containers/Card.svelte +45 -14
- package/package/containers/Card.svelte.d.ts +10 -30
- package/package/containers/Dialog.svelte +46 -32
- package/package/containers/Dialog.svelte.d.ts +9 -34
- package/package/containers/ListItem.svelte +78 -14
- package/package/containers/ListItem.svelte.d.ts +14 -25
- package/package/containers/Menu.svelte +6 -3
- package/package/containers/Menu.svelte.d.ts +6 -28
- package/package/containers/MenuItem.svelte +15 -5
- package/package/containers/MenuItem.svelte.d.ts +7 -29
- package/package/containers/Snackbar.svelte +35 -37
- package/package/containers/Snackbar.svelte.d.ts +7 -22
- package/package/containers/SnackbarItem.svelte +6 -6
- package/package/containers/SnackbarItem.svelte.d.ts +6 -29
- package/package/containers/StandardSideSheet.svelte +14 -8
- package/package/containers/StandardSideSheet.svelte.d.ts +7 -30
- package/package/forms/Checkbox.svelte +19 -4
- package/package/forms/Checkbox.svelte.d.ts +6 -29
- package/package/forms/Chip.svelte +41 -29
- package/package/forms/Chip.svelte.d.ts +18 -41
- package/package/forms/CircularProgress.svelte +4 -6
- package/package/forms/CircularProgress.svelte.d.ts +4 -20
- package/package/forms/CircularProgressIndeterminate.svelte +3 -4
- package/package/forms/CircularProgressIndeterminate.svelte.d.ts +2 -20
- package/package/forms/DatePickerDocked.svelte +52 -35
- package/package/forms/DatePickerDocked.svelte.d.ts +6 -22
- package/package/forms/LinearProgress.svelte +10 -5
- package/package/forms/LinearProgress.svelte.d.ts +4 -20
- package/package/forms/LinearProgressIndeterminate.svelte +4 -3
- package/package/forms/LinearProgressIndeterminate.svelte.d.ts +2 -20
- package/package/forms/RadioAnim1.svelte +10 -4
- package/package/forms/RadioAnim1.svelte.d.ts +6 -29
- package/package/forms/RadioAnim2.svelte +10 -4
- package/package/forms/RadioAnim2.svelte.d.ts +6 -29
- package/package/forms/RadioAnim3.svelte +10 -4
- package/package/forms/RadioAnim3.svelte.d.ts +6 -29
- package/package/forms/Slider.svelte +32 -26
- package/package/forms/Slider.svelte.d.ts +5 -21
- package/package/forms/SliderTicks.svelte +40 -33
- package/package/forms/SliderTicks.svelte.d.ts +5 -21
- package/package/forms/Switch.svelte +23 -21
- package/package/forms/Switch.svelte.d.ts +5 -22
- package/package/forms/TextField.svelte +36 -19
- package/package/forms/TextField.svelte.d.ts +14 -27
- package/package/forms/TextFieldMultiline.svelte +21 -21
- package/package/forms/TextFieldMultiline.svelte.d.ts +6 -23
- package/package/forms/TextFieldOutlined.svelte +36 -18
- package/package/forms/TextFieldOutlined.svelte.d.ts +14 -26
- package/package/forms/TextFieldOutlinedMultiline.svelte +21 -21
- package/package/forms/TextFieldOutlinedMultiline.svelte.d.ts +6 -23
- package/package/forms/_picker/Actions.svelte +16 -18
- package/package/forms/_picker/Actions.svelte.d.ts +7 -22
- package/package/forms/_picker/CalendarPicker.svelte +14 -4
- package/package/forms/_picker/CalendarPicker.svelte.d.ts +4 -18
- package/package/forms/_picker/FocusPicker.svelte +8 -9
- package/package/forms/_picker/FocusPicker.svelte.d.ts +5 -21
- package/package/forms/_picker/Header.svelte +20 -9
- package/package/forms/_picker/Header.svelte.d.ts +4 -18
- package/package/forms/_picker/Item.svelte +15 -6
- package/package/forms/_picker/Item.svelte.d.ts +8 -23
- package/package/index.d.ts +3 -9
- package/package/index.js +1 -8
- package/package/misc/Layer.svelte +7 -3
- package/package/misc/Layer.svelte.d.ts +5 -17
- package/package/misc/StyleFromScheme.svelte +6 -2
- package/package/misc/StyleFromScheme.svelte.d.ts +5 -19
- package/package/misc/_icon.svelte +12 -5
- package/package/misc/_icon.svelte.d.ts +5 -19
- package/package/misc/_ripple.svelte +11 -3
- package/package/misc/_ripple.svelte.d.ts +5 -17
- package/package/misc/_ripplesimple.svelte +4 -0
- package/package/misc/_ripplesimple.svelte.d.ts +5 -25
- package/package/misc/_styling.svelte +7 -3
- package/package/misc/_styling.svelte.d.ts +5 -19
- package/package/misc/animation.js +1 -5
- package/package/misc/easing.js +1 -28
- package/package/misc/styles.css +135 -107
- package/package/misc/utils.d.ts +1 -0
- package/package/misc/utils.js +5 -0
- package/package/nav/NavDrawer.svelte +9 -5
- package/package/nav/NavDrawer.svelte.d.ts +6 -30
- package/package/nav/NavDrawerButton.svelte +22 -12
- package/package/nav/NavDrawerButton.svelte.d.ts +8 -31
- package/package/nav/NavDrawerLink.svelte +21 -12
- package/package/nav/NavDrawerLink.svelte.d.ts +8 -30
- package/package/nav/NavList.svelte +13 -9
- package/package/nav/NavList.svelte.d.ts +7 -31
- package/package/nav/NavListButton.svelte +26 -22
- package/package/nav/NavListButton.svelte.d.ts +9 -33
- package/package/nav/NavListLink.svelte +26 -23
- package/package/nav/NavListLink.svelte.d.ts +9 -32
- package/package/nav/Tabs.svelte +20 -19
- package/package/nav/Tabs.svelte.d.ts +5 -22
- package/package/nav/TabsLink.svelte +22 -18
- package/package/nav/TabsLink.svelte.d.ts +5 -22
- package/package/nav/VariableTabs.svelte +25 -20
- package/package/nav/VariableTabs.svelte.d.ts +5 -22
- package/package/nav/VariableTabsLink.svelte +29 -22
- package/package/nav/VariableTabsLink.svelte.d.ts +5 -22
- package/package/utils/ChipChooser.svelte +10 -4
- package/package/utils/ChipChooser.svelte.d.ts +5 -19
- package/package/utils/DateField.svelte +24 -18
- package/package/utils/DateField.svelte.d.ts +4 -19
- package/package/utils/Divider.svelte +5 -1
- package/package/utils/Divider.svelte.d.ts +4 -18
- package/package.json +44 -43
- package/package/buttons/ButtonLink.svelte +0 -116
- package/package/buttons/ButtonLink.svelte.d.ts +0 -34
- package/package/buttons/SegmentedButtonContainer.svelte +0 -27
- package/package/buttons/SegmentedButtonContainer.svelte.d.ts +0 -31
- package/package/buttons/SegmentedButtonItem.svelte +0 -119
- package/package/buttons/SegmentedButtonItem.svelte.d.ts +0 -34
- package/package/containers/CardClickable.svelte +0 -78
- package/package/containers/CardClickable.svelte.d.ts +0 -34
- package/package/containers/ListItemButton.svelte +0 -86
- package/package/containers/ListItemButton.svelte.d.ts +0 -31
- package/package/containers/ListItemLabel.svelte +0 -82
- package/package/containers/ListItemLabel.svelte.d.ts +0 -29
- package/package/containers/SnackbarAnim.svelte +0 -127
- package/package/containers/SnackbarAnim.svelte.d.ts +0 -33
- package/package/forms/CheckboxAnim.svelte +0 -116
- package/package/forms/CheckboxAnim.svelte.d.ts +0 -31
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script module lang="ts">
|
|
2
2
|
export type SnackbarIn = {
|
|
3
3
|
message: string;
|
|
4
4
|
actions?: Record<string, () => void>;
|
|
5
5
|
closable?: boolean;
|
|
6
|
-
timeout?: number | null;
|
|
7
6
|
/*
|
|
8
7
|
timeout: undefined/unset -> 4s timeout
|
|
9
8
|
timeout: null -> no timeout
|
|
10
9
|
timeout: 2000 -> 2s timeout
|
|
11
10
|
*/
|
|
11
|
+
timeout?: number | null;
|
|
12
12
|
};
|
|
13
13
|
</script>
|
|
14
14
|
|
|
@@ -16,18 +16,14 @@
|
|
|
16
16
|
import { onDestroy, type ComponentProps } from "svelte";
|
|
17
17
|
import type { HTMLAttributes } from "svelte/elements";
|
|
18
18
|
import { fade } from "svelte/transition";
|
|
19
|
-
import Icon from "../misc/_icon.svelte";
|
|
20
19
|
import iconX from "@ktibow/iconset-material-symbols/close";
|
|
20
|
+
import Icon from "../misc/_icon.svelte";
|
|
21
21
|
import SnackbarItem from "./SnackbarItem.svelte";
|
|
22
|
-
type SnackbarData = {
|
|
23
|
-
message: string;
|
|
24
|
-
actions: Record<string, () => void>;
|
|
25
|
-
closable: boolean;
|
|
26
|
-
timeout: number | null;
|
|
27
|
-
};
|
|
28
22
|
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
type SnackbarConfig = Omit<ComponentProps<typeof SnackbarItem>, "children">;
|
|
24
|
+
|
|
25
|
+
let { config = {}, ...extra }: { config?: SnackbarConfig } & HTMLAttributes<HTMLDivElement> =
|
|
26
|
+
$props();
|
|
31
27
|
export const show = ({ message, actions = {}, closable = false, timeout = 4000 }: SnackbarIn) => {
|
|
32
28
|
snackbar = { message, actions, closable, timeout };
|
|
33
29
|
clearTimeout(timeoutId);
|
|
@@ -37,7 +33,7 @@
|
|
|
37
33
|
}, timeout);
|
|
38
34
|
};
|
|
39
35
|
|
|
40
|
-
let snackbar:
|
|
36
|
+
let snackbar: Required<SnackbarIn> | undefined = $state();
|
|
41
37
|
let timeoutId: number;
|
|
42
38
|
onDestroy(() => {
|
|
43
39
|
clearTimeout(timeoutId);
|
|
@@ -45,31 +41,33 @@
|
|
|
45
41
|
</script>
|
|
46
42
|
|
|
47
43
|
{#if snackbar}
|
|
48
|
-
<div class="holder" out:fade={{ duration: 200 }} {...
|
|
49
|
-
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
44
|
+
<div class="holder" out:fade={{ duration: 200 }} {...extra}>
|
|
45
|
+
{#key snackbar}
|
|
46
|
+
<SnackbarItem {...config}>
|
|
47
|
+
<p class="m3-font-body-medium">{snackbar.message}</p>
|
|
48
|
+
{#each Object.entries(snackbar.actions) as [key, action]}
|
|
49
|
+
<button
|
|
50
|
+
class="action m3-font-label-large"
|
|
51
|
+
onclick={() => {
|
|
52
|
+
snackbar = undefined;
|
|
53
|
+
action();
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
{key}
|
|
57
|
+
</button>
|
|
58
|
+
{/each}
|
|
59
|
+
{#if snackbar.closable}
|
|
60
|
+
<button
|
|
61
|
+
class="close"
|
|
62
|
+
onclick={() => {
|
|
63
|
+
snackbar = undefined;
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
<Icon icon={iconX} />
|
|
67
|
+
</button>
|
|
68
|
+
{/if}
|
|
69
|
+
</SnackbarItem>
|
|
70
|
+
{/key}
|
|
73
71
|
</div>
|
|
74
72
|
{/if}
|
|
75
73
|
|
|
@@ -7,27 +7,12 @@ export type SnackbarIn = {
|
|
|
7
7
|
import { type ComponentProps } from "svelte";
|
|
8
8
|
import type { HTMLAttributes } from "svelte/elements";
|
|
9
9
|
import SnackbarItem from "./SnackbarItem.svelte";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
$$events?: Events;
|
|
16
|
-
$$slots?: Slots;
|
|
17
|
-
}): Exports & {
|
|
18
|
-
$set?: any;
|
|
19
|
-
$on?: any;
|
|
20
|
-
};
|
|
21
|
-
z_$$bindings?: Bindings;
|
|
22
|
-
}
|
|
23
|
-
declare const Snackbar: $$__sveltets_2_IsomorphicComponent<{
|
|
24
|
-
extraWrapperOptions?: HTMLAttributes<HTMLDivElement>;
|
|
25
|
-
extraOptions?: ComponentProps<SnackbarItem>;
|
|
26
|
-
show?: ({ message, actions, closable, timeout }: SnackbarIn) => void;
|
|
27
|
-
}, {
|
|
28
|
-
[evt: string]: CustomEvent<any>;
|
|
29
|
-
}, {}, {
|
|
10
|
+
type SnackbarConfig = Omit<ComponentProps<typeof SnackbarItem>, "children">;
|
|
11
|
+
type $$ComponentProps = {
|
|
12
|
+
config?: SnackbarConfig;
|
|
13
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
14
|
+
declare const Snackbar: import("svelte").Component<$$ComponentProps, {
|
|
30
15
|
show: ({ message, actions, closable, timeout }: SnackbarIn) => void;
|
|
31
|
-
},
|
|
32
|
-
type Snackbar =
|
|
16
|
+
}, "">;
|
|
17
|
+
type Snackbar = ReturnType<typeof Snackbar>;
|
|
33
18
|
export default Snackbar;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
2
3
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
export let extraOptions: HTMLAttributes<HTMLDivElement> = {};
|
|
5
|
+
let { children, ...extra }: { children: Snippet } & HTMLAttributes<HTMLDivElement> = $props();
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
|
-
<div class="m3-container"
|
|
9
|
-
|
|
8
|
+
<div class="m3-container" {...extra}>
|
|
9
|
+
{@render children()}
|
|
10
10
|
</div>
|
|
11
11
|
|
|
12
12
|
<style>
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
background-color: rgb(var(--m3-scheme-inverse-surface));
|
|
26
26
|
color: rgb(var(--m3-scheme-inverse-on-surface));
|
|
27
27
|
animation:
|
|
28
|
-
snackbarIn
|
|
29
|
-
opacity
|
|
28
|
+
snackbarIn var(--m3-util-curve-decel) 500ms,
|
|
29
|
+
opacity var(--m3-util-curve-decel) 100ms;
|
|
30
30
|
}
|
|
31
31
|
/*@TODO: Fix animation with different shaping or something*/
|
|
32
32
|
@keyframes snackbarIn {
|
|
@@ -1,31 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
1
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
$$events?: Events;
|
|
8
|
-
$$slots?: Slots;
|
|
9
|
-
}): Exports & {
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
16
|
-
default: any;
|
|
17
|
-
} ? Props extends Record<string, never> ? any : {
|
|
18
|
-
children?: any;
|
|
19
|
-
} : {});
|
|
20
|
-
declare const SnackbarItem: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
21
|
-
display?: string;
|
|
22
|
-
extraOptions?: HTMLAttributes<HTMLDivElement>;
|
|
23
|
-
}, {
|
|
24
|
-
default: {};
|
|
25
|
-
}>, {
|
|
26
|
-
[evt: string]: CustomEvent<any>;
|
|
27
|
-
}, {
|
|
28
|
-
default: {};
|
|
29
|
-
}, {}, string>;
|
|
30
|
-
type SnackbarItem = InstanceType<typeof SnackbarItem>;
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
6
|
+
declare const SnackbarItem: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type SnackbarItem = ReturnType<typeof SnackbarItem>;
|
|
31
8
|
export default SnackbarItem;
|
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
3
|
import iconX from "@ktibow/iconset-material-symbols/close";
|
|
4
4
|
import Button from "../buttons/Button.svelte";
|
|
5
5
|
import Icon from "../misc/_icon.svelte";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
let {
|
|
8
|
+
headline,
|
|
9
|
+
children,
|
|
10
|
+
close,
|
|
11
|
+
}: {
|
|
12
|
+
headline: string;
|
|
13
|
+
children: Snippet;
|
|
14
|
+
close: () => void;
|
|
15
|
+
} = $props();
|
|
11
16
|
</script>
|
|
12
17
|
|
|
13
|
-
<div class="m3-container"
|
|
18
|
+
<div class="m3-container">
|
|
14
19
|
<div class="header">
|
|
15
20
|
<span class="m3-font-title-large">{headline}</span>
|
|
16
|
-
<Button
|
|
21
|
+
<Button variant="text" iconType="full" click={close}>
|
|
17
22
|
<Icon icon={iconX} />
|
|
18
23
|
</Button>
|
|
19
24
|
</div>
|
|
20
|
-
|
|
25
|
+
{@render children()}
|
|
21
26
|
</div>
|
|
22
27
|
|
|
23
28
|
<style>
|
|
24
29
|
.m3-container {
|
|
30
|
+
display: flex;
|
|
25
31
|
flex-direction: column;
|
|
26
32
|
}
|
|
27
33
|
.header {
|
|
@@ -1,32 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
-
default: any;
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const StandardSideSheet: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
20
3
|
headline: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
} & {
|
|
27
|
-
[evt: string]: CustomEvent<any>;
|
|
28
|
-
}, {
|
|
29
|
-
default: {};
|
|
30
|
-
}, {}, string>;
|
|
31
|
-
type StandardSideSheet = InstanceType<typeof StandardSideSheet>;
|
|
4
|
+
children: Snippet;
|
|
5
|
+
close: () => void;
|
|
6
|
+
};
|
|
7
|
+
declare const StandardSideSheet: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
|
+
type StandardSideSheet = ReturnType<typeof StandardSideSheet>;
|
|
32
9
|
export default StandardSideSheet;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
2
3
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
4
|
import Layer from "../misc/Layer.svelte";
|
|
4
5
|
|
|
5
|
-
export let display = "inline-flex";
|
|
6
|
-
export let extraOptions: HTMLAttributes<HTMLDivElement> = {};
|
|
7
6
|
// MUST BE WRAPPED IN A <label>
|
|
7
|
+
let {
|
|
8
|
+
children,
|
|
9
|
+
...extra
|
|
10
|
+
}: {
|
|
11
|
+
children: Snippet;
|
|
12
|
+
} & HTMLAttributes<HTMLDivElement> = $props();
|
|
8
13
|
</script>
|
|
9
14
|
|
|
10
|
-
<div class="m3-container"
|
|
11
|
-
|
|
15
|
+
<div class="m3-container" {...extra}>
|
|
16
|
+
{@render children()}
|
|
12
17
|
<div class="layer-container">
|
|
13
18
|
<Layer />
|
|
14
19
|
<div class="checkbox-box"></div>
|
|
@@ -25,6 +30,7 @@
|
|
|
25
30
|
|
|
26
31
|
<style>
|
|
27
32
|
.m3-container {
|
|
33
|
+
display: inline-flex;
|
|
28
34
|
position: relative;
|
|
29
35
|
width: 1.125rem;
|
|
30
36
|
height: 1.125rem;
|
|
@@ -60,6 +66,11 @@
|
|
|
60
66
|
opacity: 0;
|
|
61
67
|
pointer-events: none;
|
|
62
68
|
transition: opacity 200ms;
|
|
69
|
+
path {
|
|
70
|
+
stroke-dasharray: 20.874 20.874;
|
|
71
|
+
stroke-dashoffset: 20.874;
|
|
72
|
+
transition: stroke-dashoffset 0ms 200ms;
|
|
73
|
+
}
|
|
63
74
|
}
|
|
64
75
|
|
|
65
76
|
:global(input:focus-visible) + .layer-container {
|
|
@@ -75,6 +86,10 @@
|
|
|
75
86
|
|
|
76
87
|
:global(input:checked) ~ svg {
|
|
77
88
|
opacity: 1;
|
|
89
|
+
path {
|
|
90
|
+
stroke-dashoffset: 0;
|
|
91
|
+
transition: stroke-dashoffset 200ms;
|
|
92
|
+
}
|
|
78
93
|
}
|
|
79
94
|
|
|
80
95
|
:global(input:disabled) + .layer-container {
|
|
@@ -1,31 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
1
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
$$events?: Events;
|
|
8
|
-
$$slots?: Slots;
|
|
9
|
-
}): Exports & {
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
16
|
-
default: any;
|
|
17
|
-
} ? Props extends Record<string, never> ? any : {
|
|
18
|
-
children?: any;
|
|
19
|
-
} : {});
|
|
20
|
-
declare const Checkbox: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
21
|
-
display?: string;
|
|
22
|
-
extraOptions?: HTMLAttributes<HTMLDivElement>;
|
|
23
|
-
}, {
|
|
24
|
-
default: {};
|
|
25
|
-
}>, {
|
|
26
|
-
[evt: string]: CustomEvent<any>;
|
|
27
|
-
}, {
|
|
28
|
-
default: {};
|
|
29
|
-
}, {}, string>;
|
|
30
|
-
type Checkbox = InstanceType<typeof Checkbox>;
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
6
|
+
declare const Checkbox: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type Checkbox = ReturnType<typeof Checkbox>;
|
|
31
8
|
export default Checkbox;
|
|
@@ -1,42 +1,54 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
2
3
|
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
3
4
|
import type { IconifyIcon } from "@iconify/types";
|
|
4
5
|
import Icon from "../misc/_icon.svelte";
|
|
5
6
|
import Layer from "../misc/Layer.svelte";
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
let {
|
|
9
|
+
variant,
|
|
10
|
+
icon,
|
|
11
|
+
trailingIcon,
|
|
12
|
+
elevated = false,
|
|
13
|
+
disabled = false,
|
|
14
|
+
selected = false,
|
|
15
|
+
children,
|
|
16
|
+
click,
|
|
17
|
+
...extra
|
|
18
|
+
}: {
|
|
19
|
+
/**
|
|
20
|
+
* general is filter/suggestion since they're the same.
|
|
21
|
+
* | name | use | example | phrasing |
|
|
22
|
+
* |------------|------------------|-------------------------------|--------------------|
|
|
23
|
+
* | input | information item | like a person in the to field | user-entered thing |
|
|
24
|
+
* | assist | smart actions | like add to calendar | start with a verb |
|
|
25
|
+
* | filter | selection | like in a search page | category |
|
|
26
|
+
* | suggestion | smart actions | like a chat response | query/message |
|
|
27
|
+
*/
|
|
28
|
+
variant: "input" | "assist" | "general";
|
|
29
|
+
icon?: IconifyIcon | undefined;
|
|
30
|
+
trailingIcon?: IconifyIcon | undefined;
|
|
31
|
+
elevated?: boolean;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
selected?: boolean;
|
|
34
|
+
children: Snippet;
|
|
35
|
+
click: () => void;
|
|
36
|
+
} & HTMLButtonAttributes = $props();
|
|
24
37
|
</script>
|
|
25
38
|
|
|
26
39
|
<button
|
|
27
|
-
class="m3-container
|
|
28
|
-
style="display: {display}"
|
|
40
|
+
class="m3-container {variant}"
|
|
29
41
|
class:elevated
|
|
30
42
|
class:selected
|
|
31
43
|
{disabled}
|
|
32
|
-
|
|
33
|
-
{...
|
|
44
|
+
onclick={click}
|
|
45
|
+
{...extra}
|
|
34
46
|
>
|
|
35
47
|
<Layer />
|
|
36
48
|
{#if icon}
|
|
37
49
|
<Icon {icon} class="leading" />
|
|
38
50
|
{/if}
|
|
39
|
-
<span class="m3-font-label-large"
|
|
51
|
+
<span class="m3-font-label-large">{@render children()}</span>
|
|
40
52
|
{#if trailingIcon}
|
|
41
53
|
<Icon icon={trailingIcon} class="trailing" />
|
|
42
54
|
{/if}
|
|
@@ -55,7 +67,7 @@
|
|
|
55
67
|
|
|
56
68
|
background-color: rgb(var(--m3-scheme-surface));
|
|
57
69
|
color: rgb(var(--m3-scheme-on-surface-variant));
|
|
58
|
-
border: solid
|
|
70
|
+
border: solid 1px rgb(var(--m3-scheme-outline));
|
|
59
71
|
position: relative;
|
|
60
72
|
cursor: pointer;
|
|
61
73
|
-webkit-tap-highlight-color: transparent;
|
|
@@ -63,13 +75,13 @@
|
|
|
63
75
|
}
|
|
64
76
|
|
|
65
77
|
.m3-container > :global(:is(.ripple-container, .tint)) {
|
|
66
|
-
inset: -
|
|
78
|
+
inset: -1px;
|
|
67
79
|
}
|
|
68
80
|
.m3-container > :global(svg) {
|
|
69
81
|
width: 1.125rem;
|
|
70
82
|
height: 1.125rem;
|
|
71
83
|
}
|
|
72
|
-
.m3-container:enabled:not(.
|
|
84
|
+
.m3-container:enabled:not(.input):not(.selected) > :global(.leading) {
|
|
73
85
|
color: rgb(var(--m3-scheme-primary));
|
|
74
86
|
}
|
|
75
87
|
.m3-container > :global(.leading) {
|
|
@@ -78,17 +90,17 @@
|
|
|
78
90
|
.m3-container > :global(.trailing) {
|
|
79
91
|
margin-right: -0.5rem;
|
|
80
92
|
}
|
|
81
|
-
.
|
|
93
|
+
.input > :global(.leading) {
|
|
82
94
|
margin-left: -0.25rem;
|
|
83
95
|
}
|
|
84
|
-
.
|
|
96
|
+
.input > :global(.trailing) {
|
|
85
97
|
margin-right: -0.25rem;
|
|
86
98
|
}
|
|
87
99
|
|
|
88
|
-
.
|
|
100
|
+
.assist {
|
|
89
101
|
color: rgb(var(--m3-scheme-on-surface));
|
|
90
102
|
}
|
|
91
|
-
.
|
|
103
|
+
.input {
|
|
92
104
|
padding: 0 0.75rem;
|
|
93
105
|
}
|
|
94
106
|
.elevated {
|
|
@@ -1,48 +1,25 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
1
2
|
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
2
3
|
import type { IconifyIcon } from "@iconify/types";
|
|
3
|
-
|
|
4
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
-
$$bindings?: Bindings;
|
|
6
|
-
} & Exports;
|
|
7
|
-
(internal: unknown, props: Props & {
|
|
8
|
-
$$events?: Events;
|
|
9
|
-
$$slots?: Slots;
|
|
10
|
-
}): Exports & {
|
|
11
|
-
$set?: any;
|
|
12
|
-
$on?: any;
|
|
13
|
-
};
|
|
14
|
-
z_$$bindings?: Bindings;
|
|
15
|
-
}
|
|
16
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
17
|
-
default: any;
|
|
18
|
-
} ? Props extends Record<string, never> ? any : {
|
|
19
|
-
children?: any;
|
|
20
|
-
} : {});
|
|
21
|
-
declare const Chip: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
22
|
-
display?: string;
|
|
23
|
-
extraOptions?: HTMLButtonAttributes;
|
|
4
|
+
type $$ComponentProps = {
|
|
24
5
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
6
|
+
* general is filter/suggestion since they're the same.
|
|
7
|
+
* | name | use | example | phrasing |
|
|
8
|
+
* |------------|------------------|-------------------------------|--------------------|
|
|
9
|
+
* | input | information item | like a person in the to field | user-entered thing |
|
|
10
|
+
* | assist | smart actions | like add to calendar | start with a verb |
|
|
11
|
+
* | filter | selection | like in a search page | category |
|
|
12
|
+
* | suggestion | smart actions | like a chat response | query/message |
|
|
13
|
+
*/
|
|
14
|
+
variant: "input" | "assist" | "general";
|
|
15
|
+
icon?: IconifyIcon | undefined;
|
|
16
|
+
trailingIcon?: IconifyIcon | undefined;
|
|
35
17
|
elevated?: boolean;
|
|
36
18
|
disabled?: boolean;
|
|
37
19
|
selected?: boolean;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
[evt: string]: CustomEvent<any>;
|
|
44
|
-
}, {
|
|
45
|
-
default: {};
|
|
46
|
-
}, {}, string>;
|
|
47
|
-
type Chip = InstanceType<typeof Chip>;
|
|
20
|
+
children: Snippet;
|
|
21
|
+
click: () => void;
|
|
22
|
+
} & HTMLButtonAttributes;
|
|
23
|
+
declare const Chip: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
24
|
+
type Chip = ReturnType<typeof Chip>;
|
|
48
25
|
export default Chip;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export let percent: number;
|
|
3
|
+
|
|
4
|
+
let { percent, ...extra }: { percent: number } & HTMLAttributes<SVGElement> = $props();
|
|
6
5
|
</script>
|
|
7
6
|
|
|
8
7
|
<svg
|
|
9
8
|
viewBox="0 0 48 48"
|
|
10
9
|
xmlns="http://www.w3.org/2000/svg"
|
|
11
10
|
class="m3-container"
|
|
12
|
-
|
|
13
|
-
style="display: {display}; --percent: {percent}px;"
|
|
11
|
+
style:--percent="{percent}px"
|
|
14
12
|
role="progressbar"
|
|
15
|
-
{...
|
|
13
|
+
{...extra}
|
|
16
14
|
>
|
|
17
15
|
<circle
|
|
18
16
|
cx="24"
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
-
|
|
3
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
-
$$bindings?: Bindings;
|
|
5
|
-
} & Exports;
|
|
6
|
-
(internal: unknown, props: Props & {
|
|
7
|
-
$$events?: Events;
|
|
8
|
-
$$slots?: Slots;
|
|
9
|
-
}): Exports & {
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const CircularProgress: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
-
display?: string;
|
|
17
|
-
extraOptions?: HTMLAttributes<SVGElement>;
|
|
2
|
+
type $$ComponentProps = {
|
|
18
3
|
percent: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
type CircularProgress = InstanceType<typeof CircularProgress>;
|
|
4
|
+
} & HTMLAttributes<SVGElement>;
|
|
5
|
+
declare const CircularProgress: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type CircularProgress = ReturnType<typeof CircularProgress>;
|
|
23
7
|
export default CircularProgress;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
let extra: HTMLAttributes<SVGElement> = $props();
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<svg
|
|
8
8
|
viewBox="0 0 48 48"
|
|
9
9
|
xmlns="http://www.w3.org/2000/svg"
|
|
10
10
|
class="m3-container"
|
|
11
|
-
style="display: {display};"
|
|
12
11
|
role="progressbar"
|
|
13
|
-
{...
|
|
12
|
+
{...extra}
|
|
14
13
|
>
|
|
15
14
|
<circle
|
|
16
15
|
cx="24"
|