@sveltia/ui 0.2.3 → 0.2.4
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/composite/calendar.svelte +4 -1
- package/package/components/composite/calendar.svelte.d.ts +1 -1
- package/package/components/composite/checkbox-group.svelte +2 -3
- package/package/components/composite/combobox.svelte +9 -6
- package/package/components/composite/combobox.svelte.d.ts +4 -4
- package/package/components/composite/disclosure.svelte +2 -2
- package/package/components/composite/grid.svelte +2 -2
- package/package/components/composite/grid.svelte.d.ts +1 -1
- package/package/components/composite/listbox.svelte +2 -2
- package/package/components/composite/listbox.svelte.d.ts +1 -1
- package/package/components/composite/menu-item-group.svelte +1 -1
- package/package/components/composite/menu.svelte +2 -2
- package/package/components/composite/menu.svelte.d.ts +1 -1
- package/package/components/composite/radio-button-group.svelte +2 -2
- package/package/components/composite/radio-button-group.svelte.d.ts +1 -1
- package/package/components/composite/select-button-group.svelte +2 -2
- package/package/components/composite/select-button-group.svelte.d.ts +1 -1
- package/package/components/composite/select.svelte +2 -2
- package/package/components/composite/select.svelte.d.ts +1 -1
- package/package/components/composite/tab-list.svelte +2 -2
- package/package/components/composite/tab-list.svelte.d.ts +1 -1
- package/package/components/core/button.svelte +9 -10
- package/package/components/core/button.svelte.d.ts +9 -9
- package/package/components/core/checkbox.svelte +7 -7
- package/package/components/core/checkbox.svelte.d.ts +1 -1
- package/package/components/core/dialog.svelte +13 -3
- package/package/components/core/dialog.svelte.d.ts +2 -2
- package/package/components/core/drawer.svelte +12 -2
- package/package/components/core/grid-cell.svelte +1 -2
- package/package/components/core/group.svelte +1 -1
- package/package/components/core/icon.svelte +1 -1
- package/package/components/core/menu-button.svelte +2 -2
- package/package/components/core/menu-button.svelte.d.ts +2 -2
- package/package/components/core/menu-item-checkbox.svelte +1 -1
- package/package/components/core/menu-item-radio.svelte +1 -1
- package/package/components/core/number-input.svelte +8 -2
- package/package/components/core/number-input.svelte.d.ts +1 -1
- package/package/components/core/option.svelte +1 -1
- package/package/components/core/password-input.svelte +2 -2
- package/package/components/core/password-input.svelte.d.ts +1 -1
- package/package/components/core/radio-button.svelte +5 -5
- package/package/components/core/radio-button.svelte.d.ts +1 -1
- package/package/components/core/row-group.svelte +1 -2
- package/package/components/core/row.svelte +1 -2
- package/package/components/core/search-bar.svelte +2 -2
- package/package/components/core/select-button.svelte +1 -1
- package/package/components/core/separator.svelte +2 -1
- package/package/components/core/separator.svelte.d.ts +2 -2
- package/package/components/core/slider.svelte +25 -3
- package/package/components/core/spacer.svelte +2 -2
- package/package/components/core/switch.svelte +1 -1
- package/package/components/core/tab-panel.svelte +1 -2
- package/package/components/core/tab.svelte +1 -1
- package/package/components/core/text-area.svelte +6 -6
- package/package/components/core/text-area.svelte.d.ts +2 -2
- package/package/components/core/text-input.svelte +4 -4
- package/package/components/core/text-input.svelte.d.ts +5 -5
- package/package/components/core/toolbar.svelte +1 -2
- package/package/components/editor/markdown.svelte +1 -1
- package/package/components/editor/markdown.svelte.d.ts +1 -1
- package/package/components/helpers/group.d.ts +1 -37
- package/package/components/helpers/group.js +23 -18
- package/package/components/helpers/popup.d.ts +1 -2
- package/package/components/helpers/popup.js +8 -7
- package/package/components/helpers/util.js +6 -0
- package/package/components/util/app-shell.svelte +7 -1
- package/package/components/util/misc.js +0 -2
- package/package/components/util/popup.svelte +14 -4
- package/package/components/util/popup.svelte.d.ts +10 -10
- package/package/components/util/portal.svelte +1 -1
- package/package/index.d.ts +4 -1
- package/package/index.js +45 -0
- package/package/typedef.d.ts +1 -0
- package/package/typedef.js +4 -0
- package/package.json +10 -12
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-plusplus */
|
|
2
|
-
/* eslint-disable no-param-reassign */
|
|
3
|
-
|
|
4
1
|
import { sleep } from '../util/misc';
|
|
5
2
|
import { getRandomId } from './util';
|
|
6
3
|
|
|
@@ -43,7 +40,7 @@ const config = {
|
|
|
43
40
|
class Group {
|
|
44
41
|
/**
|
|
45
42
|
*
|
|
46
|
-
* @param {HTMLElement} parent
|
|
43
|
+
* @param {HTMLElement} parent Parent element.
|
|
47
44
|
* @todo Check for added elements probably with `MutationObserver`.
|
|
48
45
|
*/
|
|
49
46
|
constructor(parent) {
|
|
@@ -73,9 +70,9 @@ class Group {
|
|
|
73
70
|
|
|
74
71
|
element.id ||= `${this.id}-item-${index}`;
|
|
75
72
|
element.tabIndex ||= isSelected || (!hasSelected && index === 0) ? 0 : -1;
|
|
76
|
-
element.setAttribute(this.childSelectedAttr, isSelected);
|
|
73
|
+
element.setAttribute(this.childSelectedAttr, String(isSelected));
|
|
77
74
|
controls?.setAttribute('aria-labelledby', element.id);
|
|
78
|
-
controls?.setAttribute('aria-hidden', !isSelected);
|
|
75
|
+
controls?.setAttribute('aria-hidden', String(!isSelected));
|
|
79
76
|
});
|
|
80
77
|
|
|
81
78
|
parent.addEventListener('click', (event) => {
|
|
@@ -96,6 +93,7 @@ class Group {
|
|
|
96
93
|
|
|
97
94
|
/** @type {HTMLElement[]} */
|
|
98
95
|
get allMembers() {
|
|
96
|
+
// @ts-ignore
|
|
99
97
|
return [...this.parent.querySelectorAll(this.selector)];
|
|
100
98
|
}
|
|
101
99
|
|
|
@@ -106,10 +104,11 @@ class Group {
|
|
|
106
104
|
|
|
107
105
|
/**
|
|
108
106
|
*
|
|
109
|
-
* @param {
|
|
107
|
+
* @param {MouseEvent} event `click` event.
|
|
110
108
|
*/
|
|
111
109
|
onClick(event) {
|
|
112
|
-
|
|
110
|
+
// eslint-disable-next-line prefer-destructuring
|
|
111
|
+
const target = /** @type {HTMLButtonElement} */ (event.target);
|
|
113
112
|
|
|
114
113
|
if (!target.matches(this.selector)) {
|
|
115
114
|
return;
|
|
@@ -129,13 +128,13 @@ class Group {
|
|
|
129
128
|
(element.matches('[role="row"], [role="option"], [role="tab"]') && !this.multi)) &&
|
|
130
129
|
element.closest(this.parentGroupSelector) === targetParentGroup
|
|
131
130
|
) {
|
|
132
|
-
element.setAttribute(this.childSelectedAttr, isTarget);
|
|
131
|
+
element.setAttribute(this.childSelectedAttr, String(isTarget));
|
|
133
132
|
}
|
|
134
133
|
|
|
135
134
|
const controls = element.getAttribute('aria-controls');
|
|
136
135
|
|
|
137
136
|
if (controls) {
|
|
138
|
-
document.getElementById(controls)?.setAttribute('aria-hidden', !isTarget);
|
|
137
|
+
document.getElementById(controls)?.setAttribute('aria-hidden', String(!isTarget));
|
|
139
138
|
}
|
|
140
139
|
});
|
|
141
140
|
|
|
@@ -151,10 +150,12 @@ class Group {
|
|
|
151
150
|
|
|
152
151
|
/**
|
|
153
152
|
*
|
|
154
|
-
* @param {KeyboardEvent}
|
|
153
|
+
* @param {KeyboardEvent} event `keydown` event.
|
|
155
154
|
*/
|
|
156
155
|
onKeyDown(event) {
|
|
157
|
-
|
|
156
|
+
// eslint-disable-next-line prefer-destructuring
|
|
157
|
+
const target = /** @type {HTMLElement} */ (event.target);
|
|
158
|
+
const { key, ctrlKey, metaKey, shiftKey, altKey } = event;
|
|
158
159
|
|
|
159
160
|
if (target.matches(this.selector) && !ctrlKey && !metaKey && !shiftKey && !altKey) {
|
|
160
161
|
if ([' ', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(key)) {
|
|
@@ -236,11 +237,15 @@ class Group {
|
|
|
236
237
|
}
|
|
237
238
|
|
|
238
239
|
/**
|
|
239
|
-
*
|
|
240
|
+
* Activate a new group.
|
|
241
|
+
* @param {...any} args Arguments.
|
|
240
242
|
*/
|
|
241
|
-
export const activateGroup =
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
export const activateGroup = (...args) => {
|
|
244
|
+
(async () => {
|
|
245
|
+
// Wait a bit before the relevant components, including the `aria-controls` target are mounted
|
|
246
|
+
await sleep(100);
|
|
247
|
+
|
|
248
|
+
// @ts-ignore
|
|
249
|
+
return new Group(...args);
|
|
250
|
+
})();
|
|
246
251
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export function activatePopup(...args: any[]): Popup;
|
|
2
|
-
export type PopupPosition = ('top-left' | 'top-right' | 'right-top' | 'right-bottom' | 'bottom-left' | 'bottom-right' | 'left-top' | 'left-bottom');
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
*
|
|
5
4
|
*/
|
|
6
5
|
declare class Popup {
|
|
7
6
|
/**
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
1
|
/* eslint-disable no-nested-ternary */
|
|
3
2
|
|
|
4
3
|
import { get, writable } from 'svelte/store';
|
|
5
4
|
import { getRandomId } from './util';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
|
-
*
|
|
7
|
+
*
|
|
9
8
|
*/
|
|
10
|
-
|
|
11
9
|
class Popup {
|
|
12
10
|
open = writable(false);
|
|
13
11
|
|
|
@@ -30,7 +28,7 @@ class Popup {
|
|
|
30
28
|
if (position.startsWith('bottom-')) {
|
|
31
29
|
if (contentHeight > bottomMargin) {
|
|
32
30
|
if (topMargin > bottomMargin) {
|
|
33
|
-
position = position.replace('bottom-', 'top-');
|
|
31
|
+
position = /** @type {PopupPosition} */ (position.replace('bottom-', 'top-'));
|
|
34
32
|
height = topMargin;
|
|
35
33
|
} else {
|
|
36
34
|
height = bottomMargin;
|
|
@@ -62,7 +60,7 @@ class Popup {
|
|
|
62
60
|
? `${Math.round(intersectionRect.left)}px`
|
|
63
61
|
: 'auto';
|
|
64
62
|
|
|
65
|
-
const anchorPopup = this.anchorElement.closest('.popup');
|
|
63
|
+
const anchorPopup = /** @type {HTMLElement} */ (this.anchorElement.closest('.popup'));
|
|
66
64
|
|
|
67
65
|
const style = {
|
|
68
66
|
inset: [top, right, bottom, left].join(' '),
|
|
@@ -139,7 +137,7 @@ class Popup {
|
|
|
139
137
|
this.anchorElement.focus();
|
|
140
138
|
}
|
|
141
139
|
|
|
142
|
-
this.anchorElement.setAttribute('aria-expanded', open);
|
|
140
|
+
this.anchorElement.setAttribute('aria-expanded', String(open));
|
|
143
141
|
});
|
|
144
142
|
}
|
|
145
143
|
|
|
@@ -160,6 +158,9 @@ class Popup {
|
|
|
160
158
|
}
|
|
161
159
|
|
|
162
160
|
/**
|
|
163
|
-
*
|
|
161
|
+
* Activate a new popup.
|
|
162
|
+
* @param {...any} args Arguments.
|
|
163
|
+
* @returns {Popup} New popup.
|
|
164
164
|
*/
|
|
165
|
+
// @ts-ignore
|
|
165
166
|
export const activatePopup = (...args) => new Popup(...args);
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get a random ID that can be used for elements.
|
|
3
|
+
* @param {string} [prefix] Prefix to be added to the ID, e.g. `popup`.
|
|
4
|
+
* @param {number} [length] Number of characters to be used in the ID.
|
|
5
|
+
* @returns {string} Generated ID.
|
|
6
|
+
*/
|
|
1
7
|
export const getRandomId = (prefix = '', length = 7) =>
|
|
2
8
|
[
|
|
3
9
|
prefix,
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
12
12
|
const { dataset } = document.documentElement;
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
14
17
|
const applyTheme = () => {
|
|
15
18
|
if (dataset.autoTheming !== 'false') {
|
|
16
19
|
dataset.theme = mediaQuery.matches ? 'dark' : 'light';
|
|
@@ -19,6 +22,9 @@
|
|
|
19
22
|
|
|
20
23
|
applyTheme();
|
|
21
24
|
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
22
28
|
mediaQuery.onchange = () => {
|
|
23
29
|
applyTheme();
|
|
24
30
|
};
|
|
@@ -31,7 +37,7 @@
|
|
|
31
37
|
on:drop|preventDefault
|
|
32
38
|
on:contextmenu={(event) => {
|
|
33
39
|
// Disable the native context menu
|
|
34
|
-
if (!event.target?.matches('input[type="text"], textarea')) {
|
|
40
|
+
if (!(/** @type {HTMLElement} */ (event.target)?.matches('input[type="text"], textarea'))) {
|
|
35
41
|
event.preventDefault();
|
|
36
42
|
}
|
|
37
43
|
}}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Check if the given input is a simple object.
|
|
3
|
-
*
|
|
4
3
|
* @param {*} input Input, probably an object.
|
|
5
4
|
* @returns {boolean} Result.
|
|
6
5
|
*/
|
|
@@ -10,7 +9,6 @@ export const isObject = (input) =>
|
|
|
10
9
|
/**
|
|
11
10
|
* Return a simple `Promise` to resolve in the given time, making it easier to wait for a bit in the
|
|
12
11
|
* code, particularly while making sequential HTTP requests.
|
|
13
|
-
*
|
|
14
12
|
* @param {number} [ms] Milliseconds to wait.
|
|
15
13
|
* @returns {Promise} Nothing.
|
|
16
14
|
*/
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
import { writable } from 'svelte/store';
|
|
10
10
|
import { activatePopup } from '../helpers/popup';
|
|
11
11
|
|
|
12
|
-
/** @type {
|
|
12
|
+
/** @type {HTMLElement?} */
|
|
13
13
|
export let anchor = undefined;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Reference to the popup element.
|
|
17
|
-
* @type {
|
|
17
|
+
* @type {HTMLDialogElement?}
|
|
18
18
|
*/
|
|
19
19
|
export let dialog = undefined;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Reference to the content element.
|
|
23
|
-
* @type {
|
|
23
|
+
* @type {HTMLElement?}
|
|
24
24
|
*/
|
|
25
25
|
export let content = undefined;
|
|
26
26
|
|
|
@@ -50,6 +50,9 @@
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
53
56
|
const openDialog = () => {
|
|
54
57
|
(document.querySelector('.sui.app-shell') || document.body).appendChild(dialog);
|
|
55
58
|
showContent = true;
|
|
@@ -59,11 +62,14 @@
|
|
|
59
62
|
showDialog = true;
|
|
60
63
|
|
|
61
64
|
window.requestAnimationFrame(() => {
|
|
62
|
-
(dialog.querySelector('[tabindex]') || dialog).focus();
|
|
65
|
+
/** @type {HTMLElement} */ (dialog.querySelector('[tabindex]') || dialog).focus();
|
|
63
66
|
});
|
|
64
67
|
});
|
|
65
68
|
};
|
|
66
69
|
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
67
73
|
const closeDialog = async () => {
|
|
68
74
|
showDialog = false;
|
|
69
75
|
|
|
@@ -76,6 +82,9 @@
|
|
|
76
82
|
dialog?.remove();
|
|
77
83
|
};
|
|
78
84
|
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
79
88
|
const toggleDialog = () => {
|
|
80
89
|
if (dialog) {
|
|
81
90
|
if ($open) {
|
|
@@ -87,6 +96,7 @@
|
|
|
87
96
|
};
|
|
88
97
|
|
|
89
98
|
// Call the function only when the `$open` prop is changed
|
|
99
|
+
// @ts-ignore
|
|
90
100
|
$: toggleDialog($open);
|
|
91
101
|
|
|
92
102
|
onMount(() => {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
/** Generic popup helper. */
|
|
5
5
|
export default class Popup extends SvelteComponentTyped<{
|
|
6
6
|
[x: string]: any;
|
|
7
|
-
dialog?:
|
|
8
|
-
position?:
|
|
7
|
+
dialog?: HTMLDialogElement;
|
|
8
|
+
position?: PopupPosition;
|
|
9
9
|
anchor?: HTMLElement;
|
|
10
10
|
content?: HTMLElement;
|
|
11
11
|
open?: import("svelte/store").Writable<boolean>;
|
|
@@ -18,14 +18,14 @@ export default class Popup extends SvelteComponentTyped<{
|
|
|
18
18
|
set anchor(arg: HTMLElement);
|
|
19
19
|
get anchor(): HTMLElement;
|
|
20
20
|
/**accessor*/
|
|
21
|
-
set dialog(arg:
|
|
22
|
-
get dialog():
|
|
21
|
+
set dialog(arg: HTMLDialogElement);
|
|
22
|
+
get dialog(): HTMLDialogElement;
|
|
23
23
|
/**accessor*/
|
|
24
24
|
set content(arg: HTMLElement);
|
|
25
25
|
get content(): HTMLElement;
|
|
26
26
|
/**accessor*/
|
|
27
|
-
set position(arg:
|
|
28
|
-
get position():
|
|
27
|
+
set position(arg: PopupPosition);
|
|
28
|
+
get position(): PopupPosition;
|
|
29
29
|
/**accessor*/
|
|
30
30
|
set open(arg: import("svelte/store").Writable<boolean>);
|
|
31
31
|
get open(): import("svelte/store").Writable<boolean>;
|
|
@@ -37,10 +37,10 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
37
37
|
declare const __propDef: {
|
|
38
38
|
props: {
|
|
39
39
|
[x: string]: any;
|
|
40
|
-
dialog?:
|
|
41
|
-
position?:
|
|
42
|
-
anchor?:
|
|
43
|
-
content?:
|
|
40
|
+
dialog?: HTMLDialogElement | null;
|
|
41
|
+
position?: PopupPosition;
|
|
42
|
+
anchor?: HTMLElement | null;
|
|
43
|
+
content?: HTMLElement | null;
|
|
44
44
|
open?: import("svelte/store").Writable<boolean>;
|
|
45
45
|
};
|
|
46
46
|
events: {
|
package/package/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export function initLocales({ fallbackLocale, initialLocale }?:
|
|
1
|
+
export function initLocales({ fallbackLocale, initialLocale }?: {
|
|
2
|
+
fallbackLocale?: string;
|
|
3
|
+
initialLocale?: string;
|
|
4
|
+
}): void;
|
|
2
5
|
export { default as Calendar } from "./components/composite/calendar.svelte";
|
|
3
6
|
export { default as CheckboxGroup } from "./components/composite/checkbox-group.svelte";
|
|
4
7
|
export { default as Combobox } from "./components/composite/combobox.svelte";
|
package/package/index.js
CHANGED
|
@@ -3,10 +3,13 @@ import { addMessages, init } from 'svelte-i18n';
|
|
|
3
3
|
/**
|
|
4
4
|
* Load strings and initialize the locales.
|
|
5
5
|
* @param {object} [init] Initialize options.
|
|
6
|
+
* @param {string} [init.fallbackLocale] Fallback locale.
|
|
7
|
+
* @param {string} [init.initialLocale] Initial locale.
|
|
6
8
|
* @see https://github.com/kaisermann/svelte-i18n/blob/main/docs/Getting%20Started.md
|
|
7
9
|
* @see https://vitejs.dev/guide/features.html#glob-import
|
|
8
10
|
*/
|
|
9
11
|
export const initLocales = ({ fallbackLocale = 'en', initialLocale = 'en' } = {}) => {
|
|
12
|
+
/** @type {{ [key: string]: { strings: object }}} */
|
|
10
13
|
const modules = import.meta.glob('./locales/*.js', { eager: true });
|
|
11
14
|
|
|
12
15
|
Object.entries(modules).forEach(([path, { strings }]) => {
|
|
@@ -24,45 +27,87 @@ export const initLocales = ({ fallbackLocale = 'en', initialLocale = 'en' } = {}
|
|
|
24
27
|
|
|
25
28
|
initLocales();
|
|
26
29
|
|
|
30
|
+
// @ts-ignore
|
|
27
31
|
export { default as Calendar } from './components/composite/calendar.svelte';
|
|
32
|
+
// @ts-ignore
|
|
28
33
|
export { default as CheckboxGroup } from './components/composite/checkbox-group.svelte';
|
|
34
|
+
// @ts-ignore
|
|
29
35
|
export { default as Combobox } from './components/composite/combobox.svelte';
|
|
36
|
+
// @ts-ignore
|
|
30
37
|
export { default as Disclosure } from './components/composite/disclosure.svelte';
|
|
38
|
+
// @ts-ignore
|
|
31
39
|
export { default as Grid } from './components/composite/grid.svelte';
|
|
40
|
+
// @ts-ignore
|
|
32
41
|
export { default as Listbox } from './components/composite/listbox.svelte';
|
|
42
|
+
// @ts-ignore
|
|
33
43
|
export { default as MenuItemGroup } from './components/composite/menu-item-group.svelte';
|
|
44
|
+
// @ts-ignore
|
|
34
45
|
export { default as Menu } from './components/composite/menu.svelte';
|
|
46
|
+
// @ts-ignore
|
|
35
47
|
export { default as RadioButtonGroup } from './components/composite/radio-button-group.svelte';
|
|
48
|
+
// @ts-ignore
|
|
36
49
|
export { default as SelectButtonGroup } from './components/composite/select-button-group.svelte';
|
|
50
|
+
// @ts-ignore
|
|
37
51
|
export { default as Select } from './components/composite/select.svelte';
|
|
52
|
+
// @ts-ignore
|
|
38
53
|
export { default as TabList } from './components/composite/tab-list.svelte';
|
|
54
|
+
// @ts-ignore
|
|
39
55
|
export { default as Button } from './components/core/button.svelte';
|
|
56
|
+
// @ts-ignore
|
|
40
57
|
export { default as Checkbox } from './components/core/checkbox.svelte';
|
|
58
|
+
// @ts-ignore
|
|
41
59
|
export { default as Dialog } from './components/core/dialog.svelte';
|
|
60
|
+
// @ts-ignore
|
|
42
61
|
export { default as Drawer } from './components/core/drawer.svelte';
|
|
62
|
+
// @ts-ignore
|
|
43
63
|
export { default as GridCell } from './components/core/grid-cell.svelte';
|
|
64
|
+
// @ts-ignore
|
|
44
65
|
export { default as Group } from './components/core/group.svelte';
|
|
66
|
+
// @ts-ignore
|
|
45
67
|
export { default as Icon } from './components/core/icon.svelte';
|
|
68
|
+
// @ts-ignore
|
|
46
69
|
export { default as MenuButton } from './components/core/menu-button.svelte';
|
|
70
|
+
// @ts-ignore
|
|
47
71
|
export { default as MenuItemCheckbox } from './components/core/menu-item-checkbox.svelte';
|
|
72
|
+
// @ts-ignore
|
|
48
73
|
export { default as MenuItemRadio } from './components/core/menu-item-radio.svelte';
|
|
74
|
+
// @ts-ignore
|
|
49
75
|
export { default as MenuItem } from './components/core/menu-item.svelte';
|
|
76
|
+
// @ts-ignore
|
|
50
77
|
export { default as NumberInput } from './components/core/number-input.svelte';
|
|
78
|
+
// @ts-ignore
|
|
51
79
|
export { default as Option } from './components/core/option.svelte';
|
|
80
|
+
// @ts-ignore
|
|
52
81
|
export { default as PasswordInput } from './components/core/password-input.svelte';
|
|
82
|
+
// @ts-ignore
|
|
53
83
|
export { default as RadioButton } from './components/core/radio-button.svelte';
|
|
84
|
+
// @ts-ignore
|
|
54
85
|
export { default as RowGroup } from './components/core/row-group.svelte';
|
|
86
|
+
// @ts-ignore
|
|
55
87
|
export { default as Row } from './components/core/row.svelte';
|
|
88
|
+
// @ts-ignore
|
|
56
89
|
export { default as SearchBar } from './components/core/search-bar.svelte';
|
|
90
|
+
// @ts-ignore
|
|
57
91
|
export { default as SelectButton } from './components/core/select-button.svelte';
|
|
92
|
+
// @ts-ignore
|
|
58
93
|
export { default as Separator } from './components/core/separator.svelte';
|
|
94
|
+
// @ts-ignore
|
|
59
95
|
export { default as Slider } from './components/core/slider.svelte';
|
|
96
|
+
// @ts-ignore
|
|
60
97
|
export { default as Spacer } from './components/core/spacer.svelte';
|
|
98
|
+
// @ts-ignore
|
|
61
99
|
export { default as Switch } from './components/core/switch.svelte';
|
|
100
|
+
// @ts-ignore
|
|
62
101
|
export { default as TabPanel } from './components/core/tab-panel.svelte';
|
|
102
|
+
// @ts-ignore
|
|
63
103
|
export { default as Tab } from './components/core/tab.svelte';
|
|
104
|
+
// @ts-ignore
|
|
64
105
|
export { default as TextArea } from './components/core/text-area.svelte';
|
|
106
|
+
// @ts-ignore
|
|
65
107
|
export { default as TextInput } from './components/core/text-input.svelte';
|
|
108
|
+
// @ts-ignore
|
|
66
109
|
export { default as Toolbar } from './components/core/toolbar.svelte';
|
|
110
|
+
// @ts-ignore
|
|
67
111
|
export { default as MarkdownEditor } from './components/editor/markdown.svelte';
|
|
112
|
+
// @ts-ignore
|
|
68
113
|
export { default as AppShell } from './components/util/app-shell.svelte';
|
package/package/typedef.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
type PopupPosition = ('top-left' | 'top-right' | 'right-top' | 'right-bottom' | 'bottom-left' | 'bottom-right' | 'left-top' | 'left-bottom');
|
package/package/typedef.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltia/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,11 +12,10 @@
|
|
|
12
12
|
"build:watch": "svelte-kit sync && svelte-package -o package --watch",
|
|
13
13
|
"preview": "vite preview",
|
|
14
14
|
"prepublishOnly": "npm run build",
|
|
15
|
-
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
|
|
16
|
-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
|
|
17
15
|
"format": "prettier --plugin-search-dir . --write .",
|
|
18
16
|
"lint": "npm-run-all lint:*",
|
|
19
17
|
"lint:cspell": "cspell --no-progress",
|
|
18
|
+
"lint:svelte": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
|
|
20
19
|
"lint:prettier": "prettier --check --plugin-search-dir=. .",
|
|
21
20
|
"lint:eslint": "eslint .",
|
|
22
21
|
"lint:stylelint": "stylelint '**/*.{css,scss,svelte}'",
|
|
@@ -27,34 +26,33 @@
|
|
|
27
26
|
"svelte": "^3.55.1"
|
|
28
27
|
},
|
|
29
28
|
"devDependencies": {
|
|
30
|
-
"@babel/core": "^7.21.5",
|
|
31
|
-
"@babel/eslint-parser": "^7.21.3",
|
|
32
29
|
"@playwright/test": "^1.33.0",
|
|
33
30
|
"@sveltejs/adapter-auto": "2.0.1",
|
|
34
|
-
"@sveltejs/kit": "1.
|
|
31
|
+
"@sveltejs/kit": "1.16.2",
|
|
35
32
|
"@sveltejs/package": "^2.0.2",
|
|
36
33
|
"cspell": "^6.31.1",
|
|
37
|
-
"eslint": "^8.
|
|
34
|
+
"eslint": "^8.40.0",
|
|
38
35
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
39
36
|
"eslint-config-prettier": "^8.8.0",
|
|
40
37
|
"eslint-plugin-import": "^2.27.5",
|
|
41
|
-
"eslint-plugin-
|
|
38
|
+
"eslint-plugin-jsdoc": "^44.0.0",
|
|
39
|
+
"eslint-plugin-svelte": "^2.27.4",
|
|
42
40
|
"npm-run-all": "^4.1.5",
|
|
43
41
|
"postcss": "^8.4.23",
|
|
44
42
|
"postcss-html": "^1.5.0",
|
|
45
43
|
"prettier": "^2.8.8",
|
|
46
44
|
"prettier-plugin-svelte": "^2.10.0",
|
|
47
45
|
"sass": "^1.62.1",
|
|
48
|
-
"stylelint": "^15.6.
|
|
46
|
+
"stylelint": "^15.6.1",
|
|
49
47
|
"stylelint-config-recommended-scss": "^11.0.0",
|
|
50
48
|
"stylelint-scss": "^5.0.0",
|
|
51
|
-
"svelte-check": "^3.2
|
|
49
|
+
"svelte-check": "^3.3.2",
|
|
52
50
|
"svelte-i18n": "^3.6.0",
|
|
53
51
|
"svelte-migrate": "^1.1.3",
|
|
54
52
|
"svelte-preprocess": "^5.0.3",
|
|
55
53
|
"tslib": "^2.5.0",
|
|
56
|
-
"vite": "^4.3.
|
|
57
|
-
"vitest": "^0.
|
|
54
|
+
"vite": "^4.3.5",
|
|
55
|
+
"vitest": "^0.31.0"
|
|
58
56
|
},
|
|
59
57
|
"exports": {
|
|
60
58
|
"./package.json": "./package.json",
|