@okaapp/oka-ui-sv 0.1.1 → 0.1.2
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/core/badge/Badge.svelte +3 -2
- package/dist/components/core/badge/badge.css +8 -2
- package/dist/components/core/button/Button.svelte +2 -0
- package/dist/components/core/select/MultiSelect.svelte +3 -2
- package/dist/components/core/select/MultiSelect.svelte.d.ts +2 -1
- package/dist/components/core/select/SingleSelect.svelte +5 -3
- package/dist/components/core/select/SingleSelect.svelte.d.ts +3 -1
- package/dist/components/core/sidebar/Sidebar.svelte +2 -5
- package/dist/components/styling/oka-style-provider/oka-style.css +0 -2
- package/dist/components/styling/theme-switcher/ThemeSwitcher.svelte +1 -1
- package/dist/components/styling/theme-switcher/theme-switcher.css +0 -17
- package/package.json +1 -1
|
@@ -15,18 +15,24 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/* Sizes */
|
|
18
|
-
.badge--
|
|
18
|
+
.badge--lg {
|
|
19
19
|
padding: 8px 12px;
|
|
20
20
|
border-radius: 12px;
|
|
21
21
|
font-size: 16px;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.badge--
|
|
24
|
+
.badge--md {
|
|
25
25
|
padding: 6px 8px;
|
|
26
26
|
border-radius: 8px;
|
|
27
27
|
font-size: 14px;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
.badge--sm {
|
|
31
|
+
padding: 4px 6px;
|
|
32
|
+
border-radius: 6px;
|
|
33
|
+
font-size: 12px;
|
|
34
|
+
}
|
|
35
|
+
|
|
30
36
|
/* Colors */
|
|
31
37
|
.badge--success {
|
|
32
38
|
color: var(--content-success);
|
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
import Checkbox from "../checkbox/Checkbox.svelte";
|
|
9
9
|
|
|
10
10
|
let {
|
|
11
|
+
value = $bindable([]),
|
|
11
12
|
items = [] as SelectItem[],
|
|
12
13
|
placeholder = "Chọn ở đây",
|
|
13
14
|
...props
|
|
14
15
|
} = $props();
|
|
15
16
|
|
|
16
|
-
let value = $state<string[]>([]);
|
|
17
|
+
// let value = $state<string[]>([]);
|
|
17
18
|
const selectedLabel = $derived(
|
|
18
19
|
value.length > 0 ? `Đã chọn ${value.length}` : placeholder,
|
|
19
20
|
);
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
<CaretDown class="select-trigger-icon" />
|
|
37
38
|
</Select.Trigger>
|
|
38
39
|
<Select.Portal>
|
|
39
|
-
<Select.Content class="select-content" sideOffset={
|
|
40
|
+
<Select.Content class="select-content" sideOffset={12}>
|
|
40
41
|
<Select.ScrollUpButton class="select-scroll-button">
|
|
41
42
|
<CaretDoubleUp class="select-scroll-button-icon" />
|
|
42
43
|
</Select.ScrollUpButton>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "./select.css";
|
|
2
2
|
import type { SelectItem } from "./Types.js";
|
|
3
3
|
declare const MultiSelect: import("svelte").Component<{
|
|
4
|
+
value?: any[];
|
|
4
5
|
items?: SelectItem[];
|
|
5
6
|
placeholder?: string;
|
|
6
|
-
} & Record<string, any>, {}, "">;
|
|
7
|
+
} & Record<string, any>, {}, "value">;
|
|
7
8
|
type MultiSelect = ReturnType<typeof MultiSelect>;
|
|
8
9
|
export default MultiSelect;
|
|
@@ -8,12 +8,14 @@
|
|
|
8
8
|
import CaretDoubleDown from "phosphor-svelte/lib/CaretDoubleDown";
|
|
9
9
|
|
|
10
10
|
let {
|
|
11
|
+
value = $bindable(),
|
|
11
12
|
items = [] as SelectItem[],
|
|
12
13
|
placeholder = "Chọn ở đây",
|
|
14
|
+
class: className,
|
|
13
15
|
...props
|
|
14
16
|
} = $props();
|
|
15
17
|
|
|
16
|
-
let value = $state<string>("");
|
|
18
|
+
// let value = $state<string>("");
|
|
17
19
|
const selectedLabel = $derived(
|
|
18
20
|
value ? items.find((item) => item.value === value)?.label : placeholder,
|
|
19
21
|
);
|
|
@@ -26,14 +28,14 @@
|
|
|
26
28
|
{...props}
|
|
27
29
|
>
|
|
28
30
|
<Select.Trigger
|
|
29
|
-
class=
|
|
31
|
+
class={`select-trigger focus-override`}
|
|
30
32
|
aria-label="Chọn ở đây"
|
|
31
33
|
>
|
|
32
34
|
<span class="select-trigger-text">{selectedLabel}</span>
|
|
33
35
|
<CaretDown class="select-trigger-icon" />
|
|
34
36
|
</Select.Trigger>
|
|
35
37
|
<Select.Portal>
|
|
36
|
-
<Select.Content class="select-content" sideOffset={
|
|
38
|
+
<Select.Content class="select-content" sideOffset={12}>
|
|
37
39
|
<Select.ScrollUpButton class="select-scroll-button">
|
|
38
40
|
<CaretDoubleUp class="select-scroll-button-icon" />
|
|
39
41
|
</Select.ScrollUpButton>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import "./select.css";
|
|
2
2
|
import type { SelectItem } from "./Types.js";
|
|
3
3
|
declare const SingleSelect: import("svelte").Component<{
|
|
4
|
+
value?: any;
|
|
4
5
|
items?: SelectItem[];
|
|
5
6
|
placeholder?: string;
|
|
6
|
-
|
|
7
|
+
class: any;
|
|
8
|
+
} & Record<string, any>, {}, "value">;
|
|
7
9
|
type SingleSelect = ReturnType<typeof SingleSelect>;
|
|
8
10
|
export default SingleSelect;
|
|
@@ -11,17 +11,14 @@
|
|
|
11
11
|
|
|
12
12
|
let { items, class: className }: Props = $props();
|
|
13
13
|
|
|
14
|
-
let
|
|
15
|
-
$effect(() => {
|
|
16
|
-
activeItem = page.url.pathname;
|
|
17
|
-
});
|
|
14
|
+
let currentRoute = $derived(page.url.pathname);
|
|
18
15
|
</script>
|
|
19
16
|
|
|
20
17
|
<div class={`${className} sidebar`}>
|
|
21
18
|
{#each items as i}
|
|
22
19
|
<a
|
|
23
20
|
href={i.Route}
|
|
24
|
-
class={`sidebar-item ${i.Route
|
|
21
|
+
class={`sidebar-item ${currentRoute.startsWith(i.Route) ? "sidebar-item--active" : "sidebar-item--inactive"}`}
|
|
25
22
|
>
|
|
26
23
|
{#if i.Icon}
|
|
27
24
|
<IconContext
|
|
@@ -638,7 +638,6 @@ button {
|
|
|
638
638
|
cursor: pointer;
|
|
639
639
|
font: inherit;
|
|
640
640
|
line-height: inherit;
|
|
641
|
-
padding: 0;
|
|
642
641
|
}
|
|
643
642
|
|
|
644
643
|
button:focus {
|
|
@@ -679,7 +678,6 @@ th:not(.table-override) {
|
|
|
679
678
|
|
|
680
679
|
td:not(.table-override) {
|
|
681
680
|
height: 64px;
|
|
682
|
-
background: var(--surface-primary);
|
|
683
681
|
color: var(--content-primary);
|
|
684
682
|
overflow: hidden;
|
|
685
683
|
padding: 8px 16px 8px 16px;
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<span class="theme-switcher__label">Giao diện</span>
|
|
30
30
|
</Select.Trigger>
|
|
31
31
|
<Select.Portal>
|
|
32
|
-
<Select.Content class="theme-content" sideOffset={
|
|
32
|
+
<Select.Content class="theme-content" sideOffset={12}>
|
|
33
33
|
<Select.ScrollUpButton class="theme-scroll-button">
|
|
34
34
|
<CaretDoubleUp class="theme-scroll-button__icon" />
|
|
35
35
|
</Select.ScrollUpButton>
|
|
@@ -76,23 +76,6 @@
|
|
|
76
76
|
animation: content-out 300ms ease;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
/* Position adjustments */
|
|
80
|
-
.theme-content[data-side="bottom"] {
|
|
81
|
-
transform: translateY(4px);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.theme-content[data-side="left"] {
|
|
85
|
-
transform: translateX(-4px);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.theme-content[data-side="right"] {
|
|
89
|
-
transform: translateX(4px);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.theme-content[data-side="top"] {
|
|
93
|
-
transform: translateY(-4px);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
79
|
/* Viewport styles */
|
|
97
80
|
.theme-viewport {
|
|
98
81
|
display: flex;
|