@sveltia/ui 0.2.5 → 0.3.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/components/{core → button}/button.svelte +3 -2
- package/package/components/{core → button}/button.svelte.d.ts +5 -4
- package/package/components/{composite → button}/select-button-group.svelte +6 -3
- package/package/components/{composite → calendar}/calendar.svelte +9 -5
- package/package/components/{composite → calendar}/calendar.svelte.d.ts +1 -0
- package/package/components/{composite → checkbox}/checkbox-group.svelte +1 -1
- package/package/components/{composite → checkbox}/checkbox-group.svelte.d.ts +2 -2
- package/package/components/{core → checkbox}/checkbox.svelte +7 -5
- package/package/components/{core → checkbox}/checkbox.svelte.d.ts +4 -2
- package/package/components/{core → dialog}/dialog.svelte +4 -3
- package/package/components/{core → dialog}/dialog.svelte.d.ts +1 -0
- package/package/components/{composite → disclosure}/disclosure.svelte +5 -4
- package/package/components/{composite → disclosure}/disclosure.svelte.d.ts +2 -1
- package/package/components/{core/separator.svelte → divider/divider.svelte} +5 -4
- package/package/components/divider/divider.svelte.d.ts +29 -0
- package/package/components/{core → divider}/spacer.svelte +4 -0
- package/package/components/{core → divider}/spacer.svelte.d.ts +1 -0
- package/package/components/{core → drawer}/drawer.svelte +4 -3
- package/package/components/{core → drawer}/drawer.svelte.d.ts +1 -0
- package/package/components/{core → icon}/icon.svelte +5 -0
- package/package/components/{core → icon}/icon.svelte.d.ts +6 -2
- package/package/components/listbox/listbox.svelte +74 -0
- package/package/components/{composite → listbox}/listbox.svelte.d.ts +2 -0
- package/package/components/listbox/option-group.svelte +47 -0
- package/package/components/listbox/option-group.svelte.d.ts +38 -0
- package/package/components/{core → listbox}/option.svelte +34 -2
- package/package/components/{core → listbox}/option.svelte.d.ts +7 -3
- package/package/components/{core → menu}/menu-button.svelte +2 -16
- package/package/components/{core → menu}/menu-button.svelte.d.ts +4 -1
- package/package/components/{core → menu}/menu-item-checkbox.svelte +1 -0
- package/package/components/{core → menu}/menu-item-checkbox.svelte.d.ts +4 -1
- package/package/components/{composite → menu}/menu-item-group.svelte +5 -1
- package/package/components/{composite → menu}/menu-item-group.svelte.d.ts +1 -0
- package/package/components/{core → menu}/menu-item-radio.svelte +2 -0
- package/package/components/{core → menu}/menu-item-radio.svelte.d.ts +5 -1
- package/package/components/{core → menu}/menu-item.svelte +6 -6
- package/package/components/{core → menu}/menu-item.svelte.d.ts +4 -1
- package/package/components/{composite → menu}/menu.svelte +2 -1
- package/package/components/{composite → menu}/menu.svelte.d.ts +1 -0
- package/package/components/{composite → radio}/radio-group.svelte +6 -2
- package/package/components/{composite → radio}/radio-group.svelte.d.ts +1 -1
- package/package/components/{core → radio}/radio.svelte +6 -4
- package/package/components/{core → radio}/radio.svelte.d.ts +4 -2
- package/package/components/{composite → select}/combobox.svelte +7 -6
- package/package/components/{composite → select}/combobox.svelte.d.ts +3 -2
- package/package/components/{composite → select}/select.svelte +3 -1
- package/package/components/{composite → select}/select.svelte.d.ts +7 -3
- package/package/components/{core → slider}/slider.svelte +58 -47
- package/package/components/{core → slider}/slider.svelte.d.ts +12 -10
- package/package/components/{core → switch}/switch.svelte +36 -19
- package/package/components/{core → switch}/switch.svelte.d.ts +3 -2
- package/package/components/table/table-body.svelte +23 -0
- package/package/components/table/table-body.svelte.d.ts +34 -0
- package/package/components/table/table-cell.svelte +23 -0
- package/package/components/table/table-cell.svelte.d.ts +34 -0
- package/package/components/table/table-col-header.svelte +23 -0
- package/package/components/table/table-col-header.svelte.d.ts +34 -0
- package/package/components/table/table-foot.svelte +23 -0
- package/package/components/table/table-foot.svelte.d.ts +34 -0
- package/package/components/table/table-head.svelte +23 -0
- package/package/components/table/table-head.svelte.d.ts +34 -0
- package/package/components/table/table-row-header.svelte +23 -0
- package/package/components/table/table-row-header.svelte.d.ts +34 -0
- package/package/components/table/table-row.svelte +23 -0
- package/package/components/table/table-row.svelte.d.ts +38 -0
- package/package/components/table/table.svelte +44 -0
- package/package/components/table/table.svelte.d.ts +36 -0
- package/package/components/{composite → tabs}/tab-list.svelte +3 -2
- package/package/components/{composite → tabs}/tab-list.svelte.d.ts +6 -5
- package/package/components/{core → tabs}/tab-panel.svelte +1 -0
- package/package/components/{core → tabs}/tab-panel.svelte.d.ts +1 -0
- package/package/components/{core → tabs}/tab.svelte +2 -1
- package/package/components/{core → tabs}/tab.svelte.d.ts +1 -0
- package/package/components/{editor/markdown.svelte → text-field/markdown-editor.svelte} +10 -6
- package/package/components/text-field/markdown-editor.svelte.d.ts +26 -0
- package/package/components/{core → text-field}/number-input.svelte +13 -7
- package/package/components/{core → text-field}/number-input.svelte.d.ts +7 -3
- package/package/components/{core → text-field}/password-input.svelte +6 -3
- package/package/components/{core → text-field}/password-input.svelte.d.ts +8 -3
- package/package/components/{core → text-field}/search-bar.svelte +5 -2
- package/package/components/{core → text-field}/search-bar.svelte.d.ts +8 -3
- package/package/components/{core → text-field}/text-area.svelte +3 -1
- package/package/components/{core → text-field}/text-area.svelte.d.ts +9 -5
- package/package/components/{core → text-field}/text-input.svelte +6 -4
- package/package/components/{core → text-field}/text-input.svelte.d.ts +11 -7
- package/package/components/{core → toolbar}/toolbar.svelte +1 -0
- package/package/components/{core → toolbar}/toolbar.svelte.d.ts +2 -1
- package/package/components/util/app-shell.svelte +11 -40
- package/package/components/util/group.js +305 -0
- package/package/components/{core → util}/group.svelte +5 -11
- package/package/components/{core → util}/group.svelte.d.ts +4 -2
- package/package/components/util/popup.d.ts +30 -0
- package/package/components/{helpers → util}/popup.js +20 -25
- package/package/components/util/popup.svelte +14 -5
- package/package/components/util/{misc.d.ts → util.d.ts} +1 -0
- package/package/components/util/{misc.js → util.js} +15 -0
- package/package/index.d.ts +46 -41
- package/package/index.js +48 -83
- package/package/styles/core.scss +5 -34
- package/package/styles/variables.scss +6 -8
- package/package.json +351 -317
- package/package/components/composite/grid.svelte +0 -24
- package/package/components/composite/grid.svelte.d.ts +0 -31
- package/package/components/composite/listbox.svelte +0 -63
- package/package/components/core/grid-cell.svelte +0 -13
- package/package/components/core/grid-cell.svelte.d.ts +0 -29
- package/package/components/core/row-group.svelte +0 -13
- package/package/components/core/row-group.svelte.d.ts +0 -29
- package/package/components/core/row.svelte +0 -13
- package/package/components/core/row.svelte.d.ts +0 -33
- package/package/components/core/separator.svelte.d.ts +0 -26
- package/package/components/editor/markdown.svelte.d.ts +0 -25
- package/package/components/helpers/group.js +0 -253
- package/package/components/helpers/popup.d.ts +0 -30
- package/package/components/helpers/util.d.ts +0 -1
- package/package/components/helpers/util.js +0 -14
- package/package/components/{composite → button}/select-button-group.svelte.d.ts +4 -4
- /package/package/components/{core → button}/select-button.svelte +0 -0
- /package/package/components/{core → button}/select-button.svelte.d.ts +0 -0
- /package/package/components/{helpers → util}/group.d.ts +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
The equivalent of the HTML `<input type="range">` element, but it comes with the multi-thumb
|
|
4
|
+
support.
|
|
3
5
|
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range
|
|
4
6
|
@see https://w3c.github.io/aria/#slider
|
|
5
7
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/slider/
|
|
@@ -18,11 +20,14 @@
|
|
|
18
20
|
|
|
19
21
|
export let value = 0;
|
|
20
22
|
export let sliderLabel = '';
|
|
23
|
+
/** @type {[number, number]} */
|
|
21
24
|
export let values = undefined;
|
|
22
|
-
|
|
25
|
+
/** @type {[string, string]} */
|
|
26
|
+
export let sliderLabels = undefined;
|
|
23
27
|
export let min = 0;
|
|
24
28
|
export let max = 100;
|
|
25
29
|
export let step = 1;
|
|
30
|
+
/** @type {(string[] | number[])} */
|
|
26
31
|
export let optionLabels = [];
|
|
27
32
|
|
|
28
33
|
$: multiThumb = !!values;
|
|
@@ -40,53 +45,59 @@
|
|
|
40
45
|
let targetValueIndex = 0;
|
|
41
46
|
|
|
42
47
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @param {number} diff
|
|
48
|
+
* Move a thumb with mouse.
|
|
49
|
+
* @param {number} diff Distance from the original X position in pixels.
|
|
45
50
|
*/
|
|
46
|
-
const
|
|
47
|
-
if (diff
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
const moveThumb = (diff) => {
|
|
52
|
+
if (diff < 0) {
|
|
53
|
+
diff = 0;
|
|
54
|
+
} else if (diff > barWidth) {
|
|
55
|
+
diff = barWidth;
|
|
56
|
+
}
|
|
50
57
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
? fromIndex
|
|
54
|
-
: toIndex;
|
|
58
|
+
const fromIndex = positionList.findLastIndex((s) => s <= diff);
|
|
59
|
+
const toIndex = positionList.findIndex((s) => diff <= s);
|
|
55
60
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(targetValueIndex === 1 && sliderPositions[0] >= positionList[index])))
|
|
61
|
-
) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
61
|
+
const index =
|
|
62
|
+
Math.abs(positionList[fromIndex] - diff) < Math.abs(positionList[toIndex] - diff)
|
|
63
|
+
? fromIndex
|
|
64
|
+
: toIndex;
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
if (
|
|
67
|
+
sliderPositions[targetValueIndex] === positionList[index] ||
|
|
68
|
+
(multiThumb &&
|
|
69
|
+
((targetValueIndex === 0 && sliderPositions[1] <= positionList[index]) ||
|
|
70
|
+
(targetValueIndex === 1 && sliderPositions[0] >= positionList[index])))
|
|
71
|
+
) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (multiThumb) {
|
|
76
|
+
values[targetValueIndex] = valueList[index];
|
|
77
|
+
} else {
|
|
78
|
+
value = valueList[index];
|
|
70
79
|
}
|
|
71
80
|
};
|
|
72
81
|
|
|
73
82
|
/**
|
|
74
|
-
*
|
|
83
|
+
* Handle the `keydown` event fired on the slider.
|
|
75
84
|
* @param {KeyboardEvent} event `keydown` event.
|
|
76
|
-
* @param {number} [valueIndex]
|
|
85
|
+
* @param {number} [valueIndex] Index in the {@link values} array to be used to get/set the value.
|
|
77
86
|
*/
|
|
78
87
|
const onKeyDown = (event, valueIndex = 0) => {
|
|
79
|
-
const { key,
|
|
88
|
+
const { key, ctrlKey, metaKey, shiftKey, altKey } = event;
|
|
89
|
+
const hasModifier = shiftKey || altKey || ctrlKey || metaKey;
|
|
80
90
|
|
|
81
|
-
if (
|
|
91
|
+
if (hasModifier) {
|
|
82
92
|
return;
|
|
83
93
|
}
|
|
84
94
|
|
|
95
|
+
const _value = multiThumb ? values[valueIndex] : value;
|
|
85
96
|
let index = -1;
|
|
86
97
|
|
|
87
98
|
if (['ArrowDown', 'ArrowLeft'].includes(key)) {
|
|
88
|
-
if (
|
|
89
|
-
index = valueList.indexOf(
|
|
99
|
+
if (_value > min) {
|
|
100
|
+
index = valueList.indexOf(_value) - 1;
|
|
90
101
|
}
|
|
91
102
|
|
|
92
103
|
event.preventDefault();
|
|
@@ -94,8 +105,8 @@
|
|
|
94
105
|
}
|
|
95
106
|
|
|
96
107
|
if (['ArrowUp', 'ArrowRight'].includes(key)) {
|
|
97
|
-
if (
|
|
98
|
-
index = valueList.indexOf(
|
|
108
|
+
if (_value < max) {
|
|
109
|
+
index = valueList.indexOf(_value) + 1;
|
|
99
110
|
}
|
|
100
111
|
|
|
101
112
|
event.preventDefault();
|
|
@@ -120,9 +131,9 @@
|
|
|
120
131
|
};
|
|
121
132
|
|
|
122
133
|
/**
|
|
123
|
-
*
|
|
134
|
+
* Handle the `mousedown` event fired on the slider.
|
|
124
135
|
* @param {MouseEvent} event `mousedown` event.
|
|
125
|
-
* @param {number} [valueIndex]
|
|
136
|
+
* @param {number} [valueIndex] Index in the {@link values} array to be used to get/set the value.
|
|
126
137
|
*/
|
|
127
138
|
const onMouseDown = (event, valueIndex = 0) => {
|
|
128
139
|
const { clientX, screenX } = event;
|
|
@@ -134,17 +145,17 @@
|
|
|
134
145
|
};
|
|
135
146
|
|
|
136
147
|
/**
|
|
137
|
-
*
|
|
148
|
+
* Handle the `mousemove` event fired anywhere on the page.
|
|
138
149
|
* @param {MouseEvent} event `mousemove` event.
|
|
139
150
|
*/
|
|
140
151
|
const onMouseMove = (event) => {
|
|
141
152
|
if (dragging) {
|
|
142
|
-
|
|
153
|
+
moveThumb(startX + (event.screenX - startScreenX));
|
|
143
154
|
}
|
|
144
155
|
};
|
|
145
156
|
|
|
146
157
|
/**
|
|
147
|
-
*
|
|
158
|
+
* Handle the `mouseup` event fired anywhere on the page.
|
|
148
159
|
*/
|
|
149
160
|
const onMouseUp = () => {
|
|
150
161
|
if (dragging) {
|
|
@@ -153,12 +164,12 @@
|
|
|
153
164
|
};
|
|
154
165
|
|
|
155
166
|
/**
|
|
156
|
-
*
|
|
167
|
+
* Handle the `click` event fired on the slider.
|
|
157
168
|
* @param {MouseEvent} event `click` event.
|
|
158
169
|
*/
|
|
159
170
|
const onClick = (event) => {
|
|
160
171
|
if (!multiThumb && !dragging) {
|
|
161
|
-
|
|
172
|
+
moveThumb(/** @type {any} */ (event).layerX);
|
|
162
173
|
}
|
|
163
174
|
|
|
164
175
|
if (dragging) {
|
|
@@ -167,7 +178,7 @@
|
|
|
167
178
|
};
|
|
168
179
|
|
|
169
180
|
/**
|
|
170
|
-
*
|
|
181
|
+
* Update the thumb position and fire the `change` event when the value is changed.
|
|
171
182
|
*/
|
|
172
183
|
const onValueChange = () => {
|
|
173
184
|
if (multiThumb) {
|
|
@@ -220,12 +231,12 @@
|
|
|
220
231
|
style:width="{multiThumb ? sliderPositions[1] - sliderPositions[0] : sliderPositions[0]}px"
|
|
221
232
|
/>
|
|
222
233
|
<div
|
|
223
|
-
role="slider"
|
|
224
234
|
tabindex="0"
|
|
225
|
-
|
|
235
|
+
role="slider"
|
|
236
|
+
aria-label={multiThumb ? sliderLabels?.[0] || '' : sliderLabel}
|
|
226
237
|
aria-valuemin={min}
|
|
227
238
|
aria-valuemax={max}
|
|
228
|
-
aria-valuenow={value}
|
|
239
|
+
aria-valuenow={multiThumb ? values[0] : value}
|
|
229
240
|
style:left="{sliderPositions[0]}px"
|
|
230
241
|
on:mousedown={(event) => {
|
|
231
242
|
onMouseDown(event, 0);
|
|
@@ -236,12 +247,12 @@
|
|
|
236
247
|
/>
|
|
237
248
|
{#if multiThumb}
|
|
238
249
|
<div
|
|
239
|
-
role="slider"
|
|
240
250
|
tabindex="0"
|
|
241
|
-
|
|
251
|
+
role="slider"
|
|
252
|
+
aria-label={sliderLabels?.[1] || ''}
|
|
242
253
|
aria-valuemin={min}
|
|
243
254
|
aria-valuemax={max}
|
|
244
|
-
aria-valuenow={
|
|
255
|
+
aria-valuenow={values[1]}
|
|
245
256
|
style:left="{sliderPositions[1]}px"
|
|
246
257
|
on:mousedown={(event) => {
|
|
247
258
|
onMouseDown(event, 1);
|
|
@@ -276,7 +287,7 @@
|
|
|
276
287
|
width: var(--slider-base-width, 200px);
|
|
277
288
|
height: 8px;
|
|
278
289
|
border-radius: 8px;
|
|
279
|
-
background-color: var(--
|
|
290
|
+
background-color: var(--control-border-color);
|
|
280
291
|
}
|
|
281
292
|
|
|
282
293
|
.bar {
|
|
@@ -2,21 +2,23 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} SliderEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} SliderSlots */
|
|
4
4
|
/**
|
|
5
|
+
* The equivalent of the HTML `<input type="range">` element, but it comes with the multi-thumb
|
|
6
|
+
* support.
|
|
5
7
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range
|
|
6
8
|
* @see https://w3c.github.io/aria/#slider
|
|
7
9
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/slider/
|
|
8
10
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/slider-multithumb/
|
|
9
11
|
*/
|
|
10
12
|
export default class Slider extends SvelteComponentTyped<{
|
|
11
|
-
class?: string;
|
|
12
13
|
value?: number;
|
|
14
|
+
class?: string;
|
|
15
|
+
sliderLabel?: string;
|
|
16
|
+
values?: [number, number];
|
|
17
|
+
sliderLabels?: [string, string];
|
|
13
18
|
min?: number;
|
|
14
19
|
max?: number;
|
|
15
20
|
step?: number;
|
|
16
|
-
|
|
17
|
-
values?: any;
|
|
18
|
-
sliderLabels?: any[];
|
|
19
|
-
optionLabels?: any[];
|
|
21
|
+
optionLabels?: string[] | number[];
|
|
20
22
|
}, {
|
|
21
23
|
click: MouseEvent;
|
|
22
24
|
change: CustomEvent<any>;
|
|
@@ -30,15 +32,15 @@ export type SliderSlots = typeof __propDef.slots;
|
|
|
30
32
|
import { SvelteComponentTyped } from "svelte";
|
|
31
33
|
declare const __propDef: {
|
|
32
34
|
props: {
|
|
33
|
-
class?: string;
|
|
34
35
|
value?: number;
|
|
36
|
+
class?: string;
|
|
37
|
+
sliderLabel?: string;
|
|
38
|
+
values?: [number, number];
|
|
39
|
+
sliderLabels?: [string, string];
|
|
35
40
|
min?: number;
|
|
36
41
|
max?: number;
|
|
37
42
|
step?: number;
|
|
38
|
-
|
|
39
|
-
values?: any;
|
|
40
|
-
sliderLabels?: any[];
|
|
41
|
-
optionLabels?: any[];
|
|
43
|
+
optionLabels?: (string[] | number[]);
|
|
42
44
|
};
|
|
43
45
|
events: {
|
|
44
46
|
click: MouseEvent;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
A variant of `<Checkbox>`, looking like a switch that can be often seen on mobile apps.
|
|
3
4
|
@see https://w3c.github.io/aria/#switch
|
|
4
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/switch/
|
|
5
6
|
-->
|
|
@@ -19,49 +20,65 @@
|
|
|
19
20
|
export let disabled = false;
|
|
20
21
|
</script>
|
|
21
22
|
|
|
22
|
-
<
|
|
23
|
-
|
|
23
|
+
<button
|
|
24
|
+
class="sui switch {className}"
|
|
25
|
+
{disabled}
|
|
26
|
+
role="switch"
|
|
27
|
+
aria-disabled={disabled}
|
|
28
|
+
aria-checked={checked}
|
|
29
|
+
on:click={() => {
|
|
30
|
+
checked = !checked;
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
24
33
|
<span />
|
|
25
34
|
{#if label}
|
|
26
35
|
{label}
|
|
27
36
|
{:else}
|
|
28
37
|
<slot />
|
|
29
38
|
{/if}
|
|
30
|
-
</
|
|
39
|
+
</button>
|
|
31
40
|
|
|
32
|
-
<style>
|
|
41
|
+
<style>button {
|
|
33
42
|
display: inline-flex;
|
|
34
43
|
align-items: center;
|
|
35
44
|
gap: 8px;
|
|
45
|
+
border-width: 0;
|
|
46
|
+
border-style: solid;
|
|
47
|
+
border-color: transparent;
|
|
48
|
+
padding: 0;
|
|
49
|
+
color: inherit;
|
|
50
|
+
background-color: transparent;
|
|
51
|
+
box-shadow: none;
|
|
52
|
+
font: inherit;
|
|
53
|
+
text-align: left;
|
|
36
54
|
cursor: pointer;
|
|
37
55
|
-webkit-user-select: none;
|
|
38
56
|
user-select: none;
|
|
39
57
|
}
|
|
40
|
-
|
|
58
|
+
button:disabled {
|
|
41
59
|
cursor: default;
|
|
42
60
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
position: absolute;
|
|
46
|
-
left: -99999px;
|
|
61
|
+
button:disabled span {
|
|
62
|
+
opacity: 0.4;
|
|
47
63
|
}
|
|
48
|
-
|
|
49
|
-
|
|
64
|
+
button:focus-visible {
|
|
65
|
+
outline: 0;
|
|
50
66
|
}
|
|
51
|
-
|
|
52
|
-
|
|
67
|
+
button:focus-visible span::before {
|
|
68
|
+
outline-offset: 1px;
|
|
69
|
+
outline-width: 2px;
|
|
70
|
+
outline-style: solid;
|
|
71
|
+
outline-color: var(--primary-accent-color-lighter);
|
|
72
|
+
}
|
|
73
|
+
button[aria-checked=true] span {
|
|
53
74
|
background-color: var(--primary-accent-color);
|
|
54
75
|
border-color: transparent;
|
|
55
76
|
}
|
|
56
|
-
|
|
77
|
+
button[aria-checked=true] span::before {
|
|
57
78
|
transform: translateX(22px);
|
|
58
79
|
background-color: var(--primary-accent-color-foreground);
|
|
59
80
|
}
|
|
60
81
|
|
|
61
|
-
input:disabled + span {
|
|
62
|
-
opacity: 0.4;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
82
|
span {
|
|
66
83
|
position: relative;
|
|
67
84
|
width: 42px;
|
|
@@ -69,7 +86,7 @@ span {
|
|
|
69
86
|
padding: 2px;
|
|
70
87
|
display: inline-block;
|
|
71
88
|
border-radius: 16px;
|
|
72
|
-
background-color: var(--
|
|
89
|
+
background-color: var(--control-border-color);
|
|
73
90
|
transition: all 200ms;
|
|
74
91
|
}
|
|
75
92
|
span:hover {
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} SwitchEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} SwitchSlots */
|
|
4
4
|
/**
|
|
5
|
+
* A variant of `<Checkbox>`, looking like a switch that can be often seen on mobile apps.
|
|
5
6
|
* @see https://w3c.github.io/aria/#switch
|
|
6
7
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/switch/
|
|
7
8
|
*/
|
|
8
9
|
export default class Switch extends SvelteComponentTyped<{
|
|
9
10
|
label?: string;
|
|
10
|
-
class?: string;
|
|
11
11
|
disabled?: boolean;
|
|
12
|
+
class?: string;
|
|
12
13
|
checked?: boolean;
|
|
13
14
|
}, {
|
|
14
15
|
[evt: string]: CustomEvent<any>;
|
|
@@ -23,8 +24,8 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
23
24
|
declare const __propDef: {
|
|
24
25
|
props: {
|
|
25
26
|
label?: string;
|
|
26
|
-
class?: string;
|
|
27
27
|
disabled?: boolean;
|
|
28
|
+
class?: string;
|
|
28
29
|
checked?: boolean;
|
|
29
30
|
};
|
|
30
31
|
events: {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
The equivalent of the HTML `<tbody>` element.
|
|
4
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody
|
|
5
|
+
@see https://w3c.github.io/aria/#rowgroup
|
|
6
|
+
-->
|
|
7
|
+
<script>
|
|
8
|
+
/**
|
|
9
|
+
* CSS class name on the button.
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
let className = '';
|
|
13
|
+
|
|
14
|
+
export { className as class };
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div role="rowgroup" class="sui table-body {className}" {...$$restProps}>
|
|
18
|
+
<slot />
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<style>.table-body {
|
|
22
|
+
display: table-row-group;
|
|
23
|
+
}</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TableBodyProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TableBodyEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TableBodySlots */
|
|
4
|
+
/**
|
|
5
|
+
* The equivalent of the HTML `<tbody>` element.
|
|
6
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody
|
|
7
|
+
* @see https://w3c.github.io/aria/#rowgroup
|
|
8
|
+
*/
|
|
9
|
+
export default class TableBody extends SvelteComponentTyped<{
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
class?: string;
|
|
12
|
+
}, {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
}, {
|
|
15
|
+
default: {};
|
|
16
|
+
}> {
|
|
17
|
+
}
|
|
18
|
+
export type TableBodyProps = typeof __propDef.props;
|
|
19
|
+
export type TableBodyEvents = typeof __propDef.events;
|
|
20
|
+
export type TableBodySlots = typeof __propDef.slots;
|
|
21
|
+
import { SvelteComponentTyped } from "svelte";
|
|
22
|
+
declare const __propDef: {
|
|
23
|
+
props: {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
class?: string;
|
|
26
|
+
};
|
|
27
|
+
events: {
|
|
28
|
+
[evt: string]: CustomEvent<any>;
|
|
29
|
+
};
|
|
30
|
+
slots: {
|
|
31
|
+
default: {};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
The equivalent of the HTML `<td>` element.
|
|
4
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td
|
|
5
|
+
@see https://w3c.github.io/aria/#gridcell
|
|
6
|
+
-->
|
|
7
|
+
<script>
|
|
8
|
+
/**
|
|
9
|
+
* CSS class name on the button.
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
let className = '';
|
|
13
|
+
|
|
14
|
+
export { className as class };
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div role="gridcell" class="sui table-cell {className}" {...$$restProps}>
|
|
18
|
+
<slot />
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<style>.table-cell {
|
|
22
|
+
display: table-cell;
|
|
23
|
+
}</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TableCellProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TableCellEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TableCellSlots */
|
|
4
|
+
/**
|
|
5
|
+
* The equivalent of the HTML `<td>` element.
|
|
6
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td
|
|
7
|
+
* @see https://w3c.github.io/aria/#gridcell
|
|
8
|
+
*/
|
|
9
|
+
export default class TableCell extends SvelteComponentTyped<{
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
class?: string;
|
|
12
|
+
}, {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
}, {
|
|
15
|
+
default: {};
|
|
16
|
+
}> {
|
|
17
|
+
}
|
|
18
|
+
export type TableCellProps = typeof __propDef.props;
|
|
19
|
+
export type TableCellEvents = typeof __propDef.events;
|
|
20
|
+
export type TableCellSlots = typeof __propDef.slots;
|
|
21
|
+
import { SvelteComponentTyped } from "svelte";
|
|
22
|
+
declare const __propDef: {
|
|
23
|
+
props: {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
class?: string;
|
|
26
|
+
};
|
|
27
|
+
events: {
|
|
28
|
+
[evt: string]: CustomEvent<any>;
|
|
29
|
+
};
|
|
30
|
+
slots: {
|
|
31
|
+
default: {};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
The equivalent of the HTML `<th scope="col">` element.
|
|
4
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th
|
|
5
|
+
@see https://w3c.github.io/aria/#columnheader
|
|
6
|
+
-->
|
|
7
|
+
<script>
|
|
8
|
+
/**
|
|
9
|
+
* CSS class name on the button.
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
let className = '';
|
|
13
|
+
|
|
14
|
+
export { className as class };
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div role="columnheader" class="sui table-col-header {className}" {...$$restProps}>
|
|
18
|
+
<slot />
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<style>.table-col-header {
|
|
22
|
+
display: table-cell;
|
|
23
|
+
}</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TableColHeaderProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TableColHeaderEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TableColHeaderSlots */
|
|
4
|
+
/**
|
|
5
|
+
* The equivalent of the HTML `<th scope="col">` element.
|
|
6
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th
|
|
7
|
+
* @see https://w3c.github.io/aria/#columnheader
|
|
8
|
+
*/
|
|
9
|
+
export default class TableColHeader extends SvelteComponentTyped<{
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
class?: string;
|
|
12
|
+
}, {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
}, {
|
|
15
|
+
default: {};
|
|
16
|
+
}> {
|
|
17
|
+
}
|
|
18
|
+
export type TableColHeaderProps = typeof __propDef.props;
|
|
19
|
+
export type TableColHeaderEvents = typeof __propDef.events;
|
|
20
|
+
export type TableColHeaderSlots = typeof __propDef.slots;
|
|
21
|
+
import { SvelteComponentTyped } from "svelte";
|
|
22
|
+
declare const __propDef: {
|
|
23
|
+
props: {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
class?: string;
|
|
26
|
+
};
|
|
27
|
+
events: {
|
|
28
|
+
[evt: string]: CustomEvent<any>;
|
|
29
|
+
};
|
|
30
|
+
slots: {
|
|
31
|
+
default: {};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
The equivalent of the HTML `<tfoot>` element.
|
|
4
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tfoot
|
|
5
|
+
@see https://w3c.github.io/aria/#rowgroup
|
|
6
|
+
-->
|
|
7
|
+
<script>
|
|
8
|
+
/**
|
|
9
|
+
* CSS class name on the button.
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
let className = '';
|
|
13
|
+
|
|
14
|
+
export { className as class };
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div role="rowgroup" class="sui table-foot {className}" {...$$restProps}>
|
|
18
|
+
<slot />
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<style>.table-foot {
|
|
22
|
+
display: table-footer-group;
|
|
23
|
+
}</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TableFootProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TableFootEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TableFootSlots */
|
|
4
|
+
/**
|
|
5
|
+
* The equivalent of the HTML `<tfoot>` element.
|
|
6
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tfoot
|
|
7
|
+
* @see https://w3c.github.io/aria/#rowgroup
|
|
8
|
+
*/
|
|
9
|
+
export default class TableFoot extends SvelteComponentTyped<{
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
class?: string;
|
|
12
|
+
}, {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
}, {
|
|
15
|
+
default: {};
|
|
16
|
+
}> {
|
|
17
|
+
}
|
|
18
|
+
export type TableFootProps = typeof __propDef.props;
|
|
19
|
+
export type TableFootEvents = typeof __propDef.events;
|
|
20
|
+
export type TableFootSlots = typeof __propDef.slots;
|
|
21
|
+
import { SvelteComponentTyped } from "svelte";
|
|
22
|
+
declare const __propDef: {
|
|
23
|
+
props: {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
class?: string;
|
|
26
|
+
};
|
|
27
|
+
events: {
|
|
28
|
+
[evt: string]: CustomEvent<any>;
|
|
29
|
+
};
|
|
30
|
+
slots: {
|
|
31
|
+
default: {};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
The equivalent of the HTML `<thead>` element.
|
|
4
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/thead
|
|
5
|
+
@see https://w3c.github.io/aria/#rowgroup
|
|
6
|
+
-->
|
|
7
|
+
<script>
|
|
8
|
+
/**
|
|
9
|
+
* CSS class name on the button.
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
let className = '';
|
|
13
|
+
|
|
14
|
+
export { className as class };
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div role="rowgroup" class="sui table-head {className}" {...$$restProps}>
|
|
18
|
+
<slot />
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<style>.table-head {
|
|
22
|
+
display: table-header-group;
|
|
23
|
+
}</style>
|