@hyvor/design 2.1.22-beta.4 → 2.1.22

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.
@@ -1,60 +1,21 @@
1
1
  <script lang="ts">
2
- import fontsCss from './fonts.css?inline';
2
+ import ConfirmModalProvider from './../Modal/ConfirmModalProvider.svelte';
3
3
  import DarkProvider from './../Dark/DarkProvider.svelte';
4
- import { toastStore } from '../Toast/toast.js';
5
- import { confirmStore } from '../Modal/confirm.js';
6
- import { fileUploaderConfig } from '../FileUploader/file-uploader.js';
4
+ import ToastProvider from '../Toast/ToastProvider.svelte';
5
+ import FileUploaderProvider from '../FileUploader/FileUploaderProvider.svelte';
6
+ import fontsCss from './fonts.css?inline';
7
7
 
8
8
  interface Props {
9
9
  dark?: boolean;
10
10
  children?: import('svelte').Snippet;
11
- marketing?: boolean;
12
11
  }
13
12
 
14
- let { dark = false, children, marketing = false }: Props = $props();
15
-
16
- let needsToast = $state(false);
17
- let needsConfirm = $state(false);
18
- let needsFileUploader = $state(false);
19
-
20
- $effect(() => {
21
- if ($toastStore.length > 0) needsToast = true;
22
- });
23
- $effect(() => {
24
- if ($confirmStore !== null) needsConfirm = true;
25
- });
26
- $effect(() => {
27
- if ($fileUploaderConfig !== null) needsFileUploader = true;
28
- });
13
+ let { dark = false, children }: Props = $props();
29
14
  </script>
30
15
 
31
16
  <svelte:head>
32
17
  <link rel="preconnect" href="https://media.hyvor.com" />
33
- <link rel="preconnect" href="https://media.hyvor.com" crossorigin="" />
34
-
35
18
  {@html '<style>' + fontsCss + '</style>'}
36
-
37
- {#if marketing}
38
- <link
39
- rel="preload"
40
- href="https://media.hyvor.com/fonts/source-serif-4-latin-600-normal.DouSKlru.woff2"
41
- as="font"
42
- type="font/woff2"
43
- crossorigin=""
44
- />
45
- <link
46
- rel="preload"
47
- href="https://media.hyvor.com/fonts/source-serif-4-latin-400-normal.DJ5YJwmz.woff2"
48
- as="font"
49
- type="font/woff2"
50
- crossorigin=""
51
- />
52
- <style>
53
- :root {
54
- font-family: var(--font-serif) !important;
55
- }
56
- </style>
57
- {/if}
58
19
  </svelte:head>
59
20
 
60
21
  <div id="hds-base">
@@ -65,23 +26,9 @@
65
26
  <DarkProvider />
66
27
  {/if}
67
28
 
68
- {#if needsToast}
69
- {#await import('../Toast/ToastProvider.svelte') then m}
70
- <m.default />
71
- {/await}
72
- {/if}
73
-
74
- {#if needsConfirm}
75
- {#await import('../Modal/ConfirmModalProvider.svelte') then m}
76
- <m.default />
77
- {/await}
78
- {/if}
79
-
80
- {#if needsFileUploader}
81
- {#await import('../FileUploader/FileUploaderProvider.svelte') then m}
82
- <m.default />
83
- {/await}
84
- {/if}
29
+ <ToastProvider />
30
+ <ConfirmModalProvider />
31
+ <FileUploaderProvider />
85
32
 
86
33
  <style>
87
34
  :global(:root) {
@@ -1,7 +1,6 @@
1
1
  interface Props {
2
2
  dark?: boolean;
3
3
  children?: import('svelte').Snippet;
4
- marketing?: boolean;
5
4
  }
6
5
  declare const Base: import("svelte").Component<Props, {}, "">;
7
6
  type Base = ReturnType<typeof Base>;
@@ -1,12 +1,11 @@
1
1
  <script lang="ts">
2
2
  import Link from '../../components/Link/Link.svelte';
3
+ import Modal from '../../components/Modal/Modal.svelte';
3
4
  import { replaceState } from '$app/navigation';
4
5
  import { onMount } from 'svelte';
5
6
 
6
7
  let partner: string | null = $state(null);
7
8
  let showModal = $state(false);
8
- // Modal (and its Loader dependency) is only loaded once we actually need to show it
9
- let modalNeeded = $state(false);
10
9
 
11
10
  onMount(() => {
12
11
  const params = new URLSearchParams(window.location.search);
@@ -14,7 +13,6 @@
14
13
 
15
14
  if (partner) {
16
15
  showModal = true;
17
- modalNeeded = true;
18
16
  }
19
17
  });
20
18
 
@@ -46,35 +44,31 @@
46
44
  }
47
45
  </script>
48
46
 
49
- {#if modalNeeded}
50
- {#await import('../../components/Modal/Modal.svelte') then m}
51
- <m.default
52
- title="Referred by {partner}"
53
- bind:show={showModal}
54
- closeOnOutsideClick={false}
55
- footer={{
56
- cancel: {
57
- text: 'Do not track'
58
- },
59
- confirm: {
60
- text: 'Ok, Visit Site'
61
- }
62
- }}
63
- on:confirm={handleConsent}
64
- >
65
- <div class="notice">
66
- You visited our site through our affiliate partner <strong>{partner}</strong>. To track
67
- this referral, we will place a small cookie in your browser. This cookie helps us identify
68
- which affiliate partner referred you if you sign up. It does not collect any personal data.
69
- </div>
70
- <p>
71
- You can read more in our <Link href="https://hyvor.com/privacy" target="_blank"
72
- >Privacy Policy</Link
73
- >.
74
- </p>
75
- </m.default>
76
- {/await}
77
- {/if}
47
+ <Modal
48
+ title="Referred by {partner}"
49
+ bind:show={showModal}
50
+ closeOnOutsideClick={false}
51
+ footer={{
52
+ cancel: {
53
+ text: 'Do not track'
54
+ },
55
+ confirm: {
56
+ text: 'Ok, Visit Site'
57
+ }
58
+ }}
59
+ on:confirm={handleConsent}
60
+ >
61
+ <div class="notice">
62
+ You visited our site through our affiliate partner <strong>{partner}</strong>. To track this
63
+ referral, we will place a small cookie in your browser. This cookie helps us identify which
64
+ affiliate partner referred you if you sign up. It does not collect any personal data.
65
+ </div>
66
+ <p>
67
+ You can read more in our <Link href="https://hyvor.com/privacy" target="_blank"
68
+ >Privacy Policy</Link
69
+ >.
70
+ </p>
71
+ </Modal>
78
72
 
79
73
  <style>
80
74
  .notice {
@@ -11,11 +11,11 @@
11
11
  import IconBluesky from '@hyvor/icons/IconBluesky';
12
12
  import IconLockFill from '@hyvor/icons/IconLockFill';
13
13
  import IconButton from '../../components/IconButton/IconButton.svelte';
14
+ import Tooltip from '../../components/Tooltip/Tooltip.svelte';
14
15
  import LanguageToggle from '../../components/Internationalization/LanguageToggle.svelte';
15
16
  import { SOCIAL_LINKS, type Socials } from '../social.js';
16
17
  import Affiliate from '../Affiliate/Affiliate.svelte';
17
18
  import RecordVisit from './RecordVisit.svelte';
18
- import { onMount } from 'svelte';
19
19
 
20
20
  const year = new Date().getFullYear();
21
21
 
@@ -66,13 +66,6 @@
66
66
  gdprText = 'GDPR Compliant',
67
67
  fromFranceText = 'From France'
68
68
  }: Props = $props();
69
-
70
- // load Tooltip after mount to avoid including it in builds
71
- let tooltipReady = $state(false);
72
- onMount(() => {
73
- tooltipReady = true;
74
- });
75
-
76
69
  const mascotLogo = $derived(
77
70
  logo || (product ? `${instance}/api/public/logo/${product}.svg` : undefined)
78
71
  );
@@ -166,18 +159,18 @@
166
159
  <IconEnvelope size={14} />
167
160
  {email}
168
161
  </a>
169
- {#if tooltipReady}
170
- {#await import('../../components/Tooltip/Tooltip.svelte') then m}
171
- <m.default
172
- text={emailCopied ? copiedLabel : copyEmailLabel}
173
- position="top"
174
- >
175
- {@render CopyButton()}
176
- </m.default>
177
- {/await}
178
- {:else}
179
- {@render CopyButton()}
180
- {/if}
162
+ <Tooltip text={emailCopied ? copiedLabel : copyEmailLabel} position="top">
163
+ <IconButton
164
+ size="small"
165
+ variant="invisible"
166
+ color="input"
167
+ aria-label={emailCopied ? copiedLabel : copyEmailLabel}
168
+ onclick={handleCopyEmail}
169
+ onmouseleave={() => (emailCopied = false)}
170
+ >
171
+ <IconCopy size={12} />
172
+ </IconButton>
173
+ </Tooltip>
181
174
  </div>
182
175
  {/if}
183
176
 
@@ -185,12 +178,7 @@
185
178
  {#each SOCIAL_PLATFORMS as platform (platform.key)}
186
179
  {@const href = socialLinks[platform.key]}
187
180
  {#if href}
188
- <a
189
- {href}
190
- target="_blank"
191
- rel="nofollow"
192
- aria-label={platform.label}
193
- >
181
+ <a {href} target="_blank" rel="nofollow" aria-label={platform.label}>
194
182
  <platform.icon size={16} />
195
183
  </a>
196
184
  {/if}
@@ -219,11 +207,7 @@
219
207
  <svg class="ring" viewBox="0 0 32 32" aria-hidden="true">
220
208
  <circle cx="16" cy="16" r="16" fill="#173a8a" />
221
209
  {#each gdprStars as s}
222
- <path
223
- d={gdprStarPath}
224
- fill="#ffcd3c"
225
- transform="translate({s.x}, {s.y})"
226
- />
210
+ <path d={gdprStarPath} fill="#ffcd3c" transform="translate({s.x}, {s.y})" />
227
211
  {/each}
228
212
  </svg>
229
213
  <span class="lock"><IconLockFill size={10} /></span>
@@ -249,19 +233,6 @@
249
233
  {/if}
250
234
  </div>
251
235
 
252
- {#snippet CopyButton()}
253
- <IconButton
254
- size="small"
255
- variant="invisible"
256
- color="input"
257
- aria-label={emailCopied ? copiedLabel : copyEmailLabel}
258
- onclick={handleCopyEmail}
259
- onmouseleave={() => (emailCopied = false)}
260
- >
261
- <IconCopy size={12} />
262
- </IconButton>
263
- {/snippet}
264
-
265
236
  <style>
266
237
  .footer-outer {
267
238
  position: relative;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyvor/design",
3
- "version": "2.1.22-beta.4",
3
+ "version": "2.1.22",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "sideEffects": [