m3-svelte 4.5.1 → 4.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
&:is(:global(input:checked) + label):not(.square) {
|
|
175
175
|
border-radius: var(--m3-util-rounding-medium);
|
|
176
176
|
}
|
|
177
|
-
&:active {
|
|
177
|
+
&:active:not(:disabled, :global(input:disabled) + label) {
|
|
178
178
|
border-radius: var(--m3-util-rounding-small) !important;
|
|
179
179
|
}
|
|
180
180
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from "svelte";
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
HTMLAnchorAttributes,
|
|
5
|
+
HTMLAttributes,
|
|
6
|
+
HTMLButtonAttributes,
|
|
7
|
+
HTMLLabelAttributes,
|
|
8
|
+
} from "svelte/elements";
|
|
4
9
|
import Layer from "../misc/Layer.svelte";
|
|
5
10
|
|
|
6
11
|
type ActionProps =
|
|
7
12
|
| HTMLAttributes<HTMLDivElement>
|
|
8
13
|
| ({ click: () => void } & HTMLButtonAttributes)
|
|
9
|
-
| ({ label: true } & HTMLLabelAttributes)
|
|
14
|
+
| ({ label: true } & HTMLLabelAttributes)
|
|
15
|
+
| ({ href: string } & HTMLAnchorAttributes);
|
|
10
16
|
|
|
11
17
|
let props: {
|
|
12
18
|
leading?: Snippet;
|
|
@@ -78,6 +84,12 @@
|
|
|
78
84
|
<Layer />
|
|
79
85
|
{@render content(leading, overline, headline, supporting, trailing)}
|
|
80
86
|
</button>
|
|
87
|
+
{:else if "href" in props}
|
|
88
|
+
{@const { leading, overline = "", headline = "", supporting = "", trailing, ...extra } = props}
|
|
89
|
+
<a class="m3-container lines-{_lines}" {...extra}>
|
|
90
|
+
<Layer />
|
|
91
|
+
{@render content(leading, overline, headline, supporting, trailing)}
|
|
92
|
+
</a>
|
|
81
93
|
{:else}
|
|
82
94
|
{@const { leading, overline = "", headline = "", supporting = "", trailing, ...extra } = props}
|
|
83
95
|
<div class="m3-container lines-{_lines}" {...extra}>
|
|
@@ -96,6 +108,7 @@
|
|
|
96
108
|
border: none;
|
|
97
109
|
position: relative;
|
|
98
110
|
background: transparent;
|
|
111
|
+
color: inherit;
|
|
99
112
|
-webkit-tap-highlight-color: transparent;
|
|
100
113
|
}
|
|
101
114
|
button.m3-container,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
-
import type { HTMLAttributes, HTMLButtonAttributes, HTMLLabelAttributes } from "svelte/elements";
|
|
2
|
+
import type { HTMLAnchorAttributes, HTMLAttributes, HTMLButtonAttributes, HTMLLabelAttributes } from "svelte/elements";
|
|
3
3
|
type ActionProps = HTMLAttributes<HTMLDivElement> | ({
|
|
4
4
|
click: () => void;
|
|
5
5
|
} & HTMLButtonAttributes) | ({
|
|
6
6
|
label: true;
|
|
7
|
-
} & HTMLLabelAttributes)
|
|
7
|
+
} & HTMLLabelAttributes) | ({
|
|
8
|
+
href: string;
|
|
9
|
+
} & HTMLAnchorAttributes);
|
|
8
10
|
type $$ComponentProps = {
|
|
9
11
|
leading?: Snippet;
|
|
10
12
|
overline?: string;
|
package/package/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export { default as WavyLinearProgressEstimate } from "./forms/WavyLinearProgres
|
|
|
26
26
|
export { default as CircularProgress } from "./forms/CircularProgress.svelte";
|
|
27
27
|
export { default as CircularProgressEstimate } from "./forms/CircularProgressEstimate.svelte";
|
|
28
28
|
export { default as CircularProgressIndeterminate } from "./forms/CircularProgressIndeterminate.svelte";
|
|
29
|
+
export { default as LoadingIndicator } from "./forms/LoadingIndicator.svelte";
|
|
29
30
|
export { default as RadioAnim1 } from "./forms/RadioAnim1.svelte";
|
|
30
31
|
export { default as RadioAnim2 } from "./forms/RadioAnim2.svelte";
|
|
31
32
|
export { default as RadioAnim3 } from "./forms/RadioAnim3.svelte";
|
package/package/index.js
CHANGED
|
@@ -25,6 +25,7 @@ export { default as WavyLinearProgressEstimate } from "./forms/WavyLinearProgres
|
|
|
25
25
|
export { default as CircularProgress } from "./forms/CircularProgress.svelte";
|
|
26
26
|
export { default as CircularProgressEstimate } from "./forms/CircularProgressEstimate.svelte";
|
|
27
27
|
export { default as CircularProgressIndeterminate } from "./forms/CircularProgressIndeterminate.svelte";
|
|
28
|
+
export { default as LoadingIndicator } from "./forms/LoadingIndicator.svelte";
|
|
28
29
|
export { default as RadioAnim1 } from "./forms/RadioAnim1.svelte";
|
|
29
30
|
export { default as RadioAnim2 } from "./forms/RadioAnim2.svelte";
|
|
30
31
|
export { default as RadioAnim3 } from "./forms/RadioAnim3.svelte";
|
package/package/misc/colors.js
CHANGED