m3-svelte 5.3.6 → 5.6.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 +4 -11
- package/package/buttons/Button.svelte.d.ts +3 -6
- package/package/buttons/FAB.svelte +0 -3
- package/package/containers/Card.svelte +0 -1
- package/package/containers/Dialog.svelte +35 -37
- package/package/containers/Dialog.svelte.d.ts +4 -0
- package/package/containers/ListItem.svelte +0 -1
- package/package/containers/MenuItem.svelte +0 -1
- package/package/containers/Snackbar.svelte +0 -1
- package/package/forms/Checkbox.svelte +1 -1
- package/package/forms/Chip.svelte +20 -14
- package/package/forms/Chip.svelte.d.ts +3 -3
- package/package/forms/DateField.svelte +0 -1
- package/package/forms/DateFieldOutlined.svelte +0 -1
- package/package/forms/RadioAnim1.svelte +1 -2
- package/package/forms/RadioAnim2.svelte +1 -2
- package/package/forms/RadioAnim3.svelte +1 -2
- package/package/forms/Select.svelte +228 -0
- package/package/forms/Select.svelte.d.ts +16 -0
- package/package/forms/SelectOutlined.svelte +226 -0
- package/package/forms/SelectOutlined.svelte.d.ts +16 -0
- package/package/forms/Slider.svelte +127 -148
- package/package/forms/Slider.svelte.d.ts +1 -1
- package/package/forms/SliderTicks.svelte +2 -2
- package/package/forms/SliderTicks.svelte.d.ts +2 -2
- package/package/forms/Switch.svelte +30 -6
- package/package/forms/Switch.svelte.d.ts +4 -0
- package/package/forms/TextField.svelte +4 -4
- package/package/forms/TextFieldMultiline.svelte +4 -3
- package/package/forms/TextFieldOutlined.svelte +7 -4
- package/package/forms/TextFieldOutlinedMultiline.svelte +7 -3
- package/package/forms/_picker/FocusPicker.svelte +0 -1
- package/package/forms/_picker/Header.svelte +0 -1
- package/package/forms/_picker/Item.svelte +0 -1
- package/package/index.d.ts +13 -10
- package/package/index.js +13 -10
- package/package/misc/_icon.svelte +14 -1
- package/package/misc/styles.css +2 -1
- package/package/misc/typing-utils.d.ts +3 -1
- package/package/nav/NavCMLX.svelte +1 -1
- package/package/nav/NavCMLXItem.svelte +7 -7
- package/package/nav/Tabs.svelte +0 -1
- package/package/nav/TabsLink.svelte +0 -1
- package/package/nav/VariableTabs.svelte +0 -1
- package/package/nav/VariableTabsLink.svelte +0 -1
- package/package/utils/badge.d.ts +11 -0
- package/package/utils/badge.js +30 -0
- package/package.json +10 -10
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Icon from "../misc/_icon.svelte";
|
|
3
|
+
import type { IconifyIcon } from "@iconify/types";
|
|
3
4
|
import iconCheck from "@ktibow/iconset-material-symbols/check";
|
|
5
|
+
import iconX from "@ktibow/iconset-material-symbols/close";
|
|
4
6
|
import type { HTMLInputAttributes } from "svelte/elements";
|
|
5
7
|
|
|
6
8
|
// MUST BE WRAPPED IN A <label>
|
|
7
9
|
let {
|
|
8
10
|
checked = $bindable(false),
|
|
9
11
|
disabled = false,
|
|
12
|
+
uncheckedIcon = iconX,
|
|
13
|
+
checkedIcon = iconCheck,
|
|
14
|
+
icons = "checked",
|
|
10
15
|
...extra
|
|
11
16
|
}: {
|
|
12
17
|
checked?: boolean;
|
|
13
18
|
disabled?: boolean;
|
|
19
|
+
uncheckedIcon?: IconifyIcon;
|
|
20
|
+
checkedIcon?: IconifyIcon;
|
|
21
|
+
icons?: "checked" | "both" | "none";
|
|
14
22
|
} & HTMLInputAttributes = $props();
|
|
15
23
|
|
|
16
24
|
let startX: number | undefined = $state();
|
|
@@ -49,7 +57,12 @@
|
|
|
49
57
|
}}
|
|
50
58
|
/>
|
|
51
59
|
<div class="handle">
|
|
52
|
-
|
|
60
|
+
{#if icons != "none"}
|
|
61
|
+
<Icon icon={checkedIcon} />
|
|
62
|
+
{#if icons == "both"}
|
|
63
|
+
<Icon icon={uncheckedIcon} />
|
|
64
|
+
{/if}
|
|
65
|
+
{/if}
|
|
53
66
|
</div>
|
|
54
67
|
<div class="hover"></div>
|
|
55
68
|
</div>
|
|
@@ -75,7 +88,6 @@
|
|
|
75
88
|
background-color: rgb(var(--m3-scheme-surface-container-highest));
|
|
76
89
|
border: solid 0.125rem rgb(var(--m3-scheme-outline));
|
|
77
90
|
cursor: pointer;
|
|
78
|
-
-webkit-tap-highlight-color: transparent;
|
|
79
91
|
transition: var(--m3-util-easing);
|
|
80
92
|
}
|
|
81
93
|
.handle {
|
|
@@ -88,7 +100,6 @@
|
|
|
88
100
|
/* Fallback for those without on on primary */
|
|
89
101
|
color: rgb(var(--m3-scheme-on-on-primary, var(--m3-scheme-on-primary-container)));
|
|
90
102
|
cursor: pointer;
|
|
91
|
-
-webkit-tap-highlight-color: transparent;
|
|
92
103
|
transition: var(--m3-util-easing-fast-spatial);
|
|
93
104
|
|
|
94
105
|
left: 0.5rem;
|
|
@@ -106,6 +117,20 @@
|
|
|
106
117
|
opacity var(--m3-util-easing-fast-spatial),
|
|
107
118
|
scale var(--m3-util-easing-fast-spatial);
|
|
108
119
|
}
|
|
120
|
+
input:not(:checked) + :global(.handle:has(:nth-child(2))) {
|
|
121
|
+
scale: 1.5;
|
|
122
|
+
> :global(svg) {
|
|
123
|
+
color: rgb(var(--m3-scheme-surface-container-highest));
|
|
124
|
+
scale: 0.667;
|
|
125
|
+
opacity: 1;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
input:checked + :global(.handle) > :global(svg:nth-child(2)),
|
|
130
|
+
input:not(:checked) + :global(.handle) > :global(svg:first-child) {
|
|
131
|
+
display: none;
|
|
132
|
+
}
|
|
133
|
+
|
|
109
134
|
.hover {
|
|
110
135
|
position: absolute;
|
|
111
136
|
width: 3rem;
|
|
@@ -113,7 +138,6 @@
|
|
|
113
138
|
border-radius: var(--m3-util-rounding-full);
|
|
114
139
|
|
|
115
140
|
cursor: pointer;
|
|
116
|
-
-webkit-tap-highlight-color: transparent;
|
|
117
141
|
transition: var(--m3-util-easing-fast);
|
|
118
142
|
|
|
119
143
|
left: 1rem;
|
|
@@ -124,8 +148,8 @@
|
|
|
124
148
|
justify-content: center;
|
|
125
149
|
}
|
|
126
150
|
|
|
127
|
-
.m3-container:hover > input:
|
|
128
|
-
.m3-container > input:
|
|
151
|
+
.m3-container:hover > input:not(:checked):not(:disabled) + .handle,
|
|
152
|
+
.m3-container:active > input:not(:checked):not(:disabled) + .handle {
|
|
129
153
|
background-color: rgb(var(--m3-scheme-on-surface-variant));
|
|
130
154
|
}
|
|
131
155
|
.m3-container:hover > input:enabled:checked + .handle,
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import type { IconifyIcon } from "@iconify/types";
|
|
1
2
|
import type { HTMLInputAttributes } from "svelte/elements";
|
|
2
3
|
type $$ComponentProps = {
|
|
3
4
|
checked?: boolean;
|
|
4
5
|
disabled?: boolean;
|
|
6
|
+
uncheckedIcon?: IconifyIcon;
|
|
7
|
+
checkedIcon?: IconifyIcon;
|
|
8
|
+
icons?: "checked" | "both" | "none";
|
|
5
9
|
} & HTMLInputAttributes;
|
|
6
10
|
declare const Switch: import("svelte").Component<$$ComponentProps, {}, "checked">;
|
|
7
11
|
type Switch = ReturnType<typeof Switch>;
|
|
@@ -62,7 +62,8 @@
|
|
|
62
62
|
|
|
63
63
|
<style>
|
|
64
64
|
:root {
|
|
65
|
-
|
|
65
|
+
/* "textfield" is deprecated */
|
|
66
|
+
--m3-field-filled-shape: var(--m3-textfield-filled-shape, var(--m3-util-rounding-extra-small));
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
.m3-container {
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
border: none;
|
|
81
82
|
outline: none;
|
|
82
83
|
padding: 1.5rem 1rem 0.5rem 1rem;
|
|
83
|
-
border-radius: var(--m3-
|
|
84
|
+
border-radius: var(--m3-field-filled-shape) var(--m3-field-filled-shape) 0 0;
|
|
84
85
|
background-color: rgb(var(--m3-scheme-surface-container-highest));
|
|
85
86
|
color: rgb(var(--m3-scheme-on-surface));
|
|
86
87
|
}
|
|
@@ -118,7 +119,7 @@
|
|
|
118
119
|
.layer {
|
|
119
120
|
position: absolute;
|
|
120
121
|
inset: 0;
|
|
121
|
-
border-radius: var(--m3-
|
|
122
|
+
border-radius: var(--m3-field-filled-shape) var(--m3-field-filled-shape) 0 0;
|
|
122
123
|
pointer-events: none;
|
|
123
124
|
transition: all 100ms;
|
|
124
125
|
&:is(input:enabled:hover ~ .layer) {
|
|
@@ -160,7 +161,6 @@
|
|
|
160
161
|
border-start-end-radius: 0.25rem;
|
|
161
162
|
border-end-end-radius: 0.25rem;
|
|
162
163
|
|
|
163
|
-
-webkit-tap-highlight-color: transparent;
|
|
164
164
|
cursor: pointer;
|
|
165
165
|
}
|
|
166
166
|
|
|
@@ -57,7 +57,8 @@
|
|
|
57
57
|
|
|
58
58
|
<style>
|
|
59
59
|
:root {
|
|
60
|
-
|
|
60
|
+
/* "textfield" is deprecated */
|
|
61
|
+
--m3-field-filled-shape: var(--m3-textfield-filled-shape, var(--m3-util-rounding-extra-small));
|
|
61
62
|
}
|
|
62
63
|
.m3-container {
|
|
63
64
|
display: inline-flex;
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
border: none;
|
|
75
76
|
outline: none;
|
|
76
77
|
padding: 1.5rem 1rem 0.5rem 1rem;
|
|
77
|
-
border-radius: var(--m3-
|
|
78
|
+
border-radius: var(--m3-field-filled-shape) var(--m3-field-filled-shape) 0 0;
|
|
78
79
|
background-color: rgb(var(--m3-scheme-surface-container-highest));
|
|
79
80
|
color: rgb(var(--m3-scheme-on-surface));
|
|
80
81
|
resize: none;
|
|
@@ -113,7 +114,7 @@
|
|
|
113
114
|
.layer {
|
|
114
115
|
position: absolute;
|
|
115
116
|
inset: 0;
|
|
116
|
-
border-radius: var(--m3-
|
|
117
|
+
border-radius: var(--m3-field-filled-shape) var(--m3-field-filled-shape) 0 0;
|
|
117
118
|
pointer-events: none;
|
|
118
119
|
transition: all 100ms;
|
|
119
120
|
&:is(textarea:enabled:hover ~ .layer) {
|
|
@@ -66,7 +66,11 @@
|
|
|
66
66
|
do this: <TextFieldOutlined --m3-util-background="rgb(var(--m3-scheme-surface-container))" />
|
|
67
67
|
*/
|
|
68
68
|
:root {
|
|
69
|
-
|
|
69
|
+
/* "textfield" is deprecated */
|
|
70
|
+
--m3-field-outlined-shape: var(
|
|
71
|
+
--m3-textfield-outlined-shape,
|
|
72
|
+
var(--m3-util-rounding-extra-small)
|
|
73
|
+
);
|
|
70
74
|
}
|
|
71
75
|
.m3-container {
|
|
72
76
|
display: inline-flex;
|
|
@@ -83,7 +87,7 @@
|
|
|
83
87
|
border: none;
|
|
84
88
|
outline: none;
|
|
85
89
|
padding: 1rem;
|
|
86
|
-
border-radius: var(--m3-
|
|
90
|
+
border-radius: var(--m3-field-outlined-shape);
|
|
87
91
|
background-color: transparent;
|
|
88
92
|
color: rgb(var(--m3-scheme-on-surface));
|
|
89
93
|
}
|
|
@@ -122,7 +126,7 @@
|
|
|
122
126
|
position: absolute;
|
|
123
127
|
inset: 0;
|
|
124
128
|
border: 1px solid rgb(var(--error, var(--m3-scheme-outline)));
|
|
125
|
-
border-radius: var(--m3-
|
|
129
|
+
border-radius: var(--m3-field-outlined-shape);
|
|
126
130
|
pointer-events: none;
|
|
127
131
|
transition: all 100ms;
|
|
128
132
|
&:is(input:enabled:hover ~ .layer) {
|
|
@@ -157,7 +161,6 @@
|
|
|
157
161
|
border-start-end-radius: 0.25rem;
|
|
158
162
|
border-end-end-radius: 0.25rem;
|
|
159
163
|
|
|
160
|
-
-webkit-tap-highlight-color: transparent;
|
|
161
164
|
cursor: pointer;
|
|
162
165
|
}
|
|
163
166
|
|
|
@@ -61,7 +61,11 @@
|
|
|
61
61
|
do this: <TextFieldOutlinedMultiline --m3-util-background="rgb(var(--m3-scheme-surface-container))" />
|
|
62
62
|
*/
|
|
63
63
|
:root {
|
|
64
|
-
|
|
64
|
+
/* "textfield" is deprecated */
|
|
65
|
+
--m3-field-outlined-shape: var(
|
|
66
|
+
--m3-textfield-outlined-shape,
|
|
67
|
+
var(--m3-util-rounding-extra-small)
|
|
68
|
+
);
|
|
65
69
|
}
|
|
66
70
|
.m3-container {
|
|
67
71
|
display: inline-flex;
|
|
@@ -78,7 +82,7 @@
|
|
|
78
82
|
border: none;
|
|
79
83
|
outline: none;
|
|
80
84
|
padding: 1rem;
|
|
81
|
-
border-radius: var(--m3-
|
|
85
|
+
border-radius: var(--m3-field-outlined-shape);
|
|
82
86
|
background-color: transparent;
|
|
83
87
|
color: rgb(var(--m3-scheme-on-surface));
|
|
84
88
|
resize: none;
|
|
@@ -118,7 +122,7 @@
|
|
|
118
122
|
position: absolute;
|
|
119
123
|
inset: 0;
|
|
120
124
|
border: 1px solid rgb(var(--error, var(--m3-scheme-outline)));
|
|
121
|
-
border-radius: var(--m3-
|
|
125
|
+
border-radius: var(--m3-field-outlined-shape);
|
|
122
126
|
pointer-events: none;
|
|
123
127
|
transition: all 100ms;
|
|
124
128
|
&:is(textarea:enabled:hover ~ .layer) {
|
package/package/index.d.ts
CHANGED
|
@@ -18,34 +18,37 @@ export { default as MenuItem } from "./containers/MenuItem.svelte";
|
|
|
18
18
|
export { default as Snackbar } from "./containers/Snackbar.svelte";
|
|
19
19
|
export type { SnackbarIn } from "./containers/Snackbar.svelte";
|
|
20
20
|
export { default as SnackbarItem } from "./containers/SnackbarItem.svelte";
|
|
21
|
-
export { default as
|
|
22
|
-
export { default as
|
|
23
|
-
export { default as LinearProgressIndeterminate } from "./forms/LinearProgressIndeterminate.svelte";
|
|
24
|
-
export { default as WavyLinearProgress } from "./forms/WavyLinearProgress.svelte";
|
|
25
|
-
export { default as WavyLinearProgressEstimate } from "./forms/WavyLinearProgressEstimate.svelte";
|
|
21
|
+
export { default as Checkbox } from "./forms/Checkbox.svelte";
|
|
22
|
+
export { default as Chip } from "./forms/Chip.svelte";
|
|
26
23
|
export { default as CircularProgress } from "./forms/CircularProgress.svelte";
|
|
27
24
|
export { default as CircularProgressEstimate } from "./forms/CircularProgressEstimate.svelte";
|
|
28
25
|
export { default as CircularProgressIndeterminate } from "./forms/CircularProgressIndeterminate.svelte";
|
|
29
|
-
export { default as LoadingIndicator } from "./forms/LoadingIndicator.svelte";
|
|
30
26
|
export { default as DateField } from "./forms/DateField.svelte";
|
|
31
27
|
export { default as DateFieldOutlined } from "./forms/DateFieldOutlined.svelte";
|
|
28
|
+
export { default as DatePickerDocked } from "./forms/DatePickerDocked.svelte";
|
|
29
|
+
export { default as LinearProgress } from "./forms/LinearProgress.svelte";
|
|
30
|
+
export { default as LinearProgressEstimate } from "./forms/LinearProgressEstimate.svelte";
|
|
31
|
+
export { default as LinearProgressIndeterminate } from "./forms/LinearProgressIndeterminate.svelte";
|
|
32
|
+
export { default as LoadingIndicator } from "./forms/LoadingIndicator.svelte";
|
|
32
33
|
export { default as RadioAnim1 } from "./forms/RadioAnim1.svelte";
|
|
33
34
|
export { default as RadioAnim2 } from "./forms/RadioAnim2.svelte";
|
|
34
35
|
export { default as RadioAnim3 } from "./forms/RadioAnim3.svelte";
|
|
35
|
-
export { default as
|
|
36
|
-
export { default as
|
|
36
|
+
export { default as Select } from "./forms/Select.svelte";
|
|
37
|
+
export { default as SelectOutlined } from "./forms/SelectOutlined.svelte";
|
|
37
38
|
export { default as Slider } from "./forms/Slider.svelte";
|
|
39
|
+
export { default as Switch } from "./forms/Switch.svelte";
|
|
38
40
|
export { default as TextField } from "./forms/TextField.svelte";
|
|
39
41
|
export { default as TextFieldMultiline } from "./forms/TextFieldMultiline.svelte";
|
|
40
42
|
export { default as TextFieldOutlined } from "./forms/TextFieldOutlined.svelte";
|
|
41
43
|
export { default as TextFieldOutlinedMultiline } from "./forms/TextFieldOutlinedMultiline.svelte";
|
|
42
|
-
export { default as
|
|
43
|
-
export { default as
|
|
44
|
+
export { default as WavyLinearProgress } from "./forms/WavyLinearProgress.svelte";
|
|
45
|
+
export { default as WavyLinearProgressEstimate } from "./forms/WavyLinearProgressEstimate.svelte";
|
|
44
46
|
export { default as NavCMLX } from "./nav/NavCMLX.svelte";
|
|
45
47
|
export { default as NavCMLXItem } from "./nav/NavCMLXItem.svelte";
|
|
46
48
|
export { default as Tabs } from "./nav/Tabs.svelte";
|
|
47
49
|
export { default as TabsLink } from "./nav/TabsLink.svelte";
|
|
48
50
|
export { default as VariableTabs } from "./nav/VariableTabs.svelte";
|
|
49
51
|
export { default as VariableTabsLink } from "./nav/VariableTabsLink.svelte";
|
|
52
|
+
export * from "./utils/badge.js";
|
|
50
53
|
export { default as ChipChooser } from "./utils/ChipChooser.svelte";
|
|
51
54
|
export { default as Divider } from "./utils/Divider.svelte";
|
package/package/index.js
CHANGED
|
@@ -17,34 +17,37 @@ export { default as Menu } from "./containers/Menu.svelte";
|
|
|
17
17
|
export { default as MenuItem } from "./containers/MenuItem.svelte";
|
|
18
18
|
export { default as Snackbar } from "./containers/Snackbar.svelte";
|
|
19
19
|
export { default as SnackbarItem } from "./containers/SnackbarItem.svelte";
|
|
20
|
-
export { default as
|
|
21
|
-
export { default as
|
|
22
|
-
export { default as LinearProgressIndeterminate } from "./forms/LinearProgressIndeterminate.svelte";
|
|
23
|
-
export { default as WavyLinearProgress } from "./forms/WavyLinearProgress.svelte";
|
|
24
|
-
export { default as WavyLinearProgressEstimate } from "./forms/WavyLinearProgressEstimate.svelte";
|
|
20
|
+
export { default as Checkbox } from "./forms/Checkbox.svelte";
|
|
21
|
+
export { default as Chip } from "./forms/Chip.svelte";
|
|
25
22
|
export { default as CircularProgress } from "./forms/CircularProgress.svelte";
|
|
26
23
|
export { default as CircularProgressEstimate } from "./forms/CircularProgressEstimate.svelte";
|
|
27
24
|
export { default as CircularProgressIndeterminate } from "./forms/CircularProgressIndeterminate.svelte";
|
|
28
|
-
export { default as LoadingIndicator } from "./forms/LoadingIndicator.svelte";
|
|
29
25
|
export { default as DateField } from "./forms/DateField.svelte";
|
|
30
26
|
export { default as DateFieldOutlined } from "./forms/DateFieldOutlined.svelte";
|
|
27
|
+
export { default as DatePickerDocked } from "./forms/DatePickerDocked.svelte";
|
|
28
|
+
export { default as LinearProgress } from "./forms/LinearProgress.svelte";
|
|
29
|
+
export { default as LinearProgressEstimate } from "./forms/LinearProgressEstimate.svelte";
|
|
30
|
+
export { default as LinearProgressIndeterminate } from "./forms/LinearProgressIndeterminate.svelte";
|
|
31
|
+
export { default as LoadingIndicator } from "./forms/LoadingIndicator.svelte";
|
|
31
32
|
export { default as RadioAnim1 } from "./forms/RadioAnim1.svelte";
|
|
32
33
|
export { default as RadioAnim2 } from "./forms/RadioAnim2.svelte";
|
|
33
34
|
export { default as RadioAnim3 } from "./forms/RadioAnim3.svelte";
|
|
34
|
-
export { default as
|
|
35
|
-
export { default as
|
|
35
|
+
export { default as Select } from "./forms/Select.svelte";
|
|
36
|
+
export { default as SelectOutlined } from "./forms/SelectOutlined.svelte";
|
|
36
37
|
export { default as Slider } from "./forms/Slider.svelte";
|
|
38
|
+
export { default as Switch } from "./forms/Switch.svelte";
|
|
37
39
|
export { default as TextField } from "./forms/TextField.svelte";
|
|
38
40
|
export { default as TextFieldMultiline } from "./forms/TextFieldMultiline.svelte";
|
|
39
41
|
export { default as TextFieldOutlined } from "./forms/TextFieldOutlined.svelte";
|
|
40
42
|
export { default as TextFieldOutlinedMultiline } from "./forms/TextFieldOutlinedMultiline.svelte";
|
|
41
|
-
export { default as
|
|
42
|
-
export { default as
|
|
43
|
+
export { default as WavyLinearProgress } from "./forms/WavyLinearProgress.svelte";
|
|
44
|
+
export { default as WavyLinearProgressEstimate } from "./forms/WavyLinearProgressEstimate.svelte";
|
|
43
45
|
export { default as NavCMLX } from "./nav/NavCMLX.svelte";
|
|
44
46
|
export { default as NavCMLXItem } from "./nav/NavCMLXItem.svelte";
|
|
45
47
|
export { default as Tabs } from "./nav/Tabs.svelte";
|
|
46
48
|
export { default as TabsLink } from "./nav/TabsLink.svelte";
|
|
47
49
|
export { default as VariableTabs } from "./nav/VariableTabs.svelte";
|
|
48
50
|
export { default as VariableTabsLink } from "./nav/VariableTabsLink.svelte";
|
|
51
|
+
export * from "./utils/badge.js";
|
|
49
52
|
export { default as ChipChooser } from "./utils/ChipChooser.svelte";
|
|
50
53
|
export { default as Divider } from "./utils/Divider.svelte";
|
|
@@ -14,6 +14,19 @@
|
|
|
14
14
|
} = $props();
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
|
-
<svg
|
|
17
|
+
<svg
|
|
18
|
+
{width}
|
|
19
|
+
{height}
|
|
20
|
+
class={clazz}
|
|
21
|
+
data-badge={icon.body.includes("<!--badge-->") ? "" : undefined}
|
|
22
|
+
viewBox="0 0 {icon.width} {icon.height}"
|
|
23
|
+
>
|
|
18
24
|
{@html icon.body}
|
|
19
25
|
</svg>
|
|
26
|
+
|
|
27
|
+
<style>
|
|
28
|
+
/* deprecated: eventually want to just do this for all icons */
|
|
29
|
+
svg[data-badge] {
|
|
30
|
+
overflow: visible;
|
|
31
|
+
}
|
|
32
|
+
</style>
|
package/package/misc/styles.css
CHANGED
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
--m3-util-timing-function-emphasized-accel: cubic-bezier(0.3, 0, 0.8, 0.15);
|
|
84
84
|
--m3-util-timing-function-emphasized-decel: cubic-bezier(0.05, 0.7, 0.1, 1);
|
|
85
85
|
|
|
86
|
-
/* deprecated
|
|
86
|
+
/* deprecated */
|
|
87
87
|
--m3-util-curve: var(--m3-util-timing-function-emphasized);
|
|
88
88
|
--m3-util-curve-accel: var(--m3-util-timing-function-emphasized-accel);
|
|
89
89
|
--m3-util-curve-decel: var(--m3-util-timing-function-emphasized-decel);
|
|
@@ -220,6 +220,7 @@ or for very small text in the content body, such as captions. */
|
|
|
220
220
|
}
|
|
221
221
|
.m3-container {
|
|
222
222
|
box-sizing: border-box;
|
|
223
|
+
-webkit-tap-highlight-color: transparent;
|
|
223
224
|
}
|
|
224
225
|
.m3-container a,
|
|
225
226
|
a.m3-container {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
1
|
+
import type { HTMLLabelAttributes, HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
|
|
2
|
+
export type LabelAttrs = HTMLLabelAttributes & Required<Pick<HTMLLabelAttributes, "for">>;
|
|
3
|
+
export type AnchorAttrs = HTMLAnchorAttributes & Required<Pick<HTMLAnchorAttributes, "href">>;
|
|
2
4
|
export type NotButton<T> = Omit<T, "onclick">;
|
|
3
5
|
export type ButtonAttrs = HTMLButtonAttributes & Required<Pick<HTMLButtonAttributes, "onclick">>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
variant,
|
|
6
6
|
children,
|
|
7
7
|
}: {
|
|
8
|
-
variant: "compact" | "medium" | "large" | "expanded" | "auto";
|
|
8
|
+
variant: "compact" | "medium" | "large" | "expanded" | "auto"; // next release / "deprecated": rename expanded to extra-large
|
|
9
9
|
children: Snippet;
|
|
10
10
|
} = $props();
|
|
11
11
|
</script>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
| ({ click: () => void } & HTMLButtonAttributes)
|
|
9
9
|
| ({ href: string } & HTMLAnchorAttributes);
|
|
10
10
|
let props: {
|
|
11
|
-
variant: "compact" | "medium" | "large" | "expanded" | "auto";
|
|
11
|
+
variant: "compact" | "medium" | "large" | "expanded" | "auto"; // next release / "deprecated": rename expanded to extra-large
|
|
12
12
|
icon: IconifyIcon;
|
|
13
13
|
text: string;
|
|
14
14
|
selected: boolean;
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
}
|
|
82
82
|
&:hover {
|
|
83
83
|
> .icon {
|
|
84
|
-
background-color: color-mix(in
|
|
84
|
+
background-color: color-mix(in oklab, currentColor 8%, transparent);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
&:focus-visible,
|
|
88
88
|
&:active {
|
|
89
89
|
> .icon {
|
|
90
|
-
background-color: color-mix(in
|
|
90
|
+
background-color: color-mix(in oklab, currentColor 12%, transparent);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
> .icon {
|
|
@@ -188,14 +188,14 @@
|
|
|
188
188
|
|
|
189
189
|
&:hover {
|
|
190
190
|
> .icon {
|
|
191
|
-
background-color: color-mix(in
|
|
191
|
+
background-color: color-mix(in oklab, currentColor 8%, transparent);
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
&:focus-visible,
|
|
196
196
|
&:active {
|
|
197
197
|
> .icon {
|
|
198
|
-
background-color: color-mix(in
|
|
198
|
+
background-color: color-mix(in oklab, currentColor 12%, transparent);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
|
|
@@ -251,14 +251,14 @@
|
|
|
251
251
|
|
|
252
252
|
&:hover {
|
|
253
253
|
> .icon {
|
|
254
|
-
background-color: color-mix(in
|
|
254
|
+
background-color: color-mix(in oklab, currentColor 8%, transparent);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
&:focus-visible,
|
|
259
259
|
&:active {
|
|
260
260
|
> .icon {
|
|
261
|
-
background-color: color-mix(in
|
|
261
|
+
background-color: color-mix(in oklab, currentColor 12%, transparent);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
|
package/package/nav/Tabs.svelte
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IconifyIcon } from "@iconify/types";
|
|
2
|
+
export declare const addBadge: (icon: IconifyIcon, n?: number) => {
|
|
3
|
+
body: string;
|
|
4
|
+
left?: number;
|
|
5
|
+
top?: number;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
rotate?: number;
|
|
9
|
+
hFlip?: boolean;
|
|
10
|
+
vFlip?: boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const addBadge = (icon, n) => {
|
|
2
|
+
const { width, height } = icon;
|
|
3
|
+
if (!width || !height)
|
|
4
|
+
throw new Error("Icon must have icon and height");
|
|
5
|
+
let badge;
|
|
6
|
+
if (n) {
|
|
7
|
+
const x = width - 12;
|
|
8
|
+
const y = 14 - 16; // 14 down, 16 up
|
|
9
|
+
const max = 999;
|
|
10
|
+
const text = n > max ? `${max}+` : n.toString();
|
|
11
|
+
badge =
|
|
12
|
+
`<!--badge--><foreignObject x="${x}" y="${y}" width="40" height="16">` +
|
|
13
|
+
`<div class="m3-font-label-small" style="${[
|
|
14
|
+
"background-color:rgb(var(--m3-scheme-error))",
|
|
15
|
+
"color:rgb(var(--m3-scheme-on-error))",
|
|
16
|
+
"width:max-content",
|
|
17
|
+
"padding-inline:4px",
|
|
18
|
+
"border-radius:var(--m3-util-rounding-full)",
|
|
19
|
+
].join(";")}">` +
|
|
20
|
+
text +
|
|
21
|
+
`</div>`;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
badge = `<circle cx="${width - 3}" cy="3" r="3" fill="rgb(var(--m3-scheme-error))"/>`;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
...icon,
|
|
28
|
+
body: icon.body + badge,
|
|
29
|
+
};
|
|
30
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "m3-svelte",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"license": "Apache-2.0 OR GPL-3.0-only",
|
|
5
5
|
"repository": "KTibow/m3-svelte",
|
|
6
6
|
"author": {
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@iconify/types": "^2.0.0",
|
|
38
|
-
"@ktibow/iconset-material-symbols": "^0.0.
|
|
39
|
-
"@ktibow/material-color-utilities-nightly": "^0.3.
|
|
40
|
-
"svelte": "^5.38.
|
|
38
|
+
"@ktibow/iconset-material-symbols": "^0.0.1755063979",
|
|
39
|
+
"@ktibow/material-color-utilities-nightly": "^0.3.11756085020728",
|
|
40
|
+
"svelte": "^5.38.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@eslint/compat": "^1.3.2",
|
|
44
|
-
"@eslint/js": "^9.
|
|
44
|
+
"@eslint/js": "^9.34.0",
|
|
45
45
|
"@sveltejs/adapter-static": "^3.0.9",
|
|
46
|
-
"@sveltejs/kit": "^2.
|
|
47
|
-
"@sveltejs/package": "^2.
|
|
48
|
-
"@sveltejs/vite-plugin-svelte": "^6.1.
|
|
46
|
+
"@sveltejs/kit": "^2.36.2",
|
|
47
|
+
"@sveltejs/package": "^2.5.0",
|
|
48
|
+
"@sveltejs/vite-plugin-svelte": "^6.1.3",
|
|
49
49
|
"eslint": "^9.27.0",
|
|
50
50
|
"eslint-config-prettier": "^10.1.8",
|
|
51
51
|
"eslint-plugin-svelte": "^3.11.0",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"svelte-check": "^4.3.1",
|
|
58
58
|
"svelte-highlight": "^7.8.3",
|
|
59
59
|
"typescript": "^5.9.2",
|
|
60
|
-
"typescript-eslint": "^8.
|
|
61
|
-
"vite": "^7.1.
|
|
60
|
+
"typescript-eslint": "^8.41.0",
|
|
61
|
+
"vite": "^7.1.3"
|
|
62
62
|
},
|
|
63
63
|
"keywords": [
|
|
64
64
|
"svelte",
|