@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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { generateElementId } from '@sveltia/utils/element';
|
|
4
4
|
import { sleep } from '@sveltia/utils/misc';
|
|
5
|
+
import { on } from 'svelte/events';
|
|
5
6
|
import { get, writable } from 'svelte/store';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -124,13 +125,13 @@ class Popup {
|
|
|
124
125
|
this.anchorElement.setAttribute('aria-controls', this.id);
|
|
125
126
|
this.popupElement.setAttribute('id', this.id);
|
|
126
127
|
|
|
127
|
-
|
|
128
|
+
on(anchorElement, 'click', () => {
|
|
128
129
|
if (!this.isDisabled && !this.isReadOnly) {
|
|
129
130
|
this.open.set(!get(this.open));
|
|
130
131
|
}
|
|
131
132
|
});
|
|
132
133
|
|
|
133
|
-
|
|
134
|
+
on(anchorElement, 'keydown', (event) => {
|
|
134
135
|
const { key, ctrlKey, metaKey, shiftKey, altKey } = event;
|
|
135
136
|
const hasModifier = shiftKey || altKey || ctrlKey || metaKey;
|
|
136
137
|
|
|
@@ -141,7 +142,7 @@ class Popup {
|
|
|
141
142
|
}
|
|
142
143
|
});
|
|
143
144
|
|
|
144
|
-
|
|
145
|
+
on(anchorElement, 'transitionstart', () => {
|
|
145
146
|
if (this.anchorElement.closest('.hiding, .hidden, [hidden]')) {
|
|
146
147
|
this.hideImmediately();
|
|
147
148
|
}
|
|
@@ -154,7 +155,7 @@ class Popup {
|
|
|
154
155
|
}).observe(this.anchorElement);
|
|
155
156
|
|
|
156
157
|
// Close the popup when the backdrop, a menu item or an option is clicked
|
|
157
|
-
this.popupElement
|
|
158
|
+
on(this.popupElement, 'click', (event) => {
|
|
158
159
|
event.stopPropagation();
|
|
159
160
|
|
|
160
161
|
// eslint-disable-next-line prefer-destructuring
|
|
@@ -168,7 +169,7 @@ class Popup {
|
|
|
168
169
|
}
|
|
169
170
|
});
|
|
170
171
|
|
|
171
|
-
this.popupElement
|
|
172
|
+
on(this.popupElement, 'keydown', (event) => {
|
|
172
173
|
const { key, ctrlKey, metaKey, shiftKey, altKey } = event;
|
|
173
174
|
const hasModifier = shiftKey || altKey || ctrlKey || metaKey;
|
|
174
175
|
|
package/package/typedefs.d.ts
CHANGED
|
@@ -1,3 +1,548 @@
|
|
|
1
|
+
export type ButtonProps = {
|
|
2
|
+
/**
|
|
3
|
+
* - Reference to the `<button>` element.
|
|
4
|
+
*/
|
|
5
|
+
element?: HTMLButtonElement | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* - The `class` attribute on the `<button>` element.
|
|
8
|
+
*/
|
|
9
|
+
class?: string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* - The `type` attribute on the `<button>`
|
|
12
|
+
* element.
|
|
13
|
+
*/
|
|
14
|
+
type?: "reset" | "submit" | "button" | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* - The `role` attribute on the `<button>` element.
|
|
17
|
+
*/
|
|
18
|
+
role?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* - The `name` attribute on the `<button>` element.
|
|
21
|
+
*/
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* - The `value` attribute on the `<button>` element.
|
|
25
|
+
*/
|
|
26
|
+
value?: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* - Whether to hide the widget. An alias of the `aria-hidden`
|
|
29
|
+
* attribute.
|
|
30
|
+
*/
|
|
31
|
+
hidden?: boolean | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
34
|
+
* attribute.
|
|
35
|
+
*/
|
|
36
|
+
disabled?: boolean | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* - Whether to make the widget read-only. An alias of the
|
|
39
|
+
* `aria-readonly` attribute used in certain roles, including `checkbox`, `listbox`, `slider` and
|
|
40
|
+
* `textbox`.
|
|
41
|
+
*/
|
|
42
|
+
readonly?: boolean | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* - Whether to mark the widget pressed. An
|
|
45
|
+
* alias of the `aria-pressed` attribute.
|
|
46
|
+
*/
|
|
47
|
+
pressed?: boolean | "mixed" | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* - Keyboard shortcuts. An alias of the
|
|
50
|
+
* `aria-keyshortcuts` attribute. Accepts the special `Accel` key, which will be replaced with
|
|
51
|
+
* `Control` or `Meta` depending on the user’s operating system.
|
|
52
|
+
*/
|
|
53
|
+
keyShortcuts?: string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* - Text label displayed on the button.
|
|
56
|
+
*/
|
|
57
|
+
label?: string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* - The
|
|
60
|
+
* style variant of the button.
|
|
61
|
+
*/
|
|
62
|
+
variant?: "primary" | "secondary" | "tertiary" | "ghost" | "link" | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* - The size of the button.
|
|
65
|
+
*/
|
|
66
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* - Whether to only show an icon on the button and trim the padding.
|
|
69
|
+
*/
|
|
70
|
+
iconic?: boolean | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* - Whether to make the button rounded.
|
|
73
|
+
*/
|
|
74
|
+
pill?: boolean | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* - Make the button width flexible.
|
|
77
|
+
*/
|
|
78
|
+
flex?: boolean | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* - Where to show the dropdown menu.
|
|
81
|
+
*/
|
|
82
|
+
popupPosition?: PopupPosition | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* - Whether to show the backdrop for the popup.
|
|
85
|
+
*/
|
|
86
|
+
showPopupBackdrop?: boolean | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* - Primary slot content.
|
|
89
|
+
*/
|
|
90
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* - Start icon slot content.
|
|
93
|
+
*/
|
|
94
|
+
startIcon?: import("svelte").Snippet<[]> | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* - End icon slot content.
|
|
97
|
+
*/
|
|
98
|
+
endIcon?: import("svelte").Snippet<[]> | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* - Popup slot content.
|
|
101
|
+
*/
|
|
102
|
+
popup?: import("svelte").Snippet<[]> | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* - Custom `Change` event handler.
|
|
105
|
+
*/
|
|
106
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* - Custom `Select` event handler.
|
|
109
|
+
*/
|
|
110
|
+
onSelect?: ((event: CustomEvent) => void) | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* - Custom `Toggle` event handler.
|
|
113
|
+
*/
|
|
114
|
+
onToggle?: ((event: CustomEvent) => void) | undefined;
|
|
115
|
+
};
|
|
116
|
+
export type ModalProps = {
|
|
117
|
+
/**
|
|
118
|
+
* - The `class` attribute on the content element.
|
|
119
|
+
*/
|
|
120
|
+
class?: string | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* - The `role` attribute on the `<dialog>`
|
|
123
|
+
* element.
|
|
124
|
+
*/
|
|
125
|
+
role?: "dialog" | "alertdialog" | "none" | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* - Whether to show the modal.
|
|
128
|
+
*/
|
|
129
|
+
open?: boolean | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* - Whether to show the backdrop.
|
|
132
|
+
*/
|
|
133
|
+
showBackdrop?: boolean | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* - Whether to close the modal when the backdrop (outside of
|
|
136
|
+
* the modal) is clicked.
|
|
137
|
+
*/
|
|
138
|
+
lightDismiss?: boolean | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* - Whether to close the modal when the Escape key is pressed.
|
|
141
|
+
*/
|
|
142
|
+
escapeDismiss?: boolean | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* - Whether to keep the content in the DOM tree when the modal is
|
|
145
|
+
* not displayed.
|
|
146
|
+
*/
|
|
147
|
+
keepContent?: boolean | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* - A reference to the `<dialog>` element.
|
|
150
|
+
*/
|
|
151
|
+
dialog?: HTMLDialogElement | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* - Primary slot content.
|
|
154
|
+
*/
|
|
155
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
156
|
+
/**
|
|
157
|
+
* - Extra slot content.
|
|
158
|
+
*/
|
|
159
|
+
extraContent?: import("svelte").Snippet<[]> | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* - Custom `Opening` event handler.
|
|
162
|
+
*/
|
|
163
|
+
onOpening?: ((event: CustomEvent) => void) | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* - Custom `Open` event handler.
|
|
166
|
+
*/
|
|
167
|
+
onOpen?: ((event: CustomEvent) => void) | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* - Custom `Ok` event handler.
|
|
170
|
+
*/
|
|
171
|
+
onOk?: ((event: CustomEvent) => void) | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* - Custom `Cancel` event handler.
|
|
174
|
+
*/
|
|
175
|
+
onCancel?: ((event: CustomEvent) => void) | undefined;
|
|
176
|
+
/**
|
|
177
|
+
* - Custom `Closing` event handler.
|
|
178
|
+
*/
|
|
179
|
+
onClosing?: ((event: CustomEvent) => void) | undefined;
|
|
180
|
+
/**
|
|
181
|
+
* - Custom `Close` event handler.
|
|
182
|
+
*/
|
|
183
|
+
onClose?: ((event: CustomEvent) => void) | undefined;
|
|
184
|
+
};
|
|
185
|
+
export type DialogProps = {
|
|
186
|
+
/**
|
|
187
|
+
* - Text label displayed on the header. Required.
|
|
188
|
+
*/
|
|
189
|
+
title?: string | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* - The `role` attribute on the `<dialog>` element.
|
|
192
|
+
*/
|
|
193
|
+
role?: "dialog" | "alertdialog" | undefined;
|
|
194
|
+
/**
|
|
195
|
+
* - Width of the dialog.
|
|
196
|
+
*/
|
|
197
|
+
size?: "small" | "medium" | "large" | "x-large" | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* - The `class` attribute on the `<dialog>` element.
|
|
200
|
+
*/
|
|
201
|
+
class?: string | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* - Whether to open the dialog.
|
|
204
|
+
*/
|
|
205
|
+
open?: boolean | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* - Whether to show the Close button on the header.
|
|
208
|
+
*/
|
|
209
|
+
showClose?: boolean | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* - Whether to show the OK button on the footer.
|
|
212
|
+
*/
|
|
213
|
+
showOk?: boolean | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* - Whether to show the Cancel button on the footer.
|
|
216
|
+
*/
|
|
217
|
+
showCancel?: boolean | undefined;
|
|
218
|
+
/**
|
|
219
|
+
* - Text label displayed on the OK button.
|
|
220
|
+
*/
|
|
221
|
+
okLabel?: string | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* - Whether to disable the OK button.
|
|
224
|
+
*/
|
|
225
|
+
okDisabled?: boolean | undefined;
|
|
226
|
+
/**
|
|
227
|
+
* - Text label displayed on the Cancel button.
|
|
228
|
+
*/
|
|
229
|
+
cancelLabel?: string | undefined;
|
|
230
|
+
/**
|
|
231
|
+
* - Whether to disable the Cancel button.
|
|
232
|
+
*/
|
|
233
|
+
cancelDisabled?: boolean | undefined;
|
|
234
|
+
/**
|
|
235
|
+
* - Whether to close the modal when the backdrop (outside of the
|
|
236
|
+
* modal) is clicked.
|
|
237
|
+
*/
|
|
238
|
+
lightDismiss?: boolean | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* - Value entered on the textbox.
|
|
241
|
+
*/
|
|
242
|
+
value?: string | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* - Primary slot content.
|
|
245
|
+
*/
|
|
246
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
247
|
+
/**
|
|
248
|
+
* - Header slot content.
|
|
249
|
+
*/
|
|
250
|
+
header?: import("svelte").Snippet<[]> | undefined;
|
|
251
|
+
/**
|
|
252
|
+
* - Header extra slot content.
|
|
253
|
+
*/
|
|
254
|
+
headerExtra?: import("svelte").Snippet<[]> | undefined;
|
|
255
|
+
/**
|
|
256
|
+
* - Footer slot content.
|
|
257
|
+
*/
|
|
258
|
+
footer?: import("svelte").Snippet<[]> | undefined;
|
|
259
|
+
/**
|
|
260
|
+
* - Footer extra slot content.
|
|
261
|
+
*/
|
|
262
|
+
footerExtra?: import("svelte").Snippet<[]> | undefined;
|
|
263
|
+
/**
|
|
264
|
+
* - Close icon slot content.
|
|
265
|
+
*/
|
|
266
|
+
closeIcon?: import("svelte").Snippet<[]> | undefined;
|
|
267
|
+
/**
|
|
268
|
+
* - Extra content slot content.
|
|
269
|
+
*/
|
|
270
|
+
extraContent?: import("svelte").Snippet<[]> | undefined;
|
|
271
|
+
};
|
|
272
|
+
export type MenuItemProps = {
|
|
273
|
+
/**
|
|
274
|
+
* - The `class` attribute on the wrapper element.
|
|
275
|
+
*/
|
|
276
|
+
class?: string | undefined;
|
|
277
|
+
/**
|
|
278
|
+
* - The `role` attribute on
|
|
279
|
+
* the `<button>` element.
|
|
280
|
+
*/
|
|
281
|
+
role?: "menuitem" | "menuitemcheckbox" | "menuitemradio" | undefined;
|
|
282
|
+
/**
|
|
283
|
+
* - Whether to hide the widget. An alias of the `aria-hidden`
|
|
284
|
+
* attribute.
|
|
285
|
+
*/
|
|
286
|
+
hidden?: boolean | undefined;
|
|
287
|
+
/**
|
|
288
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
289
|
+
* attribute.
|
|
290
|
+
*/
|
|
291
|
+
disabled?: boolean | undefined;
|
|
292
|
+
/**
|
|
293
|
+
* - Whether to check the widget. An alias of the `aria-checked`
|
|
294
|
+
* attribute.
|
|
295
|
+
*/
|
|
296
|
+
checked?: boolean | undefined;
|
|
297
|
+
/**
|
|
298
|
+
* - Text label displayed on the item.
|
|
299
|
+
*/
|
|
300
|
+
label?: string | undefined;
|
|
301
|
+
/**
|
|
302
|
+
* - Primary slot content.
|
|
303
|
+
*/
|
|
304
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
305
|
+
/**
|
|
306
|
+
* - Start icon slot content.
|
|
307
|
+
*/
|
|
308
|
+
startIcon?: import("svelte").Snippet<[]> | undefined;
|
|
309
|
+
/**
|
|
310
|
+
* - End icon slot content.
|
|
311
|
+
*/
|
|
312
|
+
endIcon?: import("svelte").Snippet<[]> | undefined;
|
|
313
|
+
/**
|
|
314
|
+
* - Chevron icon slot content.
|
|
315
|
+
*/
|
|
316
|
+
chevronIcon?: import("svelte").Snippet<[]> | undefined;
|
|
317
|
+
/**
|
|
318
|
+
* - Items slot content.
|
|
319
|
+
*/
|
|
320
|
+
items?: import("svelte").Snippet<[]> | undefined;
|
|
321
|
+
/**
|
|
322
|
+
* - Custom `Change` event handler.
|
|
323
|
+
*/
|
|
324
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
325
|
+
/**
|
|
326
|
+
* - Custom `Select` event handler.
|
|
327
|
+
*/
|
|
328
|
+
onSelect?: ((event: CustomEvent) => void) | undefined;
|
|
329
|
+
};
|
|
330
|
+
export type ComboboxProps = {
|
|
331
|
+
/**
|
|
332
|
+
* - The `class` attribute on the wrapper element.
|
|
333
|
+
*/
|
|
334
|
+
class?: string | undefined;
|
|
335
|
+
/**
|
|
336
|
+
* - Whether to hide the widget.
|
|
337
|
+
*/
|
|
338
|
+
hidden?: boolean | undefined;
|
|
339
|
+
/**
|
|
340
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
341
|
+
* attribute.
|
|
342
|
+
*/
|
|
343
|
+
disabled?: boolean | undefined;
|
|
344
|
+
/**
|
|
345
|
+
* - Whether to make the widget read-only. An alias of the
|
|
346
|
+
* `aria-readonly` attribute.
|
|
347
|
+
*/
|
|
348
|
+
readonly?: boolean | undefined;
|
|
349
|
+
/**
|
|
350
|
+
* - Whether to mark the widget required. An alias of the
|
|
351
|
+
* `aria-required` attribute.
|
|
352
|
+
*/
|
|
353
|
+
required?: boolean | undefined;
|
|
354
|
+
/**
|
|
355
|
+
* - Whether to mark the widget invalid. An alias of the
|
|
356
|
+
* `aria-invalid` attribute.
|
|
357
|
+
*/
|
|
358
|
+
invalid?: boolean | undefined;
|
|
359
|
+
/**
|
|
360
|
+
* - Selected option’s value.
|
|
361
|
+
*/
|
|
362
|
+
value?: string | undefined;
|
|
363
|
+
/**
|
|
364
|
+
* - Whether to make the `combobox` editable.
|
|
365
|
+
*/
|
|
366
|
+
editable?: boolean | undefined;
|
|
367
|
+
/**
|
|
368
|
+
* - Where to show the dropdown menu.
|
|
369
|
+
*/
|
|
370
|
+
position?: PopupPosition | undefined;
|
|
371
|
+
/**
|
|
372
|
+
* - Primary slot content.
|
|
373
|
+
*/
|
|
374
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
375
|
+
/**
|
|
376
|
+
* - Chevron icon slot content.
|
|
377
|
+
*/
|
|
378
|
+
chevronIcon?: import("svelte").Snippet<[]> | undefined;
|
|
379
|
+
/**
|
|
380
|
+
* - Custom `change` event handler.
|
|
381
|
+
*/
|
|
382
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
383
|
+
};
|
|
384
|
+
export type TextInputProps = {
|
|
385
|
+
/**
|
|
386
|
+
* - Input value.
|
|
387
|
+
*/
|
|
388
|
+
value?: string | undefined;
|
|
389
|
+
/**
|
|
390
|
+
* - Reference to the `<input>` element.
|
|
391
|
+
*/
|
|
392
|
+
element?: HTMLInputElement | undefined;
|
|
393
|
+
/**
|
|
394
|
+
* - The `role` attribute on
|
|
395
|
+
* the `<input>` element.
|
|
396
|
+
*/
|
|
397
|
+
role?: "textbox" | "searchbox" | "combobox" | "spinbutton" | undefined;
|
|
398
|
+
/**
|
|
399
|
+
* - Keyboard shortcuts. An alias of the
|
|
400
|
+
* `aria-keyshortcuts` attribute. Accepts the special `Accel` key, which will be replaced with
|
|
401
|
+
* `Control` or `Meta` depending on the user’s operating system.
|
|
402
|
+
*/
|
|
403
|
+
keyShortcuts?: string | undefined;
|
|
404
|
+
/**
|
|
405
|
+
* - The `name` attribute on the `<input>` element.
|
|
406
|
+
*/
|
|
407
|
+
name?: string | undefined;
|
|
408
|
+
/**
|
|
409
|
+
* - Whether to display `aria-label` over the `<input>`
|
|
410
|
+
* element if it’s empty, just like how the HTML `placeholder` attribute works.
|
|
411
|
+
*/
|
|
412
|
+
showInlineLabel?: boolean | undefined;
|
|
413
|
+
/**
|
|
414
|
+
* - The
|
|
415
|
+
* `inputmode` attribute on the `<input>`.
|
|
416
|
+
*/
|
|
417
|
+
inputmode?: "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url" | undefined;
|
|
418
|
+
/**
|
|
419
|
+
* - Make the text input container flexible.
|
|
420
|
+
*/
|
|
421
|
+
flex?: boolean | undefined;
|
|
422
|
+
/**
|
|
423
|
+
* - The `class` attribute on the wrapper element.
|
|
424
|
+
*/
|
|
425
|
+
class?: string | undefined;
|
|
426
|
+
/**
|
|
427
|
+
* - Whether to hide the widget.
|
|
428
|
+
*/
|
|
429
|
+
hidden?: boolean | undefined;
|
|
430
|
+
/**
|
|
431
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
432
|
+
* attribute.
|
|
433
|
+
*/
|
|
434
|
+
disabled?: boolean | undefined;
|
|
435
|
+
/**
|
|
436
|
+
* - Whether to make the widget read-only. An alias of the
|
|
437
|
+
* `aria-readonly` attribute.
|
|
438
|
+
*/
|
|
439
|
+
readonly?: boolean | undefined;
|
|
440
|
+
/**
|
|
441
|
+
* - Whether to mark the widget required. An alias of the
|
|
442
|
+
* `aria-required` attribute.
|
|
443
|
+
*/
|
|
444
|
+
required?: boolean | undefined;
|
|
445
|
+
/**
|
|
446
|
+
* - Whether to mark the widget invalid. An alias of the
|
|
447
|
+
* `aria-invalid` attribute.
|
|
448
|
+
*/
|
|
449
|
+
invalid?: boolean | undefined;
|
|
450
|
+
/**
|
|
451
|
+
* - `aria-label` attribute.
|
|
452
|
+
*/
|
|
453
|
+
"aria-label"?: string | undefined;
|
|
454
|
+
/**
|
|
455
|
+
* - Primary slot content.
|
|
456
|
+
*/
|
|
457
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
458
|
+
/**
|
|
459
|
+
* - Custom `Change` event handler.
|
|
460
|
+
*/
|
|
461
|
+
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
462
|
+
};
|
|
463
|
+
export type KeyboardEventHandlers = {
|
|
464
|
+
/**
|
|
465
|
+
* - `keydown` event handler.
|
|
466
|
+
*/
|
|
467
|
+
onkeydown?: ((event: KeyboardEvent) => void) | undefined;
|
|
468
|
+
/**
|
|
469
|
+
* - `keyup` event handler.
|
|
470
|
+
*/
|
|
471
|
+
onkeyup?: ((event: KeyboardEvent) => void) | undefined;
|
|
472
|
+
/**
|
|
473
|
+
* - `keypress` event handler.
|
|
474
|
+
*/
|
|
475
|
+
onkeypress?: ((event: KeyboardEvent) => void) | undefined;
|
|
476
|
+
};
|
|
477
|
+
export type MouseEventHandlers = {
|
|
478
|
+
/**
|
|
479
|
+
* - `mousedown` event handler.
|
|
480
|
+
*/
|
|
481
|
+
onmousedown?: ((event: MouseEvent) => void) | undefined;
|
|
482
|
+
/**
|
|
483
|
+
* - `mouseup` event handler.
|
|
484
|
+
*/
|
|
485
|
+
onmouseup?: ((event: MouseEvent) => void) | undefined;
|
|
486
|
+
/**
|
|
487
|
+
* - `click` event handler.
|
|
488
|
+
*/
|
|
489
|
+
onclick?: ((event: MouseEvent) => void) | undefined;
|
|
490
|
+
/**
|
|
491
|
+
* - `dblclick` event handler.
|
|
492
|
+
*/
|
|
493
|
+
ondblclick?: ((event: MouseEvent) => void) | undefined;
|
|
494
|
+
};
|
|
495
|
+
export type FocusEventHandlers = {
|
|
496
|
+
/**
|
|
497
|
+
* - `focus` event handler.
|
|
498
|
+
*/
|
|
499
|
+
onfocus?: ((event: FocusEvent) => void) | undefined;
|
|
500
|
+
/**
|
|
501
|
+
* - `blur` event handler.
|
|
502
|
+
*/
|
|
503
|
+
onblur?: ((event: FocusEvent) => void) | undefined;
|
|
504
|
+
};
|
|
505
|
+
export type DragEventHandlers = {
|
|
506
|
+
/**
|
|
507
|
+
* - `dragstart` event handler.
|
|
508
|
+
*/
|
|
509
|
+
ondragstart?: ((event: DragEvent) => void) | undefined;
|
|
510
|
+
/**
|
|
511
|
+
* - `drag` event handler.
|
|
512
|
+
*/
|
|
513
|
+
ondrag?: ((event: DragEvent) => void) | undefined;
|
|
514
|
+
/**
|
|
515
|
+
* - `dragenter` event handler.
|
|
516
|
+
*/
|
|
517
|
+
ondragenter?: ((event: DragEvent) => void) | undefined;
|
|
518
|
+
/**
|
|
519
|
+
* - `dragleave` event handler.
|
|
520
|
+
*/
|
|
521
|
+
ondragleave?: ((event: DragEvent) => void) | undefined;
|
|
522
|
+
/**
|
|
523
|
+
* - `dragover` event handler.
|
|
524
|
+
*/
|
|
525
|
+
ondragover?: ((event: DragEvent) => void) | undefined;
|
|
526
|
+
/**
|
|
527
|
+
* - `drop` event handler.
|
|
528
|
+
*/
|
|
529
|
+
ondrop?: ((event: DragEvent) => void) | undefined;
|
|
530
|
+
/**
|
|
531
|
+
* - `dragend` event handler.
|
|
532
|
+
*/
|
|
533
|
+
ondragend?: ((event: DragEvent) => void) | undefined;
|
|
534
|
+
};
|
|
535
|
+
export type CommonEventHandlers = KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers;
|
|
536
|
+
export type InputEventHandlers = {
|
|
537
|
+
/**
|
|
538
|
+
* - `input` event handler.
|
|
539
|
+
*/
|
|
540
|
+
oninput?: ((event: Event) => void) | undefined;
|
|
541
|
+
/**
|
|
542
|
+
* - `beforeinput` event handler.
|
|
543
|
+
*/
|
|
544
|
+
onbeforeinput?: ((event: Event) => void) | undefined;
|
|
545
|
+
};
|
|
1
546
|
export type PopupPosition = ("top-left" | "top-right" | "right-top" | "right-bottom" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom");
|
|
2
547
|
export type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
3
548
|
export type TextEditorBlockType = "paragraph" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "bulleted-list" | "numbered-list" | "blockquote";
|