@starasia/admin 1.2.4 → 1.2.5
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 +34 -0
- package/dist/components/ModuleSwitcherModal/index.d.ts +15 -0
- package/dist/components/SidebarHeaderSlot/index.d.ts +31 -0
- package/dist/components/index.d.ts +3 -4
- package/dist/entries/App/context.d.ts +12 -10
- package/dist/entries/App/hooks.d.ts +1 -1
- package/dist/entries/App/index.d.ts +9 -11
- package/dist/hooks/useDynamicTitle.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +4198 -4980
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/menu.d.ts +29 -0
- package/package.json +1 -1
- package/dist/components/ContentLayout/index.d.ts +0 -10
- package/dist/components/ContentLayoutV2/index.d.ts +0 -10
- package/dist/components/DashboardLayout/index.d.ts +0 -34
- package/dist/components/Header/MenuSelectButton.d.ts +0 -16
- package/dist/components/Header/MobileBottomDrawer.d.ts +0 -9
- package/dist/components/Header/PhotoProfile.d.ts +0 -11
- package/dist/components/Header/hooks.d.ts +0 -4
- package/dist/components/Header/index.d.ts +0 -37
- package/dist/components/HeaderV2/components/PhotoProfile.d.ts +0 -11
- package/dist/components/HeaderV2/components/UserProfile.d.ts +0 -9
- package/dist/components/HeaderV2/hooks.d.ts +0 -4
- package/dist/components/HeaderV2/index.d.ts +0 -6
- package/dist/components/Sidebar/components/Group.d.ts +0 -9
- package/dist/components/Sidebar/components/Item.d.ts +0 -13
- package/dist/components/Sidebar/components/Provider.d.ts +0 -5
- package/dist/components/Sidebar/components/Wrapper.d.ts +0 -10
- package/dist/components/Sidebar/context.d.ts +0 -32
- package/dist/components/Sidebar/hooks.d.ts +0 -4
- package/dist/components/Sidebar/index.d.ts +0 -15
- package/dist/components/Sidebar/types.d.ts +0 -18
- package/dist/components/SidebarV2/components/Group.d.ts +0 -7
- package/dist/components/SidebarV2/components/Item.d.ts +0 -7
- package/dist/components/SidebarV2/components/Wrapper.d.ts +0 -7
- package/dist/components/SidebarV2/index.d.ts +0 -7
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface AppLayoutProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
profile?: {
|
|
6
|
+
name: string;
|
|
7
|
+
email: string;
|
|
8
|
+
};
|
|
9
|
+
isLoadingProfile?: boolean;
|
|
10
|
+
onLogout: () => void;
|
|
11
|
+
headerRight?: ReactNode;
|
|
12
|
+
isLoggingOut?: boolean;
|
|
13
|
+
loadingComponent?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Content untuk sidebar header slot (dibawah logo)
|
|
16
|
+
* Dapat berupa: Organization Menu, User Switcher, Custom Component, atau kombinasinya
|
|
17
|
+
*/
|
|
18
|
+
sidebarHeaderContent?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* AppLayout - Main application layout component based on workspace pattern
|
|
22
|
+
* Features:
|
|
23
|
+
* - Responsive sidebar with collapse/expand (mobile: full-width + overlay)
|
|
24
|
+
* - Accordion menu items with auto-expansion
|
|
25
|
+
* - Sidebar scroll position persistence
|
|
26
|
+
* - Module switcher modal with localStorage
|
|
27
|
+
* - Settings shortcuts dropdown
|
|
28
|
+
* - User profile & logout dialog
|
|
29
|
+
* - Mobile hamburger menu
|
|
30
|
+
* - Loading overlay support
|
|
31
|
+
* - Embed mode for iframes
|
|
32
|
+
*/
|
|
33
|
+
export declare function AppLayout({ children, headerRight, profile, isLoadingProfile, onLogout, isLoggingOut, loadingComponent, sidebarHeaderContent, }: AppLayoutProps): React.JSX.Element;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SidebarMenus } from '../../types';
|
|
3
|
+
|
|
4
|
+
export interface ModuleSwitcherModalProps {
|
|
5
|
+
isShow: boolean;
|
|
6
|
+
onHide: () => void;
|
|
7
|
+
menus: SidebarMenus;
|
|
8
|
+
selectedGroupId: number | null;
|
|
9
|
+
onSelect: (id: number | null) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* ModuleSwitcherModal - Module/namespace selector for the application
|
|
13
|
+
* Shows grid of available modules that can be selected to filter sidebar menus
|
|
14
|
+
*/
|
|
15
|
+
export declare function ModuleSwitcherModal({ isShow, onHide, menus, selectedGroupId, onSelect, }: ModuleSwitcherModalProps): React.JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface SidebarHeaderSlotProps {
|
|
4
|
+
/**
|
|
5
|
+
* Collapsed state from sidebar
|
|
6
|
+
*/
|
|
7
|
+
collapsed?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Content to display below logo - dapat berupa:
|
|
10
|
+
* - Organization menu
|
|
11
|
+
* - User switcher
|
|
12
|
+
* - Custom component
|
|
13
|
+
* - Atau kombinasi dari beberapa komponen
|
|
14
|
+
*/
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* SidebarHeaderSlot - Flexible slot area dibawah logo sidebar
|
|
19
|
+
* Digunakan untuk menempatkan komponen apapun yang relevan dengan sidebar header
|
|
20
|
+
*
|
|
21
|
+
* Contoh penggunaan:
|
|
22
|
+
* <SidebarHeaderSlot collapsed={sidebarCollapsed}>
|
|
23
|
+
* <OrganizationMenu />
|
|
24
|
+
* </SidebarHeaderSlot>
|
|
25
|
+
*
|
|
26
|
+
* atau:
|
|
27
|
+
* <SidebarHeaderSlot collapsed={sidebarCollapsed}>
|
|
28
|
+
* <UserSwitcher />
|
|
29
|
+
* </SidebarHeaderSlot>
|
|
30
|
+
*/
|
|
31
|
+
export declare function SidebarHeaderSlot({ collapsed, children, }: SidebarHeaderSlotProps): React.JSX.Element | null;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
+
export * from './AppLayout';
|
|
2
|
+
export * from './SidebarHeaderSlot';
|
|
3
|
+
export * from './ModuleSwitcherModal';
|
|
1
4
|
export * from './AuthLayout';
|
|
2
|
-
export * from './ContentLayout';
|
|
3
|
-
export * from './DashboardLayout';
|
|
4
|
-
export * from './Header';
|
|
5
5
|
export * from './HorizontalField';
|
|
6
6
|
export * from './ModalDialog';
|
|
7
7
|
export * from './PageLayout';
|
|
8
8
|
export * from './Pressable';
|
|
9
9
|
export * from './RightDrawer';
|
|
10
10
|
export * from './Section';
|
|
11
|
-
export * from './Sidebar';
|
|
12
11
|
export * from './ActionMenu';
|
|
13
12
|
export * from './AdvanceFilter';
|
|
14
13
|
export * from './EachUtils';
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MenuSelectButtonProps } from '../../components/Header/MenuSelectButton';
|
|
1
|
+
import { SidebarMenuItem, SidebarMenus } from '../../types';
|
|
3
2
|
|
|
4
3
|
export interface AppContextValue {
|
|
5
4
|
menus: SidebarMenus;
|
|
6
5
|
menuBottom?: SidebarMenuItem[];
|
|
7
|
-
userData:
|
|
8
|
-
|
|
6
|
+
userData: {
|
|
7
|
+
name: string;
|
|
8
|
+
email: string;
|
|
9
|
+
photoURL?: string;
|
|
10
|
+
} | null;
|
|
11
|
+
setUserData: (value: {
|
|
12
|
+
name: string;
|
|
13
|
+
email: string;
|
|
14
|
+
photoURL?: string;
|
|
15
|
+
}) => void;
|
|
9
16
|
logo: string;
|
|
10
|
-
|
|
11
|
-
headerButtonsLeft?: HeaderButtonProps[];
|
|
12
|
-
menuSelectButtons?: MenuSelectButtonProps[];
|
|
13
|
-
menuSelectCustom?: React.ReactNode;
|
|
14
|
-
bottomDrawerContent?: React.ReactNode;
|
|
15
|
-
variant?: "default" | "simple";
|
|
17
|
+
appName: string;
|
|
16
18
|
}
|
|
17
19
|
export declare const AppContext: import('react').Context<AppContextValue>;
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import { default as React, PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SidebarMenuItem, SidebarMenus } from '../../types';
|
|
3
3
|
import { ThemeObject } from '@starasia/theme';
|
|
4
|
-
import { MenuSelectButtonProps } from '../../components/Header/MenuSelectButton';
|
|
5
4
|
|
|
6
5
|
interface AppProps extends PropsWithChildren {
|
|
7
6
|
router: React.ReactNode;
|
|
8
7
|
menus: SidebarMenus;
|
|
9
8
|
menuBottom?: SidebarMenuItem[];
|
|
10
9
|
logo: string;
|
|
10
|
+
appName?: string;
|
|
11
11
|
theme?: ThemeObject;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
bottomDrawerContent?: React.ReactNode;
|
|
18
|
-
variant?: "default" | "simple";
|
|
12
|
+
initialUserData?: {
|
|
13
|
+
name: string;
|
|
14
|
+
email: string;
|
|
15
|
+
photoURL?: string;
|
|
16
|
+
} | null;
|
|
19
17
|
}
|
|
20
|
-
export declare const AppComponent: ({ router, menus, menuBottom, logo, initialUserData, theme,
|
|
21
|
-
export declare const App: React.MemoExoticComponent<({ router, menus, menuBottom, logo, initialUserData, theme,
|
|
18
|
+
export declare const AppComponent: ({ router, menus, menuBottom, logo, appName, initialUserData, theme, }: AppProps) => React.JSX.Element;
|
|
19
|
+
export declare const App: React.MemoExoticComponent<({ router, menus, menuBottom, logo, appName, initialUserData, theme, }: AppProps) => React.JSX.Element>;
|
|
22
20
|
export * from './hooks';
|
|
23
21
|
export * from './context';
|