@starasia/admin 14.30.0 → 14.32.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/dist/components/AppLayout/NavRail.d.ts +39 -0
- package/dist/components/AppLayout/index.d.ts +13 -1
- package/dist/index.cjs.js +18 -18
- package/dist/index.es.js +3210 -2855
- package/dist/index.umd.js +16 -16
- package/dist/types/menu.d.ts +51 -0
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SidebarRailAction, SidebarRailItem } from '../../types';
|
|
3
|
+
|
|
4
|
+
/** Lebar kolom rail (desktop). Cukup untuk label ±8 karakter di bawah ikon. */
|
|
5
|
+
export declare const NAV_RAIL_WIDTH = "4.5rem";
|
|
6
|
+
/**
|
|
7
|
+
* Lebar rail tanpa label (`showLabels: false`) = tinggi header, sama dengan
|
|
8
|
+
* icon rail lama — sel logo tetap bujur sangkar.
|
|
9
|
+
*/
|
|
10
|
+
export declare const NAV_RAIL_COMPACT_WIDTH = "var(--app-header-height, 4rem)";
|
|
11
|
+
export declare const navRailWidth: (showLabels: boolean) => "var(--app-header-height, 4rem)" | "4.5rem";
|
|
12
|
+
export interface NavRailProps {
|
|
13
|
+
items: SidebarRailItem[];
|
|
14
|
+
bottomItems?: SidebarRailAction[];
|
|
15
|
+
activeKey: string;
|
|
16
|
+
onSelect: (key: string) => void;
|
|
17
|
+
onAction: (item: SidebarRailAction) => void;
|
|
18
|
+
logo: string;
|
|
19
|
+
/** Panel sidebar sedang tersembunyi (hanya rail yang tampil). */
|
|
20
|
+
panelCollapsed: boolean;
|
|
21
|
+
onExpandPanel: () => void;
|
|
22
|
+
/** @default true */
|
|
23
|
+
showLabels?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Rail navigasi desktop — kolom ikon di kiri panel sidebar. Dirakit oleh
|
|
27
|
+
* `AppLayout` saat prop `rail` diisi; consumer tidak merender ini sendiri.
|
|
28
|
+
*/
|
|
29
|
+
export declare function NavRail({ items, bottomItems, activeKey, onSelect, onAction, logo, panelCollapsed, onExpandPanel, showLabels, }: NavRailProps): React.JSX.Element;
|
|
30
|
+
export interface MobileRailTabsProps {
|
|
31
|
+
items: SidebarRailItem[];
|
|
32
|
+
activeKey: string;
|
|
33
|
+
onSelect: (key: string) => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Pengganti rail di mobile: baris tab horizontal (scroll) di atas menu drawer.
|
|
37
|
+
* Kolom rail vertikal terlalu memakan lebar drawer di layar kecil.
|
|
38
|
+
*/
|
|
39
|
+
export declare function MobileRailTabs({ items, activeKey, onSelect }: MobileRailTabsProps): React.JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
2
|
import { IconName } from '@starasia/icon';
|
|
3
3
|
import { SidebarHeaderSlotChildren } from '../SidebarHeaderSlot';
|
|
4
|
+
import { SidebarRailConfig } from '../../types';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Item tombol di profile menu body. Multiple item bisa di-pass via
|
|
@@ -72,6 +73,17 @@ interface AppLayoutProps {
|
|
|
72
73
|
* @default true
|
|
73
74
|
*/
|
|
74
75
|
resizableSidebar?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Rail navigasi: kolom ikon di kiri panel sidebar (pola ClickUp/Slack).
|
|
78
|
+
* Item rail memfilter group yang tampil di panel lewat `groupIds`; item tanpa
|
|
79
|
+
* `groupIds` menampilkan semua group. Item aktif mengikuti route — buka URL
|
|
80
|
+
* yang group-nya ada di item lain dan rail pindah sendiri.
|
|
81
|
+
*
|
|
82
|
+
* Saat aktif: collapse menyembunyikan panel (rail tetap), filter
|
|
83
|
+
* `useModuleSelection` diabaikan, dan di mobile rail jadi tab horizontal di
|
|
84
|
+
* drawer. Tanpa prop ini layout sama persis dengan sebelumnya.
|
|
85
|
+
*/
|
|
86
|
+
rail?: SidebarRailConfig;
|
|
75
87
|
}
|
|
76
88
|
/**
|
|
77
89
|
* AppLayout - Main application layout component based on workspace pattern
|
|
@@ -86,5 +98,5 @@ interface AppLayoutProps {
|
|
|
86
98
|
* - Embed mode for iframes
|
|
87
99
|
* - Header actions slot for caller-composed controls (e.g. ModuleSwitcher)
|
|
88
100
|
*/
|
|
89
|
-
export declare function AppLayout({ children, headerLeftSlot, profile, isLoadingProfile, onLogout, isLoggingOut, loadingComponent, sidebarHeaderContent, headerActions, profileRole, profileMenuButtons, profileMenuItems, logoutButton, resizableSidebar, }: AppLayoutProps): React.JSX.Element;
|
|
101
|
+
export declare function AppLayout({ children, headerLeftSlot, profile, isLoadingProfile, onLogout, isLoggingOut, loadingComponent, sidebarHeaderContent, headerActions, profileRole, profileMenuButtons, profileMenuItems, logoutButton, resizableSidebar, rail, }: AppLayoutProps): React.JSX.Element;
|
|
90
102
|
export {};
|