@sveltia/ui 0.20.2 → 0.22.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 → dist}/components/button/button.svelte +1 -1
- package/{package → dist}/components/button/select-button-group.svelte +3 -0
- package/{package → dist}/components/calendar/calendar.svelte +1 -1
- package/{package → dist}/components/checkbox/checkbox.svelte +9 -2
- package/{package → dist}/components/grid/grid.svelte +1 -1
- package/{package → dist}/components/listbox/listbox.svelte +3 -0
- package/{package → dist}/components/menu/menu-button.svelte +1 -1
- package/{package → dist}/components/progressbar/progressbar.svelte +4 -1
- package/{package → dist}/components/radio/radio-group.svelte +9 -0
- package/{package → dist}/components/radio/radio.svelte +3 -3
- package/{package → dist}/components/select/combobox.svelte +6 -2
- package/{package → dist}/components/select/select-tags.svelte +1 -1
- package/{package → dist}/components/slider/slider.svelte +14 -7
- package/{package → dist}/components/switch/switch.svelte +4 -1
- package/{package → dist}/components/tabs/tab-list.svelte +1 -1
- package/{package → dist}/components/text-editor/core.d.ts +3 -1
- package/{package → dist}/components/text-editor/core.js +113 -19
- package/{package → dist}/components/text-editor/index.js +6 -0
- package/dist/components/text-editor/lexical-root.svelte +288 -0
- package/{package → dist}/components/text-editor/text-editor.svelte +18 -9
- package/{package → dist}/components/text-editor/text-editor.svelte.d.ts +8 -0
- package/{package → dist}/components/text-editor/toolbar/editor-toolbar.svelte +15 -0
- package/dist/components/text-editor/toolbar/insert-image-button.svelte +43 -0
- package/dist/components/text-editor/toolbar/insert-image-button.svelte.d.ts +17 -0
- package/dist/components/text-editor/toolbar/insert-menu-button.svelte +53 -0
- package/dist/components/text-editor/toolbar/insert-menu-button.svelte.d.ts +17 -0
- package/{package → dist}/components/text-editor/toolbar/toggle-block-menu-item.svelte +7 -0
- package/{package → dist}/components/text-field/number-input.svelte +31 -16
- package/{package → dist}/components/text-field/number-input.svelte.d.ts +8 -0
- package/{package → dist}/components/text-field/password-input.svelte +1 -0
- package/{package → dist}/components/text-field/password-input.svelte.d.ts +8 -0
- package/{package → dist}/components/text-field/search-bar.svelte +1 -0
- package/{package → dist}/components/text-field/search-bar.svelte.d.ts +8 -0
- package/{package → dist}/components/text-field/text-area.svelte +4 -4
- package/{package → dist}/components/text-field/text-input.svelte +7 -2
- package/{package → dist}/components/text-field/text-input.svelte.d.ts +13 -2
- package/{package → dist}/components/toast/toast.svelte +1 -1
- package/{package → dist}/components/toolbar/toolbar.svelte +2 -2
- package/{package → dist}/components/util/app-shell.svelte +6 -6
- package/{package → dist}/components/util/app-shell.svelte.d.ts +2 -2
- package/{package → dist}/components/util/popup.svelte +2 -2
- package/{package → dist}/locales/en.d.ts +1 -0
- package/{package → dist}/locales/en.js +1 -0
- package/{package → dist}/locales/ja.d.ts +1 -0
- package/{package → dist}/locales/ja.js +1 -0
- package/{package → dist}/styles/variables.scss +2 -2
- package/{package → dist}/typedefs.d.ts +32 -5
- package/{package → dist}/typedefs.js +26 -14
- package/package.json +20 -19
- package/package/components/text-editor/lexical-root.svelte +0 -156
- /package/{package → dist}/components/alert/alert.svelte +0 -0
- /package/{package → dist}/components/alert/alert.svelte.d.ts +0 -0
- /package/{package → dist}/components/button/button-group.svelte +0 -0
- /package/{package → dist}/components/button/button-group.svelte.d.ts +0 -0
- /package/{package → dist}/components/button/button.svelte.d.ts +0 -0
- /package/{package → dist}/components/button/select-button-group.svelte.d.ts +0 -0
- /package/{package → dist}/components/button/select-button.svelte +0 -0
- /package/{package → dist}/components/button/select-button.svelte.d.ts +0 -0
- /package/{package → dist}/components/button/split-button.svelte +0 -0
- /package/{package → dist}/components/button/split-button.svelte.d.ts +0 -0
- /package/{package → dist}/components/calendar/calendar.svelte.d.ts +0 -0
- /package/{package → dist}/components/checkbox/checkbox-group.svelte +0 -0
- /package/{package → dist}/components/checkbox/checkbox-group.svelte.d.ts +0 -0
- /package/{package → dist}/components/checkbox/checkbox.svelte.d.ts +0 -0
- /package/{package → dist}/components/dialog/alert-dialog.svelte +0 -0
- /package/{package → dist}/components/dialog/alert-dialog.svelte.d.ts +0 -0
- /package/{package → dist}/components/dialog/confirmation-dialog.svelte +0 -0
- /package/{package → dist}/components/dialog/confirmation-dialog.svelte.d.ts +0 -0
- /package/{package → dist}/components/dialog/dialog.svelte +0 -0
- /package/{package → dist}/components/dialog/dialog.svelte.d.ts +0 -0
- /package/{package → dist}/components/dialog/prompt-dialog.svelte +0 -0
- /package/{package → dist}/components/dialog/prompt-dialog.svelte.d.ts +0 -0
- /package/{package → dist}/components/disclosure/disclosure.svelte +0 -0
- /package/{package → dist}/components/disclosure/disclosure.svelte.d.ts +0 -0
- /package/{package → dist}/components/divider/divider.svelte +0 -0
- /package/{package → dist}/components/divider/divider.svelte.d.ts +0 -0
- /package/{package → dist}/components/divider/spacer.svelte +0 -0
- /package/{package → dist}/components/divider/spacer.svelte.d.ts +0 -0
- /package/{package → dist}/components/drawer/drawer.svelte +0 -0
- /package/{package → dist}/components/drawer/drawer.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-body.svelte +0 -0
- /package/{package → dist}/components/grid/grid-body.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-cell.svelte +0 -0
- /package/{package → dist}/components/grid/grid-cell.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-col-header.svelte +0 -0
- /package/{package → dist}/components/grid/grid-col-header.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-foot.svelte +0 -0
- /package/{package → dist}/components/grid/grid-foot.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-head.svelte +0 -0
- /package/{package → dist}/components/grid/grid-head.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-row-header.svelte +0 -0
- /package/{package → dist}/components/grid/grid-row-header.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid-row.svelte +0 -0
- /package/{package → dist}/components/grid/grid-row.svelte.d.ts +0 -0
- /package/{package → dist}/components/grid/grid.svelte.d.ts +0 -0
- /package/{package → dist}/components/icon/icon.svelte +0 -0
- /package/{package → dist}/components/icon/icon.svelte.d.ts +0 -0
- /package/{package → dist}/components/listbox/listbox.svelte.d.ts +0 -0
- /package/{package → dist}/components/listbox/option-group.svelte +0 -0
- /package/{package → dist}/components/listbox/option-group.svelte.d.ts +0 -0
- /package/{package → dist}/components/listbox/option.svelte +0 -0
- /package/{package → dist}/components/listbox/option.svelte.d.ts +0 -0
- /package/{package → dist}/components/menu/menu-button.svelte.d.ts +0 -0
- /package/{package → dist}/components/menu/menu-item-checkbox.svelte +0 -0
- /package/{package → dist}/components/menu/menu-item-checkbox.svelte.d.ts +0 -0
- /package/{package → dist}/components/menu/menu-item-group.svelte +0 -0
- /package/{package → dist}/components/menu/menu-item-group.svelte.d.ts +0 -0
- /package/{package → dist}/components/menu/menu-item-radio.svelte +0 -0
- /package/{package → dist}/components/menu/menu-item-radio.svelte.d.ts +0 -0
- /package/{package → dist}/components/menu/menu-item.svelte +0 -0
- /package/{package → dist}/components/menu/menu-item.svelte.d.ts +0 -0
- /package/{package → dist}/components/menu/menu.svelte +0 -0
- /package/{package → dist}/components/menu/menu.svelte.d.ts +0 -0
- /package/{package → dist}/components/progressbar/progressbar.svelte.d.ts +0 -0
- /package/{package → dist}/components/radio/radio-group.svelte.d.ts +0 -0
- /package/{package → dist}/components/radio/radio.svelte.d.ts +0 -0
- /package/{package → dist}/components/select/combobox.svelte.d.ts +0 -0
- /package/{package → dist}/components/select/select-tags.svelte.d.ts +0 -0
- /package/{package → dist}/components/select/select.svelte +0 -0
- /package/{package → dist}/components/select/select.svelte.d.ts +0 -0
- /package/{package → dist}/components/slider/slider.svelte.d.ts +0 -0
- /package/{package → dist}/components/switch/switch.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-body.svelte +0 -0
- /package/{package → dist}/components/table/table-body.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-cell.svelte +0 -0
- /package/{package → dist}/components/table/table-cell.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-col-header.svelte +0 -0
- /package/{package → dist}/components/table/table-col-header.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-foot.svelte +0 -0
- /package/{package → dist}/components/table/table-foot.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-head.svelte +0 -0
- /package/{package → dist}/components/table/table-head.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-row-header.svelte +0 -0
- /package/{package → dist}/components/table/table-row-header.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table-row.svelte +0 -0
- /package/{package → dist}/components/table/table-row.svelte.d.ts +0 -0
- /package/{package → dist}/components/table/table.svelte +0 -0
- /package/{package → dist}/components/table/table.svelte.d.ts +0 -0
- /package/{package → dist}/components/tabs/tab-box.svelte +0 -0
- /package/{package → dist}/components/tabs/tab-box.svelte.d.ts +0 -0
- /package/{package → dist}/components/tabs/tab-list.svelte.d.ts +0 -0
- /package/{package → dist}/components/tabs/tab-panel.svelte +0 -0
- /package/{package → dist}/components/tabs/tab-panel.svelte.d.ts +0 -0
- /package/{package → dist}/components/tabs/tab-panels.svelte +0 -0
- /package/{package → dist}/components/tabs/tab-panels.svelte.d.ts +0 -0
- /package/{package → dist}/components/tabs/tab.svelte +0 -0
- /package/{package → dist}/components/tabs/tab.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-editor/index.d.ts +0 -0
- /package/{package → dist}/components/text-editor/lexical-root.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-editor/toolbar/editor-toolbar.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-editor/toolbar/format-text-button.svelte +0 -0
- /package/{package → dist}/components/text-editor/toolbar/format-text-button.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-editor/toolbar/insert-link-button.svelte +0 -0
- /package/{package → dist}/components/text-editor/toolbar/insert-link-button.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-editor/toolbar/toggle-block-menu-item.svelte.d.ts +0 -0
- /package/{package → dist}/components/text-field/text-area.svelte.d.ts +0 -0
- /package/{package → dist}/components/toast/toast.svelte.d.ts +0 -0
- /package/{package → dist}/components/toolbar/toolbar.svelte.d.ts +0 -0
- /package/{package → dist}/components/util/group.svelte +0 -0
- /package/{package → dist}/components/util/group.svelte.d.ts +0 -0
- /package/{package → dist}/components/util/modal.svelte +0 -0
- /package/{package → dist}/components/util/modal.svelte.d.ts +0 -0
- /package/{package → dist}/components/util/placeholder.svelte +0 -0
- /package/{package → dist}/components/util/placeholder.svelte.d.ts +0 -0
- /package/{package → dist}/components/util/popup.svelte.d.ts +0 -0
- /package/{package → dist}/index.d.ts +0 -0
- /package/{package → dist}/index.js +0 -0
- /package/{package → dist}/services/events.svelte.d.ts +0 -0
- /package/{package → dist}/services/events.svelte.js +0 -0
- /package/{package → dist}/services/group.svelte.d.ts +0 -0
- /package/{package → dist}/services/group.svelte.js +0 -0
- /package/{package → dist}/services/popup.svelte.d.ts +0 -0
- /package/{package → dist}/services/popup.svelte.js +0 -0
- /package/{package → dist}/styles/core.scss +0 -0
|
@@ -9,6 +9,10 @@ type NumberInput = {
|
|
|
9
9
|
* @see https://w3c.github.io/aria/#textbox
|
|
10
10
|
*/
|
|
11
11
|
declare const NumberInput: import("svelte").Component<import("../../typedefs").TextInputProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & import("../../typedefs").InputEventHandlers & {
|
|
12
|
+
/**
|
|
13
|
+
* - Input value.
|
|
14
|
+
*/
|
|
15
|
+
value?: number | undefined;
|
|
12
16
|
/**
|
|
13
17
|
* - Minimum allowed value.
|
|
14
18
|
*/
|
|
@@ -32,6 +36,10 @@ declare const NumberInput: import("svelte").Component<import("../../typedefs").T
|
|
|
32
36
|
decreaseIcon?: import("svelte").Snippet<[]> | undefined;
|
|
33
37
|
} & Record<string, any>, {}, "invalid" | "value">;
|
|
34
38
|
type Props = {
|
|
39
|
+
/**
|
|
40
|
+
* - Input value.
|
|
41
|
+
*/
|
|
42
|
+
value?: number | undefined;
|
|
35
43
|
/**
|
|
36
44
|
* - Minimum allowed value.
|
|
37
45
|
*/
|
|
@@ -10,12 +10,20 @@ type PasswordInput = {
|
|
|
10
10
|
* @see https://w3c.github.io/aria/#textbox
|
|
11
11
|
*/
|
|
12
12
|
declare const PasswordInput: import("svelte").Component<import("../../typedefs").TextInputProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & import("../../typedefs").InputEventHandlers & {
|
|
13
|
+
/**
|
|
14
|
+
* - Input value.
|
|
15
|
+
*/
|
|
16
|
+
value?: string | undefined;
|
|
13
17
|
/**
|
|
14
18
|
* - Visibility icon slot content.
|
|
15
19
|
*/
|
|
16
20
|
visibilityIcon?: import("svelte").Snippet<[]> | undefined;
|
|
17
21
|
} & Record<string, any>, {}, "value">;
|
|
18
22
|
type Props = {
|
|
23
|
+
/**
|
|
24
|
+
* - Input value.
|
|
25
|
+
*/
|
|
26
|
+
value?: string | undefined;
|
|
19
27
|
/**
|
|
20
28
|
* - Visibility icon slot content.
|
|
21
29
|
*/
|
|
@@ -12,6 +12,10 @@ type SearchBar = {
|
|
|
12
12
|
* @see https://w3c.github.io/aria/#search
|
|
13
13
|
*/
|
|
14
14
|
declare const SearchBar: import("svelte").Component<import("../../typedefs").TextInputProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & import("../../typedefs").InputEventHandlers & {
|
|
15
|
+
/**
|
|
16
|
+
* - Input value.
|
|
17
|
+
*/
|
|
18
|
+
value?: string | undefined;
|
|
15
19
|
/**
|
|
16
20
|
* - Search icon slot content.
|
|
17
21
|
*/
|
|
@@ -24,6 +28,10 @@ declare const SearchBar: import("svelte").Component<import("../../typedefs").Tex
|
|
|
24
28
|
focus: () => void;
|
|
25
29
|
}, "value">;
|
|
26
30
|
type Props = {
|
|
31
|
+
/**
|
|
32
|
+
* - Input value.
|
|
33
|
+
*/
|
|
34
|
+
value?: string | undefined;
|
|
27
35
|
/**
|
|
28
36
|
* - Search icon slot content.
|
|
29
37
|
*/
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
<script>
|
|
9
9
|
/**
|
|
10
10
|
* @typedef {object} Props
|
|
11
|
-
* @property {string
|
|
11
|
+
* @property {string} [value] - Input value.
|
|
12
12
|
* @property {boolean} [flex] - Make the text input container flexible.
|
|
13
|
-
* @property {string
|
|
13
|
+
* @property {string} [name] - The `name` attribute on the `<textarea>` element.
|
|
14
14
|
* @property {boolean} [autoResize] - Whether to automatically resize the `<textarea>` based on
|
|
15
15
|
* the content.
|
|
16
16
|
* @property {string} [class] - The `class` attribute on the wrapper element.
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
class:auto-resize={autoResize}
|
|
72
72
|
></textarea>
|
|
73
73
|
{#if autoResize}
|
|
74
|
-
<div class="clone" aria-hidden="true">{value
|
|
74
|
+
<div class="clone" aria-hidden="true">{value}</div>
|
|
75
75
|
{/if}
|
|
76
76
|
</div>
|
|
77
77
|
|
|
@@ -138,7 +138,7 @@ textarea.auto-resize {
|
|
|
138
138
|
resize: none;
|
|
139
139
|
}
|
|
140
140
|
textarea[aria-invalid=true] {
|
|
141
|
-
border-color: var(--sui-error-
|
|
141
|
+
border-color: var(--sui-error-border-color);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
.clone {
|
|
@@ -8,9 +8,14 @@
|
|
|
8
8
|
import { generateElementId } from '@sveltia/utils/element';
|
|
9
9
|
import { activateKeyShortcuts } from '../../services/events.svelte';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {object} Props
|
|
13
|
+
* @property {string} [value] - Input value.
|
|
14
|
+
*/
|
|
15
|
+
|
|
11
16
|
/**
|
|
12
17
|
* @type {import('../../typedefs').TextInputProps & import('../../typedefs').CommonEventHandlers &
|
|
13
|
-
* import('../../typedefs').InputEventHandlers & Record<string, any>}
|
|
18
|
+
* import('../../typedefs').InputEventHandlers & Props & Record<string, any>}
|
|
14
19
|
*/
|
|
15
20
|
let {
|
|
16
21
|
/* eslint-disable prefer-const */
|
|
@@ -125,7 +130,7 @@ input:disabled, input:read-only {
|
|
|
125
130
|
background-color: var(--sui-disabled-background-color);
|
|
126
131
|
}
|
|
127
132
|
input[aria-invalid=true] {
|
|
128
|
-
border-color: var(--sui-error-
|
|
133
|
+
border-color: var(--sui-error-border-color);
|
|
129
134
|
}
|
|
130
135
|
input ~ :global(button) {
|
|
131
136
|
flex: none;
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
export default TextInput;
|
|
2
2
|
type TextInput = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<TextInputProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & InputEventHandlers & Record<string, any>>): void;
|
|
4
|
+
$set?(props: Partial<TextInputProps & KeyboardEventHandlers & MouseEventHandlers & FocusEventHandlers & DragEventHandlers & InputEventHandlers & Props & Record<string, any>>): void;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* A generic, single-line text field. The equivalent of the HTML `<input type="text">` element.
|
|
8
8
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text
|
|
9
9
|
* @see https://w3c.github.io/aria/#textbox
|
|
10
10
|
*/
|
|
11
|
-
declare const TextInput: import("svelte").Component<import("../../typedefs").TextInputProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & import("../../typedefs").InputEventHandlers &
|
|
11
|
+
declare const TextInput: import("svelte").Component<import("../../typedefs").TextInputProps & import("../../typedefs").KeyboardEventHandlers & import("../../typedefs").MouseEventHandlers & import("../../typedefs").FocusEventHandlers & import("../../typedefs").DragEventHandlers & import("../../typedefs").InputEventHandlers & {
|
|
12
|
+
/**
|
|
13
|
+
* - Input value.
|
|
14
|
+
*/
|
|
15
|
+
value?: string | undefined;
|
|
16
|
+
} & Record<string, any>, {}, "value" | "element">;
|
|
17
|
+
type Props = {
|
|
18
|
+
/**
|
|
19
|
+
* - Input value.
|
|
20
|
+
*/
|
|
21
|
+
value?: string | undefined;
|
|
22
|
+
};
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @typedef {object} Props
|
|
12
|
-
* @property {string | number
|
|
12
|
+
* @property {string | number} [id] - The toast ID. If updated, the timer that hides
|
|
13
13
|
* the toast will be reset, meaning the same toast can be displayed for a longer period of time.
|
|
14
14
|
* @property {boolean} [show] - Whether to show the toast.
|
|
15
15
|
* @property {number} [duration] - Duration to automatically hide the toast. Use `0` to hide it
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* attribute.
|
|
14
14
|
* @property {'horizontal' | 'vertical'} [orientation] - Orientation of the widget. An alias of
|
|
15
15
|
* the `aria-orientation` attribute.
|
|
16
|
-
* @property {'primary' | 'secondary'
|
|
16
|
+
* @property {'primary' | 'secondary'} [variant] - The style variant of the toolbar.
|
|
17
17
|
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
18
18
|
*/
|
|
19
19
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
<div
|
|
37
37
|
{...restProps}
|
|
38
38
|
role="toolbar"
|
|
39
|
-
class="sui toolbar {orientation} {variant
|
|
39
|
+
class="sui toolbar {orientation} {variant} {className}"
|
|
40
40
|
{hidden}
|
|
41
41
|
aria-hidden={hidden}
|
|
42
42
|
aria-disabled={disabled}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @typedef {object} Props
|
|
12
|
-
* @property {'horizontal' | 'vertical'
|
|
12
|
+
* @property {'horizontal' | 'vertical'} [orientation] - Orientation of the app
|
|
13
13
|
* shell’s children..
|
|
14
14
|
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
15
15
|
*/
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
<div
|
|
83
83
|
{...restProps}
|
|
84
84
|
role="none"
|
|
85
|
-
class="sui app-shell {orientation
|
|
85
|
+
class="sui app-shell {orientation}"
|
|
86
86
|
ondragover={(event) => event.preventDefault()}
|
|
87
87
|
ondrop={(event) => event.preventDefault()}
|
|
88
88
|
oncontextmenu={(event) => {
|
|
@@ -339,8 +339,8 @@
|
|
|
339
339
|
--sui-alert-foreground-color-lightness: 75%;
|
|
340
340
|
--sui-alert-background-color-saturation: 40%;
|
|
341
341
|
--sui-alert-background-color-lightness: 10%;
|
|
342
|
-
--sui-alert-border-color-saturation:
|
|
343
|
-
--sui-alert-border-color-lightness:
|
|
342
|
+
--sui-alert-border-color-saturation: 48%;
|
|
343
|
+
--sui-alert-border-color-lightness: 38%;
|
|
344
344
|
}
|
|
345
345
|
@media (prefers-color-scheme: light) {
|
|
346
346
|
:global(:root:not([data-theme])),
|
|
@@ -410,8 +410,8 @@
|
|
|
410
410
|
--sui-alert-foreground-color-lightness: 75%;
|
|
411
411
|
--sui-alert-background-color-saturation: 40%;
|
|
412
412
|
--sui-alert-background-color-lightness: 10%;
|
|
413
|
-
--sui-alert-border-color-saturation:
|
|
414
|
-
--sui-alert-border-color-lightness:
|
|
413
|
+
--sui-alert-border-color-saturation: 48%;
|
|
414
|
+
--sui-alert-border-color-lightness: 38%;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
|
|
@@ -13,7 +13,7 @@ declare const AppShell: import("svelte").Component<{
|
|
|
13
13
|
* - Orientation of the app
|
|
14
14
|
* shell’s children..
|
|
15
15
|
*/
|
|
16
|
-
orientation?: "
|
|
16
|
+
orientation?: "vertical" | "horizontal" | undefined;
|
|
17
17
|
/**
|
|
18
18
|
* - Primary slot content.
|
|
19
19
|
*/
|
|
@@ -24,7 +24,7 @@ type Props = {
|
|
|
24
24
|
* - Orientation of the app
|
|
25
25
|
* shell’s children..
|
|
26
26
|
*/
|
|
27
|
-
orientation?: "
|
|
27
|
+
orientation?: "vertical" | "horizontal" | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* - Primary slot content.
|
|
30
30
|
*/
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* @property {boolean} [open] - Whether to open the popup.
|
|
16
16
|
* @property {HTMLElement} [anchor] - A reference to the anchor element that opens the popup.
|
|
17
17
|
* Typically a `<button>`.
|
|
18
|
-
* @property {HTMLElement
|
|
18
|
+
* @property {HTMLElement} [content] - A reference to the content element.
|
|
19
19
|
* @property {import('../../typedefs').PopupPosition} [position] - Where to show the popup.
|
|
20
|
-
* @property {HTMLElement
|
|
20
|
+
* @property {HTMLElement} [positionBaseElement] - The base element of
|
|
21
21
|
* {@link position}. If omitted, this will be {@link anchor}.
|
|
22
22
|
* @property {boolean} [touchOptimized] - Whether to show the popup at the center of the screen on
|
|
23
23
|
* mobile/tablet and ignore the defined dropdown `position`.
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
--sui-alert-foreground-color-lightness: 75%;
|
|
67
67
|
--sui-alert-background-color-saturation: 40%;
|
|
68
68
|
--sui-alert-background-color-lightness: 10%;
|
|
69
|
-
--sui-alert-border-color-saturation:
|
|
70
|
-
--sui-alert-border-color-lightness:
|
|
69
|
+
--sui-alert-border-color-saturation: 48%;
|
|
70
|
+
--sui-alert-border-color-lightness: 38%;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
:global {
|
|
@@ -382,10 +382,6 @@ export type ComboboxProps = {
|
|
|
382
382
|
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
383
383
|
};
|
|
384
384
|
export type TextInputProps = {
|
|
385
|
-
/**
|
|
386
|
-
* - Input value.
|
|
387
|
-
*/
|
|
388
|
-
value?: string | undefined;
|
|
389
385
|
/**
|
|
390
386
|
* - Reference to the `<input>` element.
|
|
391
387
|
*/
|
|
@@ -545,10 +541,37 @@ export type InputEventHandlers = {
|
|
|
545
541
|
};
|
|
546
542
|
export type PopupPosition = ("top-left" | "top-right" | "right-top" | "right-bottom" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom");
|
|
547
543
|
export type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
548
|
-
export type TextEditorBlockType = "paragraph" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "bulleted-list" | "numbered-list" | "blockquote";
|
|
544
|
+
export type TextEditorBlockType = "paragraph" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "bulleted-list" | "numbered-list" | "blockquote" | "code-block";
|
|
549
545
|
export type TextEditorFormatType = "bold" | "italic" | "code";
|
|
550
546
|
export type TextEditorInlineType = TextEditorFormatType | "link";
|
|
551
547
|
export type TextEditorMode = "rich-text" | "plain-text";
|
|
548
|
+
export type TextEditorComponent = {
|
|
549
|
+
/**
|
|
550
|
+
* - Component ID.
|
|
551
|
+
*/
|
|
552
|
+
id: string;
|
|
553
|
+
/**
|
|
554
|
+
* - Component label.
|
|
555
|
+
*/
|
|
556
|
+
label: string;
|
|
557
|
+
/**
|
|
558
|
+
* - Material Symbols icon name.
|
|
559
|
+
*/
|
|
560
|
+
icon?: string | undefined;
|
|
561
|
+
/**
|
|
562
|
+
* - Lexical node class implementation.
|
|
563
|
+
*/
|
|
564
|
+
node: import("lexical").LexicalNode;
|
|
565
|
+
/**
|
|
566
|
+
* - Function
|
|
567
|
+
* to create a new node instance.
|
|
568
|
+
*/
|
|
569
|
+
createNode: (props?: Record<string, any>) => import("lexical").LexicalNode;
|
|
570
|
+
/**
|
|
571
|
+
* - Node transformer.
|
|
572
|
+
*/
|
|
573
|
+
transformer: import("@lexical/markdown").Transformer;
|
|
574
|
+
};
|
|
552
575
|
export type TextEditorState = {
|
|
553
576
|
/**
|
|
554
577
|
* - Lexical
|
|
@@ -588,6 +611,10 @@ export type TextEditorState = {
|
|
|
588
611
|
* the editor.
|
|
589
612
|
*/
|
|
590
613
|
enabledButtons: (TextEditorBlockType | TextEditorInlineType)[];
|
|
614
|
+
/**
|
|
615
|
+
* - Editor components.
|
|
616
|
+
*/
|
|
617
|
+
components: TextEditorComponent[];
|
|
591
618
|
/**
|
|
592
619
|
* - Function to trigger the Lexical converter.
|
|
593
620
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {object} ButtonProps
|
|
3
|
-
* @property {HTMLButtonElement
|
|
3
|
+
* @property {HTMLButtonElement} [element] - Reference to the `<button>` element.
|
|
4
4
|
* @property {string} [class] - The `class` attribute on the `<button>` element.
|
|
5
5
|
* @property {'button' | 'submit' | 'reset'} [type] - The `type` attribute on the `<button>`
|
|
6
6
|
* element.
|
|
7
7
|
* @property {string} [role] - The `role` attribute on the `<button>` element.
|
|
8
|
-
* @property {string
|
|
9
|
-
* @property {string
|
|
8
|
+
* @property {string} [name] - The `name` attribute on the `<button>` element.
|
|
9
|
+
* @property {string} [value] - The `value` attribute on the `<button>` element.
|
|
10
10
|
* @property {boolean} [hidden] - Whether to hide the widget. An alias of the `aria-hidden`
|
|
11
11
|
* attribute.
|
|
12
12
|
* @property {boolean} [disabled] - Whether to disable the widget. An alias of the `aria-disabled`
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
* @property {boolean} [readonly] - Whether to make the widget read-only. An alias of the
|
|
15
15
|
* `aria-readonly` attribute used in certain roles, including `checkbox`, `listbox`, `slider` and
|
|
16
16
|
* `textbox`.
|
|
17
|
-
* @property {boolean | 'mixed'
|
|
17
|
+
* @property {boolean | 'mixed'} [pressed] - Whether to mark the widget pressed. An
|
|
18
18
|
* alias of the `aria-pressed` attribute.
|
|
19
|
-
* @property {string
|
|
19
|
+
* @property {string} [keyShortcuts] - Keyboard shortcuts. An alias of the
|
|
20
20
|
* `aria-keyshortcuts` attribute. Accepts the special `Accel` key, which will be replaced with
|
|
21
21
|
* `Control` or `Meta` depending on the user’s operating system.
|
|
22
22
|
* @property {string} [label] - Text label displayed on the button.
|
|
23
|
-
* @property {'primary' | 'secondary' | 'tertiary' | 'ghost' | 'link'
|
|
23
|
+
* @property {'primary' | 'secondary' | 'tertiary' | 'ghost' | 'link'} [variant] - The
|
|
24
24
|
* style variant of the button.
|
|
25
|
-
* @property {'small' | 'medium' | 'large'
|
|
25
|
+
* @property {'small' | 'medium' | 'large'} [size] - The size of the button.
|
|
26
26
|
* @property {boolean} [iconic] - Whether to only show an icon on the button and trim the padding.
|
|
27
27
|
* @property {boolean} [pill] - Whether to make the button rounded.
|
|
28
28
|
* @property {boolean} [flex] - Make the button width flexible.
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
* @property {boolean} [escapeDismiss] - Whether to close the modal when the Escape key is pressed.
|
|
50
50
|
* @property {boolean} [keepContent] - Whether to keep the content in the DOM tree when the modal is
|
|
51
51
|
* not displayed.
|
|
52
|
-
* @property {HTMLDialogElement
|
|
52
|
+
* @property {HTMLDialogElement} [dialog] - A reference to the `<dialog>` element.
|
|
53
53
|
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
54
54
|
* @property {import('svelte').Snippet} [extraContent] - Extra slot content.
|
|
55
55
|
* @property {(event: CustomEvent) => void} [onOpening] - Custom `Opening` event handler.
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
* `aria-required` attribute.
|
|
120
120
|
* @property {boolean} [invalid] - Whether to mark the widget invalid. An alias of the
|
|
121
121
|
* `aria-invalid` attribute.
|
|
122
|
-
* @property {string
|
|
122
|
+
* @property {string} [value] - Selected option’s value.
|
|
123
123
|
* @property {boolean} [editable] - Whether to make the `combobox` editable.
|
|
124
124
|
* @property {PopupPosition} [position] - Where to show the dropdown menu.
|
|
125
125
|
* @property {import('svelte').Snippet} [children] - Primary slot content.
|
|
@@ -129,14 +129,13 @@
|
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* @typedef {object} TextInputProps
|
|
132
|
-
* @property {
|
|
133
|
-
* @property {HTMLInputElement | undefined} [element] - Reference to the `<input>` element.
|
|
132
|
+
* @property {HTMLInputElement} [element] - Reference to the `<input>` element.
|
|
134
133
|
* @property {'textbox' | 'searchbox' | 'combobox' | 'spinbutton'} [role] - The `role` attribute on
|
|
135
134
|
* the `<input>` element.
|
|
136
|
-
* @property {string
|
|
135
|
+
* @property {string} [keyShortcuts] - Keyboard shortcuts. An alias of the
|
|
137
136
|
* `aria-keyshortcuts` attribute. Accepts the special `Accel` key, which will be replaced with
|
|
138
137
|
* `Control` or `Meta` depending on the user’s operating system.
|
|
139
|
-
* @property {string
|
|
138
|
+
* @property {string} [name] - The `name` attribute on the `<input>` element.
|
|
140
139
|
* @property {boolean} [showInlineLabel] - Whether to display `aria-label` over the `<input>`
|
|
141
140
|
* element if it’s empty, just like how the HTML `placeholder` attribute works.
|
|
142
141
|
* @property {'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'} [inputmode] - The
|
|
@@ -212,7 +211,8 @@
|
|
|
212
211
|
|
|
213
212
|
/**
|
|
214
213
|
* @typedef {'paragraph' | 'heading-1' | 'heading-2' | 'heading-3' | 'heading-4' | 'heading-5' |
|
|
215
|
-
* 'heading-6' | 'bulleted-list' | 'numbered-list' | 'blockquote'}
|
|
214
|
+
* 'heading-6' | 'bulleted-list' | 'numbered-list' | 'blockquote' | 'code-block'}
|
|
215
|
+
* TextEditorBlockType
|
|
216
216
|
*/
|
|
217
217
|
|
|
218
218
|
/**
|
|
@@ -227,6 +227,17 @@
|
|
|
227
227
|
* @typedef {'rich-text' | 'plain-text'} TextEditorMode
|
|
228
228
|
*/
|
|
229
229
|
|
|
230
|
+
/**
|
|
231
|
+
* @typedef {object} TextEditorComponent
|
|
232
|
+
* @property {string} id - Component ID.
|
|
233
|
+
* @property {string} label - Component label.
|
|
234
|
+
* @property {string} [icon] - Material Symbols icon name.
|
|
235
|
+
* @property {import('lexical').LexicalNode} node - Lexical node class implementation.
|
|
236
|
+
* @property {(props?: Record<string, any>) => import('lexical').LexicalNode} createNode - Function
|
|
237
|
+
* to create a new node instance.
|
|
238
|
+
* @property {import('@lexical/markdown').Transformer} transformer - Node transformer.
|
|
239
|
+
*/
|
|
240
|
+
|
|
230
241
|
/**
|
|
231
242
|
* @typedef {object} TextEditorState
|
|
232
243
|
* @property {import('svelte/store').Writable<import('lexical').LexicalEditor>} editor - Lexical
|
|
@@ -243,6 +254,7 @@
|
|
|
243
254
|
* error while converting Markdown to Lexical nodes.
|
|
244
255
|
* @property {(TextEditorBlockType | TextEditorInlineType)[]} enabledButtons - Enabled buttons for
|
|
245
256
|
* the editor.
|
|
257
|
+
* @property {TextEditorComponent[]} components - Editor components.
|
|
246
258
|
* @property {Function} convertMarkdown - Function to trigger the Lexical converter.
|
|
247
259
|
*/
|
|
248
260
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltia/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
14
|
"dev": "vite dev",
|
|
15
|
-
"build": "svelte-kit sync && svelte-package
|
|
16
|
-
"build:watch": "svelte-kit sync && svelte-package
|
|
15
|
+
"build": "svelte-kit sync && svelte-package",
|
|
16
|
+
"build:watch": "svelte-kit sync && svelte-package --watch",
|
|
17
17
|
"preview": "vite preview",
|
|
18
18
|
"prepublishOnly": "npm run build",
|
|
19
19
|
"format": "prettier --write .",
|
|
@@ -38,56 +38,57 @@
|
|
|
38
38
|
"@lexical/selection": "^0.21.0",
|
|
39
39
|
"@lexical/table": "^0.21.0",
|
|
40
40
|
"@lexical/utils": "^0.21.0",
|
|
41
|
-
"@sveltia/utils": "^0.
|
|
41
|
+
"@sveltia/utils": "^0.6.3",
|
|
42
|
+
"prismjs": "^1.29.0",
|
|
42
43
|
"lexical": "^0.21.0"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
46
|
"svelte": "^5.0.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@playwright/test": "^1.49.
|
|
49
|
+
"@playwright/test": "^1.49.1",
|
|
49
50
|
"@sveltejs/adapter-auto": "^3.3.1",
|
|
50
|
-
"@sveltejs/kit": "^2.
|
|
51
|
+
"@sveltejs/kit": "^2.14.1",
|
|
51
52
|
"@sveltejs/package": "^2.3.7",
|
|
52
|
-
"@sveltejs/vite-plugin-svelte": "5.0.
|
|
53
|
-
"cspell": "^8.
|
|
53
|
+
"@sveltejs/vite-plugin-svelte": "5.0.3",
|
|
54
|
+
"cspell": "^8.17.1",
|
|
54
55
|
"eslint": "^8.57.1",
|
|
55
56
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
56
57
|
"eslint-config-prettier": "^9.1.0",
|
|
57
58
|
"eslint-plugin-import": "^2.31.0",
|
|
58
|
-
"eslint-plugin-jsdoc": "^50.6.
|
|
59
|
+
"eslint-plugin-jsdoc": "^50.6.1",
|
|
59
60
|
"eslint-plugin-svelte": "^2.46.1",
|
|
60
61
|
"postcss": "^8.4.49",
|
|
61
62
|
"postcss-html": "^1.7.0",
|
|
62
63
|
"prettier": "^3.4.2",
|
|
63
64
|
"prettier-plugin-svelte": "^3.3.2",
|
|
64
|
-
"sass": "^1.
|
|
65
|
-
"stylelint": "^16.
|
|
65
|
+
"sass": "^1.83.0",
|
|
66
|
+
"stylelint": "^16.12.0",
|
|
66
67
|
"stylelint-config-recommended-scss": "^14.1.0",
|
|
67
68
|
"stylelint-scss": "^6.10.0",
|
|
68
|
-
"svelte": "5.
|
|
69
|
+
"svelte": "5.15.0",
|
|
69
70
|
"svelte-check": "^4.1.1",
|
|
70
71
|
"svelte-i18n": "^4.0.1",
|
|
71
72
|
"svelte-preprocess": "^6.0.3",
|
|
72
73
|
"tslib": "^2.8.1",
|
|
73
|
-
"vite": "^6.0.
|
|
74
|
+
"vite": "^6.0.5",
|
|
74
75
|
"vitest": "^2.1.8"
|
|
75
76
|
},
|
|
76
77
|
"exports": {
|
|
77
78
|
".": {
|
|
78
|
-
"types": "./
|
|
79
|
-
"svelte": "./
|
|
80
|
-
"default": "./
|
|
79
|
+
"types": "./dist/index.d.ts",
|
|
80
|
+
"svelte": "./dist/index.js",
|
|
81
|
+
"default": "./dist/index.js"
|
|
81
82
|
}
|
|
82
83
|
},
|
|
83
84
|
"files": [
|
|
84
|
-
"
|
|
85
|
+
"dist"
|
|
85
86
|
],
|
|
86
|
-
"svelte": "./
|
|
87
|
+
"svelte": "./dist/index.js",
|
|
87
88
|
"typesVersions": {
|
|
88
89
|
">4.0": {
|
|
89
90
|
"index": [
|
|
90
|
-
"./
|
|
91
|
+
"./dist/index.d.ts"
|
|
91
92
|
]
|
|
92
93
|
}
|
|
93
94
|
},
|