@realminc/ui 0.9.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/LICENSE +99 -0
- package/README.md +254 -0
- package/dist/components/chart/chart.d.ts +2 -0
- package/dist/components/chart/chart_pane.d.ts +7 -0
- package/dist/components/chart/index.d.ts +5 -0
- package/dist/components/chart/indicators.d.ts +7 -0
- package/dist/components/chart/types.d.ts +110 -0
- package/dist/components/display/benchmark_table.d.ts +26 -0
- package/dist/components/display/code_block.d.ts +33 -0
- package/dist/components/display/feature_card.d.ts +22 -0
- package/dist/components/display/hero.d.ts +28 -0
- package/dist/components/display/image_card.d.ts +33 -0
- package/dist/components/display/index.d.ts +28 -0
- package/dist/components/display/label.d.ts +25 -0
- package/dist/components/display/line_table.d.ts +35 -0
- package/dist/components/display/marquee.d.ts +38 -0
- package/dist/components/display/number_display.d.ts +29 -0
- package/dist/components/display/price_display.d.ts +31 -0
- package/dist/components/display/side_indicator.d.ts +23 -0
- package/dist/components/display/side_line.d.ts +31 -0
- package/dist/components/display/stat_card.d.ts +20 -0
- package/dist/components/display/token_icon.d.ts +15 -0
- package/dist/components/feedback/callout.d.ts +22 -0
- package/dist/components/feedback/index.d.ts +6 -0
- package/dist/components/feedback/loading.d.ts +46 -0
- package/dist/components/feedback/modal.d.ts +29 -0
- package/dist/components/form/button.d.ts +54 -0
- package/dist/components/form/index.d.ts +8 -0
- package/dist/components/form/input.d.ts +18 -0
- package/dist/components/form/number_input.d.ts +41 -0
- package/dist/components/form/select.d.ts +43 -0
- package/dist/components/fx/index.d.ts +7 -0
- package/dist/components/fx/scramble_button.d.ts +9 -0
- package/dist/components/fx/scramble_control.d.ts +12 -0
- package/dist/components/fx/scramble_link.d.ts +10 -0
- package/dist/components/fx/scramble_text.d.ts +13 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/layout/container.d.ts +17 -0
- package/dist/components/layout/index.d.ts +8 -0
- package/dist/components/layout/table.d.ts +73 -0
- package/dist/components/layout/tabs.d.ts +37 -0
- package/dist/components/layout/widget.d.ts +26 -0
- package/dist/components/nav/footer.d.ts +32 -0
- package/dist/components/nav/index.d.ts +6 -0
- package/dist/components/nav/logo.d.ts +17 -0
- package/dist/components/nav/navbar.d.ts +47 -0
- package/dist/components/transition/index.d.ts +4 -0
- package/dist/components/transition/page_entrance.d.ts +39 -0
- package/dist/components/transition/page_transition.d.ts +62 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +17138 -0
- package/dist/styles/fonts.css +104 -0
- package/dist/styles/tailwind.preset.d.ts +3 -0
- package/dist/styles/theme.d.ts +372 -0
- package/dist/tailwind.js +47 -0
- package/dist/theme.js +143 -0
- package/package.json +84 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-Bold.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-BoldItalic.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-ExtraLight.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-ExtraLightItalic.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-Italic.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-Light.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-LightItalic.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-Medium.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-MediumItalic.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-Regular.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-SemiBold.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-SemiBoldItalic.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-Text.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-TextItalic.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-Thin.ttf +0 -0
- package/public/fonts/ibm-plex-sans/IBMPlexSans-ThinItalic.ttf +0 -0
- package/public/fonts/intel-one-mono/IntelOneMono-Bold.ttf +0 -0
- package/public/fonts/intel-one-mono/IntelOneMono-BoldItalic.ttf +0 -0
- package/public/fonts/intel-one-mono/IntelOneMono-Italic.ttf +0 -0
- package/public/fonts/intel-one-mono/IntelOneMono-Light.ttf +0 -0
- package/public/fonts/intel-one-mono/IntelOneMono-LightItalic.ttf +0 -0
- package/public/fonts/intel-one-mono/IntelOneMono-Medium.ttf +0 -0
- package/public/fonts/intel-one-mono/IntelOneMono-MediumItalic.ttf +0 -0
- package/public/fonts/intel-one-mono/IntelOneMono-Regular.ttf +0 -0
- package/public/fonts/switzer/SwitzerVariable-Italic.ttf +0 -0
- package/public/fonts/switzer/SwitzerVariable.ttf +0 -0
- package/public/logo/README.md +75 -0
- package/public/logo/apple-touch-icon.png +0 -0
- package/public/logo/favicon-192.png +0 -0
- package/public/logo/favicon-512.png +0 -0
- package/public/logo/favicon.ico +0 -0
- package/public/logo/favicon.svg +4 -0
- package/public/logo/oa-wordmark-dark.svg +6 -0
- package/public/logo/oa-wordmark-light.svg +6 -0
- package/public/logo/realm-app-dark.svg +4 -0
- package/public/logo/realm-app-light.svg +4 -0
- package/public/logo/realm-integrated-wordmark-dark.svg +4 -0
- package/public/logo/realm-integrated-wordmark-light.svg +4 -0
- package/public/logo/realm-logo-dark.svg +6 -0
- package/public/logo/realm-logo-light.svg +6 -0
- package/public/logo/realm-mark-dark.svg +3 -0
- package/public/logo/realm-mark-light.svg +3 -0
- package/public/logo/realm-r-mark.svg +6 -0
- package/public/logo/realm-token.svg +4 -0
- package/public/logo/realm-wordmark-dark.svg +6 -0
- package/public/logo/realm-wordmark-light.svg +6 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface OaTableColumn<T> {
|
|
3
|
+
/** Unique key for the column */
|
|
4
|
+
key: string;
|
|
5
|
+
/** Column header */
|
|
6
|
+
header: ReactNode;
|
|
7
|
+
/** Cell renderer */
|
|
8
|
+
cell: (row: T, index: number) => ReactNode;
|
|
9
|
+
/** Enable sorting for this column */
|
|
10
|
+
sortable?: boolean;
|
|
11
|
+
/** Sort function (return -1, 0, 1) */
|
|
12
|
+
sort_fn?: (a: T, b: T) => number;
|
|
13
|
+
/** Column width (CSS value) */
|
|
14
|
+
width?: string;
|
|
15
|
+
/** Min width (CSS value) */
|
|
16
|
+
min_width?: string;
|
|
17
|
+
/** Text alignment */
|
|
18
|
+
align?: 'left' | 'center' | 'right';
|
|
19
|
+
/** Additional header className */
|
|
20
|
+
header_class_name?: string;
|
|
21
|
+
/** Additional cell className */
|
|
22
|
+
cell_class_name?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface OaTableProps<T> {
|
|
25
|
+
/** Data rows */
|
|
26
|
+
data: T[];
|
|
27
|
+
/** Column definitions */
|
|
28
|
+
columns: OaTableColumn<T>[];
|
|
29
|
+
/** Unique key extractor for rows */
|
|
30
|
+
row_key: (row: T, index: number) => string;
|
|
31
|
+
/** Row click handler */
|
|
32
|
+
on_row_click?: (row: T, index: number) => void;
|
|
33
|
+
/** Empty state content */
|
|
34
|
+
emptyContent?: ReactNode;
|
|
35
|
+
/** Loading state */
|
|
36
|
+
loading?: boolean;
|
|
37
|
+
/** Loading content */
|
|
38
|
+
loading_content?: ReactNode;
|
|
39
|
+
/** Sticky header */
|
|
40
|
+
sticky_header?: boolean;
|
|
41
|
+
/** Compact mode (less padding) */
|
|
42
|
+
compact?: boolean;
|
|
43
|
+
/** Striped rows */
|
|
44
|
+
striped?: boolean;
|
|
45
|
+
/** Hover effect on rows */
|
|
46
|
+
hoverable?: boolean;
|
|
47
|
+
/** Show borders between cells */
|
|
48
|
+
bordered?: boolean;
|
|
49
|
+
/** Max height with scroll */
|
|
50
|
+
max_height?: string;
|
|
51
|
+
/** Additional table className */
|
|
52
|
+
className?: string;
|
|
53
|
+
/** Additional header row className */
|
|
54
|
+
header_class_name?: string;
|
|
55
|
+
/** Additional body className */
|
|
56
|
+
body_class_name?: string;
|
|
57
|
+
/** Row className (can be function for conditional styling) */
|
|
58
|
+
row_class_name?: string | ((row: T, index: number) => string);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* OaTable - Sortable, styled data table
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* <OaTable
|
|
65
|
+
* data={orders}
|
|
66
|
+
* rowKey={(order) => order.id}
|
|
67
|
+
* columns={[
|
|
68
|
+
* { key: 'side', header: 'Side', cell: (o) => <OaSideIndicator side={o.side} /> },
|
|
69
|
+
* { key: 'price', header: 'Price', cell: (o) => o.price, sortable: true, align: 'right' },
|
|
70
|
+
* ]}
|
|
71
|
+
* />
|
|
72
|
+
*/
|
|
73
|
+
export declare function OaTable<T>({ data, columns, row_key, on_row_click, emptyContent, loading, loading_content, sticky_header, compact, striped, hoverable, bordered, max_height, className, header_class_name, body_class_name, row_class_name, }: OaTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface OaTab {
|
|
3
|
+
/** Tab identifier */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Tab label */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Tab content */
|
|
8
|
+
content: ReactNode;
|
|
9
|
+
/** Badge count (optional) */
|
|
10
|
+
badge?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface OaTabsProps {
|
|
13
|
+
/** Array of tabs */
|
|
14
|
+
tabs: OaTab[];
|
|
15
|
+
/** Default active tab id */
|
|
16
|
+
default_tab?: string;
|
|
17
|
+
/** Controlled active tab */
|
|
18
|
+
active_tab?: string;
|
|
19
|
+
/** On tab change callback */
|
|
20
|
+
on_tab_change?: (tab_id: string) => void;
|
|
21
|
+
/** Tab bar position */
|
|
22
|
+
position?: 'top' | 'bottom';
|
|
23
|
+
/** Additional className for container */
|
|
24
|
+
className?: string;
|
|
25
|
+
/** Additional className for tab bar */
|
|
26
|
+
tab_bar_class_name?: string;
|
|
27
|
+
/** Additional className for content */
|
|
28
|
+
content_class_name?: string;
|
|
29
|
+
/** Compact mode (smaller tabs) */
|
|
30
|
+
compact?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* OaTabs - Tabbed content container
|
|
34
|
+
*
|
|
35
|
+
* Used for switching between views (positions/orders/history, etc.)
|
|
36
|
+
*/
|
|
37
|
+
export declare function OaTabs({ tabs, default_tab, active_tab: controlled_tab, on_tab_change, position, className, tab_bar_class_name, content_class_name, compact, }: OaTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface OaWidgetProps {
|
|
3
|
+
/** Widget title (displayed in header) */
|
|
4
|
+
title?: string;
|
|
5
|
+
/** Hide the header */
|
|
6
|
+
hide_header?: boolean;
|
|
7
|
+
/** Content on the right side of the header */
|
|
8
|
+
header_right?: ReactNode;
|
|
9
|
+
/** Widget content */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/** Additional className */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Header className override */
|
|
14
|
+
header_class_name?: string;
|
|
15
|
+
/** Content className override */
|
|
16
|
+
content_class_name?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* OaWidget - Standard widget container
|
|
20
|
+
*
|
|
21
|
+
* The base visual pattern for exchange panels:
|
|
22
|
+
* - Dark background with subtle border
|
|
23
|
+
* - Optional header with title
|
|
24
|
+
* - Scrollable content area
|
|
25
|
+
*/
|
|
26
|
+
export declare function OaWidget({ title, hide_header, header_right, children, className, header_class_name, content_class_name, }: OaWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface OaFooterLink {
|
|
2
|
+
label: string;
|
|
3
|
+
href: string;
|
|
4
|
+
}
|
|
5
|
+
export interface OaFooterSection {
|
|
6
|
+
title: string;
|
|
7
|
+
links: OaFooterLink[];
|
|
8
|
+
}
|
|
9
|
+
export interface OaFooterProps {
|
|
10
|
+
/** Footer sections with links */
|
|
11
|
+
sections?: OaFooterSection[];
|
|
12
|
+
/** Logo variant */
|
|
13
|
+
variant?: 'dark' | 'light';
|
|
14
|
+
/** Custom link component */
|
|
15
|
+
link_component?: React.ComponentType<{
|
|
16
|
+
href: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}>;
|
|
20
|
+
/** Copyright text */
|
|
21
|
+
copyright?: string;
|
|
22
|
+
/** Tagline */
|
|
23
|
+
tagline?: string;
|
|
24
|
+
/** Custom className */
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* OaFooter - Realm Footer Component
|
|
29
|
+
*
|
|
30
|
+
* Shared footer for all Realm apps.
|
|
31
|
+
*/
|
|
32
|
+
export declare function OaFooter({ sections, variant, link_component: LinkComponent, copyright, tagline, className, }: OaFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { OaLogo } from './logo';
|
|
2
|
+
export type { OaLogoProps } from './logo';
|
|
3
|
+
export { OaNavbar } from './navbar';
|
|
4
|
+
export type { OaNavbarProps, OaNavLink } from './navbar';
|
|
5
|
+
export { OaFooter } from './footer';
|
|
6
|
+
export type { OaFooterProps, OaFooterSection, OaFooterLink } from './footer';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface OaLogoProps {
|
|
2
|
+
/** Logo variant: 'dark' for dark backgrounds, 'light' for light backgrounds */
|
|
3
|
+
variant?: 'dark' | 'light';
|
|
4
|
+
/** Show icon + text combined, or icon only */
|
|
5
|
+
type?: 'full' | 'icon';
|
|
6
|
+
/** Size preset */
|
|
7
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
8
|
+
/** Custom className */
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* OaLogo - Realm Logo Component
|
|
13
|
+
*
|
|
14
|
+
* Uses the fixed-diagonal R mark and integrated Realm wordmark.
|
|
15
|
+
* All logos sourced from @realm/ui/public/logo/
|
|
16
|
+
*/
|
|
17
|
+
export declare function OaLogo({ variant, type, size, className }: OaLogoProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface OaNavLink {
|
|
2
|
+
label: string;
|
|
3
|
+
href: string;
|
|
4
|
+
is_active?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface OaNavbarProps {
|
|
7
|
+
/** Navigation links */
|
|
8
|
+
links?: OaNavLink[];
|
|
9
|
+
/** Logo variant for background */
|
|
10
|
+
variant?: 'dark' | 'light';
|
|
11
|
+
/** Current path for active state */
|
|
12
|
+
current_path?: string;
|
|
13
|
+
/** Custom link component (for router integration) */
|
|
14
|
+
link_component?: React.ComponentType<{
|
|
15
|
+
href: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}>;
|
|
19
|
+
/** Right side content (wallet button, etc.) */
|
|
20
|
+
right_content?: React.ReactNode;
|
|
21
|
+
/** Center content (search bar, etc.) */
|
|
22
|
+
center_content?: React.ReactNode;
|
|
23
|
+
/** Label next to logo (e.g., "Docs", "Exchange") */
|
|
24
|
+
logo_label?: string;
|
|
25
|
+
/** Mobile menu button click handler */
|
|
26
|
+
on_menu_click?: () => void;
|
|
27
|
+
/** Show mobile menu button */
|
|
28
|
+
show_mobile_menu?: boolean;
|
|
29
|
+
/** Custom className for navbar container */
|
|
30
|
+
className?: string;
|
|
31
|
+
/** Animation enabled */
|
|
32
|
+
animate?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* OaNavbar - Realm Navbar Component
|
|
36
|
+
*
|
|
37
|
+
* Shared navbar for all Realm apps with consistent branding.
|
|
38
|
+
* Pass a custom link_component for React Router / Next.js integration.
|
|
39
|
+
*
|
|
40
|
+
* Features:
|
|
41
|
+
* - Logo with optional label
|
|
42
|
+
* - Navigation links
|
|
43
|
+
* - Center content slot (for search)
|
|
44
|
+
* - Right content slot (for buttons)
|
|
45
|
+
* - Mobile menu button
|
|
46
|
+
*/
|
|
47
|
+
export declare function OaNavbar({ links, variant, current_path, link_component: LinkComponent, right_content, center_content, logo_label, on_menu_click, show_mobile_menu, className, animate, }: OaNavbarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { OaPageTransition, use_page_transition } from './page_transition';
|
|
2
|
+
export type { OaPageTransitionProps, OaTransitionDirection } from './page_transition';
|
|
3
|
+
export { OaPageEntrance } from './page_entrance';
|
|
4
|
+
export type { OaPageEntranceProps } from './page_entrance';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface OaPageEntranceProps {
|
|
2
|
+
/** Content to show after entrance animation */
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** Direction the overlay exits: 'left' = exit left, 'right' = exit right (default) */
|
|
5
|
+
exit_direction?: 'left' | 'right';
|
|
6
|
+
/** Delay before starting exit animation (default: 300ms) */
|
|
7
|
+
delay?: number;
|
|
8
|
+
/** Duration of exit animation (default: 500ms) */
|
|
9
|
+
duration?: number;
|
|
10
|
+
/** Show logo during entrance (default: true) */
|
|
11
|
+
show_logo?: boolean;
|
|
12
|
+
/** Custom content instead of logo */
|
|
13
|
+
entrance_content?: React.ReactNode;
|
|
14
|
+
/** Z-index (default: 200) */
|
|
15
|
+
zIndex?: number;
|
|
16
|
+
/** Callback when entrance animation completes */
|
|
17
|
+
on_complete?: () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* OaPageEntrance - Page load entrance animation
|
|
21
|
+
*
|
|
22
|
+
* Shows a full-screen overlay with logo that wipes away to reveal content.
|
|
23
|
+
* Used when navigating TO an app (e.g., landing → exchange).
|
|
24
|
+
*
|
|
25
|
+
* Pairs with OaPageTransition for seamless app-to-app navigation:
|
|
26
|
+
* 1. User on Landing clicks "Launch App"
|
|
27
|
+
* 2. OaPageTransition wipes in from left (covering landing)
|
|
28
|
+
* 3. Browser navigates to Exchange
|
|
29
|
+
* 4. OaPageEntrance on Exchange wipes out to right (revealing exchange)
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* // In exchange app's root component
|
|
34
|
+
* <OaPageEntrance exit_direction="right">
|
|
35
|
+
* <App />
|
|
36
|
+
* </OaPageEntrance>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function OaPageEntrance({ children, exit_direction, delay, duration, show_logo, entrance_content, zIndex, on_complete, }: OaPageEntranceProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export type OaTransitionDirection = 'left' | 'right';
|
|
2
|
+
export interface OaPageTransitionProps {
|
|
3
|
+
/** Whether the transition is active */
|
|
4
|
+
is_active: boolean;
|
|
5
|
+
/** Direction of the wipe: 'left' = left-to-right, 'right' = right-to-left */
|
|
6
|
+
direction?: OaTransitionDirection;
|
|
7
|
+
/** Duration in seconds (default: 0.5) */
|
|
8
|
+
duration?: number;
|
|
9
|
+
/** Callback when transition animation completes */
|
|
10
|
+
on_complete?: () => void;
|
|
11
|
+
/** Show logo in center (default: true) */
|
|
12
|
+
show_logo?: boolean;
|
|
13
|
+
/** Custom content instead of logo */
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
/** Z-index (default: 200) */
|
|
16
|
+
zIndex?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* OaPageTransition - Full-screen wipe transition effect
|
|
20
|
+
*
|
|
21
|
+
* Used for smooth page transitions between Realm apps:
|
|
22
|
+
* - Landing → Exchange (direction="left", left-to-right wipe)
|
|
23
|
+
* - Exchange → Landing (direction="right", right-to-left wipe)
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* const [isTransitioning, setIsTransitioning] = useState(false);
|
|
28
|
+
*
|
|
29
|
+
* const handle_navigate = () => {
|
|
30
|
+
* setIsTransitioning(true);
|
|
31
|
+
* setTimeout(() => {
|
|
32
|
+
* window.location.href = 'https://exchange.realm.software';
|
|
33
|
+
* }, 700);
|
|
34
|
+
* };
|
|
35
|
+
*
|
|
36
|
+
* <OaPageTransition
|
|
37
|
+
* is_active={isTransitioning}
|
|
38
|
+
* direction="left"
|
|
39
|
+
* />
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function OaPageTransition({ is_active, direction, duration, on_complete, show_logo, children, zIndex, }: OaPageTransitionProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
/**
|
|
44
|
+
* Hook to manage page transition state
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* const { isTransitioning, start_transition } = use_page_transition();
|
|
49
|
+
*
|
|
50
|
+
* <button onClick={() => start_transition('https://exchange.realm.software')}>
|
|
51
|
+
* Launch App
|
|
52
|
+
* </button>
|
|
53
|
+
*
|
|
54
|
+
* <OaPageTransition is_active={isTransitioning} />
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function use_page_transition(delay?: number): {
|
|
58
|
+
isTransitioning: boolean;
|
|
59
|
+
targetUrl: string | null;
|
|
60
|
+
start_transition: (url: string) => void;
|
|
61
|
+
cancel_transition: () => void;
|
|
62
|
+
};
|
package/dist/index.d.ts
ADDED