@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
|
@@ -1,56 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default MenuItemRadio;
|
|
2
|
+
type MenuItemRadio = SvelteComponent<ButtonProps & MenuItemProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "checked" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A menu item widget with a radio. Only one item can be selected within the parent `<Menu>` or
|
|
6
9
|
* `<MenuItemGroup>` component.
|
|
7
10
|
* @see https://w3c.github.io/aria/#menuitemradio
|
|
8
11
|
*/
|
|
9
|
-
|
|
10
|
-
[x: string]: any;
|
|
11
|
-
class?: string | undefined;
|
|
12
|
-
disabled?: boolean | undefined;
|
|
13
|
-
label?: string | undefined;
|
|
14
|
-
checked?: boolean | undefined;
|
|
15
|
-
hidden?: boolean | undefined;
|
|
16
|
-
iconName?: string | undefined;
|
|
17
|
-
iconLabel?: string | undefined;
|
|
18
|
-
}, {
|
|
19
|
-
click: MouseEvent;
|
|
20
|
-
select: CustomEvent<any>;
|
|
21
|
-
change: CustomEvent<any>;
|
|
22
|
-
} & {
|
|
12
|
+
declare const MenuItemRadio: $$__sveltets_2_IsomorphicComponent<import("../../typedefs").ButtonProps & import("../../typedefs").MenuItemProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & Record<string, any>, {
|
|
23
13
|
[evt: string]: CustomEvent<any>;
|
|
24
|
-
}, {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class?: string | undefined;
|
|
36
|
-
disabled?: boolean | undefined;
|
|
37
|
-
label?: string | undefined;
|
|
38
|
-
checked?: boolean | undefined;
|
|
39
|
-
hidden?: boolean | undefined;
|
|
40
|
-
iconName?: string | undefined;
|
|
41
|
-
iconLabel?: string | undefined;
|
|
42
|
-
};
|
|
43
|
-
events: {
|
|
44
|
-
click: MouseEvent;
|
|
45
|
-
select: CustomEvent<any>;
|
|
46
|
-
change: CustomEvent<any>;
|
|
47
|
-
} & {
|
|
48
|
-
[evt: string]: CustomEvent<any>;
|
|
14
|
+
}, {}, {}, "checked">;
|
|
15
|
+
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> {
|
|
16
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
|
+
$$bindings?: Bindings;
|
|
18
|
+
} & Exports;
|
|
19
|
+
(internal: unknown, props: Props & {
|
|
20
|
+
$$events?: Events;
|
|
21
|
+
$$slots?: Slots;
|
|
22
|
+
}): Exports & {
|
|
23
|
+
$set?: any;
|
|
24
|
+
$on?: any;
|
|
49
25
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
exports?: undefined;
|
|
54
|
-
bindings?: undefined;
|
|
55
|
-
};
|
|
56
|
-
export {};
|
|
26
|
+
z_$$bindings?: Bindings;
|
|
27
|
+
}
|
|
@@ -4,104 +4,95 @@
|
|
|
4
4
|
@see https://w3c.github.io/aria/#menuitem
|
|
5
5
|
-->
|
|
6
6
|
<script>
|
|
7
|
-
import { writable } from 'svelte/store';
|
|
8
7
|
import Button from '../button/button.svelte';
|
|
9
8
|
import Icon from '../icon/icon.svelte';
|
|
10
|
-
import Menu from './menu.svelte';
|
|
11
9
|
import Popup from '../util/popup.svelte';
|
|
10
|
+
import Menu from './menu.svelte';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
let className = '';
|
|
18
|
-
export { className as class };
|
|
19
|
-
/**
|
|
20
|
-
* The `role` attribute on the `<button>` element.
|
|
21
|
-
* @type {'menuitem' | 'menuitemcheckbox' | 'menuitemradio'}
|
|
22
|
-
*/
|
|
23
|
-
export let role = 'menuitem';
|
|
24
|
-
/**
|
|
25
|
-
* Whether to hide the widget. An alias of the `aria-hidden` attribute.
|
|
26
|
-
* @type {boolean | undefined}
|
|
27
|
-
*/
|
|
28
|
-
export let hidden = undefined;
|
|
29
|
-
/**
|
|
30
|
-
* Whether to disable the widget. An alias of the `aria-disabled` attribute.
|
|
31
|
-
* @type {boolean}
|
|
13
|
+
* @type {import('../../typedefs').ButtonProps & import('../../typedefs').MenuItemProps &
|
|
14
|
+
* import('../../typedefs').CommonEventHandlers & Record<string, any>}
|
|
32
15
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
16
|
+
let {
|
|
17
|
+
/* eslint-disable prefer-const */
|
|
18
|
+
class: className,
|
|
19
|
+
role = 'menuitem',
|
|
20
|
+
hidden = false,
|
|
21
|
+
disabled = false,
|
|
22
|
+
label = '',
|
|
23
|
+
children: _children,
|
|
24
|
+
startIcon: _startIcon,
|
|
25
|
+
endIcon: _endIcon,
|
|
26
|
+
chevronIcon,
|
|
27
|
+
items,
|
|
28
|
+
onChange,
|
|
29
|
+
onSelect,
|
|
30
|
+
...restProps
|
|
31
|
+
/* eslint-enable prefer-const */
|
|
32
|
+
} = $props();
|
|
33
|
+
|
|
34
|
+
let isPopupOpen = $state(false);
|
|
35
|
+
|
|
43
36
|
/**
|
|
44
|
-
*
|
|
37
|
+
* Reference to the `<button>` element.
|
|
38
|
+
* @type {HTMLButtonElement | undefined}
|
|
45
39
|
*/
|
|
46
|
-
|
|
40
|
+
let buttonElement = $state();
|
|
47
41
|
|
|
48
|
-
|
|
49
|
-
let buttonComponent;
|
|
50
|
-
let isPopupOpen = writable(false);
|
|
51
|
-
|
|
52
|
-
$: hasChildren = role === 'menuitem' && $$slots.children;
|
|
42
|
+
const hasItems = $derived(role === 'menuitem' && !!items);
|
|
53
43
|
</script>
|
|
54
44
|
|
|
55
|
-
<div role="none" class="sui menuitem {className}"
|
|
45
|
+
<div role="none" class="sui menuitem {className}" {hidden}>
|
|
56
46
|
<Button
|
|
47
|
+
bind:element={buttonElement}
|
|
48
|
+
{...restProps}
|
|
57
49
|
{role}
|
|
58
50
|
{hidden}
|
|
59
51
|
{disabled}
|
|
60
|
-
aria-haspopup={
|
|
61
|
-
aria-expanded={
|
|
62
|
-
{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
on:mouseenter={() => {
|
|
66
|
-
if (hasChildren) {
|
|
67
|
-
$isPopupOpen = true;
|
|
52
|
+
aria-haspopup={hasItems ? 'menu' : undefined}
|
|
53
|
+
aria-expanded={hasItems ? isPopupOpen : undefined}
|
|
54
|
+
onmouseenter={() => {
|
|
55
|
+
if (hasItems) {
|
|
56
|
+
isPopupOpen = true;
|
|
68
57
|
}
|
|
69
58
|
}}
|
|
70
|
-
|
|
71
|
-
if (
|
|
72
|
-
|
|
59
|
+
onmouseleave={() => {
|
|
60
|
+
if (hasItems) {
|
|
61
|
+
isPopupOpen = false;
|
|
73
62
|
}
|
|
74
63
|
}}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
on:select
|
|
78
|
-
on:change
|
|
64
|
+
{onChange}
|
|
65
|
+
{onSelect}
|
|
79
66
|
>
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
{
|
|
88
|
-
|
|
89
|
-
|
|
67
|
+
{#snippet startIcon()}
|
|
68
|
+
{@render _startIcon?.()}
|
|
69
|
+
{/snippet}
|
|
70
|
+
{#snippet children()}
|
|
71
|
+
<div role="none" class="content" class:label={!!label}>
|
|
72
|
+
{#if label}
|
|
73
|
+
{label}
|
|
74
|
+
{:else}
|
|
75
|
+
{@render _children?.()}
|
|
76
|
+
{/if}
|
|
77
|
+
</div>
|
|
78
|
+
{#if hasItems}
|
|
79
|
+
<span role="none" class="icon-outer">
|
|
80
|
+
{#if chevronIcon}
|
|
81
|
+
{@render chevronIcon()}
|
|
82
|
+
{:else}
|
|
83
|
+
<Icon name="chevron_right" />
|
|
84
|
+
{/if}
|
|
85
|
+
</span>
|
|
90
86
|
{/if}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<slot name="chevron-icon">
|
|
96
|
-
<Icon name="chevron_right" />
|
|
97
|
-
</slot>
|
|
98
|
-
</span>
|
|
99
|
-
{/if}
|
|
87
|
+
{/snippet}
|
|
88
|
+
{#snippet endIcon()}
|
|
89
|
+
{@render _endIcon?.()}
|
|
90
|
+
{/snippet}
|
|
100
91
|
</Button>
|
|
101
|
-
{#if
|
|
102
|
-
<Popup anchor={
|
|
92
|
+
{#if hasItems}
|
|
93
|
+
<Popup anchor={buttonElement} position="right-top" bind:open={isPopupOpen}>
|
|
103
94
|
<Menu>
|
|
104
|
-
|
|
95
|
+
{@render items?.()}
|
|
105
96
|
</Menu>
|
|
106
97
|
</Popup>
|
|
107
98
|
{/if}
|
|
@@ -1,75 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default MenuItem;
|
|
2
|
+
type MenuItem = SvelteComponent<ButtonProps & MenuItemProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A menu item widget.
|
|
6
9
|
* @see https://w3c.github.io/aria/#menuitem
|
|
7
10
|
*/
|
|
8
|
-
|
|
9
|
-
[x: string]: any;
|
|
10
|
-
class?: string | undefined;
|
|
11
|
-
disabled?: boolean | undefined;
|
|
12
|
-
label?: string | undefined;
|
|
13
|
-
role?: "menuitem" | "menuitemcheckbox" | "menuitemradio" | undefined;
|
|
14
|
-
hidden?: boolean | undefined;
|
|
15
|
-
iconName?: string | undefined;
|
|
16
|
-
iconLabel?: string | undefined;
|
|
17
|
-
}, {
|
|
18
|
-
click: MouseEvent;
|
|
19
|
-
focus: FocusEvent;
|
|
20
|
-
blur: FocusEvent;
|
|
21
|
-
select: CustomEvent<any>;
|
|
22
|
-
change: CustomEvent<any>;
|
|
23
|
-
} & {
|
|
11
|
+
declare const MenuItem: $$__sveltets_2_IsomorphicComponent<import("../../typedefs").ButtonProps & import("../../typedefs").MenuItemProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & Record<string, any>, {
|
|
24
12
|
[evt: string]: CustomEvent<any>;
|
|
25
|
-
}, {
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
}, {}, {}, "">;
|
|
14
|
+
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> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: Props & {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
28
24
|
};
|
|
29
|
-
|
|
30
|
-
'end-icon': {
|
|
31
|
-
slot: string;
|
|
32
|
-
};
|
|
33
|
-
'chevron-icon': {};
|
|
34
|
-
children: {};
|
|
35
|
-
}> {
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
36
26
|
}
|
|
37
|
-
export type MenuItemProps = typeof __propDef.props;
|
|
38
|
-
export type MenuItemEvents = typeof __propDef.events;
|
|
39
|
-
export type MenuItemSlots = 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
|
-
role?: "menuitem" | "menuitemcheckbox" | "menuitemradio" | undefined;
|
|
48
|
-
hidden?: boolean | undefined;
|
|
49
|
-
iconName?: string | undefined;
|
|
50
|
-
iconLabel?: string | undefined;
|
|
51
|
-
};
|
|
52
|
-
events: {
|
|
53
|
-
click: MouseEvent;
|
|
54
|
-
focus: FocusEvent;
|
|
55
|
-
blur: FocusEvent;
|
|
56
|
-
select: CustomEvent<any>;
|
|
57
|
-
change: CustomEvent<any>;
|
|
58
|
-
} & {
|
|
59
|
-
[evt: string]: CustomEvent<any>;
|
|
60
|
-
};
|
|
61
|
-
slots: {
|
|
62
|
-
'start-icon': {
|
|
63
|
-
slot: string;
|
|
64
|
-
};
|
|
65
|
-
default: {};
|
|
66
|
-
'end-icon': {
|
|
67
|
-
slot: string;
|
|
68
|
-
};
|
|
69
|
-
'chevron-icon': {};
|
|
70
|
-
children: {};
|
|
71
|
-
};
|
|
72
|
-
exports?: undefined;
|
|
73
|
-
bindings?: undefined;
|
|
74
|
-
};
|
|
75
|
-
export {};
|
|
@@ -5,42 +5,45 @@
|
|
|
5
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/menubar/
|
|
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. An alias of the `aria-hidden`
|
|
14
|
+
* attribute.
|
|
15
|
+
* @property {boolean} [disabled] - Whether to disable the widget. An alias of the `aria-disabled`
|
|
16
|
+
* attribute.
|
|
17
|
+
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
18
|
+
* @property {(event: CustomEvent) => void} [onChange] - Custom `Change` event handler.
|
|
14
19
|
*/
|
|
15
|
-
|
|
16
|
-
export { className as class };
|
|
17
|
-
/**
|
|
18
|
-
* Whether to hide the widget. An alias of the `aria-hidden` attribute.
|
|
19
|
-
* @type {boolean | undefined}
|
|
20
|
-
*/
|
|
21
|
-
export let hidden = undefined;
|
|
20
|
+
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @type {boolean}
|
|
22
|
+
* @type {Props & Record<string, any>}
|
|
25
23
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
let {
|
|
25
|
+
/* eslint-disable prefer-const */
|
|
26
|
+
class: className,
|
|
27
|
+
hidden = false,
|
|
28
|
+
disabled = false,
|
|
29
|
+
children,
|
|
30
|
+
onChange,
|
|
31
|
+
...restProps
|
|
32
|
+
/* eslint-enable prefer-const */
|
|
33
|
+
} = $props();
|
|
29
34
|
</script>
|
|
30
35
|
|
|
31
36
|
<div
|
|
37
|
+
{...restProps}
|
|
32
38
|
role="menu"
|
|
33
39
|
class="sui menu {className}"
|
|
34
|
-
|
|
40
|
+
{hidden}
|
|
35
41
|
aria-hidden={hidden}
|
|
36
42
|
aria-disabled={disabled}
|
|
37
|
-
{
|
|
43
|
+
{onChange}
|
|
38
44
|
use:activateGroup
|
|
39
|
-
on:change={(/** @type {CustomEvent} */ event) => {
|
|
40
|
-
dispatch('change', event.detail);
|
|
41
|
-
}}
|
|
42
45
|
>
|
|
43
|
-
|
|
46
|
+
{@render children?.()}
|
|
44
47
|
</div>
|
|
45
48
|
|
|
46
49
|
<style>.menu {
|
|
@@ -1,44 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export default Menu;
|
|
2
|
+
type Menu = SvelteComponent<Props & Record<string, any>, {
|
|
3
|
+
[evt: string]: CustomEvent<any>;
|
|
4
|
+
}, {}> & {
|
|
5
|
+
$$bindings?: "" | undefined;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* A menu widget.
|
|
6
9
|
* @see https://w3c.github.io/aria/#menu
|
|
7
10
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/menubar/
|
|
8
11
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
declare const Menu: $$__sveltets_2_IsomorphicComponent<{
|
|
13
|
+
/**
|
|
14
|
+
* - The `class` attribute on the wrapper element.
|
|
15
|
+
*/
|
|
11
16
|
class?: string | undefined;
|
|
12
|
-
|
|
17
|
+
/**
|
|
18
|
+
* - Whether to hide the widget. An alias of the `aria-hidden`
|
|
19
|
+
* attribute.
|
|
20
|
+
*/
|
|
13
21
|
hidden?: boolean | undefined;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
/**
|
|
23
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
24
|
+
* attribute.
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* - Primary slot content.
|
|
29
|
+
*/
|
|
30
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* - Custom `Change` event handler.
|
|
33
|
+
*/
|
|
34
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
35
|
+
} & Record<string, any>, {
|
|
17
36
|
[evt: string]: CustomEvent<any>;
|
|
18
|
-
}, {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
bindings?: undefined;
|
|
37
|
+
}, {}, {}, "">;
|
|
38
|
+
type Props = {
|
|
39
|
+
/**
|
|
40
|
+
* - The `class` attribute on the wrapper element.
|
|
41
|
+
*/
|
|
42
|
+
class?: string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* - Whether to hide the widget. An alias of the `aria-hidden`
|
|
45
|
+
* attribute.
|
|
46
|
+
*/
|
|
47
|
+
hidden?: boolean | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
50
|
+
* attribute.
|
|
51
|
+
*/
|
|
52
|
+
disabled?: boolean | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* - Primary slot content.
|
|
55
|
+
*/
|
|
56
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* - Custom `Change` event handler.
|
|
59
|
+
*/
|
|
60
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
43
61
|
};
|
|
44
|
-
|
|
62
|
+
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> {
|
|
63
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
64
|
+
$$bindings?: Bindings;
|
|
65
|
+
} & Exports;
|
|
66
|
+
(internal: unknown, props: Props & {
|
|
67
|
+
$$events?: Events;
|
|
68
|
+
$$slots?: Slots;
|
|
69
|
+
}): Exports & {
|
|
70
|
+
$set?: any;
|
|
71
|
+
$on?: any;
|
|
72
|
+
};
|
|
73
|
+
z_$$bindings?: Bindings;
|
|
74
|
+
}
|
|
@@ -5,68 +5,62 @@
|
|
|
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 {'horizontal'|'vertical'} [orientation] - Orientation of the widget. An alias of the
|
|
23
|
+
* `aria-orientation` attribute.
|
|
24
|
+
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
25
|
+
* @property {(event: CustomEvent) => void} [onChange] - Custom `Change` event handler.
|
|
14
26
|
*/
|
|
15
|
-
|
|
16
|
-
export { className as class };
|
|
17
|
-
/**
|
|
18
|
-
* Whether to hide the widget. An alias of the `aria-hidden` attribute.
|
|
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;
|
|
37
|
-
/**
|
|
38
|
-
* Whether to mark the widget invalid. An alias of the `aria-invalid` attribute.
|
|
39
|
-
* @type {boolean}
|
|
40
|
-
*/
|
|
41
|
-
export let invalid = false;
|
|
27
|
+
|
|
42
28
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @type {'horizontal' | 'vertical'}
|
|
29
|
+
* @type {Props & Record<string, any>}
|
|
45
30
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
31
|
+
let {
|
|
32
|
+
/* eslint-disable prefer-const */
|
|
33
|
+
class: className,
|
|
34
|
+
hidden = false,
|
|
35
|
+
disabled = false,
|
|
36
|
+
readonly = false,
|
|
37
|
+
required = false,
|
|
38
|
+
invalid = false,
|
|
39
|
+
orientation = 'horizontal',
|
|
40
|
+
children,
|
|
41
|
+
onChange,
|
|
42
|
+
...restProps
|
|
43
|
+
/* eslint-enable prefer-const */
|
|
44
|
+
} = $props();
|
|
49
45
|
</script>
|
|
50
46
|
|
|
51
47
|
<div
|
|
48
|
+
{...restProps}
|
|
52
49
|
role="radiogroup"
|
|
53
50
|
class="sui radio-group {className} {orientation}"
|
|
54
51
|
tabindex="-1"
|
|
55
|
-
|
|
52
|
+
{hidden}
|
|
56
53
|
aria-hidden={hidden}
|
|
57
54
|
aria-disabled={disabled}
|
|
58
55
|
aria-readonly={readonly}
|
|
59
56
|
aria-required={required}
|
|
60
57
|
aria-invalid={invalid}
|
|
61
58
|
aria-orientation={orientation}
|
|
62
|
-
{
|
|
59
|
+
{onChange}
|
|
63
60
|
use:activateGroup
|
|
64
|
-
on:change={(/** @type {CustomEvent} */ event) => {
|
|
65
|
-
dispatch('change', event.detail);
|
|
66
|
-
}}
|
|
67
61
|
>
|
|
68
62
|
<div role="none" class="inner" inert={disabled}>
|
|
69
|
-
|
|
63
|
+
{@render children?.()}
|
|
70
64
|
</div>
|
|
71
65
|
</div>
|
|
72
66
|
|