@goplusvn/core 0.1.16 → 0.1.17
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/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/src/ui/layout/page-tabs.tsx +38 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.17 — Fix: khôi phục nền màu tab (page-tabs) theo golden vinhhoa
|
|
4
|
+
|
|
5
|
+
Bản "neutral single-style" trước đó bỏ gradient nền tab NHƯNG vẫn để icon/chữ
|
|
6
|
+
`text-white` (thiết kế cho nền tối) → tab inactive: chữ/icon trắng trên nền xám
|
|
7
|
+
nhạt = mất màu/mờ (không lấy theo --primary). Khôi phục `getTabBackgroundColor`
|
|
8
|
+
bản golden vinhhoa: tab inactive = 1 gradient tối theo hash path (bộ 21 màu), chữ
|
|
9
|
+
`text-white`; tab active = nền trang (trắng) + viền `border-primary`. Mọi app hiện
|
|
10
|
+
màu nền tab như vinhhoa.
|
|
11
|
+
|
|
12
|
+
|
|
3
13
|
## 0.1.16 — RBAC roles route-handler factory
|
|
4
14
|
|
|
5
15
|
Slice ⑧b. Mỗi app hand-write /api/roles + /api/roles/[id] (list users[], create/update
|
package/package.json
CHANGED
|
@@ -85,10 +85,42 @@ export function PageTabs({
|
|
|
85
85
|
currentTabIndex >= 0 && currentTabIndex < sortedTabs.length - 1;
|
|
86
86
|
const hasOtherTabs = sortedTabs.length > 1;
|
|
87
87
|
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
// Nền tab: active = mặt phẳng trang (trắng); inactive = 1 gradient tối theo hash
|
|
89
|
+
// của path (bộ 21 màu cố định) — bám thiết kế golden vinhhoa (icon/chữ trắng đọc
|
|
90
|
+
// rõ trên nền tối). KHÔNG dùng --primary để mỗi tab có màu riêng, dễ phân biệt.
|
|
91
|
+
const getTabBackgroundColor = (path: string, isActive: boolean) => {
|
|
92
|
+
if (isActive) return "bg-background";
|
|
93
|
+
|
|
94
|
+
const normalizedPath = path.replace(/^\/[a-z]{2}(\/|$)/, "/");
|
|
95
|
+
const hash = normalizedPath.split("").reduce((acc, char) => {
|
|
96
|
+
return (acc << 5) - acc + char.charCodeAt(0);
|
|
97
|
+
}, 0);
|
|
98
|
+
|
|
99
|
+
const gradients = [
|
|
100
|
+
"bg-gradient-to-r from-slate-700 to-slate-600",
|
|
101
|
+
"bg-gradient-to-r from-zinc-700 to-zinc-600",
|
|
102
|
+
"bg-gradient-to-r from-stone-700 to-stone-600",
|
|
103
|
+
"bg-gradient-to-r from-neutral-700 to-neutral-600",
|
|
104
|
+
"bg-gradient-to-r from-blue-700 to-blue-600",
|
|
105
|
+
"bg-gradient-to-r from-indigo-700 to-indigo-600",
|
|
106
|
+
"bg-gradient-to-r from-purple-700 to-purple-600",
|
|
107
|
+
"bg-gradient-to-r from-violet-700 to-violet-600",
|
|
108
|
+
"bg-gradient-to-r from-fuchsia-700 to-fuchsia-600",
|
|
109
|
+
"bg-gradient-to-r from-pink-700 to-pink-600",
|
|
110
|
+
"bg-gradient-to-r from-rose-700 to-rose-600",
|
|
111
|
+
"bg-gradient-to-r from-red-700 to-red-600",
|
|
112
|
+
"bg-gradient-to-r from-orange-700 to-orange-600",
|
|
113
|
+
"bg-gradient-to-r from-amber-700 to-amber-600",
|
|
114
|
+
"bg-gradient-to-r from-yellow-700 to-yellow-600",
|
|
115
|
+
"bg-gradient-to-r from-lime-700 to-lime-600",
|
|
116
|
+
"bg-gradient-to-r from-green-700 to-green-600",
|
|
117
|
+
"bg-gradient-to-r from-emerald-700 to-emerald-600",
|
|
118
|
+
"bg-gradient-to-r from-teal-700 to-teal-600",
|
|
119
|
+
"bg-gradient-to-r from-cyan-700 to-cyan-600",
|
|
120
|
+
"bg-gradient-to-r from-sky-700 to-sky-600",
|
|
121
|
+
];
|
|
122
|
+
|
|
123
|
+
return gradients[Math.abs(hash) % gradients.length];
|
|
92
124
|
};
|
|
93
125
|
|
|
94
126
|
return (
|
|
@@ -135,11 +167,11 @@ export function PageTabs({
|
|
|
135
167
|
variant === "default" &&
|
|
136
168
|
(isActive
|
|
137
169
|
? "bg-background text-foreground border-b-2 border-primary shadow-sm shadow-primary/10 border-t border-x border-b-0 rounded-t-md -mb-px z-10"
|
|
138
|
-
: "text-
|
|
170
|
+
: "text-white hover:text-white border-b border-white/10 rounded-t-md"),
|
|
139
171
|
variant === "header" &&
|
|
140
172
|
(isActive
|
|
141
173
|
? "bg-background text-foreground border-b-2 border-primary shadow-sm shadow-primary/10 border-t border-x rounded-t-md z-10"
|
|
142
|
-
: "text-
|
|
174
|
+
: "text-white hover:text-white border-b border-white/10 rounded-t-md"),
|
|
143
175
|
!isLast &&
|
|
144
176
|
!isActive &&
|
|
145
177
|
variant === "default" &&
|