@sveltia/ui 0.15.16 → 0.17.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/components/alert/alert.svelte +22 -7
- package/package/components/alert/alert.svelte.d.ts +47 -31
- package/package/components/button/button-group.svelte +16 -6
- package/package/components/button/button-group.svelte.d.ts +38 -28
- package/package/components/button/button.svelte +41 -136
- package/package/components/button/button.svelte.d.ts +20 -162
- package/package/components/button/select-button-group.svelte +31 -37
- package/package/components/button/select-button-group.svelte.d.ts +91 -39
- package/package/components/button/select-button.svelte +19 -62
- package/package/components/button/select-button.svelte.d.ts +31 -65
- package/package/components/button/split-button.svelte +37 -47
- package/package/components/button/split-button.svelte.d.ts +54 -60
- package/package/components/calendar/calendar.svelte +80 -55
- package/package/components/calendar/calendar.svelte.d.ts +30 -26
- package/package/components/checkbox/checkbox-group.svelte +23 -20
- package/package/components/checkbox/checkbox-group.svelte.d.ts +64 -32
- package/package/components/checkbox/checkbox.svelte +57 -67
- package/package/components/checkbox/checkbox.svelte.d.ts +81 -53
- package/package/components/dialog/alert-dialog.svelte +9 -36
- package/package/components/dialog/alert-dialog.svelte.d.ts +20 -49
- package/package/components/dialog/confirmation-dialog.svelte +9 -41
- package/package/components/dialog/confirmation-dialog.svelte.d.ts +20 -51
- package/package/components/dialog/dialog.svelte +60 -105
- package/package/components/dialog/dialog.svelte.d.ts +19 -86
- package/package/components/dialog/prompt-dialog.svelte +32 -61
- package/package/components/dialog/prompt-dialog.svelte.d.ts +53 -65
- package/package/components/disclosure/disclosure.svelte +39 -34
- package/package/components/disclosure/disclosure.svelte.d.ts +88 -57
- package/package/components/divider/divider.svelte +18 -14
- package/package/components/divider/divider.svelte.d.ts +48 -26
- package/package/components/divider/spacer.svelte +13 -8
- package/package/components/divider/spacer.svelte.d.ts +37 -25
- package/package/components/drawer/drawer.svelte +63 -76
- package/package/components/drawer/drawer.svelte.d.ts +116 -70
- package/package/components/grid/grid-body.svelte +15 -10
- package/package/components/grid/grid-body.svelte.d.ts +45 -29
- package/package/components/grid/grid-cell.svelte +16 -6
- package/package/components/grid/grid-cell.svelte.d.ts +38 -28
- package/package/components/grid/grid-col-header.svelte +16 -6
- package/package/components/grid/grid-col-header.svelte.d.ts +38 -28
- package/package/components/grid/grid-foot.svelte +16 -6
- package/package/components/grid/grid-foot.svelte.d.ts +38 -28
- package/package/components/grid/grid-head.svelte +16 -6
- package/package/components/grid/grid-head.svelte.d.ts +38 -28
- package/package/components/grid/grid-row-header.svelte +16 -6
- package/package/components/grid/grid-row-header.svelte.d.ts +38 -28
- package/package/components/grid/grid-row.svelte +19 -23
- package/package/components/grid/grid-row.svelte.d.ts +63 -43
- package/package/components/grid/grid.svelte +26 -25
- package/package/components/grid/grid.svelte.d.ts +71 -37
- package/package/components/icon/icon.svelte +14 -9
- package/package/components/icon/icon.svelte.d.ts +37 -25
- package/package/components/listbox/listbox.svelte +46 -52
- package/package/components/listbox/listbox.svelte.d.ts +117 -45
- package/package/components/listbox/option-group.svelte +23 -19
- package/package/components/listbox/option-group.svelte.d.ts +64 -32
- package/package/components/listbox/option.svelte +44 -57
- package/package/components/listbox/option.svelte.d.ts +68 -74
- package/package/components/menu/menu-button.svelte +42 -63
- package/package/components/menu/menu-button.svelte.d.ts +35 -62
- package/package/components/menu/menu-item-checkbox.svelte +29 -41
- package/package/components/menu/menu-item-checkbox.svelte.d.ts +20 -49
- package/package/components/menu/menu-item-group.svelte +22 -19
- package/package/components/menu/menu-item-group.svelte.d.ts +56 -32
- package/package/components/menu/menu-item-radio.svelte +29 -41
- package/package/components/menu/menu-item-radio.svelte.d.ts +20 -49
- package/package/components/menu/menu-item.svelte +66 -75
- package/package/components/menu/menu-item.svelte.d.ts +19 -68
- package/package/components/menu/menu.svelte +25 -22
- package/package/components/menu/menu.svelte.d.ts +65 -35
- package/package/components/radio/radio-group.svelte +36 -42
- package/package/components/radio/radio-group.svelte.d.ts +100 -40
- package/package/components/radio/radio.svelte +45 -48
- package/package/components/radio/radio.svelte.d.ts +111 -47
- package/package/components/select/combobox.svelte +76 -101
- package/package/components/select/combobox.svelte.d.ts +19 -54
- package/package/components/select/select-tags.svelte +48 -59
- package/package/components/select/select-tags.svelte.d.ts +127 -45
- package/package/components/select/select.svelte +18 -37
- package/package/components/select/select.svelte.d.ts +20 -45
- package/package/components/slider/slider.svelte +71 -68
- package/package/components/slider/slider.svelte.d.ts +159 -47
- package/package/components/switch/switch.svelte +36 -46
- package/package/components/switch/switch.svelte.d.ts +98 -42
- package/package/components/table/table-body.svelte +15 -11
- package/package/components/table/table-body.svelte.d.ts +45 -29
- package/package/components/table/table-cell.svelte +16 -6
- package/package/components/table/table-cell.svelte.d.ts +38 -28
- package/package/components/table/table-col-header.svelte +16 -6
- package/package/components/table/table-col-header.svelte.d.ts +38 -28
- package/package/components/table/table-foot.svelte +16 -6
- package/package/components/table/table-foot.svelte.d.ts +38 -28
- package/package/components/table/table-head.svelte +16 -6
- package/package/components/table/table-head.svelte.d.ts +38 -28
- package/package/components/table/table-row-header.svelte +16 -6
- package/package/components/table/table-row-header.svelte.d.ts +38 -28
- package/package/components/table/table-row.svelte +16 -6
- package/package/components/table/table-row.svelte.d.ts +38 -28
- package/package/components/table/table.svelte +16 -6
- package/package/components/table/table.svelte.d.ts +38 -28
- package/package/components/tabs/tab-box.svelte +16 -9
- package/package/components/tabs/tab-box.svelte.d.ts +47 -27
- package/package/components/tabs/tab-list.svelte +36 -35
- package/package/components/tabs/tab-list.svelte.d.ts +80 -38
- package/package/components/tabs/tab-panel.svelte +16 -6
- package/package/components/tabs/tab-panel.svelte.d.ts +38 -28
- package/package/components/tabs/tab-panels.svelte +16 -6
- package/package/components/tabs/tab-panels.svelte.d.ts +38 -26
- package/package/components/tabs/tab.svelte +28 -25
- package/package/components/tabs/tab.svelte.d.ts +31 -55
- package/package/components/text-editor/lexical-root.svelte +38 -32
- package/package/components/text-editor/lexical-root.svelte.d.ts +91 -29
- package/package/components/text-editor/text-editor.svelte +63 -79
- package/package/components/text-editor/text-editor.svelte.d.ts +114 -36
- package/package/components/text-editor/toolbar/editor-toolbar.svelte +41 -24
- package/package/components/text-editor/toolbar/editor-toolbar.svelte.d.ts +49 -23
- package/package/components/text-editor/toolbar/format-text-button.svelte +15 -5
- package/package/components/text-editor/toolbar/format-text-button.svelte.d.ts +30 -22
- package/package/components/text-editor/toolbar/insert-link-button.svelte +18 -16
- package/package/components/text-editor/toolbar/insert-link-button.svelte.d.ts +20 -23
- package/package/components/text-editor/toolbar/toggle-block-menu-item.svelte +19 -7
- package/package/components/text-editor/toolbar/toggle-block-menu-item.svelte.d.ts +30 -22
- package/package/components/text-field/number-input.svelte +63 -81
- package/package/components/text-field/number-input.svelte.d.ts +62 -68
- package/package/components/text-field/password-input.svelte +38 -57
- package/package/components/text-field/password-input.svelte.d.ts +30 -58
- package/package/components/text-field/search-bar.svelte +45 -62
- package/package/components/text-field/search-bar.svelte.d.ts +42 -87
- package/package/components/text-field/text-area.svelte +38 -54
- package/package/components/text-field/text-area.svelte.d.ts +116 -50
- package/package/components/text-field/text-input.svelte +30 -86
- package/package/components/text-field/text-input.svelte.d.ts +20 -105
- package/package/components/toast/toast.svelte +36 -30
- package/package/components/toast/toast.svelte.d.ts +65 -33
- package/package/components/toolbar/toolbar.svelte +25 -25
- package/package/components/toolbar/toolbar.svelte.d.ts +72 -34
- package/package/components/util/app-shell.svelte +22 -10
- package/package/components/util/app-shell.svelte.d.ts +40 -34
- package/package/components/util/group.svelte +20 -15
- package/package/components/util/group.svelte.d.ts +55 -31
- package/package/components/util/modal.svelte +89 -105
- package/package/components/util/modal.svelte.d.ts +24 -82
- package/package/components/util/placeholder.svelte +21 -0
- package/package/components/util/placeholder.svelte.d.ts +34 -0
- package/package/components/util/popup.svelte +65 -62
- package/package/components/util/popup.svelte.d.ts +104 -82
- package/package/services/{group.js → group.svelte.js} +11 -12
- package/package/services/{popup.js → popup.svelte.js} +6 -5
- package/package/typedefs.d.ts +545 -0
- package/package/typedefs.js +202 -0
- package/package.json +16 -23
- package/package/components/util/portal.svelte +0 -36
- package/package/components/util/portal.svelte.d.ts +0 -32
- /package/package/services/{events.d.ts → events.svelte.d.ts} +0 -0
- /package/package/services/{events.js → events.svelte.js} +0 -0
- /package/package/services/{group.d.ts → group.svelte.d.ts} +0 -0
- /package/package/services/{popup.d.ts → popup.svelte.d.ts} +0 -0
|
@@ -5,62 +5,56 @@
|
|
|
5
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
|
-
import {
|
|
9
|
-
import { activateGroup } from '../../services/group';
|
|
8
|
+
import { activateGroup } from '../../services/group.svelte';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @
|
|
11
|
+
* @typedef {object} Props
|
|
12
|
+
* @property {string} [class] - The `class` attribute on the wrapper element.
|
|
13
|
+
* @property {boolean} [hidden] - Whether to hide the widget.
|
|
14
|
+
* @property {boolean} [disabled] - Whether to disable the widget. An alias of the `aria-disabled`
|
|
15
|
+
* attribute.
|
|
16
|
+
* @property {boolean} [readonly] - Whether to make the widget read-only. An alias of the
|
|
17
|
+
* `aria-readonly` attribute.
|
|
18
|
+
* @property {boolean} [required] - Whether to mark the widget required. An alias of the
|
|
19
|
+
* `aria-required` attribute.
|
|
20
|
+
* @property {boolean} [invalid] - Whether to mark the widget invalid. An alias of the
|
|
21
|
+
* `aria-invalid` attribute.
|
|
22
|
+
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
23
|
+
* @property {(event: CustomEvent) => void} [onChange] - Custom `Change` event handler.
|
|
14
24
|
*/
|
|
15
|
-
|
|
16
|
-
export { className as class };
|
|
17
|
-
/**
|
|
18
|
-
* Whether to hide the widget.
|
|
19
|
-
* @type {boolean | undefined}
|
|
20
|
-
*/
|
|
21
|
-
export let hidden = undefined;
|
|
22
|
-
/**
|
|
23
|
-
* Whether to disable the widget. An alias of the `aria-disabled` attribute.
|
|
24
|
-
* @type {boolean}
|
|
25
|
-
*/
|
|
26
|
-
export let disabled = false;
|
|
27
|
-
/**
|
|
28
|
-
* Whether to make the widget read-only. An alias of the `aria-readonly` attribute.
|
|
29
|
-
* @type {boolean}
|
|
30
|
-
*/
|
|
31
|
-
export let readonly = false;
|
|
32
|
-
/**
|
|
33
|
-
* Whether to mark the widget required. An alias of the `aria-required` attribute.
|
|
34
|
-
* @type {boolean}
|
|
35
|
-
*/
|
|
36
|
-
export let required = false;
|
|
25
|
+
|
|
37
26
|
/**
|
|
38
|
-
*
|
|
39
|
-
* @type {boolean}
|
|
27
|
+
* @type {Props & Record<string, any>}
|
|
40
28
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
29
|
+
let {
|
|
30
|
+
/* eslint-disable prefer-const */
|
|
31
|
+
class: className,
|
|
32
|
+
hidden = false,
|
|
33
|
+
disabled = false,
|
|
34
|
+
readonly = false,
|
|
35
|
+
required = false,
|
|
36
|
+
invalid = false,
|
|
37
|
+
children,
|
|
38
|
+
...restProps
|
|
39
|
+
/* eslint-enable prefer-const */
|
|
40
|
+
} = $props();
|
|
44
41
|
</script>
|
|
45
42
|
|
|
46
43
|
<div
|
|
44
|
+
{...restProps}
|
|
47
45
|
role="radiogroup"
|
|
48
46
|
class="sui select-button-group {className}"
|
|
49
|
-
|
|
47
|
+
{hidden}
|
|
50
48
|
tabindex="-1"
|
|
51
49
|
aria-hidden={hidden}
|
|
52
50
|
aria-disabled={disabled}
|
|
53
51
|
aria-readonly={readonly}
|
|
54
52
|
aria-required={required}
|
|
55
53
|
aria-invalid={invalid}
|
|
56
|
-
{...$$restProps}
|
|
57
54
|
use:activateGroup
|
|
58
|
-
on:change={(/** @type {CustomEvent} */ event) => {
|
|
59
|
-
dispatch('change', event.detail);
|
|
60
|
-
}}
|
|
61
55
|
>
|
|
62
56
|
<div role="none" class="inner" inert={disabled}>
|
|
63
|
-
|
|
57
|
+
{@render children?.()}
|
|
64
58
|
</div>
|
|
65
59
|
</div>
|
|
66
60
|
|
|
@@ -1,50 +1,102 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default SelectButtonGroup;
|
|
2
|
+
type SelectButtonGroup = SvelteComponent<Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A variant of `<RadioGroup>`, looking like normal buttons.
|
|
6
9
|
* @see https://w3c.github.io/aria/#radiogroup
|
|
7
10
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
8
11
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
declare const SelectButtonGroup: $$__sveltets_2_IsomorphicComponent<{
|
|
13
|
+
/**
|
|
14
|
+
* - The `class` attribute on the wrapper element.
|
|
15
|
+
*/
|
|
11
16
|
class?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* - Whether to hide the widget.
|
|
19
|
+
*/
|
|
20
|
+
hidden?: boolean | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
23
|
+
* attribute.
|
|
24
|
+
*/
|
|
12
25
|
disabled?: boolean | undefined;
|
|
13
|
-
|
|
26
|
+
/**
|
|
27
|
+
* - Whether to make the widget read-only. An alias of the
|
|
28
|
+
* `aria-readonly` attribute.
|
|
29
|
+
*/
|
|
30
|
+
readonly?: boolean | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* - Whether to mark the widget required. An alias of the
|
|
33
|
+
* `aria-required` attribute.
|
|
34
|
+
*/
|
|
14
35
|
required?: boolean | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* - Whether to mark the widget invalid. An alias of the
|
|
38
|
+
* `aria-invalid` attribute.
|
|
39
|
+
*/
|
|
40
|
+
invalid?: boolean | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* - Primary slot content.
|
|
43
|
+
*/
|
|
44
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* - Custom `Change` event handler.
|
|
47
|
+
*/
|
|
48
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
49
|
+
} & Record<string, any>, {
|
|
50
|
+
[evt: string]: CustomEvent<any>;
|
|
51
|
+
}, {}, {}, "">;
|
|
52
|
+
type Props = {
|
|
53
|
+
/**
|
|
54
|
+
* - The `class` attribute on the wrapper element.
|
|
55
|
+
*/
|
|
56
|
+
class?: string | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* - Whether to hide the widget.
|
|
59
|
+
*/
|
|
15
60
|
hidden?: boolean | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
63
|
+
* attribute.
|
|
64
|
+
*/
|
|
65
|
+
disabled?: boolean | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* - Whether to make the widget read-only. An alias of the
|
|
68
|
+
* `aria-readonly` attribute.
|
|
69
|
+
*/
|
|
16
70
|
readonly?: boolean | undefined;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
required?: boolean | undefined;
|
|
36
|
-
hidden?: boolean | undefined;
|
|
37
|
-
readonly?: boolean | undefined;
|
|
38
|
-
};
|
|
39
|
-
events: {
|
|
40
|
-
change: CustomEvent<any>;
|
|
41
|
-
} & {
|
|
42
|
-
[evt: string]: CustomEvent<any>;
|
|
43
|
-
};
|
|
44
|
-
slots: {
|
|
45
|
-
default: {};
|
|
46
|
-
};
|
|
47
|
-
exports?: undefined;
|
|
48
|
-
bindings?: undefined;
|
|
71
|
+
/**
|
|
72
|
+
* - Whether to mark the widget required. An alias of the
|
|
73
|
+
* `aria-required` attribute.
|
|
74
|
+
*/
|
|
75
|
+
required?: boolean | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* - Whether to mark the widget invalid. An alias of the
|
|
78
|
+
* `aria-invalid` attribute.
|
|
79
|
+
*/
|
|
80
|
+
invalid?: boolean | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* - Primary slot content.
|
|
83
|
+
*/
|
|
84
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* - Custom `Change` event handler.
|
|
87
|
+
*/
|
|
88
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
49
89
|
};
|
|
50
|
-
|
|
90
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
91
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
92
|
+
$$bindings?: Bindings;
|
|
93
|
+
} & Exports;
|
|
94
|
+
(internal: unknown, props: Props & {
|
|
95
|
+
$$events?: Events;
|
|
96
|
+
$$slots?: Slots;
|
|
97
|
+
}): Exports & {
|
|
98
|
+
$set?: any;
|
|
99
|
+
$on?: any;
|
|
100
|
+
};
|
|
101
|
+
z_$$bindings?: Bindings;
|
|
102
|
+
}
|
|
@@ -8,75 +8,32 @@
|
|
|
8
8
|
import Button from './button.svelte';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* @
|
|
11
|
+
* @typedef {object} Props
|
|
12
|
+
* @property {boolean} [selected] - Whether to select the widget. An alias of the `aria-checked`
|
|
13
|
+
* attribute. Because the UI is a button, we expose `selected` instead of `checked`.
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
-
export { className as class };
|
|
16
|
-
/**
|
|
17
|
-
* The `value` attribute on the `<button>` element.
|
|
18
|
-
* @type {string | undefined}
|
|
19
|
-
*/
|
|
20
|
-
export let value = undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Whether to select the widget. An alias of the `aria-checked` attribute.
|
|
23
|
-
* Because the UI is a button, we expose `selected` instead of `checked`.
|
|
24
|
-
* @type {boolean}
|
|
25
|
-
*/
|
|
26
|
-
export let selected = false;
|
|
27
|
-
/**
|
|
28
|
-
* Whether to hide the widget. An alias of the `aria-hidden` attribute.
|
|
29
|
-
* @type {boolean | undefined}
|
|
30
|
-
*/
|
|
31
|
-
export let hidden = undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Whether to disable the widget. An alias of the `aria-disabled` attribute.
|
|
34
|
-
* @type {boolean}
|
|
35
|
-
*/
|
|
36
|
-
export let disabled = false;
|
|
37
|
-
/**
|
|
38
|
-
* Text label displayed on the button.
|
|
39
|
-
* @type {string}
|
|
40
|
-
*/
|
|
41
|
-
export let label = '';
|
|
42
|
-
/**
|
|
43
|
-
* The style variant of the button.
|
|
44
|
-
* @type {'primary' | 'secondary' | 'tertiary' | 'ghost' | 'link' | undefined}
|
|
45
|
-
*/
|
|
46
|
-
export let variant = undefined;
|
|
47
|
-
/**
|
|
48
|
-
* The size of the button.
|
|
49
|
-
* @type {'small' | 'medium' | 'large'}
|
|
50
|
-
*/
|
|
51
|
-
export let size = 'medium';
|
|
15
|
+
|
|
52
16
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*/
|
|
56
|
-
|
|
17
|
+
* @type {import('../../typedefs').ButtonProps & import('../../typedefs').CommonEventHandlers &
|
|
18
|
+
* Props & Record<string, any>}
|
|
19
|
+
*/
|
|
20
|
+
let {
|
|
21
|
+
/* eslint-disable prefer-const */
|
|
22
|
+
selected = $bindable(false),
|
|
23
|
+
class: className,
|
|
24
|
+
onChange,
|
|
25
|
+
...restProps
|
|
26
|
+
/* eslint-enable prefer-const */
|
|
27
|
+
} = $props();
|
|
57
28
|
</script>
|
|
58
29
|
|
|
59
30
|
<Button
|
|
31
|
+
{...restProps}
|
|
60
32
|
role="radio"
|
|
61
33
|
class="sui select-button {className}"
|
|
62
|
-
{value}
|
|
63
|
-
{hidden}
|
|
64
|
-
{disabled}
|
|
65
|
-
{label}
|
|
66
|
-
{variant}
|
|
67
|
-
{size}
|
|
68
|
-
{iconic}
|
|
69
34
|
aria-checked={selected}
|
|
70
|
-
{
|
|
71
|
-
on:click
|
|
72
|
-
on:dblclick
|
|
73
|
-
on:select
|
|
74
|
-
on:change
|
|
75
|
-
on:change={(event) => {
|
|
35
|
+
onChange={(event) => {
|
|
76
36
|
selected = event.detail.selected;
|
|
37
|
+
onChange?.(event);
|
|
77
38
|
}}
|
|
78
|
-
>
|
|
79
|
-
<slot name="start-icon" slot="start-icon" />
|
|
80
|
-
<slot />
|
|
81
|
-
<slot name="end-icon" slot="end-icon" />
|
|
82
|
-
</Button>
|
|
39
|
+
></Button>
|
|
@@ -1,74 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default SelectButton;
|
|
2
|
+
type SelectButton = SvelteComponent<ButtonProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "selected" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A variant of `<Radio>`, looking like a normal button.
|
|
6
9
|
* @see https://w3c.github.io/aria/#radio
|
|
7
10
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
8
11
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
size?: "small" | "medium" | "large" | undefined;
|
|
15
|
-
value?: string | undefined;
|
|
16
|
-
hidden?: boolean | undefined;
|
|
17
|
-
variant?: "primary" | "secondary" | "tertiary" | "ghost" | "link" | undefined;
|
|
18
|
-
iconic?: boolean | undefined;
|
|
12
|
+
declare const SelectButton: $$__sveltets_2_IsomorphicComponent<import("../../typedefs").ButtonProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & {
|
|
13
|
+
/**
|
|
14
|
+
* - Whether to select the widget. An alias of the `aria-checked`
|
|
15
|
+
* attribute. Because the UI is a button, we expose `selected` instead of `checked`.
|
|
16
|
+
*/
|
|
19
17
|
selected?: boolean | undefined;
|
|
20
|
-
}, {
|
|
21
|
-
click: MouseEvent;
|
|
22
|
-
dblclick: MouseEvent;
|
|
23
|
-
select: CustomEvent<any>;
|
|
24
|
-
change: CustomEvent<any>;
|
|
25
|
-
} & {
|
|
18
|
+
} & Record<string, any>, {
|
|
26
19
|
[evt: string]: CustomEvent<any>;
|
|
27
|
-
}, {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
}, {}, {}, "selected">;
|
|
21
|
+
type Props = {
|
|
22
|
+
/**
|
|
23
|
+
* - Whether to select the widget. An alias of the `aria-checked`
|
|
24
|
+
* attribute. Because the UI is a button, we expose `selected` instead of `checked`.
|
|
25
|
+
*/
|
|
26
|
+
selected?: boolean | undefined;
|
|
27
|
+
};
|
|
28
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
29
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
30
|
+
$$bindings?: Bindings;
|
|
31
|
+
} & Exports;
|
|
32
|
+
(internal: unknown, props: Props & {
|
|
33
|
+
$$events?: Events;
|
|
34
|
+
$$slots?: Slots;
|
|
35
|
+
}): Exports & {
|
|
36
|
+
$set?: any;
|
|
37
|
+
$on?: any;
|
|
34
38
|
};
|
|
35
|
-
|
|
39
|
+
z_$$bindings?: Bindings;
|
|
36
40
|
}
|
|
37
|
-
export type SelectButtonProps = typeof __propDef.props;
|
|
38
|
-
export type SelectButtonEvents = typeof __propDef.events;
|
|
39
|
-
export type SelectButtonSlots = typeof __propDef.slots;
|
|
40
|
-
import { SvelteComponent } from "svelte";
|
|
41
|
-
declare const __propDef: {
|
|
42
|
-
props: {
|
|
43
|
-
[x: string]: any;
|
|
44
|
-
class?: string | undefined;
|
|
45
|
-
disabled?: boolean | undefined;
|
|
46
|
-
label?: string | undefined;
|
|
47
|
-
size?: "small" | "medium" | "large" | undefined;
|
|
48
|
-
value?: string | undefined;
|
|
49
|
-
hidden?: boolean | undefined;
|
|
50
|
-
variant?: "primary" | "secondary" | "tertiary" | "ghost" | "link" | undefined;
|
|
51
|
-
iconic?: boolean | undefined;
|
|
52
|
-
selected?: boolean | undefined;
|
|
53
|
-
};
|
|
54
|
-
events: {
|
|
55
|
-
click: MouseEvent;
|
|
56
|
-
dblclick: MouseEvent;
|
|
57
|
-
select: CustomEvent<any>;
|
|
58
|
-
change: CustomEvent<any>;
|
|
59
|
-
} & {
|
|
60
|
-
[evt: string]: CustomEvent<any>;
|
|
61
|
-
};
|
|
62
|
-
slots: {
|
|
63
|
-
'start-icon': {
|
|
64
|
-
slot: string;
|
|
65
|
-
};
|
|
66
|
-
default: {};
|
|
67
|
-
'end-icon': {
|
|
68
|
-
slot: string;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
exports?: undefined;
|
|
72
|
-
bindings?: undefined;
|
|
73
|
-
};
|
|
74
|
-
export {};
|
|
@@ -12,65 +12,49 @@
|
|
|
12
12
|
import Button from './button.svelte';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @
|
|
15
|
+
* @typedef {object} Props
|
|
16
|
+
* @property {import('../../typedefs').PopupPosition} [popupPosition] - Where to show the dropdown
|
|
17
|
+
* menu.
|
|
18
|
+
* @property {boolean} [showPopupBackdrop] - Whether to show the backdrop for the popup.
|
|
19
|
+
* @property {import('svelte').Snippet} [chevronIcon] - Chevron slot content.
|
|
20
|
+
* @property {import('svelte').Snippet} [popup] - Popup slot content.
|
|
17
21
|
*/
|
|
18
|
-
|
|
19
|
-
export { className as class };
|
|
20
|
-
/**
|
|
21
|
-
* Whether to hide the widget. An alias of the `aria-hidden` attribute.
|
|
22
|
-
* @type {boolean | undefined}
|
|
23
|
-
*/
|
|
24
|
-
export let hidden = undefined;
|
|
25
|
-
/**
|
|
26
|
-
* Whether to disable the widget. An alias of the `aria-disabled` attribute.
|
|
27
|
-
* @type {boolean}
|
|
28
|
-
*/
|
|
29
|
-
export let disabled = false;
|
|
30
|
-
/**
|
|
31
|
-
* Text label displayed on the button.
|
|
32
|
-
* @type {string}
|
|
33
|
-
*/
|
|
34
|
-
export let label = '';
|
|
35
|
-
/**
|
|
36
|
-
* The style variant of the button.
|
|
37
|
-
* @type {'primary' | 'secondary' | 'tertiary' | 'ghost' | undefined}
|
|
38
|
-
*/
|
|
39
|
-
export let variant = undefined;
|
|
40
|
-
/**
|
|
41
|
-
* The size of the button.
|
|
42
|
-
* @type {'small' | 'medium' | 'large' | undefined}
|
|
43
|
-
*/
|
|
44
|
-
export let size = 'medium';
|
|
45
|
-
/**
|
|
46
|
-
* Where to show the dropdown menu.
|
|
47
|
-
* @type {import('../../typedefs').PopupPosition}
|
|
48
|
-
*/
|
|
49
|
-
export let popupPosition = 'bottom-left';
|
|
22
|
+
|
|
50
23
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
24
|
+
* @type {import('../../typedefs').ButtonProps & import('../../typedefs').CommonEventHandlers &
|
|
25
|
+
* Props & Record<string, any>}
|
|
53
26
|
*/
|
|
54
|
-
|
|
27
|
+
let {
|
|
28
|
+
/* eslint-disable prefer-const */
|
|
29
|
+
hidden = false,
|
|
30
|
+
disabled = false,
|
|
31
|
+
label = '',
|
|
32
|
+
variant = undefined,
|
|
33
|
+
size = 'medium',
|
|
34
|
+
popupPosition = 'bottom-left',
|
|
35
|
+
showPopupBackdrop = false,
|
|
36
|
+
chevronIcon,
|
|
37
|
+
popup: _popup,
|
|
38
|
+
...restProps
|
|
39
|
+
/* eslint-enable prefer-const */
|
|
40
|
+
} = $props();
|
|
55
41
|
|
|
56
42
|
/**
|
|
57
43
|
* @type {HTMLElement | undefined}
|
|
58
44
|
*/
|
|
59
|
-
let wrapper;
|
|
45
|
+
let wrapper = $state();
|
|
60
46
|
</script>
|
|
61
47
|
|
|
62
48
|
<div
|
|
49
|
+
bind:this={wrapper}
|
|
63
50
|
role="group"
|
|
64
51
|
class="sui split-button"
|
|
65
|
-
|
|
52
|
+
{hidden}
|
|
66
53
|
aria-hidden={hidden}
|
|
67
54
|
aria-disabled={disabled}
|
|
68
55
|
aria-label={$_('_sui.split_button.x_options', { values: { name: label } })}
|
|
69
|
-
bind:this={wrapper}
|
|
70
56
|
>
|
|
71
|
-
<Button
|
|
72
|
-
<slot name="start-icon" slot="start-icon" />
|
|
73
|
-
</Button>
|
|
57
|
+
<Button {...restProps} {hidden} {disabled} {label} {variant} {size}></Button>
|
|
74
58
|
<MenuButton
|
|
75
59
|
iconic
|
|
76
60
|
{hidden}
|
|
@@ -82,10 +66,16 @@
|
|
|
82
66
|
popupPositionBaseElement={wrapper}
|
|
83
67
|
{showPopupBackdrop}
|
|
84
68
|
>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
69
|
+
{#snippet endIcon()}
|
|
70
|
+
{#if chevronIcon}
|
|
71
|
+
{@render chevronIcon()}
|
|
72
|
+
{:else}
|
|
73
|
+
<Icon name="arrow_drop_down" class="small-arrow" />
|
|
74
|
+
{/if}
|
|
75
|
+
{/snippet}
|
|
76
|
+
{#snippet popup()}
|
|
77
|
+
{@render _popup?.()}
|
|
78
|
+
{/snippet}
|
|
89
79
|
</MenuButton>
|
|
90
80
|
</div>
|
|
91
81
|
|
|
@@ -1,71 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default SplitButton;
|
|
2
|
+
type SplitButton = SvelteComponent<ButtonProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A combination of a normal `<Button>` (default action) and an arrow-only `<MenuButton>` (different
|
|
6
9
|
* actions). For example, Microsoft Word has the Paste button along with the Keep Source Formatting,
|
|
7
10
|
* Match Formatting and Keep Text Only options.
|
|
8
11
|
* @see https://www.google.com/search?q=split+button&tbm=isch
|
|
9
12
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
size?: "small" | "medium" | "large" | undefined;
|
|
16
|
-
hidden?: boolean | undefined;
|
|
17
|
-
variant?: "primary" | "secondary" | "tertiary" | "ghost" | undefined;
|
|
13
|
+
declare const SplitButton: $$__sveltets_2_IsomorphicComponent<import("../../typedefs").ButtonProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & {
|
|
14
|
+
/**
|
|
15
|
+
* - Where to show the dropdown
|
|
16
|
+
* menu.
|
|
17
|
+
*/
|
|
18
18
|
popupPosition?: import("../../typedefs").PopupPosition | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* - Whether to show the backdrop for the popup.
|
|
21
|
+
*/
|
|
19
22
|
showPopupBackdrop?: boolean | undefined;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
/**
|
|
24
|
+
* - Chevron slot content.
|
|
25
|
+
*/
|
|
26
|
+
chevronIcon?: import("svelte").Snippet<[]> | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* - Popup slot content.
|
|
29
|
+
*/
|
|
30
|
+
popup?: import("svelte").Snippet<[]> | undefined;
|
|
31
|
+
} & Record<string, any>, {
|
|
23
32
|
[evt: string]: CustomEvent<any>;
|
|
24
|
-
}, {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
}, {}, {}, "">;
|
|
34
|
+
type Props = {
|
|
35
|
+
/**
|
|
36
|
+
* - Where to show the dropdown
|
|
37
|
+
* menu.
|
|
38
|
+
*/
|
|
39
|
+
popupPosition?: import("../../typedefs").PopupPosition | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* - Whether to show the backdrop for the popup.
|
|
42
|
+
*/
|
|
43
|
+
showPopupBackdrop?: boolean | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* - Chevron slot content.
|
|
46
|
+
*/
|
|
47
|
+
chevronIcon?: import("svelte").Snippet<[]> | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* - Popup slot content.
|
|
50
|
+
*/
|
|
51
|
+
popup?: import("svelte").Snippet<[]> | undefined;
|
|
52
|
+
};
|
|
53
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
54
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
55
|
+
$$bindings?: Bindings;
|
|
56
|
+
} & Exports;
|
|
57
|
+
(internal: unknown, props: Props & {
|
|
58
|
+
$$events?: Events;
|
|
59
|
+
$$slots?: Slots;
|
|
60
|
+
}): Exports & {
|
|
61
|
+
$set?: any;
|
|
62
|
+
$on?: any;
|
|
33
63
|
};
|
|
34
|
-
|
|
64
|
+
z_$$bindings?: Bindings;
|
|
35
65
|
}
|
|
36
|
-
export type SplitButtonProps = typeof __propDef.props;
|
|
37
|
-
export type SplitButtonEvents = typeof __propDef.events;
|
|
38
|
-
export type SplitButtonSlots = typeof __propDef.slots;
|
|
39
|
-
import { SvelteComponent } from "svelte";
|
|
40
|
-
declare const __propDef: {
|
|
41
|
-
props: {
|
|
42
|
-
[x: string]: any;
|
|
43
|
-
class?: string | undefined;
|
|
44
|
-
disabled?: boolean | undefined;
|
|
45
|
-
label?: string | undefined;
|
|
46
|
-
size?: "small" | "medium" | "large" | undefined;
|
|
47
|
-
hidden?: boolean | undefined;
|
|
48
|
-
variant?: "primary" | "secondary" | "tertiary" | "ghost" | undefined;
|
|
49
|
-
popupPosition?: import("../../typedefs").PopupPosition | undefined;
|
|
50
|
-
showPopupBackdrop?: boolean | undefined;
|
|
51
|
-
};
|
|
52
|
-
events: {
|
|
53
|
-
click: MouseEvent;
|
|
54
|
-
} & {
|
|
55
|
-
[evt: string]: CustomEvent<any>;
|
|
56
|
-
};
|
|
57
|
-
slots: {
|
|
58
|
-
'start-icon': {
|
|
59
|
-
slot: string;
|
|
60
|
-
};
|
|
61
|
-
'chevron-icon': {
|
|
62
|
-
slot: string;
|
|
63
|
-
};
|
|
64
|
-
popup: {
|
|
65
|
-
slot: string;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
exports?: undefined;
|
|
69
|
-
bindings?: undefined;
|
|
70
|
-
};
|
|
71
|
-
export {};
|