@websline/system-components 0.0.1
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/README.md +0 -0
- package/dist/components/atoms/avatar/Avatar.svelte +78 -0
- package/dist/components/atoms/avatar/Avatar.svelte.d.ts +65 -0
- package/dist/components/atoms/avatar/avatar.variants.d.ts +37 -0
- package/dist/components/atoms/avatar/avatar.variants.js +20 -0
- package/dist/components/atoms/closeButton/CloseButton.svelte +92 -0
- package/dist/components/atoms/closeButton/CloseButton.svelte.d.ts +25 -0
- package/dist/components/atoms/closeButton/closeButton.variants.d.ts +37 -0
- package/dist/components/atoms/closeButton/closeButton.variants.js +21 -0
- package/dist/components/atoms/form/button/Button.svelte +67 -0
- package/dist/components/atoms/form/button/Button.svelte.d.ts +81 -0
- package/dist/components/atoms/form/button/button.variants.d.ts +58 -0
- package/dist/components/atoms/form/button/button.variants.js +82 -0
- package/dist/components/atoms/form/formField/FormField.svelte +69 -0
- package/dist/components/atoms/form/formField/FormField.svelte.d.ts +73 -0
- package/dist/components/atoms/form/helperText/HelperText.svelte +18 -0
- package/dist/components/atoms/form/helperText/HelperText.svelte.d.ts +15 -0
- package/dist/components/atoms/form/iconButton/IconButton.svelte +69 -0
- package/dist/components/atoms/form/iconButton/IconButton.svelte.d.ts +89 -0
- package/dist/components/atoms/form/iconButton/iconButton.variants.d.ts +64 -0
- package/dist/components/atoms/form/iconButton/iconButton.variants.js +91 -0
- package/dist/components/atoms/form/input/Input.svelte +65 -0
- package/dist/components/atoms/form/input/Input.svelte.d.ts +89 -0
- package/dist/components/atoms/form/input/input.variants.d.ts +22 -0
- package/dist/components/atoms/form/input/input.variants.js +15 -0
- package/dist/components/atoms/form/label/Label.svelte +36 -0
- package/dist/components/atoms/form/label/Label.svelte.d.ts +41 -0
- package/dist/components/atoms/form/textarea/Textarea.svelte +64 -0
- package/dist/components/atoms/form/textarea/Textarea.svelte.d.ts +89 -0
- package/dist/components/atoms/form/textarea/textarea.variants.d.ts +37 -0
- package/dist/components/atoms/form/textarea/textarea.variants.js +20 -0
- package/dist/components/atoms/icon/Icon.svelte +41 -0
- package/dist/components/atoms/icon/Icon.svelte.d.ts +21 -0
- package/dist/components/atoms/icon/components/Academy.svelte +27 -0
- package/dist/components/atoms/icon/components/Academy.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Bold.svelte +27 -0
- package/dist/components/atoms/icon/components/Bold.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Close.svelte +27 -0
- package/dist/components/atoms/icon/components/Close.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Italic.svelte +27 -0
- package/dist/components/atoms/icon/components/Italic.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Link.svelte +27 -0
- package/dist/components/atoms/icon/components/Link.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/ListOrdered.svelte +27 -0
- package/dist/components/atoms/icon/components/ListOrdered.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/ListUnordered.svelte +26 -0
- package/dist/components/atoms/icon/components/ListUnordered.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Refresh.svelte +27 -0
- package/dist/components/atoms/icon/components/Refresh.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Underline.svelte +26 -0
- package/dist/components/atoms/icon/components/Underline.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/index.d.ts +20 -0
- package/dist/components/atoms/icon/index.js +21 -0
- package/dist/components/atoms/loading/spinner/Spinner.svelte +40 -0
- package/dist/components/atoms/loading/spinner/Spinner.svelte.d.ts +25 -0
- package/dist/components/molecules/notification/Notification.svelte +42 -0
- package/dist/components/molecules/notification/Notification.svelte.d.ts +57 -0
- package/dist/components/molecules/notification/notification.variants.d.ts +67 -0
- package/dist/components/molecules/notification/notification.variants.js +30 -0
- package/dist/components/molecules/richTextEditor/RichTextEditor.svelte +144 -0
- package/dist/components/molecules/richTextEditor/RichTextEditor.svelte.d.ts +87 -0
- package/dist/components/molecules/richTextEditor/RichTextEditorToolbar.svelte +5 -0
- package/dist/components/molecules/richTextEditor/RichTextEditorToolbar.svelte.d.ts +11 -0
- package/dist/components/molecules/richTextEditor/richTextEditor.variants.d.ts +64 -0
- package/dist/components/molecules/richTextEditor/richTextEditor.variants.js +30 -0
- package/dist/components/molecules/toggleGroup/ToggleGroup.svelte +61 -0
- package/dist/components/molecules/toggleGroup/ToggleGroup.svelte.d.ts +49 -0
- package/dist/components/molecules/toggleGroup/ToggleGroupItem.svelte +47 -0
- package/dist/components/molecules/toggleGroup/ToggleGroupItem.svelte.d.ts +25 -0
- package/dist/components/molecules/toggleGroup/toggleGroup.variants.d.ts +35 -0
- package/dist/components/molecules/toggleGroup/toggleGroup.variants.js +21 -0
- package/dist/components/molecules/toggleGroup/toggleGroupItem.variants.d.ts +110 -0
- package/dist/components/molecules/toggleGroup/toggleGroupItem.variants.js +69 -0
- package/dist/components/organisms/notificationGroup/NotificationGroup.svelte +68 -0
- package/dist/components/organisms/notificationGroup/NotificationGroup.svelte.d.ts +6 -0
- package/dist/components/organisms/notificationGroup/notificationGroup.variants.d.ts +24 -0
- package/dist/components/organisms/notificationGroup/notificationGroup.variants.js +11 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +32 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/notification.d.ts +1 -0
- package/dist/utils/notification.js +11 -0
- package/package.json +95 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default Link;
|
|
2
|
+
type Link = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Link: import("svelte").Component<{
|
|
7
|
+
/**
|
|
8
|
+
* Icon color
|
|
9
|
+
*/
|
|
10
|
+
color?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Icon height
|
|
13
|
+
*/
|
|
14
|
+
height?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Icon StrokeWidth
|
|
17
|
+
*/
|
|
18
|
+
strokeWidth?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Icon width
|
|
21
|
+
*/
|
|
22
|
+
width?: number;
|
|
23
|
+
}, {}, "">;
|
|
24
|
+
type Props = {
|
|
25
|
+
/**
|
|
26
|
+
* Icon color
|
|
27
|
+
*/
|
|
28
|
+
color?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Icon height
|
|
31
|
+
*/
|
|
32
|
+
height?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Icon StrokeWidth
|
|
35
|
+
*/
|
|
36
|
+
strokeWidth?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Icon width
|
|
39
|
+
*/
|
|
40
|
+
width?: number;
|
|
41
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {Object} Props
|
|
4
|
+
* @property {string} [color=""] Icon color
|
|
5
|
+
* @property {number} [height=24] Icon height
|
|
6
|
+
* @property {number} [strokeWidth=24] Icon StrokeWidth
|
|
7
|
+
* @property {number} [width=24] Icon width
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** @type {Props} */
|
|
11
|
+
let { color, height, width, strokeWidth, ...rest } = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<svg
|
|
15
|
+
{height}
|
|
16
|
+
{width}
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
fill="none"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
{...rest}>
|
|
21
|
+
<path
|
|
22
|
+
d="M10 4H21M10 9.33333H21M10 14.6667H21M10 20H21M3 14.6667H6V16.2667L3 19.4667V20H6M3.5 5.06667L4.5 4V9.33333M4.5 9.33333H3.5M4.5 9.33333H5.5"
|
|
23
|
+
stroke={color}
|
|
24
|
+
stroke-width={strokeWidth}
|
|
25
|
+
stroke-linecap="round"
|
|
26
|
+
stroke-linejoin="round" />
|
|
27
|
+
</svg>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default ListOrdered;
|
|
2
|
+
type ListOrdered = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const ListOrdered: import("svelte").Component<{
|
|
7
|
+
/**
|
|
8
|
+
* Icon color
|
|
9
|
+
*/
|
|
10
|
+
color?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Icon height
|
|
13
|
+
*/
|
|
14
|
+
height?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Icon StrokeWidth
|
|
17
|
+
*/
|
|
18
|
+
strokeWidth?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Icon width
|
|
21
|
+
*/
|
|
22
|
+
width?: number;
|
|
23
|
+
}, {}, "">;
|
|
24
|
+
type Props = {
|
|
25
|
+
/**
|
|
26
|
+
* Icon color
|
|
27
|
+
*/
|
|
28
|
+
color?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Icon height
|
|
31
|
+
*/
|
|
32
|
+
height?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Icon StrokeWidth
|
|
35
|
+
*/
|
|
36
|
+
strokeWidth?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Icon width
|
|
39
|
+
*/
|
|
40
|
+
width?: number;
|
|
41
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {Object} Props
|
|
4
|
+
* @property {string} [color=""] Icon color
|
|
5
|
+
* @property {number} [height=24] Icon height
|
|
6
|
+
* @property {number} [strokeWidth=24] Icon StrokeWidth
|
|
7
|
+
* @property {number} [width=24] Icon width
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** @type {Props} */
|
|
11
|
+
let { color, height, width, strokeWidth, ...rest } = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<svg
|
|
15
|
+
{height}
|
|
16
|
+
{width}
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
fill="none"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
{...rest}>
|
|
21
|
+
<path
|
|
22
|
+
d="M10.2 12H21M10.2 19H21M10.2 5H21M3 17H6.6V21H3V17ZM3 10H6.6V14H3V10ZM3 3H6.6V7H3V3Z"
|
|
23
|
+
stroke={color}
|
|
24
|
+
stroke-width={strokeWidth}
|
|
25
|
+
stroke-linejoin="round" />
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default ListUnordered;
|
|
2
|
+
type ListUnordered = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const ListUnordered: import("svelte").Component<{
|
|
7
|
+
/**
|
|
8
|
+
* Icon color
|
|
9
|
+
*/
|
|
10
|
+
color?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Icon height
|
|
13
|
+
*/
|
|
14
|
+
height?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Icon StrokeWidth
|
|
17
|
+
*/
|
|
18
|
+
strokeWidth?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Icon width
|
|
21
|
+
*/
|
|
22
|
+
width?: number;
|
|
23
|
+
}, {}, "">;
|
|
24
|
+
type Props = {
|
|
25
|
+
/**
|
|
26
|
+
* Icon color
|
|
27
|
+
*/
|
|
28
|
+
color?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Icon height
|
|
31
|
+
*/
|
|
32
|
+
height?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Icon StrokeWidth
|
|
35
|
+
*/
|
|
36
|
+
strokeWidth?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Icon width
|
|
39
|
+
*/
|
|
40
|
+
width?: number;
|
|
41
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {Object} Props
|
|
4
|
+
* @property {string} [color=""] Icon color
|
|
5
|
+
* @property {number} [height=24] Icon height
|
|
6
|
+
* @property {number} [strokeWidth=24] Icon StrokeWidth
|
|
7
|
+
* @property {number} [width=24] Icon width
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** @type {Props} */
|
|
11
|
+
let { color, height, width, strokeWidth, ...rest } = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<svg
|
|
15
|
+
{height}
|
|
16
|
+
{width}
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
fill="none"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
{...rest}>
|
|
21
|
+
<path
|
|
22
|
+
d="M21 4V12C21 7.02945 16.9706 3 12 3C9.45725 3 7.1608 4.05448 5.52405 5.75M3 20V12C3 16.9706 7.02945 21 12 21C14.4278 21 16.6311 20.0387 18.25 18.476"
|
|
23
|
+
stroke={color}
|
|
24
|
+
stroke-width={strokeWidth}
|
|
25
|
+
stroke-linecap="round"
|
|
26
|
+
stroke-linejoin="round" />
|
|
27
|
+
</svg>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default Refresh;
|
|
2
|
+
type Refresh = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Refresh: import("svelte").Component<{
|
|
7
|
+
/**
|
|
8
|
+
* Icon color
|
|
9
|
+
*/
|
|
10
|
+
color?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Icon height
|
|
13
|
+
*/
|
|
14
|
+
height?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Icon StrokeWidth
|
|
17
|
+
*/
|
|
18
|
+
strokeWidth?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Icon width
|
|
21
|
+
*/
|
|
22
|
+
width?: number;
|
|
23
|
+
}, {}, "">;
|
|
24
|
+
type Props = {
|
|
25
|
+
/**
|
|
26
|
+
* Icon color
|
|
27
|
+
*/
|
|
28
|
+
color?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Icon height
|
|
31
|
+
*/
|
|
32
|
+
height?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Icon StrokeWidth
|
|
35
|
+
*/
|
|
36
|
+
strokeWidth?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Icon width
|
|
39
|
+
*/
|
|
40
|
+
width?: number;
|
|
41
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {Object} Props
|
|
4
|
+
* @property {string} [color=""] Icon color
|
|
5
|
+
* @property {number} [height=24] Icon height
|
|
6
|
+
* @property {number} [strokeWidth=24] Icon StrokeWidth
|
|
7
|
+
* @property {number} [width=24] Icon width
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** @type {Props} */
|
|
11
|
+
let { color, height, width, strokeWidth, ...rest } = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<svg
|
|
15
|
+
{height}
|
|
16
|
+
{width}
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
fill="none"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
{...rest}>
|
|
21
|
+
<path
|
|
22
|
+
d="M4 21H20M18 3C18 6.22917 18 7.47388 18 10.7031C18 14.1808 15.3137 17 12 17C8.68629 17 6 14.1808 6 10.7031C6 7.47388 6 6.22917 6 3"
|
|
23
|
+
stroke={color}
|
|
24
|
+
stroke-width={strokeWidth}
|
|
25
|
+
stroke-linecap="round" />
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default Underline;
|
|
2
|
+
type Underline = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Underline: import("svelte").Component<{
|
|
7
|
+
/**
|
|
8
|
+
* Icon color
|
|
9
|
+
*/
|
|
10
|
+
color?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Icon height
|
|
13
|
+
*/
|
|
14
|
+
height?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Icon StrokeWidth
|
|
17
|
+
*/
|
|
18
|
+
strokeWidth?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Icon width
|
|
21
|
+
*/
|
|
22
|
+
width?: number;
|
|
23
|
+
}, {}, "">;
|
|
24
|
+
type Props = {
|
|
25
|
+
/**
|
|
26
|
+
* Icon color
|
|
27
|
+
*/
|
|
28
|
+
color?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Icon height
|
|
31
|
+
*/
|
|
32
|
+
height?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Icon StrokeWidth
|
|
35
|
+
*/
|
|
36
|
+
strokeWidth?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Icon width
|
|
39
|
+
*/
|
|
40
|
+
width?: number;
|
|
41
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export namespace registry {
|
|
2
|
+
export { Academy as academy };
|
|
3
|
+
export { Bold as bold };
|
|
4
|
+
export { Close as close };
|
|
5
|
+
export { Italic as italic };
|
|
6
|
+
export { Link as link };
|
|
7
|
+
export { ListOrdered as listOrdered };
|
|
8
|
+
export { ListUnordered as listUnordered };
|
|
9
|
+
export { Refresh as refresh };
|
|
10
|
+
export { Underline as underline };
|
|
11
|
+
}
|
|
12
|
+
import Academy from "./components/Academy.svelte";
|
|
13
|
+
import Bold from "./components/Bold.svelte";
|
|
14
|
+
import Close from "./components/Close.svelte";
|
|
15
|
+
import Italic from "./components/Italic.svelte";
|
|
16
|
+
import Link from "./components/Link.svelte";
|
|
17
|
+
import ListOrdered from "./components/ListOrdered.svelte";
|
|
18
|
+
import ListUnordered from "./components/ListUnordered.svelte";
|
|
19
|
+
import Refresh from "./components/Refresh.svelte";
|
|
20
|
+
import Underline from "./components/Underline.svelte";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Academy from "./components/Academy.svelte";
|
|
2
|
+
import Bold from "./components/Bold.svelte";
|
|
3
|
+
import Close from "./components/Close.svelte";
|
|
4
|
+
import Italic from "./components/Italic.svelte";
|
|
5
|
+
import Link from "./components/Link.svelte";
|
|
6
|
+
import ListOrdered from "./components/ListOrdered.svelte";
|
|
7
|
+
import ListUnordered from "./components/ListUnordered.svelte";
|
|
8
|
+
import Refresh from "./components/Refresh.svelte";
|
|
9
|
+
import Underline from "./components/Underline.svelte";
|
|
10
|
+
|
|
11
|
+
export const registry = {
|
|
12
|
+
academy: Academy,
|
|
13
|
+
bold: Bold,
|
|
14
|
+
close: Close,
|
|
15
|
+
italic: Italic,
|
|
16
|
+
link: Link,
|
|
17
|
+
listOrdered: ListOrdered,
|
|
18
|
+
listUnordered: ListUnordered,
|
|
19
|
+
refresh: Refresh,
|
|
20
|
+
underline: Underline,
|
|
21
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { tv } from "tailwind-variants";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {Object} Props
|
|
6
|
+
* @property {"small" | "medium" | "large"} [size="medium"] Spinner size
|
|
7
|
+
* @property {string} [class=""] Additional CSS classes to apply to the component
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** @type {Props} */
|
|
11
|
+
let { class: className = "", size = "medium" } = $props();
|
|
12
|
+
|
|
13
|
+
const spinnerVariants = tv({
|
|
14
|
+
base: "inline-flex animate-[spin_0.7s_linear_infinite]",
|
|
15
|
+
variants: {
|
|
16
|
+
size: {
|
|
17
|
+
small: "h-4 w-4",
|
|
18
|
+
medium: "h-6 w-6",
|
|
19
|
+
large: "h-8 w-8",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
size: "medium",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<svg
|
|
29
|
+
class={spinnerVariants({ class: className, size })}
|
|
30
|
+
role="status"
|
|
31
|
+
viewBox="0 0 100 101"
|
|
32
|
+
fill="none"
|
|
33
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
34
|
+
<path
|
|
35
|
+
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
|
|
36
|
+
fill="#fff"></path>
|
|
37
|
+
<path
|
|
38
|
+
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
|
39
|
+
fill="#77736f"></path>
|
|
40
|
+
</svg>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default Spinner;
|
|
2
|
+
type Spinner = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Spinner: import("svelte").Component<{
|
|
7
|
+
/**
|
|
8
|
+
* Spinner size
|
|
9
|
+
*/
|
|
10
|
+
size?: "small" | "medium" | "large";
|
|
11
|
+
/**
|
|
12
|
+
* Additional CSS classes to apply to the component
|
|
13
|
+
*/
|
|
14
|
+
class?: string;
|
|
15
|
+
}, {}, "">;
|
|
16
|
+
type Props = {
|
|
17
|
+
/**
|
|
18
|
+
* Spinner size
|
|
19
|
+
*/
|
|
20
|
+
size?: "small" | "medium" | "large";
|
|
21
|
+
/**
|
|
22
|
+
* Additional CSS classes to apply to the component
|
|
23
|
+
*/
|
|
24
|
+
class?: string;
|
|
25
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { CloseButton, Icon } from "../../../index.js";
|
|
3
|
+
import { notificationVariants } from "./notification.variants.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {Object} Props
|
|
7
|
+
* @property {boolean} [autoClose=true] Whether to automatically close the notification after a duration
|
|
8
|
+
* @property {string} [class=""] Additional CSS classes to apply to the component
|
|
9
|
+
* @property {string} [icon=""] Icon to display in the notification
|
|
10
|
+
* @property {string} [message=""] Message to display in the notification
|
|
11
|
+
* @property {string} [title=""] Title to display in the notification
|
|
12
|
+
* @property {"info" | "success" | "warning" | "danger"} [variant="info"] Notification variant
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** @type {Props} */
|
|
16
|
+
let {
|
|
17
|
+
autoClose = true,
|
|
18
|
+
class: className = "",
|
|
19
|
+
icon = "",
|
|
20
|
+
message = "",
|
|
21
|
+
onClose,
|
|
22
|
+
title = "",
|
|
23
|
+
variant = "",
|
|
24
|
+
} = $props();
|
|
25
|
+
|
|
26
|
+
let styles = $derived(notificationVariants({ variant }));
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<div class={styles.base({ class: className })}>
|
|
30
|
+
<div class={styles.icon({ variant })}>
|
|
31
|
+
<Icon name={icon} />
|
|
32
|
+
</div>
|
|
33
|
+
<div class={styles.content()}>
|
|
34
|
+
{#if title}
|
|
35
|
+
<p class={styles.title()}>{title}</p>
|
|
36
|
+
{/if}
|
|
37
|
+
{#if message}
|
|
38
|
+
<p class={styles.message()}>{message}</p>
|
|
39
|
+
{/if}
|
|
40
|
+
</div>
|
|
41
|
+
<CloseButton {autoClose} class={styles.close()} {onClose} />
|
|
42
|
+
</div>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export default Notification;
|
|
2
|
+
type Notification = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Notification: import("svelte").Component<{
|
|
7
|
+
/**
|
|
8
|
+
* Whether to automatically close the notification after a duration
|
|
9
|
+
*/
|
|
10
|
+
autoClose?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Additional CSS classes to apply to the component
|
|
13
|
+
*/
|
|
14
|
+
class?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Icon to display in the notification
|
|
17
|
+
*/
|
|
18
|
+
icon?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Message to display in the notification
|
|
21
|
+
*/
|
|
22
|
+
message?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Title to display in the notification
|
|
25
|
+
*/
|
|
26
|
+
title?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Notification variant
|
|
29
|
+
*/
|
|
30
|
+
variant?: "info" | "success" | "warning" | "danger";
|
|
31
|
+
}, {}, "">;
|
|
32
|
+
type Props = {
|
|
33
|
+
/**
|
|
34
|
+
* Whether to automatically close the notification after a duration
|
|
35
|
+
*/
|
|
36
|
+
autoClose?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Additional CSS classes to apply to the component
|
|
39
|
+
*/
|
|
40
|
+
class?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Icon to display in the notification
|
|
43
|
+
*/
|
|
44
|
+
icon?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Message to display in the notification
|
|
47
|
+
*/
|
|
48
|
+
message?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Title to display in the notification
|
|
51
|
+
*/
|
|
52
|
+
title?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Notification variant
|
|
55
|
+
*/
|
|
56
|
+
variant?: "info" | "success" | "warning" | "danger";
|
|
57
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export const notificationVariants: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
variant: {
|
|
3
|
+
info: {
|
|
4
|
+
icon: string;
|
|
5
|
+
};
|
|
6
|
+
success: {
|
|
7
|
+
icon: string;
|
|
8
|
+
};
|
|
9
|
+
warning: {
|
|
10
|
+
icon: string;
|
|
11
|
+
};
|
|
12
|
+
danger: {
|
|
13
|
+
icon: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
base: string;
|
|
18
|
+
close: string;
|
|
19
|
+
icon: string;
|
|
20
|
+
content: string;
|
|
21
|
+
message: string;
|
|
22
|
+
title: string;
|
|
23
|
+
}, undefined, {
|
|
24
|
+
variant: {
|
|
25
|
+
info: {
|
|
26
|
+
icon: string;
|
|
27
|
+
};
|
|
28
|
+
success: {
|
|
29
|
+
icon: string;
|
|
30
|
+
};
|
|
31
|
+
warning: {
|
|
32
|
+
icon: string;
|
|
33
|
+
};
|
|
34
|
+
danger: {
|
|
35
|
+
icon: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
}, {
|
|
39
|
+
base: string;
|
|
40
|
+
close: string;
|
|
41
|
+
icon: string;
|
|
42
|
+
content: string;
|
|
43
|
+
message: string;
|
|
44
|
+
title: string;
|
|
45
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
46
|
+
variant: {
|
|
47
|
+
info: {
|
|
48
|
+
icon: string;
|
|
49
|
+
};
|
|
50
|
+
success: {
|
|
51
|
+
icon: string;
|
|
52
|
+
};
|
|
53
|
+
warning: {
|
|
54
|
+
icon: string;
|
|
55
|
+
};
|
|
56
|
+
danger: {
|
|
57
|
+
icon: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
}, {
|
|
61
|
+
base: string;
|
|
62
|
+
close: string;
|
|
63
|
+
icon: string;
|
|
64
|
+
content: string;
|
|
65
|
+
message: string;
|
|
66
|
+
title: string;
|
|
67
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
|
|
3
|
+
const notificationVariants = tv({
|
|
4
|
+
slots: {
|
|
5
|
+
base: "bg-white dark:bg-neutral-900 border-neutral-300 dark:border-neutral-700 border-1 rounded-lg p-2 grid grid-cols-[40px_1fr_24px] gap-2",
|
|
6
|
+
close: "col-[3] self-start",
|
|
7
|
+
icon: "flex h-10 items-center justify-center rounded-sm text-white w-10",
|
|
8
|
+
content: "flex flex-col justify-center",
|
|
9
|
+
message: "body-extra-small text-neutral-500",
|
|
10
|
+
title: "body-default dark:text-white",
|
|
11
|
+
},
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
info: {
|
|
15
|
+
icon: "bg-blue-500",
|
|
16
|
+
},
|
|
17
|
+
success: {
|
|
18
|
+
icon: "bg-green-500",
|
|
19
|
+
},
|
|
20
|
+
warning: {
|
|
21
|
+
icon: "bg-yellow-500",
|
|
22
|
+
},
|
|
23
|
+
danger: {
|
|
24
|
+
icon: "bg-red-500",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export { notificationVariants };
|