tera-system-ui 0.0.5 → 0.0.8
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/dialog/Dialog.svelte +10 -10
- package/dist/components/dialog/dialog.scss +7 -3
- package/dist/components/language-picker-button/LanguagePickerButton.svelte +4 -2
- package/dist/components/popover-responsive/PopoverResponsive.svelte +2 -1
- package/dist/components/tera-ui-context/TeraUiContext.svelte +7 -0
- package/package.json +3 -2
|
@@ -77,17 +77,17 @@
|
|
|
77
77
|
onmousedown={handleClickOutside}
|
|
78
78
|
>
|
|
79
79
|
<button class=""></button>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
{/if}
|
|
80
|
+
{#if (closeButton)}
|
|
81
|
+
<form method="dialog">
|
|
82
|
+
<Button class="absolute right-1 top-1 [&>svg]:opacity-45 [&>svg]:hover:opacity-90 z-10" icon
|
|
83
|
+
variant="ghost"
|
|
84
|
+
size="sm">
|
|
85
|
+
<IconX/>
|
|
86
|
+
</Button>
|
|
87
|
+
</form>
|
|
88
|
+
{/if}
|
|
90
89
|
|
|
90
|
+
<div class={"dialog-box " + dialogContainer()}>
|
|
91
91
|
{#if header}
|
|
92
92
|
<header class={headerStyle()}>
|
|
93
93
|
{@render header?.()}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
.dialog-box {
|
|
2
|
-
max-height:
|
|
2
|
+
max-height: calc(100svh - 1rem);
|
|
3
3
|
overflow-y: auto;
|
|
4
4
|
overscroll-behavior: contain;
|
|
5
5
|
display: grid;
|
|
6
6
|
grid-template-rows: auto 1fr auto;
|
|
7
|
-
@apply bg-neutral-token-1 relative;
|
|
7
|
+
@apply bg-neutral-token-1 relative top-0 left-0 bottom-0;
|
|
8
8
|
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -13,12 +13,16 @@ dialog, dialog:modal {
|
|
|
13
13
|
max-height: 100svh;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
dialog[open] {
|
|
17
|
+
@apply grid place-content-center grid-cols-1;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
dialog {
|
|
17
21
|
&[data-position="top"] {
|
|
18
22
|
position: fixed;
|
|
19
23
|
top: 0;
|
|
20
24
|
left: 50%;
|
|
21
|
-
transform: translateX(-50%) translateY(
|
|
25
|
+
transform: translateX(-50%) translateY(0.5rem);
|
|
22
26
|
margin: 0;
|
|
23
27
|
}
|
|
24
28
|
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import {Dialog} from "../dialog";
|
|
5
5
|
import IconCheck from "../icons/IconCheck.svelte";
|
|
6
6
|
import {getGlobalContext} from "../tera-ui-context/global-context";
|
|
7
|
+
import * as m from '../../paraglide/messages.js'
|
|
8
|
+
import {languageTag} from "../../paraglide/runtime";
|
|
7
9
|
|
|
8
10
|
let {
|
|
9
11
|
children,
|
|
@@ -81,9 +83,9 @@
|
|
|
81
83
|
<img class="size-6 flag-img" src={getFlagUrl(currentLangItem.flag)} alt={currentLangItem.flag}>
|
|
82
84
|
</button>
|
|
83
85
|
|
|
84
|
-
<Dialog bind:open={openDialog} class="text-neutral-token-13" size="xs">
|
|
86
|
+
<Dialog bind:open={openDialog} class="text-neutral-token-13" size="xs" staticRender>
|
|
85
87
|
{#snippet header()}
|
|
86
|
-
|
|
88
|
+
{m.text_select_language()}
|
|
87
89
|
{/snippet}
|
|
88
90
|
<div class="grid grid-cols-1 mx-auto gap-2">
|
|
89
91
|
{#each LANGUAGE_LIST as lang}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import {type TeraUiContextProps} from "./TeraUiContext";
|
|
3
3
|
import {setGlobalContext} from "./global-context";
|
|
4
|
+
import {setLanguageTag} from "../../paraglide/runtime";
|
|
5
|
+
import * as m from '../../paraglide/messages.js'
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
let {
|
|
@@ -16,6 +18,11 @@
|
|
|
16
18
|
language,
|
|
17
19
|
...props
|
|
18
20
|
})
|
|
21
|
+
|
|
22
|
+
setLanguageTag(language)
|
|
23
|
+
console.log('setLanguageTag', language)
|
|
24
|
+
console.log('test translate', m.text_select_language())
|
|
25
|
+
|
|
19
26
|
</script>
|
|
20
27
|
|
|
21
28
|
{@render children()}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tera-system-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build && npm run package",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
11
11
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
12
12
|
"storybook": "storybook dev -p 6006",
|
|
13
|
-
"build-storybook": "storybook build"
|
|
13
|
+
"build-storybook": "storybook build",
|
|
14
|
+
"lang-compile": "paraglide-js compile --project ./project.inlang --outdir ./src/lib/paraglide"
|
|
14
15
|
},
|
|
15
16
|
"bin": {
|
|
16
17
|
"ui": "./scripts/add-component-template.js",
|