@sveltia/ui 0.2.3 → 0.2.5
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/composite/calendar.svelte +4 -1
- package/package/components/composite/calendar.svelte.d.ts +1 -1
- package/package/components/composite/checkbox-group.svelte +4 -4
- package/package/components/composite/combobox.svelte +11 -8
- package/package/components/composite/combobox.svelte.d.ts +5 -5
- package/package/components/composite/disclosure.svelte +3 -3
- package/package/components/composite/disclosure.svelte.d.ts +1 -1
- package/package/components/composite/grid.svelte +2 -2
- package/package/components/composite/grid.svelte.d.ts +1 -1
- package/package/components/composite/listbox.svelte +4 -4
- package/package/components/composite/listbox.svelte.d.ts +2 -2
- package/package/components/composite/menu-item-group.svelte +1 -1
- package/package/components/composite/menu.svelte +3 -3
- package/package/components/composite/menu.svelte.d.ts +2 -2
- package/package/components/composite/{radio-button-group.svelte → radio-group.svelte} +11 -10
- package/package/components/composite/radio-group.svelte.d.ts +40 -0
- package/package/components/composite/select-button-group.svelte +4 -4
- package/package/components/composite/select-button-group.svelte.d.ts +3 -3
- package/package/components/composite/select.svelte +2 -2
- package/package/components/composite/select.svelte.d.ts +1 -1
- package/package/components/composite/tab-list.svelte +4 -4
- package/package/components/composite/tab-list.svelte.d.ts +2 -2
- package/package/components/core/button.svelte +12 -13
- package/package/components/core/button.svelte.d.ts +10 -10
- package/package/components/core/checkbox.svelte +40 -21
- package/package/components/core/checkbox.svelte.d.ts +4 -2
- package/package/components/core/dialog.svelte +14 -4
- package/package/components/core/dialog.svelte.d.ts +3 -3
- package/package/components/core/drawer.svelte +13 -3
- package/package/components/core/drawer.svelte.d.ts +1 -1
- package/package/components/core/grid-cell.svelte +1 -2
- package/package/components/core/group.svelte +1 -1
- package/package/components/core/icon.svelte +1 -1
- package/package/components/core/menu-button.svelte +3 -3
- package/package/components/core/menu-button.svelte.d.ts +3 -3
- package/package/components/core/menu-item-checkbox.svelte +1 -1
- package/package/components/core/menu-item-radio.svelte +1 -1
- package/package/components/core/number-input.svelte +19 -9
- package/package/components/core/number-input.svelte.d.ts +1 -1
- package/package/components/core/option.svelte +1 -1
- package/package/components/core/password-input.svelte +3 -3
- package/package/components/core/password-input.svelte.d.ts +1 -1
- package/package/components/core/{radio-button.svelte → radio.svelte} +45 -20
- package/package/components/core/radio.svelte.d.ts +41 -0
- package/package/components/core/row-group.svelte +1 -2
- package/package/components/core/row.svelte +1 -2
- package/package/components/core/search-bar.svelte +2 -2
- package/package/components/core/select-button.svelte +3 -3
- package/package/components/core/select-button.svelte.d.ts +2 -2
- package/package/components/core/separator.svelte +2 -1
- package/package/components/core/separator.svelte.d.ts +2 -2
- package/package/components/core/slider.svelte +54 -18
- package/package/components/core/spacer.svelte +2 -2
- package/package/components/core/switch.svelte +3 -3
- package/package/components/core/switch.svelte.d.ts +1 -1
- package/package/components/core/tab-panel.svelte +2 -3
- package/package/components/core/tab-panel.svelte.d.ts +1 -1
- package/package/components/core/tab.svelte +2 -2
- package/package/components/core/tab.svelte.d.ts +1 -1
- package/package/components/core/text-area.svelte +7 -7
- package/package/components/core/text-area.svelte.d.ts +2 -2
- package/package/components/core/text-input.svelte +7 -7
- package/package/components/core/text-input.svelte.d.ts +5 -5
- package/package/components/core/toolbar.svelte +2 -3
- package/package/components/core/toolbar.svelte.d.ts +1 -1
- package/package/components/editor/markdown.svelte +1 -1
- package/package/components/editor/markdown.svelte.d.ts +1 -1
- package/package/components/helpers/group.d.ts +1 -37
- package/package/components/helpers/group.js +26 -19
- package/package/components/helpers/popup.d.ts +1 -2
- package/package/components/helpers/popup.js +18 -8
- package/package/components/helpers/util.js +6 -0
- package/package/components/util/app-shell.svelte +15 -6
- package/package/components/util/misc.js +0 -2
- package/package/components/util/popup.svelte +14 -4
- package/package/components/util/popup.svelte.d.ts +10 -10
- package/package/components/util/portal.svelte +1 -1
- package/package/index.d.ts +6 -3
- package/package/index.js +47 -2
- package/package/styles/variables.scss +8 -5
- package/package/typedef.d.ts +1 -0
- package/package/typedef.js +4 -0
- package/package.json +30 -32
- package/package/components/composite/radio-button-group.svelte.d.ts +0 -36
- package/package/components/core/radio-button.svelte.d.ts +0 -37
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import Separator from '../core/separator.svelte';
|
|
6
6
|
import Spacer from '../core/spacer.svelte';
|
|
7
7
|
|
|
8
|
-
/** @type {
|
|
8
|
+
/** @type {string?} */
|
|
9
9
|
export let value = undefined;
|
|
10
10
|
|
|
11
11
|
const dayList = [];
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
$: firstDayOfMonth = new Date(date.getUTCFullYear(), date.getUTCMonth(), 1);
|
|
17
17
|
$: firstDay = new Date(firstDayOfMonth);
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
19
22
|
const getWeeks = () => {
|
|
20
23
|
const cursor = new Date(firstDay);
|
|
21
24
|
|
|
@@ -5,16 +5,15 @@
|
|
|
5
5
|
<script>
|
|
6
6
|
/**
|
|
7
7
|
* CSS class name on the button.
|
|
8
|
-
* @type {
|
|
8
|
+
* @type {string}
|
|
9
9
|
*/
|
|
10
|
-
// eslint-disable-next-line padding-line-between-statements
|
|
11
10
|
let className = '';
|
|
12
11
|
|
|
13
12
|
export { className as class };
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* The `aria-label` attribute on the button element.
|
|
17
|
-
* @type {
|
|
16
|
+
* @type {string}
|
|
18
17
|
*/
|
|
19
18
|
export let ariaLabel = '';
|
|
20
19
|
|
|
@@ -33,11 +32,12 @@
|
|
|
33
32
|
|
|
34
33
|
<style>.checkbox-group {
|
|
35
34
|
display: inline-flex;
|
|
36
|
-
gap: 16px;
|
|
37
35
|
}
|
|
38
36
|
.checkbox-group.horizontal {
|
|
37
|
+
gap: 16px;
|
|
39
38
|
align-items: center;
|
|
40
39
|
}
|
|
41
40
|
.checkbox-group.vertical {
|
|
41
|
+
gap: 8px;
|
|
42
42
|
flex-direction: column;
|
|
43
43
|
}</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
3
|
@see https://w3c.github.io/aria/#combobox
|
|
4
|
-
@see https://
|
|
4
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/combobox/
|
|
5
5
|
-->
|
|
6
6
|
<script>
|
|
7
7
|
import { createEventDispatcher } from 'svelte';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* CSS class name on the button.
|
|
19
|
-
* @type {
|
|
19
|
+
* @type {string}
|
|
20
20
|
*/
|
|
21
21
|
let className = '';
|
|
22
22
|
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Selected option’s value.
|
|
42
|
-
* @type {(
|
|
42
|
+
* @type {(string | number | undefined)}
|
|
43
43
|
*/
|
|
44
44
|
export let value = undefined;
|
|
45
45
|
|
|
46
46
|
const dispatch = createEventDispatcher();
|
|
47
47
|
const id = getRandomId('combobox');
|
|
48
48
|
let comboboxElement;
|
|
49
|
-
/** @type {
|
|
49
|
+
/** @type {TextInput?} */
|
|
50
50
|
let inputComponent;
|
|
51
|
-
/** @type {
|
|
51
|
+
/** @type {Popup?} */
|
|
52
52
|
let popupComponent;
|
|
53
53
|
let isPopupOpen = writable(false);
|
|
54
54
|
</script>
|
|
@@ -117,8 +117,11 @@
|
|
|
117
117
|
bind:this={popupComponent}
|
|
118
118
|
>
|
|
119
119
|
<Listbox
|
|
120
|
-
on:click={(
|
|
121
|
-
if (target.matches('[role="option"]')) {
|
|
120
|
+
on:click={(event) => {
|
|
121
|
+
if (/** @type {HTMLElement} */ (event.target).matches('[role="option"]')) {
|
|
122
|
+
// eslint-disable-next-line prefer-destructuring
|
|
123
|
+
const target = /** @type {HTMLButtonElement?} */ (event.target);
|
|
124
|
+
|
|
122
125
|
// @todo support more types
|
|
123
126
|
value = target.dataset.type === 'number' ? Number(target.value) : target.value;
|
|
124
127
|
label = target.querySelector('.label')?.textContent || target.value;
|
|
@@ -159,7 +162,7 @@
|
|
|
159
162
|
display: flex;
|
|
160
163
|
align-items: center;
|
|
161
164
|
border-width: 1px;
|
|
162
|
-
border-color: var(--control-border-color);
|
|
165
|
+
border-color: var(--secondary-control-border-color);
|
|
163
166
|
border-radius: 4px;
|
|
164
167
|
padding: 0 32px 0 8px;
|
|
165
168
|
width: 100%;
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} ComboboxSlots */
|
|
4
4
|
/**
|
|
5
5
|
* @see https://w3c.github.io/aria/#combobox
|
|
6
|
-
* @see https://
|
|
6
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/combobox/
|
|
7
7
|
*/
|
|
8
8
|
export default class Combobox extends SvelteComponentTyped<{
|
|
9
9
|
[x: string]: any;
|
|
10
10
|
label?: string;
|
|
11
|
-
position?:
|
|
11
|
+
position?: PopupPosition;
|
|
12
12
|
class?: string;
|
|
13
13
|
disabled?: boolean;
|
|
14
|
-
value?: string;
|
|
14
|
+
value?: string | number;
|
|
15
15
|
readOnly?: boolean;
|
|
16
16
|
}, {
|
|
17
17
|
change: CustomEvent<any>;
|
|
@@ -29,10 +29,10 @@ declare const __propDef: {
|
|
|
29
29
|
props: {
|
|
30
30
|
[x: string]: any;
|
|
31
31
|
label?: string;
|
|
32
|
-
position?:
|
|
32
|
+
position?: PopupPosition;
|
|
33
33
|
class?: string;
|
|
34
34
|
disabled?: boolean;
|
|
35
|
-
value?: (string | undefined);
|
|
35
|
+
value?: (string | number | undefined);
|
|
36
36
|
readOnly?: boolean;
|
|
37
37
|
};
|
|
38
38
|
events: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
@see https://
|
|
3
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
|
|
4
4
|
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
|
|
5
5
|
-->
|
|
6
6
|
<script>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* CSS class name on the button.
|
|
13
|
-
* @type {
|
|
13
|
+
* @type {string}
|
|
14
14
|
*/
|
|
15
15
|
let className = '';
|
|
16
16
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
<Icon name="expand_more" />
|
|
37
37
|
{label}
|
|
38
38
|
</Button>
|
|
39
|
-
<div class="content" id="{id}-content" hidden={!expanded ?
|
|
39
|
+
<div class="content" id="{id}-content" hidden={!expanded ? true : undefined}>
|
|
40
40
|
<slot />
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} DisclosureEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} DisclosureSlots */
|
|
4
4
|
/**
|
|
5
|
-
* @see https://
|
|
5
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
|
|
6
6
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
|
|
7
7
|
*/
|
|
8
8
|
export default class Disclosure extends SvelteComponentTyped<{
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* CSS class name on the button.
|
|
6
|
-
* @type {
|
|
6
|
+
* @type {string}
|
|
7
7
|
*/
|
|
8
8
|
let className = '';
|
|
9
9
|
|
|
10
10
|
export { className as class };
|
|
11
11
|
|
|
12
|
-
/** @type {
|
|
12
|
+
/** @type {HTMLElement?} */
|
|
13
13
|
export let element = undefined;
|
|
14
14
|
</script>
|
|
15
15
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
3
|
@see https://w3c.github.io/aria/#listbox
|
|
4
|
-
@see https://
|
|
4
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/listbox/
|
|
5
5
|
-->
|
|
6
6
|
<svelte:options accessors={true} />
|
|
7
7
|
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* CSS class name on the button.
|
|
13
|
-
* @type {
|
|
13
|
+
* @type {string}
|
|
14
14
|
*/
|
|
15
15
|
let className = '';
|
|
16
16
|
|
|
17
17
|
export { className as class };
|
|
18
18
|
|
|
19
|
-
/** @type {
|
|
19
|
+
/** @type {HTMLElement?} */
|
|
20
20
|
export let element = undefined;
|
|
21
21
|
|
|
22
22
|
export let multiple = false;
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
color: inherit;
|
|
43
43
|
margin: 0;
|
|
44
44
|
border-width: 1px;
|
|
45
|
-
border-color: var(--control-border-color);
|
|
45
|
+
border-color: var(--secondary-control-border-color);
|
|
46
46
|
border-radius: 4px;
|
|
47
47
|
padding: 4px;
|
|
48
48
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} ListboxSlots */
|
|
4
4
|
/**
|
|
5
5
|
* @see https://w3c.github.io/aria/#listbox
|
|
6
|
-
* @see https://
|
|
6
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/listbox/
|
|
7
7
|
*/
|
|
8
8
|
export default class Listbox extends SvelteComponentTyped<{
|
|
9
9
|
[x: string]: any;
|
|
@@ -36,7 +36,7 @@ declare const __propDef: {
|
|
|
36
36
|
props: {
|
|
37
37
|
[x: string]: any;
|
|
38
38
|
class?: string;
|
|
39
|
-
element?:
|
|
39
|
+
element?: HTMLElement | null;
|
|
40
40
|
multiple?: boolean;
|
|
41
41
|
};
|
|
42
42
|
events: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
3
|
@see https://w3c.github.io/aria/#menu
|
|
4
|
-
@see https://
|
|
4
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/menubar/
|
|
5
5
|
-->
|
|
6
6
|
<svelte:options accessors={true} />
|
|
7
7
|
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* CSS class name on the button.
|
|
13
|
-
* @type {
|
|
13
|
+
* @type {string}
|
|
14
14
|
*/
|
|
15
15
|
let className = '';
|
|
16
16
|
|
|
17
17
|
export { className as class };
|
|
18
18
|
|
|
19
|
-
/** @type {
|
|
19
|
+
/** @type {HTMLElement?} */
|
|
20
20
|
export let element = undefined;
|
|
21
21
|
</script>
|
|
22
22
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} MenuSlots */
|
|
4
4
|
/**
|
|
5
5
|
* @see https://w3c.github.io/aria/#menu
|
|
6
|
-
* @see https://
|
|
6
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/menubar/
|
|
7
7
|
*/
|
|
8
8
|
export default class Menu extends SvelteComponentTyped<{
|
|
9
9
|
[x: string]: any;
|
|
@@ -29,7 +29,7 @@ declare const __propDef: {
|
|
|
29
29
|
props: {
|
|
30
30
|
[x: string]: any;
|
|
31
31
|
class?: string;
|
|
32
|
-
element?:
|
|
32
|
+
element?: HTMLElement | null;
|
|
33
33
|
};
|
|
34
34
|
events: {
|
|
35
35
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
The container of `<
|
|
3
|
+
The container of `<Radio>`s.
|
|
4
4
|
@see https://w3c.github.io/aria/#radiogroup
|
|
5
|
-
@see https://
|
|
5
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
8
|
import { activateGroup } from '../helpers/group';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* CSS class name on the button.
|
|
12
|
-
* @type {
|
|
12
|
+
* @type {string}
|
|
13
13
|
*/
|
|
14
14
|
let className = '';
|
|
15
15
|
|
|
@@ -18,28 +18,29 @@
|
|
|
18
18
|
/** @type {('horizontal'|'vertical')} */
|
|
19
19
|
export let orientation = 'horizontal';
|
|
20
20
|
|
|
21
|
-
/** @type {
|
|
21
|
+
/** @type {HTMLElement?} */
|
|
22
22
|
export let element = undefined;
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
25
|
<div
|
|
26
|
-
class="sui radio-
|
|
26
|
+
class="sui radio-group {className} {orientation}"
|
|
27
27
|
role="radiogroup"
|
|
28
28
|
tabindex="0"
|
|
29
29
|
bind:this={element}
|
|
30
|
+
on:select
|
|
30
31
|
use:activateGroup
|
|
31
32
|
>
|
|
32
33
|
<slot />
|
|
33
34
|
</div>
|
|
34
35
|
|
|
35
|
-
<style>.radio-
|
|
36
|
+
<style>.radio-group {
|
|
36
37
|
display: inline-flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
gap: 16px;
|
|
39
38
|
}
|
|
40
|
-
.radio-
|
|
39
|
+
.radio-group.horizontal {
|
|
40
|
+
gap: 16px;
|
|
41
41
|
align-items: center;
|
|
42
42
|
}
|
|
43
|
-
.radio-
|
|
43
|
+
.radio-group.vertical {
|
|
44
|
+
gap: 8px;
|
|
44
45
|
flex-direction: column;
|
|
45
46
|
}</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} RadioGroupProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} RadioGroupEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} RadioGroupSlots */
|
|
4
|
+
/**
|
|
5
|
+
* The container of `<Radio>`s.
|
|
6
|
+
* @see https://w3c.github.io/aria/#radiogroup
|
|
7
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
8
|
+
*/
|
|
9
|
+
export default class RadioGroup extends SvelteComponentTyped<{
|
|
10
|
+
class?: string;
|
|
11
|
+
element?: HTMLElement;
|
|
12
|
+
orientation?: "horizontal" | "vertical";
|
|
13
|
+
}, {
|
|
14
|
+
select: Event;
|
|
15
|
+
} & {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {
|
|
18
|
+
default: {};
|
|
19
|
+
}> {
|
|
20
|
+
}
|
|
21
|
+
export type RadioGroupProps = typeof __propDef.props;
|
|
22
|
+
export type RadioGroupEvents = typeof __propDef.events;
|
|
23
|
+
export type RadioGroupSlots = typeof __propDef.slots;
|
|
24
|
+
import { SvelteComponentTyped } from "svelte";
|
|
25
|
+
declare const __propDef: {
|
|
26
|
+
props: {
|
|
27
|
+
class?: string;
|
|
28
|
+
element?: HTMLElement | null;
|
|
29
|
+
orientation?: ('horizontal' | 'vertical');
|
|
30
|
+
};
|
|
31
|
+
events: {
|
|
32
|
+
select: Event;
|
|
33
|
+
} & {
|
|
34
|
+
[evt: string]: CustomEvent<any>;
|
|
35
|
+
};
|
|
36
|
+
slots: {
|
|
37
|
+
default: {};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
A variant of `<
|
|
3
|
+
A variant of `<RadioGroup>`, looking like normal buttons.
|
|
4
4
|
@see https://w3c.github.io/aria/#radiogroup
|
|
5
|
-
@see https://
|
|
5
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
8
|
import { createEventDispatcher } from 'svelte';
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* CSS class name on the button.
|
|
13
|
-
* @type {
|
|
13
|
+
* @type {string}
|
|
14
14
|
*/
|
|
15
15
|
let className = '';
|
|
16
16
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
const dispatch = createEventDispatcher();
|
|
24
24
|
|
|
25
|
-
/** @type {
|
|
25
|
+
/** @type {HTMLElement?} */
|
|
26
26
|
export let element = undefined;
|
|
27
27
|
|
|
28
28
|
$: {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} SelectButtonGroupEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} SelectButtonGroupSlots */
|
|
4
4
|
/**
|
|
5
|
-
* A variant of `<
|
|
5
|
+
* A variant of `<RadioGroup>`, looking like normal buttons.
|
|
6
6
|
* @see https://w3c.github.io/aria/#radiogroup
|
|
7
|
-
* @see https://
|
|
7
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
8
8
|
*/
|
|
9
9
|
export default class SelectButtonGroup extends SvelteComponentTyped<{
|
|
10
10
|
class?: string;
|
|
@@ -27,7 +27,7 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
27
27
|
declare const __propDef: {
|
|
28
28
|
props: {
|
|
29
29
|
class?: string;
|
|
30
|
-
element?:
|
|
30
|
+
element?: HTMLElement | null;
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
value?: string;
|
|
33
33
|
ariaLabel?: string;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* CSS class name on the button.
|
|
10
|
-
* @type {
|
|
10
|
+
* @type {string}
|
|
11
11
|
*/
|
|
12
12
|
let className = '';
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Selected option’s value.
|
|
20
|
-
* @type {
|
|
20
|
+
* @type {string?}
|
|
21
21
|
*/
|
|
22
22
|
export let value = undefined;
|
|
23
23
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
3
|
@see https://w3c.github.io/aria/#tablist
|
|
4
|
-
@see https://
|
|
4
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/tabs/
|
|
5
5
|
-->
|
|
6
6
|
<svelte:options accessors={true} />
|
|
7
7
|
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* CSS class name on the button.
|
|
13
|
-
* @type {
|
|
13
|
+
* @type {string}
|
|
14
14
|
*/
|
|
15
15
|
let className = '';
|
|
16
16
|
|
|
17
17
|
export { className as class };
|
|
18
18
|
|
|
19
|
-
/** @type {
|
|
19
|
+
/** @type {HTMLElement?} */
|
|
20
20
|
export let element = undefined;
|
|
21
21
|
|
|
22
22
|
/** @type {('horizontal'|'vertical')} */
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
<style>.tab-list {
|
|
42
42
|
display: flex;
|
|
43
43
|
align-items: center;
|
|
44
|
-
border-color: var(--control-border-color);
|
|
44
|
+
border-color: var(--secondary-control-border-color);
|
|
45
45
|
}
|
|
46
46
|
.tab-list[aria-orientation=horizontal] {
|
|
47
47
|
gap: 16px;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} TabListSlots */
|
|
4
4
|
/**
|
|
5
5
|
* @see https://w3c.github.io/aria/#tablist
|
|
6
|
-
* @see https://
|
|
6
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/tabs/
|
|
7
7
|
*/
|
|
8
8
|
export default class TabList extends SvelteComponentTyped<{
|
|
9
9
|
[x: string]: any;
|
|
@@ -39,7 +39,7 @@ declare const __propDef: {
|
|
|
39
39
|
props: {
|
|
40
40
|
[x: string]: any;
|
|
41
41
|
class?: string;
|
|
42
|
-
element?:
|
|
42
|
+
element?: HTMLElement | null;
|
|
43
43
|
name?: string;
|
|
44
44
|
orientation?: ('horizontal' | 'vertical');
|
|
45
45
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
3
|
@see https://w3c.github.io/aria/#button
|
|
4
|
-
@see https://
|
|
4
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/button/
|
|
5
5
|
-->
|
|
6
6
|
<svelte:options accessors={true} />
|
|
7
7
|
|
|
@@ -10,16 +10,15 @@
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* CSS class name on the button.
|
|
13
|
-
* @type {
|
|
13
|
+
* @type {string}
|
|
14
14
|
*/
|
|
15
|
-
// eslint-disable-next-line padding-line-between-statements
|
|
16
15
|
let className = '';
|
|
17
16
|
|
|
18
17
|
export { className as class };
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* Reference to the button element.
|
|
22
|
-
* @type {
|
|
21
|
+
* @type {HTMLButtonElement?}
|
|
23
22
|
*/
|
|
24
23
|
export let element = undefined;
|
|
25
24
|
|
|
@@ -31,7 +30,7 @@
|
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
32
|
* The `role` attribute on the button element.
|
|
34
|
-
* @type {
|
|
33
|
+
* @type {string}
|
|
35
34
|
*/
|
|
36
35
|
export let role = 'button';
|
|
37
36
|
|
|
@@ -43,25 +42,25 @@
|
|
|
43
42
|
|
|
44
43
|
/**
|
|
45
44
|
* Whether the button is hidden.
|
|
46
|
-
* @type {
|
|
45
|
+
* @type {boolean}
|
|
47
46
|
*/
|
|
48
47
|
export let hidden = false;
|
|
49
48
|
|
|
50
49
|
/**
|
|
51
50
|
* Whether the button is disabled.
|
|
52
|
-
* @type {
|
|
51
|
+
* @type {boolean}
|
|
53
52
|
*/
|
|
54
53
|
export let disabled = false;
|
|
55
54
|
|
|
56
55
|
/**
|
|
57
56
|
* The `aria-pressed` attribute on the button element.
|
|
58
|
-
* @type {(
|
|
57
|
+
* @type {(boolean | 'false' | 'mixed' | 'true' | undefined)}
|
|
59
58
|
*/
|
|
60
59
|
export let pressed = undefined;
|
|
61
60
|
|
|
62
61
|
/**
|
|
63
62
|
* Text label displayed on the button.
|
|
64
|
-
* @type {
|
|
63
|
+
* @type {string}
|
|
65
64
|
*/
|
|
66
65
|
export let label = '';
|
|
67
66
|
|
|
@@ -78,8 +77,8 @@
|
|
|
78
77
|
<button
|
|
79
78
|
{type}
|
|
80
79
|
{role}
|
|
81
|
-
hidden={hidden ?
|
|
82
|
-
disabled={disabled ?
|
|
80
|
+
hidden={hidden ? true : undefined}
|
|
81
|
+
disabled={disabled ? true : undefined}
|
|
83
82
|
class="sui button {size} {className}"
|
|
84
83
|
aria-hidden={hidden ? true : undefined}
|
|
85
84
|
aria-disabled={disabled ? true : undefined}
|
|
@@ -152,7 +151,7 @@ button:global(.primary) :global(.label:only-child), button:global(.secondary) :g
|
|
|
152
151
|
padding: 0 4px;
|
|
153
152
|
}
|
|
154
153
|
button:global(.primary) {
|
|
155
|
-
border-color: var(--control-border-color);
|
|
154
|
+
border-color: var(--secondary-control-border-color);
|
|
156
155
|
color: var(--primary-accent-color-foreground);
|
|
157
156
|
background-color: var(--primary-accent-color);
|
|
158
157
|
}
|
|
@@ -174,7 +173,7 @@ button:global(.secondary)[aria-pressed=true] {
|
|
|
174
173
|
background-color: var(--primary-accent-color);
|
|
175
174
|
}
|
|
176
175
|
button:global(.tertiary) {
|
|
177
|
-
border-color: var(--control-border-color);
|
|
176
|
+
border-color: var(--secondary-control-border-color);
|
|
178
177
|
color: var(--highlight-foreground-color);
|
|
179
178
|
background-color: var(--tertiary-background-color);
|
|
180
179
|
}
|