@hyvor/design 0.0.67 → 0.0.68

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.
Files changed (123) hide show
  1. package/dist/components/ActionList/ActionList.svelte +2 -7
  2. package/dist/components/ActionList/ActionListGroup.svelte +24 -29
  3. package/dist/components/ActionList/ActionListItem.svelte +86 -88
  4. package/dist/components/ActionList/Selected.svelte +17 -20
  5. package/dist/components/Avatar/Avatar.svelte +7 -11
  6. package/dist/components/Avatar/AvatarStack.svelte +16 -20
  7. package/dist/components/Base/Base.svelte +3 -3
  8. package/dist/components/Box/Box.svelte +8 -8
  9. package/dist/components/Button/Button.svelte +33 -42
  10. package/dist/components/Button/ButtonGroup.svelte +6 -6
  11. package/dist/components/Callout/Callout.svelte +88 -86
  12. package/dist/components/Callout/Callout.svelte.d.ts +1 -0
  13. package/dist/components/Checkbox/Checkbox.svelte +113 -121
  14. package/dist/components/CodeBlock/CodeBlock.svelte +26 -23
  15. package/dist/components/CodeBlock/getCode.js +6 -6
  16. package/dist/components/CodeBlock/hljs.scss +189 -191
  17. package/dist/components/CodeBlock/prism.scss +370 -7
  18. package/dist/components/ColorPicker/ColorPicker.svelte +42 -42
  19. package/dist/components/Dark/DarkProvider.svelte +9 -9
  20. package/dist/components/Dark/DarkToggle.svelte +7 -10
  21. package/dist/components/Divider/Divider.svelte +6 -7
  22. package/dist/components/Dropdown/Dropdown.svelte +33 -108
  23. package/dist/components/Dropdown/DropdownContent.svelte +120 -0
  24. package/dist/components/Dropdown/DropdownContent.svelte.d.ts +24 -0
  25. package/dist/components/FormControl/Caption.svelte +9 -9
  26. package/dist/components/FormControl/FormControl.svelte +18 -18
  27. package/dist/components/FormControl/InputGroup.svelte +7 -8
  28. package/dist/components/FormControl/Label.svelte +5 -5
  29. package/dist/components/FormControl/Validation.svelte +18 -16
  30. package/dist/components/FormControl/Validation.svelte.d.ts +1 -1
  31. package/dist/components/HyvorBar/BarProducts.svelte +52 -0
  32. package/dist/components/HyvorBar/BarProducts.svelte.d.ts +39 -0
  33. package/dist/components/HyvorBar/BarSupport.svelte +119 -0
  34. package/dist/components/HyvorBar/BarSupport.svelte.d.ts +19 -0
  35. package/dist/components/HyvorBar/BarUpdates.svelte +58 -0
  36. package/dist/components/HyvorBar/BarUpdates.svelte.d.ts +18 -0
  37. package/dist/components/HyvorBar/BarUpdatesList.svelte +134 -0
  38. package/dist/components/HyvorBar/BarUpdatesList.svelte.d.ts +18 -0
  39. package/dist/components/HyvorBar/BarUser.svelte +60 -0
  40. package/dist/components/HyvorBar/BarUser.svelte.d.ts +16 -0
  41. package/dist/components/HyvorBar/BarUserPreview.svelte +42 -0
  42. package/dist/components/HyvorBar/BarUserPreview.svelte.d.ts +14 -0
  43. package/dist/components/HyvorBar/HyvorBar.svelte +150 -0
  44. package/dist/components/HyvorBar/HyvorBar.svelte.d.ts +19 -0
  45. package/dist/components/HyvorBar/bar.d.ts +33 -0
  46. package/dist/components/HyvorBar/bar.js +74 -0
  47. package/dist/components/HyvorBar/img/G2.svelte +9 -0
  48. package/dist/components/HyvorBar/img/G2.svelte.d.ts +23 -0
  49. package/dist/components/HyvorBar/img/Trustpilot.svelte +11 -0
  50. package/dist/components/HyvorBar/img/Trustpilot.svelte.d.ts +23 -0
  51. package/dist/components/IconButton/IconButton.svelte +19 -23
  52. package/dist/components/IconMessage/IconMessage.svelte +89 -38
  53. package/dist/components/IconMessage/IconMessage.svelte.d.ts +9 -1
  54. package/dist/components/Internationalization/InternationalizationProvider.svelte +2 -2
  55. package/dist/components/Internationalization/InternationalizationProvider.svelte.d.ts +1 -1
  56. package/dist/components/Internationalization/LanguageToggle.svelte +33 -36
  57. package/dist/components/Internationalization/LanguageToggle.svelte.d.ts +2 -2
  58. package/dist/components/Internationalization/T.svelte.d.ts +3 -3
  59. package/dist/components/Internationalization/i18n.d.ts +4 -4
  60. package/dist/components/Internationalization/i18n.js +13 -11
  61. package/dist/components/Internationalization/t.d.ts +3 -3
  62. package/dist/components/Internationalization/t.js +4 -4
  63. package/dist/components/Internationalization/types.d.ts +1 -1
  64. package/dist/components/Link/Link.svelte +53 -58
  65. package/dist/components/Loader/LoadButton.svelte +15 -29
  66. package/dist/components/Loader/Loader.svelte +56 -69
  67. package/dist/components/Modal/ConfirmModalProvider.svelte +18 -36
  68. package/dist/components/Modal/Modal.svelte +134 -164
  69. package/dist/components/Modal/ModalFooter.svelte +23 -26
  70. package/dist/components/Modal/confirm.d.ts +1 -1
  71. package/dist/components/Modal/confirm.js +4 -4
  72. package/dist/components/Modal/modal-types.d.ts +2 -2
  73. package/dist/components/NavLink/NavLink.svelte +78 -86
  74. package/dist/components/Radio/Radio.svelte +23 -31
  75. package/dist/components/Slider/Slider.svelte +71 -79
  76. package/dist/components/SplitControl/SplitControl.svelte +28 -42
  77. package/dist/components/Switch/Switch.svelte +60 -65
  78. package/dist/components/TabNav/TabNav.svelte +6 -10
  79. package/dist/components/TabNav/TabNavItem.svelte +36 -43
  80. package/dist/components/Table/Table.svelte +7 -4
  81. package/dist/components/Table/TableRow.svelte +23 -23
  82. package/dist/components/Tag/Tag.svelte +28 -36
  83. package/dist/components/Text/Text.svelte +15 -22
  84. package/dist/components/TextInput/TextInput.svelte +26 -26
  85. package/dist/components/Textarea/Textarea.svelte +38 -38
  86. package/dist/components/Toast/ToastIcon.svelte +29 -31
  87. package/dist/components/Toast/ToastMessage.svelte +33 -39
  88. package/dist/components/Toast/ToastProvider.svelte +16 -16
  89. package/dist/components/Toast/cleaner.js +5 -5
  90. package/dist/components/Toast/toast.d.ts +2 -2
  91. package/dist/components/Toast/toast.js +10 -10
  92. package/dist/components/Tooltip/Tooltip.svelte +82 -83
  93. package/dist/components/directives/clickOutside.js +4 -4
  94. package/dist/components/directives/debounce.d.ts +1 -0
  95. package/dist/components/directives/debounce.js +8 -0
  96. package/dist/components/index.d.ts +1 -0
  97. package/dist/components/index.js +1 -0
  98. package/dist/index.css +31 -33
  99. package/dist/marketing/Container/Container.svelte +8 -8
  100. package/dist/marketing/Docs/Content/Content.svelte +8 -7
  101. package/dist/marketing/Docs/Content/DocsImage.svelte +52 -62
  102. package/dist/marketing/Docs/Docs.svelte +21 -24
  103. package/dist/marketing/Docs/Nav/Nav.svelte +21 -22
  104. package/dist/marketing/Docs/Nav/NavCategory.svelte +28 -28
  105. package/dist/marketing/Docs/Nav/NavItem.svelte +21 -24
  106. package/dist/marketing/Docs/Sidebar/Sidebar.svelte +22 -25
  107. package/dist/marketing/Docs/Toc.svelte +17 -19
  108. package/dist/marketing/Document/Document.svelte +5 -5
  109. package/dist/marketing/Document/DocumentTitle.svelte +49 -49
  110. package/dist/marketing/Footer/Footer.svelte +111 -119
  111. package/dist/marketing/Footer/FooterLinkList.svelte +24 -26
  112. package/dist/marketing/Header/Header.svelte +7 -15
  113. package/dist/marketing/Logo/LogoBlogs.svelte +41 -0
  114. package/dist/marketing/Logo/LogoBlogs.svelte.d.ts +16 -0
  115. package/dist/marketing/Logo/LogoCore.svelte +41 -0
  116. package/dist/marketing/Logo/LogoCore.svelte.d.ts +16 -0
  117. package/dist/marketing/Logo/LogoFortguard.svelte +49 -0
  118. package/dist/marketing/Logo/LogoFortguard.svelte.d.ts +16 -0
  119. package/dist/marketing/Logo/LogoTalk.svelte +27 -0
  120. package/dist/marketing/Logo/LogoTalk.svelte.d.ts +16 -0
  121. package/dist/stores/dark.js +8 -8
  122. package/dist/variables.scss +41 -48
  123. package/package.json +59 -58
@@ -0,0 +1,23 @@
1
+ /** @typedef {typeof __propDef.props} G2Props */
2
+ /** @typedef {typeof __propDef.events} G2Events */
3
+ /** @typedef {typeof __propDef.slots} G2Slots */
4
+ export default class G2 extends SvelteComponent<{
5
+ [x: string]: never;
6
+ }, {
7
+ [evt: string]: CustomEvent<any>;
8
+ }, {}> {
9
+ }
10
+ export type G2Props = typeof __propDef.props;
11
+ export type G2Events = typeof __propDef.events;
12
+ export type G2Slots = typeof __propDef.slots;
13
+ import { SvelteComponent } from "svelte";
14
+ declare const __propDef: {
15
+ props: {
16
+ [x: string]: never;
17
+ };
18
+ events: {
19
+ [evt: string]: CustomEvent<any>;
20
+ };
21
+ slots: {};
22
+ };
23
+ export {};
@@ -0,0 +1,11 @@
1
+ <svg
2
+ fill="#000000"
3
+ width="12"
4
+ height="12"
5
+ viewBox="0 0 24 24"
6
+ role="img"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ ><path
9
+ d="M12,17.964l5.214-1.321l2.179,6.714L12,17.964z M24,9.286h-9.179L12,0.643L9.179,9.286 H0l7.429,5.357l-2.821,8.643l7.429-5.357l4.571-3.286L24,9.286L24,9.286L24,9.286L24,9.286z"
10
+ />
11
+ </svg>
@@ -0,0 +1,23 @@
1
+ /** @typedef {typeof __propDef.props} TrustpilotProps */
2
+ /** @typedef {typeof __propDef.events} TrustpilotEvents */
3
+ /** @typedef {typeof __propDef.slots} TrustpilotSlots */
4
+ export default class Trustpilot extends SvelteComponent<{
5
+ [x: string]: never;
6
+ }, {
7
+ [evt: string]: CustomEvent<any>;
8
+ }, {}> {
9
+ }
10
+ export type TrustpilotProps = typeof __propDef.props;
11
+ export type TrustpilotEvents = typeof __propDef.events;
12
+ export type TrustpilotSlots = typeof __propDef.slots;
13
+ import { SvelteComponent } from "svelte";
14
+ declare const __propDef: {
15
+ props: {
16
+ [x: string]: never;
17
+ };
18
+ events: {
19
+ [evt: string]: CustomEvent<any>;
20
+ };
21
+ slots: {};
22
+ };
23
+ export {};
@@ -11,29 +11,25 @@ size = (typeof size === "number" ? size : sizes[size]) + "px";
11
11
  </script>
12
12
 
13
13
  <svelte:element
14
- this={as}
15
- class="button {color} {variant}"
16
-
17
- style:width={size}
18
- style:height={size}
19
-
20
- on:keyup
21
- on:keydown
22
- on:keypress
23
- on:focus
24
- on:blur
25
- on:click
26
- on:mouseover
27
- on:mouseenter
28
- on:mouseleave
29
- on:change
30
-
31
- role="button"
32
- tabindex="0"
33
-
34
- {...$$restProps}
14
+ this={as}
15
+ class="button {color} {variant}"
16
+ style:width={size}
17
+ style:height={size}
18
+ on:keyup
19
+ on:keydown
20
+ on:keypress
21
+ on:focus
22
+ on:blur
23
+ on:click
24
+ on:mouseover
25
+ on:mouseenter
26
+ on:mouseleave
27
+ on:change
28
+ role="button"
29
+ tabindex="0"
30
+ {...$$restProps}
35
31
  >
36
- <slot />
32
+ <slot />
37
33
  </svelte:element>
38
34
 
39
35
  <style>.button {
@@ -239,4 +235,4 @@ size = (typeof size === "number" ? size : sizes[size]) + "px";
239
235
  cursor: not-allowed;
240
236
  opacity: 0.2;
241
237
  box-shadow: none !important;
242
- }</style>
238
+ }</style>
@@ -1,8 +1,23 @@
1
- <script>import { IconBug, IconInbox, IconPatchExclamation } from "@hyvor/icons";
1
+ <script>import {} from "svelte";
2
+ import { IconBug, IconInbox } from "@hyvor/icons";
3
+ import Button from "../Button/Button.svelte";
4
+ export let size = "medium";
2
5
  export let icon = null;
3
6
  export let message = null;
4
- export let iconSize = 100;
5
- export let padding = 0;
7
+ export let iconSize = void 0;
8
+ const iconsSizes = {
9
+ small: 35,
10
+ medium: 50,
11
+ large: 75
12
+ };
13
+ iconSize = iconSize || iconsSizes[size];
14
+ export let padding = void 0;
15
+ const paddings = {
16
+ small: 15,
17
+ medium: 40,
18
+ large: 60
19
+ };
20
+ padding = padding === void 0 ? paddings[size] : padding;
6
21
  export let empty = false;
7
22
  export let error = false;
8
23
  export let iconColor = null;
@@ -12,46 +27,82 @@ if (empty) {
12
27
  }
13
28
  if (error) {
14
29
  message = message || "Something went wrong";
15
- icon = IconPatchExclamation;
16
- iconColor = iconColor || "var(--red)";
30
+ icon = IconBug;
31
+ iconColor = iconColor || "var(--gray-dark)";
17
32
  }
18
33
  iconColor = iconColor || "var(--gray-dark)";
34
+ export let cta = null;
35
+ function onCtaClick(e) {
36
+ if (cta) {
37
+ cta.onClick(e);
38
+ }
39
+ }
19
40
  </script>
20
41
 
21
- <div class="icon-message" style:padding={padding + "px"}>
22
- <div class="icon" style:color={iconColor} {...$$restProps}>
23
- {#if $$slots.icon}
24
- <slot name="icon" />
25
- {:else if icon}
26
- <svelte:component this={icon} size={iconSize + "px"} />
27
- {/if}
28
- </div>
29
-
30
- <div class="message">
31
- {#if $$slots.message}
32
- <slot name="message" />
33
- {:else if message}
34
- {message}
35
- {/if}
36
- </div>
42
+ <div class="icon-message {size}" style:padding={padding + 'px'}>
43
+ <div class="icon" style:color={iconColor} {...$$restProps}>
44
+ {#if $$slots.icon}
45
+ <slot name="icon" />
46
+ {:else if icon}
47
+ <svelte:component this={icon} size={iconSize + 'px'} />
48
+ {/if}
49
+ </div>
50
+
51
+ <div class="message">
52
+ {#if $$slots.default}
53
+ <slot />
54
+ {:else if $$slots.message}
55
+ <slot name="message" />
56
+ {:else if message}
57
+ {message}
58
+ {/if}
59
+ </div>
60
+
61
+ {#if cta || $$slots.cta}
62
+ <div class="cta">
63
+ {#if $$slots.cta}
64
+ <slot name="cta" />
65
+ {:else}
66
+ <Button on:click={onCtaClick} {size} {...cta?.props}>
67
+ {cta?.text}
68
+ </Button>
69
+ {/if}
70
+ </div>
71
+ {/if}
37
72
  </div>
38
73
 
39
74
  <style>
40
- .icon-message {
41
- width: 100%;
42
- height: 100%;
43
- flex: 1;
44
- display: flex;
45
- align-items: center;
46
- justify-content: center;
47
- position: relative;
48
- flex-direction: column; /* Change to column direction */
49
- text-align: center;
50
- }
51
-
52
- .message {
53
- /* Add message styles here */
54
- color: var(--text-light);
55
- margin-top: 15px;
56
- }
75
+ .icon-message {
76
+ width: 100%;
77
+ height: 100%;
78
+ flex: 1;
79
+ display: flex;
80
+ align-items: center;
81
+ justify-content: center;
82
+ position: relative;
83
+ flex-direction: column; /* Change to column direction */
84
+ text-align: center;
85
+ }
86
+
87
+ .icon {
88
+ display: inline-flex;
89
+ align-items: flex-end;
90
+ }
91
+
92
+ .message {
93
+ /* Add message styles here */
94
+ color: var(--text-light);
95
+ margin-top: 10px;
96
+ }
97
+
98
+ .icon-message.small .message {
99
+ margin-top: 8px;
100
+ }
101
+ .icon-message.large .message {
102
+ margin-top: 13px;
103
+ }
104
+
105
+ .cta {
106
+ margin-top: 15px;
107
+ }
57
108
  </style>
@@ -1,8 +1,9 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import type { ComponentType } from "svelte";
2
+ import { type ComponentType } from 'svelte';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  [x: string]: any;
6
+ size?: "small" | "medium" | "large" | undefined;
6
7
  icon?: ComponentType | null | undefined;
7
8
  message?: string | null | undefined;
8
9
  iconSize?: number | undefined;
@@ -10,13 +11,20 @@ declare const __propDef: {
10
11
  empty?: boolean | undefined;
11
12
  error?: boolean | undefined;
12
13
  iconColor?: string | null | undefined;
14
+ cta?: {
15
+ text: string;
16
+ onClick: (e: MouseEvent) => void;
17
+ props?: Record<string, any> | undefined;
18
+ } | null | undefined;
13
19
  };
14
20
  events: {
15
21
  [evt: string]: CustomEvent<any>;
16
22
  };
17
23
  slots: {
18
24
  icon: {};
25
+ default: {};
19
26
  message: {};
27
+ cta: {};
20
28
  };
21
29
  };
22
30
  export type IconMessageProps = typeof __propDef.props;
@@ -7,5 +7,5 @@ setContext("i18n", i18n);
7
7
  </script>
8
8
 
9
9
  {#key $locale}
10
- <slot />
11
- {/key}
10
+ <slot />
11
+ {/key}
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { type Language } from "./i18n.js";
2
+ import { type Language } from './i18n.js';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  languages: Language[];
@@ -21,43 +21,40 @@ function handleClick(language) {
21
21
  }
22
22
  </script>
23
23
 
24
-
25
24
  {#if i18n && $currentLanguage}
26
-
27
- <Dropdown bind:show={show} {position} {align}>
28
- <span slot="trigger">
29
- {#if icon}
30
- <IconButton color="input" {size}>
31
- {$currentLanguage.flag}
32
- </IconButton>
33
- {:else}
34
- <Button color="input" {size}>
35
- <span slot="start">{$currentLanguage.flag}</span>
36
- {$currentLanguage.name}
37
- <svelte:component slot="end" this={caret} size={12} />
38
- </Button>
39
- {/if}
40
- </span>
41
- <ActionList slot="content">
42
- {#each i18n.languages as language (language.code)}
43
- <ActionListItem on:click={() => handleClick(language)}>
44
- <span class="flag" slot="start">{language.flag}</span>
45
- <span class="name">
46
- {language.name}
47
- </span>
48
- <Text small light>
49
- {language.region}
50
- </Text>
51
- </ActionListItem>
52
- {/each}
53
- </ActionList>
54
- </Dropdown>
55
-
25
+ <Dropdown bind:show {position} {align}>
26
+ <span slot="trigger">
27
+ {#if icon}
28
+ <IconButton color="input" {size}>
29
+ {$currentLanguage.flag}
30
+ </IconButton>
31
+ {:else}
32
+ <Button color="input" {size}>
33
+ <span slot="start">{$currentLanguage.flag}</span>
34
+ {$currentLanguage.name}
35
+ <svelte:component this={caret} slot="end" size={12} />
36
+ </Button>
37
+ {/if}
38
+ </span>
39
+ <ActionList slot="content">
40
+ {#each i18n.languages as language (language.code)}
41
+ <ActionListItem on:click={() => handleClick(language)}>
42
+ <span class="flag" slot="start">{language.flag}</span>
43
+ <span class="name">
44
+ {language.name}
45
+ </span>
46
+ <Text small light>
47
+ {language.region}
48
+ </Text>
49
+ </ActionListItem>
50
+ {/each}
51
+ </ActionList>
52
+ </Dropdown>
56
53
  {/if}
57
54
 
58
55
  <style>
59
- .flag {
60
- margin-right: 6px;
61
- font-size: 20px;
62
- }
63
- </style>
56
+ .flag {
57
+ margin-right: 6px;
58
+ font-size: 20px;
59
+ }
60
+ </style>
@@ -1,6 +1,6 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { type ComponentProps, type ComponentType } from "svelte";
3
- import Dropdown from "../Dropdown/Dropdown.svelte";
2
+ import { type ComponentProps, type ComponentType } from 'svelte';
3
+ import Dropdown from '../Dropdown/Dropdown.svelte';
4
4
  declare const __propDef: {
5
5
  props: {
6
6
  position?: ComponentProps<Dropdown>['position'];
@@ -1,7 +1,7 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { type ToDotPaths, type I18nStrings } from "./types.js";
3
- import { type ComponentType } from "svelte";
4
- import { type PrimitiveType } from "intl-messageformat";
2
+ import { type ToDotPaths, type I18nStrings } from './types.js';
3
+ import { type ComponentType } from 'svelte';
4
+ import { type PrimitiveType } from 'intl-messageformat';
5
5
  declare class __sveltets_Render<StringsT extends I18nStrings> {
6
6
  props(): {
7
7
  key: ToDotPaths<StringsT>;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="svelte" />
2
- import type { PrimitiveType } from "intl-messageformat";
3
- import { type Readable, type Writable } from "svelte/store";
4
- import T from "./T.svelte";
5
- import type { ToDotPaths, I18nStrings } from "./types.js";
2
+ import type { PrimitiveType } from 'intl-messageformat';
3
+ import { type Readable, type Writable } from 'svelte/store';
4
+ import T from './T.svelte';
5
+ import type { ToDotPaths, I18nStrings } from './types.js';
6
6
  export type i18nLoaderType = () => Promise<any>;
7
7
  interface LanguageBase {
8
8
  name: string;
@@ -1,7 +1,7 @@
1
- import { deepmerge } from "deepmerge-ts";
2
- import { writable, derived } from "svelte/store";
3
- import { t } from "./t.js";
4
- import T from "./T.svelte";
1
+ import { deepmerge } from 'deepmerge-ts';
2
+ import { writable, derived } from 'svelte/store';
3
+ import { t } from './t.js';
4
+ import T from './T.svelte';
5
5
  export class InternationalizationService {
6
6
  languages = [];
7
7
  locale;
@@ -10,7 +10,7 @@ export class InternationalizationService {
10
10
  stringsCache = new Map();
11
11
  defaultStrings;
12
12
  constructor(languages) {
13
- const defaultLanguage = languages.find(l => l.default);
13
+ const defaultLanguage = languages.find((l) => l.default);
14
14
  if (!defaultLanguage) {
15
15
  throw new Error('Default language not found');
16
16
  }
@@ -19,7 +19,7 @@ export class InternationalizationService {
19
19
  throw new Error('Default strings not found for the default language');
20
20
  }
21
21
  this.locale = writable(defaultLanguage.code);
22
- this.localeLanguage = derived(this.locale, $locale => this.languageByCode($locale));
22
+ this.localeLanguage = derived(this.locale, ($locale) => this.languageByCode($locale));
23
23
  this.defaultStrings = defaultStrings;
24
24
  this.strings.set(this.defaultStrings);
25
25
  this.stringsCache.set(defaultLanguage.code, this.defaultStrings);
@@ -39,7 +39,9 @@ export class InternationalizationService {
39
39
  this.locale.set(code);
40
40
  }
41
41
  else {
42
- this.languageByCode(code)?.loader().then(({ default: strings }) => {
42
+ this.languageByCode(code)
43
+ ?.loader()
44
+ .then(({ default: strings }) => {
43
45
  this.stringsCache.set(code, strings);
44
46
  this.setStrings(code);
45
47
  this.locale.set(code);
@@ -49,16 +51,16 @@ export class InternationalizationService {
49
51
  register(language) {
50
52
  this.languages.push({
51
53
  ...language,
52
- loader: language.hasOwnProperty('strings') ?
53
- () => Promise.resolve(language.strings) :
54
- language.loader,
54
+ loader: language.hasOwnProperty('strings')
55
+ ? () => Promise.resolve(language.strings)
56
+ : language.loader
55
57
  });
56
58
  }
57
59
  found(code) {
58
60
  return !!this.languageByCode(code);
59
61
  }
60
62
  languageByCode(code) {
61
- return this.languages.find(l => l.code === code);
63
+ return this.languages.find((l) => l.code === code);
62
64
  }
63
65
  t(key, params = {}) {
64
66
  return t(key, params, this);
@@ -1,6 +1,6 @@
1
- import { type PrimitiveType } from "intl-messageformat";
2
- import { type InternationalizationService } from "./i18n.js";
3
- import type { I18nStrings, ToDotPaths } from "./types.js";
1
+ import { type PrimitiveType } from 'intl-messageformat';
2
+ import { type InternationalizationService } from './i18n.js';
3
+ import type { I18nStrings, ToDotPaths } from './types.js';
4
4
  type ParamValue = PrimitiveType | ((chunks: string | string[]) => string);
5
5
  type ParamsType = Record<string, ParamValue>;
6
6
  export declare function getMessage(key: string, params: ParamsType, $strings: Record<string, any>, $locale: string): string;
@@ -1,7 +1,7 @@
1
- import { IntlMessageFormat } from "intl-messageformat";
2
- import { getContext } from "svelte";
3
- import { get } from "svelte/store";
4
- import { getStringByKey } from "./i18n.js";
1
+ import { IntlMessageFormat } from 'intl-messageformat';
2
+ import { getContext } from 'svelte';
3
+ import { get } from 'svelte/store';
4
+ import { getStringByKey } from './i18n.js';
5
5
  export function getMessage(key, params, $strings, $locale) {
6
6
  const string = getStringByKey($strings, key);
7
7
  if (string) {
@@ -2,6 +2,6 @@ export type I18nStrings = {
2
2
  [key: string]: string | I18nStrings;
3
3
  };
4
4
  export type ToDotPaths<T> = T extends object ? {
5
- [K in keyof T]: `${Exclude<K, symbol>}${"" | `.${ToDotPaths<T[K]>}`}`;
5
+ [K in keyof T]: `${Exclude<K, symbol>}${'' | `.${ToDotPaths<T[K]>}`}`;
6
6
  }[keyof T] : never;
7
7
  export type FromDotPath<T, K extends string> = K extends keyof T ? T[K] : K extends `${infer K0}.${infer KR}` ? K0 extends keyof T ? FromDotPath<T[K0], KR> : never : never;
@@ -4,69 +4,64 @@ export let underline = true;
4
4
  </script>
5
5
 
6
6
  <a
7
- {href}
8
-
9
- class="color-{color}"
10
- class:underline={underline}
11
-
12
- on:keyup
13
- on:keydown
14
- on:keypress
15
- on:focus
16
- on:blur
17
- on:click
18
- on:mouseover
19
- on:mouseenter
20
- on:mouseleave
21
- on:change
22
-
23
- {...$$restProps}
7
+ {href}
8
+ class="color-{color}"
9
+ class:underline
10
+ on:keyup
11
+ on:keydown
12
+ on:keypress
13
+ on:focus
14
+ on:blur
15
+ on:click
16
+ on:mouseover
17
+ on:mouseenter
18
+ on:mouseleave
19
+ on:change
20
+ {...$$restProps}
24
21
  >
22
+ {#if $$slots.start}
23
+ <span class="slot start-slot"><slot name="start" /></span>
24
+ {/if}
25
25
 
26
- {#if $$slots.start}
27
- <span class="slot start-slot"><slot name="start" /></span>
28
- {/if}
29
-
30
- <slot />
31
-
32
- {#if $$slots.end}
33
- <span class="slot end-slot"><slot name="end" /></span>
34
- {/if}
26
+ <slot />
35
27
 
28
+ {#if $$slots.end}
29
+ <span class="slot end-slot"><slot name="end" /></span>
30
+ {/if}
36
31
  </a>
37
32
 
38
33
  <style>
39
- a {
40
- display: inline-flex;
41
- align-items: center;
42
- color: var(--local-color);
43
- }
44
- a.color-link {
45
- --local-color: var(--link);
46
- }
47
- a.color-accent {
48
- --local-color: var(--accent);
49
- }
50
- a.color-text {
51
- --local-color: var(--text);
52
- }
53
- a.underline {
54
- text-decoration: underline;
55
- text-decoration-color: var(--local-color);
56
- }
57
- a:not(.underline):hover {
58
- text-decoration: underline;
59
- }
34
+ a {
35
+ display: inline-flex;
36
+ align-items: center;
37
+ color: var(--local-color);
38
+ }
39
+ a.color-link {
40
+ --local-color: var(--link);
41
+ }
42
+ a.color-accent {
43
+ --local-color: var(--accent);
44
+ }
45
+ a.color-text {
46
+ --local-color: var(--text);
47
+ }
48
+ a.underline {
49
+ text-decoration: underline;
50
+ text-decoration-color: var(--local-color);
51
+ }
52
+ a:not(.underline):hover {
53
+ text-decoration: underline;
54
+ }
60
55
 
61
- .slot {
62
- display: inline-flex;
63
- align-items: center;
64
- }
56
+ .slot {
57
+ display: inline-flex;
58
+ align-items: center;
59
+ }
65
60
 
66
- .start-slot {
67
- margin-right: 4px;
68
- }
69
- .end-slot {
70
- margin-left: 4px;
71
- }
72
- </style>
61
+ .start-slot {
62
+ margin-right: 4px;
63
+ }
64
+ .end-slot {
65
+ margin-left: 4px;
66
+ }
67
+ </style>