@babylonlabs-io/core-ui 1.4.2 → 1.5.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/Menu/Menu.d.ts +13 -0
- package/dist/components/Menu/MenuContext.d.ts +13 -0
- package/dist/components/Menu/MenuDrawer.d.ts +17 -0
- package/dist/components/Menu/MenuItem.d.ts +25 -0
- package/dist/components/Menu/SubMenu.d.ts +23 -0
- package/dist/components/Menu/SubMenuItem.d.ts +19 -0
- package/dist/components/Menu/index.d.ts +6 -0
- package/dist/hooks/useIsMobile.d.ts +7 -0
- package/dist/index.cjs.js +1 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +3366 -6620
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Placement } from '@popperjs/core';
|
|
3
|
+
interface MenuProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
trigger?: React.ReactNode;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
placement?: Placement;
|
|
9
|
+
offset?: [number, number];
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Menu: React.FC<MenuProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface MenuContextValue {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
setIsOpen: (open: boolean) => void;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
isMobile: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const useMenuContext: () => MenuContextValue | undefined;
|
|
9
|
+
export declare const MenuProvider: React.FC<{
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
value: MenuContextValue;
|
|
12
|
+
}>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface MenuDrawerProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
title?: string;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
titleAlign?: "left" | "center" | "right";
|
|
9
|
+
backIcon?: React.ReactNode;
|
|
10
|
+
fullHeight?: boolean;
|
|
11
|
+
fullWidth?: boolean;
|
|
12
|
+
showBackButton?: boolean;
|
|
13
|
+
showDivider?: boolean;
|
|
14
|
+
onBackdropClick?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const MenuDrawer: React.FC<MenuDrawerProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface MenuItemProps {
|
|
3
|
+
/** Leading icon or element */
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
/** Primary text content */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Secondary text or description */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Click handler */
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
/** Disabled state */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Additional CSS classes */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Custom content (overrides default layout) */
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
/** Trailing element (e.g., chevron, badge, switch) */
|
|
18
|
+
suffix?: React.ReactNode;
|
|
19
|
+
/** Selected/active state */
|
|
20
|
+
selected?: boolean;
|
|
21
|
+
/** Role attribute for accessibility */
|
|
22
|
+
role?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const MenuItem: React.FC<MenuItemProps>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface SubMenuProps {
|
|
3
|
+
/** Nested submenu content */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Primary text to display in the menu item */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** Secondary text for the menu item */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Leading icon */
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
/** Icon used for the back button inside the drawer */
|
|
12
|
+
backIcon?: React.ReactNode;
|
|
13
|
+
/** Trailing element shown in the menu item (defaults to chevron) */
|
|
14
|
+
suffix?: React.ReactNode;
|
|
15
|
+
/** Extra classes for the menu item button */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Extra classes for the drawer */
|
|
18
|
+
contentClassName?: string;
|
|
19
|
+
/** Title alignment in the drawer header */
|
|
20
|
+
titleAlign?: "left" | "center" | "right";
|
|
21
|
+
}
|
|
22
|
+
export declare const SubMenu: React.FC<SubMenuProps>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface SubMenuItemProps {
|
|
3
|
+
/** Primary text content */
|
|
4
|
+
label: string;
|
|
5
|
+
/** Secondary text or description */
|
|
6
|
+
description?: string;
|
|
7
|
+
/** Click handler */
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
/** Selected/active state */
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
/** Additional CSS classes */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Custom suffix element (defaults to checkmark when selected) */
|
|
14
|
+
suffix?: React.ReactNode;
|
|
15
|
+
/** Disabled state */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const SubMenuItem: React.FC<SubMenuItemProps>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to detect if the viewport is in mobile size
|
|
3
|
+
* @param breakpoint - The breakpoint in pixels (default: 768)
|
|
4
|
+
* @param throttleMs - The throttle delay in milliseconds (default: 100)
|
|
5
|
+
* @returns boolean indicating if viewport is mobile size
|
|
6
|
+
*/
|
|
7
|
+
export declare function useIsMobile(breakpoint?: number, throttleMs?: number): boolean;
|