@hyvor/design 0.0.68 → 1.0.3

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 (165) hide show
  1. package/dist/components/ActionList/ActionList.svelte +22 -9
  2. package/dist/components/ActionList/ActionList.svelte.d.ts +8 -20
  3. package/dist/components/ActionList/ActionListGroup.svelte +18 -8
  4. package/dist/components/ActionList/ActionListGroup.svelte.d.ts +8 -20
  5. package/dist/components/ActionList/ActionListItem.svelte +49 -25
  6. package/dist/components/ActionList/ActionListItem.svelte.d.ts +27 -25
  7. package/dist/components/ActionList/Selected.svelte +10 -4
  8. package/dist/components/ActionList/Selected.svelte.d.ts +6 -17
  9. package/dist/components/Avatar/Avatar.svelte +16 -9
  10. package/dist/components/Avatar/Avatar.svelte.d.ts +7 -18
  11. package/dist/components/Avatar/AvatarStack.svelte +14 -8
  12. package/dist/components/Avatar/AvatarStack.svelte.d.ts +6 -18
  13. package/dist/components/Base/Base.svelte +14 -6
  14. package/dist/components/Base/Base.svelte.d.ts +6 -18
  15. package/dist/components/Box/Box.svelte +10 -3
  16. package/dist/components/Box/Box.svelte.d.ts +7 -19
  17. package/dist/components/Button/Button.svelte +52 -25
  18. package/dist/components/Button/Button.svelte.d.ts +16 -39
  19. package/dist/components/Button/ButtonGroup.svelte +9 -1
  20. package/dist/components/Button/ButtonGroup.svelte.d.ts +5 -27
  21. package/dist/components/Callout/Callout.svelte +41 -20
  22. package/dist/components/Callout/Callout.svelte.d.ts +11 -23
  23. package/dist/components/Checkbox/Checkbox.svelte +58 -38
  24. package/dist/components/Checkbox/Checkbox.svelte.d.ts +11 -34
  25. package/dist/components/CodeBlock/CodeBlock.svelte +21 -11
  26. package/dist/components/CodeBlock/CodeBlock.svelte.d.ts +6 -17
  27. package/dist/components/CodeBlock/getCode.js +2 -0
  28. package/dist/components/ColorPicker/ColorPicker.svelte +34 -15
  29. package/dist/components/ColorPicker/ColorPicker.svelte.d.ts +25 -19
  30. package/dist/components/Dark/DarkProvider.svelte +7 -5
  31. package/dist/components/Dark/DarkProvider.svelte.d.ts +16 -12
  32. package/dist/components/Dark/DarkToggle.svelte +8 -6
  33. package/dist/components/Dark/DarkToggle.svelte.d.ts +16 -12
  34. package/dist/components/Divider/Divider.svelte +17 -6
  35. package/dist/components/Divider/Divider.svelte.d.ts +9 -20
  36. package/dist/components/Dropdown/Dropdown.svelte +33 -14
  37. package/dist/components/Dropdown/Dropdown.svelte.d.ts +13 -24
  38. package/dist/components/Dropdown/DropdownContent.svelte +124 -92
  39. package/dist/components/Dropdown/DropdownContent.svelte.d.ts +12 -24
  40. package/dist/components/FormControl/Caption.svelte +10 -3
  41. package/dist/components/FormControl/Caption.svelte.d.ts +7 -19
  42. package/dist/components/FormControl/FormControl.svelte +11 -2
  43. package/dist/components/FormControl/FormControl.svelte.d.ts +6 -27
  44. package/dist/components/FormControl/InputGroup.svelte +17 -9
  45. package/dist/components/FormControl/InputGroup.svelte.d.ts +7 -19
  46. package/dist/components/FormControl/Label.svelte +11 -2
  47. package/dist/components/FormControl/Label.svelte.d.ts +6 -27
  48. package/dist/components/FormControl/Validation.svelte +18 -9
  49. package/dist/components/FormControl/Validation.svelte.d.ts +8 -20
  50. package/dist/components/HyvorBar/BarProducts.svelte +44 -25
  51. package/dist/components/HyvorBar/BarProducts.svelte.d.ts +14 -21
  52. package/dist/components/HyvorBar/BarSupport.svelte +165 -101
  53. package/dist/components/HyvorBar/BarSupport.svelte.d.ts +7 -18
  54. package/dist/components/HyvorBar/BarUpdates.svelte +25 -15
  55. package/dist/components/HyvorBar/BarUpdates.svelte.d.ts +6 -17
  56. package/dist/components/HyvorBar/BarUpdatesList.svelte +73 -48
  57. package/dist/components/HyvorBar/BarUpdatesList.svelte.d.ts +6 -17
  58. package/dist/components/HyvorBar/BarUser.svelte +36 -24
  59. package/dist/components/HyvorBar/BarUser.svelte.d.ts +5 -16
  60. package/dist/components/HyvorBar/BarUserPreview.svelte +2 -1
  61. package/dist/components/HyvorBar/BarUserPreview.svelte.d.ts +16 -12
  62. package/dist/components/HyvorBar/HyvorBar.svelte +69 -36
  63. package/dist/components/HyvorBar/HyvorBar.svelte.d.ts +7 -18
  64. package/dist/components/HyvorBar/bar.d.ts +2 -2
  65. package/dist/components/HyvorBar/img/G2.svelte.d.ts +22 -19
  66. package/dist/components/HyvorBar/img/Trustpilot.svelte.d.ts +22 -19
  67. package/dist/components/IconButton/IconButton.svelte +43 -22
  68. package/dist/components/IconButton/IconButton.svelte.d.ts +10 -33
  69. package/dist/components/IconMessage/IconMessage.svelte +111 -56
  70. package/dist/components/IconMessage/IconMessage.svelte.d.ts +19 -35
  71. package/dist/components/Internationalization/InternationalizationProvider.svelte +14 -7
  72. package/dist/components/Internationalization/InternationalizationProvider.svelte.d.ts +6 -18
  73. package/dist/components/Internationalization/LanguageToggle.svelte +73 -47
  74. package/dist/components/Internationalization/LanguageToggle.svelte.d.ts +10 -21
  75. package/dist/components/Internationalization/T.svelte +158 -114
  76. package/dist/components/Internationalization/T.svelte.d.ts +17 -15
  77. package/dist/components/Internationalization/i18n.d.ts +1 -3
  78. package/dist/components/Internationalization/t.d.ts +1 -2
  79. package/dist/components/Internationalization/types.d.ts +1 -0
  80. package/dist/components/Link/Link.svelte +31 -19
  81. package/dist/components/Link/Link.svelte.d.ts +11 -34
  82. package/dist/components/Loader/LoadButton.svelte +24 -9
  83. package/dist/components/Loader/LoadButton.svelte.d.ts +29 -42
  84. package/dist/components/Loader/Loader.svelte +69 -42
  85. package/dist/components/Loader/Loader.svelte.d.ts +15 -27
  86. package/dist/components/Modal/ConfirmModalProvider.svelte +28 -20
  87. package/dist/components/Modal/ConfirmModalProvider.svelte.d.ts +3 -14
  88. package/dist/components/Modal/Modal.svelte +76 -47
  89. package/dist/components/Modal/Modal.svelte.d.ts +31 -29
  90. package/dist/components/Modal/ModalFooter.svelte +14 -6
  91. package/dist/components/Modal/ModalFooter.svelte.d.ts +22 -18
  92. package/dist/components/Modal/confirm.d.ts +2 -2
  93. package/dist/components/Modal/modal-types.d.ts +2 -2
  94. package/dist/components/NavLink/NavLink.svelte +31 -18
  95. package/dist/components/NavLink/NavLink.svelte.d.ts +11 -33
  96. package/dist/components/Radio/Radio.svelte +35 -16
  97. package/dist/components/Radio/Radio.svelte.d.ts +10 -33
  98. package/dist/components/Slider/Slider.svelte +53 -36
  99. package/dist/components/Slider/Slider.svelte.d.ts +24 -20
  100. package/dist/components/SplitControl/SplitControl.svelte +27 -18
  101. package/dist/components/SplitControl/SplitControl.svelte.d.ts +11 -24
  102. package/dist/components/Switch/Switch.svelte +30 -15
  103. package/dist/components/Switch/Switch.svelte.d.ts +8 -31
  104. package/dist/components/TabNav/TabNav.svelte +29 -15
  105. package/dist/components/TabNav/TabNav.svelte.d.ts +7 -19
  106. package/dist/components/TabNav/TabNavItem.svelte +36 -15
  107. package/dist/components/TabNav/TabNavItem.svelte.d.ts +10 -24
  108. package/dist/components/Table/Table.svelte +11 -4
  109. package/dist/components/Table/Table.svelte.d.ts +7 -19
  110. package/dist/components/Table/TableRow.svelte +11 -3
  111. package/dist/components/Table/TableRow.svelte.d.ts +7 -19
  112. package/dist/components/Tag/Tag.svelte +65 -31
  113. package/dist/components/Tag/Tag.svelte.d.ts +16 -39
  114. package/dist/components/Text/Text.svelte +20 -6
  115. package/dist/components/Text/Text.svelte.d.ts +10 -22
  116. package/dist/components/TextInput/TextInput.svelte +42 -21
  117. package/dist/components/TextInput/TextInput.svelte.d.ts +12 -36
  118. package/dist/components/Textarea/Textarea.svelte +46 -24
  119. package/dist/components/Textarea/Textarea.svelte.d.ts +13 -37
  120. package/dist/components/Toast/ToastIcon.svelte +26 -15
  121. package/dist/components/Toast/ToastIcon.svelte.d.ts +5 -16
  122. package/dist/components/Toast/ToastMessage.svelte +11 -4
  123. package/dist/components/Toast/ToastMessage.svelte.d.ts +5 -16
  124. package/dist/components/Toast/ToastProvider.svelte +6 -4
  125. package/dist/components/Toast/ToastProvider.svelte.d.ts +16 -12
  126. package/dist/components/Toast/toast.d.ts +2 -2
  127. package/dist/components/Tooltip/Tooltip.svelte +71 -55
  128. package/dist/components/Tooltip/Tooltip.svelte.d.ts +35 -23
  129. package/dist/marketing/Container/Container.svelte +8 -2
  130. package/dist/marketing/Container/Container.svelte.d.ts +6 -18
  131. package/dist/marketing/Docs/Content/Content.svelte +41 -29
  132. package/dist/marketing/Docs/Content/Content.svelte.d.ts +5 -16
  133. package/dist/marketing/Docs/Content/DocsImage.svelte +17 -9
  134. package/dist/marketing/Docs/Content/DocsImage.svelte.d.ts +9 -20
  135. package/dist/marketing/Docs/Docs.svelte +9 -3
  136. package/dist/marketing/Docs/Docs.svelte.d.ts +6 -29
  137. package/dist/marketing/Docs/Nav/Nav.svelte +77 -50
  138. package/dist/marketing/Docs/Nav/Nav.svelte.d.ts +5 -16
  139. package/dist/marketing/Docs/Nav/NavCategory.svelte +16 -6
  140. package/dist/marketing/Docs/Nav/NavCategory.svelte.d.ts +8 -20
  141. package/dist/marketing/Docs/Nav/NavItem.svelte +10 -3
  142. package/dist/marketing/Docs/Nav/NavItem.svelte.d.ts +6 -18
  143. package/dist/marketing/Docs/Sidebar/Sidebar.svelte.d.ts +22 -19
  144. package/dist/marketing/Docs/Toc.svelte +49 -39
  145. package/dist/marketing/Docs/Toc.svelte.d.ts +3 -14
  146. package/dist/marketing/Document/Document.svelte +11 -4
  147. package/dist/marketing/Document/Document.svelte.d.ts +7 -19
  148. package/dist/marketing/Document/DocumentTitle.svelte +16 -5
  149. package/dist/marketing/Document/DocumentTitle.svelte.d.ts +9 -20
  150. package/dist/marketing/Footer/Footer.svelte +55 -38
  151. package/dist/marketing/Footer/Footer.svelte.d.ts +8 -20
  152. package/dist/marketing/Footer/FooterLinkList.svelte +8 -2
  153. package/dist/marketing/Footer/FooterLinkList.svelte.d.ts +6 -18
  154. package/dist/marketing/Header/Header.svelte +41 -23
  155. package/dist/marketing/Header/Header.svelte.d.ts +10 -22
  156. package/dist/marketing/Logo/LogoBlogs.svelte +6 -1
  157. package/dist/marketing/Logo/LogoBlogs.svelte.d.ts +5 -16
  158. package/dist/marketing/Logo/LogoCore.svelte +6 -1
  159. package/dist/marketing/Logo/LogoCore.svelte.d.ts +5 -16
  160. package/dist/marketing/Logo/LogoFortguard.svelte +7 -2
  161. package/dist/marketing/Logo/LogoFortguard.svelte.d.ts +5 -16
  162. package/dist/marketing/Logo/LogoTalk.svelte +6 -1
  163. package/dist/marketing/Logo/LogoTalk.svelte.d.ts +5 -16
  164. package/dist/stores/dark.d.ts +0 -1
  165. package/package.json +8 -8
@@ -1,117 +1,161 @@
1
- <script generics="StringsT extends I18nStrings">import {} from "./types.js";
2
- import {
3
- getContext,
4
- onMount,
5
- tick,
6
- afterUpdate,
7
- getAllContexts
8
- } from "svelte";
9
- import { getStringByKey, InternationalizationService } from "./i18n.js";
10
- import { IntlMessageFormat } from "intl-messageformat";
11
- import { browser } from "$app/environment";
12
- import { getMessage as getMessageBase } from "./t.js";
13
- export let key;
14
- export let params = {};
15
- const context = getAllContexts();
16
- let hasComponentParams = false;
17
- function getElementFunc(el) {
18
- return (chunks) => {
19
- const children = typeof chunks === "string" ? chunks : chunks.join("");
20
- return `<${el}>${children}</${el}>`;
21
- };
22
- }
23
- function getParamsForBackend() {
24
- let retParams = {};
25
- for (let [key2, value] of Object.entries(params)) {
26
- let newValue;
27
- if (typeof value === "object" && value !== null) {
28
- if (value.hasOwnProperty("component")) {
29
- newValue = (chunks) => {
30
- const children = typeof chunks === "string" ? chunks : chunks.join("");
31
- return children;
32
- };
33
- hasComponentParams = true;
34
- } else if (value.hasOwnProperty("element")) {
35
- newValue = getElementFunc(value.element);
36
- }
37
- } else {
38
- newValue = value;
39
- }
40
- retParams[key2] = newValue;
41
- }
42
- return retParams;
43
- }
44
- const componentBindings = /* @__PURE__ */ new Map();
45
- function getParamsForFrontend() {
46
- let retParams = {};
47
- for (let [key2, value] of Object.entries(params)) {
48
- let newValue;
49
- if (typeof value === "object" && value !== null) {
50
- if (value.hasOwnProperty("component")) {
51
- const { component, props } = value;
52
- newValue = (chunks) => {
53
- const children = typeof chunks === "string" ? chunks : chunks.join("");
54
- const id = key2 + "-" + Math.random().toString(36).substring(7) + "-" + Date.now().toString();
55
- componentBindings.set(id, {
56
- component,
57
- props: {
58
- ...props,
59
- children
60
- }
61
- });
62
- return '<span id="' + id + '">' + children + "</span>";
63
- };
64
- } else if (value.hasOwnProperty("element")) {
65
- newValue = getElementFunc(value.element);
66
- }
67
- } else {
68
- newValue = value;
69
- }
70
- retParams[key2] = newValue;
71
- }
72
- return retParams;
73
- }
74
- const i18n = getContext("i18n");
75
- const locale = i18n.locale;
76
- const strings = i18n.strings;
77
- let message = getMessage(getParamsForBackend());
78
- function getMessage(processedParams) {
79
- return getMessageBase(key, processedParams, $strings, $locale);
80
- }
81
- function bindComponents() {
82
- for (let [id, binding] of componentBindings) {
83
- const el = document.getElementById(id);
84
- if (el) {
85
- el.innerHTML = "";
86
- new binding.component({
87
- target: el,
88
- hydrate: true,
89
- props: binding.props,
90
- context
91
- });
92
- }
93
- }
94
- }
95
- async function renderFrontend() {
96
- message = getMessage(getParamsForFrontend());
97
- await tick();
98
- if (hasComponentParams)
99
- bindComponents();
100
- }
101
- let mounted = false;
102
- $: {
103
- params;
104
- key;
105
- if (browser && mounted) {
106
- renderFrontend();
107
- }
108
- }
109
- onMount(async () => {
110
- mounted = true;
111
- if (hasComponentParams) {
112
- renderFrontend();
113
- }
114
- });
1
+ <script lang="ts" generics="StringsT extends I18nStrings">
2
+ import { run } from 'svelte/legacy';
3
+
4
+ import { type ToDotPaths, type I18nStrings, type PrimitiveType } from './types.js';
5
+ import { getContext, onMount, tick, getAllContexts, type Component, hydrate } from 'svelte';
6
+ import { InternationalizationService } from './i18n.js';
7
+ import { browser } from '$app/environment';
8
+ import { getMessage as getMessageBase } from './t.js';
9
+
10
+ type ComponentDeclaration = {
11
+ element?: string;
12
+ component?: Component<any>;
13
+ props?: Record<string, any>;
14
+ };
15
+ type InputParams = Record<string, PrimitiveType | ComponentDeclaration>;
16
+ type ParamValue = PrimitiveType | ((chunks: string | string[]) => string);
17
+
18
+ interface Props {
19
+ key: ToDotPaths<StringsT>;
20
+ params?: InputParams;
21
+ }
22
+
23
+ let { key, params = {} }: Props = $props();
24
+
25
+ const context = getAllContexts();
26
+
27
+ let hasComponentParams = false;
28
+
29
+ function getElementFunc(el: string) {
30
+ return (chunks: string | string[]) => {
31
+ const children = typeof chunks === 'string' ? chunks : chunks.join('');
32
+ return `<${el}>${children}</${el}>`;
33
+ };
34
+ }
35
+
36
+ /**
37
+ * In backend processing (SSR), we only render the strings inside it
38
+ * The components are not rendered.
39
+ * However, if components are found, we set hasComponentParams to true
40
+ * so that we can render the components in the frontend later.
41
+ */
42
+ function getParamsForBackend() {
43
+ let retParams: Record<string, ParamValue> = {};
44
+
45
+ for (let [key, value] of Object.entries(params)) {
46
+ let newValue: ParamValue;
47
+ if (typeof value === 'object' && value !== null) {
48
+ if (value.hasOwnProperty('component')) {
49
+ newValue = (chunks: string | string[]) => {
50
+ const children = typeof chunks === 'string' ? chunks : chunks.join('');
51
+ return children;
52
+ };
53
+ hasComponentParams = true;
54
+ } else if (value.hasOwnProperty('element')) {
55
+ newValue = getElementFunc((value as any).element as string);
56
+ }
57
+ } else {
58
+ newValue = value as PrimitiveType;
59
+ }
60
+ retParams[key] = newValue;
61
+ }
62
+
63
+ return retParams;
64
+ }
65
+
66
+ /**
67
+ * In frontend processing, we render the components
68
+ */
69
+ interface ComponentBinding {
70
+ component: Component<any>;
71
+ props: Record<string, any>;
72
+ }
73
+ const componentBindings = new Map<string, ComponentBinding>();
74
+ function getParamsForFrontend() {
75
+ let retParams: Record<string, ParamValue> = {};
76
+
77
+ for (let [key, value] of Object.entries(params)) {
78
+ let newValue: ParamValue;
79
+ if (typeof value === 'object' && value !== null) {
80
+ if (value.hasOwnProperty('component')) {
81
+ const { component, props } = value as ComponentDeclaration;
82
+
83
+ newValue = (chunks: string | string[]) => {
84
+ const children = typeof chunks === 'string' ? chunks : chunks.join('');
85
+ const id =
86
+ key + '-' + Math.random().toString(36).substring(7) + '-' + Date.now().toString();
87
+ componentBindings.set(id, {
88
+ component: component!,
89
+ props: {
90
+ ...props,
91
+ children
92
+ }
93
+ });
94
+ return '<span id="' + id + '">' + children + '</span>';
95
+ };
96
+ } else if (value.hasOwnProperty('element')) {
97
+ newValue = getElementFunc((value as any).element as string);
98
+ }
99
+ } else {
100
+ newValue = value as PrimitiveType;
101
+ }
102
+ retParams[key] = newValue;
103
+ }
104
+
105
+ return retParams;
106
+ }
107
+
108
+ const i18n = getContext<InternationalizationService>('i18n');
109
+ const locale = i18n.locale;
110
+ const strings = i18n.strings;
111
+
112
+ let message = $state(getMessage(getParamsForBackend()));
113
+
114
+ function getMessage(processedParams: Record<string, ParamValue>) {
115
+ return getMessageBase(key, processedParams, $strings, $locale);
116
+ }
117
+
118
+ function bindComponents() {
119
+ for (let [id, binding] of componentBindings) {
120
+ const el = document.getElementById(id);
121
+ if (el) {
122
+ el.innerHTML = '';
123
+ hydrate(binding.component, {
124
+ target: el,
125
+ props: binding.props,
126
+ context
127
+ });
128
+ }
129
+ }
130
+ }
131
+
132
+ async function renderFrontend() {
133
+ message = getMessage(getParamsForFrontend());
134
+ await tick();
135
+ if (hasComponentParams) bindComponents();
136
+ }
137
+
138
+ let mounted = $state(false);
139
+
140
+ run(() => {
141
+ params;
142
+ key;
143
+ if (browser && mounted) {
144
+ renderFrontend();
145
+ }
146
+ });
147
+
148
+ onMount(async () => {
149
+ mounted = true;
150
+
151
+ /**
152
+ * If there are components,
153
+ * we wait for the tick, then bind the components
154
+ */
155
+ if (hasComponentParams) {
156
+ renderFrontend();
157
+ }
158
+ });
115
159
  </script>
116
160
 
117
161
  {@html message}
@@ -1,24 +1,26 @@
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';
1
+ import { type ToDotPaths, type I18nStrings, type PrimitiveType } from './types.js';
2
+ import { type Component } from 'svelte';
5
3
  declare class __sveltets_Render<StringsT extends I18nStrings> {
6
4
  props(): {
7
5
  key: ToDotPaths<StringsT>;
8
6
  params?: Record<string, PrimitiveType | {
9
- element?: string | undefined;
10
- component?: ComponentType | undefined;
11
- props?: Record<string, any> | undefined;
7
+ element?: string;
8
+ component?: Component<any>;
9
+ props?: Record<string, any>;
12
10
  }> | undefined;
13
11
  };
14
- events(): {} & {
15
- [evt: string]: CustomEvent<any>;
16
- };
12
+ events(): {};
17
13
  slots(): {};
14
+ bindings(): "";
15
+ exports(): {};
18
16
  }
19
- export type TProps<StringsT extends I18nStrings> = ReturnType<__sveltets_Render<StringsT>['props']>;
20
- export type TEvents<StringsT extends I18nStrings> = ReturnType<__sveltets_Render<StringsT>['events']>;
21
- export type TSlots<StringsT extends I18nStrings> = ReturnType<__sveltets_Render<StringsT>['slots']>;
22
- export default class T<StringsT extends I18nStrings> extends SvelteComponent<TProps<StringsT>, TEvents<StringsT>, TSlots<StringsT>> {
17
+ interface $$IsomorphicComponent {
18
+ new <StringsT extends I18nStrings>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<StringsT>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<StringsT>['props']>, ReturnType<__sveltets_Render<StringsT>['events']>, ReturnType<__sveltets_Render<StringsT>['slots']>> & {
19
+ $$bindings?: ReturnType<__sveltets_Render<StringsT>['bindings']>;
20
+ } & ReturnType<__sveltets_Render<StringsT>['exports']>;
21
+ <StringsT extends I18nStrings>(internal: unknown, props: ReturnType<__sveltets_Render<StringsT>['props']> & {}): ReturnType<__sveltets_Render<StringsT>['exports']>;
22
+ z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
23
23
  }
24
- export {};
24
+ declare const T: $$IsomorphicComponent;
25
+ type T<StringsT extends I18nStrings> = InstanceType<typeof T<StringsT>>;
26
+ export default T;
@@ -1,8 +1,6 @@
1
- /// <reference types="svelte" />
2
- import type { PrimitiveType } from 'intl-messageformat';
3
1
  import { type Readable, type Writable } from 'svelte/store';
4
2
  import T from './T.svelte';
5
- import type { ToDotPaths, I18nStrings } from './types.js';
3
+ import type { ToDotPaths, I18nStrings, PrimitiveType } from './types.js';
6
4
  export type i18nLoaderType = () => Promise<any>;
7
5
  interface LanguageBase {
8
6
  name: string;
@@ -1,6 +1,5 @@
1
- import { type PrimitiveType } from 'intl-messageformat';
2
1
  import { type InternationalizationService } from './i18n.js';
3
- import type { I18nStrings, ToDotPaths } from './types.js';
2
+ import type { I18nStrings, PrimitiveType, ToDotPaths } from './types.js';
4
3
  type ParamValue = PrimitiveType | ((chunks: string | string[]) => string);
5
4
  type ParamsType = Record<string, ParamValue>;
6
5
  export declare function getMessage(key: string, params: ParamsType, $strings: Record<string, any>, $locale: string): string;
@@ -1,6 +1,7 @@
1
1
  export type I18nStrings = {
2
2
  [key: string]: string | I18nStrings;
3
3
  };
4
+ export type PrimitiveType = string | number | boolean | null | undefined | Date;
4
5
  export type ToDotPaths<T> = T extends object ? {
5
6
  [K in keyof T]: `${Exclude<K, symbol>}${'' | `.${ToDotPaths<T[K]>}`}`;
6
7
  }[keyof T] : never;
@@ -1,32 +1,44 @@
1
- <script>export let href;
2
- export let color = "link";
3
- export let underline = true;
1
+ <script lang="ts">
2
+ import { createBubbler } from 'svelte/legacy';
3
+
4
+ const bubble = createBubbler();
5
+ interface Props {
6
+ href: string;
7
+ color?: 'link' | 'accent' | 'text';
8
+ underline?: boolean;
9
+ start?: import('svelte').Snippet;
10
+ children?: import('svelte').Snippet;
11
+ end?: import('svelte').Snippet;
12
+ [key: string]: any;
13
+ }
14
+
15
+ let { href, color = 'link', underline = true, start, children, end, ...rest }: Props = $props();
4
16
  </script>
5
17
 
6
18
  <a
7
19
  {href}
8
20
  class="color-{color}"
9
21
  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}
22
+ onkeyup={bubble('keyup')}
23
+ onkeydown={bubble('keydown')}
24
+ onkeypress={bubble('keypress')}
25
+ onfocus={bubble('focus')}
26
+ onblur={bubble('blur')}
27
+ onclick={bubble('click')}
28
+ onmouseover={bubble('mouseover')}
29
+ onmouseenter={bubble('mouseenter')}
30
+ onmouseleave={bubble('mouseleave')}
31
+ onchange={bubble('change')}
32
+ {...rest}
21
33
  >
22
- {#if $$slots.start}
23
- <span class="slot start-slot"><slot name="start" /></span>
34
+ {#if start}
35
+ <span class="slot start-slot">{@render start?.()}</span>
24
36
  {/if}
25
37
 
26
- <slot />
38
+ {@render children?.()}
27
39
 
28
- {#if $$slots.end}
29
- <span class="slot end-slot"><slot name="end" /></span>
40
+ {#if end}
41
+ <span class="slot end-slot">{@render end?.()}</span>
30
42
  {/if}
31
43
  </a>
32
44
 
@@ -1,34 +1,11 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- [x: string]: any;
5
- href: string;
6
- color?: "accent" | "text" | "link" | undefined;
7
- underline?: boolean | undefined;
8
- };
9
- events: {
10
- keyup: KeyboardEvent;
11
- keydown: KeyboardEvent;
12
- keypress: KeyboardEvent;
13
- focus: FocusEvent;
14
- blur: FocusEvent;
15
- click: MouseEvent;
16
- mouseover: MouseEvent;
17
- mouseenter: MouseEvent;
18
- mouseleave: MouseEvent;
19
- change: Event;
20
- } & {
21
- [evt: string]: CustomEvent<any>;
22
- };
23
- slots: {
24
- start: {};
25
- default: {};
26
- end: {};
27
- };
28
- };
29
- export type LinkProps = typeof __propDef.props;
30
- export type LinkEvents = typeof __propDef.events;
31
- export type LinkSlots = typeof __propDef.slots;
32
- export default class Link extends SvelteComponent<LinkProps, LinkEvents, LinkSlots> {
33
- }
34
- export {};
1
+ declare const Link: import("svelte").Component<{
2
+ [key: string]: any;
3
+ href: string;
4
+ color?: "link" | "accent" | "text";
5
+ underline?: boolean;
6
+ start?: import("svelte").Snippet;
7
+ children?: import("svelte").Snippet;
8
+ end?: import("svelte").Snippet;
9
+ }, {}, "">;
10
+ type Link = ReturnType<typeof Link>;
11
+ export default Link;
@@ -1,12 +1,27 @@
1
- <script>import Button from "../Button/Button.svelte";
2
- import Loader from "./Loader.svelte";
3
- export let text;
4
- export let show;
5
- export let loading;
6
- export let height = 50;
7
- export let divProps = {};
8
- export let loaderProps = {};
9
- export let buttonProps = {};
1
+ <script lang="ts">
2
+ import type { ComponentProps } from 'svelte';
3
+ import Button from '../Button/Button.svelte';
4
+ import Loader from './Loader.svelte';
5
+
6
+ interface Props {
7
+ text: string;
8
+ show: boolean; // has more
9
+ loading: boolean; // whether loading
10
+ height?: number;
11
+ divProps?: Record<string, any>;
12
+ loaderProps?: ComponentProps<typeof Loader>;
13
+ buttonProps?: ComponentProps<typeof Button>;
14
+ }
15
+
16
+ let {
17
+ text,
18
+ show,
19
+ loading,
20
+ height = 50,
21
+ divProps = {},
22
+ loaderProps = {},
23
+ buttonProps = {}
24
+ }: Props = $props();
10
25
  </script>
11
26
 
12
27
  {#if show}
@@ -1,44 +1,31 @@
1
- import { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- text: string;
5
- show: boolean;
6
- loading: boolean;
7
- height?: number | undefined;
8
- divProps?: Record<string, any> | undefined;
9
- loaderProps?: {
10
- [x: string]: any;
11
- block?: boolean | undefined;
12
- full?: boolean | undefined;
13
- padding?: number | "none" | "small" | "medium" | "large" | undefined;
14
- size?: number | "small" | "medium" | "large" | undefined;
15
- state?: "none" | "error" | "loading" | "success" | undefined;
16
- duration?: number | null | undefined;
17
- color?: string | undefined;
18
- colorTrack?: string | undefined;
19
- invert?: boolean | undefined;
20
- } | undefined;
21
- buttonProps?: {
22
- [x: string]: any;
23
- as?: "button" | "a" | undefined;
24
- size?: "small" | "medium" | "large" | "x-small" | undefined;
25
- color?: "input" | "accent" | "gray" | "green" | "red" | "blue" | "orange" | undefined;
26
- block?: boolean | undefined;
27
- variant?: "fill" | "fill-light" | "outline" | "invisible" | "outline-fill" | undefined;
28
- align?: "start" | "center" | undefined;
29
- button?: HTMLButtonElement | HTMLAnchorElement | undefined;
30
- } | undefined;
1
+ import type { ComponentProps } from 'svelte';
2
+ import Button from '../Button/Button.svelte';
3
+ import Loader from './Loader.svelte';
4
+ 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> {
5
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
6
+ $$bindings?: Bindings;
7
+ } & Exports;
8
+ (internal: unknown, props: Props & {
9
+ $$events?: Events;
10
+ $$slots?: Slots;
11
+ }): Exports & {
12
+ $set?: any;
13
+ $on?: any;
31
14
  };
32
- events: {
33
- click: MouseEvent;
34
- } & {
35
- [evt: string]: CustomEvent<any>;
36
- };
37
- slots: {};
38
- };
39
- export type LoadButtonProps = typeof __propDef.props;
40
- export type LoadButtonEvents = typeof __propDef.events;
41
- export type LoadButtonSlots = typeof __propDef.slots;
42
- export default class LoadButton extends SvelteComponent<LoadButtonProps, LoadButtonEvents, LoadButtonSlots> {
15
+ z_$$bindings?: Bindings;
43
16
  }
44
- export {};
17
+ declare const LoadButton: $$__sveltets_2_IsomorphicComponent<{
18
+ text: string;
19
+ show: boolean;
20
+ loading: boolean;
21
+ height?: number;
22
+ divProps?: Record<string, any>;
23
+ loaderProps?: ComponentProps<typeof Loader>;
24
+ buttonProps?: ComponentProps<typeof Button>;
25
+ }, {
26
+ click: any;
27
+ } & {
28
+ [evt: string]: CustomEvent<any>;
29
+ }, {}, {}, "">;
30
+ type LoadButton = InstanceType<typeof LoadButton>;
31
+ export default LoadButton;