@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,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,7 +1,26 @@
|
|
|
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
26
|
<label class:disabled>
|
|
@@ -11,22 +30,22 @@ export let input = {};
|
|
|
11
30
|
bind:group
|
|
12
31
|
bind:this={input}
|
|
13
32
|
{value}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{
|
|
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}
|
|
25
44
|
/>
|
|
26
45
|
|
|
27
46
|
<span class="checkmark"></span>
|
|
28
47
|
|
|
29
|
-
|
|
48
|
+
{@render children?.()}
|
|
30
49
|
</label>
|
|
31
50
|
|
|
32
51
|
<style>label {
|
|
@@ -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,42 +1,59 @@
|
|
|
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
|
-
<!-- svelte-ignore
|
|
39
|
-
<div class="track" bind:this={trackEl} class:dragging
|
|
55
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
56
|
+
<div class="track" bind:this={trackEl} class:dragging onmousedown={handleMousedown}>
|
|
40
57
|
<div class="progress" style="width: {progress}%"></div>
|
|
41
58
|
<button class="handle" style="left: {progress}%">
|
|
42
59
|
<span class="tip">
|
|
@@ -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;
|
|
@@ -1,42 +1,51 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import Caption from '../FormControl/Caption.svelte';
|
|
4
|
+
import Label from '../FormControl/Label.svelte';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
label?: string | Snippet;
|
|
8
|
+
caption?: string | Snippet;
|
|
9
|
+
column?: boolean;
|
|
10
|
+
flex?: number[];
|
|
11
|
+
children?: Snippet;
|
|
12
|
+
nested?: Snippet;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const { label, caption, column = false, flex = [1, 2], children, nested }: Props = $props();
|
|
7
16
|
</script>
|
|
8
17
|
|
|
9
|
-
<div class="split-control" class:has-nested={
|
|
18
|
+
<div class="split-control" class:has-nested={!!nested} class:column>
|
|
10
19
|
<div class="left" style:flex={flex[0]}>
|
|
11
20
|
<div class="label-wrap">
|
|
12
|
-
{#if
|
|
13
|
-
<slot name="label" />
|
|
14
|
-
{:else}
|
|
21
|
+
{#if typeof label === 'string'}
|
|
15
22
|
<Label>{label}</Label>
|
|
23
|
+
{:else}
|
|
24
|
+
{@render label?.()}
|
|
16
25
|
{/if}
|
|
17
26
|
</div>
|
|
18
27
|
|
|
19
|
-
{#if
|
|
28
|
+
{#if caption}
|
|
20
29
|
<div class="caption-wrap">
|
|
21
|
-
{#if
|
|
22
|
-
<slot name="caption" />
|
|
23
|
-
{:else if caption}
|
|
30
|
+
{#if typeof caption === 'string'}
|
|
24
31
|
<Caption>{caption}</Caption>
|
|
32
|
+
{:else}
|
|
33
|
+
{@render caption()}
|
|
25
34
|
{/if}
|
|
26
35
|
</div>
|
|
27
36
|
{/if}
|
|
28
37
|
</div>
|
|
29
38
|
|
|
30
|
-
{#if
|
|
39
|
+
{#if children}
|
|
31
40
|
<div class="right" style:flex={flex[1]}>
|
|
32
|
-
|
|
41
|
+
{@render children()}
|
|
33
42
|
</div>
|
|
34
43
|
{/if}
|
|
35
44
|
</div>
|
|
36
45
|
|
|
37
|
-
{#if
|
|
46
|
+
{#if nested}
|
|
38
47
|
<div class="nested">
|
|
39
|
-
|
|
48
|
+
{@render nested()}
|
|
40
49
|
</div>
|
|
41
50
|
{/if}
|
|
42
51
|
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
slots: {
|
|
13
|
-
label: {};
|
|
14
|
-
caption: {};
|
|
15
|
-
default: {};
|
|
16
|
-
nested: {};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export type SplitControlProps = typeof __propDef.props;
|
|
20
|
-
export type SplitControlEvents = typeof __propDef.events;
|
|
21
|
-
export type SplitControlSlots = typeof __propDef.slots;
|
|
22
|
-
export default class SplitControl extends SvelteComponent<SplitControlProps, SplitControlEvents, SplitControlSlots> {
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
declare const SplitControl: import("svelte").Component<{
|
|
3
|
+
label?: string | Snippet;
|
|
4
|
+
caption?: string | Snippet;
|
|
5
|
+
column?: boolean;
|
|
6
|
+
flex?: number[];
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
nested?: Snippet;
|
|
9
|
+
}, {}, "">;
|
|
10
|
+
type SplitControl = ReturnType<typeof SplitControl>;
|
|
11
|
+
export default SplitControl;
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createBubbler } from 'svelte/legacy';
|
|
3
|
+
|
|
4
|
+
const bubble = createBubbler();
|
|
5
|
+
interface Props {
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
input?: any;
|
|
8
|
+
children?: import('svelte').Snippet;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
checked = $bindable(false),
|
|
14
|
+
input = $bindable({} as HTMLInputElement),
|
|
15
|
+
children,
|
|
16
|
+
...rest
|
|
17
|
+
}: Props = $props();
|
|
3
18
|
</script>
|
|
4
19
|
|
|
5
20
|
<label class="switch-wrap">
|
|
@@ -8,23 +23,23 @@ export let input = {};
|
|
|
8
23
|
type="checkbox"
|
|
9
24
|
bind:checked
|
|
10
25
|
bind:this={input}
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
{...rest}
|
|
27
|
+
onkeyup={bubble('keyup')}
|
|
28
|
+
onkeydown={bubble('keydown')}
|
|
29
|
+
onkeypress={bubble('keypress')}
|
|
30
|
+
onfocus={bubble('focus')}
|
|
31
|
+
onblur={bubble('blur')}
|
|
32
|
+
onclick={bubble('click')}
|
|
33
|
+
onmouseover={bubble('mouseover')}
|
|
34
|
+
onmouseenter={bubble('mouseenter')}
|
|
35
|
+
onmouseleave={bubble('mouseleave')}
|
|
36
|
+
onchange={bubble('change')}
|
|
22
37
|
/>
|
|
23
38
|
<span class="slider"></span>
|
|
24
39
|
</span>
|
|
25
|
-
{#if
|
|
40
|
+
{#if children}
|
|
26
41
|
<span class="message">
|
|
27
|
-
|
|
42
|
+
{@render children?.()}
|
|
28
43
|
</span>
|
|
29
44
|
{/if}
|
|
30
45
|
</label>
|
|
@@ -1,31 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
keyup: KeyboardEvent;
|
|
10
|
-
keydown: KeyboardEvent;
|
|
11
|
-
keypress: KeyboardEvent;
|
|
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
|
-
default: {};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export type SwitchProps = typeof __propDef.props;
|
|
27
|
-
export type SwitchEvents = typeof __propDef.events;
|
|
28
|
-
export type SwitchSlots = typeof __propDef.slots;
|
|
29
|
-
export default class Switch extends SvelteComponent<SwitchProps, SwitchEvents, SwitchSlots> {
|
|
30
|
-
}
|
|
31
|
-
export {};
|
|
1
|
+
declare const Switch: import("svelte").Component<{
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
checked?: boolean;
|
|
4
|
+
input?: any;
|
|
5
|
+
children?: import("svelte").Snippet;
|
|
6
|
+
}, {}, "checked" | "input">;
|
|
7
|
+
type Switch = ReturnType<typeof Switch>;
|
|
8
|
+
export default Switch;
|
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { run } from 'svelte/legacy';
|
|
3
|
+
|
|
4
|
+
import { onMount, setContext } from 'svelte';
|
|
5
|
+
import { writable } from 'svelte/store';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
active: string;
|
|
9
|
+
children?: import('svelte').Snippet;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { active = $bindable(), children, ...rest }: Props = $props();
|
|
14
|
+
|
|
15
|
+
const activeStore = writable(active);
|
|
16
|
+
setContext('tab-nav-active', activeStore);
|
|
17
|
+
|
|
18
|
+
$effect(() => {
|
|
19
|
+
activeStore.set(active);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
onMount(() => {
|
|
23
|
+
const unsubscribe = activeStore.subscribe((value) => {
|
|
24
|
+
active = value;
|
|
25
|
+
});
|
|
26
|
+
return unsubscribe;
|
|
27
|
+
});
|
|
14
28
|
</script>
|
|
15
29
|
|
|
16
|
-
<div class="tab-nav" {
|
|
17
|
-
|
|
30
|
+
<div class="tab-nav" {...rest}>
|
|
31
|
+
{@render children?.()}
|
|
18
32
|
</div>
|
|
19
33
|
|
|
20
34
|
<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 TabNavProps = typeof __propDef.props;
|
|
15
|
-
export type TabNavEvents = typeof __propDef.events;
|
|
16
|
-
export type TabNavSlots = typeof __propDef.slots;
|
|
17
|
-
export default class TabNav extends SvelteComponent<TabNavProps, TabNavEvents, TabNavSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
1
|
+
declare const TabNav: import("svelte").Component<{
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
active: string;
|
|
4
|
+
children?: import("svelte").Snippet;
|
|
5
|
+
}, {}, "active">;
|
|
6
|
+
type TabNav = ReturnType<typeof TabNav>;
|
|
7
|
+
export default TabNav;
|
|
@@ -1,24 +1,45 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createBubbler, handlers } from 'svelte/legacy';
|
|
3
|
+
|
|
4
|
+
const bubble = createBubbler();
|
|
5
|
+
import { getContext } from 'svelte';
|
|
6
|
+
import type { Writable } from 'svelte/store';
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
active?: boolean;
|
|
10
|
+
name: string;
|
|
11
|
+
start?: import('svelte').Snippet;
|
|
12
|
+
children?: import('svelte').Snippet;
|
|
13
|
+
end?: import('svelte').Snippet;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let { active = false, name, start, children, end, ...rest }: Props = $props();
|
|
18
|
+
|
|
19
|
+
const activeStore = getContext('tab-nav-active') as Writable<string>;
|
|
20
|
+
|
|
21
|
+
let isActive = $derived($activeStore === name || active);
|
|
22
|
+
|
|
23
|
+
function handleClick() {
|
|
24
|
+
activeStore.set(name);
|
|
25
|
+
}
|
|
10
26
|
</script>
|
|
11
27
|
|
|
12
|
-
<button
|
|
13
|
-
|
|
28
|
+
<button
|
|
29
|
+
class="tab"
|
|
30
|
+
class:active={isActive}
|
|
31
|
+
onclick={handlers(handleClick, bubble('click'))}
|
|
32
|
+
{...rest}
|
|
33
|
+
>
|
|
34
|
+
{#if start}
|
|
14
35
|
<span class="start">
|
|
15
|
-
|
|
36
|
+
{@render start?.()}
|
|
16
37
|
</span>
|
|
17
38
|
{/if}
|
|
18
|
-
|
|
19
|
-
{#if
|
|
39
|
+
{@render children?.()}
|
|
40
|
+
{#if end}
|
|
20
41
|
<span class="end">
|
|
21
|
-
|
|
42
|
+
{@render end?.()}
|
|
22
43
|
</span>
|
|
23
44
|
{/if}
|
|
24
45
|
</button>
|