@dimasbaguspm/versaur 0.0.57 → 0.0.59
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/js/desktop-breakpoint-CuSom-sN.js +47 -0
- package/dist/js/feedbacks/index.js +1 -1
- package/dist/js/forms/index.js +1 -1
- package/dist/js/helpers/index.js +14 -0
- package/dist/js/{image-rectangle-K9jmTTED.js → image-rectangle-CCvXv24a.js} +819 -926
- package/dist/js/{index-DOdDlCoL.js → index-BDtz_hQY.js} +520 -802
- package/dist/js/index.js +72 -59
- package/dist/js/jsx-runtime-C5mzlN2N.js +284 -0
- package/dist/js/layouts/index.js +9 -8
- package/dist/js/navigation/index.js +1 -1
- package/dist/js/overlays/index.js +2 -2
- package/dist/js/primitive/index.js +2 -2
- package/dist/js/providers/index.js +1 -1
- package/dist/js/{skeleton-BNZyaRjo.js → skeleton-BRwIW26B.js} +6 -5
- package/dist/js/{snackbar-DH8jCh2V.js → snackbar-CTq4MLir.js} +14 -13
- package/dist/js/{tabs-CmfJNCe6.js → tabs-BQs53hHL.js} +8 -7
- package/dist/js/{time-picker-input-BgbyllDK.js → time-picker-input-Disd231b.js} +24 -23
- package/dist/js/{tooltip-nZW9TUz3.js → tooltip-Dpx3TpR6.js} +211 -205
- package/dist/js/top-bar-B2nzldfs.js +1074 -0
- package/dist/js/{use-snackbars-Cou8L41F.js → use-snackbars-B6lnVjrX.js} +14 -13
- package/dist/types/helpers/index.d.ts +1 -0
- package/dist/types/helpers/match-media/built-in/components/desktop-breakpoint.d.ts +18 -0
- package/dist/types/helpers/match-media/built-in/components/index.d.ts +3 -0
- package/dist/types/helpers/match-media/built-in/components/mobile-breakpoint.d.ts +18 -0
- package/dist/types/helpers/match-media/built-in/components/tablet-breakpoint.d.ts +18 -0
- package/dist/types/helpers/match-media/built-in/hooks/index.d.ts +3 -0
- package/dist/types/helpers/match-media/built-in/hooks/use-desktop-breakpoint.d.ts +11 -0
- package/dist/types/helpers/match-media/built-in/hooks/use-mobile-breakpoint.d.ts +11 -0
- package/dist/types/helpers/match-media/built-in/hooks/use-tablet-breakpoint.d.ts +11 -0
- package/dist/types/helpers/match-media/built-in/index.d.ts +2 -0
- package/dist/types/helpers/match-media/constants.d.ts +7 -0
- package/dist/types/helpers/match-media/index.d.ts +4 -0
- package/dist/types/helpers/match-media/match-media.d.ts +25 -0
- package/dist/types/helpers/match-media/test-helpers.d.ts +21 -0
- package/dist/types/helpers/match-media/use-match-media.d.ts +15 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/layouts/app-layout/app-layout.atoms.d.ts +6 -0
- package/dist/types/layouts/app-layout/app-layout.d.ts +8 -0
- package/dist/types/layouts/app-layout/index.d.ts +2 -0
- package/dist/types/layouts/app-layout/types.d.ts +52 -0
- package/dist/types/layouts/index.d.ts +2 -1
- package/dist/types/layouts/page-content/types.d.ts +0 -6
- package/dist/types/layouts/page-header/types.d.ts +14 -6
- package/dist/types/layouts/page-layout/index.d.ts +2 -0
- package/dist/types/layouts/page-layout/page-layout.atoms.d.ts +3 -0
- package/dist/types/layouts/page-layout/page-layout.d.ts +5 -0
- package/dist/types/layouts/page-layout/types.d.ts +37 -0
- package/dist/types/layouts/side-bar/side-bar.atoms.d.ts +1 -1
- package/dist/types/layouts/side-bar/side-bar.d.ts +1 -1
- package/dist/types/layouts/side-bar/types.d.ts +55 -18
- package/dist/types/overlays/menu/types.d.ts +8 -8
- package/dist/types/primitive/button-menu/types.d.ts +1 -1
- package/dist/types/primitive/button-menu-icon/types.d.ts +1 -1
- package/dist/utils/enforce-subpath-import.js +5 -2
- package/package.json +5 -1
- package/dist/js/top-bar-Do2JqSqe.js +0 -908
- package/dist/types/layouts/app-bar/app-bar.atoms.d.ts +0 -25
- package/dist/types/layouts/app-bar/app-bar.d.ts +0 -9
- package/dist/types/layouts/app-bar/index.d.ts +0 -2
- package/dist/types/layouts/app-bar/types.d.ts +0 -46
- package/dist/types/overlays/menu/use-menu.d.ts +0 -15
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { S as h } from "./snackbar-
|
|
4
|
-
|
|
1
|
+
import { j as c } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import { createContext as p, useState as x, useRef as k, useCallback as l, useEffect as S, useMemo as v, useContext as w } from "react";
|
|
3
|
+
import { S as h } from "./snackbar-CTq4MLir.js";
|
|
4
|
+
import { c as d } from "./index-BDtz_hQY.js";
|
|
5
|
+
const f = p(
|
|
5
6
|
null
|
|
6
7
|
), j = d(
|
|
7
8
|
[
|
|
@@ -20,11 +21,11 @@ const f = x(
|
|
|
20
21
|
}
|
|
21
22
|
}), C = 4e3;
|
|
22
23
|
function E() {
|
|
23
|
-
const [a, o] =
|
|
24
|
+
const [a, o] = x([]), t = k({}), n = l((e) => {
|
|
24
25
|
o((r) => r.filter((s) => s.id !== e)), t.current[e] && (clearTimeout(t.current[e]), delete t.current[e]);
|
|
25
|
-
}, []), i =
|
|
26
|
+
}, []), i = l(
|
|
26
27
|
(e, r, s) => {
|
|
27
|
-
const u = `${Date.now()}-${Math.random()}`,
|
|
28
|
+
const u = `${Date.now()}-${Math.random()}`, m = s?.duration ?? C;
|
|
28
29
|
o((b) => [
|
|
29
30
|
...b,
|
|
30
31
|
{
|
|
@@ -32,11 +33,11 @@ function E() {
|
|
|
32
33
|
color: e,
|
|
33
34
|
message: r,
|
|
34
35
|
...s,
|
|
35
|
-
duration:
|
|
36
|
+
duration: m
|
|
36
37
|
}
|
|
37
38
|
]), t.current[u] = setTimeout(() => {
|
|
38
39
|
n(u);
|
|
39
|
-
},
|
|
40
|
+
}, m);
|
|
40
41
|
},
|
|
41
42
|
[n]
|
|
42
43
|
);
|
|
@@ -44,7 +45,7 @@ function E() {
|
|
|
44
45
|
Object.values(t.current).forEach(clearTimeout), t.current = {};
|
|
45
46
|
}, []), { queue: a, showSnack: i, removeSnack: n };
|
|
46
47
|
}
|
|
47
|
-
const
|
|
48
|
+
const N = ({ children: a }) => {
|
|
48
49
|
const { queue: o, showSnack: t, removeSnack: n } = E(), i = v(() => ({ showSnack: t }), [t]);
|
|
49
50
|
return /* @__PURE__ */ c.jsxs(f.Provider, { value: i, children: [
|
|
50
51
|
a,
|
|
@@ -79,13 +80,13 @@ const V = ({ children: a }) => {
|
|
|
79
80
|
)
|
|
80
81
|
] });
|
|
81
82
|
};
|
|
82
|
-
function
|
|
83
|
+
function $() {
|
|
83
84
|
const a = w(f);
|
|
84
85
|
if (!a)
|
|
85
86
|
throw new Error("useSnackbars must be used within a SnackbarsProvider");
|
|
86
87
|
return a;
|
|
87
88
|
}
|
|
88
89
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
N as S,
|
|
91
|
+
$ as u
|
|
91
92
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './match-media';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for breakpoint components
|
|
3
|
+
*/
|
|
4
|
+
interface BreakpointComponentProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Component that only renders children on desktop viewports
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <DesktopBreakpoint>
|
|
13
|
+
* <DesktopOnlyContent />
|
|
14
|
+
* </DesktopBreakpoint>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function DesktopBreakpoint({ children }: BreakpointComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for breakpoint components
|
|
3
|
+
*/
|
|
4
|
+
interface BreakpointComponentProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Component that only renders children on mobile viewports
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <MobileBreakpoint>
|
|
13
|
+
* <MobileOnlyContent />
|
|
14
|
+
* </MobileBreakpoint>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function MobileBreakpoint({ children }: BreakpointComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for breakpoint components
|
|
3
|
+
*/
|
|
4
|
+
interface BreakpointComponentProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Component that only renders children on tablet viewports
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <TabletBreakpoint>
|
|
13
|
+
* <TabletOnlyContent />
|
|
14
|
+
* </TabletBreakpoint>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function TabletBreakpoint({ children }: BreakpointComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to detect if the current viewport is desktop
|
|
3
|
+
*
|
|
4
|
+
* @returns boolean indicating if viewport is desktop (min-width: 1024px)
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* const isDesktop = useDesktopBreakpoint()
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare function useDesktopBreakpoint(): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to detect if the current viewport is mobile
|
|
3
|
+
*
|
|
4
|
+
* @returns boolean indicating if viewport is mobile (max-width: 767px)
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* const isMobile = useMobileBreakpoint()
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare function useMobileBreakpoint(): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to detect if the current viewport is tablet
|
|
3
|
+
*
|
|
4
|
+
* @returns boolean indicating if viewport is tablet (768px - 1023px)
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* const isTablet = useTabletBreakpoint()
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare function useTabletBreakpoint(): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard Tailwind breakpoint definitions
|
|
3
|
+
* These align with common Tailwind CSS breakpoints
|
|
4
|
+
*/
|
|
5
|
+
export declare const BREAKPOINT_MOBILE = "(max-width: 767px)";
|
|
6
|
+
export declare const BREAKPOINT_TABLET = "(min-width: 768px) and (max-width: 1023px)";
|
|
7
|
+
export declare const BREAKPOINT_DESKTOP = "(min-width: 1024px)";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for MatchMedia component
|
|
3
|
+
*/
|
|
4
|
+
interface MatchMediaProps {
|
|
5
|
+
/** CSS media query string to match against */
|
|
6
|
+
query: string;
|
|
7
|
+
/** Content to render when query matches */
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Component that conditionally renders children based on a media query
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <MatchMedia query="(min-width: 1024px)">
|
|
16
|
+
* <DesktopContent />
|
|
17
|
+
* </MatchMedia>
|
|
18
|
+
*
|
|
19
|
+
* <MatchMedia query="(prefers-color-scheme: dark)">
|
|
20
|
+
* <DarkModeUI />
|
|
21
|
+
* </MatchMedia>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function MatchMedia({ query, children }: MatchMediaProps): import("react/jsx-runtime").JSX.Element | null;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a mock MediaQueryList for testing
|
|
3
|
+
*/
|
|
4
|
+
export declare const createMatchMediaMock: (matches: boolean) => {
|
|
5
|
+
matches: boolean;
|
|
6
|
+
media: string;
|
|
7
|
+
onchange: null;
|
|
8
|
+
addListener: import('vitest').Mock<(...args: any[]) => any>;
|
|
9
|
+
removeListener: import('vitest').Mock<(...args: any[]) => any>;
|
|
10
|
+
addEventListener: import('vitest').Mock<(event: string, listener: (event: MediaQueryListEvent) => void) => void>;
|
|
11
|
+
removeEventListener: import('vitest').Mock<(event: string, listener: (event: MediaQueryListEvent) => void) => void>;
|
|
12
|
+
dispatchEvent: import('vitest').Mock<(...args: any[]) => any>;
|
|
13
|
+
_triggerChange: (newMatches: boolean) => void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Setup and teardown for matchMedia mocking
|
|
17
|
+
*/
|
|
18
|
+
export declare const setupMatchMediaMock: () => {
|
|
19
|
+
beforeEach: () => void;
|
|
20
|
+
afterEach: () => void;
|
|
21
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base hook to detect if a media query matches
|
|
3
|
+
* Uses the native matchMedia API for optimal performance
|
|
4
|
+
*
|
|
5
|
+
* @param query - CSS media query string
|
|
6
|
+
* @returns boolean indicating if the query matches
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const isMobile = useMatchMedia(BREAKPOINT_MOBILE)
|
|
11
|
+
* const isDesktop = useMatchMedia(BREAKPOINT_DESKTOP)
|
|
12
|
+
* const prefersDark = useMatchMedia('(prefers-color-scheme: dark)')
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function useMatchMedia(query: string): boolean;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AppLayoutTopRegionProps, AppLayoutSideLeftRegionProps, AppLayoutSideRightRegionProps, AppLayoutBottomRegionProps, AppLayoutMainRegionProps } from './types';
|
|
2
|
+
export declare const AppLayoutTopRegion: import('react').ForwardRefExoticComponent<AppLayoutTopRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const AppLayoutSideLeftRegion: import('react').ForwardRefExoticComponent<AppLayoutSideLeftRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare const AppLayoutSideRightRegion: import('react').ForwardRefExoticComponent<AppLayoutSideRightRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const AppLayoutBottomRegion: import('react').ForwardRefExoticComponent<AppLayoutBottomRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const AppLayoutMainRegion: import('react').ForwardRefExoticComponent<AppLayoutMainRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AppLayoutProps } from './types';
|
|
2
|
+
export declare const AppLayout: import('react').ForwardRefExoticComponent<AppLayoutProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
3
|
+
TopRegion: import('react').ForwardRefExoticComponent<import('./types').AppLayoutTopRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
4
|
+
SideLeftRegion: import('react').ForwardRefExoticComponent<import('./types').AppLayoutSideLeftRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
SideRightRegion: import('react').ForwardRefExoticComponent<import('./types').AppLayoutSideRightRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
BottomRegion: import('react').ForwardRefExoticComponent<import('./types').AppLayoutBottomRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
|
+
MainRegion: import('react').ForwardRefExoticComponent<import('./types').AppLayoutMainRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* AppLayoutRoot - main container for application layout
|
|
4
|
+
* Provides high-level layout structure with named regions for app shell
|
|
5
|
+
* Compound pattern: TopRegion, SideLeftRegion, SideRightRegion, BottomRegion, MainRegion
|
|
6
|
+
*/
|
|
7
|
+
export type AppLayoutProps = HTMLAttributes<HTMLDivElement>;
|
|
8
|
+
/**
|
|
9
|
+
* AppLayoutTopRegion - top region of the app (header, navigation bar)
|
|
10
|
+
*/
|
|
11
|
+
export interface AppLayoutTopRegionProps extends HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
/**
|
|
13
|
+
* Custom class for top region
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* AppLayoutSideLeftRegion - left sidebar region
|
|
19
|
+
*/
|
|
20
|
+
export interface AppLayoutSideLeftRegionProps extends HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
/**
|
|
22
|
+
* Custom class for left sidebar region
|
|
23
|
+
*/
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* AppLayoutSideRightRegion - right sidebar region
|
|
28
|
+
*/
|
|
29
|
+
export interface AppLayoutSideRightRegionProps extends HTMLAttributes<HTMLDivElement> {
|
|
30
|
+
/**
|
|
31
|
+
* Custom class for right sidebar region
|
|
32
|
+
*/
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* AppLayoutBottomRegion - bottom region of the app (footer, bottom nav)
|
|
37
|
+
*/
|
|
38
|
+
export interface AppLayoutBottomRegionProps extends HTMLAttributes<HTMLDivElement> {
|
|
39
|
+
/**
|
|
40
|
+
* Custom class for bottom region
|
|
41
|
+
*/
|
|
42
|
+
className?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* AppLayoutMainRegion - main content region
|
|
46
|
+
*/
|
|
47
|
+
export interface AppLayoutMainRegionProps extends HTMLAttributes<HTMLDivElement> {
|
|
48
|
+
/**
|
|
49
|
+
* Custom class for main region
|
|
50
|
+
*/
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export * from './app-
|
|
1
|
+
export * from './app-layout';
|
|
2
2
|
export * from './bottom-bar';
|
|
3
3
|
export * from './badge-group';
|
|
4
4
|
export * from './button-group';
|
|
5
5
|
export * from './filter-chip-group';
|
|
6
6
|
export * from './page-header';
|
|
7
7
|
export * from './page-content';
|
|
8
|
+
export * from './page-layout';
|
|
8
9
|
export * from './page-loader';
|
|
9
10
|
export * from './form-layout';
|
|
10
11
|
export * from './side-bar';
|
|
@@ -17,12 +17,6 @@ export interface PageContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
17
17
|
* - 'two-column-asymmetric-right': Two columns with right column wider
|
|
18
18
|
*/
|
|
19
19
|
template?: 'single-column' | 'two-column' | 'two-column-asymmetric-left' | 'two-column-asymmetric-right';
|
|
20
|
-
/**
|
|
21
|
-
* Background color of the layout
|
|
22
|
-
* - 'white': White background
|
|
23
|
-
* - 'gray': Gray background
|
|
24
|
-
*/
|
|
25
|
-
backgroundColor?: 'white' | 'gray';
|
|
26
20
|
/**
|
|
27
21
|
* Content to render inside the layout
|
|
28
22
|
*/
|
|
@@ -11,12 +11,6 @@ export interface PageHeaderProps extends HTMLAttributes<HTMLElement> {
|
|
|
11
11
|
* - 'narrow': Container for mobile screens (centered)
|
|
12
12
|
*/
|
|
13
13
|
size?: 'fluid' | 'wide' | 'narrow';
|
|
14
|
-
/**
|
|
15
|
-
* Background color of the header
|
|
16
|
-
* - 'white': White background
|
|
17
|
-
* - 'gray': Gray background
|
|
18
|
-
*/
|
|
19
|
-
backgroundColor?: 'white' | 'gray';
|
|
20
14
|
children?: ReactNode;
|
|
21
15
|
}
|
|
22
16
|
/**
|
|
@@ -24,12 +18,26 @@ export interface PageHeaderProps extends HTMLAttributes<HTMLElement> {
|
|
|
24
18
|
*/
|
|
25
19
|
export interface PageHeaderTopProps extends HTMLAttributes<HTMLDivElement> {
|
|
26
20
|
children: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Size determines the horizontal padding
|
|
23
|
+
* - 'fluid': No padding
|
|
24
|
+
* - 'wide': px-6
|
|
25
|
+
* - 'narrow': px-4
|
|
26
|
+
*/
|
|
27
|
+
size?: 'fluid' | 'wide' | 'narrow';
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* Props for PageHeaderBreadcrumbs - breadcrumbs section
|
|
30
31
|
*/
|
|
31
32
|
export interface PageHeaderBreadcrumbsProps extends HTMLAttributes<HTMLDivElement> {
|
|
32
33
|
children: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Size determines the horizontal padding
|
|
36
|
+
* - 'fluid': No padding
|
|
37
|
+
* - 'wide': px-6
|
|
38
|
+
* - 'narrow': px-4
|
|
39
|
+
*/
|
|
40
|
+
size?: 'fluid' | 'wide' | 'narrow';
|
|
33
41
|
}
|
|
34
42
|
/**
|
|
35
43
|
* Props for PageHeaderContent - title and subtitle area
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PageLayoutHeaderRegionProps, PageLayoutContentRegionProps } from './types';
|
|
2
|
+
export declare const PageLayoutHeaderRegion: import('react').ForwardRefExoticComponent<PageLayoutHeaderRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const PageLayoutContentRegion: import('react').ForwardRefExoticComponent<PageLayoutContentRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PageLayoutProps } from './types';
|
|
2
|
+
export declare const PageLayout: import('react').ForwardRefExoticComponent<PageLayoutProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
3
|
+
HeaderRegion: import('react').ForwardRefExoticComponent<import('./types').PageLayoutHeaderRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
4
|
+
ContentRegion: import('react').ForwardRefExoticComponent<import('./types').PageLayoutContentRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* PageLayoutRoot - main container for page layout
|
|
4
|
+
* Manages layout between header and content regions
|
|
5
|
+
* Compound pattern: HeaderRegion, ContentRegion
|
|
6
|
+
*/
|
|
7
|
+
export interface PageLayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/**
|
|
9
|
+
* Add horizontal margin (left and right) to the page layout
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
hasMargin?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* PageLayoutHeaderRegion - header region of the page
|
|
16
|
+
*/
|
|
17
|
+
export interface PageLayoutHeaderRegionProps extends HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
/**
|
|
19
|
+
* Background color of the header region
|
|
20
|
+
* - 'white': White background
|
|
21
|
+
* - 'gray': Gray background
|
|
22
|
+
* @default 'white'
|
|
23
|
+
*/
|
|
24
|
+
backgroundColor?: 'white' | 'gray';
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* PageLayoutContentRegion - content region of the page
|
|
28
|
+
*/
|
|
29
|
+
export interface PageLayoutContentRegionProps extends HTMLAttributes<HTMLDivElement> {
|
|
30
|
+
/**
|
|
31
|
+
* Background color of the content region
|
|
32
|
+
* - 'white': White background
|
|
33
|
+
* - 'gray': Gray background
|
|
34
|
+
* @default 'white'
|
|
35
|
+
*/
|
|
36
|
+
backgroundColor?: 'white' | 'gray';
|
|
37
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SideBarItemProps, SideBarGroupProps } from './types';
|
|
2
|
-
export declare const SideBarItem: import('react').ForwardRefExoticComponent<SideBarItemProps & import('react').RefAttributes<
|
|
2
|
+
export declare const SideBarItem: import('react').ForwardRefExoticComponent<SideBarItemProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
3
3
|
export declare const SideBarGroup: import('react').ForwardRefExoticComponent<SideBarGroupProps & import('react').RefAttributes<HTMLLIElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SideBarProps } from './types';
|
|
2
2
|
export declare const SideBar: import('react').ForwardRefExoticComponent<SideBarProps & import('react').RefAttributes<HTMLElement>> & {
|
|
3
|
-
Item: import('react').ForwardRefExoticComponent<import('./types').SideBarItemProps & import('react').RefAttributes<
|
|
3
|
+
Item: import('react').ForwardRefExoticComponent<import('./types').SideBarItemProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
4
4
|
Group: import('react').ForwardRefExoticComponent<import('./types').SideBarGroupProps & import('react').RefAttributes<HTMLLIElement>>;
|
|
5
5
|
};
|
|
@@ -1,31 +1,43 @@
|
|
|
1
|
-
import { HTMLAttributes, AnchorHTMLAttributes, ReactNode
|
|
1
|
+
import { HTMLAttributes, AnchorHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Props for the SideBar root component
|
|
4
4
|
*/
|
|
5
5
|
export interface SideBarProps extends HTMLAttributes<HTMLElement> {
|
|
6
6
|
/**
|
|
7
|
-
* Children nodes (
|
|
7
|
+
* Children nodes (SideBar.Item, SideBar.Group)
|
|
8
8
|
*/
|
|
9
9
|
children: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Whether the sidebar starts in collapsed state
|
|
12
|
+
* @default false (expanded)
|
|
13
|
+
*/
|
|
14
|
+
defaultCollapsed?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Callback when collapse state changes
|
|
17
|
+
*/
|
|
18
|
+
onCollapseChange?: (collapsed: boolean) => void;
|
|
10
19
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
interface SideBarItemBaseAsButton extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
20
|
+
/**
|
|
21
|
+
* Props for the SideBar.Item component (anchor only)
|
|
22
|
+
*/
|
|
23
|
+
export interface SideBarItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
24
|
+
/**
|
|
25
|
+
* Whether this item is currently active/selected
|
|
26
|
+
*/
|
|
19
27
|
active?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Icon element to display
|
|
30
|
+
*/
|
|
20
31
|
icon?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Text label for the item
|
|
34
|
+
*/
|
|
21
35
|
children: ReactNode;
|
|
22
|
-
|
|
23
|
-
|
|
36
|
+
/**
|
|
37
|
+
* URL for the anchor
|
|
38
|
+
*/
|
|
39
|
+
href: AnchorHTMLAttributes<HTMLAnchorElement>['href'];
|
|
24
40
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Props for the SideBar.Item component (polymorphic: anchor or button)
|
|
27
|
-
*/
|
|
28
|
-
export type SideBarItemProps = SideBarItemBaseAsAnchor | SideBarItemBaseAsButton;
|
|
29
41
|
/**
|
|
30
42
|
* Props for the SideBar.Group component
|
|
31
43
|
*/
|
|
@@ -35,8 +47,33 @@ export interface SideBarGroupProps extends HTMLAttributes<HTMLLIElement> {
|
|
|
35
47
|
*/
|
|
36
48
|
label: ReactNode;
|
|
37
49
|
/**
|
|
38
|
-
* Children (SideBar.Item)
|
|
50
|
+
* Children (SideBar.Item elements)
|
|
39
51
|
*/
|
|
40
52
|
children: ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* Icon element to display
|
|
55
|
+
*/
|
|
56
|
+
icon?: ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the group's children are expanded by default
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
defaultExpanded?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Context value for sidebar state
|
|
65
|
+
*/
|
|
66
|
+
export interface SideBarContextValue {
|
|
67
|
+
/**
|
|
68
|
+
* Whether the sidebar is currently collapsed
|
|
69
|
+
*/
|
|
70
|
+
isCollapsed: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Toggle the collapsed state
|
|
73
|
+
*/
|
|
74
|
+
toggleCollapsed: () => void;
|
|
75
|
+
/**
|
|
76
|
+
* Expand the sidebar (set to expanded state)
|
|
77
|
+
*/
|
|
78
|
+
expandSidebar: () => void;
|
|
41
79
|
}
|
|
42
|
-
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { HTMLAttributes, MouseEvent, ReactNode
|
|
1
|
+
import { HTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { PopoverPlacement } from '../../utils/popover';
|
|
2
3
|
export type MenuSize = 'sm' | 'md';
|
|
3
|
-
export type MenuPlacement = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end' | 'auto';
|
|
4
4
|
/**
|
|
5
5
|
* Props for Menu
|
|
6
6
|
*/
|
|
7
7
|
export interface MenuProps {
|
|
8
|
-
/** Whether the menu is open (controlled
|
|
8
|
+
/** Whether the menu is open (controlled) */
|
|
9
9
|
isOpen: boolean;
|
|
10
|
-
/** Callback when
|
|
11
|
-
|
|
10
|
+
/** Callback when the menu closes */
|
|
11
|
+
onClose: () => void;
|
|
12
12
|
/** Menu size variant */
|
|
13
13
|
size?: MenuSize;
|
|
14
14
|
/** Menu content (MenuContent/MenuItem) */
|
|
@@ -16,9 +16,9 @@ export interface MenuProps {
|
|
|
16
16
|
/** Trigger element */
|
|
17
17
|
children: ReactNode;
|
|
18
18
|
/** Preferred placement of the menu relative to trigger */
|
|
19
|
-
placement?:
|
|
20
|
-
/**
|
|
21
|
-
|
|
19
|
+
placement?: PopoverPlacement;
|
|
20
|
+
/** Gap between trigger and menu in pixels */
|
|
21
|
+
gap?: number;
|
|
22
22
|
/** Whether to keep the menu after list item clicked */
|
|
23
23
|
preserve?: boolean;
|
|
24
24
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { MenuProps } from '../../overlays/menu/types';
|
|
3
3
|
import { ButtonProps } from '../button/types';
|
|
4
|
-
export interface ButtonMenuProps extends Omit<ButtonProps, 'content'>, Pick<MenuProps, 'placement' | '
|
|
4
|
+
export interface ButtonMenuProps extends Omit<ButtonProps, 'content'>, Pick<MenuProps, 'placement' | 'preserve'> {
|
|
5
5
|
/**
|
|
6
6
|
* Callback function triggered when the menu open state changes.
|
|
7
7
|
*/
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { IconProps } from '../icon';
|
|
3
3
|
import { ButtonIconProps } from '../button-icon';
|
|
4
4
|
import { MenuProps } from '../../overlays/menu/types';
|
|
5
|
-
export interface ButtonMenuIconProps extends Omit<ButtonIconProps, 'content'>, Pick<IconProps, 'as'>, Pick<MenuProps, 'placement' | '
|
|
5
|
+
export interface ButtonMenuIconProps extends Omit<ButtonIconProps, 'content'>, Pick<IconProps, 'as'>, Pick<MenuProps, 'placement' | 'preserve'> {
|
|
6
6
|
/**
|
|
7
7
|
* Callback function triggered when the menu open state changes.
|
|
8
8
|
*/
|