@umituz/web-dashboard 7.1.0 → 7.2.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/web-dashboard",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "Installable app skeleton for the fleet — layouts, analytics (dependency-free SVG charts), calendar, onboarding flow permissions/module registry; udb-* stylesheet on design-system tokens",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -136,3 +136,43 @@ describe("DashboardLayout (command palette)", () => {
|
|
|
136
136
|
expect(await screen.findByRole("dialog")).toBeTruthy();
|
|
137
137
|
});
|
|
138
138
|
});
|
|
139
|
+
|
|
140
|
+
describe("DashboardSidebar (secondaryLabel)", () => {
|
|
141
|
+
const secondaryConfig: DashboardLayoutConfig = {
|
|
142
|
+
sidebarGroups: [
|
|
143
|
+
{
|
|
144
|
+
title: "Main",
|
|
145
|
+
items: [{ path: "/", label: "Home", icon: Home, end: false, secondaryLabel: "오늘" }],
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
brandName: "Test",
|
|
149
|
+
defaultTitle: "Workspace",
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
it("renders the secondary label next to the item label", () => {
|
|
153
|
+
renderAt("/", { config: secondaryConfig });
|
|
154
|
+
const link = screen.getByRole("link", { name: /home/i });
|
|
155
|
+
expect(link.textContent).toContain("오늘");
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("hides the secondary label when the sidebar is collapsed", () => {
|
|
159
|
+
window.localStorage.setItem("udb-collapsed-test", "1");
|
|
160
|
+
render(
|
|
161
|
+
<MemoryRouter initialEntries={["/"]}>
|
|
162
|
+
<Routes>
|
|
163
|
+
<Route
|
|
164
|
+
path="*"
|
|
165
|
+
element={
|
|
166
|
+
<DashboardLayout config={secondaryConfig} labels={labels} collapsedStorageKey="udb-collapsed-test" />
|
|
167
|
+
}
|
|
168
|
+
>
|
|
169
|
+
<Route path="*" element={<div>outlet-content</div>} />
|
|
170
|
+
</Route>
|
|
171
|
+
</Routes>
|
|
172
|
+
</MemoryRouter>
|
|
173
|
+
);
|
|
174
|
+
const link = screen.getByRole("link", { name: /home/i });
|
|
175
|
+
expect(link.textContent).not.toContain("오늘");
|
|
176
|
+
window.localStorage.removeItem("udb-collapsed-test");
|
|
177
|
+
});
|
|
178
|
+
});
|
|
@@ -136,6 +136,10 @@ export const DashboardSidebar = ({
|
|
|
136
136
|
<item.icon className="udb-sidebar__item-icon" />
|
|
137
137
|
{!collapsed && <span>{item.label}</span>}
|
|
138
138
|
|
|
139
|
+
{!collapsed && item.secondaryLabel && (
|
|
140
|
+
<span className="udb-sidebar__item-secondary">{item.secondaryLabel}</span>
|
|
141
|
+
)}
|
|
142
|
+
|
|
139
143
|
{!collapsed && item.badge !== undefined && item.badge !== "" && (
|
|
140
144
|
<span className="udb-sidebar__item-badge">{item.badge}</span>
|
|
141
145
|
|
package/src/styles/chrome.css
CHANGED
|
@@ -458,12 +458,20 @@
|
|
|
458
458
|
z-index: 50;
|
|
459
459
|
animation: udb-pop 0.18s ease;
|
|
460
460
|
}
|
|
461
|
-
/* Radix-portal variant: positioning/animation come from the dropdown primitive. */
|
|
462
461
|
.udb-menu--pop {
|
|
463
462
|
top: auto;
|
|
464
463
|
right: auto;
|
|
465
464
|
animation: none;
|
|
466
465
|
}
|
|
466
|
+
.udb-sidebar__item-secondary {
|
|
467
|
+
margin-left: auto;
|
|
468
|
+
font-size: 11px;
|
|
469
|
+
font-weight: var(--font-weight-normal);
|
|
470
|
+
color: var(--udb-sidebar-muted);
|
|
471
|
+
}
|
|
472
|
+
.udb-sidebar__item-secondary + .udb-sidebar__item-badge {
|
|
473
|
+
margin-left: var(--udb-space-2);
|
|
474
|
+
}
|
|
467
475
|
.udb-sidebar__item-badge {
|
|
468
476
|
margin-left: auto;
|
|
469
477
|
padding: 1px var(--udb-space-2);
|
|
@@ -529,8 +537,6 @@
|
|
|
529
537
|
color: var(--color-muted-foreground);
|
|
530
538
|
font-size: var(--udb-font-size-sm);
|
|
531
539
|
}
|
|
532
|
-
|
|
533
|
-
/* — Skip link: first focusable element, visible only when focused — */
|
|
534
540
|
.udb-skip-link {
|
|
535
541
|
position: fixed;
|
|
536
542
|
top: var(--udb-space-2);
|
|
@@ -549,12 +555,9 @@
|
|
|
549
555
|
.udb-skip-link:focus {
|
|
550
556
|
transform: translateY(0);
|
|
551
557
|
}
|
|
552
|
-
/* Programmatic focus (skip target) shows no ring — the jump itself is the cue. */
|
|
553
558
|
.udb-layout__content:focus {
|
|
554
559
|
outline: none;
|
|
555
560
|
}
|
|
556
|
-
|
|
557
|
-
/* Scroll lock applied to <html> while the mobile drawer is open. */
|
|
558
561
|
.udb-scroll-lock {
|
|
559
562
|
overflow: hidden;
|
|
560
563
|
}
|