@hyvor/design 0.0.68 → 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 +22 -9
- package/dist/components/ActionList/ActionList.svelte.d.ts +8 -20
- package/dist/components/ActionList/ActionListGroup.svelte +18 -8
- package/dist/components/ActionList/ActionListGroup.svelte.d.ts +8 -20
- package/dist/components/ActionList/ActionListItem.svelte +49 -25
- package/dist/components/ActionList/ActionListItem.svelte.d.ts +27 -25
- package/dist/components/ActionList/Selected.svelte +10 -4
- package/dist/components/ActionList/Selected.svelte.d.ts +6 -17
- package/dist/components/Avatar/Avatar.svelte +16 -9
- package/dist/components/Avatar/Avatar.svelte.d.ts +7 -18
- package/dist/components/Avatar/AvatarStack.svelte +14 -8
- package/dist/components/Avatar/AvatarStack.svelte.d.ts +6 -18
- package/dist/components/Base/Base.svelte +14 -6
- package/dist/components/Base/Base.svelte.d.ts +6 -18
- package/dist/components/Box/Box.svelte +10 -3
- package/dist/components/Box/Box.svelte.d.ts +7 -19
- package/dist/components/Button/Button.svelte +52 -25
- package/dist/components/Button/Button.svelte.d.ts +16 -39
- package/dist/components/Button/ButtonGroup.svelte +9 -1
- package/dist/components/Button/ButtonGroup.svelte.d.ts +5 -27
- package/dist/components/Callout/Callout.svelte +41 -20
- package/dist/components/Callout/Callout.svelte.d.ts +11 -23
- package/dist/components/Checkbox/Checkbox.svelte +58 -38
- package/dist/components/Checkbox/Checkbox.svelte.d.ts +11 -34
- package/dist/components/CodeBlock/CodeBlock.svelte +21 -11
- package/dist/components/CodeBlock/CodeBlock.svelte.d.ts +6 -17
- package/dist/components/CodeBlock/getCode.js +2 -0
- package/dist/components/ColorPicker/ColorPicker.svelte +34 -15
- package/dist/components/ColorPicker/ColorPicker.svelte.d.ts +25 -19
- package/dist/components/Dark/DarkProvider.svelte +7 -5
- package/dist/components/Dark/DarkProvider.svelte.d.ts +16 -12
- package/dist/components/Dark/DarkToggle.svelte +8 -6
- package/dist/components/Dark/DarkToggle.svelte.d.ts +16 -12
- package/dist/components/Divider/Divider.svelte +17 -6
- package/dist/components/Divider/Divider.svelte.d.ts +9 -20
- package/dist/components/Dropdown/Dropdown.svelte +33 -14
- package/dist/components/Dropdown/Dropdown.svelte.d.ts +13 -24
- package/dist/components/Dropdown/DropdownContent.svelte +124 -92
- package/dist/components/Dropdown/DropdownContent.svelte.d.ts +12 -24
- package/dist/components/FormControl/Caption.svelte +10 -3
- package/dist/components/FormControl/Caption.svelte.d.ts +7 -19
- package/dist/components/FormControl/FormControl.svelte +11 -2
- package/dist/components/FormControl/FormControl.svelte.d.ts +6 -27
- package/dist/components/FormControl/InputGroup.svelte +17 -9
- package/dist/components/FormControl/InputGroup.svelte.d.ts +7 -19
- package/dist/components/FormControl/Label.svelte +11 -2
- package/dist/components/FormControl/Label.svelte.d.ts +6 -27
- package/dist/components/FormControl/Validation.svelte +18 -9
- package/dist/components/FormControl/Validation.svelte.d.ts +8 -20
- package/dist/components/HyvorBar/BarProducts.svelte +44 -25
- package/dist/components/HyvorBar/BarProducts.svelte.d.ts +14 -21
- package/dist/components/HyvorBar/BarSupport.svelte +165 -101
- package/dist/components/HyvorBar/BarSupport.svelte.d.ts +7 -18
- package/dist/components/HyvorBar/BarUpdates.svelte +25 -15
- package/dist/components/HyvorBar/BarUpdates.svelte.d.ts +6 -17
- package/dist/components/HyvorBar/BarUpdatesList.svelte +73 -48
- package/dist/components/HyvorBar/BarUpdatesList.svelte.d.ts +6 -17
- package/dist/components/HyvorBar/BarUser.svelte +36 -24
- package/dist/components/HyvorBar/BarUser.svelte.d.ts +5 -16
- package/dist/components/HyvorBar/BarUserPreview.svelte +2 -1
- package/dist/components/HyvorBar/BarUserPreview.svelte.d.ts +16 -12
- package/dist/components/HyvorBar/HyvorBar.svelte +69 -36
- package/dist/components/HyvorBar/HyvorBar.svelte.d.ts +7 -18
- package/dist/components/HyvorBar/bar.d.ts +2 -2
- package/dist/components/HyvorBar/img/G2.svelte.d.ts +22 -19
- package/dist/components/HyvorBar/img/Trustpilot.svelte.d.ts +22 -19
- package/dist/components/IconButton/IconButton.svelte +43 -22
- package/dist/components/IconButton/IconButton.svelte.d.ts +10 -33
- package/dist/components/IconMessage/IconMessage.svelte +111 -56
- package/dist/components/IconMessage/IconMessage.svelte.d.ts +19 -35
- package/dist/components/Internationalization/InternationalizationProvider.svelte +14 -7
- package/dist/components/Internationalization/InternationalizationProvider.svelte.d.ts +6 -18
- package/dist/components/Internationalization/LanguageToggle.svelte +73 -47
- package/dist/components/Internationalization/LanguageToggle.svelte.d.ts +10 -21
- 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 +1 -3
- package/dist/components/Internationalization/t.d.ts +1 -2
- package/dist/components/Internationalization/types.d.ts +1 -0
- package/dist/components/Link/Link.svelte +31 -19
- package/dist/components/Link/Link.svelte.d.ts +11 -34
- package/dist/components/Loader/LoadButton.svelte +24 -9
- package/dist/components/Loader/LoadButton.svelte.d.ts +29 -42
- package/dist/components/Loader/Loader.svelte +69 -42
- package/dist/components/Loader/Loader.svelte.d.ts +15 -27
- package/dist/components/Modal/ConfirmModalProvider.svelte +28 -20
- package/dist/components/Modal/ConfirmModalProvider.svelte.d.ts +3 -14
- package/dist/components/Modal/Modal.svelte +76 -47
- package/dist/components/Modal/Modal.svelte.d.ts +31 -29
- package/dist/components/Modal/ModalFooter.svelte +14 -6
- package/dist/components/Modal/ModalFooter.svelte.d.ts +22 -18
- package/dist/components/Modal/confirm.d.ts +2 -2
- package/dist/components/Modal/modal-types.d.ts +2 -2
- package/dist/components/NavLink/NavLink.svelte +31 -18
- package/dist/components/NavLink/NavLink.svelte.d.ts +11 -33
- package/dist/components/Radio/Radio.svelte +35 -16
- package/dist/components/Radio/Radio.svelte.d.ts +10 -33
- package/dist/components/Slider/Slider.svelte +53 -36
- package/dist/components/Slider/Slider.svelte.d.ts +24 -20
- package/dist/components/SplitControl/SplitControl.svelte +27 -18
- package/dist/components/SplitControl/SplitControl.svelte.d.ts +11 -24
- package/dist/components/Switch/Switch.svelte +30 -15
- package/dist/components/Switch/Switch.svelte.d.ts +8 -31
- package/dist/components/TabNav/TabNav.svelte +29 -15
- package/dist/components/TabNav/TabNav.svelte.d.ts +7 -19
- package/dist/components/TabNav/TabNavItem.svelte +36 -15
- package/dist/components/TabNav/TabNavItem.svelte.d.ts +10 -24
- package/dist/components/Table/Table.svelte +11 -4
- package/dist/components/Table/Table.svelte.d.ts +7 -19
- package/dist/components/Table/TableRow.svelte +11 -3
- package/dist/components/Table/TableRow.svelte.d.ts +7 -19
- package/dist/components/Tag/Tag.svelte +65 -31
- package/dist/components/Tag/Tag.svelte.d.ts +16 -39
- package/dist/components/Text/Text.svelte +20 -6
- package/dist/components/Text/Text.svelte.d.ts +10 -22
- package/dist/components/TextInput/TextInput.svelte +42 -21
- package/dist/components/TextInput/TextInput.svelte.d.ts +12 -36
- package/dist/components/Textarea/Textarea.svelte +46 -24
- package/dist/components/Textarea/Textarea.svelte.d.ts +13 -37
- package/dist/components/Toast/ToastIcon.svelte +26 -15
- package/dist/components/Toast/ToastIcon.svelte.d.ts +5 -16
- package/dist/components/Toast/ToastMessage.svelte +11 -4
- package/dist/components/Toast/ToastMessage.svelte.d.ts +5 -16
- package/dist/components/Toast/ToastProvider.svelte +6 -4
- package/dist/components/Toast/ToastProvider.svelte.d.ts +16 -12
- package/dist/components/Toast/toast.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.svelte +71 -55
- package/dist/components/Tooltip/Tooltip.svelte.d.ts +35 -23
- package/dist/marketing/Container/Container.svelte +8 -2
- package/dist/marketing/Container/Container.svelte.d.ts +6 -18
- package/dist/marketing/Docs/Content/Content.svelte +41 -29
- package/dist/marketing/Docs/Content/Content.svelte.d.ts +5 -16
- package/dist/marketing/Docs/Content/DocsImage.svelte +17 -9
- package/dist/marketing/Docs/Content/DocsImage.svelte.d.ts +9 -20
- package/dist/marketing/Docs/Docs.svelte +9 -3
- package/dist/marketing/Docs/Docs.svelte.d.ts +6 -29
- package/dist/marketing/Docs/Nav/Nav.svelte +77 -50
- package/dist/marketing/Docs/Nav/Nav.svelte.d.ts +5 -16
- package/dist/marketing/Docs/Nav/NavCategory.svelte +16 -6
- package/dist/marketing/Docs/Nav/NavCategory.svelte.d.ts +8 -20
- package/dist/marketing/Docs/Nav/NavItem.svelte +10 -3
- package/dist/marketing/Docs/Nav/NavItem.svelte.d.ts +6 -18
- package/dist/marketing/Docs/Sidebar/Sidebar.svelte.d.ts +22 -19
- package/dist/marketing/Docs/Toc.svelte +49 -39
- package/dist/marketing/Docs/Toc.svelte.d.ts +3 -14
- package/dist/marketing/Document/Document.svelte +11 -4
- package/dist/marketing/Document/Document.svelte.d.ts +7 -19
- package/dist/marketing/Document/DocumentTitle.svelte +16 -5
- package/dist/marketing/Document/DocumentTitle.svelte.d.ts +9 -20
- package/dist/marketing/Footer/Footer.svelte +55 -38
- package/dist/marketing/Footer/Footer.svelte.d.ts +8 -20
- package/dist/marketing/Footer/FooterLinkList.svelte +8 -2
- package/dist/marketing/Footer/FooterLinkList.svelte.d.ts +6 -18
- package/dist/marketing/Header/Header.svelte +41 -23
- package/dist/marketing/Header/Header.svelte.d.ts +10 -22
- package/dist/marketing/Logo/LogoBlogs.svelte +6 -1
- package/dist/marketing/Logo/LogoBlogs.svelte.d.ts +5 -16
- package/dist/marketing/Logo/LogoCore.svelte +6 -1
- package/dist/marketing/Logo/LogoCore.svelte.d.ts +5 -16
- package/dist/marketing/Logo/LogoFortguard.svelte +7 -2
- package/dist/marketing/Logo/LogoFortguard.svelte.d.ts +5 -16
- package/dist/marketing/Logo/LogoTalk.svelte +6 -1
- package/dist/marketing/Logo/LogoTalk.svelte.d.ts +5 -16
- package/dist/stores/dark.d.ts +0 -1
- package/package.json +8 -8
|
@@ -1,39 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
focus: FocusEvent;
|
|
18
|
-
blur: FocusEvent;
|
|
19
|
-
click: MouseEvent;
|
|
20
|
-
mouseover: MouseEvent;
|
|
21
|
-
mouseenter: MouseEvent;
|
|
22
|
-
mouseleave: MouseEvent;
|
|
23
|
-
change: Event;
|
|
24
|
-
} & {
|
|
25
|
-
[evt: string]: CustomEvent<any>;
|
|
26
|
-
};
|
|
27
|
-
slots: {
|
|
28
|
-
start: {};
|
|
29
|
-
default: {};
|
|
30
|
-
end: {};
|
|
31
|
-
action: {};
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
export type ButtonProps = typeof __propDef.props;
|
|
35
|
-
export type ButtonEvents = typeof __propDef.events;
|
|
36
|
-
export type ButtonSlots = typeof __propDef.slots;
|
|
37
|
-
export default class Button extends SvelteComponent<ButtonProps, ButtonEvents, ButtonSlots> {
|
|
38
|
-
}
|
|
39
|
-
export {};
|
|
1
|
+
declare const Button: import("svelte").Component<{
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
as?: "button" | "a";
|
|
4
|
+
size?: "x-small" | "small" | "medium" | "large";
|
|
5
|
+
color?: "accent" | "gray" | "green" | "red" | "blue" | "orange" | "input";
|
|
6
|
+
block?: boolean;
|
|
7
|
+
variant?: "fill" | "fill-light" | "outline" | "invisible" | "outline-fill";
|
|
8
|
+
align?: "start" | "center";
|
|
9
|
+
button?: any;
|
|
10
|
+
start?: import("svelte").Snippet;
|
|
11
|
+
children?: import("svelte").Snippet;
|
|
12
|
+
end?: import("svelte").Snippet;
|
|
13
|
+
action?: import("svelte").Snippet;
|
|
14
|
+
}, {}, "button">;
|
|
15
|
+
type Button = ReturnType<typeof Button>;
|
|
16
|
+
export default Button;
|
|
@@ -1,27 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {
|
|
9
|
-
default: {};
|
|
10
|
-
}> {
|
|
11
|
-
}
|
|
12
|
-
export type ButtonGroupProps = typeof __propDef.props;
|
|
13
|
-
export type ButtonGroupEvents = typeof __propDef.events;
|
|
14
|
-
export type ButtonGroupSlots = typeof __propDef.slots;
|
|
15
|
-
import { SvelteComponent } from "svelte";
|
|
16
|
-
declare const __propDef: {
|
|
17
|
-
props: {
|
|
18
|
-
[x: string]: never;
|
|
19
|
-
};
|
|
20
|
-
events: {
|
|
21
|
-
[evt: string]: CustomEvent<any>;
|
|
22
|
-
};
|
|
23
|
-
slots: {
|
|
24
|
-
default: {};
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export {};
|
|
1
|
+
declare const ButtonGroup: import("svelte").Component<{
|
|
2
|
+
children?: import("svelte").Snippet;
|
|
3
|
+
}, {}, "">;
|
|
4
|
+
type ButtonGroup = ReturnType<typeof ButtonGroup>;
|
|
5
|
+
export default ButtonGroup;
|
|
@@ -1,39 +1,60 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
</script>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const {
|
|
5
|
+
type = 'soft',
|
|
6
|
+
title = undefined,
|
|
7
|
+
children = undefined,
|
|
8
|
+
text = undefined,
|
|
9
|
+
icon = undefined,
|
|
10
|
+
...rest
|
|
11
|
+
}: {
|
|
12
|
+
type?: 'info' | 'success' | 'warning' | 'danger' | 'soft';
|
|
13
|
+
title?: string | Snippet;
|
|
14
|
+
icon?: Snippet;
|
|
15
|
+
text?: string | Snippet;
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
} = $props();
|
|
19
|
+
</script>
|
|
11
20
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{:else if title}
|
|
21
|
+
<div class={'callout ' + type} {...rest}>
|
|
22
|
+
{#if typeof title === 'string'}
|
|
15
23
|
<div class="title-wrap">
|
|
16
|
-
{#if
|
|
24
|
+
{#if icon}
|
|
17
25
|
<span
|
|
18
26
|
class="title-icon
|
|
19
|
-
|
|
27
|
+
"
|
|
20
28
|
>
|
|
29
|
+
{@render icon()}
|
|
30
|
+
</span>
|
|
21
31
|
{/if}
|
|
22
|
-
|
|
23
32
|
<div class="title">{title}</div>
|
|
24
33
|
</div>
|
|
34
|
+
{:else if title !== undefined}
|
|
35
|
+
<div class="title-wrap">
|
|
36
|
+
{#if icon}
|
|
37
|
+
<span class="title-icon">{@render icon()}</span>
|
|
38
|
+
{/if}
|
|
39
|
+
|
|
40
|
+
<div class="title">{@render title?.()}</div>
|
|
41
|
+
</div>
|
|
25
42
|
{/if}
|
|
26
43
|
|
|
27
44
|
<div class="text-wrap">
|
|
28
|
-
{#if
|
|
29
|
-
<span class="icon"
|
|
45
|
+
{#if icon && !title}
|
|
46
|
+
<span class="icon">{@render icon()}</span>
|
|
30
47
|
{/if}
|
|
31
48
|
|
|
32
49
|
<div class="text">
|
|
33
|
-
{#if
|
|
34
|
-
|
|
50
|
+
{#if children}
|
|
51
|
+
{@render children()}
|
|
52
|
+
{/if}
|
|
53
|
+
{#if typeof text === 'string'}
|
|
54
|
+
{text}
|
|
55
|
+
{:else}
|
|
56
|
+
{@render text?.()}
|
|
35
57
|
{/if}
|
|
36
|
-
<slot name="text" />
|
|
37
58
|
</div>
|
|
38
59
|
</div>
|
|
39
60
|
</div>
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
icon: {};
|
|
13
|
-
title: {};
|
|
14
|
-
default: {};
|
|
15
|
-
text: {};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export type CalloutProps = typeof __propDef.props;
|
|
19
|
-
export type CalloutEvents = typeof __propDef.events;
|
|
20
|
-
export type CalloutSlots = typeof __propDef.slots;
|
|
21
|
-
export default class Callout extends SvelteComponent<CalloutProps, CalloutEvents, CalloutSlots> {
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
declare const Callout: import("svelte").Component<{
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
type?: "info" | "success" | "warning" | "danger" | "soft";
|
|
5
|
+
title?: string | Snippet;
|
|
6
|
+
icon?: Snippet;
|
|
7
|
+
text?: string | Snippet;
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
}, {}, "">;
|
|
10
|
+
type Callout = ReturnType<typeof Callout>;
|
|
11
|
+
export default Callout;
|
|
@@ -1,26 +1,47 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createBubbler, handlers } from 'svelte/legacy';
|
|
3
|
+
|
|
4
|
+
const bubble = createBubbler();
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
checked?: boolean | undefined;
|
|
8
|
+
group?: (number | string)[];
|
|
9
|
+
value?: string | number;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
input?: HTMLInputElement;
|
|
12
|
+
children?: import('svelte').Snippet;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
checked = $bindable(undefined),
|
|
18
|
+
group = $bindable([]),
|
|
19
|
+
value = 'on',
|
|
20
|
+
disabled = false,
|
|
21
|
+
input = $bindable({} as HTMLInputElement),
|
|
22
|
+
children,
|
|
23
|
+
...rest
|
|
24
|
+
}: Props = $props();
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* From https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/forms/Checkbox.svelte
|
|
28
|
+
*/
|
|
29
|
+
function handleChange() {
|
|
30
|
+
if (disabled) return;
|
|
31
|
+
const index = group.indexOf(value);
|
|
32
|
+
if (checked === undefined) checked = index >= 0;
|
|
33
|
+
if (checked) {
|
|
34
|
+
if (index < 0) {
|
|
35
|
+
group.push(value);
|
|
36
|
+
group = group;
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
if (index >= 0) {
|
|
40
|
+
group.splice(index, 1);
|
|
41
|
+
group = group;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
24
45
|
</script>
|
|
25
46
|
|
|
26
47
|
<span class="checkbox-wrap">
|
|
@@ -30,23 +51,22 @@ function handleChange() {
|
|
|
30
51
|
bind:checked
|
|
31
52
|
bind:this={input}
|
|
32
53
|
{disabled}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{
|
|
44
|
-
on:change={handleChange}
|
|
54
|
+
onkeyup={bubble('keyup')}
|
|
55
|
+
onkeydown={bubble('keydown')}
|
|
56
|
+
onkeypress={bubble('keypress')}
|
|
57
|
+
onfocus={bubble('focus')}
|
|
58
|
+
onblur={bubble('blur')}
|
|
59
|
+
onclick={bubble('click')}
|
|
60
|
+
onmouseover={bubble('mouseover')}
|
|
61
|
+
onmouseenter={bubble('mouseenter')}
|
|
62
|
+
onmouseleave={bubble('mouseleave')}
|
|
63
|
+
onchange={handlers(bubble('change'), handleChange)}
|
|
64
|
+
{...rest}
|
|
45
65
|
/>
|
|
46
|
-
<span class="placeholder"
|
|
47
|
-
{#if
|
|
66
|
+
<span class="placeholder"></span>
|
|
67
|
+
{#if children}
|
|
48
68
|
<span class="label">
|
|
49
|
-
|
|
69
|
+
{@render children?.()}
|
|
50
70
|
</span>
|
|
51
71
|
{/if}
|
|
52
72
|
</label>
|
|
@@ -1,34 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
keyup: KeyboardEvent;
|
|
13
|
-
keydown: KeyboardEvent;
|
|
14
|
-
keypress: KeyboardEvent;
|
|
15
|
-
focus: FocusEvent;
|
|
16
|
-
blur: FocusEvent;
|
|
17
|
-
click: MouseEvent;
|
|
18
|
-
mouseover: MouseEvent;
|
|
19
|
-
mouseenter: MouseEvent;
|
|
20
|
-
mouseleave: MouseEvent;
|
|
21
|
-
change: Event;
|
|
22
|
-
} & {
|
|
23
|
-
[evt: string]: CustomEvent<any>;
|
|
24
|
-
};
|
|
25
|
-
slots: {
|
|
26
|
-
default: {};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export type CheckboxProps = typeof __propDef.props;
|
|
30
|
-
export type CheckboxEvents = typeof __propDef.events;
|
|
31
|
-
export type CheckboxSlots = typeof __propDef.slots;
|
|
32
|
-
export default class Checkbox extends SvelteComponent<CheckboxProps, CheckboxEvents, CheckboxSlots> {
|
|
33
|
-
}
|
|
34
|
-
export {};
|
|
1
|
+
declare const Checkbox: import("svelte").Component<{
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
checked?: boolean | undefined;
|
|
4
|
+
group?: (number | string)[];
|
|
5
|
+
value?: string | number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
input?: HTMLInputElement;
|
|
8
|
+
children?: import("svelte").Snippet;
|
|
9
|
+
}, {}, "checked" | "group" | "input">;
|
|
10
|
+
type Checkbox = ReturnType<typeof Checkbox>;
|
|
11
|
+
export default Checkbox;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
//import './prism.scss';
|
|
3
|
+
import './hljs.scss';
|
|
4
|
+
|
|
5
|
+
type InputLanguage = 'html' | 'css' | 'js' | 'ts' | 'yaml' | 'json' | 'svelte' | 'jsx' | 'php';
|
|
6
|
+
|
|
7
|
+
const languagesMap: Partial<Record<InputLanguage, Language>> = {
|
|
8
|
+
svelte: 'html',
|
|
9
|
+
jsx: 'js'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
import getCode, { type Language } from './getCode.js';
|
|
13
|
+
interface Props {
|
|
14
|
+
code: string;
|
|
15
|
+
language?: InputLanguage;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let { code, language = 'html' }: Props = $props();
|
|
19
|
+
const languageCode = (languagesMap[language] || language) as Language;
|
|
10
20
|
</script>
|
|
11
21
|
|
|
12
22
|
<pre class="language-{languageCode} hljs"><code>{@html getCode(code, languageCode)}</code></pre>
|
|
@@ -22,7 +32,7 @@ import getCode, {} from "./getCode.js";
|
|
|
22
32
|
overflow: auto;
|
|
23
33
|
border-radius: 20px;
|
|
24
34
|
padding: 20px;
|
|
25
|
-
line-height: 1.
|
|
35
|
+
line-height: 1.2;
|
|
26
36
|
}
|
|
27
37
|
pre code {
|
|
28
38
|
all: unset;
|
|
@@ -33,7 +43,7 @@ import getCode, {} from "./getCode.js";
|
|
|
33
43
|
Ubuntu Mono,
|
|
34
44
|
monospace;
|
|
35
45
|
font-size: 14px;
|
|
36
|
-
line-height: 1.5;
|
|
46
|
+
line-height: 1.5 !important;
|
|
37
47
|
tab-size: 4;
|
|
38
48
|
hyphens: none;
|
|
39
49
|
}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import './hljs.scss';
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
12
|
-
};
|
|
13
|
-
export type CodeBlockProps = typeof __propDef.props;
|
|
14
|
-
export type CodeBlockEvents = typeof __propDef.events;
|
|
15
|
-
export type CodeBlockSlots = typeof __propDef.slots;
|
|
16
|
-
export default class CodeBlock extends SvelteComponent<CodeBlockProps, CodeBlockEvents, CodeBlockSlots> {
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
2
|
+
declare const CodeBlock: import("svelte").Component<{
|
|
3
|
+
code: string;
|
|
4
|
+
language?: "css" | "ts" | "yaml" | "json" | "php" | "html" | "js" | "svelte" | "jsx";
|
|
5
|
+
}, {}, "">;
|
|
6
|
+
type CodeBlock = ReturnType<typeof CodeBlock>;
|
|
7
|
+
export default CodeBlock;
|
|
@@ -5,12 +5,14 @@ import css from 'highlight.js/lib/languages/css';
|
|
|
5
5
|
import ts from 'highlight.js/lib/languages/typescript';
|
|
6
6
|
import yaml from 'highlight.js/lib/languages/yaml';
|
|
7
7
|
import json from 'highlight.js/lib/languages/json';
|
|
8
|
+
import php from 'highlight.js/lib/languages/php';
|
|
8
9
|
hljs.registerLanguage('javascript', javascript);
|
|
9
10
|
hljs.registerLanguage('xml', xml);
|
|
10
11
|
hljs.registerLanguage('css', css);
|
|
11
12
|
hljs.registerLanguage('ts', ts);
|
|
12
13
|
hljs.registerLanguage('yaml', yaml);
|
|
13
14
|
hljs.registerLanguage('json', json);
|
|
15
|
+
hljs.registerLanguage('php', php);
|
|
14
16
|
export default function getCode(code, language) {
|
|
15
17
|
let ret = code;
|
|
16
18
|
// remove the first empty line
|
|
@@ -1,17 +1,35 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ColorPicker from 'svelte-awesome-color-picker';
|
|
3
|
+
import { clickOutside } from '../index.js';
|
|
4
|
+
import { createEventDispatcher } from 'svelte';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
color?: string;
|
|
8
|
+
size?: number;
|
|
9
|
+
show?: boolean;
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
color = $bindable('#000000'),
|
|
15
|
+
size = 30,
|
|
16
|
+
show = $bindable(false),
|
|
17
|
+
'aria-label': ariaLabel = ''
|
|
18
|
+
}: Props = $props();
|
|
19
|
+
|
|
20
|
+
const dispatch = createEventDispatcher<{
|
|
21
|
+
input: string;
|
|
22
|
+
change: string;
|
|
23
|
+
}>();
|
|
24
|
+
|
|
25
|
+
function handleInput() {
|
|
26
|
+
dispatch('input', color);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function handleClose() {
|
|
30
|
+
dispatch('change', color);
|
|
31
|
+
show = false;
|
|
32
|
+
}
|
|
15
33
|
</script>
|
|
16
34
|
|
|
17
35
|
<span class="color-picker">
|
|
@@ -19,13 +37,14 @@ function handleClose() {
|
|
|
19
37
|
style:width="{size}px"
|
|
20
38
|
style:height="{size}px"
|
|
21
39
|
style:background-color={color}
|
|
22
|
-
|
|
40
|
+
onclick={() => {
|
|
23
41
|
if (show) {
|
|
24
42
|
handleClose();
|
|
25
43
|
} else {
|
|
26
44
|
show = true;
|
|
27
45
|
}
|
|
28
46
|
}}
|
|
47
|
+
aria-label={ariaLabel}
|
|
29
48
|
></button>
|
|
30
49
|
|
|
31
50
|
{#if show}
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import ColorPicker from 'svelte-awesome-color-picker';
|
|
2
|
+
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> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
7
12
|
};
|
|
8
|
-
|
|
9
|
-
input: CustomEvent<string>;
|
|
10
|
-
change: CustomEvent<string>;
|
|
11
|
-
} & {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
15
|
-
};
|
|
16
|
-
export type ColorPickerProps = typeof __propDef.props;
|
|
17
|
-
export type ColorPickerEvents = typeof __propDef.events;
|
|
18
|
-
export type ColorPickerSlots = typeof __propDef.slots;
|
|
19
|
-
export default class ColorPicker extends SvelteComponent<ColorPickerProps, ColorPickerEvents, ColorPickerSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
20
14
|
}
|
|
21
|
-
|
|
15
|
+
declare const ColorPicker: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
color?: string;
|
|
17
|
+
size?: number;
|
|
18
|
+
show?: boolean;
|
|
19
|
+
'aria-label'?: string;
|
|
20
|
+
}, {
|
|
21
|
+
input: CustomEvent<string>;
|
|
22
|
+
change: CustomEvent<string>;
|
|
23
|
+
} & {
|
|
24
|
+
[evt: string]: CustomEvent<any>;
|
|
25
|
+
}, {}, {}, "color" | "show">;
|
|
26
|
+
type ColorPicker = InstanceType<typeof ColorPicker>;
|
|
27
|
+
export default ColorPicker;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
import { setInitialState } from '../../stores/dark.js';
|
|
4
|
+
|
|
5
|
+
onMount(() => {
|
|
6
|
+
setInitialState();
|
|
7
|
+
});
|
|
6
8
|
</script>
|
|
7
9
|
|
|
8
10
|
<svelte:head>
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
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> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
6
11
|
};
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
export type DarkProviderProps = typeof __propDef.props;
|
|
10
|
-
export type DarkProviderEvents = typeof __propDef.events;
|
|
11
|
-
export type DarkProviderSlots = typeof __propDef.slots;
|
|
12
|
-
export default class DarkProvider extends SvelteComponent<DarkProviderProps, DarkProviderEvents, DarkProviderSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
declare const DarkProvider: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type DarkProvider = InstanceType<typeof DarkProvider>;
|
|
18
|
+
export default DarkProvider;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { IconMoonStarsFill, IconSunFill } from '@hyvor/icons';
|
|
3
|
+
import IconButton from '../IconButton/IconButton.svelte';
|
|
4
|
+
import { dark } from './../../stores/dark.js';
|
|
5
|
+
|
|
6
|
+
function handleClick() {
|
|
7
|
+
dark.update((value) => !value);
|
|
8
|
+
}
|
|
7
9
|
</script>
|
|
8
10
|
|
|
9
11
|
<IconButton on:click={handleClick} variant="invisible">
|