@starasia/admin 12.24.0 → 12.26.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/index.d.ts +10 -1
- package/dist/entries/App/sidebar.d.ts +29 -1
- package/dist/index.cjs.js +18 -18
- package/dist/index.es.js +3077 -2961
- package/dist/index.umd.js +16 -16
- package/package.json +2 -2
|
@@ -62,6 +62,15 @@ interface AppLayoutProps {
|
|
|
62
62
|
* bertanggung jawab penuh atas footer & handler logout.
|
|
63
63
|
*/
|
|
64
64
|
logoutButton?: ReactNode;
|
|
65
|
+
/**
|
|
66
|
+
* Enable drag-to-resize on the (expanded, desktop) sidebar. A handle on the
|
|
67
|
+
* right edge lets the user drag the width; the chosen width persists via
|
|
68
|
+
* `SidebarProvider` (localStorage). Dragging below the snap threshold
|
|
69
|
+
* collapses the sidebar to its icon rail. Configure bounds via
|
|
70
|
+
* `SidebarProvider` props (`defaultWidth`, `minWidth`, `maxWidth`).
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
resizableSidebar?: boolean;
|
|
65
74
|
}
|
|
66
75
|
/**
|
|
67
76
|
* AppLayout - Main application layout component based on workspace pattern
|
|
@@ -76,5 +85,5 @@ interface AppLayoutProps {
|
|
|
76
85
|
* - Embed mode for iframes
|
|
77
86
|
* - Header actions slot for caller-composed controls (e.g. ModuleSwitcher)
|
|
78
87
|
*/
|
|
79
|
-
export declare function AppLayout({ children, headerLeftSlot, profile, isLoadingProfile, onLogout, isLoggingOut, loadingComponent, sidebarHeaderContent, headerActions, profileRole, profileMenuButtons, profileMenuItems, logoutButton, }: AppLayoutProps): React.JSX.Element;
|
|
88
|
+
export declare function AppLayout({ children, headerLeftSlot, profile, isLoadingProfile, onLogout, isLoggingOut, loadingComponent, sidebarHeaderContent, headerActions, profileRole, profileMenuButtons, profileMenuItems, logoutButton, resizableSidebar, }: AppLayoutProps): React.JSX.Element;
|
|
80
89
|
export {};
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { default as React, PropsWithChildren } from 'react';
|
|
2
2
|
|
|
3
|
+
/** Default expanded sidebar width in px (16.375rem). */
|
|
4
|
+
export declare const SIDEBAR_DEFAULT_WIDTH = 262;
|
|
5
|
+
/**
|
|
6
|
+
* Smallest draggable expanded width in px. Equal to the default — the sidebar
|
|
7
|
+
* can be dragged WIDER than its default, never narrower. (To collapse, use the
|
|
8
|
+
* toggle or drag past the snap threshold.)
|
|
9
|
+
*/
|
|
10
|
+
export declare const SIDEBAR_MIN_WIDTH = 262;
|
|
11
|
+
/** Largest draggable expanded width in px. */
|
|
12
|
+
export declare const SIDEBAR_MAX_WIDTH = 480;
|
|
3
13
|
export interface SidebarContextValue {
|
|
4
14
|
/** Desktop sidebar collapsed (narrow rail) state. */
|
|
5
15
|
collapsed: boolean;
|
|
@@ -11,6 +21,16 @@ export interface SidebarContextValue {
|
|
|
11
21
|
collapse: () => void;
|
|
12
22
|
/** Force-expand the desktop sidebar to full width. */
|
|
13
23
|
expand: () => void;
|
|
24
|
+
/** Current expanded sidebar width in px (drag-resizable, persisted). */
|
|
25
|
+
width: number;
|
|
26
|
+
/** Set the expanded width (px); auto-clamped to [minWidth, maxWidth] + persisted. */
|
|
27
|
+
setWidth: (value: number | ((prev: number) => number)) => void;
|
|
28
|
+
/** Reset the expanded width back to the default. */
|
|
29
|
+
resetWidth: () => void;
|
|
30
|
+
/** Smallest allowed expanded width (px). */
|
|
31
|
+
minWidth: number;
|
|
32
|
+
/** Largest allowed expanded width (px). */
|
|
33
|
+
maxWidth: number;
|
|
14
34
|
/** Mobile drawer open state (sidebar slides over the content). */
|
|
15
35
|
mobileOpen: boolean;
|
|
16
36
|
/** Set the mobile drawer open state directly (boolean or updater fn). */
|
|
@@ -25,6 +45,14 @@ export interface SidebarContextValue {
|
|
|
25
45
|
export interface SidebarProviderProps extends PropsWithChildren {
|
|
26
46
|
/** Initial desktop collapsed state. @default false */
|
|
27
47
|
defaultCollapsed?: boolean;
|
|
48
|
+
/** Default expanded width in px, used before the user drags. @default 262 */
|
|
49
|
+
defaultWidth?: number;
|
|
50
|
+
/** Smallest draggable expanded width in px. @default 200 */
|
|
51
|
+
minWidth?: number;
|
|
52
|
+
/** Largest draggable expanded width in px. @default 480 */
|
|
53
|
+
maxWidth?: number;
|
|
54
|
+
/** localStorage key the chosen width is persisted under. @default "sa-sidebar-width" */
|
|
55
|
+
widthStorageKey?: string;
|
|
28
56
|
}
|
|
29
57
|
/**
|
|
30
58
|
* Holds the AppLayout sidebar's collapse/expand (desktop) and drawer (mobile)
|
|
@@ -32,7 +60,7 @@ export interface SidebarProviderProps extends PropsWithChildren {
|
|
|
32
60
|
* instead of prop-drilling. Mounted automatically by `<App>`, alongside
|
|
33
61
|
* `SidebarBadgesProvider` — consumers don't need to render it themselves.
|
|
34
62
|
*/
|
|
35
|
-
export declare const SidebarProvider: ({ children, defaultCollapsed, }: SidebarProviderProps) => React.JSX.Element;
|
|
63
|
+
export declare const SidebarProvider: ({ children, defaultCollapsed, defaultWidth, minWidth, maxWidth, widthStorageKey, }: SidebarProviderProps) => React.JSX.Element;
|
|
36
64
|
/**
|
|
37
65
|
* Read & control the AppLayout sidebar.
|
|
38
66
|
*
|