@okaapp/oka-ui-sv 0.4.5 → 0.4.7
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/LICENSE +0 -0
- package/README.md +0 -0
- package/dist/assets/fonts/dm_serif_display/DMSerifDisplay-Regular.ttf +0 -0
- package/dist/assets/fonts/inter/Inter-Italic-VariableFont_opsz,wght.ttf +0 -0
- package/dist/assets/fonts/inter/Inter-VariableFont_opsz,wght.ttf +0 -0
- package/dist/components/aaengine-set/auto-buton/auto-button.css +0 -0
- package/dist/components/aaengine-set/engine-orb/engine-orb.css +0 -0
- package/dist/components/core/avatar/avatar.css +0 -0
- package/dist/components/core/badge/badge.css +0 -0
- package/dist/components/core/button/Button.svelte +19 -4
- package/dist/components/core/button/button.css +0 -0
- package/dist/components/core/checkbox/checkbox.css +0 -0
- package/dist/components/core/dialog/dialog.css +0 -0
- package/dist/components/core/input/input.css +1 -1
- package/dist/components/core/loading/loading.css +0 -0
- package/dist/components/core/pagination/pagination.css +0 -0
- package/dist/components/core/pin-input/pin-input.css +0 -0
- package/dist/components/core/select/select.css +1 -2
- package/dist/components/core/separator/separator.css +0 -0
- package/dist/components/core/sidebar/sidebar.css +0 -0
- package/dist/components/core/tooltips/tooltips.css +0 -0
- package/dist/components/styling/oka-style-provider/oka-style.css +0 -0
- package/dist/components/styling/theme-switcher/ThemeSwitcher.svelte +19 -5
- package/dist/components/styling/theme-switcher/ThemeSwitcher.svelte.d.ts +4 -1
- package/dist/components/styling/theme-switcher/Themes.d.ts +2 -0
- package/dist/components/styling/theme-switcher/Themes.js +14 -0
- package/dist/components/styling/theme-switcher/theme-switcher.css +0 -0
- package/package.json +1 -1
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import "./button.css";
|
|
3
3
|
import { Button } from "bits-ui";
|
|
4
|
+
import { IconContext } from "phosphor-svelte";
|
|
4
5
|
|
|
5
6
|
let {
|
|
6
7
|
ref = $bindable(null),
|
|
@@ -18,9 +19,15 @@
|
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
const sizes = {
|
|
21
|
-
lg: "height: 48px; padding: 12px; font-size: 16px;",
|
|
22
|
-
md: "height: 40px; padding: 8px; font-size: 14px;",
|
|
23
|
-
sm: "height: 36px; padding: 6px 8px; font-size: 12px;",
|
|
22
|
+
lg: "height: 48px; padding: 12px 16px; font-size: 16px; gap: 8px;",
|
|
23
|
+
md: "height: 40px; padding: 12px 8px; font-size: 14px; gap: 8px;",
|
|
24
|
+
sm: "height: 36px; padding: 6px 8px; font-size: 12px; gap: 4px;",
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const iconSizes = {
|
|
28
|
+
lg: 24,
|
|
29
|
+
md: 20,
|
|
30
|
+
sm: 16,
|
|
24
31
|
};
|
|
25
32
|
</script>
|
|
26
33
|
|
|
@@ -30,5 +37,13 @@
|
|
|
30
37
|
{...props}
|
|
31
38
|
bind:ref
|
|
32
39
|
>
|
|
33
|
-
|
|
40
|
+
<IconContext
|
|
41
|
+
values={{
|
|
42
|
+
size: sizes[size as keyof typeof iconSizes],
|
|
43
|
+
mirrored: false,
|
|
44
|
+
weight: "regular",
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
{@render children?.()}
|
|
48
|
+
</IconContext>
|
|
34
49
|
</Button.Root>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
currentTheme = savedTheme;
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
+
type Props = {
|
|
19
|
+
lang?: "vi" | "en";
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
let { lang = "vi" }: Props = $props();
|
|
23
|
+
|
|
18
24
|
function setTheme(v: string) {
|
|
19
25
|
document.body.classList.remove(currentTheme);
|
|
20
26
|
document.body.classList.add(v);
|
|
@@ -24,9 +30,11 @@
|
|
|
24
30
|
</script>
|
|
25
31
|
|
|
26
32
|
<Select.Root type="single" onValueChange={setTheme} value={currentTheme}>
|
|
27
|
-
<Select.Trigger class="theme-switcher"
|
|
33
|
+
<Select.Trigger class="theme-switcher">
|
|
28
34
|
<Palette class="theme-switcher__icon" />
|
|
29
|
-
<span class="theme-switcher__label"
|
|
35
|
+
<span class="theme-switcher__label"
|
|
36
|
+
>{lang === "vi" ? "Giao diện" : "Themes"}</span
|
|
37
|
+
>
|
|
30
38
|
</Select.Trigger>
|
|
31
39
|
<Select.Portal>
|
|
32
40
|
<Select.Content class="theme-content" sideOffset={12}>
|
|
@@ -47,8 +55,12 @@
|
|
|
47
55
|
{#each themeGroup.Themes as theme}
|
|
48
56
|
<Select.Item
|
|
49
57
|
value={theme.ClassName}
|
|
50
|
-
label={
|
|
51
|
-
|
|
58
|
+
label={lang === "vi"
|
|
59
|
+
? theme.DisplayName
|
|
60
|
+
: theme.DisplayNameEng}
|
|
61
|
+
aria-label={lang === "vi"
|
|
62
|
+
? theme.DisplayName
|
|
63
|
+
: theme.DisplayNameEng}
|
|
52
64
|
class="theme-item"
|
|
53
65
|
>
|
|
54
66
|
{#if theme.DisplayImage}
|
|
@@ -65,7 +77,9 @@
|
|
|
65
77
|
{:else}
|
|
66
78
|
<Palette class="theme-item__image" />
|
|
67
79
|
{/if}
|
|
68
|
-
{
|
|
80
|
+
{lang === "vi"
|
|
81
|
+
? theme.DisplayName
|
|
82
|
+
: theme.DisplayNameEng}
|
|
69
83
|
</Select.Item>
|
|
70
84
|
{/each}
|
|
71
85
|
</div>
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import "./theme-switcher.css";
|
|
2
|
-
|
|
2
|
+
type Props = {
|
|
3
|
+
lang?: "vi" | "en";
|
|
4
|
+
};
|
|
5
|
+
declare const ThemeSwitcher: import("svelte").Component<Props, {}, "">;
|
|
3
6
|
type ThemeSwitcher = ReturnType<typeof ThemeSwitcher>;
|
|
4
7
|
export default ThemeSwitcher;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
type Theme = {
|
|
2
2
|
ClassName: string;
|
|
3
3
|
DisplayName: string;
|
|
4
|
+
DisplayNameEng: string;
|
|
4
5
|
DisplayImage?: string;
|
|
5
6
|
MainAccent?: string;
|
|
6
7
|
};
|
|
7
8
|
type ThemeGroup = {
|
|
8
9
|
Name: string;
|
|
9
10
|
DisplayName: string;
|
|
11
|
+
DisplayNameEng: string;
|
|
10
12
|
Themes: Theme[];
|
|
11
13
|
};
|
|
12
14
|
export declare const Themes: ThemeGroup[];
|
|
@@ -2,20 +2,24 @@ export const Themes = [
|
|
|
2
2
|
{
|
|
3
3
|
Name: "light",
|
|
4
4
|
DisplayName: "Giao diện sáng",
|
|
5
|
+
DisplayNameEng: "Light interfaces",
|
|
5
6
|
Themes: [
|
|
6
7
|
{
|
|
7
8
|
ClassName: "default-light",
|
|
8
9
|
DisplayName: "Appta sáng",
|
|
10
|
+
DisplayNameEng: "Default light",
|
|
9
11
|
MainAccent: "#58C4F5",
|
|
10
12
|
},
|
|
11
13
|
{
|
|
12
14
|
ClassName: "neutral-light",
|
|
13
15
|
DisplayName: "Trung tính sáng",
|
|
16
|
+
DisplayNameEng: "Neutral light",
|
|
14
17
|
MainAccent: "#70707b",
|
|
15
18
|
},
|
|
16
19
|
{
|
|
17
20
|
ClassName: "nord-light",
|
|
18
21
|
DisplayName: "Cực bắc sáng",
|
|
22
|
+
DisplayNameEng: "Nord light",
|
|
19
23
|
MainAccent: "#88C0D0",
|
|
20
24
|
},
|
|
21
25
|
]
|
|
@@ -23,20 +27,24 @@ export const Themes = [
|
|
|
23
27
|
{
|
|
24
28
|
Name: "dark",
|
|
25
29
|
DisplayName: "Giao diện tối",
|
|
30
|
+
DisplayNameEng: "Dark interfaces",
|
|
26
31
|
Themes: [
|
|
27
32
|
{
|
|
28
33
|
ClassName: "default-dark",
|
|
29
34
|
DisplayName: "Appta tối",
|
|
35
|
+
DisplayNameEng: "Default dark",
|
|
30
36
|
MainAccent: "#23598E",
|
|
31
37
|
},
|
|
32
38
|
{
|
|
33
39
|
ClassName: "neutral-dark",
|
|
34
40
|
DisplayName: "Trung tính tối",
|
|
41
|
+
DisplayNameEng: "Neutral dark",
|
|
35
42
|
MainAccent: "#26262A",
|
|
36
43
|
},
|
|
37
44
|
{
|
|
38
45
|
ClassName: "nord-dark",
|
|
39
46
|
DisplayName: "Cực bắc tối",
|
|
47
|
+
DisplayNameEng: "Nord dark",
|
|
40
48
|
MainAccent: "#4C566A",
|
|
41
49
|
},
|
|
42
50
|
]
|
|
@@ -44,30 +52,36 @@ export const Themes = [
|
|
|
44
52
|
{
|
|
45
53
|
Name: "feng-shui",
|
|
46
54
|
DisplayName: "Phong thủy",
|
|
55
|
+
DisplayNameEng: "Fengshui Sets",
|
|
47
56
|
Themes: [
|
|
48
57
|
{
|
|
49
58
|
ClassName: "fengshui-kim",
|
|
50
59
|
DisplayName: "Mệnh Kim",
|
|
60
|
+
DisplayNameEng: "Metal",
|
|
51
61
|
MainAccent: "#dfa30a",
|
|
52
62
|
},
|
|
53
63
|
{
|
|
54
64
|
ClassName: "fengshui-moc",
|
|
55
65
|
DisplayName: "Mệnh Mộc",
|
|
66
|
+
DisplayNameEng: "Wood",
|
|
56
67
|
MainAccent: "#89c014",
|
|
57
68
|
},
|
|
58
69
|
{
|
|
59
70
|
ClassName: "fengshui-thuy",
|
|
60
71
|
DisplayName: "Mệnh Thủy",
|
|
72
|
+
DisplayNameEng: "Water",
|
|
61
73
|
MainAccent: "#0E93D3",
|
|
62
74
|
},
|
|
63
75
|
{
|
|
64
76
|
ClassName: "fengshui-hoa",
|
|
65
77
|
DisplayName: "Mệnh Hỏa",
|
|
78
|
+
DisplayNameEng: "Fire",
|
|
66
79
|
MainAccent: "#FF6B3E",
|
|
67
80
|
},
|
|
68
81
|
{
|
|
69
82
|
ClassName: "fengshui-tho",
|
|
70
83
|
DisplayName: "Mệnh Thổ",
|
|
84
|
+
DisplayNameEng: "Earth",
|
|
71
85
|
MainAccent: "#A26D4B",
|
|
72
86
|
},
|
|
73
87
|
]
|
|
File without changes
|