@hyvor/design 0.0.68 → 1.0.5
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 -19
- package/dist/components/ActionList/ActionListGroup.svelte +18 -8
- package/dist/components/ActionList/ActionListGroup.svelte.d.ts +8 -19
- package/dist/components/ActionList/ActionListItem.svelte +49 -25
- package/dist/components/ActionList/ActionListItem.svelte.d.ts +28 -25
- package/dist/components/ActionList/Selected.svelte +10 -4
- package/dist/components/ActionList/Selected.svelte.d.ts +6 -16
- package/dist/components/Avatar/Avatar.svelte +16 -9
- package/dist/components/Avatar/Avatar.svelte.d.ts +7 -17
- package/dist/components/Avatar/AvatarStack.svelte +14 -8
- package/dist/components/Avatar/AvatarStack.svelte.d.ts +6 -17
- package/dist/components/Base/Base.svelte +14 -6
- package/dist/components/Base/Base.svelte.d.ts +6 -17
- package/dist/components/Box/Box.svelte +10 -3
- package/dist/components/Box/Box.svelte.d.ts +7 -18
- package/dist/components/Button/Button.svelte +52 -25
- package/dist/components/Button/Button.svelte.d.ts +16 -38
- package/dist/components/Button/ButtonGroup.svelte +9 -1
- package/dist/components/Button/ButtonGroup.svelte.d.ts +5 -26
- package/dist/components/Callout/Callout.svelte +41 -20
- package/dist/components/Callout/Callout.svelte.d.ts +11 -22
- 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 +7 -16
- package/dist/components/CodeBlock/getCode.js +2 -0
- package/dist/components/ColorPicker/ColorPicker.svelte +34 -15
- package/dist/components/ColorPicker/ColorPicker.svelte.d.ts +26 -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 -19
- package/dist/components/Dropdown/Dropdown.svelte +33 -14
- package/dist/components/Dropdown/Dropdown.svelte.d.ts +13 -23
- 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 -18
- package/dist/components/FormControl/FormControl.svelte +11 -2
- package/dist/components/FormControl/FormControl.svelte.d.ts +6 -26
- package/dist/components/FormControl/InputGroup.svelte +17 -9
- package/dist/components/FormControl/InputGroup.svelte.d.ts +7 -18
- package/dist/components/FormControl/Label.svelte +11 -2
- package/dist/components/FormControl/Label.svelte.d.ts +6 -26
- package/dist/components/FormControl/Validation.svelte +18 -9
- package/dist/components/FormControl/Validation.svelte.d.ts +8 -19
- package/dist/components/HyvorBar/BarProducts.svelte +44 -25
- package/dist/components/HyvorBar/BarSupport.svelte +165 -101
- package/dist/components/HyvorBar/BarSupport.svelte.d.ts +7 -17
- package/dist/components/HyvorBar/BarUpdates.svelte +25 -15
- package/dist/components/HyvorBar/BarUpdates.svelte.d.ts +6 -16
- package/dist/components/HyvorBar/BarUpdatesList.svelte +73 -48
- package/dist/components/HyvorBar/BarUpdatesList.svelte.d.ts +6 -16
- package/dist/components/HyvorBar/BarUser.svelte +36 -24
- package/dist/components/HyvorBar/BarUser.svelte.d.ts +5 -15
- 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 -32
- 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 -17
- package/dist/components/Internationalization/LanguageToggle.svelte +73 -47
- package/dist/components/Internationalization/LanguageToggle.svelte.d.ts +10 -20
- 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 -33
- 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 -26
- 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 +32 -29
- package/dist/components/Modal/ModalFooter.svelte +14 -6
- package/dist/components/Modal/ModalFooter.svelte.d.ts +23 -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 -32
- package/dist/components/Radio/Radio.svelte +35 -16
- package/dist/components/Radio/Radio.svelte.d.ts +10 -32
- package/dist/components/Slider/Slider.svelte +86 -36
- package/dist/components/Slider/Slider.svelte.d.ts +25 -20
- package/dist/components/SplitControl/SplitControl.svelte +27 -18
- package/dist/components/SplitControl/SplitControl.svelte.d.ts +11 -23
- package/dist/components/Switch/Switch.svelte +30 -15
- package/dist/components/Switch/Switch.svelte.d.ts +8 -30
- package/dist/components/TabNav/TabNav.svelte +29 -15
- package/dist/components/TabNav/TabNav.svelte.d.ts +7 -18
- package/dist/components/TabNav/TabNavItem.svelte +36 -15
- package/dist/components/TabNav/TabNavItem.svelte.d.ts +10 -23
- package/dist/components/Table/Table.svelte +11 -4
- package/dist/components/Table/Table.svelte.d.ts +7 -18
- package/dist/components/Table/TableRow.svelte +11 -3
- package/dist/components/Table/TableRow.svelte.d.ts +7 -18
- package/dist/components/Tag/Tag.svelte +65 -31
- package/dist/components/Tag/Tag.svelte.d.ts +16 -38
- package/dist/components/Text/Text.svelte +20 -6
- package/dist/components/Text/Text.svelte.d.ts +10 -21
- package/dist/components/TextInput/TextInput.svelte +81 -28
- package/dist/components/TextInput/TextInput.svelte.d.ts +14 -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 -15
- package/dist/components/Toast/ToastMessage.svelte +11 -4
- package/dist/components/Toast/ToastMessage.svelte.d.ts +5 -15
- 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 -17
- package/dist/marketing/Docs/Content/Content.svelte +41 -29
- package/dist/marketing/Docs/Content/Content.svelte.d.ts +5 -15
- package/dist/marketing/Docs/Content/DocsImage.svelte +17 -9
- package/dist/marketing/Docs/Content/DocsImage.svelte.d.ts +9 -19
- package/dist/marketing/Docs/Docs.svelte +9 -3
- package/dist/marketing/Docs/Docs.svelte.d.ts +6 -28
- package/dist/marketing/Docs/Nav/Nav.svelte +77 -50
- package/dist/marketing/Docs/Nav/Nav.svelte.d.ts +5 -15
- package/dist/marketing/Docs/Nav/NavCategory.svelte +16 -6
- package/dist/marketing/Docs/Nav/NavCategory.svelte.d.ts +8 -19
- package/dist/marketing/Docs/Nav/NavItem.svelte +10 -3
- package/dist/marketing/Docs/Nav/NavItem.svelte.d.ts +6 -17
- 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 -18
- package/dist/marketing/Document/DocumentTitle.svelte +16 -5
- package/dist/marketing/Document/DocumentTitle.svelte.d.ts +9 -19
- package/dist/marketing/Footer/Footer.svelte +55 -38
- package/dist/marketing/Footer/Footer.svelte.d.ts +8 -19
- package/dist/marketing/Footer/FooterLinkList.svelte +8 -2
- package/dist/marketing/Footer/FooterLinkList.svelte.d.ts +6 -17
- package/dist/marketing/Header/Header.svelte +41 -23
- package/dist/marketing/Header/Header.svelte.d.ts +10 -21
- package/dist/marketing/Logo/LogoBlogs.svelte +6 -1
- package/dist/marketing/Logo/LogoBlogs.svelte.d.ts +5 -15
- package/dist/marketing/Logo/LogoCore.svelte +6 -1
- package/dist/marketing/Logo/LogoCore.svelte.d.ts +5 -15
- package/dist/marketing/Logo/LogoFortguard.svelte +7 -2
- package/dist/marketing/Logo/LogoFortguard.svelte.d.ts +5 -15
- package/dist/marketing/Logo/LogoTalk.svelte +6 -1
- package/dist/marketing/Logo/LogoTalk.svelte.d.ts +5 -15
- package/dist/stores/dark.d.ts +0 -1
- package/package.json +10 -10
- package/dist/components/HyvorBar/BarProducts.svelte.d.ts +0 -39
|
@@ -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 DarkToggleProps = typeof __propDef.props;
|
|
10
|
-
export type DarkToggleEvents = typeof __propDef.events;
|
|
11
|
-
export type DarkToggleSlots = typeof __propDef.slots;
|
|
12
|
-
export default class DarkToggle extends SvelteComponent<DarkToggleProps, DarkToggleEvents, DarkToggleSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
declare const DarkToggle: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type DarkToggle = InstanceType<typeof DarkToggle>;
|
|
18
|
+
export default DarkToggle;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
color?: string;
|
|
4
|
+
height?: number;
|
|
5
|
+
width?: number;
|
|
6
|
+
margin?: number;
|
|
7
|
+
align?: 'start' | 'center' | 'end';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
color = 'var(--accent-lightest)',
|
|
12
|
+
height = 1,
|
|
13
|
+
width = 100,
|
|
14
|
+
margin = 0,
|
|
15
|
+
align = 'center'
|
|
16
|
+
}: Props = $props();
|
|
6
17
|
</script>
|
|
7
18
|
|
|
8
19
|
<div
|
|
@@ -17,7 +28,7 @@ export let align = "center";
|
|
|
17
28
|
margin-right: {align === 'center' ? 'auto' : 0};
|
|
18
29
|
display: flex;
|
|
19
30
|
"
|
|
20
|
-
|
|
31
|
+
></div>
|
|
21
32
|
|
|
22
33
|
<style>
|
|
23
34
|
.line {
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
margin?: number | undefined;
|
|
8
|
-
align?: "start" | "end" | "center" | undefined;
|
|
9
|
-
};
|
|
10
|
-
events: {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
};
|
|
13
|
-
slots: {};
|
|
14
|
-
};
|
|
15
|
-
export type DividerProps = typeof __propDef.props;
|
|
16
|
-
export type DividerEvents = typeof __propDef.events;
|
|
17
|
-
export type DividerSlots = typeof __propDef.slots;
|
|
18
|
-
export default class Divider extends SvelteComponent<DividerProps, DividerEvents, DividerSlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
color?: string;
|
|
3
|
+
height?: number;
|
|
4
|
+
width?: number;
|
|
5
|
+
margin?: number;
|
|
6
|
+
align?: 'start' | 'center' | 'end';
|
|
19
7
|
}
|
|
20
|
-
|
|
8
|
+
declare const Divider: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type Divider = ReturnType<typeof Divider>;
|
|
10
|
+
export default Divider;
|
|
@@ -1,27 +1,46 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import DropdownContent from './DropdownContent.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
show?: boolean;
|
|
7
|
+
width?: number;
|
|
8
|
+
relative?: boolean;
|
|
9
|
+
closeOnOutsideClick?: boolean;
|
|
10
|
+
align?: 'start' | 'center' | 'end';
|
|
11
|
+
position?: 'left' | 'right' | 'bottom' | 'top';
|
|
12
|
+
trigger?: Snippet;
|
|
13
|
+
content?: Snippet;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
show = $bindable(false),
|
|
18
|
+
width = 225,
|
|
19
|
+
relative = false,
|
|
20
|
+
closeOnOutsideClick = true,
|
|
21
|
+
align = 'start',
|
|
22
|
+
position = 'bottom',
|
|
23
|
+
trigger,
|
|
24
|
+
content
|
|
25
|
+
}: Props = $props();
|
|
26
|
+
|
|
27
|
+
let triggerEl: HTMLElement | undefined = $state();
|
|
9
28
|
</script>
|
|
10
29
|
|
|
11
30
|
<span class="dropdown" class:relative>
|
|
12
31
|
<span
|
|
13
32
|
class="trigger"
|
|
14
|
-
|
|
33
|
+
onclick={() => (show = !show)}
|
|
15
34
|
role="listbox"
|
|
16
35
|
tabindex="0"
|
|
17
|
-
|
|
36
|
+
onkeyup={(e) => {
|
|
18
37
|
if (e.key === 'Escape') {
|
|
19
38
|
show = false;
|
|
20
39
|
}
|
|
21
40
|
}}
|
|
22
|
-
bind:this={
|
|
41
|
+
bind:this={triggerEl}
|
|
23
42
|
>
|
|
24
|
-
|
|
43
|
+
{@render trigger?.()}
|
|
25
44
|
</span>
|
|
26
45
|
|
|
27
46
|
{#if show}
|
|
@@ -32,9 +51,9 @@ let trigger;
|
|
|
32
51
|
{align}
|
|
33
52
|
{position}
|
|
34
53
|
{relative}
|
|
35
|
-
{
|
|
54
|
+
trigger={triggerEl}
|
|
36
55
|
>
|
|
37
|
-
|
|
56
|
+
{@render content?.()}
|
|
38
57
|
</DropdownContent>
|
|
39
58
|
{/if}
|
|
40
59
|
</span>
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {
|
|
15
|
-
trigger: {};
|
|
16
|
-
content: {};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export type DropdownProps = typeof __propDef.props;
|
|
20
|
-
export type DropdownEvents = typeof __propDef.events;
|
|
21
|
-
export type DropdownSlots = typeof __propDef.slots;
|
|
22
|
-
export default class Dropdown extends SvelteComponent<DropdownProps, DropdownEvents, DropdownSlots> {
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
show?: boolean;
|
|
4
|
+
width?: number;
|
|
5
|
+
relative?: boolean;
|
|
6
|
+
closeOnOutsideClick?: boolean;
|
|
7
|
+
align?: 'start' | 'center' | 'end';
|
|
8
|
+
position?: 'left' | 'right' | 'bottom' | 'top';
|
|
9
|
+
trigger?: Snippet;
|
|
10
|
+
content?: Snippet;
|
|
23
11
|
}
|
|
24
|
-
|
|
12
|
+
declare const Dropdown: import("svelte").Component<Props, {}, "show">;
|
|
13
|
+
type Dropdown = ReturnType<typeof Dropdown>;
|
|
14
|
+
export default Dropdown;
|
|
@@ -1,99 +1,131 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { run } from 'svelte/legacy';
|
|
3
|
+
|
|
4
|
+
import { onMount } from 'svelte';
|
|
5
|
+
import { clickOutside } from '../directives/clickOutside.js';
|
|
6
|
+
import debounce from '../directives/debounce.js';
|
|
7
|
+
import { cubicIn } from 'svelte/easing';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
show: boolean;
|
|
11
|
+
width: number;
|
|
12
|
+
relative: boolean;
|
|
13
|
+
closeOnOutsideClick?: boolean;
|
|
14
|
+
align: 'start' | 'center' | 'end';
|
|
15
|
+
position: 'left' | 'right' | 'bottom' | 'top';
|
|
16
|
+
trigger: HTMLElement;
|
|
17
|
+
children?: import('svelte').Snippet;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let {
|
|
21
|
+
show = $bindable(),
|
|
22
|
+
width,
|
|
23
|
+
relative,
|
|
24
|
+
closeOnOutsideClick = true,
|
|
25
|
+
align,
|
|
26
|
+
position,
|
|
27
|
+
trigger,
|
|
28
|
+
children
|
|
29
|
+
}: Props = $props();
|
|
30
|
+
|
|
31
|
+
let contentWrap: HTMLElement | undefined = $state();
|
|
32
|
+
|
|
33
|
+
function positionWrap() {
|
|
34
|
+
if (!trigger) return;
|
|
35
|
+
if (!contentWrap) return;
|
|
36
|
+
if (relative) return;
|
|
37
|
+
|
|
38
|
+
const triggerRect = trigger.getBoundingClientRect();
|
|
39
|
+
const contentRect = contentWrap.getBoundingClientRect();
|
|
40
|
+
|
|
41
|
+
const documentWidth = document.documentElement.clientWidth;
|
|
42
|
+
|
|
43
|
+
const GAP = 5;
|
|
44
|
+
const SPACE_AROUND = 15;
|
|
45
|
+
|
|
46
|
+
if (position === 'bottom') {
|
|
47
|
+
contentWrap.style.top = triggerRect.bottom + GAP + 'px';
|
|
48
|
+
if (contentRect.height + triggerRect.bottom > window.innerHeight) {
|
|
49
|
+
contentWrap.style.bottom = SPACE_AROUND + 'px';
|
|
50
|
+
} else {
|
|
51
|
+
contentWrap.style.bottom = 'auto';
|
|
52
|
+
}
|
|
53
|
+
} else if (position === 'top') {
|
|
54
|
+
contentWrap.style.top = triggerRect.top - contentRect.height - GAP + 'px';
|
|
55
|
+
} else if (position === 'left') {
|
|
56
|
+
contentWrap.style.left = triggerRect.left - width - GAP + 'px';
|
|
57
|
+
} else if (position === 'right') {
|
|
58
|
+
contentWrap.style.left = triggerRect.right + GAP + 'px';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (position === 'bottom' || position === 'top') {
|
|
62
|
+
if (align === 'start') {
|
|
63
|
+
if (triggerRect.left + width < documentWidth) {
|
|
64
|
+
contentWrap.style.left = triggerRect.left + 'px';
|
|
65
|
+
} else {
|
|
66
|
+
contentWrap.style.right = SPACE_AROUND + 'px';
|
|
67
|
+
}
|
|
68
|
+
} else if (align === 'center') {
|
|
69
|
+
contentWrap.style.left =
|
|
70
|
+
Math.max(triggerRect.left + triggerRect.width / 2 - width / 2, SPACE_AROUND) + 'px';
|
|
71
|
+
} else if (align === 'end') {
|
|
72
|
+
contentWrap.style.left = Math.max(triggerRect.right - width, SPACE_AROUND) + 'px';
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
if (align === 'start') {
|
|
76
|
+
contentWrap.style.top = triggerRect.top + 'px';
|
|
77
|
+
} else if (align === 'center') {
|
|
78
|
+
contentWrap.style.top =
|
|
79
|
+
triggerRect.top + triggerRect.height / 2 - contentRect.height / 2 + 'px';
|
|
80
|
+
} else if (align === 'end') {
|
|
81
|
+
contentWrap.style.top = triggerRect.bottom - contentRect.height + 'px';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (width >= documentWidth - SPACE_AROUND * 2) {
|
|
86
|
+
contentWrap.style.width = documentWidth - SPACE_AROUND * 2 + 'px';
|
|
87
|
+
} else {
|
|
88
|
+
contentWrap.style.width = width + 'px';
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
run(() => {
|
|
93
|
+
if (position || align) {
|
|
94
|
+
positionWrap();
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
function debouncedPosition() {
|
|
99
|
+
debounce(positionWrap, 10)();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
onMount(() => {
|
|
103
|
+
if (!contentWrap) return;
|
|
104
|
+
|
|
105
|
+
positionWrap();
|
|
106
|
+
|
|
107
|
+
const mutationObserver = new MutationObserver(positionWrap);
|
|
108
|
+
mutationObserver.observe(contentWrap, {
|
|
109
|
+
subtree: true,
|
|
110
|
+
childList: true
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
function slideIn(node: any) {
|
|
115
|
+
return {
|
|
116
|
+
duration: 100,
|
|
117
|
+
easing: cubicIn,
|
|
118
|
+
css: (t: number) => {
|
|
119
|
+
return `
|
|
88
120
|
opacity: ${0.2 + t * 0.8};
|
|
89
121
|
transform: translateY(-${(1 - t) * 5}px) scale(${0.95 + t * 0.05});
|
|
90
122
|
`;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
94
126
|
</script>
|
|
95
127
|
|
|
96
|
-
<svelte:window
|
|
128
|
+
<svelte:window onresize={debouncedPosition} onscroll={debouncedPosition} />
|
|
97
129
|
|
|
98
130
|
<div
|
|
99
131
|
class="content-wrap {align} {position}"
|
|
@@ -106,7 +138,7 @@ function slideIn(node) {
|
|
|
106
138
|
transition:slideIn
|
|
107
139
|
>
|
|
108
140
|
<div class="hds-box content">
|
|
109
|
-
|
|
141
|
+
{@render children?.()}
|
|
110
142
|
</div>
|
|
111
143
|
</div>
|
|
112
144
|
|
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
[evt: string]: CustomEvent<any>;
|
|
14
|
-
};
|
|
15
|
-
slots: {
|
|
16
|
-
default: {};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export type DropdownContentProps = typeof __propDef.props;
|
|
20
|
-
export type DropdownContentEvents = typeof __propDef.events;
|
|
21
|
-
export type DropdownContentSlots = typeof __propDef.slots;
|
|
22
|
-
export default class DropdownContent extends SvelteComponent<DropdownContentProps, DropdownContentEvents, DropdownContentSlots> {
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
1
|
+
declare const DropdownContent: import("svelte").Component<{
|
|
2
|
+
show: boolean;
|
|
3
|
+
width: number;
|
|
4
|
+
relative: boolean;
|
|
5
|
+
closeOnOutsideClick?: boolean;
|
|
6
|
+
align: "start" | "center" | "end";
|
|
7
|
+
position: "left" | "right" | "bottom" | "top";
|
|
8
|
+
trigger: HTMLElement;
|
|
9
|
+
children?: import("svelte").Snippet;
|
|
10
|
+
}, {}, "show">;
|
|
11
|
+
type DropdownContent = ReturnType<typeof DropdownContent>;
|
|
12
|
+
export default DropdownContent;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
bold?: boolean;
|
|
4
|
+
children?: import('svelte').Snippet;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
let { bold = false, children, ...rest }: Props = $props();
|
|
2
9
|
</script>
|
|
3
10
|
|
|
4
|
-
<div class="caption" class:bold {
|
|
5
|
-
|
|
11
|
+
<div class="caption" class:bold {...rest}>
|
|
12
|
+
{@render children?.()}
|
|
6
13
|
</div>
|
|
7
14
|
|
|
8
15
|
<style>
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
bold?: boolean | undefined;
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {
|
|
11
|
-
default: {};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type CaptionProps = typeof __propDef.props;
|
|
15
|
-
export type CaptionEvents = typeof __propDef.events;
|
|
16
|
-
export type CaptionSlots = typeof __propDef.slots;
|
|
17
|
-
export default class Caption extends SvelteComponent<CaptionProps, CaptionEvents, CaptionSlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
bold?: boolean;
|
|
3
|
+
children?: import('svelte').Snippet;
|
|
4
|
+
[key: string]: any;
|
|
18
5
|
}
|
|
19
|
-
|
|
6
|
+
declare const Caption: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type Caption = ReturnType<typeof Caption>;
|
|
8
|
+
export default Caption;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
children?: import('svelte').Snippet;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
let { children, ...rest }: Props = $props();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div class="form-control" {...rest}>
|
|
11
|
+
{@render children?.()}
|
|
3
12
|
</div>
|
|
4
13
|
|
|
5
14
|
<style>
|
|
@@ -1,27 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default class FormControl extends SvelteComponent<{
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {
|
|
9
|
-
default: {};
|
|
10
|
-
}> {
|
|
1
|
+
interface Props {
|
|
2
|
+
children?: import('svelte').Snippet;
|
|
3
|
+
[key: string]: any;
|
|
11
4
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
import { SvelteComponent } from "svelte";
|
|
16
|
-
declare const __propDef: {
|
|
17
|
-
props: {
|
|
18
|
-
[x: string]: any;
|
|
19
|
-
};
|
|
20
|
-
events: {
|
|
21
|
-
[evt: string]: CustomEvent<any>;
|
|
22
|
-
};
|
|
23
|
-
slots: {
|
|
24
|
-
default: {};
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export {};
|
|
5
|
+
declare const FormControl: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type FormControl = ReturnType<typeof FormControl>;
|
|
7
|
+
export default FormControl;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
gap?: number | 'small' | 'medium' | 'large';
|
|
4
|
+
children?: import('svelte').Snippet;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
let { gap = $bindable('medium'), children, ...rest }: Props = $props();
|
|
9
|
+
|
|
10
|
+
const gaps = {
|
|
11
|
+
small: 4,
|
|
12
|
+
medium: 8,
|
|
13
|
+
large: 16
|
|
14
|
+
};
|
|
15
|
+
gap = typeof gap === 'number' ? gap : gaps[gap];
|
|
8
16
|
</script>
|
|
9
17
|
|
|
10
|
-
<div class="checkbox-group" style:gap={gap + 'px'} {
|
|
11
|
-
|
|
18
|
+
<div class="checkbox-group" style:gap={gap + 'px'} {...rest}>
|
|
19
|
+
{@render children?.()}
|
|
12
20
|
</div>
|
|
13
21
|
|
|
14
22
|
<style>
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
gap?: number | "small" | "medium" | "large" | undefined;
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {
|
|
11
|
-
default: {};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type InputGroupProps = typeof __propDef.props;
|
|
15
|
-
export type InputGroupEvents = typeof __propDef.events;
|
|
16
|
-
export type InputGroupSlots = typeof __propDef.slots;
|
|
17
|
-
export default class InputGroup extends SvelteComponent<InputGroupProps, InputGroupEvents, InputGroupSlots> {
|
|
1
|
+
interface Props {
|
|
2
|
+
gap?: number | 'small' | 'medium' | 'large';
|
|
3
|
+
children?: import('svelte').Snippet;
|
|
4
|
+
[key: string]: any;
|
|
18
5
|
}
|
|
19
|
-
|
|
6
|
+
declare const InputGroup: import("svelte").Component<Props, {}, "gap">;
|
|
7
|
+
type InputGroup = ReturnType<typeof InputGroup>;
|
|
8
|
+
export default InputGroup;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
children?: import('svelte').Snippet;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
let { children, ...rest }: Props = $props();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<label {...rest}>
|
|
11
|
+
{@render children?.()}
|
|
3
12
|
</label>
|
|
4
13
|
|
|
5
14
|
<style>
|