m3-svelte 4.0.0-beta.0 → 4.0.0-beta.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 +22 -8
- package/package/buttons/Button.svelte.d.ts +1 -1
- package/package/buttons/TogglePrimitive.svelte +20 -0
- package/package/buttons/TogglePrimitive.svelte.d.ts +10 -0
- package/package/index.d.ts +3 -6
- package/package/index.js +3 -6
- package/package/misc/Layer.svelte +1 -3
- package/package/misc/Layer.svelte.d.ts +1 -4
- package/package/misc/_ripple.svelte +0 -4
- package/package/misc/_ripple.svelte.d.ts +1 -4
- package/package/misc/_ripplesimple.svelte +1 -3
- package/package/misc/_ripplesimple.svelte.d.ts +5 -5
- package/package/nav/NavCMLX.svelte +69 -0
- package/package/nav/NavCMLX.svelte.d.ts +8 -0
- package/package/nav/NavCMLXItem.svelte +286 -0
- package/package/nav/NavCMLXItem.svelte.d.ts +16 -0
- package/package.json +1 -1
- package/package/nav/NavDrawer.svelte +0 -23
- package/package/nav/NavDrawer.svelte.d.ts +0 -7
- package/package/nav/NavDrawerButton.svelte +0 -73
- package/package/nav/NavDrawerButton.svelte.d.ts +0 -12
- package/package/nav/NavDrawerLink.svelte +0 -71
- package/package/nav/NavDrawerLink.svelte.d.ts +0 -12
- package/package/nav/NavList.svelte +0 -46
- package/package/nav/NavList.svelte.d.ts +0 -8
- package/package/nav/NavListButton.svelte +0 -136
- package/package/nav/NavListButton.svelte.d.ts +0 -13
- package/package/nav/NavListLink.svelte +0 -134
- package/package/nav/NavListLink.svelte.d.ts +0 -13
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
| ({ href: string } & HTMLAnchorAttributes)
|
|
14
14
|
| ({ for: string } & HTMLLabelAttributes);
|
|
15
15
|
type Props = {
|
|
16
|
-
variant
|
|
16
|
+
variant?: "elevated" | "filled" | "tonal" | "outlined" | "text";
|
|
17
17
|
square?: boolean;
|
|
18
18
|
iconType?: "none" | "left" | "full";
|
|
19
19
|
children: Snippet;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
{#if "click" in props}
|
|
26
26
|
{@const {
|
|
27
|
-
variant,
|
|
27
|
+
variant = "filled",
|
|
28
28
|
click,
|
|
29
29
|
disabled,
|
|
30
30
|
square = false,
|
|
@@ -39,29 +39,43 @@
|
|
|
39
39
|
class:square
|
|
40
40
|
{...extra}
|
|
41
41
|
>
|
|
42
|
-
<Layer
|
|
42
|
+
<Layer />
|
|
43
43
|
{@render children()}
|
|
44
44
|
</button>
|
|
45
45
|
{:else if "href" in props}
|
|
46
|
-
{@const {
|
|
46
|
+
{@const {
|
|
47
|
+
variant = "filled",
|
|
48
|
+
href,
|
|
49
|
+
square = false,
|
|
50
|
+
iconType = "none",
|
|
51
|
+
children,
|
|
52
|
+
...extra
|
|
53
|
+
} = props}
|
|
47
54
|
<a
|
|
48
55
|
{href}
|
|
49
56
|
class="m3-container m3-font-label-large {variant} icon-{iconType}"
|
|
50
57
|
class:square
|
|
51
58
|
{...extra}
|
|
52
59
|
>
|
|
53
|
-
<Layer
|
|
60
|
+
<Layer />
|
|
54
61
|
{@render children()}
|
|
55
62
|
</a>
|
|
56
63
|
{:else}
|
|
57
|
-
{@const {
|
|
64
|
+
{@const {
|
|
65
|
+
variant = "filled",
|
|
66
|
+
for: forItem,
|
|
67
|
+
square = false,
|
|
68
|
+
iconType = "none",
|
|
69
|
+
children,
|
|
70
|
+
...extra
|
|
71
|
+
} = props}
|
|
58
72
|
<label
|
|
59
73
|
for={forItem}
|
|
60
74
|
class="m3-container m3-font-label-large {variant} icon-{iconType}"
|
|
61
75
|
class:square
|
|
62
76
|
{...extra}
|
|
63
77
|
>
|
|
64
|
-
<Layer
|
|
78
|
+
<Layer />
|
|
65
79
|
{@render children()}
|
|
66
80
|
</label>
|
|
67
81
|
{/if}
|
|
@@ -82,6 +96,7 @@
|
|
|
82
96
|
|
|
83
97
|
align-items: center;
|
|
84
98
|
justify-content: center;
|
|
99
|
+
background-color: transparent;
|
|
85
100
|
cursor: pointer;
|
|
86
101
|
user-select: none;
|
|
87
102
|
position: relative;
|
|
@@ -143,7 +158,6 @@
|
|
|
143
158
|
background-color: transparent;
|
|
144
159
|
}
|
|
145
160
|
&.text:not(:disabled, :global(input:disabled) + label) {
|
|
146
|
-
background-color: transparent;
|
|
147
161
|
color: rgb(var(--m3-scheme-primary));
|
|
148
162
|
}
|
|
149
163
|
@media (hover: hover) {
|
|
@@ -9,7 +9,7 @@ type ActionProps = ({
|
|
|
9
9
|
for: string;
|
|
10
10
|
} & HTMLLabelAttributes);
|
|
11
11
|
type Props = {
|
|
12
|
-
variant
|
|
12
|
+
variant?: "elevated" | "filled" | "tonal" | "outlined" | "text";
|
|
13
13
|
square?: boolean;
|
|
14
14
|
iconType?: "none" | "left" | "full";
|
|
15
15
|
children: Snippet;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
toggle = $bindable(),
|
|
7
|
+
variant,
|
|
8
|
+
round = false,
|
|
9
|
+
children,
|
|
10
|
+
}: {
|
|
11
|
+
toggle: boolean;
|
|
12
|
+
variant?: "filled" | "tonal";
|
|
13
|
+
round?: boolean;
|
|
14
|
+
children: Snippet;
|
|
15
|
+
} = $props();
|
|
16
|
+
const id = crypto.randomUUID();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<input type="checkbox" {id} bind:checked={toggle} />
|
|
20
|
+
<Button for={id} {variant} square={!round} {children} />
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
toggle: boolean;
|
|
4
|
+
variant?: "filled" | "tonal";
|
|
5
|
+
round?: boolean;
|
|
6
|
+
children: Snippet;
|
|
7
|
+
};
|
|
8
|
+
declare const TogglePrimitive: import("svelte").Component<$$ComponentProps, {}, "toggle">;
|
|
9
|
+
type TogglePrimitive = ReturnType<typeof TogglePrimitive>;
|
|
10
|
+
export default TogglePrimitive;
|
package/package/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./misc/serializeScheme.js";
|
|
|
8
8
|
export { default as Button } from "./buttons/Button.svelte";
|
|
9
9
|
export { default as ConnectedButtons } from "./buttons/ConnectedButtons.svelte";
|
|
10
10
|
export { default as FAB } from "./buttons/FAB.svelte";
|
|
11
|
+
export { default as TogglePrimitive } from "./buttons/TogglePrimitive.svelte";
|
|
11
12
|
export { default as BottomSheet } from "./containers/BottomSheet.svelte";
|
|
12
13
|
export { default as Card } from "./containers/Card.svelte";
|
|
13
14
|
export { default as Dialog } from "./containers/Dialog.svelte";
|
|
@@ -34,12 +35,8 @@ export { default as TextFieldOutlined } from "./forms/TextFieldOutlined.svelte";
|
|
|
34
35
|
export { default as TextFieldOutlinedMultiline } from "./forms/TextFieldOutlinedMultiline.svelte";
|
|
35
36
|
export { default as DatePickerDocked } from "./forms/DatePickerDocked.svelte";
|
|
36
37
|
export { default as Chip } from "./forms/Chip.svelte";
|
|
37
|
-
export { default as
|
|
38
|
-
export { default as
|
|
39
|
-
export { default as NavDrawerLink } from "./nav/NavDrawerLink.svelte";
|
|
40
|
-
export { default as NavList } from "./nav/NavList.svelte";
|
|
41
|
-
export { default as NavListButton } from "./nav/NavListButton.svelte";
|
|
42
|
-
export { default as NavListLink } from "./nav/NavListLink.svelte";
|
|
38
|
+
export { default as NavCMLX } from "./nav/NavCMLX.svelte";
|
|
39
|
+
export { default as NavCMLXItem } from "./nav/NavCMLXItem.svelte";
|
|
43
40
|
export { default as Tabs } from "./nav/Tabs.svelte";
|
|
44
41
|
export { default as TabsLink } from "./nav/TabsLink.svelte";
|
|
45
42
|
export { default as VariableTabs } from "./nav/VariableTabs.svelte";
|
package/package/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./misc/serializeScheme.js";
|
|
|
8
8
|
export { default as Button } from "./buttons/Button.svelte";
|
|
9
9
|
export { default as ConnectedButtons } from "./buttons/ConnectedButtons.svelte";
|
|
10
10
|
export { default as FAB } from "./buttons/FAB.svelte";
|
|
11
|
+
export { default as TogglePrimitive } from "./buttons/TogglePrimitive.svelte";
|
|
11
12
|
export { default as BottomSheet } from "./containers/BottomSheet.svelte";
|
|
12
13
|
export { default as Card } from "./containers/Card.svelte";
|
|
13
14
|
export { default as Dialog } from "./containers/Dialog.svelte";
|
|
@@ -33,12 +34,8 @@ export { default as TextFieldOutlined } from "./forms/TextFieldOutlined.svelte";
|
|
|
33
34
|
export { default as TextFieldOutlinedMultiline } from "./forms/TextFieldOutlinedMultiline.svelte";
|
|
34
35
|
export { default as DatePickerDocked } from "./forms/DatePickerDocked.svelte";
|
|
35
36
|
export { default as Chip } from "./forms/Chip.svelte";
|
|
36
|
-
export { default as
|
|
37
|
-
export { default as
|
|
38
|
-
export { default as NavDrawerLink } from "./nav/NavDrawerLink.svelte";
|
|
39
|
-
export { default as NavList } from "./nav/NavList.svelte";
|
|
40
|
-
export { default as NavListButton } from "./nav/NavListButton.svelte";
|
|
41
|
-
export { default as NavListLink } from "./nav/NavListLink.svelte";
|
|
37
|
+
export { default as NavCMLX } from "./nav/NavCMLX.svelte";
|
|
38
|
+
export { default as NavCMLXItem } from "./nav/NavCMLXItem.svelte";
|
|
42
39
|
export { default as Tabs } from "./nav/Tabs.svelte";
|
|
43
40
|
export { default as TabsLink } from "./nav/TabsLink.svelte";
|
|
44
41
|
export { default as VariableTabs } from "./nav/VariableTabs.svelte";
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
import Ripple from "./_ripple.svelte";
|
|
3
3
|
import RippleSimple from "./_ripplesimple.svelte";
|
|
4
4
|
|
|
5
|
-
let { morph = false }: { morph?: boolean } = $props();
|
|
6
|
-
|
|
7
5
|
let ripple = $state(RippleSimple);
|
|
8
6
|
if (
|
|
9
7
|
// @ts-expect-error about M3_SVELTE_NO_RIPPLE
|
|
@@ -16,4 +14,4 @@
|
|
|
16
14
|
const Component = $derived(ripple);
|
|
17
15
|
</script>
|
|
18
16
|
|
|
19
|
-
<Component
|
|
17
|
+
<Component />
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
morph?: boolean;
|
|
3
|
-
};
|
|
4
|
-
declare const Layer: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
1
|
+
declare const Layer: import("svelte").Component<Record<string, never>, {}, "">;
|
|
5
2
|
type Layer = ReturnType<typeof Layer>;
|
|
6
3
|
export default Layer;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
morph: boolean;
|
|
3
|
-
};
|
|
4
|
-
declare const Ripple: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
1
|
+
declare const Ripple: import("svelte").Component<Record<string, never>, {}, "">;
|
|
5
2
|
type Ripple = ReturnType<typeof Ripple>;
|
|
6
3
|
export default Ripple;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
type $$ComponentProps = {
|
|
2
|
-
morph: boolean;
|
|
3
|
-
};
|
|
4
|
-
declare const Ripplesimple: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
5
|
-
type Ripplesimple = ReturnType<typeof Ripplesimple>;
|
|
6
1
|
export default Ripplesimple;
|
|
2
|
+
type Ripplesimple = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Record<string, never>>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Ripplesimple: import("svelte").Component<Record<string, never>, {}, "">;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
variant,
|
|
6
|
+
children,
|
|
7
|
+
}: {
|
|
8
|
+
variant: "compact" | "medium" | "large" | "expanded" | "auto";
|
|
9
|
+
children: Snippet;
|
|
10
|
+
} = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<nav class="m3-container {variant}">
|
|
14
|
+
{@render children()}
|
|
15
|
+
</nav>
|
|
16
|
+
|
|
17
|
+
<style>
|
|
18
|
+
.m3-container {
|
|
19
|
+
display: flex;
|
|
20
|
+
&.compact,
|
|
21
|
+
&.medium {
|
|
22
|
+
background-color: rgb(var(--m3-scheme-surface-container));
|
|
23
|
+
}
|
|
24
|
+
&.compact {
|
|
25
|
+
justify-content: space-evenly;
|
|
26
|
+
}
|
|
27
|
+
&.medium {
|
|
28
|
+
justify-content: center;
|
|
29
|
+
}
|
|
30
|
+
&.large,
|
|
31
|
+
&.expanded {
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
}
|
|
34
|
+
&.large {
|
|
35
|
+
width: 6rem;
|
|
36
|
+
gap: 0.25rem;
|
|
37
|
+
}
|
|
38
|
+
&.expanded {
|
|
39
|
+
padding-top: 1.25rem;
|
|
40
|
+
min-width: 13.75rem;
|
|
41
|
+
max-width: 22.5rem;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
.m3-container.auto {
|
|
45
|
+
@media (width < 37.5rem) {
|
|
46
|
+
/* Compact */
|
|
47
|
+
background-color: rgb(var(--m3-scheme-surface-container));
|
|
48
|
+
justify-content: space-evenly;
|
|
49
|
+
}
|
|
50
|
+
@media (37.5rem <= width < 52.5rem) {
|
|
51
|
+
/* Medium */
|
|
52
|
+
background-color: rgb(var(--m3-scheme-surface-container));
|
|
53
|
+
justify-content: center;
|
|
54
|
+
}
|
|
55
|
+
@media (52.5rem <= width < 100rem) {
|
|
56
|
+
/* Large */
|
|
57
|
+
gap: 0.25rem;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
width: 6rem;
|
|
60
|
+
}
|
|
61
|
+
@media (100rem <= width) {
|
|
62
|
+
/* Expanded */
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
padding-top: 1.25rem;
|
|
65
|
+
min-width: 13.75rem;
|
|
66
|
+
max-width: 22.5rem;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
variant: "compact" | "medium" | "large" | "expanded" | "auto";
|
|
4
|
+
children: Snippet;
|
|
5
|
+
};
|
|
6
|
+
declare const NavCmlx: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type NavCmlx = ReturnType<typeof NavCmlx>;
|
|
8
|
+
export default NavCmlx;
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { IconifyIcon } from "@iconify/types";
|
|
3
|
+
import type { HTMLButtonAttributes, HTMLAnchorAttributes } from "svelte/elements";
|
|
4
|
+
import Icon from "../misc/_icon.svelte";
|
|
5
|
+
import Layer from "../misc/Layer.svelte";
|
|
6
|
+
|
|
7
|
+
type ActionProps =
|
|
8
|
+
| ({ click: () => void } & HTMLButtonAttributes)
|
|
9
|
+
| ({ href: string } & HTMLAnchorAttributes);
|
|
10
|
+
let props: {
|
|
11
|
+
variant: "compact" | "medium" | "large" | "expanded" | "auto";
|
|
12
|
+
icon: IconifyIcon;
|
|
13
|
+
text: string;
|
|
14
|
+
selected: boolean;
|
|
15
|
+
} & ActionProps = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
{#if "click" in props}
|
|
19
|
+
{@const { variant, icon, text, selected, click, ...extra } = props}
|
|
20
|
+
<button
|
|
21
|
+
onclick={click}
|
|
22
|
+
class="m3-container m3-font-label-medium {variant}"
|
|
23
|
+
class:selected
|
|
24
|
+
{...extra}
|
|
25
|
+
>
|
|
26
|
+
<div class="content">
|
|
27
|
+
<Layer />
|
|
28
|
+
<div class="icon">
|
|
29
|
+
<Icon {icon} width="1.5rem" height="1.5rem" />
|
|
30
|
+
</div>
|
|
31
|
+
{text}
|
|
32
|
+
</div>
|
|
33
|
+
</button>
|
|
34
|
+
{:else}
|
|
35
|
+
{@const { variant, icon, text, selected, href, ...extra } = props}
|
|
36
|
+
<a {href} class="m3-container m3-font-label-medium {variant}" {...extra}>
|
|
37
|
+
<div class="content" class:selected>
|
|
38
|
+
<Layer />
|
|
39
|
+
<div class="icon">
|
|
40
|
+
<Icon {icon} width="1.5rem" height="1.5rem" />
|
|
41
|
+
</div>
|
|
42
|
+
{text}
|
|
43
|
+
</div>
|
|
44
|
+
</a>
|
|
45
|
+
{/if}
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
.m3-container {
|
|
49
|
+
display: flex;
|
|
50
|
+
|
|
51
|
+
.content {
|
|
52
|
+
display: flex;
|
|
53
|
+
gap: 0.25rem;
|
|
54
|
+
align-items: center;
|
|
55
|
+
position: relative;
|
|
56
|
+
color: rgb(var(--m3-scheme-on-surface-variant));
|
|
57
|
+
transition: all var(--m3-util-easing);
|
|
58
|
+
&:is(.compact .content, .large .content) {
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
&.selected {
|
|
61
|
+
color: rgb(var(--m3-scheme-secondary));
|
|
62
|
+
> .icon {
|
|
63
|
+
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
64
|
+
}
|
|
65
|
+
> .icon::before {
|
|
66
|
+
opacity: 1;
|
|
67
|
+
width: 100%;
|
|
68
|
+
inset: 0;
|
|
69
|
+
transition:
|
|
70
|
+
width var(--m3-util-easing-fast-spatial),
|
|
71
|
+
inset var(--m3-util-easing-fast-spatial);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
&:hover {
|
|
75
|
+
> .icon {
|
|
76
|
+
background-color: color-mix(in srgb-linear, currentColor 8%, transparent);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
&:focus-visible,
|
|
80
|
+
&:active {
|
|
81
|
+
> .icon {
|
|
82
|
+
background-color: color-mix(in srgb-linear, currentColor 12%, transparent);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
> .icon {
|
|
86
|
+
width: 3.5rem;
|
|
87
|
+
height: 2rem;
|
|
88
|
+
}
|
|
89
|
+
> :global(:is(.ripple-container, .tint)) {
|
|
90
|
+
display: none;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
&:is(.medium .content, .expanded .content) {
|
|
94
|
+
padding-inline: 1rem;
|
|
95
|
+
border-radius: var(--m3-util-rounding-full);
|
|
96
|
+
&.selected {
|
|
97
|
+
background-color: rgb(var(--m3-scheme-secondary-container));
|
|
98
|
+
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
&:is(.expanded .content) {
|
|
102
|
+
gap: 0.75rem;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
.icon {
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
border-radius: var(--m3-util-rounding-full);
|
|
110
|
+
position: relative;
|
|
111
|
+
transition: all var(--m3-util-easing);
|
|
112
|
+
}
|
|
113
|
+
.icon::before {
|
|
114
|
+
position: absolute;
|
|
115
|
+
display: block;
|
|
116
|
+
content: " ";
|
|
117
|
+
background-color: rgb(var(--m3-scheme-secondary-container));
|
|
118
|
+
|
|
119
|
+
opacity: 0;
|
|
120
|
+
inset: 0 50%;
|
|
121
|
+
width: 0;
|
|
122
|
+
border-radius: 2rem;
|
|
123
|
+
transition:
|
|
124
|
+
opacity var(--m3-util-easing),
|
|
125
|
+
inset 0ms 500ms,
|
|
126
|
+
width 0ms 500ms;
|
|
127
|
+
}
|
|
128
|
+
.icon > :global(svg) {
|
|
129
|
+
z-index: 1;
|
|
130
|
+
}
|
|
131
|
+
&.compact {
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
height: 4rem;
|
|
134
|
+
padding-block: 0.375rem;
|
|
135
|
+
}
|
|
136
|
+
&.medium {
|
|
137
|
+
height: 4rem;
|
|
138
|
+
padding-block: 0.75rem;
|
|
139
|
+
}
|
|
140
|
+
&.large {
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
height: 4rem;
|
|
143
|
+
padding-block: 0.375rem;
|
|
144
|
+
}
|
|
145
|
+
&.expanded {
|
|
146
|
+
height: 3.5rem;
|
|
147
|
+
padding-inline: 1.25rem;
|
|
148
|
+
font-size: var(--m3-font-label-large-size, 0.875rem);
|
|
149
|
+
line-height: var(--m3-font-label-large-height, 1.429);
|
|
150
|
+
letter-spacing: var(--m3-font-label-large-tracking, 0.006rem);
|
|
151
|
+
font-weight: var(--m3-font-label-large-weight, 500);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.m3-container.auto {
|
|
156
|
+
@media (width < 37.5rem) {
|
|
157
|
+
/* Compact */
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
height: 4rem;
|
|
160
|
+
padding-block: 0.375rem;
|
|
161
|
+
|
|
162
|
+
.content {
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
|
|
165
|
+
&.selected {
|
|
166
|
+
color: rgb(var(--m3-scheme-secondary));
|
|
167
|
+
> .icon {
|
|
168
|
+
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
169
|
+
}
|
|
170
|
+
> .icon::before {
|
|
171
|
+
opacity: 1;
|
|
172
|
+
width: 100%;
|
|
173
|
+
inset: 0;
|
|
174
|
+
transition:
|
|
175
|
+
width var(--m3-util-easing-fast-spatial),
|
|
176
|
+
inset var(--m3-util-easing-fast-spatial);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&:hover {
|
|
181
|
+
> .icon {
|
|
182
|
+
background-color: color-mix(in srgb-linear, currentColor 8%, transparent);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&:focus-visible,
|
|
187
|
+
&:active {
|
|
188
|
+
> .icon {
|
|
189
|
+
background-color: color-mix(in srgb-linear, currentColor 12%, transparent);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
> .icon {
|
|
194
|
+
width: 3.5rem;
|
|
195
|
+
height: 2rem;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
> :global(:is(.ripple-container, .tint)) {
|
|
199
|
+
display: none;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
@media (37.5rem <= width < 52.5rem) {
|
|
204
|
+
/* Medium */
|
|
205
|
+
height: 4rem;
|
|
206
|
+
padding-block: 0.75rem;
|
|
207
|
+
|
|
208
|
+
.content {
|
|
209
|
+
padding-inline: 1rem;
|
|
210
|
+
border-radius: var(--m3-util-rounding-full);
|
|
211
|
+
|
|
212
|
+
&.selected {
|
|
213
|
+
background-color: rgb(var(--m3-scheme-secondary-container));
|
|
214
|
+
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
@media (52.5rem <= width < 100rem) {
|
|
219
|
+
/* Large */
|
|
220
|
+
flex-direction: column;
|
|
221
|
+
height: 4rem;
|
|
222
|
+
padding-block: 0.375rem;
|
|
223
|
+
|
|
224
|
+
.content {
|
|
225
|
+
flex-direction: column;
|
|
226
|
+
|
|
227
|
+
&.selected {
|
|
228
|
+
color: rgb(var(--m3-scheme-secondary));
|
|
229
|
+
> .icon {
|
|
230
|
+
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
231
|
+
}
|
|
232
|
+
> .icon::before {
|
|
233
|
+
opacity: 1;
|
|
234
|
+
width: 100%;
|
|
235
|
+
inset: 0;
|
|
236
|
+
transition:
|
|
237
|
+
width var(--m3-util-easing-fast-spatial),
|
|
238
|
+
inset var(--m3-util-easing-fast-spatial);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
&:hover {
|
|
243
|
+
> .icon {
|
|
244
|
+
background-color: color-mix(in srgb-linear, currentColor 8%, transparent);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
&:focus-visible,
|
|
249
|
+
&:active {
|
|
250
|
+
> .icon {
|
|
251
|
+
background-color: color-mix(in srgb-linear, currentColor 12%, transparent);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
> .icon {
|
|
256
|
+
width: 3.5rem;
|
|
257
|
+
height: 2rem;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
> :global(:is(.ripple-container, .tint)) {
|
|
261
|
+
display: none;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
@media (100rem <= width) {
|
|
266
|
+
/* Expanded */
|
|
267
|
+
height: 3.5rem;
|
|
268
|
+
padding-inline: 1.25rem;
|
|
269
|
+
font-size: var(--m3-font-label-large-size, 0.875rem);
|
|
270
|
+
line-height: var(--m3-font-label-large-height, 1.429);
|
|
271
|
+
letter-spacing: var(--m3-font-label-large-tracking, 0.006rem);
|
|
272
|
+
font-weight: var(--m3-font-label-large-weight, 500);
|
|
273
|
+
|
|
274
|
+
.content {
|
|
275
|
+
padding-inline: 1rem;
|
|
276
|
+
border-radius: var(--m3-util-rounding-full);
|
|
277
|
+
gap: 0.75rem;
|
|
278
|
+
|
|
279
|
+
&.selected {
|
|
280
|
+
background-color: rgb(var(--m3-scheme-secondary-container));
|
|
281
|
+
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IconifyIcon } from "@iconify/types";
|
|
2
|
+
import type { HTMLButtonAttributes, HTMLAnchorAttributes } from "svelte/elements";
|
|
3
|
+
type ActionProps = ({
|
|
4
|
+
click: () => void;
|
|
5
|
+
} & HTMLButtonAttributes) | ({
|
|
6
|
+
href: string;
|
|
7
|
+
} & HTMLAnchorAttributes);
|
|
8
|
+
type $$ComponentProps = {
|
|
9
|
+
variant: "compact" | "medium" | "large" | "expanded" | "auto";
|
|
10
|
+
icon: IconifyIcon;
|
|
11
|
+
text: string;
|
|
12
|
+
selected: boolean;
|
|
13
|
+
} & ActionProps;
|
|
14
|
+
declare const NavCmlxItem: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
15
|
+
type NavCmlxItem = ReturnType<typeof NavCmlxItem>;
|
|
16
|
+
export default NavCmlxItem;
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from "svelte";
|
|
3
|
-
|
|
4
|
-
let {
|
|
5
|
-
children,
|
|
6
|
-
}: {
|
|
7
|
-
children: Snippet;
|
|
8
|
-
} = $props();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<nav class="m3-container">
|
|
12
|
-
{@render children()}
|
|
13
|
-
</nav>
|
|
14
|
-
|
|
15
|
-
<style>
|
|
16
|
-
.m3-container {
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
width: 22.5rem;
|
|
20
|
-
padding: 1rem 0.75rem 0 0.75rem;
|
|
21
|
-
background-color: rgb(var(--m3-scheme-surface));
|
|
22
|
-
}
|
|
23
|
-
</style>
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from "svelte";
|
|
3
|
-
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
4
|
-
import type { IconifyIcon } from "@iconify/types";
|
|
5
|
-
import Icon from "../misc/_icon.svelte";
|
|
6
|
-
import Layer from "../misc/Layer.svelte";
|
|
7
|
-
|
|
8
|
-
let {
|
|
9
|
-
selected,
|
|
10
|
-
icon,
|
|
11
|
-
children,
|
|
12
|
-
click,
|
|
13
|
-
...extra
|
|
14
|
-
}: {
|
|
15
|
-
selected: boolean;
|
|
16
|
-
icon: IconifyIcon;
|
|
17
|
-
children: Snippet;
|
|
18
|
-
click: () => void;
|
|
19
|
-
} & HTMLButtonAttributes = $props();
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<button class="destination" disabled={selected} onclick={click} {...extra}>
|
|
23
|
-
<Layer />
|
|
24
|
-
<Icon {icon} />
|
|
25
|
-
<span class="m3-font-label-large">{@render children()}</span>
|
|
26
|
-
</button>
|
|
27
|
-
|
|
28
|
-
<style>
|
|
29
|
-
.destination {
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
gap: 0.75rem;
|
|
33
|
-
position: relative;
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
|
|
36
|
-
height: 3.5rem;
|
|
37
|
-
border: none;
|
|
38
|
-
border-radius: 1.75rem;
|
|
39
|
-
padding: 0 1.5rem 0 1rem;
|
|
40
|
-
|
|
41
|
-
background-color: transparent;
|
|
42
|
-
color: rgb(var(--m3-scheme-on-surface-variant));
|
|
43
|
-
transition: all 300ms;
|
|
44
|
-
-webkit-tap-highlight-color: transparent;
|
|
45
|
-
cursor: pointer;
|
|
46
|
-
}
|
|
47
|
-
.destination :global(svg) {
|
|
48
|
-
width: 1.5rem;
|
|
49
|
-
height: 1.5rem;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@media (hover: hover) {
|
|
53
|
-
.destination:hover {
|
|
54
|
-
color: rgb(var(--m3-scheme-on-surface));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.destination:disabled {
|
|
59
|
-
background-color: rgb(var(--m3-scheme-secondary-container));
|
|
60
|
-
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
61
|
-
cursor: auto;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.destination {
|
|
65
|
-
print-color-adjust: exact;
|
|
66
|
-
-webkit-print-color-adjust: exact;
|
|
67
|
-
}
|
|
68
|
-
@media screen and (forced-colors: active) {
|
|
69
|
-
.destination:disabled {
|
|
70
|
-
background-color: selecteditem;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
</style>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from "svelte";
|
|
2
|
-
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
3
|
-
import type { IconifyIcon } from "@iconify/types";
|
|
4
|
-
type $$ComponentProps = {
|
|
5
|
-
selected: boolean;
|
|
6
|
-
icon: IconifyIcon;
|
|
7
|
-
children: Snippet;
|
|
8
|
-
click: () => void;
|
|
9
|
-
} & HTMLButtonAttributes;
|
|
10
|
-
declare const NavDrawerButton: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
11
|
-
type NavDrawerButton = ReturnType<typeof NavDrawerButton>;
|
|
12
|
-
export default NavDrawerButton;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from "svelte";
|
|
3
|
-
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
4
|
-
import type { IconifyIcon } from "@iconify/types";
|
|
5
|
-
import Icon from "../misc/_icon.svelte";
|
|
6
|
-
import Layer from "../misc/Layer.svelte";
|
|
7
|
-
|
|
8
|
-
let {
|
|
9
|
-
selected,
|
|
10
|
-
icon,
|
|
11
|
-
children,
|
|
12
|
-
href,
|
|
13
|
-
...extra
|
|
14
|
-
}: {
|
|
15
|
-
selected: boolean;
|
|
16
|
-
icon: IconifyIcon;
|
|
17
|
-
children: Snippet;
|
|
18
|
-
href: string;
|
|
19
|
-
} & HTMLAnchorAttributes = $props();
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<a {href} class="destination" class:selected {...extra}>
|
|
23
|
-
<Layer />
|
|
24
|
-
<Icon {icon} />
|
|
25
|
-
<span class="m3-font-label-large">{@render children?.()}</span>
|
|
26
|
-
</a>
|
|
27
|
-
|
|
28
|
-
<style>
|
|
29
|
-
.destination {
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
gap: 0.75rem;
|
|
33
|
-
position: relative;
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
|
|
36
|
-
height: 3.5rem;
|
|
37
|
-
border-radius: 1.75rem;
|
|
38
|
-
padding: 0 1.5rem 0 1rem;
|
|
39
|
-
|
|
40
|
-
background-color: transparent;
|
|
41
|
-
color: rgb(var(--m3-scheme-on-surface-variant));
|
|
42
|
-
transition: all 300ms;
|
|
43
|
-
-webkit-tap-highlight-color: transparent;
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
}
|
|
46
|
-
.destination :global(svg) {
|
|
47
|
-
width: 1.5rem;
|
|
48
|
-
height: 1.5rem;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@media (hover: hover) {
|
|
52
|
-
.destination:hover {
|
|
53
|
-
color: rgb(var(--m3-scheme-on-surface));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.destination.selected {
|
|
58
|
-
background-color: rgb(var(--m3-scheme-secondary-container));
|
|
59
|
-
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.destination {
|
|
63
|
-
print-color-adjust: exact;
|
|
64
|
-
-webkit-print-color-adjust: exact;
|
|
65
|
-
}
|
|
66
|
-
@media screen and (forced-colors: active) {
|
|
67
|
-
.destination.selected {
|
|
68
|
-
background-color: selecteditem;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
</style>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from "svelte";
|
|
2
|
-
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
3
|
-
import type { IconifyIcon } from "@iconify/types";
|
|
4
|
-
type $$ComponentProps = {
|
|
5
|
-
selected: boolean;
|
|
6
|
-
icon: IconifyIcon;
|
|
7
|
-
children: Snippet;
|
|
8
|
-
href: string;
|
|
9
|
-
} & HTMLAnchorAttributes;
|
|
10
|
-
declare const NavDrawerLink: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
11
|
-
type NavDrawerLink = ReturnType<typeof NavDrawerLink>;
|
|
12
|
-
export default NavDrawerLink;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from "svelte";
|
|
3
|
-
|
|
4
|
-
let {
|
|
5
|
-
variant,
|
|
6
|
-
children,
|
|
7
|
-
}: {
|
|
8
|
-
variant: "rail" | "bar" | "auto";
|
|
9
|
-
children: Snippet;
|
|
10
|
-
} = $props();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<nav class="m3-container {variant}">
|
|
14
|
-
{@render children()}
|
|
15
|
-
</nav>
|
|
16
|
-
|
|
17
|
-
<style>
|
|
18
|
-
.m3-container {
|
|
19
|
-
display: flex;
|
|
20
|
-
position: relative;
|
|
21
|
-
flex-grow: 1;
|
|
22
|
-
background-color: rgb(var(--m3-scheme-surface-container));
|
|
23
|
-
padding: 0.75rem 0.5rem 1rem 0.5rem;
|
|
24
|
-
justify-content: space-evenly;
|
|
25
|
-
gap: 0.5rem;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.rail {
|
|
29
|
-
background-color: rgb(var(--m3-scheme-surface));
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
width: 5rem;
|
|
32
|
-
padding: 3.5rem 0;
|
|
33
|
-
justify-content: flex-start;
|
|
34
|
-
gap: 0.75rem;
|
|
35
|
-
}
|
|
36
|
-
@media (min-width: 37.5rem) {
|
|
37
|
-
.auto {
|
|
38
|
-
background-color: rgb(var(--m3-scheme-surface));
|
|
39
|
-
flex-direction: column;
|
|
40
|
-
width: 5rem;
|
|
41
|
-
padding: 3.5rem 0;
|
|
42
|
-
justify-content: flex-start;
|
|
43
|
-
gap: 0.75rem;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
</style>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from "svelte";
|
|
2
|
-
type $$ComponentProps = {
|
|
3
|
-
variant: "rail" | "bar" | "auto";
|
|
4
|
-
children: Snippet;
|
|
5
|
-
};
|
|
6
|
-
declare const NavList: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
-
type NavList = ReturnType<typeof NavList>;
|
|
8
|
-
export default NavList;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from "svelte";
|
|
3
|
-
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
4
|
-
import type { IconifyIcon } from "@iconify/types";
|
|
5
|
-
import Icon from "../misc/_icon.svelte";
|
|
6
|
-
|
|
7
|
-
let {
|
|
8
|
-
variant,
|
|
9
|
-
selected,
|
|
10
|
-
icon,
|
|
11
|
-
children,
|
|
12
|
-
click,
|
|
13
|
-
...extra
|
|
14
|
-
}: {
|
|
15
|
-
variant: "rail" | "bar" | "auto";
|
|
16
|
-
selected: boolean;
|
|
17
|
-
icon: IconifyIcon;
|
|
18
|
-
children: Snippet;
|
|
19
|
-
click: () => void;
|
|
20
|
-
} & HTMLButtonAttributes = $props();
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<button class="m3-container {variant}" class:selected onclick={click} {...extra}>
|
|
24
|
-
<div class="icon-space">
|
|
25
|
-
<Icon {icon} />
|
|
26
|
-
</div>
|
|
27
|
-
<p class="m3-font-label-medium">{@render children()}</p>
|
|
28
|
-
</button>
|
|
29
|
-
|
|
30
|
-
<style>
|
|
31
|
-
.m3-container {
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-direction: column;
|
|
34
|
-
height: 3.25rem;
|
|
35
|
-
gap: 0.25rem;
|
|
36
|
-
padding: 0;
|
|
37
|
-
border: none;
|
|
38
|
-
align-items: stretch;
|
|
39
|
-
text-align: center;
|
|
40
|
-
|
|
41
|
-
background-color: transparent;
|
|
42
|
-
--text: var(--m3-scheme-on-surface-variant);
|
|
43
|
-
color: rgb(var(--text));
|
|
44
|
-
-webkit-tap-highlight-color: transparent;
|
|
45
|
-
cursor: pointer;
|
|
46
|
-
}
|
|
47
|
-
.icon-space {
|
|
48
|
-
display: flex;
|
|
49
|
-
flex: none;
|
|
50
|
-
align-self: center;
|
|
51
|
-
justify-content: center;
|
|
52
|
-
align-items: center;
|
|
53
|
-
|
|
54
|
-
position: relative;
|
|
55
|
-
width: 4rem;
|
|
56
|
-
height: 2rem;
|
|
57
|
-
border-radius: 2rem;
|
|
58
|
-
transition: background-color 200ms;
|
|
59
|
-
}
|
|
60
|
-
.icon-space::before {
|
|
61
|
-
position: absolute;
|
|
62
|
-
display: block;
|
|
63
|
-
content: " ";
|
|
64
|
-
background-color: rgb(var(--m3-scheme-secondary-container));
|
|
65
|
-
|
|
66
|
-
opacity: 0;
|
|
67
|
-
inset: 0 50%;
|
|
68
|
-
width: 0;
|
|
69
|
-
border-radius: 2rem;
|
|
70
|
-
transition:
|
|
71
|
-
opacity 200ms,
|
|
72
|
-
inset 0ms 200ms,
|
|
73
|
-
width 0ms 200ms;
|
|
74
|
-
}
|
|
75
|
-
.icon-space > :global(svg) {
|
|
76
|
-
z-index: 1;
|
|
77
|
-
width: 1.5rem;
|
|
78
|
-
height: 1.5rem;
|
|
79
|
-
transition: color 200ms;
|
|
80
|
-
}
|
|
81
|
-
p {
|
|
82
|
-
margin: 0;
|
|
83
|
-
transition: color 200ms;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.rail {
|
|
87
|
-
height: 3.5rem;
|
|
88
|
-
}
|
|
89
|
-
.rail > .icon-space {
|
|
90
|
-
width: 3.5rem;
|
|
91
|
-
}
|
|
92
|
-
@media (min-width: 37.5rem) {
|
|
93
|
-
.auto {
|
|
94
|
-
height: 3.5rem;
|
|
95
|
-
}
|
|
96
|
-
.auto > .icon-space {
|
|
97
|
-
width: 3.5rem;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.selected {
|
|
102
|
-
--text: var(--m3-scheme-on-surface);
|
|
103
|
-
}
|
|
104
|
-
.selected > .icon-space::before {
|
|
105
|
-
opacity: 1;
|
|
106
|
-
inset: 0 0;
|
|
107
|
-
width: 100%;
|
|
108
|
-
transition:
|
|
109
|
-
width var(--m3-util-easing-fast-spatial),
|
|
110
|
-
inset var(--m3-util-easing-fast-spatial);
|
|
111
|
-
}
|
|
112
|
-
.selected > .icon-space > :global(svg) {
|
|
113
|
-
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@media (hover: hover) {
|
|
117
|
-
.m3-container:hover > .icon-space {
|
|
118
|
-
background-color: rgb(var(--text) / 0.08);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
.m3-container:focus-visible > .icon-space,
|
|
122
|
-
.m3-container:active > .icon-space {
|
|
123
|
-
background-color: rgb(var(--text) / 0.12);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.selected {
|
|
127
|
-
print-color-adjust: exact;
|
|
128
|
-
-webkit-print-color-adjust: exact;
|
|
129
|
-
}
|
|
130
|
-
@media screen and (forced-colors: active) {
|
|
131
|
-
.icon-space::before {
|
|
132
|
-
background-color: selecteditem;
|
|
133
|
-
color: selecteditemtext;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
</style>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from "svelte";
|
|
2
|
-
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
3
|
-
import type { IconifyIcon } from "@iconify/types";
|
|
4
|
-
type $$ComponentProps = {
|
|
5
|
-
variant: "rail" | "bar" | "auto";
|
|
6
|
-
selected: boolean;
|
|
7
|
-
icon: IconifyIcon;
|
|
8
|
-
children: Snippet;
|
|
9
|
-
click: () => void;
|
|
10
|
-
} & HTMLButtonAttributes;
|
|
11
|
-
declare const NavListButton: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
12
|
-
type NavListButton = ReturnType<typeof NavListButton>;
|
|
13
|
-
export default NavListButton;
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from "svelte";
|
|
3
|
-
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
4
|
-
import type { IconifyIcon } from "@iconify/types";
|
|
5
|
-
import Icon from "../misc/_icon.svelte";
|
|
6
|
-
|
|
7
|
-
let {
|
|
8
|
-
variant,
|
|
9
|
-
selected,
|
|
10
|
-
icon,
|
|
11
|
-
children,
|
|
12
|
-
href,
|
|
13
|
-
...extra
|
|
14
|
-
}: {
|
|
15
|
-
variant: "rail" | "bar" | "auto";
|
|
16
|
-
selected: boolean;
|
|
17
|
-
icon: IconifyIcon;
|
|
18
|
-
children: Snippet;
|
|
19
|
-
href: string;
|
|
20
|
-
} & HTMLAnchorAttributes = $props();
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<a class="m3-container {variant}" class:selected {href} {...extra}>
|
|
24
|
-
<div class="icon-space">
|
|
25
|
-
<Icon {icon} />
|
|
26
|
-
</div>
|
|
27
|
-
<p class="m3-font-label-medium">{@render children()}</p>
|
|
28
|
-
</a>
|
|
29
|
-
|
|
30
|
-
<style>
|
|
31
|
-
.m3-container {
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-direction: column;
|
|
34
|
-
height: 3.25rem;
|
|
35
|
-
gap: 0.25rem;
|
|
36
|
-
padding: 0;
|
|
37
|
-
text-align: center;
|
|
38
|
-
|
|
39
|
-
background-color: transparent;
|
|
40
|
-
--text: var(--m3-scheme-on-surface-variant);
|
|
41
|
-
color: rgb(var(--text));
|
|
42
|
-
-webkit-tap-highlight-color: transparent;
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
}
|
|
45
|
-
.icon-space {
|
|
46
|
-
display: flex;
|
|
47
|
-
flex: none;
|
|
48
|
-
align-self: center;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
align-items: center;
|
|
51
|
-
|
|
52
|
-
position: relative;
|
|
53
|
-
width: 4rem;
|
|
54
|
-
height: 2rem;
|
|
55
|
-
border-radius: 2rem;
|
|
56
|
-
transition: background-color 200ms;
|
|
57
|
-
}
|
|
58
|
-
.icon-space::before {
|
|
59
|
-
position: absolute;
|
|
60
|
-
display: block;
|
|
61
|
-
content: " ";
|
|
62
|
-
background-color: rgb(var(--m3-scheme-secondary-container));
|
|
63
|
-
|
|
64
|
-
opacity: 0;
|
|
65
|
-
inset: 0 50%;
|
|
66
|
-
width: 0;
|
|
67
|
-
border-radius: 2rem;
|
|
68
|
-
transition:
|
|
69
|
-
opacity 200ms,
|
|
70
|
-
inset 0ms 200ms,
|
|
71
|
-
width 0ms 200ms;
|
|
72
|
-
}
|
|
73
|
-
.icon-space > :global(svg) {
|
|
74
|
-
z-index: 1;
|
|
75
|
-
width: 1.5rem;
|
|
76
|
-
height: 1.5rem;
|
|
77
|
-
transition: color 200ms;
|
|
78
|
-
}
|
|
79
|
-
p {
|
|
80
|
-
margin: 0;
|
|
81
|
-
transition: color 200ms;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.rail {
|
|
85
|
-
height: 3.5rem;
|
|
86
|
-
}
|
|
87
|
-
.rail > .icon-space {
|
|
88
|
-
width: 3.5rem;
|
|
89
|
-
}
|
|
90
|
-
@media (min-width: 37.5rem) {
|
|
91
|
-
.auto {
|
|
92
|
-
height: 3.5rem;
|
|
93
|
-
}
|
|
94
|
-
.auto > .icon-space {
|
|
95
|
-
width: 3.5rem;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.selected {
|
|
100
|
-
--text: var(--m3-scheme-on-surface);
|
|
101
|
-
}
|
|
102
|
-
.selected > .icon-space::before {
|
|
103
|
-
opacity: 1;
|
|
104
|
-
inset: 0 0;
|
|
105
|
-
width: 100%;
|
|
106
|
-
transition:
|
|
107
|
-
width var(--m3-util-easing-fast-spatial),
|
|
108
|
-
inset var(--m3-util-easing-fast-spatial);
|
|
109
|
-
}
|
|
110
|
-
.selected > .icon-space > :global(svg) {
|
|
111
|
-
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
@media (hover: hover) {
|
|
115
|
-
.m3-container:hover > .icon-space {
|
|
116
|
-
background-color: rgb(var(--text) / 0.08);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
.m3-container:focus-visible > .icon-space,
|
|
120
|
-
.m3-container:active > .icon-space {
|
|
121
|
-
background-color: rgb(var(--text) / 0.12);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.selected {
|
|
125
|
-
print-color-adjust: exact;
|
|
126
|
-
-webkit-print-color-adjust: exact;
|
|
127
|
-
}
|
|
128
|
-
@media screen and (forced-colors: active) {
|
|
129
|
-
.icon-space::before {
|
|
130
|
-
background-color: selecteditem;
|
|
131
|
-
color: selecteditemtext;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
</style>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from "svelte";
|
|
2
|
-
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
3
|
-
import type { IconifyIcon } from "@iconify/types";
|
|
4
|
-
type $$ComponentProps = {
|
|
5
|
-
variant: "rail" | "bar" | "auto";
|
|
6
|
-
selected: boolean;
|
|
7
|
-
icon: IconifyIcon;
|
|
8
|
-
children: Snippet;
|
|
9
|
-
href: string;
|
|
10
|
-
} & HTMLAnchorAttributes;
|
|
11
|
-
declare const NavListLink: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
12
|
-
type NavListLink = ReturnType<typeof NavListLink>;
|
|
13
|
-
export default NavListLink;
|