@hyvor/design 0.0.68 → 1.0.5
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/ActionList/ActionList.svelte +22 -9
- package/dist/components/ActionList/ActionList.svelte.d.ts +8 -19
- package/dist/components/ActionList/ActionListGroup.svelte +18 -8
- package/dist/components/ActionList/ActionListGroup.svelte.d.ts +8 -19
- package/dist/components/ActionList/ActionListItem.svelte +49 -25
- package/dist/components/ActionList/ActionListItem.svelte.d.ts +28 -25
- package/dist/components/ActionList/Selected.svelte +10 -4
- package/dist/components/ActionList/Selected.svelte.d.ts +6 -16
- package/dist/components/Avatar/Avatar.svelte +16 -9
- package/dist/components/Avatar/Avatar.svelte.d.ts +7 -17
- package/dist/components/Avatar/AvatarStack.svelte +14 -8
- package/dist/components/Avatar/AvatarStack.svelte.d.ts +6 -17
- package/dist/components/Base/Base.svelte +14 -6
- package/dist/components/Base/Base.svelte.d.ts +6 -17
- package/dist/components/Box/Box.svelte +10 -3
- package/dist/components/Box/Box.svelte.d.ts +7 -18
- package/dist/components/Button/Button.svelte +52 -25
- package/dist/components/Button/Button.svelte.d.ts +16 -38
- package/dist/components/Button/ButtonGroup.svelte +9 -1
- package/dist/components/Button/ButtonGroup.svelte.d.ts +5 -26
- package/dist/components/Callout/Callout.svelte +41 -20
- package/dist/components/Callout/Callout.svelte.d.ts +11 -22
- package/dist/components/Checkbox/Checkbox.svelte +58 -38
- package/dist/components/Checkbox/Checkbox.svelte.d.ts +11 -34
- package/dist/components/CodeBlock/CodeBlock.svelte +21 -11
- package/dist/components/CodeBlock/CodeBlock.svelte.d.ts +7 -16
- package/dist/components/CodeBlock/getCode.js +2 -0
- package/dist/components/ColorPicker/ColorPicker.svelte +34 -15
- package/dist/components/ColorPicker/ColorPicker.svelte.d.ts +26 -19
- package/dist/components/Dark/DarkProvider.svelte +7 -5
- package/dist/components/Dark/DarkProvider.svelte.d.ts +16 -12
- package/dist/components/Dark/DarkToggle.svelte +8 -6
- package/dist/components/Dark/DarkToggle.svelte.d.ts +16 -12
- package/dist/components/Divider/Divider.svelte +17 -6
- package/dist/components/Divider/Divider.svelte.d.ts +9 -19
- package/dist/components/Dropdown/Dropdown.svelte +33 -14
- package/dist/components/Dropdown/Dropdown.svelte.d.ts +13 -23
- package/dist/components/Dropdown/DropdownContent.svelte +124 -92
- package/dist/components/Dropdown/DropdownContent.svelte.d.ts +12 -24
- package/dist/components/FormControl/Caption.svelte +10 -3
- package/dist/components/FormControl/Caption.svelte.d.ts +7 -18
- package/dist/components/FormControl/FormControl.svelte +11 -2
- package/dist/components/FormControl/FormControl.svelte.d.ts +6 -26
- package/dist/components/FormControl/InputGroup.svelte +17 -9
- package/dist/components/FormControl/InputGroup.svelte.d.ts +7 -18
- package/dist/components/FormControl/Label.svelte +11 -2
- package/dist/components/FormControl/Label.svelte.d.ts +6 -26
- package/dist/components/FormControl/Validation.svelte +18 -9
- package/dist/components/FormControl/Validation.svelte.d.ts +8 -19
- package/dist/components/HyvorBar/BarProducts.svelte +44 -25
- package/dist/components/HyvorBar/BarSupport.svelte +165 -101
- package/dist/components/HyvorBar/BarSupport.svelte.d.ts +7 -17
- package/dist/components/HyvorBar/BarUpdates.svelte +25 -15
- package/dist/components/HyvorBar/BarUpdates.svelte.d.ts +6 -16
- package/dist/components/HyvorBar/BarUpdatesList.svelte +73 -48
- package/dist/components/HyvorBar/BarUpdatesList.svelte.d.ts +6 -16
- package/dist/components/HyvorBar/BarUser.svelte +36 -24
- package/dist/components/HyvorBar/BarUser.svelte.d.ts +5 -15
- package/dist/components/HyvorBar/BarUserPreview.svelte +2 -1
- package/dist/components/HyvorBar/BarUserPreview.svelte.d.ts +16 -12
- package/dist/components/HyvorBar/HyvorBar.svelte +69 -36
- package/dist/components/HyvorBar/HyvorBar.svelte.d.ts +7 -18
- package/dist/components/HyvorBar/bar.d.ts +2 -2
- package/dist/components/HyvorBar/img/G2.svelte.d.ts +22 -19
- package/dist/components/HyvorBar/img/Trustpilot.svelte.d.ts +22 -19
- package/dist/components/IconButton/IconButton.svelte +43 -22
- package/dist/components/IconButton/IconButton.svelte.d.ts +10 -32
- package/dist/components/IconMessage/IconMessage.svelte +111 -56
- package/dist/components/IconMessage/IconMessage.svelte.d.ts +19 -35
- package/dist/components/Internationalization/InternationalizationProvider.svelte +14 -7
- package/dist/components/Internationalization/InternationalizationProvider.svelte.d.ts +6 -17
- package/dist/components/Internationalization/LanguageToggle.svelte +73 -47
- package/dist/components/Internationalization/LanguageToggle.svelte.d.ts +10 -20
- package/dist/components/Internationalization/T.svelte +158 -114
- package/dist/components/Internationalization/T.svelte.d.ts +17 -15
- package/dist/components/Internationalization/i18n.d.ts +1 -3
- package/dist/components/Internationalization/t.d.ts +1 -2
- package/dist/components/Internationalization/types.d.ts +1 -0
- package/dist/components/Link/Link.svelte +31 -19
- package/dist/components/Link/Link.svelte.d.ts +11 -33
- package/dist/components/Loader/LoadButton.svelte +24 -9
- package/dist/components/Loader/LoadButton.svelte.d.ts +29 -42
- package/dist/components/Loader/Loader.svelte +69 -42
- package/dist/components/Loader/Loader.svelte.d.ts +15 -26
- package/dist/components/Modal/ConfirmModalProvider.svelte +28 -20
- package/dist/components/Modal/ConfirmModalProvider.svelte.d.ts +3 -14
- package/dist/components/Modal/Modal.svelte +76 -47
- package/dist/components/Modal/Modal.svelte.d.ts +32 -29
- package/dist/components/Modal/ModalFooter.svelte +14 -6
- package/dist/components/Modal/ModalFooter.svelte.d.ts +23 -18
- package/dist/components/Modal/confirm.d.ts +2 -2
- package/dist/components/Modal/modal-types.d.ts +2 -2
- package/dist/components/NavLink/NavLink.svelte +31 -18
- package/dist/components/NavLink/NavLink.svelte.d.ts +11 -32
- package/dist/components/Radio/Radio.svelte +35 -16
- package/dist/components/Radio/Radio.svelte.d.ts +10 -32
- package/dist/components/Slider/Slider.svelte +86 -36
- package/dist/components/Slider/Slider.svelte.d.ts +25 -20
- package/dist/components/SplitControl/SplitControl.svelte +27 -18
- package/dist/components/SplitControl/SplitControl.svelte.d.ts +11 -23
- package/dist/components/Switch/Switch.svelte +30 -15
- package/dist/components/Switch/Switch.svelte.d.ts +8 -30
- package/dist/components/TabNav/TabNav.svelte +29 -15
- package/dist/components/TabNav/TabNav.svelte.d.ts +7 -18
- package/dist/components/TabNav/TabNavItem.svelte +36 -15
- package/dist/components/TabNav/TabNavItem.svelte.d.ts +10 -23
- package/dist/components/Table/Table.svelte +11 -4
- package/dist/components/Table/Table.svelte.d.ts +7 -18
- package/dist/components/Table/TableRow.svelte +11 -3
- package/dist/components/Table/TableRow.svelte.d.ts +7 -18
- package/dist/components/Tag/Tag.svelte +65 -31
- package/dist/components/Tag/Tag.svelte.d.ts +16 -38
- package/dist/components/Text/Text.svelte +20 -6
- package/dist/components/Text/Text.svelte.d.ts +10 -21
- package/dist/components/TextInput/TextInput.svelte +81 -28
- package/dist/components/TextInput/TextInput.svelte.d.ts +14 -36
- package/dist/components/Textarea/Textarea.svelte +46 -24
- package/dist/components/Textarea/Textarea.svelte.d.ts +13 -37
- package/dist/components/Toast/ToastIcon.svelte +26 -15
- package/dist/components/Toast/ToastIcon.svelte.d.ts +5 -15
- package/dist/components/Toast/ToastMessage.svelte +11 -4
- package/dist/components/Toast/ToastMessage.svelte.d.ts +5 -15
- package/dist/components/Toast/ToastProvider.svelte +6 -4
- package/dist/components/Toast/ToastProvider.svelte.d.ts +16 -12
- package/dist/components/Toast/toast.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.svelte +71 -55
- package/dist/components/Tooltip/Tooltip.svelte.d.ts +35 -23
- package/dist/marketing/Container/Container.svelte +8 -2
- package/dist/marketing/Container/Container.svelte.d.ts +6 -17
- package/dist/marketing/Docs/Content/Content.svelte +41 -29
- package/dist/marketing/Docs/Content/Content.svelte.d.ts +5 -15
- package/dist/marketing/Docs/Content/DocsImage.svelte +17 -9
- package/dist/marketing/Docs/Content/DocsImage.svelte.d.ts +9 -19
- package/dist/marketing/Docs/Docs.svelte +9 -3
- package/dist/marketing/Docs/Docs.svelte.d.ts +6 -28
- package/dist/marketing/Docs/Nav/Nav.svelte +77 -50
- package/dist/marketing/Docs/Nav/Nav.svelte.d.ts +5 -15
- package/dist/marketing/Docs/Nav/NavCategory.svelte +16 -6
- package/dist/marketing/Docs/Nav/NavCategory.svelte.d.ts +8 -19
- package/dist/marketing/Docs/Nav/NavItem.svelte +10 -3
- package/dist/marketing/Docs/Nav/NavItem.svelte.d.ts +6 -17
- package/dist/marketing/Docs/Sidebar/Sidebar.svelte.d.ts +22 -19
- package/dist/marketing/Docs/Toc.svelte +49 -39
- package/dist/marketing/Docs/Toc.svelte.d.ts +3 -14
- package/dist/marketing/Document/Document.svelte +11 -4
- package/dist/marketing/Document/Document.svelte.d.ts +7 -18
- package/dist/marketing/Document/DocumentTitle.svelte +16 -5
- package/dist/marketing/Document/DocumentTitle.svelte.d.ts +9 -19
- package/dist/marketing/Footer/Footer.svelte +55 -38
- package/dist/marketing/Footer/Footer.svelte.d.ts +8 -19
- package/dist/marketing/Footer/FooterLinkList.svelte +8 -2
- package/dist/marketing/Footer/FooterLinkList.svelte.d.ts +6 -17
- package/dist/marketing/Header/Header.svelte +41 -23
- package/dist/marketing/Header/Header.svelte.d.ts +10 -21
- package/dist/marketing/Logo/LogoBlogs.svelte +6 -1
- package/dist/marketing/Logo/LogoBlogs.svelte.d.ts +5 -15
- package/dist/marketing/Logo/LogoCore.svelte +6 -1
- package/dist/marketing/Logo/LogoCore.svelte.d.ts +5 -15
- package/dist/marketing/Logo/LogoFortguard.svelte +7 -2
- package/dist/marketing/Logo/LogoFortguard.svelte.d.ts +5 -15
- package/dist/marketing/Logo/LogoTalk.svelte +6 -1
- package/dist/marketing/Logo/LogoTalk.svelte.d.ts +5 -15
- package/dist/stores/dark.d.ts +0 -1
- package/package.json +10 -10
- package/dist/components/HyvorBar/BarProducts.svelte.d.ts +0 -39
|
@@ -1,117 +1,161 @@
|
|
|
1
|
-
<script generics="StringsT extends I18nStrings">
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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 {
|
|
2
|
-
import { type
|
|
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
|
|
10
|
-
component?:
|
|
11
|
-
props?: Record<string, any
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
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>
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
{
|
|
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
|
|
23
|
-
<span class="slot start-slot"
|
|
34
|
+
{#if start}
|
|
35
|
+
<span class="slot start-slot">{@render start?.()}</span>
|
|
24
36
|
{/if}
|
|
25
37
|
|
|
26
|
-
|
|
38
|
+
{@render children?.()}
|
|
27
39
|
|
|
28
|
-
{#if
|
|
29
|
-
<span class="slot end-slot"
|
|
40
|
+
{#if end}
|
|
41
|
+
<span class="slot end-slot">{@render end?.()}</span>
|
|
30
42
|
{/if}
|
|
31
43
|
</a>
|
|
32
44
|
|
|
@@ -1,34 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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> {
|
|
1
|
+
interface Props {
|
|
2
|
+
href: string;
|
|
3
|
+
color?: 'link' | 'accent' | 'text';
|
|
4
|
+
underline?: boolean;
|
|
5
|
+
start?: import('svelte').Snippet;
|
|
6
|
+
children?: import('svelte').Snippet;
|
|
7
|
+
end?: import('svelte').Snippet;
|
|
8
|
+
[key: string]: any;
|
|
33
9
|
}
|
|
34
|
-
|
|
10
|
+
declare const Link: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type Link = ReturnType<typeof Link>;
|
|
12
|
+
export default Link;
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;
|