m3-svelte 5.15.5 → 6.0.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 +137 -131
- package/package/buttons/ConnectedButtons.svelte +1 -1
- package/package/buttons/FAB.svelte +27 -20
- package/package/buttons/SplitButton.svelte +26 -19
- package/package/containers/BottomSheet.svelte +7 -7
- package/package/containers/Card.svelte +12 -12
- package/package/containers/Dialog.svelte +33 -44
- package/package/containers/Dialog.svelte.d.ts +0 -8
- package/package/containers/ListItem.svelte +43 -11
- package/package/containers/Menu.svelte +3 -3
- package/package/containers/MenuItem.svelte +13 -6
- package/package/containers/Snackbar.svelte +49 -45
- package/package/containers/Snackbar.svelte.d.ts +4 -17
- package/package/containers/SnackbarItem.svelte +6 -6
- package/package/containers/StandardSideSheet.svelte +11 -2
- package/package/forms/Checkbox.svelte +12 -12
- package/package/forms/Chip.svelte +28 -18
- package/package/forms/CircularProgress.svelte +3 -3
- package/package/forms/CircularProgressEstimate.svelte +2 -2
- package/package/forms/DateField.svelte +30 -18
- package/package/forms/DateFieldOutlined.svelte +39 -27
- package/package/forms/DatePickerDocked.svelte +2 -2
- package/package/forms/LinearProgress.svelte +5 -5
- package/package/forms/LinearProgressEstimate.svelte +4 -4
- package/package/forms/LoadingIndicator.svelte +4 -4
- package/package/forms/RadioAnim1.svelte +9 -9
- package/package/forms/RadioAnim2.svelte +9 -9
- package/package/forms/RadioAnim3.svelte +9 -9
- package/package/forms/Select.svelte +43 -35
- package/package/forms/SelectOutlined.svelte +44 -36
- package/package/forms/Slider.svelte +35 -30
- package/package/forms/Switch.svelte +27 -28
- package/package/forms/TextField.svelte +41 -29
- package/package/forms/TextFieldMultiline.svelte +41 -29
- package/package/forms/TextFieldOutlined.svelte +41 -29
- package/package/forms/TextFieldOutlinedMultiline.svelte +41 -29
- package/package/forms/WavyLinearProgress.svelte +2 -7
- package/package/forms/WavyLinearProgressEstimate.svelte +2 -7
- package/package/forms/_picker/CalendarPicker.svelte +9 -2
- package/package/forms/_picker/FocusPicker.svelte +9 -7
- package/package/forms/_picker/Header.svelte +12 -5
- package/package/forms/_picker/Item.svelte +15 -8
- package/package/index.d.ts +4 -8
- package/package/index.js +4 -7
- package/package/{utils → misc}/Divider.svelte +1 -1
- package/package/misc/Icon.svelte +0 -4
- package/package/misc/Layer.svelte +1 -1
- package/package/{utils → misc}/badge.js +8 -5
- package/package/misc/recommended-styles.css +9 -9
- package/package/misc/styles.css +160 -227
- package/package/misc/tailwind-styles.css +199 -107
- package/package/misc/utils.js +2 -4
- package/package/nav/NavCMLX.svelte +65 -29
- package/package/nav/NavCMLX.svelte.d.ts +1 -1
- package/package/nav/NavCMLXItem.svelte +359 -188
- package/package/nav/NavCMLXItem.svelte.d.ts +4 -7
- package/package/nav/Tabs.svelte +19 -10
- package/package/nav/TabsLink.svelte +19 -10
- package/package/nav/VariableTabs.svelte +18 -9
- package/package/nav/VariableTabsLink.svelte +18 -9
- package/package.json +16 -13
- package/package/containers/NewSnackbar.svelte +0 -113
- package/package/containers/NewSnackbar.svelte.d.ts +0 -7
- package/package/forms/CircularProgressIndeterminate.svelte +0 -62
- package/package/forms/CircularProgressIndeterminate.svelte.d.ts +0 -5
- package/package/forms/LinearProgressIndeterminate.svelte +0 -57
- package/package/forms/LinearProgressIndeterminate.svelte.d.ts +0 -5
- package/package/forms/SliderTicks.svelte +0 -12
- package/package/forms/SliderTicks.svelte.d.ts +0 -18
- /package/package/{utils → misc}/ChipChooser.svelte +0 -0
- /package/package/{utils → misc}/ChipChooser.svelte.d.ts +0 -0
- /package/package/{utils → misc}/Divider.svelte.d.ts +0 -0
- /package/package/{utils → misc}/badge.d.ts +0 -0
package/package/nav/Tabs.svelte
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
{#if item.icon}
|
|
32
32
|
<Icon icon={item.icon} />
|
|
33
33
|
{/if}
|
|
34
|
-
<span
|
|
34
|
+
<span>{item.name}</span>
|
|
35
35
|
</label>
|
|
36
36
|
{/each}
|
|
37
37
|
<div class="bar"></div>
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
.m3-container {
|
|
42
42
|
display: flex;
|
|
43
43
|
position: relative;
|
|
44
|
-
background-color:
|
|
44
|
+
background-color: var(--m3c-surface);
|
|
45
45
|
}
|
|
46
46
|
input {
|
|
47
47
|
position: absolute;
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
position: absolute;
|
|
53
53
|
inset: auto 0 0 0;
|
|
54
54
|
height: 1px;
|
|
55
|
-
background-color:
|
|
55
|
+
background-color: var(--m3c-surface-container-highest);
|
|
56
56
|
}
|
|
57
57
|
label {
|
|
58
58
|
flex: 1 0;
|
|
@@ -67,35 +67,44 @@
|
|
|
67
67
|
align-items: center;
|
|
68
68
|
justify-content: center;
|
|
69
69
|
|
|
70
|
-
color:
|
|
70
|
+
color: var(--m3c-on-surface-variant);
|
|
71
71
|
user-select: none;
|
|
72
72
|
cursor: pointer;
|
|
73
|
-
transition: color var(--m3-
|
|
73
|
+
transition: color var(--m3-easing-fast);
|
|
74
74
|
}
|
|
75
75
|
label > :global(svg) {
|
|
76
76
|
width: 1.5rem;
|
|
77
77
|
height: 1.5rem;
|
|
78
78
|
}
|
|
79
|
+
label > span {
|
|
80
|
+
|
|
81
|
+
font-family: var(--m3-font);
|
|
82
|
+
font-size: 0.875rem;
|
|
83
|
+
line-height: 1.429;
|
|
84
|
+
letter-spacing: 0.006rem;
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
|
|
87
|
+
}
|
|
79
88
|
|
|
80
89
|
@media (hover: hover) {
|
|
81
90
|
label:hover {
|
|
82
|
-
color:
|
|
91
|
+
color: var(--m3c-on-surface);
|
|
83
92
|
}
|
|
84
93
|
}
|
|
85
94
|
input:focus-visible + label,
|
|
86
95
|
input:active + label,
|
|
87
96
|
input:checked + label {
|
|
88
|
-
color:
|
|
97
|
+
color: var(--m3c-on-surface);
|
|
89
98
|
}
|
|
90
99
|
|
|
91
100
|
.bar {
|
|
92
101
|
position: absolute;
|
|
93
|
-
background-color:
|
|
102
|
+
background-color: var(--m3c-primary);
|
|
94
103
|
width: calc(100% / var(--items));
|
|
95
104
|
height: 0;
|
|
96
105
|
bottom: 0;
|
|
97
106
|
pointer-events: none;
|
|
98
|
-
transition: var(--m3-
|
|
107
|
+
transition: var(--m3-easing-fast-spatial);
|
|
99
108
|
}
|
|
100
109
|
input:checked:nth-of-type(1) ~ .bar {
|
|
101
110
|
inset-inline-start: 0;
|
|
@@ -128,7 +137,7 @@
|
|
|
128
137
|
height: 1.5rem;
|
|
129
138
|
}
|
|
130
139
|
.primary > input:checked + label {
|
|
131
|
-
color:
|
|
140
|
+
color: var(--m3c-primary);
|
|
132
141
|
}
|
|
133
142
|
.primary > .bar {
|
|
134
143
|
width: 3rem;
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
{#if item.icon}
|
|
35
35
|
<Icon icon={item.icon} />
|
|
36
36
|
{/if}
|
|
37
|
-
<span
|
|
37
|
+
<span>{item.name}</span>
|
|
38
38
|
</a>
|
|
39
39
|
{/each}
|
|
40
40
|
<div class="bar"></div>
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
.m3-container {
|
|
45
45
|
display: flex;
|
|
46
46
|
position: relative;
|
|
47
|
-
background-color:
|
|
47
|
+
background-color: var(--m3c-surface);
|
|
48
48
|
}
|
|
49
49
|
.divider {
|
|
50
50
|
position: absolute;
|
|
51
51
|
inset: auto 0 0 0;
|
|
52
52
|
height: 1px;
|
|
53
|
-
background-color:
|
|
53
|
+
background-color: var(--m3c-surface-container-highest);
|
|
54
54
|
}
|
|
55
55
|
a {
|
|
56
56
|
flex: 1 0;
|
|
@@ -65,36 +65,45 @@
|
|
|
65
65
|
align-items: center;
|
|
66
66
|
justify-content: center;
|
|
67
67
|
|
|
68
|
-
color:
|
|
68
|
+
color: var(--m3c-on-surface-variant);
|
|
69
69
|
user-select: none;
|
|
70
70
|
cursor: pointer;
|
|
71
|
-
transition: color var(--m3-
|
|
71
|
+
transition: color var(--m3-easing-fast);
|
|
72
72
|
}
|
|
73
73
|
a > :global(svg) {
|
|
74
74
|
width: 1.5rem;
|
|
75
75
|
height: 1.5rem;
|
|
76
76
|
}
|
|
77
|
+
a > span {
|
|
78
|
+
|
|
79
|
+
font-family: var(--m3-font);
|
|
80
|
+
font-size: 0.875rem;
|
|
81
|
+
line-height: 1.429;
|
|
82
|
+
letter-spacing: 0.006rem;
|
|
83
|
+
font-weight: 500;
|
|
84
|
+
|
|
85
|
+
}
|
|
77
86
|
|
|
78
87
|
@media (hover: hover) {
|
|
79
88
|
a:hover {
|
|
80
|
-
color:
|
|
89
|
+
color: var(--m3c-on-surface);
|
|
81
90
|
}
|
|
82
91
|
}
|
|
83
92
|
a:focus-visible,
|
|
84
93
|
a:active,
|
|
85
94
|
a.selected {
|
|
86
|
-
color:
|
|
95
|
+
color: var(--m3c-on-surface);
|
|
87
96
|
}
|
|
88
97
|
|
|
89
98
|
.bar {
|
|
90
99
|
position: absolute;
|
|
91
|
-
background-color:
|
|
100
|
+
background-color: var(--m3c-primary);
|
|
92
101
|
width: calc(100% / var(--items));
|
|
93
102
|
height: 0.125rem;
|
|
94
103
|
left: calc(100% / var(--items) * var(--i));
|
|
95
104
|
bottom: 0;
|
|
96
105
|
pointer-events: none;
|
|
97
|
-
transition: var(--m3-
|
|
106
|
+
transition: var(--m3-easing-fast-spatial);
|
|
98
107
|
}
|
|
99
108
|
|
|
100
109
|
.primary > a {
|
|
@@ -109,7 +118,7 @@
|
|
|
109
118
|
height: 1.5rem;
|
|
110
119
|
}
|
|
111
120
|
.primary > a.selected {
|
|
112
|
-
color:
|
|
121
|
+
color: var(--m3c-primary);
|
|
113
122
|
}
|
|
114
123
|
.primary > .bar {
|
|
115
124
|
width: 3rem;
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
{#if item.icon}
|
|
91
91
|
<Icon icon={item.icon} />
|
|
92
92
|
{/if}
|
|
93
|
-
<span
|
|
93
|
+
<span>{item.name}</span>
|
|
94
94
|
</label>
|
|
95
95
|
{/each}
|
|
96
96
|
<div class="bar"></div>
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
.m3-container {
|
|
101
101
|
display: grid;
|
|
102
102
|
position: relative;
|
|
103
|
-
background-color:
|
|
103
|
+
background-color: var(--m3c-surface);
|
|
104
104
|
grid-template-columns: repeat(var(--items), auto);
|
|
105
105
|
padding-inline: 1rem;
|
|
106
106
|
justify-content: start;
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
position: absolute;
|
|
116
116
|
inset: auto 0 0 0;
|
|
117
117
|
height: 1px;
|
|
118
|
-
background-color:
|
|
118
|
+
background-color: var(--m3c-surface-container-highest);
|
|
119
119
|
}
|
|
120
120
|
label {
|
|
121
121
|
height: 3rem;
|
|
@@ -128,25 +128,34 @@
|
|
|
128
128
|
align-items: center;
|
|
129
129
|
justify-content: center;
|
|
130
130
|
|
|
131
|
-
color:
|
|
131
|
+
color: var(--m3c-on-surface-variant);
|
|
132
132
|
user-select: none;
|
|
133
133
|
cursor: pointer;
|
|
134
|
-
transition: color var(--m3-
|
|
134
|
+
transition: color var(--m3-easing-fast);
|
|
135
135
|
}
|
|
136
136
|
label > :global(svg) {
|
|
137
137
|
width: 1.5rem;
|
|
138
138
|
height: 1.5rem;
|
|
139
139
|
}
|
|
140
|
+
label > span {
|
|
141
|
+
|
|
142
|
+
font-family: var(--m3-font);
|
|
143
|
+
font-size: 0.875rem;
|
|
144
|
+
line-height: 1.429;
|
|
145
|
+
letter-spacing: 0.006rem;
|
|
146
|
+
font-weight: 500;
|
|
147
|
+
|
|
148
|
+
}
|
|
140
149
|
|
|
141
150
|
@media (hover: hover) {
|
|
142
151
|
label:hover {
|
|
143
|
-
color:
|
|
152
|
+
color: var(--m3c-on-surface);
|
|
144
153
|
}
|
|
145
154
|
}
|
|
146
155
|
input:focus-visible + label,
|
|
147
156
|
input:active + label,
|
|
148
157
|
input:checked + label {
|
|
149
|
-
color:
|
|
158
|
+
color: var(--m3c-on-surface);
|
|
150
159
|
}
|
|
151
160
|
|
|
152
161
|
label,
|
|
@@ -154,7 +163,7 @@
|
|
|
154
163
|
grid-row: 1;
|
|
155
164
|
}
|
|
156
165
|
.bar {
|
|
157
|
-
background-color:
|
|
166
|
+
background-color: var(--m3c-primary);
|
|
158
167
|
height: 0.125rem;
|
|
159
168
|
z-index: 1;
|
|
160
169
|
align-self: end;
|
|
@@ -203,7 +212,7 @@
|
|
|
203
212
|
height: 1.5rem;
|
|
204
213
|
}
|
|
205
214
|
.primary > input:checked + label {
|
|
206
|
-
color:
|
|
215
|
+
color: var(--m3c-primary);
|
|
207
216
|
}
|
|
208
217
|
.primary > .bar {
|
|
209
218
|
width: 3rem;
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
{#if item.icon}
|
|
94
94
|
<Icon icon={item.icon} />
|
|
95
95
|
{/if}
|
|
96
|
-
<span
|
|
96
|
+
<span>{item.name}</span>
|
|
97
97
|
</a>
|
|
98
98
|
{/each}
|
|
99
99
|
<div class="bar" style="grid-column: {items.findIndex((i) => i.value == tab) + 1}"></div>
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
display: grid;
|
|
105
105
|
grid-template-columns: repeat(var(--items), auto);
|
|
106
106
|
position: relative;
|
|
107
|
-
background-color:
|
|
107
|
+
background-color: var(--m3c-surface);
|
|
108
108
|
padding-inline: 1rem;
|
|
109
109
|
justify-content: start;
|
|
110
110
|
overflow-x: auto;
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
position: absolute;
|
|
114
114
|
inset: auto 0 0 0;
|
|
115
115
|
height: 1px;
|
|
116
|
-
background-color:
|
|
116
|
+
background-color: var(--m3c-surface-container-highest);
|
|
117
117
|
}
|
|
118
118
|
a {
|
|
119
119
|
height: 3rem;
|
|
@@ -126,25 +126,34 @@
|
|
|
126
126
|
align-items: center;
|
|
127
127
|
justify-content: center;
|
|
128
128
|
|
|
129
|
-
color:
|
|
129
|
+
color: var(--m3c-on-surface-variant);
|
|
130
130
|
user-select: none;
|
|
131
131
|
cursor: pointer;
|
|
132
|
-
transition: color var(--m3-
|
|
132
|
+
transition: color var(--m3-easing-fast);
|
|
133
133
|
}
|
|
134
134
|
a > :global(svg) {
|
|
135
135
|
width: 1.5rem;
|
|
136
136
|
height: 1.5rem;
|
|
137
137
|
}
|
|
138
|
+
a > span {
|
|
139
|
+
|
|
140
|
+
font-family: var(--m3-font);
|
|
141
|
+
font-size: 0.875rem;
|
|
142
|
+
line-height: 1.429;
|
|
143
|
+
letter-spacing: 0.006rem;
|
|
144
|
+
font-weight: 500;
|
|
145
|
+
|
|
146
|
+
}
|
|
138
147
|
|
|
139
148
|
@media (hover: hover) {
|
|
140
149
|
a:hover {
|
|
141
|
-
color:
|
|
150
|
+
color: var(--m3c-on-surface);
|
|
142
151
|
}
|
|
143
152
|
}
|
|
144
153
|
a:focus-visible,
|
|
145
154
|
a:active,
|
|
146
155
|
a.selected {
|
|
147
|
-
color:
|
|
156
|
+
color: var(--m3c-on-surface);
|
|
148
157
|
}
|
|
149
158
|
|
|
150
159
|
a,
|
|
@@ -152,7 +161,7 @@
|
|
|
152
161
|
grid-row: 1;
|
|
153
162
|
}
|
|
154
163
|
.bar {
|
|
155
|
-
background-color:
|
|
164
|
+
background-color: var(--m3c-primary);
|
|
156
165
|
height: 0.125rem;
|
|
157
166
|
z-index: 1;
|
|
158
167
|
align-self: end;
|
|
@@ -171,7 +180,7 @@
|
|
|
171
180
|
height: 1.5rem;
|
|
172
181
|
}
|
|
173
182
|
.primary > a.selected {
|
|
174
|
-
color:
|
|
183
|
+
color: var(--m3c-primary);
|
|
175
184
|
}
|
|
176
185
|
.primary > .bar {
|
|
177
186
|
width: 3rem;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "m3-svelte",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"license": "Apache-2.0 OR GPL-3.0-only",
|
|
5
5
|
"repository": "KTibow/m3-svelte",
|
|
6
6
|
"author": {
|
|
@@ -22,11 +22,9 @@
|
|
|
22
22
|
"svelte": "./package/index.js"
|
|
23
23
|
},
|
|
24
24
|
"./misc/styles.css": {
|
|
25
|
-
"import": "./package/misc/styles.css",
|
|
26
25
|
"style": "./package/misc/styles.css"
|
|
27
26
|
},
|
|
28
27
|
"./misc/recommended-styles.css": {
|
|
29
|
-
"import": "./package/misc/recommended-styles.css",
|
|
30
28
|
"style": "./package/misc/recommended-styles.css"
|
|
31
29
|
},
|
|
32
30
|
"./misc/tailwind-styles.css": {
|
|
@@ -35,32 +33,37 @@
|
|
|
35
33
|
},
|
|
36
34
|
"dependencies": {
|
|
37
35
|
"@iconify/types": "^2.0.0",
|
|
38
|
-
"@ktibow/iconset-material-symbols": "~0.0.
|
|
39
|
-
"@ktibow/material-color-utilities-nightly": "^0.3.11763580498000"
|
|
40
|
-
"svelte": "^5.43.14"
|
|
36
|
+
"@ktibow/iconset-material-symbols": "~0.0.1764827375",
|
|
37
|
+
"@ktibow/material-color-utilities-nightly": "^0.3.11763580498000"
|
|
41
38
|
},
|
|
42
39
|
"devDependencies": {
|
|
43
40
|
"@eslint/compat": "^2.0.0",
|
|
44
41
|
"@eslint/js": "^9.39.1",
|
|
45
42
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
46
|
-
"@sveltejs/kit": "^2.
|
|
47
|
-
"@sveltejs/package": "^2.5.
|
|
43
|
+
"@sveltejs/kit": "^2.49.1",
|
|
44
|
+
"@sveltejs/package": "^2.5.7",
|
|
48
45
|
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
49
46
|
"@types/flubber": "^0.4.0",
|
|
50
|
-
"eslint": "^9.
|
|
47
|
+
"eslint": "^9.39.1",
|
|
51
48
|
"eslint-config-prettier": "^10.1.8",
|
|
52
|
-
"eslint-plugin-svelte": "^3.
|
|
49
|
+
"eslint-plugin-svelte": "^3.13.1",
|
|
53
50
|
"fast-glob": "^3.3.3",
|
|
54
51
|
"flubber": "^0.4.2",
|
|
55
52
|
"globals": "^16.5.0",
|
|
56
|
-
"prettier": "^3.
|
|
53
|
+
"prettier": "^3.7.4",
|
|
57
54
|
"prettier-plugin-svelte": "^3.4.0",
|
|
58
55
|
"publint": "^0.3.15",
|
|
56
|
+
"svelte": "^5.45.6",
|
|
59
57
|
"svelte-check": "^4.3.4",
|
|
60
58
|
"svelte-highlight": "^7.9.0",
|
|
61
59
|
"typescript": "^5.9.3",
|
|
62
|
-
"typescript-eslint": "^8.48.
|
|
63
|
-
"vite": "^7.2.
|
|
60
|
+
"typescript-eslint": "^8.48.1",
|
|
61
|
+
"vite": "^7.2.6",
|
|
62
|
+
"vite-plugin-functions-mixins": "^0.1.0",
|
|
63
|
+
"vite-plugin-token-shaker": "^0.0.3"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"svelte": "^5.40.0"
|
|
64
67
|
},
|
|
65
68
|
"keywords": [
|
|
66
69
|
"svelte",
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
export const snackbar = (
|
|
3
|
-
message: string,
|
|
4
|
-
actions?: Record<string, () => void>,
|
|
5
|
-
closable?: boolean,
|
|
6
|
-
/*
|
|
7
|
-
undefined/unset -> 4s timeout
|
|
8
|
-
2000 -> 2s timeout
|
|
9
|
-
-1 -> no timeout
|
|
10
|
-
*/
|
|
11
|
-
timeout?: number,
|
|
12
|
-
) => {
|
|
13
|
-
_show(message, actions, closable, timeout);
|
|
14
|
-
};
|
|
15
|
-
let _show: typeof snackbar;
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<script lang="ts">
|
|
19
|
-
import { fade } from "svelte/transition";
|
|
20
|
-
import iconX from "@ktibow/iconset-material-symbols/close";
|
|
21
|
-
import Icon from "../misc/Icon.svelte";
|
|
22
|
-
import SnackbarItem from "./SnackbarItem.svelte";
|
|
23
|
-
import Layer from "../misc/Layer.svelte";
|
|
24
|
-
|
|
25
|
-
let { closeTitle = "Close" }: { closeTitle?: string } = $props();
|
|
26
|
-
let shown:
|
|
27
|
-
| { message: string; actions: Record<string, () => void>; closable: boolean }
|
|
28
|
-
| undefined = $state();
|
|
29
|
-
let timeoutId: number;
|
|
30
|
-
_show = (message, actions = {}, closable = false, timeout = 4000) => {
|
|
31
|
-
shown = { message, actions, closable };
|
|
32
|
-
clearTimeout(timeoutId);
|
|
33
|
-
if (timeout && timeout > 0)
|
|
34
|
-
timeoutId = setTimeout(() => {
|
|
35
|
-
shown = undefined;
|
|
36
|
-
}, timeout);
|
|
37
|
-
};
|
|
38
|
-
</script>
|
|
39
|
-
|
|
40
|
-
{#if shown}
|
|
41
|
-
<div class="holder" out:fade={{ duration: 200 }}>
|
|
42
|
-
{#key shown}
|
|
43
|
-
<SnackbarItem>
|
|
44
|
-
<p class="m3-font-body-medium">{shown.message}</p>
|
|
45
|
-
{#each Object.entries(shown.actions) as [key, action]}
|
|
46
|
-
<button
|
|
47
|
-
type="button"
|
|
48
|
-
class="action m3-font-label-large"
|
|
49
|
-
onclick={() => {
|
|
50
|
-
shown = undefined;
|
|
51
|
-
action();
|
|
52
|
-
}}
|
|
53
|
-
>
|
|
54
|
-
{key}
|
|
55
|
-
</button>
|
|
56
|
-
{/each}
|
|
57
|
-
{#if shown.closable}
|
|
58
|
-
<button
|
|
59
|
-
type="button"
|
|
60
|
-
class="close"
|
|
61
|
-
title={closeTitle}
|
|
62
|
-
onclick={() => {
|
|
63
|
-
shown = undefined;
|
|
64
|
-
}}
|
|
65
|
-
>
|
|
66
|
-
<Layer />
|
|
67
|
-
<Icon icon={iconX} />
|
|
68
|
-
</button>
|
|
69
|
-
{/if}
|
|
70
|
-
</SnackbarItem>
|
|
71
|
-
{/key}
|
|
72
|
-
</div>
|
|
73
|
-
{/if}
|
|
74
|
-
|
|
75
|
-
<style>
|
|
76
|
-
.holder {
|
|
77
|
-
position: fixed;
|
|
78
|
-
padding-bottom: 1rem;
|
|
79
|
-
bottom: var(--m3-util-bottom-offset);
|
|
80
|
-
left: 50%;
|
|
81
|
-
transform: translate(-50%, 0);
|
|
82
|
-
z-index: 3;
|
|
83
|
-
}
|
|
84
|
-
p {
|
|
85
|
-
margin-right: auto;
|
|
86
|
-
}
|
|
87
|
-
button {
|
|
88
|
-
display: flex;
|
|
89
|
-
align-self: stretch;
|
|
90
|
-
align-items: center;
|
|
91
|
-
margin: 0;
|
|
92
|
-
padding: 0;
|
|
93
|
-
border: none;
|
|
94
|
-
|
|
95
|
-
background-color: transparent;
|
|
96
|
-
color: unset;
|
|
97
|
-
cursor: pointer;
|
|
98
|
-
position: relative;
|
|
99
|
-
}
|
|
100
|
-
button :global(svg) {
|
|
101
|
-
width: 1.5rem;
|
|
102
|
-
height: 1.5rem;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.action {
|
|
106
|
-
color: rgb(var(--m3-scheme-inverse-primary));
|
|
107
|
-
padding: 0 0.5rem;
|
|
108
|
-
}
|
|
109
|
-
.close {
|
|
110
|
-
padding: 0 0.75rem;
|
|
111
|
-
margin-right: -1rem;
|
|
112
|
-
}
|
|
113
|
-
</style>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const snackbar: (message: string, actions?: Record<string, () => void>, closable?: boolean, timeout?: number) => void;
|
|
2
|
-
type $$ComponentProps = {
|
|
3
|
-
closeTitle?: string;
|
|
4
|
-
};
|
|
5
|
-
declare const NewSnackbar: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
-
type NewSnackbar = ReturnType<typeof NewSnackbar>;
|
|
7
|
-
export default NewSnackbar;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@deprecated use LoadingIndicator or one of the Estimate components instead
|
|
4
|
-
-->
|
|
5
|
-
<script lang="ts">
|
|
6
|
-
import type { HTMLAttributes } from "svelte/elements";
|
|
7
|
-
|
|
8
|
-
let extra: HTMLAttributes<SVGElement> = $props();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<svg
|
|
12
|
-
viewBox="0 0 48 48"
|
|
13
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
-
class="m3-container"
|
|
15
|
-
role="progressbar"
|
|
16
|
-
{...extra}
|
|
17
|
-
>
|
|
18
|
-
<circle
|
|
19
|
-
cx="24"
|
|
20
|
-
cy="24"
|
|
21
|
-
r="20"
|
|
22
|
-
stroke="rgb(var(--m3-scheme-primary))"
|
|
23
|
-
stroke-width="4"
|
|
24
|
-
stroke-dasharray="125.66 125.66"
|
|
25
|
-
stroke-linecap="round"
|
|
26
|
-
fill="none"
|
|
27
|
-
/>
|
|
28
|
-
</svg>
|
|
29
|
-
|
|
30
|
-
<style>
|
|
31
|
-
svg {
|
|
32
|
-
width: 3rem;
|
|
33
|
-
height: 3rem;
|
|
34
|
-
animation: progressRotate 2.2s infinite linear;
|
|
35
|
-
}
|
|
36
|
-
circle {
|
|
37
|
-
transition: var(--m3-util-easing-fast);
|
|
38
|
-
animation: progressSize 2.2s infinite linear;
|
|
39
|
-
}
|
|
40
|
-
@keyframes progressRotate {
|
|
41
|
-
0% {
|
|
42
|
-
transform: rotate(0deg);
|
|
43
|
-
}
|
|
44
|
-
40% {
|
|
45
|
-
transform: rotate(360deg);
|
|
46
|
-
}
|
|
47
|
-
100% {
|
|
48
|
-
transform: rotate(1080deg);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
@keyframes progressSize {
|
|
52
|
-
0% {
|
|
53
|
-
stroke-dashoffset: 125.66;
|
|
54
|
-
}
|
|
55
|
-
40% {
|
|
56
|
-
stroke-dashoffset: 62.83;
|
|
57
|
-
}
|
|
58
|
-
100% {
|
|
59
|
-
stroke-dashoffset: 125.66;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
</style>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
-
/** @deprecated use LoadingIndicator or one of the Estimate components instead */
|
|
3
|
-
declare const CircularProgressIndeterminate: import("svelte").Component<HTMLAttributes<SVGElement>, {}, "">;
|
|
4
|
-
type CircularProgressIndeterminate = ReturnType<typeof CircularProgressIndeterminate>;
|
|
5
|
-
export default CircularProgressIndeterminate;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@deprecated use LoadingIndicator or one of the Estimate components instead
|
|
4
|
-
-->
|
|
5
|
-
<script lang="ts">
|
|
6
|
-
import type { DivAttrs } from "../misc/typing-utils";
|
|
7
|
-
|
|
8
|
-
let extra: DivAttrs = $props();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<div class="m3-container" role="progressbar" {...extra}>
|
|
12
|
-
<div class="percent"></div>
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
<style>
|
|
16
|
-
@layer tokens {
|
|
17
|
-
:root {
|
|
18
|
-
--m3-linear-progress-shape: var(--m3-util-rounding-full);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
.m3-container {
|
|
22
|
-
display: inline-flex;
|
|
23
|
-
background-color: rgb(var(--m3-scheme-primary-container));
|
|
24
|
-
height: 0.25rem;
|
|
25
|
-
min-width: 8rem;
|
|
26
|
-
position: relative;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
border-radius: var(--m3-linear-progress-shape);
|
|
29
|
-
}
|
|
30
|
-
.percent {
|
|
31
|
-
background-color: rgb(var(--m3-scheme-primary));
|
|
32
|
-
animation: progress infinite 1.5s ease-out;
|
|
33
|
-
border-radius: var(--m3-linear-progress-shape);
|
|
34
|
-
width: 50%;
|
|
35
|
-
top: 0;
|
|
36
|
-
bottom: 0;
|
|
37
|
-
position: absolute;
|
|
38
|
-
}
|
|
39
|
-
@keyframes progress {
|
|
40
|
-
0% {
|
|
41
|
-
left: -50%;
|
|
42
|
-
}
|
|
43
|
-
100% {
|
|
44
|
-
left: 125%;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.m3-container {
|
|
49
|
-
print-color-adjust: exact;
|
|
50
|
-
-webkit-print-color-adjust: exact;
|
|
51
|
-
}
|
|
52
|
-
@media screen and (forced-colors: active) {
|
|
53
|
-
.percent {
|
|
54
|
-
background-color: selecteditem;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
</style>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { DivAttrs } from "../misc/typing-utils";
|
|
2
|
-
/** @deprecated use LoadingIndicator or one of the Estimate components instead */
|
|
3
|
-
declare const LinearProgressIndeterminate: import("svelte").Component<DivAttrs, {}, "">;
|
|
4
|
-
type LinearProgressIndeterminate = ReturnType<typeof LinearProgressIndeterminate>;
|
|
5
|
-
export default LinearProgressIndeterminate;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@deprecated use Slider directly instead
|
|
4
|
-
-->
|
|
5
|
-
<script lang="ts">
|
|
6
|
-
import type { ComponentProps } from "svelte";
|
|
7
|
-
import Slider from "./Slider.svelte";
|
|
8
|
-
|
|
9
|
-
let props: Omit<ComponentProps<typeof Slider>, "stops"> = $props();
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<Slider {...props} stops={true}></Slider>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** @deprecated use Slider directly instead */
|
|
2
|
-
declare const SliderTicks: import("svelte").Component<Omit<{
|
|
3
|
-
value: number;
|
|
4
|
-
min?: number;
|
|
5
|
-
max?: number;
|
|
6
|
-
step?: number | "any";
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
showValue?: boolean;
|
|
9
|
-
size?: "xs" | "s" | "m" | "l" | "xl";
|
|
10
|
-
leadingIcon?: import("@iconify/types").IconifyIcon;
|
|
11
|
-
trailingIcon?: import("@iconify/types").IconifyIcon;
|
|
12
|
-
stops?: boolean;
|
|
13
|
-
endStops?: boolean;
|
|
14
|
-
vertical?: boolean;
|
|
15
|
-
format?: (n: number) => string;
|
|
16
|
-
} & Omit<import("svelte/elements").HTMLInputAttributes, "size">, "stops">, {}, "">;
|
|
17
|
-
type SliderTicks = ReturnType<typeof SliderTicks>;
|
|
18
|
-
export default SliderTicks;
|