@hyvor/design 2.1.20-beta.2 → 2.1.20
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/Dropdown/Dropdown.svelte +4 -5
- package/dist/components/Dropdown/Dropdown.svelte.d.ts +0 -1
- package/dist/components/Dropdown/DropdownContent.svelte +1 -7
- package/dist/components/Tooltip/Tooltip.svelte +1 -4
- package/dist/components/directives/clickOutside.d.ts +1 -2
- package/dist/components/directives/clickOutside.js +7 -25
- package/dist/index.css +1 -86
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/marketing/Testimonials/Testimonials.svelte +27 -3
- package/dist/marketing/Testimonials/Testimonials.svelte.d.ts +1 -0
- package/dist/variables.css +80 -0
- package/package.json +1 -6
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
trigger?: Snippet;
|
|
14
14
|
content?: Snippet;
|
|
15
15
|
contentPadding?: number;
|
|
16
|
-
keepInDom?: boolean;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
let {
|
|
@@ -25,18 +24,18 @@
|
|
|
25
24
|
position = 'bottom',
|
|
26
25
|
trigger,
|
|
27
26
|
content,
|
|
28
|
-
contentPadding
|
|
29
|
-
keepInDom = false
|
|
27
|
+
contentPadding
|
|
30
28
|
}: Props = $props();
|
|
31
29
|
|
|
32
30
|
let triggerEl: HTMLElement | undefined = $state();
|
|
33
31
|
</script>
|
|
34
32
|
|
|
35
33
|
<span class="dropdown" class:relative>
|
|
36
|
-
<!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_static_element_interactions -->
|
|
37
34
|
<span
|
|
38
35
|
class="trigger"
|
|
39
36
|
onclick={() => (show = !show)}
|
|
37
|
+
role="listbox"
|
|
38
|
+
tabindex="0"
|
|
40
39
|
onkeyup={(e) => {
|
|
41
40
|
if (e.key === 'Escape') {
|
|
42
41
|
show = false;
|
|
@@ -47,7 +46,7 @@
|
|
|
47
46
|
{@render trigger?.()}
|
|
48
47
|
</span>
|
|
49
48
|
|
|
50
|
-
{#if show
|
|
49
|
+
{#if show}
|
|
51
50
|
<DropdownContent
|
|
52
51
|
bind:show
|
|
53
52
|
{width}
|
|
@@ -101,7 +101,6 @@
|
|
|
101
101
|
$effect(() => {
|
|
102
102
|
position;
|
|
103
103
|
align;
|
|
104
|
-
show;
|
|
105
104
|
positionWrap();
|
|
106
105
|
});
|
|
107
106
|
|
|
@@ -130,9 +129,8 @@
|
|
|
130
129
|
|
|
131
130
|
<div
|
|
132
131
|
class="content-wrap {align} {position}"
|
|
133
|
-
class:visually-hidden={!show}
|
|
134
132
|
use:clickOutside={{
|
|
135
|
-
enabled: closeOnOutsideClick
|
|
133
|
+
enabled: closeOnOutsideClick,
|
|
136
134
|
callback: () => (show = false)
|
|
137
135
|
}}
|
|
138
136
|
bind:this={contentWrap}
|
|
@@ -152,10 +150,6 @@
|
|
|
152
150
|
flex-direction: column;
|
|
153
151
|
}
|
|
154
152
|
|
|
155
|
-
.content-wrap.visually-hidden {
|
|
156
|
-
display: none;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
153
|
.content {
|
|
160
154
|
overflow-y: auto;
|
|
161
155
|
min-height: 0;
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
let wrap: HTMLDivElement | undefined = $state();
|
|
34
34
|
let tooltipEl: HTMLDivElement | undefined = $state();
|
|
35
35
|
let showTimeout: ReturnType<typeof setTimeout>;
|
|
36
|
-
const tooltipId = $props.id();
|
|
37
36
|
|
|
38
37
|
function positionTooltip() {
|
|
39
38
|
if (wrap && tooltipEl && show) {
|
|
@@ -102,7 +101,7 @@
|
|
|
102
101
|
class="tooltip-wrap {color}"
|
|
103
102
|
onmouseenter={handleMouseEnter}
|
|
104
103
|
onmouseleave={handleMouseLeave}
|
|
105
|
-
|
|
104
|
+
role="tooltip"
|
|
106
105
|
bind:this={wrap}
|
|
107
106
|
{...wrapperProps}
|
|
108
107
|
>
|
|
@@ -110,11 +109,9 @@
|
|
|
110
109
|
|
|
111
110
|
{#if !disabled && show}
|
|
112
111
|
<div
|
|
113
|
-
id={tooltipId}
|
|
114
112
|
class="tooltip {position}"
|
|
115
113
|
style:max-width={maxWidth + 'px'}
|
|
116
114
|
bind:this={tooltipEl}
|
|
117
|
-
role="tooltip"
|
|
118
115
|
transition:fade={{ duration: 100 }}
|
|
119
116
|
>
|
|
120
117
|
{#if tooltip}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
function normalize(input) {
|
|
2
|
-
return typeof input === 'function' ? { callback: input } : input;
|
|
3
|
-
}
|
|
4
1
|
export function clickOutside(node, input) {
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
const options = typeof input === 'function' ? { callback: input } : input;
|
|
3
|
+
const enabled = options.enabled === undefined ? true : options.enabled;
|
|
4
|
+
if (!enabled)
|
|
5
|
+
return;
|
|
7
6
|
const handleClick = (event) => {
|
|
8
7
|
if (!node.contains(event.target)) {
|
|
9
8
|
if (options.stopPropagation)
|
|
@@ -11,28 +10,11 @@ export function clickOutside(node, input) {
|
|
|
11
10
|
options.callback();
|
|
12
11
|
}
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
listening = true;
|
|
18
|
-
setTimeout(() => {
|
|
19
|
-
if (listening)
|
|
20
|
-
document.addEventListener('click', handleClick);
|
|
21
|
-
}, 0);
|
|
22
|
-
}
|
|
23
|
-
else if (!enabled && listening) {
|
|
24
|
-
listening = false;
|
|
25
|
-
document.removeEventListener('click', handleClick);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
sync();
|
|
13
|
+
setTimeout(() => {
|
|
14
|
+
document.addEventListener('click', handleClick);
|
|
15
|
+
}, 0);
|
|
29
16
|
return {
|
|
30
|
-
update(newInput) {
|
|
31
|
-
options = normalize(newInput);
|
|
32
|
-
sync();
|
|
33
|
-
},
|
|
34
17
|
destroy() {
|
|
35
|
-
listening = false;
|
|
36
18
|
document.removeEventListener('click', handleClick);
|
|
37
19
|
}
|
|
38
20
|
};
|
package/dist/index.css
CHANGED
|
@@ -1,89 +1,4 @@
|
|
|
1
|
-
/*
|
|
2
|
-
:root {
|
|
3
|
-
/**
|
|
4
|
-
* Each app should have its own accent colors
|
|
5
|
-
* --accent should be usable with light text
|
|
6
|
-
* --accent-light and --accent-lightest should be usable with dark text
|
|
7
|
-
*/
|
|
8
|
-
--accent: #000;
|
|
9
|
-
--accent-light: #bdbdbd;
|
|
10
|
-
--accent-lightest: #fafafa;
|
|
11
|
-
--accent-light-mid: #818181;
|
|
12
|
-
--accent-text: #fff;
|
|
13
|
-
|
|
14
|
-
--border: #e1e1e1;
|
|
15
|
-
|
|
16
|
-
--text: #000;
|
|
17
|
-
--text-light: #777;
|
|
18
|
-
--text-white: #fff;
|
|
19
|
-
|
|
20
|
-
/*
|
|
21
|
-
* Generally used colors
|
|
22
|
-
* In most cases, no need to extend these colors
|
|
23
|
-
*/
|
|
24
|
-
--green-light: #cadfca;
|
|
25
|
-
--green: #4b874b;
|
|
26
|
-
--green-dark: #335c33;
|
|
27
|
-
|
|
28
|
-
--red-dark: #ab2525;
|
|
29
|
-
--red: #c05959;
|
|
30
|
-
--red-light: #ffdfdf;
|
|
31
|
-
|
|
32
|
-
--blue-dark: #334b81;
|
|
33
|
-
--blue: #5875b9;
|
|
34
|
-
--blue-light: #dae5ff;
|
|
35
|
-
|
|
36
|
-
--orange-dark: #8b5b04;
|
|
37
|
-
--orange: #a98526;
|
|
38
|
-
--orange-light: #efe3b4;
|
|
39
|
-
|
|
40
|
-
--gray-light: #ddd;
|
|
41
|
-
--gray: #999;
|
|
42
|
-
--gray-dark: #555;
|
|
43
|
-
|
|
44
|
-
--hover: #fafafa;
|
|
45
|
-
--hover-dark: #f0f0f0;
|
|
46
|
-
|
|
47
|
-
--link: #1d85d2;
|
|
48
|
-
|
|
49
|
-
--input: #f3f3f3;
|
|
50
|
-
--input-hover: #ccc;
|
|
51
|
-
/* checkbox/radio */
|
|
52
|
-
|
|
53
|
-
--box-shadow: 0 0 30px #0000000d;
|
|
54
|
-
--box-shadow-light: 0 0 10px 6px rgba(0, 0, 0, 0.06);
|
|
55
|
-
--box-radius: 20px;
|
|
56
|
-
--box-background: #fff;
|
|
57
|
-
|
|
58
|
-
--line-height-content: 28px;
|
|
59
|
-
--header-height: 55px;
|
|
60
|
-
|
|
61
|
-
--font-sans-serif: 'Readex Pro', Avenir, Inter, Helvetica, Arial, sans-serif;
|
|
62
|
-
--font-serif: 'Source Serif 4', serif;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
:root.dark {
|
|
66
|
-
--background: #000;
|
|
67
|
-
|
|
68
|
-
--text: #fff;
|
|
69
|
-
--text-light: #999;
|
|
70
|
-
--box-background: #1c1c1c;
|
|
71
|
-
|
|
72
|
-
--accent-light: #555;
|
|
73
|
-
--accent-lightest: #2d2d2d;
|
|
74
|
-
|
|
75
|
-
--border: #4a4a4a;
|
|
76
|
-
--link: #7cb6e1;
|
|
77
|
-
--hover: #232323;
|
|
78
|
-
|
|
79
|
-
--input: #333;
|
|
80
|
-
}
|
|
81
|
-
/* </variables> */
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Global styles
|
|
86
|
-
*/
|
|
1
|
+
/* font */
|
|
87
2
|
:root {
|
|
88
3
|
font-family: var(--font-sans-serif);
|
|
89
4
|
font-size: 16px;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -28,9 +28,15 @@
|
|
|
28
28
|
label?: string;
|
|
29
29
|
title?: string;
|
|
30
30
|
reviews: Review[];
|
|
31
|
+
handwrittenNames?: boolean;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
let {
|
|
34
|
+
let {
|
|
35
|
+
label = 'Testimonials',
|
|
36
|
+
title = 'Loved by our customers.',
|
|
37
|
+
reviews,
|
|
38
|
+
handwrittenNames = true
|
|
39
|
+
}: Props = $props();
|
|
34
40
|
|
|
35
41
|
let started: boolean[] = $state(reviews.map(() => false));
|
|
36
42
|
let playing: boolean[] = $state(reviews.map(() => false));
|
|
@@ -126,6 +132,12 @@
|
|
|
126
132
|
}
|
|
127
133
|
</script>
|
|
128
134
|
|
|
135
|
+
<svelte:head>
|
|
136
|
+
{#if handwrittenNames}
|
|
137
|
+
<link href="https://fonts.bunny.net/css?family=caveat:600,700" rel="stylesheet" />
|
|
138
|
+
{/if}
|
|
139
|
+
</svelte:head>
|
|
140
|
+
|
|
129
141
|
{#snippet meta(review: Review)}
|
|
130
142
|
<div class="role">
|
|
131
143
|
{review.role}, <br />
|
|
@@ -144,7 +156,7 @@
|
|
|
144
156
|
</div>
|
|
145
157
|
{/snippet}
|
|
146
158
|
|
|
147
|
-
<section class="hds-testimonials">
|
|
159
|
+
<section class="hds-testimonials" class:handwritten={handwrittenNames}>
|
|
148
160
|
<div class="hds-container head">
|
|
149
161
|
<p class="label">{label}</p>
|
|
150
162
|
<h2>{@html title}</h2>
|
|
@@ -414,16 +426,24 @@
|
|
|
414
426
|
}
|
|
415
427
|
|
|
416
428
|
.name {
|
|
417
|
-
font-size:
|
|
429
|
+
font-size: 16px;
|
|
418
430
|
font-weight: 600;
|
|
419
431
|
color: var(--text);
|
|
420
432
|
line-height: 1.3;
|
|
421
433
|
}
|
|
422
434
|
|
|
435
|
+
.handwritten .name {
|
|
436
|
+
font-family: 'Caveat', cursive;
|
|
437
|
+
font-size: 28px;
|
|
438
|
+
font-weight: 600;
|
|
439
|
+
line-height: 1.15;
|
|
440
|
+
}
|
|
441
|
+
|
|
423
442
|
.role {
|
|
424
443
|
font-size: 14px;
|
|
425
444
|
line-height: 1.35;
|
|
426
445
|
color: var(--text-light);
|
|
446
|
+
margin-top: 4px;
|
|
427
447
|
font-family: var(--font-serif);
|
|
428
448
|
}
|
|
429
449
|
|
|
@@ -440,6 +460,10 @@
|
|
|
440
460
|
text-decoration: underline;
|
|
441
461
|
}
|
|
442
462
|
|
|
463
|
+
.handwritten .company {
|
|
464
|
+
font-weight: 600;
|
|
465
|
+
}
|
|
466
|
+
|
|
443
467
|
.video-card {
|
|
444
468
|
overflow: hidden;
|
|
445
469
|
padding: 0;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* variables */
|
|
2
|
+
:root {
|
|
3
|
+
/**
|
|
4
|
+
* Each app should have its own accent colors
|
|
5
|
+
* --accent should be usable with light text
|
|
6
|
+
* --accent-light and --accent-lightest should be usable with dark text
|
|
7
|
+
*/
|
|
8
|
+
--accent: #000;
|
|
9
|
+
--accent-light: #bdbdbd;
|
|
10
|
+
--accent-lightest: #fafafa;
|
|
11
|
+
--accent-light-mid: #818181;
|
|
12
|
+
--accent-text: #fff;
|
|
13
|
+
|
|
14
|
+
--border: #e1e1e1;
|
|
15
|
+
|
|
16
|
+
--text: #000;
|
|
17
|
+
--text-light: #777;
|
|
18
|
+
--text-white: #fff;
|
|
19
|
+
|
|
20
|
+
/*
|
|
21
|
+
* Generally used colors
|
|
22
|
+
* In most cases, no need to extend these colors
|
|
23
|
+
*/
|
|
24
|
+
--green-light: #cadfca;
|
|
25
|
+
--green: #4b874b;
|
|
26
|
+
--green-dark: #335c33;
|
|
27
|
+
|
|
28
|
+
--red-dark: #ab2525;
|
|
29
|
+
--red: #c05959;
|
|
30
|
+
--red-light: #ffdfdf;
|
|
31
|
+
|
|
32
|
+
--blue-dark: #334b81;
|
|
33
|
+
--blue: #5875b9;
|
|
34
|
+
--blue-light: #dae5ff;
|
|
35
|
+
|
|
36
|
+
--orange-dark: #8b5b04;
|
|
37
|
+
--orange: #a98526;
|
|
38
|
+
--orange-light: #efe3b4;
|
|
39
|
+
|
|
40
|
+
--gray-light: #ddd;
|
|
41
|
+
--gray: #999;
|
|
42
|
+
--gray-dark: #555;
|
|
43
|
+
|
|
44
|
+
--hover: #fafafa;
|
|
45
|
+
--hover-dark: #f0f0f0;
|
|
46
|
+
|
|
47
|
+
--link: #1d85d2;
|
|
48
|
+
|
|
49
|
+
--input: #f3f3f3;
|
|
50
|
+
--input-hover: #ccc;
|
|
51
|
+
/* checkbox/radio */
|
|
52
|
+
|
|
53
|
+
--box-shadow: 0 0 30px #0000000d;
|
|
54
|
+
--box-shadow-light: 0 0 10px 6px rgba(0, 0, 0, 0.06);
|
|
55
|
+
--box-radius: 20px;
|
|
56
|
+
--box-background: #fff;
|
|
57
|
+
|
|
58
|
+
--line-height-content: 28px;
|
|
59
|
+
--header-height: 55px;
|
|
60
|
+
|
|
61
|
+
--font-sans-serif: 'Readex Pro', Avenir, Inter, Helvetica, Arial, sans-serif;
|
|
62
|
+
--font-serif: 'Source Serif 4', serif;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:root.dark {
|
|
66
|
+
--background: #000;
|
|
67
|
+
|
|
68
|
+
--text: #fff;
|
|
69
|
+
--text-light: #999;
|
|
70
|
+
--box-background: #1c1c1c;
|
|
71
|
+
|
|
72
|
+
--accent-light: #555;
|
|
73
|
+
--accent-lightest: #2d2d2d;
|
|
74
|
+
|
|
75
|
+
--border: #4a4a4a;
|
|
76
|
+
--link: #7cb6e1;
|
|
77
|
+
--hover: #232323;
|
|
78
|
+
|
|
79
|
+
--input: #333;
|
|
80
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyvor/design",
|
|
3
|
-
"version": "2.1.20
|
|
3
|
+
"version": "2.1.20",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
|
-
"sideEffects": [
|
|
7
|
-
"./dist/index.js",
|
|
8
|
-
"./dist/index.css",
|
|
9
|
-
"**/*.css"
|
|
10
|
-
],
|
|
11
6
|
"repository": {
|
|
12
7
|
"url": "https://github.com/hyvor/design"
|
|
13
8
|
},
|