@hyvor/design 2.1.8-beta.5 → 2.1.9
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/BarNotice/BarNotice.svelte +1 -1
- package/dist/cloud/HyvorBar/BarSupport.svelte +1 -1
- package/dist/cloud/HyvorBar/Organization/BarOrganization.svelte +1 -1
- package/dist/components/Avatar/Avatar.svelte +50 -4
- package/dist/components/Avatar/Avatar.svelte.d.ts +4 -1
- package/dist/components/Avatar/AvatarStack.svelte +6 -3
- package/dist/components/ButtonGroup/ButtonGroup.svelte +82 -0
- package/dist/components/{Button → ButtonGroup}/ButtonGroup.svelte.d.ts +1 -0
- package/dist/components/Modal/ConfirmModalProvider.svelte +6 -9
- package/dist/components/Modal/ModalFooter.svelte +24 -27
- package/dist/components/Toast/ToastMessage.svelte +3 -6
- package/dist/components/Toast/ToastProvider.svelte +8 -4
- package/dist/components/Tooltip/Tooltip.svelte +54 -28
- package/dist/components/Tooltip/Tooltip.svelte.d.ts +15 -35
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.css +4 -1
- package/dist/marketing/Docs/Docs.svelte +2 -2
- package/dist/marketing/Footer/Footer.svelte +98 -402
- package/dist/marketing/Footer/Footer.svelte.d.ts +2 -18
- package/dist/marketing/Footer/FooterLinkList.svelte +3 -10
- package/dist/marketing/Header/Header.svelte +28 -72
- package/dist/marketing/Header/Header.svelte.d.ts +2 -5
- package/dist/marketing/index.d.ts +0 -18
- package/dist/marketing/index.js +0 -17
- package/dist/marketing/social.d.ts +1 -1
- package/dist/marketing/social.js +1 -1
- package/package.json +1 -1
- package/dist/components/Button/ButtonGroup.svelte +0 -18
- package/dist/marketing/AllFeaturesAccordion/AllFeaturesAccordion.svelte +0 -251
- package/dist/marketing/AllFeaturesAccordion/AllFeaturesAccordion.svelte.d.ts +0 -23
- package/dist/marketing/AllFeaturesAccordion/AllFeaturesAccordionFeature.svelte +0 -75
- package/dist/marketing/AllFeaturesAccordion/AllFeaturesAccordionFeature.svelte.d.ts +0 -10
- package/dist/marketing/FAQ/FAQ.svelte +0 -233
- package/dist/marketing/FAQ/FAQ.svelte.d.ts +0 -13
- package/dist/marketing/FeatureSplit/FeatureSplit.svelte +0 -325
- package/dist/marketing/FeatureSplit/FeatureSplit.svelte.d.ts +0 -24
- package/dist/marketing/FullTrialSignup/FullTrialSignup.svelte +0 -164
- package/dist/marketing/FullTrialSignup/FullTrialSignup.svelte.d.ts +0 -18
- package/dist/marketing/Header/HeaderLanguageToggle.svelte +0 -121
- package/dist/marketing/Header/HeaderLanguageToggle.svelte.d.ts +0 -14
- package/dist/marketing/Header/HeaderNavLink.svelte +0 -148
- package/dist/marketing/Header/HeaderNavLink.svelte.d.ts +0 -17
- package/dist/marketing/Header/language.d.ts +0 -18
- package/dist/marketing/Header/language.js +0 -35
- package/dist/marketing/Hero/Hero.svelte +0 -353
- package/dist/marketing/Hero/Hero.svelte.d.ts +0 -16
- package/dist/marketing/LogoStrip/LogoStrip.svelte +0 -204
- package/dist/marketing/LogoStrip/LogoStrip.svelte.d.ts +0 -19
- package/dist/marketing/Seal/CcpaSeal.svelte +0 -29
- package/dist/marketing/Seal/CcpaSeal.svelte.d.ts +0 -6
- package/dist/marketing/Seal/GdprSeal.svelte +0 -60
- package/dist/marketing/Seal/GdprSeal.svelte.d.ts +0 -6
- package/dist/marketing/Seal/IsoSeal.svelte +0 -44
- package/dist/marketing/Seal/IsoSeal.svelte.d.ts +0 -6
- package/dist/marketing/Seal/Seal.svelte +0 -62
- package/dist/marketing/Seal/Seal.svelte.d.ts +0 -8
- package/dist/marketing/Seal/SsoSeal.svelte +0 -31
- package/dist/marketing/Seal/SsoSeal.svelte.d.ts +0 -6
- package/dist/marketing/Seal/ccpa.svg +0 -131
- package/dist/marketing/SpotlightSplit/SpotlightSplit.svelte +0 -256
- package/dist/marketing/SpotlightSplit/SpotlightSplit.svelte.d.ts +0 -19
- package/dist/marketing/Testimonials/Testimonials.svelte +0 -382
- package/dist/marketing/Testimonials/Testimonials.svelte.d.ts +0 -23
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
text="You have an unpaid invoice. Please settle to avoid service interruption."
|
|
13
13
|
position="bottom"
|
|
14
14
|
>
|
|
15
|
-
<a href={instance + '/account/billing?pay-failed'}>
|
|
15
|
+
<a href={instance + '/account/org/billing?pay-failed'}>
|
|
16
16
|
<Tag color="orange">
|
|
17
17
|
{#snippet start()}
|
|
18
18
|
<IconExclamationCircle size={14} />
|
|
@@ -2,10 +2,20 @@
|
|
|
2
2
|
interface Props {
|
|
3
3
|
size?: number | 'small' | 'medium' | 'large';
|
|
4
4
|
alt?: string;
|
|
5
|
-
|
|
5
|
+
src?: string | null;
|
|
6
|
+
username?: string;
|
|
7
|
+
bg?: string;
|
|
8
|
+
fg?: string;
|
|
6
9
|
}
|
|
7
10
|
|
|
8
|
-
let {
|
|
11
|
+
let {
|
|
12
|
+
size = $bindable('medium'),
|
|
13
|
+
alt = '',
|
|
14
|
+
src = null,
|
|
15
|
+
username = '',
|
|
16
|
+
bg = 'var(--accent)',
|
|
17
|
+
fg = 'var(--accent-text)'
|
|
18
|
+
}: Props = $props();
|
|
9
19
|
|
|
10
20
|
const sizes = {
|
|
11
21
|
small: 24,
|
|
@@ -13,14 +23,50 @@
|
|
|
13
23
|
large: 48
|
|
14
24
|
};
|
|
15
25
|
size = typeof size === 'number' ? size : sizes[size];
|
|
26
|
+
|
|
27
|
+
function getInitials(name: string) {
|
|
28
|
+
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
29
|
+
if (parts.length === 0) {
|
|
30
|
+
return '';
|
|
31
|
+
}
|
|
32
|
+
if (parts.length === 1) {
|
|
33
|
+
return parts[0].slice(0, 2).toUpperCase();
|
|
34
|
+
}
|
|
35
|
+
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const initials = $derived(getInitials(username));
|
|
16
39
|
</script>
|
|
17
40
|
|
|
18
|
-
|
|
41
|
+
{#if src}
|
|
42
|
+
<img {src} {alt} style={`width: ${size}px; height: ${size}px;`} />
|
|
43
|
+
{:else}
|
|
44
|
+
<svg
|
|
45
|
+
width={size}
|
|
46
|
+
height={size}
|
|
47
|
+
viewBox="0 0 {size} {size}"
|
|
48
|
+
role="img"
|
|
49
|
+
aria-label={alt || username}
|
|
50
|
+
>
|
|
51
|
+
<circle cx={size / 2} cy={size / 2} r={size / 2} fill={bg} />
|
|
52
|
+
<text
|
|
53
|
+
x="50%"
|
|
54
|
+
y="50%"
|
|
55
|
+
dy=".35em"
|
|
56
|
+
text-anchor="middle"
|
|
57
|
+
fill={fg}
|
|
58
|
+
font-family="var(--font-sans-serif)"
|
|
59
|
+
font-size={size * 0.4}>{initials}</text
|
|
60
|
+
>
|
|
61
|
+
</svg>
|
|
62
|
+
{/if}
|
|
19
63
|
|
|
20
64
|
<style>
|
|
21
|
-
img
|
|
65
|
+
img,
|
|
66
|
+
svg {
|
|
22
67
|
border-radius: 50%;
|
|
23
68
|
display: inline-block;
|
|
24
69
|
overflow: hidden;
|
|
70
|
+
vertical-align: middle;
|
|
25
71
|
}
|
|
26
72
|
</style>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
size?: number | 'small' | 'medium' | 'large';
|
|
3
3
|
alt?: string;
|
|
4
|
-
|
|
4
|
+
src?: string | null;
|
|
5
|
+
username?: string;
|
|
6
|
+
bg?: string;
|
|
7
|
+
fg?: string;
|
|
5
8
|
}
|
|
6
9
|
declare const Avatar: import("svelte").Component<Props, {}, "size">;
|
|
7
10
|
type Avatar = ReturnType<typeof Avatar>;
|
|
@@ -22,13 +22,16 @@
|
|
|
22
22
|
display: inline-flex;
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
}
|
|
25
|
-
.stack :global(img)
|
|
25
|
+
.stack :global(img),
|
|
26
|
+
.stack :global(svg) {
|
|
26
27
|
transition: 0.2s;
|
|
27
28
|
}
|
|
28
|
-
.stack :global(img:not(:first-child))
|
|
29
|
+
.stack :global(img:not(:first-child)),
|
|
30
|
+
.stack :global(svg:not(:first-child)) {
|
|
29
31
|
margin-left: calc(var(--local-size) * -0.5);
|
|
30
32
|
}
|
|
31
|
-
.stack:hover :global(img:not(:first-child))
|
|
33
|
+
.stack:hover :global(img:not(:first-child)),
|
|
34
|
+
.stack:hover :global(svg:not(:first-child)) {
|
|
32
35
|
margin-left: 3px;
|
|
33
36
|
}
|
|
34
37
|
</style>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
column?: boolean;
|
|
4
|
+
children?: import('svelte').Snippet;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
let { column = false, children }: Props = $props();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div class="button-group" class:column>
|
|
11
|
+
{@render children?.()}
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<style>.button-group {
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.button-group.column {
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: stretch;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.button-group :global(> .button) {
|
|
24
|
+
position: relative;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.button-group :global(> .button:hover),
|
|
28
|
+
.button-group :global(> .button:focus-visible) {
|
|
29
|
+
z-index: 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.button-group:not(.column) :global(> .button:not(:first-child)) {
|
|
33
|
+
border-top-left-radius: 0;
|
|
34
|
+
border-bottom-left-radius: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.button-group:not(.column) :global(> .button:not(:last-child)) {
|
|
38
|
+
border-top-right-radius: 0;
|
|
39
|
+
border-bottom-right-radius: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.button-group.column :global(> .button:not(:first-child)) {
|
|
43
|
+
border-top-left-radius: 0;
|
|
44
|
+
border-top-right-radius: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.button-group.column :global(> .button:not(:last-child)) {
|
|
48
|
+
border-bottom-left-radius: 0;
|
|
49
|
+
border-bottom-right-radius: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.button-group:not(.column) :global(> .button:not(:first-child)) {
|
|
53
|
+
margin-left: -1px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.button-group.column :global(> .button:not(:first-child)) {
|
|
57
|
+
margin-top: -1px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.button-group:not(.column) :global(> .button:not(.outline):not(.outline-fill):not(:first-child))::before {
|
|
61
|
+
content: "";
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: 22%;
|
|
64
|
+
bottom: 22%;
|
|
65
|
+
left: 0;
|
|
66
|
+
width: 1px;
|
|
67
|
+
background-color: currentColor;
|
|
68
|
+
opacity: 0.25;
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.button-group.column :global(> .button:not(.outline):not(.outline-fill):not(:first-child))::before {
|
|
73
|
+
content: "";
|
|
74
|
+
position: absolute;
|
|
75
|
+
left: 22%;
|
|
76
|
+
right: 22%;
|
|
77
|
+
top: 0;
|
|
78
|
+
height: 1px;
|
|
79
|
+
background-color: currentColor;
|
|
80
|
+
opacity: 0.25;
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
}</style>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import Modal from './Modal.svelte';
|
|
3
3
|
import { confirmStore } from './confirm.js';
|
|
4
4
|
import Button from './../Button/Button.svelte';
|
|
5
|
-
import ButtonGroup from './../Button/ButtonGroup.svelte';
|
|
6
5
|
|
|
7
6
|
let show = $state(true);
|
|
8
7
|
|
|
@@ -32,14 +31,12 @@
|
|
|
32
31
|
{/if}
|
|
33
32
|
|
|
34
33
|
{#snippet footer()}
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
</Button>
|
|
42
|
-
</ButtonGroup>
|
|
34
|
+
<Button variant="invisible" on:click={handleCancel}>
|
|
35
|
+
{$confirmStore.cancelText || 'Cancel'}
|
|
36
|
+
</Button>
|
|
37
|
+
<Button color={$confirmStore.danger ? 'red' : 'accent'} on:click={handleConfirm}>
|
|
38
|
+
{$confirmStore.confirmText || 'Confirm'}
|
|
39
|
+
</Button>
|
|
43
40
|
{/snippet}
|
|
44
41
|
</Modal>
|
|
45
42
|
{/if}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { createEventDispatcher } from 'svelte';
|
|
3
3
|
import Button from '../Button/Button.svelte';
|
|
4
|
-
import ButtonGroup from '../Button/ButtonGroup.svelte';
|
|
5
4
|
import type { Footer } from './modal-types.ts';
|
|
6
5
|
|
|
7
6
|
interface Props {
|
|
@@ -14,30 +13,28 @@
|
|
|
14
13
|
const dispatch = createEventDispatcher();
|
|
15
14
|
</script>
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
{/if}
|
|
16
|
+
{#if footer.cancel !== false}
|
|
17
|
+
<Button
|
|
18
|
+
variant="invisible"
|
|
19
|
+
on:click={() => {
|
|
20
|
+
show = false;
|
|
21
|
+
dispatch('cancel');
|
|
22
|
+
}}
|
|
23
|
+
{...footer.cancel?.props}
|
|
24
|
+
disabled={footer.cancel?.disabled}
|
|
25
|
+
>
|
|
26
|
+
{footer.cancel?.text || 'Cancel'}
|
|
27
|
+
</Button>
|
|
28
|
+
{/if}
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</ButtonGroup>
|
|
30
|
+
{#if footer.confirm !== false}
|
|
31
|
+
<Button
|
|
32
|
+
variant="fill"
|
|
33
|
+
color={footer.confirm?.danger ? 'red' : 'accent'}
|
|
34
|
+
on:click={() => dispatch('confirm')}
|
|
35
|
+
{...footer.confirm?.props}
|
|
36
|
+
disabled={footer.confirm?.disabled}
|
|
37
|
+
>
|
|
38
|
+
{footer.confirm?.text || 'Confirm'}
|
|
39
|
+
</Button>
|
|
40
|
+
{/if}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import ToastIcon from './ToastIcon.svelte';
|
|
3
3
|
import type { Toast } from './toast.ts';
|
|
4
|
-
import { fade } from 'svelte/transition';
|
|
4
|
+
import { fade, fly } from 'svelte/transition';
|
|
5
|
+
import { cubicOut } from 'svelte/easing';
|
|
5
6
|
|
|
6
7
|
interface Props {
|
|
7
8
|
toast: Toast;
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
let { toast }: Props = $props();
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<div class="toast"
|
|
14
|
+
<div class="toast" in:fly={{ y: 20, duration: 250, easing: cubicOut }} out:fade={{ duration: 150 }}>
|
|
14
15
|
{#if toast.type !== 'blank'}
|
|
15
16
|
<div class="icon-wrap">
|
|
16
17
|
<ToastIcon {toast} />
|
|
@@ -28,7 +29,6 @@
|
|
|
28
29
|
|
|
29
30
|
<style>
|
|
30
31
|
.toast {
|
|
31
|
-
margin-bottom: 10px;
|
|
32
32
|
box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1);
|
|
33
33
|
border-radius: var(--box-radius);
|
|
34
34
|
background-color: var(--box-background);
|
|
@@ -38,9 +38,6 @@
|
|
|
38
38
|
max-width: 350px;
|
|
39
39
|
pointer-events: initial;
|
|
40
40
|
}
|
|
41
|
-
.toast:first-child {
|
|
42
|
-
margin-top: 10px;
|
|
43
|
-
}
|
|
44
41
|
.icon-wrap {
|
|
45
42
|
margin-right: 8px;
|
|
46
43
|
display: inline-flex;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { flip } from 'svelte/animate';
|
|
2
3
|
import ToastMessage from './ToastMessage.svelte';
|
|
3
4
|
import { toastStore } from './toast.js';
|
|
4
5
|
import { useCleaner } from './cleaner.js';
|
|
@@ -8,21 +9,24 @@
|
|
|
8
9
|
|
|
9
10
|
<div id="toasts-wrap">
|
|
10
11
|
{#each $toastStore as toast (toast.id)}
|
|
11
|
-
<
|
|
12
|
+
<div class="toast-item" animate:flip={{ duration: 200 }}>
|
|
13
|
+
<ToastMessage {toast} />
|
|
14
|
+
</div>
|
|
12
15
|
{/each}
|
|
13
16
|
</div>
|
|
14
17
|
|
|
15
18
|
<style>
|
|
16
19
|
#toasts-wrap {
|
|
17
20
|
position: fixed;
|
|
18
|
-
|
|
21
|
+
bottom: 0;
|
|
19
22
|
left: 0;
|
|
20
23
|
width: 100%;
|
|
21
24
|
z-index: 20000000;
|
|
22
25
|
display: flex;
|
|
23
|
-
flex-direction: column;
|
|
26
|
+
flex-direction: column-reverse;
|
|
24
27
|
align-items: center;
|
|
25
|
-
|
|
28
|
+
gap: 10px;
|
|
29
|
+
padding: 10px 0 24px;
|
|
26
30
|
pointer-events: none;
|
|
27
31
|
}
|
|
28
32
|
</style>
|
|
@@ -1,22 +1,43 @@
|
|
|
1
|
-
<!-- @migration-task Error while migrating Svelte code: This migration would change the name of a slot making the component unusable -->
|
|
2
1
|
<script lang="ts">
|
|
3
|
-
import { tick, onMount
|
|
2
|
+
import { tick, onMount } from 'svelte';
|
|
4
3
|
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
|
+
}
|
|
5
19
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
let {
|
|
21
|
+
text = '',
|
|
22
|
+
position = 'top',
|
|
23
|
+
color = 'black',
|
|
24
|
+
show = $bindable(false),
|
|
25
|
+
maxWidth = 300,
|
|
26
|
+
disabled = false,
|
|
27
|
+
delay = 100,
|
|
28
|
+
children,
|
|
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>;
|
|
15
36
|
|
|
16
37
|
function positionTooltip() {
|
|
17
|
-
if (wrap &&
|
|
38
|
+
if (wrap && tooltipEl && show) {
|
|
18
39
|
const wrapRect = wrap.getBoundingClientRect();
|
|
19
|
-
const tooltipRect =
|
|
40
|
+
const tooltipRect = tooltipEl.getBoundingClientRect();
|
|
20
41
|
|
|
21
42
|
let top, left;
|
|
22
43
|
|
|
@@ -36,36 +57,41 @@
|
|
|
36
57
|
left = position === 'left' ? leftVal : wrapRect.right + 10;
|
|
37
58
|
}
|
|
38
59
|
|
|
39
|
-
|
|
40
|
-
|
|
60
|
+
tooltipEl.style.top = top + 'px';
|
|
61
|
+
tooltipEl.style.left = left + 'px';
|
|
41
62
|
}
|
|
42
63
|
}
|
|
43
64
|
|
|
44
|
-
|
|
65
|
+
function handleMouseEnter() {
|
|
45
66
|
if (!disabled) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
67
|
+
clearTimeout(showTimeout);
|
|
68
|
+
showTimeout = setTimeout(async () => {
|
|
69
|
+
show = true;
|
|
70
|
+
await tick();
|
|
71
|
+
positionTooltip();
|
|
72
|
+
}, delay);
|
|
49
73
|
}
|
|
50
74
|
}
|
|
51
75
|
|
|
52
76
|
function handleMouseLeave() {
|
|
77
|
+
clearTimeout(showTimeout);
|
|
53
78
|
show = false;
|
|
54
79
|
}
|
|
55
80
|
|
|
56
|
-
|
|
81
|
+
$effect(() => {
|
|
57
82
|
if (text) {
|
|
58
83
|
tick().then(() => {
|
|
59
84
|
positionTooltip();
|
|
60
85
|
});
|
|
61
86
|
}
|
|
62
|
-
}
|
|
87
|
+
});
|
|
63
88
|
|
|
64
89
|
onMount(() => {
|
|
65
90
|
positionTooltip();
|
|
66
91
|
document.addEventListener('scroll', positionTooltip);
|
|
67
92
|
|
|
68
93
|
return () => {
|
|
94
|
+
clearTimeout(showTimeout);
|
|
69
95
|
document.removeEventListener('scroll', positionTooltip);
|
|
70
96
|
};
|
|
71
97
|
});
|
|
@@ -73,23 +99,23 @@
|
|
|
73
99
|
|
|
74
100
|
<div
|
|
75
101
|
class="tooltip-wrap {color}"
|
|
76
|
-
|
|
77
|
-
|
|
102
|
+
onmouseenter={handleMouseEnter}
|
|
103
|
+
onmouseleave={handleMouseLeave}
|
|
78
104
|
role="tooltip"
|
|
79
105
|
bind:this={wrap}
|
|
80
|
-
{
|
|
106
|
+
{...wrapperProps}
|
|
81
107
|
>
|
|
82
|
-
|
|
108
|
+
{@render children?.()}
|
|
83
109
|
|
|
84
110
|
{#if !disabled && show}
|
|
85
111
|
<div
|
|
86
112
|
class="tooltip {position}"
|
|
87
113
|
style:max-width={maxWidth + 'px'}
|
|
88
|
-
bind:this={
|
|
114
|
+
bind:this={tooltipEl}
|
|
89
115
|
transition:fade={{ duration: 100 }}
|
|
90
116
|
>
|
|
91
|
-
{#if
|
|
92
|
-
|
|
117
|
+
{#if tooltip}
|
|
118
|
+
{@render tooltip()}
|
|
93
119
|
{:else}
|
|
94
120
|
{text}
|
|
95
121
|
{/if}
|
|
@@ -1,37 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
interface Props {
|
|
4
|
+
text?: string;
|
|
5
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
6
|
+
color?: 'black' | 'accent' | 'soft' | 'danger';
|
|
7
|
+
show?: boolean;
|
|
8
|
+
maxWidth?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
delay?: number;
|
|
11
|
+
children?: Snippet;
|
|
12
|
+
tooltip?: Snippet;
|
|
13
|
+
wrapperProps?: HTMLAttributes<HTMLDivElement>;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
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>;
|
|
15
|
+
declare const Tooltip: import("svelte").Component<Props, {}, "show">;
|
|
16
|
+
type Tooltip = ReturnType<typeof Tooltip>;
|
|
37
17
|
export default Tooltip;
|
|
@@ -7,7 +7,7 @@ export { default as AvatarStack } from './Avatar/AvatarStack.svelte';
|
|
|
7
7
|
export { default as Base } from './Base/Base.svelte';
|
|
8
8
|
export { default as Box } from './Box/Box.svelte';
|
|
9
9
|
export { default as Button } from './Button/Button.svelte';
|
|
10
|
-
export { default as ButtonGroup } from './
|
|
10
|
+
export { default as ButtonGroup } from './ButtonGroup/ButtonGroup.svelte';
|
|
11
11
|
export { default as BoxShadowPicker } from './BoxShadowPicker/BoxShadowPicker.svelte';
|
|
12
12
|
export { default as Callout } from './Callout/Callout.svelte';
|
|
13
13
|
export { default as Checkbox } from './Checkbox/Checkbox.svelte';
|
package/dist/components/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export { default as AvatarStack } from './Avatar/AvatarStack.svelte';
|
|
|
7
7
|
export { default as Base } from './Base/Base.svelte';
|
|
8
8
|
export { default as Box } from './Box/Box.svelte';
|
|
9
9
|
export { default as Button } from './Button/Button.svelte';
|
|
10
|
-
export { default as ButtonGroup } from './
|
|
10
|
+
export { default as ButtonGroup } from './ButtonGroup/ButtonGroup.svelte';
|
|
11
11
|
export { default as BoxShadowPicker } from './BoxShadowPicker/BoxShadowPicker.svelte';
|
|
12
12
|
export { default as Callout } from './Callout/Callout.svelte';
|
|
13
13
|
export { default as Checkbox } from './Checkbox/Checkbox.svelte';
|
package/dist/index.css
CHANGED
|
@@ -84,10 +84,13 @@ a {
|
|
|
84
84
|
hyphens: none;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
:root.dark .shiki {
|
|
88
|
+
background-color: var(--shiki-dark-bg) !important;
|
|
89
|
+
}
|
|
90
|
+
|
|
87
91
|
:root.dark .shiki,
|
|
88
92
|
:root.dark .shiki span {
|
|
89
93
|
color: var(--shiki-dark) !important;
|
|
90
|
-
background-color: var(--shiki-dark-bg) !important;
|
|
91
94
|
font-style: var(--shiki-dark-font-style) !important;
|
|
92
95
|
font-weight: var(--shiki-dark-font-weight) !important;
|
|
93
96
|
text-decoration: var(--shiki-dark-text-decoration) !important;
|
|
@@ -368,7 +368,7 @@
|
|
|
368
368
|
margin: 20px 0;
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
content :global(code) {
|
|
371
|
+
content :global(code:not(pre code)) {
|
|
372
372
|
font-size: 14px;
|
|
373
373
|
padding: 0.2em 0.4em;
|
|
374
374
|
display: inline-block;
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
line-height: normal;
|
|
380
380
|
font-weight: 400;
|
|
381
381
|
}
|
|
382
|
-
:global(:root.dark) content :global(code) {
|
|
382
|
+
:global(:root.dark) content :global(code:not(pre code)) {
|
|
383
383
|
background-color: #282c34;
|
|
384
384
|
color: #e06c75;
|
|
385
385
|
}
|