@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,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,14 +1,24 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
+
}
|
|
7
9
|
|
|
10
|
+
let {
|
|
11
|
+
color = 'var(--accent-lightest)',
|
|
12
|
+
height = 1,
|
|
13
|
+
width = 100,
|
|
14
|
+
margin = 0,
|
|
15
|
+
align = 'center'
|
|
16
|
+
}: Props = $props();
|
|
17
|
+
</script>
|
|
8
18
|
|
|
9
19
|
<div
|
|
10
|
-
|
|
11
|
-
|
|
20
|
+
class="line"
|
|
21
|
+
style="
|
|
12
22
|
background-color: {color};
|
|
13
23
|
height: {height}px;
|
|
14
24
|
width: {width}%;
|
|
@@ -18,10 +28,10 @@ export let align = "center";
|
|
|
18
28
|
margin-right: {align === 'center' ? 'auto' : 0};
|
|
19
29
|
display: flex;
|
|
20
30
|
"
|
|
21
|
-
|
|
31
|
+
></div>
|
|
22
32
|
|
|
23
33
|
<style>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</style>
|
|
34
|
+
.line {
|
|
35
|
+
display: block;
|
|
36
|
+
}
|
|
37
|
+
</style>
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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> {
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
1
|
+
declare const Divider: import("svelte").Component<{
|
|
2
|
+
color?: string;
|
|
3
|
+
height?: number;
|
|
4
|
+
width?: number;
|
|
5
|
+
margin?: number;
|
|
6
|
+
align?: "start" | "center" | "end";
|
|
7
|
+
}, {}, "">;
|
|
8
|
+
type Divider = ReturnType<typeof Divider>;
|
|
9
|
+
export default Divider;
|
|
@@ -1,46 +1,61 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
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
|
-
<span
|
|
12
|
-
|
|
13
|
-
class
|
|
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
|
-
</Box>
|
|
41
|
-
</div>
|
|
42
|
-
{/if}
|
|
43
|
-
|
|
30
|
+
<span class="dropdown" class:relative>
|
|
31
|
+
<span
|
|
32
|
+
class="trigger"
|
|
33
|
+
onclick={() => (show = !show)}
|
|
34
|
+
role="listbox"
|
|
35
|
+
tabindex="0"
|
|
36
|
+
onkeyup={(e) => {
|
|
37
|
+
if (e.key === 'Escape') {
|
|
38
|
+
show = false;
|
|
39
|
+
}
|
|
40
|
+
}}
|
|
41
|
+
bind:this={triggerEl}
|
|
42
|
+
>
|
|
43
|
+
{@render trigger?.()}
|
|
44
|
+
</span>
|
|
45
|
+
|
|
46
|
+
{#if show}
|
|
47
|
+
<DropdownContent
|
|
48
|
+
bind:show
|
|
49
|
+
{width}
|
|
50
|
+
{closeOnOutsideClick}
|
|
51
|
+
{align}
|
|
52
|
+
{position}
|
|
53
|
+
{relative}
|
|
54
|
+
trigger={triggerEl}
|
|
55
|
+
>
|
|
56
|
+
{@render content?.()}
|
|
57
|
+
</DropdownContent>
|
|
58
|
+
{/if}
|
|
44
59
|
</span>
|
|
45
60
|
|
|
46
61
|
<style>.dropdown {
|
|
@@ -48,77 +63,6 @@ class:relative
|
|
|
48
63
|
display: inline-block;
|
|
49
64
|
}
|
|
50
65
|
|
|
51
|
-
.dropdown .content-wrap {
|
|
52
|
-
position:
|
|
53
|
-
left: 0;
|
|
54
|
-
z-index: 1;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.content-wrap.bottom {
|
|
58
|
-
top: 100%;
|
|
59
|
-
margin-top: 5px;
|
|
60
|
-
}
|
|
61
|
-
.content-wrap.bottom.end {
|
|
62
|
-
left: auto;
|
|
63
|
-
right: 0;
|
|
64
|
-
}
|
|
65
|
-
.content-wrap.bottom.center {
|
|
66
|
-
left: 50%;
|
|
67
|
-
transform: translateX(-50%);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.content-wrap.top {
|
|
71
|
-
bottom: 100%;
|
|
72
|
-
margin-bottom: 5px;
|
|
73
|
-
}
|
|
74
|
-
.content-wrap.top.end {
|
|
75
|
-
left: auto;
|
|
76
|
-
right: 0;
|
|
77
|
-
}
|
|
78
|
-
.content-wrap.top.center {
|
|
79
|
-
left: 50%;
|
|
80
|
-
transform: translateX(-50%);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.content-wrap.left {
|
|
84
|
-
right: 100%;
|
|
85
|
-
left: auto;
|
|
86
|
-
margin-right: 5px;
|
|
87
|
-
top: 0;
|
|
88
|
-
bottom: auto;
|
|
89
|
-
}
|
|
90
|
-
.content-wrap.left.end {
|
|
91
|
-
top: auto;
|
|
92
|
-
bottom: 0;
|
|
93
|
-
}
|
|
94
|
-
.content-wrap.left.center {
|
|
95
|
-
top: 50%;
|
|
96
|
-
transform: translateY(-50%);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.content-wrap.right {
|
|
100
|
-
left: 100%;
|
|
101
|
-
margin-left: 5px;
|
|
102
|
-
top: 0;
|
|
103
|
-
bottom: auto;
|
|
104
|
-
}
|
|
105
|
-
.content-wrap.right.end {
|
|
106
|
-
bottom: 0;
|
|
107
|
-
top: auto;
|
|
108
|
-
}
|
|
109
|
-
.content-wrap.right.center {
|
|
110
|
-
top: 50%;
|
|
111
|
-
transform: translateY(-50%);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.content-wrap > :global(.content) {
|
|
115
|
-
padding: 10px;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.dropdown.relative > .content-wrap {
|
|
119
|
-
position: relative;
|
|
66
|
+
.dropdown.relative > :global(.content-wrap) {
|
|
67
|
+
position: relative !important;
|
|
120
68
|
}</style>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
@@ -1,24 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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> {
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
declare const Dropdown: import("svelte").Component<{
|
|
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;
|
|
11
|
+
}, {}, "show">;
|
|
12
|
+
type Dropdown = ReturnType<typeof Dropdown>;
|
|
13
|
+
export default Dropdown;
|
|
@@ -0,0 +1,152 @@
|
|
|
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 `
|
|
120
|
+
opacity: ${0.2 + t * 0.8};
|
|
121
|
+
transform: translateY(-${(1 - t) * 5}px) scale(${0.95 + t * 0.05});
|
|
122
|
+
`;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
</script>
|
|
127
|
+
|
|
128
|
+
<svelte:window onresize={debouncedPosition} onscroll={debouncedPosition} />
|
|
129
|
+
|
|
130
|
+
<div
|
|
131
|
+
class="content-wrap {align} {position}"
|
|
132
|
+
use:clickOutside={{
|
|
133
|
+
enabled: closeOnOutsideClick,
|
|
134
|
+
callback: () => (show = false)
|
|
135
|
+
}}
|
|
136
|
+
bind:this={contentWrap}
|
|
137
|
+
style="width: {width}px"
|
|
138
|
+
transition:slideIn
|
|
139
|
+
>
|
|
140
|
+
<div class="hds-box content">
|
|
141
|
+
{@render children?.()}
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<style>.content-wrap {
|
|
146
|
+
position: fixed;
|
|
147
|
+
z-index: 1000000;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.content-wrap > .content {
|
|
151
|
+
padding: 10px;
|
|
152
|
+
}</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
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,16 +1,23 @@
|
|
|
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>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</style>
|
|
16
|
+
.caption {
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
color: var(--text-light);
|
|
19
|
+
}
|
|
20
|
+
.caption.bold {
|
|
21
|
+
font-weight: 600;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
1
|
+
declare const Caption: import("svelte").Component<{
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
bold?: boolean;
|
|
4
|
+
children?: import("svelte").Snippet;
|
|
5
|
+
}, {}, "">;
|
|
6
|
+
type Caption = ReturnType<typeof Caption>;
|
|
7
|
+
export default Caption;
|
|
@@ -1,27 +1,36 @@
|
|
|
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>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
.form-control {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
}
|
|
10
19
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
20
|
+
.form-control :global(.caption) {
|
|
21
|
+
margin-bottom: 8px;
|
|
22
|
+
}
|
|
14
23
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
.form-control > :global(label) {
|
|
25
|
+
margin-bottom: 8px;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
}
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
.form-control :global(label + .caption) {
|
|
30
|
+
margin-top: -8px;
|
|
31
|
+
}
|
|
23
32
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
.form-control :global(.validation) {
|
|
34
|
+
margin-top: 8px;
|
|
35
|
+
}
|
|
27
36
|
</style>
|
|
@@ -1,27 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {
|
|
9
|
-
default: {};
|
|
10
|
-
}> {
|
|
11
|
-
}
|
|
12
|
-
export type FormControlProps = typeof __propDef.props;
|
|
13
|
-
export type FormControlEvents = typeof __propDef.events;
|
|
14
|
-
export type FormControlSlots = typeof __propDef.slots;
|
|
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 {};
|
|
1
|
+
declare const FormControl: import("svelte").Component<{
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
children?: import("svelte").Snippet;
|
|
4
|
+
}, {}, "">;
|
|
5
|
+
type FormControl = ReturnType<typeof FormControl>;
|
|
6
|
+
export default FormControl;
|