@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,95 +1,100 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createBubbler } from 'svelte/legacy';
|
|
3
|
+
|
|
4
|
+
const bubble = createBubbler();
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
href: string;
|
|
8
|
+
active?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
start?: import('svelte').Snippet;
|
|
11
|
+
children?: import('svelte').Snippet;
|
|
12
|
+
end?: import('svelte').Snippet;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
let { href, active = false, disabled = false, start, children, end }: Props = $props();
|
|
4
17
|
</script>
|
|
5
18
|
|
|
6
|
-
<a
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
<a
|
|
20
|
+
{href}
|
|
21
|
+
class:active
|
|
22
|
+
class:disabled
|
|
23
|
+
onkeyup={bubble('keyup')}
|
|
24
|
+
onkeydown={bubble('keydown')}
|
|
25
|
+
onkeypress={bubble('keypress')}
|
|
26
|
+
onfocus={bubble('focus')}
|
|
27
|
+
onblur={bubble('blur')}
|
|
28
|
+
onclick={bubble('click')}
|
|
29
|
+
onmouseover={bubble('mouseover')}
|
|
30
|
+
onmouseenter={bubble('mouseenter')}
|
|
31
|
+
onmouseleave={bubble('mouseleave')}
|
|
32
|
+
onchange={bubble('change')}
|
|
20
33
|
>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<slot name="end" />
|
|
37
|
-
</span>
|
|
38
|
-
{/if}
|
|
34
|
+
{#if start}
|
|
35
|
+
<span class="start">
|
|
36
|
+
{@render start?.()}
|
|
37
|
+
</span>
|
|
38
|
+
{/if}
|
|
39
|
+
|
|
40
|
+
<span class="middle">
|
|
41
|
+
{@render children?.()}
|
|
42
|
+
</span>
|
|
43
|
+
|
|
44
|
+
{#if end}
|
|
45
|
+
<span class="end">
|
|
46
|
+
{@render end?.()}
|
|
47
|
+
</span>
|
|
48
|
+
{/if}
|
|
39
49
|
</a>
|
|
40
50
|
|
|
41
|
-
|
|
42
51
|
<style>
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
</style>
|
|
52
|
+
a {
|
|
53
|
+
display: flex;
|
|
54
|
+
padding: 12px 29px;
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
letter-spacing: 0.3px;
|
|
57
|
+
border-left: 3px solid transparent;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
align-items: center;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
a:hover {
|
|
63
|
+
background-color: var(--hover);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
a.active {
|
|
67
|
+
background-color: var(--accent-lightest);
|
|
68
|
+
border-left: 3px solid var(--accent);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
a.disabled {
|
|
72
|
+
cursor: not-allowed;
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
opacity: 0.5;
|
|
75
|
+
/* hover */
|
|
76
|
+
background-color: transparent;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.start,
|
|
80
|
+
.middle,
|
|
81
|
+
.end {
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.middle {
|
|
87
|
+
flex: 1;
|
|
88
|
+
/* display: flex; */
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
align-items: flex-start;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.start {
|
|
94
|
+
margin-right: 8px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.end {
|
|
98
|
+
margin-left: 8px;
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
focus: FocusEvent;
|
|
13
|
-
blur: FocusEvent;
|
|
14
|
-
click: MouseEvent;
|
|
15
|
-
mouseover: MouseEvent;
|
|
16
|
-
mouseenter: MouseEvent;
|
|
17
|
-
mouseleave: MouseEvent;
|
|
18
|
-
change: Event;
|
|
19
|
-
} & {
|
|
20
|
-
[evt: string]: CustomEvent<any>;
|
|
21
|
-
};
|
|
22
|
-
slots: {
|
|
23
|
-
start: {};
|
|
24
|
-
default: {};
|
|
25
|
-
end: {};
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export type NavLinkProps = typeof __propDef.props;
|
|
29
|
-
export type NavLinkEvents = typeof __propDef.events;
|
|
30
|
-
export type NavLinkSlots = typeof __propDef.slots;
|
|
31
|
-
export default class NavLink extends SvelteComponent<NavLinkProps, NavLinkEvents, NavLinkSlots> {
|
|
32
|
-
}
|
|
33
|
-
export {};
|
|
1
|
+
declare const NavLink: import("svelte").Component<{
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
href: string;
|
|
4
|
+
active?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
start?: import("svelte").Snippet;
|
|
7
|
+
children?: import("svelte").Snippet;
|
|
8
|
+
end?: import("svelte").Snippet;
|
|
9
|
+
}, {}, "">;
|
|
10
|
+
type NavLink = ReturnType<typeof NavLink>;
|
|
11
|
+
export default NavLink;
|
|
@@ -1,42 +1,53 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createBubbler } from 'svelte/legacy';
|
|
3
|
+
|
|
4
|
+
const bubble = createBubbler();
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
/* for whatever reason simply passing value with rest props doesn't work */
|
|
8
|
+
value?: number | string;
|
|
9
|
+
group?: number | string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
input?: any;
|
|
12
|
+
children?: import('svelte').Snippet;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
value = '',
|
|
18
|
+
group = $bindable(''),
|
|
19
|
+
disabled = false,
|
|
20
|
+
input = $bindable({} as HTMLInputElement),
|
|
21
|
+
children,
|
|
22
|
+
...rest
|
|
23
|
+
}: Props = $props();
|
|
5
24
|
</script>
|
|
6
25
|
|
|
7
|
-
<label
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
{...$$restProps}
|
|
31
|
-
/>
|
|
32
|
-
|
|
33
|
-
<span class="checkmark"></span>
|
|
34
|
-
|
|
35
|
-
<slot />
|
|
36
|
-
|
|
26
|
+
<label class:disabled>
|
|
27
|
+
<input
|
|
28
|
+
type="radio"
|
|
29
|
+
{disabled}
|
|
30
|
+
bind:group
|
|
31
|
+
bind:this={input}
|
|
32
|
+
{value}
|
|
33
|
+
onkeyup={bubble('keyup')}
|
|
34
|
+
onkeydown={bubble('keydown')}
|
|
35
|
+
onkeypress={bubble('keypress')}
|
|
36
|
+
onfocus={bubble('focus')}
|
|
37
|
+
onblur={bubble('blur')}
|
|
38
|
+
onclick={bubble('click')}
|
|
39
|
+
onmouseover={bubble('mouseover')}
|
|
40
|
+
onmouseenter={bubble('mouseenter')}
|
|
41
|
+
onmouseleave={bubble('mouseleave')}
|
|
42
|
+
onchange={bubble('change')}
|
|
43
|
+
{...rest}
|
|
44
|
+
/>
|
|
45
|
+
|
|
46
|
+
<span class="checkmark"></span>
|
|
47
|
+
|
|
48
|
+
{@render children?.()}
|
|
37
49
|
</label>
|
|
38
50
|
|
|
39
|
-
|
|
40
51
|
<style>label {
|
|
41
52
|
position: relative;
|
|
42
53
|
padding-left: 30px;
|
|
@@ -1,33 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
keyup: KeyboardEvent;
|
|
12
|
-
keydown: KeyboardEvent;
|
|
13
|
-
keypress: KeyboardEvent;
|
|
14
|
-
focus: FocusEvent;
|
|
15
|
-
blur: FocusEvent;
|
|
16
|
-
click: MouseEvent;
|
|
17
|
-
mouseover: MouseEvent;
|
|
18
|
-
mouseenter: MouseEvent;
|
|
19
|
-
mouseleave: MouseEvent;
|
|
20
|
-
change: Event;
|
|
21
|
-
} & {
|
|
22
|
-
[evt: string]: CustomEvent<any>;
|
|
23
|
-
};
|
|
24
|
-
slots: {
|
|
25
|
-
default: {};
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export type RadioProps = typeof __propDef.props;
|
|
29
|
-
export type RadioEvents = typeof __propDef.events;
|
|
30
|
-
export type RadioSlots = typeof __propDef.slots;
|
|
31
|
-
export default class Radio extends SvelteComponent<RadioProps, RadioEvents, RadioSlots> {
|
|
32
|
-
}
|
|
33
|
-
export {};
|
|
1
|
+
declare const Radio: import("svelte").Component<{
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
value?: number | string;
|
|
4
|
+
group?: number | string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
input?: any;
|
|
7
|
+
children?: import("svelte").Snippet;
|
|
8
|
+
}, {}, "group" | "input">;
|
|
9
|
+
type Radio = ReturnType<typeof Radio>;
|
|
10
|
+
export default Radio;
|
|
@@ -1,127 +1,136 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createEventDispatcher } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
min: number;
|
|
6
|
+
max: number;
|
|
7
|
+
value: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
// export let disabled = false;
|
|
10
|
+
dots?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { min, max, value = $bindable(), step = 1, dots = false }: Props = $props();
|
|
14
|
+
|
|
15
|
+
const dispatch = createEventDispatcher<{
|
|
16
|
+
change: number;
|
|
17
|
+
}>();
|
|
18
|
+
|
|
19
|
+
function toStep(value: number) {
|
|
20
|
+
return Math.max(min, Math.min(max, Math.round(value / step) * step));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let progress = $derived(((value - min) / (max - min)) * 100);
|
|
24
|
+
|
|
25
|
+
let dragging = $state(false);
|
|
26
|
+
let trackEl: HTMLDivElement | undefined = $state();
|
|
27
|
+
|
|
28
|
+
function handleMousedown(event: MouseEvent) {
|
|
29
|
+
dragging = true;
|
|
30
|
+
handleMousemove(event);
|
|
31
|
+
|
|
32
|
+
window.addEventListener('mousemove', handleMousemove);
|
|
33
|
+
window.addEventListener('mouseup', handleMouseup);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function handleMouseup() {
|
|
37
|
+
dragging = false;
|
|
38
|
+
window.removeEventListener('mousemove', handleMousemove);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function handleMousemove(event: MouseEvent) {
|
|
42
|
+
if (!trackEl) return;
|
|
43
|
+
if (dragging) {
|
|
44
|
+
const rect = trackEl.getBoundingClientRect();
|
|
45
|
+
const x = event.clientX - rect.left;
|
|
46
|
+
const width = rect.width;
|
|
47
|
+
const newValue = min + (x / width) * (max - min);
|
|
48
|
+
value = toStep(newValue);
|
|
49
|
+
dispatch('change', value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
35
52
|
</script>
|
|
36
53
|
|
|
37
54
|
<div class="slider">
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{#each Array.from({ length: (max - min) / step + 1 }, (_, i) => i) as i}
|
|
54
|
-
<div
|
|
55
|
-
class="dot"
|
|
56
|
-
style="left: {(i * 100) / ((max - min) / step)}%"
|
|
57
|
-
></div>
|
|
58
|
-
{/each}
|
|
59
|
-
{/if}
|
|
60
|
-
</div>
|
|
55
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
56
|
+
<div class="track" bind:this={trackEl} class:dragging onmousedown={handleMousedown}>
|
|
57
|
+
<div class="progress" style="width: {progress}%"></div>
|
|
58
|
+
<button class="handle" style="left: {progress}%">
|
|
59
|
+
<span class="tip">
|
|
60
|
+
{value}
|
|
61
|
+
</span>
|
|
62
|
+
</button>
|
|
63
|
+
|
|
64
|
+
{#if dots}
|
|
65
|
+
{#each Array.from({ length: (max - min) / step + 1 }, (_, i) => i) as i}
|
|
66
|
+
<div class="dot" style="left: {(i * 100) / ((max - min) / step)}%"></div>
|
|
67
|
+
{/each}
|
|
68
|
+
{/if}
|
|
69
|
+
</div>
|
|
61
70
|
</div>
|
|
62
71
|
|
|
63
72
|
<style>
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
73
|
+
.track {
|
|
74
|
+
background-color: var(--input);
|
|
75
|
+
height: 10px;
|
|
76
|
+
border-radius: 20px;
|
|
77
|
+
position: relative;
|
|
78
|
+
}
|
|
79
|
+
.handle {
|
|
80
|
+
background-color: var(--accent);
|
|
81
|
+
width: 20px;
|
|
82
|
+
height: 20px;
|
|
83
|
+
border-radius: 50%;
|
|
84
|
+
position: absolute;
|
|
85
|
+
top: 50%;
|
|
86
|
+
transform: translate(-50%, -50%);
|
|
87
|
+
cursor: grab;
|
|
88
|
+
z-index: 1;
|
|
89
|
+
transition: 0.2s box-shadow;
|
|
90
|
+
}
|
|
91
|
+
.handle:hover {
|
|
92
|
+
box-shadow: 0 0 0 2px var(--accent-light);
|
|
93
|
+
}
|
|
94
|
+
.tip {
|
|
95
|
+
position: absolute;
|
|
96
|
+
bottom: 100%;
|
|
97
|
+
margin-bottom: 3px;
|
|
98
|
+
left: 50%;
|
|
99
|
+
transform: translateX(-50%);
|
|
100
|
+
padding: 3px 6px;
|
|
101
|
+
border-radius: 5px;
|
|
102
|
+
|
|
103
|
+
/* from Tooltip */
|
|
104
|
+
--local-bg: #24292f;
|
|
105
|
+
--local-color: #fff;
|
|
106
|
+
|
|
107
|
+
background-color: var(--local-bg);
|
|
108
|
+
color: var(--local-color);
|
|
109
|
+
display: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.dot {
|
|
113
|
+
background-color: var(--accent-light);
|
|
114
|
+
z-index: 0;
|
|
115
|
+
width: 8px;
|
|
116
|
+
height: 8px;
|
|
117
|
+
border-radius: 50%;
|
|
118
|
+
position: absolute;
|
|
119
|
+
top: 50%;
|
|
120
|
+
transform: translate(-50%, -50%);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.handle:hover .tip,
|
|
124
|
+
.track.dragging .tip {
|
|
125
|
+
display: block;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.track.dragging,
|
|
129
|
+
.track.dragging .handle {
|
|
130
|
+
cursor: grabbing;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.track.dragging .handle {
|
|
134
|
+
box-shadow: 0 0 0 3px var(--accent-light);
|
|
135
|
+
}
|
|
127
136
|
</style>
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
9
11
|
};
|
|
10
|
-
|
|
11
|
-
change: CustomEvent<number>;
|
|
12
|
-
} & {
|
|
13
|
-
[evt: string]: CustomEvent<any>;
|
|
14
|
-
};
|
|
15
|
-
slots: {};
|
|
16
|
-
};
|
|
17
|
-
export type SliderProps = typeof __propDef.props;
|
|
18
|
-
export type SliderEvents = typeof __propDef.events;
|
|
19
|
-
export type SliderSlots = typeof __propDef.slots;
|
|
20
|
-
export default class Slider extends SvelteComponent<SliderProps, SliderEvents, SliderSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
21
13
|
}
|
|
22
|
-
|
|
14
|
+
declare const Slider: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
min: number;
|
|
16
|
+
max: number;
|
|
17
|
+
value: number;
|
|
18
|
+
step?: number;
|
|
19
|
+
dots?: boolean;
|
|
20
|
+
}, {
|
|
21
|
+
change: CustomEvent<number>;
|
|
22
|
+
} & {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
}, {}, {}, "value">;
|
|
25
|
+
type Slider = InstanceType<typeof Slider>;
|
|
26
|
+
export default Slider;
|