@hyvor/design 0.0.67 → 1.0.3
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/dist/components/ActionList/ActionList.svelte +21 -13
- package/dist/components/ActionList/ActionList.svelte.d.ts +8 -20
- package/dist/components/ActionList/ActionListGroup.svelte +40 -35
- package/dist/components/ActionList/ActionListGroup.svelte.d.ts +8 -20
- package/dist/components/ActionList/ActionListItem.svelte +129 -107
- package/dist/components/ActionList/ActionListItem.svelte.d.ts +27 -25
- package/dist/components/ActionList/Selected.svelte +27 -24
- package/dist/components/ActionList/Selected.svelte.d.ts +6 -17
- package/dist/components/Avatar/Avatar.svelte +22 -19
- package/dist/components/Avatar/Avatar.svelte.d.ts +7 -18
- package/dist/components/Avatar/AvatarStack.svelte +29 -27
- package/dist/components/Avatar/AvatarStack.svelte.d.ts +6 -18
- package/dist/components/Base/Base.svelte +16 -8
- package/dist/components/Base/Base.svelte.d.ts +6 -18
- package/dist/components/Box/Box.svelte +16 -9
- package/dist/components/Box/Box.svelte.d.ts +7 -19
- package/dist/components/Button/Button.svelte +65 -47
- package/dist/components/Button/Button.svelte.d.ts +16 -39
- package/dist/components/Button/ButtonGroup.svelte +14 -6
- package/dist/components/Button/ButtonGroup.svelte.d.ts +5 -27
- package/dist/components/Callout/Callout.svelte +110 -87
- package/dist/components/Callout/Callout.svelte.d.ts +11 -22
- package/dist/components/Checkbox/Checkbox.svelte +156 -144
- package/dist/components/Checkbox/Checkbox.svelte.d.ts +11 -34
- package/dist/components/CodeBlock/CodeBlock.svelte +45 -32
- package/dist/components/CodeBlock/CodeBlock.svelte.d.ts +6 -17
- package/dist/components/CodeBlock/getCode.js +8 -6
- package/dist/components/CodeBlock/hljs.scss +189 -191
- package/dist/components/CodeBlock/prism.scss +370 -7
- package/dist/components/ColorPicker/ColorPicker.svelte +75 -56
- package/dist/components/ColorPicker/ColorPicker.svelte.d.ts +25 -19
- package/dist/components/Dark/DarkProvider.svelte +16 -14
- package/dist/components/Dark/DarkProvider.svelte.d.ts +16 -12
- package/dist/components/Dark/DarkToggle.svelte +15 -16
- package/dist/components/Dark/DarkToggle.svelte.d.ts +16 -12
- package/dist/components/Divider/Divider.svelte +23 -13
- package/dist/components/Divider/Divider.svelte.d.ts +9 -20
- package/dist/components/Dropdown/Dropdown.svelte +58 -114
- package/dist/components/Dropdown/Dropdown.svelte.d.ts +13 -24
- package/dist/components/Dropdown/DropdownContent.svelte +152 -0
- package/dist/components/Dropdown/DropdownContent.svelte.d.ts +12 -0
- package/dist/components/FormControl/Caption.svelte +18 -11
- package/dist/components/FormControl/Caption.svelte.d.ts +7 -19
- package/dist/components/FormControl/FormControl.svelte +28 -19
- package/dist/components/FormControl/FormControl.svelte.d.ts +6 -27
- package/dist/components/FormControl/InputGroup.svelte +22 -15
- package/dist/components/FormControl/InputGroup.svelte.d.ts +7 -19
- package/dist/components/FormControl/Label.svelte +15 -6
- package/dist/components/FormControl/Label.svelte.d.ts +6 -27
- package/dist/components/FormControl/Validation.svelte +30 -19
- package/dist/components/FormControl/Validation.svelte.d.ts +9 -21
- package/dist/components/HyvorBar/BarProducts.svelte +71 -0
- package/dist/components/HyvorBar/BarProducts.svelte.d.ts +32 -0
- package/dist/components/HyvorBar/BarSupport.svelte +183 -0
- package/dist/components/HyvorBar/BarSupport.svelte.d.ts +8 -0
- package/dist/components/HyvorBar/BarUpdates.svelte +68 -0
- package/dist/components/HyvorBar/BarUpdates.svelte.d.ts +7 -0
- package/dist/components/HyvorBar/BarUpdatesList.svelte +159 -0
- package/dist/components/HyvorBar/BarUpdatesList.svelte.d.ts +7 -0
- package/dist/components/HyvorBar/BarUser.svelte +72 -0
- package/dist/components/HyvorBar/BarUser.svelte.d.ts +5 -0
- package/dist/components/HyvorBar/BarUserPreview.svelte +43 -0
- package/dist/components/HyvorBar/BarUserPreview.svelte.d.ts +18 -0
- package/dist/components/HyvorBar/HyvorBar.svelte +183 -0
- package/dist/components/HyvorBar/HyvorBar.svelte.d.ts +8 -0
- package/dist/components/HyvorBar/bar.d.ts +33 -0
- package/dist/components/HyvorBar/bar.js +74 -0
- package/dist/components/HyvorBar/img/G2.svelte +9 -0
- package/dist/components/HyvorBar/img/G2.svelte.d.ts +26 -0
- package/dist/components/HyvorBar/img/Trustpilot.svelte +11 -0
- package/dist/components/HyvorBar/img/Trustpilot.svelte.d.ts +26 -0
- package/dist/components/IconButton/IconButton.svelte +49 -32
- package/dist/components/IconButton/IconButton.svelte.d.ts +10 -33
- package/dist/components/IconMessage/IconMessage.svelte +157 -51
- package/dist/components/IconMessage/IconMessage.svelte.d.ts +19 -27
- package/dist/components/Internationalization/InternationalizationProvider.svelte +15 -8
- package/dist/components/Internationalization/InternationalizationProvider.svelte.d.ts +7 -19
- package/dist/components/Internationalization/LanguageToggle.svelte +80 -57
- package/dist/components/Internationalization/LanguageToggle.svelte.d.ts +11 -22
- package/dist/components/Internationalization/T.svelte +158 -114
- package/dist/components/Internationalization/T.svelte.d.ts +17 -15
- package/dist/components/Internationalization/i18n.d.ts +3 -5
- package/dist/components/Internationalization/i18n.js +13 -11
- package/dist/components/Internationalization/t.d.ts +2 -3
- package/dist/components/Internationalization/t.js +4 -4
- package/dist/components/Internationalization/types.d.ts +2 -1
- package/dist/components/Link/Link.svelte +68 -61
- package/dist/components/Link/Link.svelte.d.ts +11 -34
- package/dist/components/Loader/LoadButton.svelte +39 -38
- package/dist/components/Loader/LoadButton.svelte.d.ts +29 -42
- package/dist/components/Loader/Loader.svelte +121 -107
- package/dist/components/Loader/Loader.svelte.d.ts +15 -27
- package/dist/components/Modal/ConfirmModalProvider.svelte +41 -51
- package/dist/components/Modal/ConfirmModalProvider.svelte.d.ts +3 -14
- package/dist/components/Modal/Modal.svelte +202 -203
- package/dist/components/Modal/Modal.svelte.d.ts +31 -29
- package/dist/components/Modal/ModalFooter.svelte +36 -31
- package/dist/components/Modal/ModalFooter.svelte.d.ts +22 -18
- package/dist/components/Modal/confirm.d.ts +2 -2
- package/dist/components/Modal/confirm.js +4 -4
- package/dist/components/Modal/modal-types.d.ts +4 -4
- package/dist/components/NavLink/NavLink.svelte +94 -89
- package/dist/components/NavLink/NavLink.svelte.d.ts +11 -33
- package/dist/components/Radio/Radio.svelte +46 -35
- package/dist/components/Radio/Radio.svelte.d.ts +10 -33
- package/dist/components/Slider/Slider.svelte +129 -120
- package/dist/components/Slider/Slider.svelte.d.ts +24 -20
- package/dist/components/SplitControl/SplitControl.svelte +43 -48
- package/dist/components/SplitControl/SplitControl.svelte.d.ts +11 -24
- package/dist/components/Switch/Switch.svelte +77 -67
- package/dist/components/Switch/Switch.svelte.d.ts +8 -31
- package/dist/components/TabNav/TabNav.svelte +33 -23
- package/dist/components/TabNav/TabNav.svelte.d.ts +7 -19
- package/dist/components/TabNav/TabNavItem.svelte +65 -51
- package/dist/components/TabNav/TabNavItem.svelte.d.ts +10 -24
- package/dist/components/Table/Table.svelte +17 -7
- package/dist/components/Table/Table.svelte.d.ts +7 -19
- package/dist/components/Table/TableRow.svelte +32 -24
- package/dist/components/Table/TableRow.svelte.d.ts +7 -19
- package/dist/components/Tag/Tag.svelte +75 -49
- package/dist/components/Tag/Tag.svelte.d.ts +16 -39
- package/dist/components/Text/Text.svelte +33 -26
- package/dist/components/Text/Text.svelte.d.ts +10 -22
- package/dist/components/TextInput/TextInput.svelte +54 -33
- package/dist/components/TextInput/TextInput.svelte.d.ts +12 -36
- package/dist/components/Textarea/Textarea.svelte +68 -46
- package/dist/components/Textarea/Textarea.svelte.d.ts +13 -37
- package/dist/components/Toast/ToastIcon.svelte +55 -46
- package/dist/components/Toast/ToastIcon.svelte.d.ts +5 -16
- package/dist/components/Toast/ToastMessage.svelte +42 -41
- package/dist/components/Toast/ToastMessage.svelte.d.ts +5 -16
- package/dist/components/Toast/ToastProvider.svelte +22 -20
- package/dist/components/Toast/ToastProvider.svelte.d.ts +16 -12
- package/dist/components/Toast/cleaner.js +5 -5
- package/dist/components/Toast/toast.d.ts +3 -3
- package/dist/components/Toast/toast.js +10 -10
- package/dist/components/Tooltip/Tooltip.svelte +163 -148
- package/dist/components/Tooltip/Tooltip.svelte.d.ts +35 -23
- package/dist/components/directives/clickOutside.js +4 -4
- package/dist/components/directives/debounce.d.ts +1 -0
- package/dist/components/directives/debounce.js +8 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/index.css +31 -33
- package/dist/marketing/Container/Container.svelte +15 -9
- package/dist/marketing/Container/Container.svelte.d.ts +6 -18
- package/dist/marketing/Docs/Content/Content.svelte +48 -35
- package/dist/marketing/Docs/Content/Content.svelte.d.ts +5 -16
- package/dist/marketing/Docs/Content/DocsImage.svelte +67 -69
- package/dist/marketing/Docs/Content/DocsImage.svelte.d.ts +9 -20
- package/dist/marketing/Docs/Docs.svelte +28 -25
- package/dist/marketing/Docs/Docs.svelte.d.ts +6 -29
- package/dist/marketing/Docs/Nav/Nav.svelte +96 -70
- package/dist/marketing/Docs/Nav/Nav.svelte.d.ts +5 -16
- package/dist/marketing/Docs/Nav/NavCategory.svelte +39 -29
- package/dist/marketing/Docs/Nav/NavCategory.svelte.d.ts +8 -20
- package/dist/marketing/Docs/Nav/NavItem.svelte +30 -26
- package/dist/marketing/Docs/Nav/NavItem.svelte.d.ts +6 -18
- package/dist/marketing/Docs/Sidebar/Sidebar.svelte +22 -25
- package/dist/marketing/Docs/Sidebar/Sidebar.svelte.d.ts +22 -19
- package/dist/marketing/Docs/Toc.svelte +64 -56
- package/dist/marketing/Docs/Toc.svelte.d.ts +3 -14
- package/dist/marketing/Document/Document.svelte +15 -8
- package/dist/marketing/Document/Document.svelte.d.ts +7 -19
- package/dist/marketing/Document/DocumentTitle.svelte +65 -54
- package/dist/marketing/Document/DocumentTitle.svelte.d.ts +9 -20
- package/dist/marketing/Footer/Footer.svelte +154 -145
- package/dist/marketing/Footer/Footer.svelte.d.ts +8 -20
- package/dist/marketing/Footer/FooterLinkList.svelte +31 -27
- package/dist/marketing/Footer/FooterLinkList.svelte.d.ts +6 -18
- package/dist/marketing/Header/Header.svelte +47 -37
- package/dist/marketing/Header/Header.svelte.d.ts +10 -22
- package/dist/marketing/Logo/LogoBlogs.svelte +46 -0
- package/dist/marketing/Logo/LogoBlogs.svelte.d.ts +5 -0
- package/dist/marketing/Logo/LogoCore.svelte +46 -0
- package/dist/marketing/Logo/LogoCore.svelte.d.ts +5 -0
- package/dist/marketing/Logo/LogoFortguard.svelte +54 -0
- package/dist/marketing/Logo/LogoFortguard.svelte.d.ts +5 -0
- package/dist/marketing/Logo/LogoTalk.svelte +32 -0
- package/dist/marketing/Logo/LogoTalk.svelte.d.ts +5 -0
- package/dist/stores/dark.d.ts +0 -1
- package/dist/stores/dark.js +8 -8
- package/dist/variables.scss +41 -48
- package/package.json +59 -58
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
import Button from '../Button/Button.svelte';
|
|
4
|
+
import Loader from './Loader.svelte';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
text: string;
|
|
8
|
+
show: boolean; // has more
|
|
9
|
+
loading: boolean; // whether loading
|
|
10
|
+
height?: number;
|
|
11
|
+
divProps?: Record<string, any>;
|
|
12
|
+
loaderProps?: ComponentProps<typeof Loader>;
|
|
13
|
+
buttonProps?: ComponentProps<typeof Button>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
text,
|
|
18
|
+
show,
|
|
19
|
+
loading,
|
|
20
|
+
height = 50,
|
|
21
|
+
divProps = {},
|
|
22
|
+
loaderProps = {},
|
|
23
|
+
buttonProps = {}
|
|
24
|
+
}: Props = $props();
|
|
10
25
|
</script>
|
|
11
26
|
|
|
12
27
|
{#if show}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{:else}
|
|
23
|
-
|
|
24
|
-
<Button
|
|
25
|
-
size="small"
|
|
26
|
-
on:click
|
|
27
|
-
{...buttonProps}
|
|
28
|
-
>
|
|
29
|
-
{text}
|
|
30
|
-
</Button>
|
|
31
|
-
|
|
32
|
-
{/if}
|
|
33
|
-
|
|
34
|
-
</div>
|
|
35
|
-
|
|
28
|
+
<div class="load-button" style:height="{height}px" {...divProps}>
|
|
29
|
+
{#if loading}
|
|
30
|
+
<Loader {...loaderProps} />
|
|
31
|
+
{:else}
|
|
32
|
+
<Button size="small" on:click {...buttonProps}>
|
|
33
|
+
{text}
|
|
34
|
+
</Button>
|
|
35
|
+
{/if}
|
|
36
|
+
</div>
|
|
36
37
|
{/if}
|
|
37
38
|
|
|
38
39
|
<style>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
</style>
|
|
40
|
+
.load-button {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -1,44 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
size?: number | "small" | "medium" | "large" | undefined;
|
|
15
|
-
state?: "none" | "error" | "loading" | "success" | undefined;
|
|
16
|
-
duration?: number | null | undefined;
|
|
17
|
-
color?: string | undefined;
|
|
18
|
-
colorTrack?: string | undefined;
|
|
19
|
-
invert?: boolean | undefined;
|
|
20
|
-
} | undefined;
|
|
21
|
-
buttonProps?: {
|
|
22
|
-
[x: string]: any;
|
|
23
|
-
as?: "button" | "a" | undefined;
|
|
24
|
-
size?: "small" | "medium" | "large" | "x-small" | undefined;
|
|
25
|
-
color?: "input" | "accent" | "gray" | "green" | "red" | "blue" | "orange" | undefined;
|
|
26
|
-
block?: boolean | undefined;
|
|
27
|
-
variant?: "fill" | "fill-light" | "outline" | "invisible" | "outline-fill" | undefined;
|
|
28
|
-
align?: "start" | "center" | undefined;
|
|
29
|
-
button?: HTMLButtonElement | HTMLAnchorElement | undefined;
|
|
30
|
-
} | undefined;
|
|
1
|
+
import type { ComponentProps } from 'svelte';
|
|
2
|
+
import Button from '../Button/Button.svelte';
|
|
3
|
+
import Loader from './Loader.svelte';
|
|
4
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
5
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
6
|
+
$$bindings?: Bindings;
|
|
7
|
+
} & Exports;
|
|
8
|
+
(internal: unknown, props: Props & {
|
|
9
|
+
$$events?: Events;
|
|
10
|
+
$$slots?: Slots;
|
|
11
|
+
}): Exports & {
|
|
12
|
+
$set?: any;
|
|
13
|
+
$on?: any;
|
|
31
14
|
};
|
|
32
|
-
|
|
33
|
-
click: MouseEvent;
|
|
34
|
-
} & {
|
|
35
|
-
[evt: string]: CustomEvent<any>;
|
|
36
|
-
};
|
|
37
|
-
slots: {};
|
|
38
|
-
};
|
|
39
|
-
export type LoadButtonProps = typeof __propDef.props;
|
|
40
|
-
export type LoadButtonEvents = typeof __propDef.events;
|
|
41
|
-
export type LoadButtonSlots = typeof __propDef.slots;
|
|
42
|
-
export default class LoadButton extends SvelteComponent<LoadButtonProps, LoadButtonEvents, LoadButtonSlots> {
|
|
15
|
+
z_$$bindings?: Bindings;
|
|
43
16
|
}
|
|
44
|
-
|
|
17
|
+
declare const LoadButton: $$__sveltets_2_IsomorphicComponent<{
|
|
18
|
+
text: string;
|
|
19
|
+
show: boolean;
|
|
20
|
+
loading: boolean;
|
|
21
|
+
height?: number;
|
|
22
|
+
divProps?: Record<string, any>;
|
|
23
|
+
loaderProps?: ComponentProps<typeof Loader>;
|
|
24
|
+
buttonProps?: ComponentProps<typeof Button>;
|
|
25
|
+
}, {
|
|
26
|
+
click: any;
|
|
27
|
+
} & {
|
|
28
|
+
[evt: string]: CustomEvent<any>;
|
|
29
|
+
}, {}, {}, "">;
|
|
30
|
+
type LoadButton = InstanceType<typeof LoadButton>;
|
|
31
|
+
export default LoadButton;
|
|
@@ -1,113 +1,126 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { run } from 'svelte/legacy';
|
|
3
|
+
|
|
4
|
+
import { IconCheckCircleFill, IconXCircleFill } from '@hyvor/icons';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
block?: boolean;
|
|
8
|
+
full?: boolean;
|
|
9
|
+
padding?: 'none' | 'small' | 'medium' | 'large' | number;
|
|
10
|
+
size?: 'small' | 'medium' | 'large' | number;
|
|
11
|
+
state?: 'loading' | 'success' | 'error' | 'none';
|
|
12
|
+
duration?: null | number;
|
|
13
|
+
color?: string;
|
|
14
|
+
colorTrack?: string;
|
|
15
|
+
invert?: boolean;
|
|
16
|
+
children?: import('svelte').Snippet;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let {
|
|
21
|
+
block = false,
|
|
22
|
+
full = false,
|
|
23
|
+
padding = $bindable('medium'),
|
|
24
|
+
size = $bindable('medium'),
|
|
25
|
+
state = $bindable('loading'),
|
|
26
|
+
duration = 2000,
|
|
27
|
+
color = $bindable('var(--accent)'),
|
|
28
|
+
colorTrack = $bindable('var(--accent-lightest)'),
|
|
29
|
+
invert = false,
|
|
30
|
+
children,
|
|
31
|
+
...rest
|
|
32
|
+
}: Props = $props();
|
|
33
|
+
|
|
34
|
+
if (invert) {
|
|
35
|
+
const colorCopy = color;
|
|
36
|
+
color = colorTrack;
|
|
37
|
+
colorTrack = colorCopy;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const sizes = {
|
|
41
|
+
small: 16,
|
|
42
|
+
medium: 24,
|
|
43
|
+
large: 32
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
size = typeof size === 'number' ? size : sizes[size];
|
|
47
|
+
|
|
48
|
+
const strokeWidth = size >= 32 ? 5 : size >= 24 ? 4 : size >= 16 ? 3 : 2;
|
|
49
|
+
const r = size / 2 - strokeWidth / 2;
|
|
50
|
+
const strokeDashArray = 2 * Math.PI * r;
|
|
51
|
+
const strokeDashOffset = strokeDashArray - strokeDashArray * 0.25;
|
|
52
|
+
|
|
53
|
+
const paddings = {
|
|
54
|
+
none: 0,
|
|
55
|
+
small: 60,
|
|
56
|
+
medium: 150,
|
|
57
|
+
large: 250
|
|
58
|
+
};
|
|
59
|
+
padding = typeof padding === 'number' ? padding : paddings[padding];
|
|
60
|
+
run(() => {
|
|
61
|
+
if (duration && (state === 'success' || state === 'error')) {
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
state = 'none';
|
|
64
|
+
}, duration);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
43
67
|
</script>
|
|
44
68
|
|
|
45
|
-
<div
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
style:padding={block ? padding + "px" : undefined}
|
|
55
|
-
{...$$restProps}
|
|
69
|
+
<div
|
|
70
|
+
class="loader"
|
|
71
|
+
class:block
|
|
72
|
+
class:full
|
|
73
|
+
class:success={state === 'success'}
|
|
74
|
+
class:error={state === 'error'}
|
|
75
|
+
style:--local-size={size + 'px'}
|
|
76
|
+
style:padding={block ? padding + 'px' : undefined}
|
|
77
|
+
{...rest}
|
|
56
78
|
>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
{#if $$slots.default}
|
|
102
|
-
<div class="message">
|
|
103
|
-
<slot></slot>
|
|
104
|
-
</div>
|
|
105
|
-
{/if}
|
|
106
|
-
|
|
79
|
+
{#if state !== 'none'}
|
|
80
|
+
<span class="loader-wrap">
|
|
81
|
+
{#if state === 'loading'}
|
|
82
|
+
<svg>
|
|
83
|
+
<circle
|
|
84
|
+
class="track"
|
|
85
|
+
cx="50%"
|
|
86
|
+
cy="50%"
|
|
87
|
+
r={r + 'px'}
|
|
88
|
+
fill="none"
|
|
89
|
+
stroke-width={strokeWidth}
|
|
90
|
+
stroke={colorTrack}
|
|
91
|
+
></circle>
|
|
92
|
+
<circle
|
|
93
|
+
class="progress"
|
|
94
|
+
cx="50%"
|
|
95
|
+
cy="50%"
|
|
96
|
+
r={r + 'px'}
|
|
97
|
+
fill="none"
|
|
98
|
+
stroke-width={strokeWidth}
|
|
99
|
+
stroke={color}
|
|
100
|
+
stroke-linecap="round"
|
|
101
|
+
stroke-dasharray={strokeDashArray}
|
|
102
|
+
stroke-dashoffset={strokeDashOffset}
|
|
103
|
+
></circle>
|
|
104
|
+
</svg>
|
|
105
|
+
{:else if state === 'success'}
|
|
106
|
+
<span class="success-icon">
|
|
107
|
+
<IconCheckCircleFill color="var(--green)" width={size} height={size} />
|
|
108
|
+
</span>
|
|
109
|
+
{:else if state === 'error'}
|
|
110
|
+
<span class="error-icon">
|
|
111
|
+
<IconXCircleFill color="var(--red)" width={size} height={size} />
|
|
112
|
+
</span>
|
|
113
|
+
{/if}
|
|
114
|
+
</span>
|
|
115
|
+
{/if}
|
|
116
|
+
|
|
117
|
+
{#if children}
|
|
118
|
+
<div class="message">
|
|
119
|
+
{@render children?.()}
|
|
120
|
+
</div>
|
|
121
|
+
{/if}
|
|
107
122
|
</div>
|
|
108
123
|
|
|
109
|
-
|
|
110
|
-
|
|
111
124
|
<style>.loader {
|
|
112
125
|
display: inline-flex;
|
|
113
126
|
align-items: center;
|
|
@@ -147,7 +160,8 @@ padding = typeof padding === "number" ? padding : paddings[padding];
|
|
|
147
160
|
position: relative;
|
|
148
161
|
}
|
|
149
162
|
|
|
150
|
-
.success-icon,
|
|
163
|
+
.success-icon,
|
|
164
|
+
.error-icon {
|
|
151
165
|
animation: scale 0.2s ease-in-out;
|
|
152
166
|
}
|
|
153
167
|
|
|
@@ -184,4 +198,4 @@ circle.progress {
|
|
|
184
198
|
transform: scale(1);
|
|
185
199
|
opacity: 1;
|
|
186
200
|
}
|
|
187
|
-
}</style>
|
|
201
|
+
}</style>
|
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
};
|
|
18
|
-
slots: {
|
|
19
|
-
default: {};
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export type LoaderProps = typeof __propDef.props;
|
|
23
|
-
export type LoaderEvents = typeof __propDef.events;
|
|
24
|
-
export type LoaderSlots = typeof __propDef.slots;
|
|
25
|
-
export default class Loader extends SvelteComponent<LoaderProps, LoaderEvents, LoaderSlots> {
|
|
26
|
-
}
|
|
27
|
-
export {};
|
|
1
|
+
declare const Loader: import("svelte").Component<{
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
block?: boolean;
|
|
4
|
+
full?: boolean;
|
|
5
|
+
padding?: "none" | "small" | "medium" | "large" | number;
|
|
6
|
+
size?: "small" | "medium" | "large" | number;
|
|
7
|
+
state?: "loading" | "success" | "error" | "none";
|
|
8
|
+
duration?: null | number;
|
|
9
|
+
color?: string;
|
|
10
|
+
colorTrack?: string;
|
|
11
|
+
invert?: boolean;
|
|
12
|
+
children?: import("svelte").Snippet;
|
|
13
|
+
}, {}, "size" | "color" | "padding" | "state" | "colorTrack">;
|
|
14
|
+
type Loader = ReturnType<typeof Loader>;
|
|
15
|
+
export default Loader;
|
|
@@ -1,57 +1,47 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import Button from "./../Button/Button.svelte";
|
|
4
|
-
import ButtonGroup from "./../Button/ButtonGroup.svelte";
|
|
5
|
-
let show = true;
|
|
6
|
-
function handleCancel() {
|
|
7
|
-
$confirmStore.onCancel();
|
|
8
|
-
}
|
|
9
|
-
function handleConfirm() {
|
|
10
|
-
$confirmStore.onConfirm();
|
|
11
|
-
}
|
|
12
|
-
$: {
|
|
13
|
-
if (!show) {
|
|
14
|
-
handleCancel();
|
|
15
|
-
show = true;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
</script>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { run } from 'svelte/legacy';
|
|
19
3
|
|
|
20
|
-
|
|
4
|
+
import Modal from './Modal.svelte';
|
|
5
|
+
import { confirmStore } from './confirm.js';
|
|
6
|
+
import Button from './../Button/Button.svelte';
|
|
7
|
+
import ButtonGroup from './../Button/ButtonGroup.svelte';
|
|
21
8
|
|
|
22
|
-
|
|
23
|
-
title={$confirmStore.title}
|
|
24
|
-
bind:show={show}
|
|
25
|
-
size="small"
|
|
26
|
-
loading={$confirmStore.loading}
|
|
27
|
-
>
|
|
9
|
+
let show = $state(true);
|
|
28
10
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<svelte:component
|
|
33
|
-
this={$confirmStore.content}
|
|
34
|
-
{...$confirmStore.contentProps || {}}
|
|
35
|
-
/>
|
|
36
|
-
{/if}
|
|
11
|
+
function handleCancel() {
|
|
12
|
+
$confirmStore!.onCancel();
|
|
13
|
+
}
|
|
37
14
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
variant="invisible"
|
|
42
|
-
on:click={handleCancel}
|
|
43
|
-
>
|
|
44
|
-
{$confirmStore.cancelText || "Cancel"}
|
|
45
|
-
</Button>
|
|
46
|
-
<Button
|
|
47
|
-
color={$confirmStore.danger ? "red" : "accent"}
|
|
48
|
-
on:click={handleConfirm}
|
|
49
|
-
>
|
|
50
|
-
{$confirmStore.confirmText || "Confirm"}
|
|
51
|
-
</Button>
|
|
52
|
-
</ButtonGroup>
|
|
53
|
-
</svelte:fragment>
|
|
15
|
+
function handleConfirm() {
|
|
16
|
+
$confirmStore!.onConfirm();
|
|
17
|
+
}
|
|
54
18
|
|
|
55
|
-
|
|
19
|
+
run(() => {
|
|
20
|
+
if (!show) {
|
|
21
|
+
handleCancel();
|
|
22
|
+
show = true;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
{#if $confirmStore}
|
|
28
|
+
<Modal title={$confirmStore.title} bind:show size="small" loading={$confirmStore.loading}>
|
|
29
|
+
{#if typeof $confirmStore.content === 'string'}
|
|
30
|
+
{$confirmStore.content}
|
|
31
|
+
{:else}
|
|
32
|
+
{@const SvelteComponent = $confirmStore.content}
|
|
33
|
+
<SvelteComponent {...$confirmStore.contentProps || {}} />
|
|
34
|
+
{/if}
|
|
56
35
|
|
|
57
|
-
{
|
|
36
|
+
{#snippet footer()}
|
|
37
|
+
<ButtonGroup>
|
|
38
|
+
<Button variant="invisible" on:click={handleCancel}>
|
|
39
|
+
{$confirmStore.cancelText || 'Cancel'}
|
|
40
|
+
</Button>
|
|
41
|
+
<Button color={$confirmStore.danger ? 'red' : 'accent'} on:click={handleConfirm}>
|
|
42
|
+
{$confirmStore.confirmText || 'Confirm'}
|
|
43
|
+
</Button>
|
|
44
|
+
</ButtonGroup>
|
|
45
|
+
{/snippet}
|
|
46
|
+
</Modal>
|
|
47
|
+
{/if}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
events: {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
};
|
|
7
|
-
slots: {};
|
|
8
|
-
};
|
|
9
|
-
export type ConfirmModalProviderProps = typeof __propDef.props;
|
|
10
|
-
export type ConfirmModalProviderEvents = typeof __propDef.events;
|
|
11
|
-
export type ConfirmModalProviderSlots = typeof __propDef.slots;
|
|
12
|
-
export default class ConfirmModalProvider extends SvelteComponent<ConfirmModalProviderProps, ConfirmModalProviderEvents, ConfirmModalProviderSlots> {
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
1
|
+
declare const ConfirmModalProvider: import("svelte").Component<Record<string, never>, {}, "">;
|
|
2
|
+
type ConfirmModalProvider = ReturnType<typeof ConfirmModalProvider>;
|
|
3
|
+
export default ConfirmModalProvider;
|