@hyvor/design 2.1.7 → 2.1.8-beta.2
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/cloud/HyvorBar/BarSupport.svelte +1 -1
- package/dist/cloud/HyvorBar/Organization/BarOrganization.svelte +1 -1
- package/dist/components/Tooltip/Tooltip.svelte +28 -54
- package/dist/components/Tooltip/Tooltip.svelte.d.ts +35 -15
- package/dist/marketing/Footer/Footer.svelte +402 -98
- package/dist/marketing/Footer/Footer.svelte.d.ts +18 -2
- package/dist/marketing/Footer/FooterLinkList.svelte +10 -3
- package/dist/marketing/Header/Header.svelte +72 -28
- package/dist/marketing/Header/Header.svelte.d.ts +5 -2
- package/dist/marketing/Header/HeaderLanguageToggle.svelte +121 -0
- package/dist/marketing/Header/HeaderLanguageToggle.svelte.d.ts +14 -0
- package/dist/marketing/Header/HeaderNavLink.svelte +148 -0
- package/dist/marketing/Header/HeaderNavLink.svelte.d.ts +17 -0
- package/dist/marketing/Header/language.d.ts +18 -0
- package/dist/marketing/Header/language.js +35 -0
- package/dist/marketing/index.d.ts +4 -0
- package/dist/marketing/index.js +3 -0
- package/dist/marketing/social.d.ts +1 -1
- package/dist/marketing/social.js +1 -1
- package/package.json +1 -1
|
@@ -1,43 +1,22 @@
|
|
|
1
|
+
<!-- @migration-task Error while migrating Svelte code: This migration would change the name of a slot making the component unusable -->
|
|
1
2
|
<script lang="ts">
|
|
2
|
-
import { tick, onMount } from 'svelte';
|
|
3
|
+
import { tick, onMount, onDestroy } from 'svelte';
|
|
3
4
|
import { fade } from 'svelte/transition';
|
|
4
|
-
import type { Snippet } from 'svelte';
|
|
5
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
text?: string;
|
|
9
|
-
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
10
|
-
color?: 'black' | 'accent' | 'soft' | 'danger';
|
|
11
|
-
show?: boolean;
|
|
12
|
-
maxWidth?: number;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
delay?: number;
|
|
15
|
-
children?: Snippet;
|
|
16
|
-
tooltip?: Snippet;
|
|
17
|
-
wrapperProps?: HTMLAttributes<HTMLDivElement>;
|
|
18
|
-
}
|
|
19
5
|
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
tooltip,
|
|
30
|
-
wrapperProps = {}
|
|
31
|
-
}: Props = $props();
|
|
32
|
-
|
|
33
|
-
let wrap: HTMLDivElement | undefined = $state();
|
|
34
|
-
let tooltipEl: HTMLDivElement | undefined = $state();
|
|
35
|
-
let showTimeout: ReturnType<typeof setTimeout>;
|
|
6
|
+
export let text: string = '';
|
|
7
|
+
export let position: 'top' | 'bottom' | 'left' | 'right' = 'top';
|
|
8
|
+
export let color: 'black' | 'accent' | 'soft' | 'danger' = 'black';
|
|
9
|
+
export let show = false;
|
|
10
|
+
export let maxWidth: number = 300;
|
|
11
|
+
export let disabled = false;
|
|
12
|
+
|
|
13
|
+
let wrap: HTMLDivElement;
|
|
14
|
+
let tooltip: HTMLDivElement;
|
|
36
15
|
|
|
37
16
|
function positionTooltip() {
|
|
38
|
-
if (wrap &&
|
|
17
|
+
if (wrap && tooltip && show) {
|
|
39
18
|
const wrapRect = wrap.getBoundingClientRect();
|
|
40
|
-
const tooltipRect =
|
|
19
|
+
const tooltipRect = tooltip.getBoundingClientRect();
|
|
41
20
|
|
|
42
21
|
let top, left;
|
|
43
22
|
|
|
@@ -57,41 +36,36 @@
|
|
|
57
36
|
left = position === 'left' ? leftVal : wrapRect.right + 10;
|
|
58
37
|
}
|
|
59
38
|
|
|
60
|
-
|
|
61
|
-
|
|
39
|
+
tooltip.style.top = top + 'px';
|
|
40
|
+
tooltip.style.left = left + 'px';
|
|
62
41
|
}
|
|
63
42
|
}
|
|
64
43
|
|
|
65
|
-
function handleMouseEnter() {
|
|
44
|
+
async function handleMouseEnter() {
|
|
66
45
|
if (!disabled) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
await tick();
|
|
71
|
-
positionTooltip();
|
|
72
|
-
}, delay);
|
|
46
|
+
show = true;
|
|
47
|
+
await tick();
|
|
48
|
+
positionTooltip();
|
|
73
49
|
}
|
|
74
50
|
}
|
|
75
51
|
|
|
76
52
|
function handleMouseLeave() {
|
|
77
|
-
clearTimeout(showTimeout);
|
|
78
53
|
show = false;
|
|
79
54
|
}
|
|
80
55
|
|
|
81
|
-
|
|
56
|
+
$: {
|
|
82
57
|
if (text) {
|
|
83
58
|
tick().then(() => {
|
|
84
59
|
positionTooltip();
|
|
85
60
|
});
|
|
86
61
|
}
|
|
87
|
-
}
|
|
62
|
+
}
|
|
88
63
|
|
|
89
64
|
onMount(() => {
|
|
90
65
|
positionTooltip();
|
|
91
66
|
document.addEventListener('scroll', positionTooltip);
|
|
92
67
|
|
|
93
68
|
return () => {
|
|
94
|
-
clearTimeout(showTimeout);
|
|
95
69
|
document.removeEventListener('scroll', positionTooltip);
|
|
96
70
|
};
|
|
97
71
|
});
|
|
@@ -99,23 +73,23 @@
|
|
|
99
73
|
|
|
100
74
|
<div
|
|
101
75
|
class="tooltip-wrap {color}"
|
|
102
|
-
|
|
103
|
-
|
|
76
|
+
on:mouseenter={handleMouseEnter}
|
|
77
|
+
on:mouseleave={handleMouseLeave}
|
|
104
78
|
role="tooltip"
|
|
105
79
|
bind:this={wrap}
|
|
106
|
-
{
|
|
80
|
+
{...$$restProps}
|
|
107
81
|
>
|
|
108
|
-
|
|
82
|
+
<slot />
|
|
109
83
|
|
|
110
84
|
{#if !disabled && show}
|
|
111
85
|
<div
|
|
112
86
|
class="tooltip {position}"
|
|
113
87
|
style:max-width={maxWidth + 'px'}
|
|
114
|
-
bind:this={
|
|
88
|
+
bind:this={tooltip}
|
|
115
89
|
transition:fade={{ duration: 100 }}
|
|
116
90
|
>
|
|
117
|
-
{#if tooltip}
|
|
118
|
-
|
|
91
|
+
{#if $$slots.tooltip}
|
|
92
|
+
<slot name="tooltip" />
|
|
119
93
|
{:else}
|
|
120
94
|
{text}
|
|
121
95
|
{/if}
|
|
@@ -1,17 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
wrapperProps?: HTMLAttributes<HTMLDivElement>;
|
|
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;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
+
default: any;
|
|
16
|
+
} ? Props extends Record<string, never> ? any : {
|
|
17
|
+
children?: any;
|
|
18
|
+
} : {});
|
|
19
|
+
declare const Tooltip: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
[x: string]: any;
|
|
21
|
+
text?: string | undefined;
|
|
22
|
+
position?: "top" | "bottom" | "left" | "right" | undefined;
|
|
23
|
+
color?: "black" | "accent" | "soft" | "danger" | undefined;
|
|
24
|
+
show?: boolean | undefined;
|
|
25
|
+
maxWidth?: number | undefined;
|
|
26
|
+
disabled?: boolean | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
default: {};
|
|
29
|
+
tooltip: {};
|
|
30
|
+
}>, {
|
|
31
|
+
[evt: string]: CustomEvent<any>;
|
|
32
|
+
}, {
|
|
33
|
+
default: {};
|
|
34
|
+
tooltip: {};
|
|
35
|
+
}, {}, string>;
|
|
36
|
+
type Tooltip = InstanceType<typeof Tooltip>;
|
|
17
37
|
export default Tooltip;
|