@sveltia/ui 0.19.2 → 0.20.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.d.ts +18 -0
- package/package/components/button/button-group.svelte.d.ts +14 -0
- package/package/components/button/button.svelte.d.ts +4 -0
- package/package/components/button/select-button-group.svelte.d.ts +42 -0
- package/package/components/button/select-button.svelte.d.ts +11 -0
- package/package/components/button/split-button.svelte.d.ts +23 -0
- package/package/components/calendar/calendar.svelte.d.ts +10 -0
- package/package/components/checkbox/checkbox-group.svelte.d.ts +28 -0
- package/package/components/checkbox/checkbox.svelte +1 -0
- package/package/components/checkbox/checkbox.svelte.d.ts +37 -0
- package/package/components/dialog/alert-dialog.svelte.d.ts +4 -0
- package/package/components/dialog/confirmation-dialog.svelte.d.ts +4 -0
- package/package/components/dialog/dialog.svelte +8 -1
- package/package/components/dialog/dialog.svelte.d.ts +4 -0
- package/package/components/dialog/prompt-dialog.svelte.d.ts +22 -0
- package/package/components/disclosure/disclosure.svelte.d.ts +41 -0
- package/package/components/divider/divider.svelte.d.ts +20 -0
- package/package/components/divider/spacer.svelte.d.ts +14 -0
- package/package/components/drawer/drawer.svelte.d.ts +55 -0
- package/package/components/grid/grid-body.svelte.d.ts +18 -0
- package/package/components/grid/grid-cell.svelte.d.ts +14 -0
- package/package/components/grid/grid-col-header.svelte.d.ts +14 -0
- package/package/components/grid/grid-foot.svelte.d.ts +14 -0
- package/package/components/grid/grid-head.svelte.d.ts +14 -0
- package/package/components/grid/grid-row-header.svelte.d.ts +14 -0
- package/package/components/grid/grid-row.svelte.d.ts +27 -0
- package/package/components/grid/grid.svelte.d.ts +31 -0
- package/package/components/icon/icon.svelte.d.ts +14 -0
- package/package/components/listbox/listbox.svelte.d.ts +56 -0
- package/package/components/listbox/option-group.svelte.d.ts +28 -0
- package/package/components/listbox/option.svelte.d.ts +31 -0
- package/package/components/menu/menu-button.svelte.d.ts +13 -0
- package/package/components/menu/menu-item-checkbox.svelte.d.ts +4 -0
- package/package/components/menu/menu-item-group.svelte.d.ts +24 -0
- package/package/components/menu/menu-item-radio.svelte.d.ts +4 -0
- package/package/components/menu/menu-item.svelte.d.ts +4 -0
- package/package/components/menu/menu.svelte.d.ts +28 -0
- package/package/components/progressbar/progressbar.svelte +54 -0
- package/package/components/progressbar/progressbar.svelte.d.ts +53 -0
- package/package/components/radio/radio-group.svelte.d.ts +47 -0
- package/package/components/radio/radio.svelte +1 -0
- package/package/components/radio/radio.svelte.d.ts +52 -0
- package/package/components/select/combobox.svelte.d.ts +4 -0
- package/package/components/select/select-tags.svelte.d.ts +63 -0
- package/package/components/select/select.svelte.d.ts +4 -0
- package/package/components/slider/slider.svelte.d.ts +77 -0
- package/package/components/switch/switch.svelte.d.ts +46 -0
- package/package/components/table/table-body.svelte.d.ts +18 -0
- package/package/components/table/table-cell.svelte.d.ts +14 -0
- package/package/components/table/table-col-header.svelte.d.ts +14 -0
- package/package/components/table/table-foot.svelte.d.ts +14 -0
- package/package/components/table/table-head.svelte.d.ts +14 -0
- package/package/components/table/table-row-header.svelte.d.ts +14 -0
- package/package/components/table/table-row.svelte.d.ts +14 -0
- package/package/components/table/table.svelte.d.ts +14 -0
- package/package/components/tabs/tab-box.svelte.d.ts +19 -0
- package/package/components/tabs/tab-list.svelte.d.ts +36 -0
- package/package/components/tabs/tab-panel.svelte.d.ts +14 -0
- package/package/components/tabs/tab-panels.svelte.d.ts +14 -0
- package/package/components/tabs/tab.svelte.d.ts +11 -0
- package/package/components/text-editor/core.js +4 -1
- package/package/components/text-editor/lexical-root.svelte.d.ts +42 -0
- package/package/components/text-editor/text-editor.svelte.d.ts +54 -0
- package/package/components/text-editor/toolbar/editor-toolbar.svelte.d.ts +20 -0
- package/package/components/text-editor/toolbar/format-text-button.svelte.d.ts +10 -0
- package/package/components/text-editor/toolbar/insert-link-button.svelte +43 -33
- package/package/components/text-editor/toolbar/insert-link-button.svelte.d.ts +4 -0
- package/package/components/text-editor/toolbar/toggle-block-menu-item.svelte.d.ts +10 -0
- package/package/components/text-field/number-input.svelte.d.ts +27 -0
- package/package/components/text-field/password-input.svelte.d.ts +10 -0
- package/package/components/text-field/search-bar.svelte.d.ts +16 -0
- package/package/components/text-field/text-area.svelte.d.ts +55 -0
- package/package/components/text-field/text-input.svelte.d.ts +4 -0
- package/package/components/toast/toast.svelte.d.ts +28 -0
- package/package/components/toolbar/toolbar.svelte.d.ts +32 -0
- package/package/components/util/app-shell.svelte.d.ts +15 -0
- package/package/components/util/group.svelte.d.ts +23 -0
- package/package/components/util/modal.svelte.d.ts +6 -0
- package/package/components/util/placeholder.svelte.d.ts +10 -0
- package/package/components/util/popup.svelte.d.ts +49 -0
- package/package/index.d.ts +1 -0
- package/package/index.js +1 -0
- package/package.json +25 -25
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
import { LinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
|
|
3
3
|
import { $getNearestNodeOfType as getNearestNodeOfType } from '@lexical/utils';
|
|
4
4
|
import { generateElementId } from '@sveltia/utils/element';
|
|
5
|
-
import {
|
|
5
|
+
import { sleep } from '@sveltia/utils/misc';
|
|
6
6
|
import {
|
|
7
7
|
COMMAND_PRIORITY_NORMAL,
|
|
8
8
|
KEY_DOWN_COMMAND,
|
|
9
|
+
$createRangeSelection as createRangeSelection,
|
|
10
|
+
$createTextNode as createTextNode,
|
|
9
11
|
$getPreviousSelection as getPreviousSelection,
|
|
10
12
|
$getSelection as getSelection,
|
|
11
13
|
$getTextContent as getTextContent,
|
|
14
|
+
$insertNodes as insertNodes,
|
|
12
15
|
$isRangeSelection as isRangeSelection,
|
|
16
|
+
$setSelection as setSelection,
|
|
13
17
|
} from 'lexical';
|
|
14
18
|
import { getContext } from 'svelte';
|
|
15
19
|
import { _ } from 'svelte-i18n';
|
|
@@ -47,7 +51,7 @@
|
|
|
47
51
|
$editor.getEditorState().read(() => {
|
|
48
52
|
const textContent = getTextContent().trim();
|
|
49
53
|
|
|
50
|
-
anchorURL =
|
|
54
|
+
anchorURL = textContent;
|
|
51
55
|
hasAnchor = !!textContent;
|
|
52
56
|
dialogMode = 'create';
|
|
53
57
|
openDialog = true;
|
|
@@ -105,7 +109,7 @@
|
|
|
105
109
|
* @param {KeyboardEvent} event - `keydown` event.
|
|
106
110
|
*/
|
|
107
111
|
const onInputKeyDown = (event) => {
|
|
108
|
-
if (matchShortcuts(event, 'Enter') &&
|
|
112
|
+
if (matchShortcuts(event, 'Enter') && anchorURL) {
|
|
109
113
|
openDialog = false;
|
|
110
114
|
}
|
|
111
115
|
};
|
|
@@ -117,26 +121,34 @@
|
|
|
117
121
|
*/
|
|
118
122
|
const onDialogClose = async (event) => {
|
|
119
123
|
if (event.detail !== 'cancel' && dialogMode !== 'remove') {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
await new Promise((resolve) => {
|
|
125
|
+
$editor.update(async () => {
|
|
126
|
+
let selection = getSelection() ?? getPreviousSelection()?.clone();
|
|
123
127
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
128
|
+
if (!isRangeSelection(selection)) {
|
|
129
|
+
selection = createRangeSelection();
|
|
130
|
+
}
|
|
127
131
|
|
|
128
|
-
|
|
129
|
-
|
|
132
|
+
if (!hasAnchor) {
|
|
133
|
+
anchorText = anchorText.trim();
|
|
134
|
+
anchorText ||= anchorURL;
|
|
130
135
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
const { anchor, focus } = /** @type {import('lexical').RangeSelection} */ (selection);
|
|
137
|
+
const node = createTextNode(anchorText);
|
|
138
|
+
const key = node.getKey();
|
|
134
139
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
140
|
+
insertNodes([node]);
|
|
141
|
+
anchor.set(key, anchorText.length, 'text');
|
|
142
|
+
focus.set(key, 0, 'text');
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
setSelection(selection);
|
|
146
|
+
resolve(undefined);
|
|
138
147
|
});
|
|
139
|
-
}
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
// Wait a sec until the text is selected
|
|
151
|
+
await sleep(50);
|
|
140
152
|
|
|
141
153
|
$editor.dispatchCommand(TOGGLE_LINK_COMMAND, anchorURL);
|
|
142
154
|
}
|
|
@@ -191,18 +203,29 @@
|
|
|
191
203
|
: $_('_sui.text_editor.update_link')}
|
|
192
204
|
bind:open={openDialog}
|
|
193
205
|
bind:value={anchorURL}
|
|
194
|
-
okDisabled={!
|
|
206
|
+
okDisabled={!anchorURL}
|
|
195
207
|
okLabel={dialogMode === 'create' ? $_('_sui.insert') : $_('_sui.update')}
|
|
196
208
|
onClose={(event) => {
|
|
197
209
|
onDialogClose(event);
|
|
198
210
|
}}
|
|
199
211
|
>
|
|
212
|
+
<div role="none">
|
|
213
|
+
<label for="{id}-url">{$_('_sui.text_editor.url')}</label>
|
|
214
|
+
<TextInput
|
|
215
|
+
id="{id}-url"
|
|
216
|
+
bind:value={anchorURL}
|
|
217
|
+
flex
|
|
218
|
+
aria-label="URL"
|
|
219
|
+
onkeydown={(event) => {
|
|
220
|
+
onInputKeyDown(event);
|
|
221
|
+
}}
|
|
222
|
+
/>
|
|
223
|
+
</div>
|
|
200
224
|
{#if !hasAnchor}
|
|
201
225
|
<div role="none">
|
|
202
226
|
<label for="{id}-text">{$_('_sui.text_editor.text')}</label>
|
|
203
227
|
<TextInput
|
|
204
228
|
id="{id}-text"
|
|
205
|
-
autofocus
|
|
206
229
|
bind:value={anchorText}
|
|
207
230
|
flex
|
|
208
231
|
onkeydown={(event) => {
|
|
@@ -211,19 +234,6 @@
|
|
|
211
234
|
/>
|
|
212
235
|
</div>
|
|
213
236
|
{/if}
|
|
214
|
-
<div role="none">
|
|
215
|
-
<label for="{id}-url">{$_('_sui.text_editor.url')}</label>
|
|
216
|
-
<TextInput
|
|
217
|
-
id="{id}-url"
|
|
218
|
-
autofocus={hasAnchor || undefined}
|
|
219
|
-
bind:value={anchorURL}
|
|
220
|
-
flex
|
|
221
|
-
aria-label="URL"
|
|
222
|
-
onkeydown={(event) => {
|
|
223
|
-
onInputKeyDown(event);
|
|
224
|
-
}}
|
|
225
|
-
/>
|
|
226
|
-
</div>
|
|
227
237
|
{#snippet footerExtra()}
|
|
228
238
|
{#if dialogMode !== 'create'}
|
|
229
239
|
<Button
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export default InsertLinkButton;
|
|
2
|
+
type InsertLinkButton = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Record<string, never>>): void;
|
|
5
|
+
};
|
|
2
6
|
declare const InsertLinkButton: import("svelte").Component<Record<string, never>, {}, "">;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
export default ToggleBlockMenuItem;
|
|
2
|
+
type ToggleBlockMenuItem = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props & Record<string, any>>): void;
|
|
5
|
+
};
|
|
2
6
|
declare const ToggleBlockMenuItem: import("svelte").Component<{
|
|
3
7
|
/**
|
|
4
8
|
* - Button type.
|
|
5
9
|
*/
|
|
6
10
|
type: import("../../../typedefs").TextEditorBlockType;
|
|
7
11
|
} & Record<string, any>, {}, "">;
|
|
12
|
+
type Props = {
|
|
13
|
+
/**
|
|
14
|
+
* - Button type.
|
|
15
|
+
*/
|
|
16
|
+
type: import("../../../typedefs").TextEditorBlockType;
|
|
17
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export default NumberInput;
|
|
2
|
+
type NumberInput = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<TextInputProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & InputEventHandlers & Props & Record<string, any>>): void;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* The equivalent of the HTML `<input type="number">` element.
|
|
4
8
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number
|
|
@@ -27,3 +31,26 @@ declare const NumberInput: import("svelte").Component<import("../../typedefs").T
|
|
|
27
31
|
*/
|
|
28
32
|
decreaseIcon?: import("svelte").Snippet<[]> | undefined;
|
|
29
33
|
} & Record<string, any>, {}, "invalid" | "value">;
|
|
34
|
+
type Props = {
|
|
35
|
+
/**
|
|
36
|
+
* - Minimum allowed value.
|
|
37
|
+
*/
|
|
38
|
+
min?: number | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* - Maximum allowed value.
|
|
41
|
+
*/
|
|
42
|
+
max?: number | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* - Value to be added or removed when using the up/down arrow key or
|
|
45
|
+
* button.
|
|
46
|
+
*/
|
|
47
|
+
step?: number | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* - Increase icon slot content.
|
|
50
|
+
*/
|
|
51
|
+
increaseIcon?: import("svelte").Snippet<[]> | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* - Decrease icon slot content.
|
|
54
|
+
*/
|
|
55
|
+
decreaseIcon?: import("svelte").Snippet<[]> | undefined;
|
|
56
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export default PasswordInput;
|
|
2
|
+
type PasswordInput = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<TextInputProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & InputEventHandlers & Props & Record<string, any>>): void;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* The equivalent of the HTML `<input type="password">` element, but it comes with the Show/Hide
|
|
4
8
|
* button.
|
|
@@ -11,3 +15,9 @@ declare const PasswordInput: import("svelte").Component<import("../../typedefs")
|
|
|
11
15
|
*/
|
|
12
16
|
visibilityIcon?: import("svelte").Snippet<[]> | undefined;
|
|
13
17
|
} & Record<string, any>, {}, "value">;
|
|
18
|
+
type Props = {
|
|
19
|
+
/**
|
|
20
|
+
* - Visibility icon slot content.
|
|
21
|
+
*/
|
|
22
|
+
visibilityIcon?: import("svelte").Snippet<[]> | undefined;
|
|
23
|
+
};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export default SearchBar;
|
|
2
|
+
type SearchBar = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<TextInputProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & InputEventHandlers & Props & Record<string, any>>): void;
|
|
5
|
+
} & {
|
|
6
|
+
focus: () => void;
|
|
7
|
+
};
|
|
2
8
|
/**
|
|
3
9
|
* The equivalent of the HTML `<input type="search">` element. It comes with a magnifier icon and
|
|
4
10
|
* clear button.
|
|
@@ -17,3 +23,13 @@ declare const SearchBar: import("svelte").Component<import("../../typedefs").Tex
|
|
|
17
23
|
} & Record<string, any>, {
|
|
18
24
|
focus: () => void;
|
|
19
25
|
}, "value">;
|
|
26
|
+
type Props = {
|
|
27
|
+
/**
|
|
28
|
+
* - Search icon slot content.
|
|
29
|
+
*/
|
|
30
|
+
searchIcon?: import("svelte").Snippet<[]> | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* - Close icon slot content.
|
|
33
|
+
*/
|
|
34
|
+
closeIcon?: import("svelte").Snippet<[]> | undefined;
|
|
35
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export default TextArea;
|
|
2
|
+
type TextArea = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & InputEventHandlers & Props & Record<string, any>>): void;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* A multi-line text field based on the HTML `<textarea>` element, providing the auto-resize support.
|
|
4
8
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
|
|
@@ -56,3 +60,54 @@ declare const TextArea: import("svelte").Component<import("../../typedefs").Keyb
|
|
|
56
60
|
*/
|
|
57
61
|
children?: import("svelte").Snippet<[]> | undefined;
|
|
58
62
|
} & Record<string, any>, {}, "value">;
|
|
63
|
+
type Props = {
|
|
64
|
+
/**
|
|
65
|
+
* - Input value.
|
|
66
|
+
*/
|
|
67
|
+
value?: string | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* - Make the text input container flexible.
|
|
70
|
+
*/
|
|
71
|
+
flex?: boolean | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* - The `name` attribute on the `<textarea>` element.
|
|
74
|
+
*/
|
|
75
|
+
name?: string | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* - Whether to automatically resize the `<textarea>` based on
|
|
78
|
+
* the content.
|
|
79
|
+
*/
|
|
80
|
+
autoResize?: boolean | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* - The `class` attribute on the wrapper element.
|
|
83
|
+
*/
|
|
84
|
+
class?: string | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* - Whether to hide the widget.
|
|
87
|
+
*/
|
|
88
|
+
hidden?: boolean | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
91
|
+
* attribute.
|
|
92
|
+
*/
|
|
93
|
+
disabled?: boolean | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* - Whether to make the widget read-only. An alias of the
|
|
96
|
+
* `aria-readonly` attribute.
|
|
97
|
+
*/
|
|
98
|
+
readonly?: boolean | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* - Whether to mark the widget required. An alias of the
|
|
101
|
+
* `aria-required` attribute.
|
|
102
|
+
*/
|
|
103
|
+
required?: boolean | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* - Whether to mark the widget invalid. An alias of the
|
|
106
|
+
* `aria-invalid` attribute.
|
|
107
|
+
*/
|
|
108
|
+
invalid?: boolean | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* - Primary slot content.
|
|
111
|
+
*/
|
|
112
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
113
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export default TextInput;
|
|
2
|
+
type TextInput = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<TextInputProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & InputEventHandlers & Record<string, any>>): void;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* A generic, single-line text field. The equivalent of the HTML `<input type="text">` element.
|
|
4
8
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export default Toast;
|
|
2
|
+
type Toast = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props & Record<string, any>>): void;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* Toast/snackbar notification. Use the Popover API if possible to acquire a non-modal top layer.
|
|
4
8
|
* @see https://w3c.github.io/aria/#alert
|
|
@@ -28,3 +32,27 @@ declare const Toast: import("svelte").Component<{
|
|
|
28
32
|
*/
|
|
29
33
|
children?: import("svelte").Snippet<[]> | undefined;
|
|
30
34
|
} & Record<string, any>, {}, "show">;
|
|
35
|
+
type Props = {
|
|
36
|
+
/**
|
|
37
|
+
* - The toast ID. If updated, the timer that hides
|
|
38
|
+
* the toast will be reset, meaning the same toast can be displayed for a longer period of time.
|
|
39
|
+
*/
|
|
40
|
+
id?: string | number | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* - Whether to show the toast.
|
|
43
|
+
*/
|
|
44
|
+
show?: boolean | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* - Duration to automatically hide the toast. Use `0` to hide it
|
|
47
|
+
* manually from the consumer.
|
|
48
|
+
*/
|
|
49
|
+
duration?: number | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* - Position of the toast.
|
|
52
|
+
*/
|
|
53
|
+
position?: import("../../typedefs").ToastPosition | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* - Primary slot content.
|
|
56
|
+
*/
|
|
57
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
58
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export default Toolbar;
|
|
2
|
+
type Toolbar = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props & Record<string, any>>): void;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* A toolbar layout that can contain `<Button>`, `<Select>` and other widgets.
|
|
4
8
|
* @see https://w3c.github.io/aria/#toolbar
|
|
@@ -32,3 +36,31 @@ declare const Toolbar: import("svelte").Component<{
|
|
|
32
36
|
*/
|
|
33
37
|
children?: import("svelte").Snippet<[]> | undefined;
|
|
34
38
|
} & Record<string, any>, {}, "">;
|
|
39
|
+
type Props = {
|
|
40
|
+
/**
|
|
41
|
+
* - The `class` attribute on the wrapper element.
|
|
42
|
+
*/
|
|
43
|
+
class?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* - Whether to hide the widget.
|
|
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
|
+
* - Orientation of the widget. An alias of
|
|
55
|
+
* the `aria-orientation` attribute.
|
|
56
|
+
*/
|
|
57
|
+
orientation?: "vertical" | "horizontal" | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* - The style variant of the toolbar.
|
|
60
|
+
*/
|
|
61
|
+
variant?: "primary" | "secondary" | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* - Primary slot content.
|
|
64
|
+
*/
|
|
65
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
66
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export default AppShell;
|
|
2
|
+
type AppShell = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props & Record<string, any>>): void;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* Provide an application’s shell that makes the web app more like a native app. It also handles the
|
|
4
8
|
* dark/light mode switching. This component has to be placed directly under `<body>` (or
|
|
@@ -15,3 +19,14 @@ declare const AppShell: import("svelte").Component<{
|
|
|
15
19
|
*/
|
|
16
20
|
children?: import("svelte").Snippet<[]> | undefined;
|
|
17
21
|
} & Record<string, any>, {}, "">;
|
|
22
|
+
type Props = {
|
|
23
|
+
/**
|
|
24
|
+
* - Orientation of the app
|
|
25
|
+
* shell’s children..
|
|
26
|
+
*/
|
|
27
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* - Primary slot content.
|
|
30
|
+
*/
|
|
31
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
32
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export default Group;
|
|
2
|
+
type Group = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props & Record<string, any>>): void;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* A generic group layout.
|
|
4
8
|
* @see https://w3c.github.io/aria/#group
|
|
@@ -22,3 +26,22 @@ declare const Group: import("svelte").Component<{
|
|
|
22
26
|
*/
|
|
23
27
|
children?: import("svelte").Snippet<[]> | undefined;
|
|
24
28
|
} & Record<string, any>, {}, "">;
|
|
29
|
+
type Props = {
|
|
30
|
+
/**
|
|
31
|
+
* - The `class` attribute on the wrapper element.
|
|
32
|
+
*/
|
|
33
|
+
class?: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* - Whether to hide the widget.
|
|
36
|
+
*/
|
|
37
|
+
hidden?: boolean | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* - Whether to disable the widget. An alias of the `aria-disabled`
|
|
40
|
+
* attribute.
|
|
41
|
+
*/
|
|
42
|
+
disabled?: boolean | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* - Primary slot content.
|
|
45
|
+
*/
|
|
46
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
47
|
+
};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export default Modal;
|
|
2
|
+
type Modal = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<ModalProps & Record<string, any>>): void;
|
|
5
|
+
} & {
|
|
6
|
+
close: (returnValue: string) => void;
|
|
7
|
+
};
|
|
2
8
|
/** A generic modal top-layer helper based on the HTML `<dialog>` element. */
|
|
3
9
|
declare const Modal: import("svelte").Component<import("../../typedefs").ModalProps & Record<string, any>, {
|
|
4
10
|
close: (returnValue: string) => void;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export default Placeholder;
|
|
2
|
+
type Placeholder = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props & Record<string, any>>): void;
|
|
5
|
+
};
|
|
2
6
|
/** @see https://github.com/sveltejs/svelte/issues/3088 */
|
|
3
7
|
declare const Placeholder: import("svelte").Component<{
|
|
4
8
|
/**
|
|
@@ -6,3 +10,9 @@ declare const Placeholder: import("svelte").Component<{
|
|
|
6
10
|
*/
|
|
7
11
|
children?: import("svelte").Snippet<[]> | undefined;
|
|
8
12
|
} & Record<string, any>, {}, "">;
|
|
13
|
+
type Props = {
|
|
14
|
+
/**
|
|
15
|
+
* - Primary slot content.
|
|
16
|
+
*/
|
|
17
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
18
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export default Popup;
|
|
2
|
+
type Popup = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<ModalProps & Props & Record<string, any>>): void;
|
|
5
|
+
};
|
|
2
6
|
/** Generic popup helper. */
|
|
3
7
|
declare const Popup: import("svelte").Component<import("../../typedefs").ModalProps & {
|
|
4
8
|
/**
|
|
@@ -45,3 +49,48 @@ declare const Popup: import("svelte").Component<import("../../typedefs").ModalPr
|
|
|
45
49
|
*/
|
|
46
50
|
onOpen?: ((event: CustomEvent) => void) | undefined;
|
|
47
51
|
} & Record<string, any>, {}, "open" | "content">;
|
|
52
|
+
type Props = {
|
|
53
|
+
/**
|
|
54
|
+
* - The `class` attribute on the content element.
|
|
55
|
+
*/
|
|
56
|
+
class?: string | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* - Whether to open the popup.
|
|
59
|
+
*/
|
|
60
|
+
open?: boolean | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* - A reference to the anchor element that opens the popup.
|
|
63
|
+
* Typically a `<button>`.
|
|
64
|
+
*/
|
|
65
|
+
anchor?: HTMLElement | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* - A reference to the content element.
|
|
68
|
+
*/
|
|
69
|
+
content?: HTMLElement | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* - Where to show the popup.
|
|
72
|
+
*/
|
|
73
|
+
position?: import("../../typedefs").PopupPosition | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* - The base element of
|
|
76
|
+
* {@link position}. If omitted, this will be {@link anchor}.
|
|
77
|
+
*/
|
|
78
|
+
positionBaseElement?: HTMLElement | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* - Whether to show the popup at the center of the screen on
|
|
81
|
+
* mobile/tablet and ignore the defined dropdown `position`.
|
|
82
|
+
*/
|
|
83
|
+
touchOptimized?: boolean | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* - Primary slot content.
|
|
86
|
+
*/
|
|
87
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* - Extra slot content.
|
|
90
|
+
*/
|
|
91
|
+
extraContent?: import("svelte").Snippet<[]> | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* - Custom `Open` event handler.
|
|
94
|
+
*/
|
|
95
|
+
onOpen?: ((event: CustomEvent) => void) | undefined;
|
|
96
|
+
};
|
package/package/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export { default as MenuItemGroup } from "./components/menu/menu-item-group.svel
|
|
|
37
37
|
export { default as MenuItemRadio } from "./components/menu/menu-item-radio.svelte";
|
|
38
38
|
export { default as MenuItem } from "./components/menu/menu-item.svelte";
|
|
39
39
|
export { default as Menu } from "./components/menu/menu.svelte";
|
|
40
|
+
export { default as Progressbar } from "./components/progressbar/progressbar.svelte";
|
|
40
41
|
export { default as RadioGroup } from "./components/radio/radio-group.svelte";
|
|
41
42
|
export { default as Radio } from "./components/radio/radio.svelte";
|
|
42
43
|
export { default as Combobox } from "./components/select/combobox.svelte";
|
package/package/index.js
CHANGED
|
@@ -62,6 +62,7 @@ export { default as MenuItemGroup } from './components/menu/menu-item-group.svel
|
|
|
62
62
|
export { default as MenuItemRadio } from './components/menu/menu-item-radio.svelte';
|
|
63
63
|
export { default as MenuItem } from './components/menu/menu-item.svelte';
|
|
64
64
|
export { default as Menu } from './components/menu/menu.svelte';
|
|
65
|
+
export { default as Progressbar } from './components/progressbar/progressbar.svelte';
|
|
65
66
|
export { default as RadioGroup } from './components/radio/radio-group.svelte';
|
|
66
67
|
export { default as Radio } from './components/radio/radio.svelte';
|
|
67
68
|
export { default as Combobox } from './components/select/combobox.svelte';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltia/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -28,50 +28,50 @@
|
|
|
28
28
|
"test:unit": "vitest"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@lexical/code": "^0.
|
|
32
|
-
"@lexical/dragon": "^0.
|
|
33
|
-
"@lexical/history": "^0.
|
|
34
|
-
"@lexical/link": "^0.
|
|
35
|
-
"@lexical/list": "^0.
|
|
36
|
-
"@lexical/markdown": "^0.
|
|
37
|
-
"@lexical/rich-text": "^0.
|
|
38
|
-
"@lexical/selection": "^0.
|
|
39
|
-
"@lexical/table": "^0.
|
|
40
|
-
"@lexical/utils": "^0.
|
|
31
|
+
"@lexical/code": "^0.20.0",
|
|
32
|
+
"@lexical/dragon": "^0.20.0",
|
|
33
|
+
"@lexical/history": "^0.20.0",
|
|
34
|
+
"@lexical/link": "^0.20.0",
|
|
35
|
+
"@lexical/list": "^0.20.0",
|
|
36
|
+
"@lexical/markdown": "^0.20.0",
|
|
37
|
+
"@lexical/rich-text": "^0.20.0",
|
|
38
|
+
"@lexical/selection": "^0.20.0",
|
|
39
|
+
"@lexical/table": "^0.20.0",
|
|
40
|
+
"@lexical/utils": "^0.20.0",
|
|
41
41
|
"@sveltia/utils": "^0.5.0",
|
|
42
|
-
"lexical": "^0.
|
|
42
|
+
"lexical": "^0.20.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"svelte": "^5.0.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@playwright/test": "^1.48.
|
|
49
|
-
"@sveltejs/adapter-auto": "^3.3.
|
|
50
|
-
"@sveltejs/kit": "^2.
|
|
51
|
-
"@sveltejs/package": "^2.3.
|
|
48
|
+
"@playwright/test": "^1.48.2",
|
|
49
|
+
"@sveltejs/adapter-auto": "^3.3.1",
|
|
50
|
+
"@sveltejs/kit": "^2.8.0",
|
|
51
|
+
"@sveltejs/package": "^2.3.7",
|
|
52
52
|
"@sveltejs/vite-plugin-svelte": "4.0.0",
|
|
53
|
-
"cspell": "^8.
|
|
53
|
+
"cspell": "^8.16.0",
|
|
54
54
|
"eslint": "^8.57.1",
|
|
55
55
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
56
56
|
"eslint-config-prettier": "^9.1.0",
|
|
57
57
|
"eslint-plugin-import": "^2.31.0",
|
|
58
58
|
"eslint-plugin-jsdoc": "^50.4.3",
|
|
59
59
|
"eslint-plugin-svelte": "^2.46.0",
|
|
60
|
-
"postcss": "^8.4.
|
|
60
|
+
"postcss": "^8.4.49",
|
|
61
61
|
"postcss-html": "^1.7.0",
|
|
62
62
|
"prettier": "^3.3.3",
|
|
63
|
-
"prettier-plugin-svelte": "^3.2.
|
|
64
|
-
"sass": "^1.80.
|
|
63
|
+
"prettier-plugin-svelte": "^3.2.8",
|
|
64
|
+
"sass": "^1.80.6",
|
|
65
65
|
"stylelint": "^16.10.0",
|
|
66
66
|
"stylelint-config-recommended-scss": "^14.1.0",
|
|
67
67
|
"stylelint-scss": "^6.8.1",
|
|
68
|
-
"svelte": "5.
|
|
69
|
-
"svelte-check": "^4.0.
|
|
68
|
+
"svelte": "5.1.15",
|
|
69
|
+
"svelte-check": "^4.0.7",
|
|
70
70
|
"svelte-i18n": "^4.0.1",
|
|
71
71
|
"svelte-preprocess": "^6.0.3",
|
|
72
|
-
"tslib": "^2.8.
|
|
73
|
-
"vite": "^5.4.
|
|
74
|
-
"vitest": "^2.1.
|
|
72
|
+
"tslib": "^2.8.1",
|
|
73
|
+
"vite": "^5.4.11",
|
|
74
|
+
"vitest": "^2.1.4"
|
|
75
75
|
},
|
|
76
76
|
"exports": {
|
|
77
77
|
".": {
|