@vinyasa/navigation 1.0.26
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/README.md +45 -0
- package/dist/cjs/breadcrumbs.cjs +240 -0
- package/dist/cjs/breadcrumbs.css +58 -0
- package/dist/cjs/command-navigation.cjs +215 -0
- package/dist/cjs/command-navigation.css +46 -0
- package/dist/cjs/index.cjs +2681 -0
- package/dist/cjs/index.css +1162 -0
- package/dist/cjs/navigation-menu.cjs +302 -0
- package/dist/cjs/navigation-menu.css +197 -0
- package/dist/cjs/pagination.cjs +462 -0
- package/dist/cjs/pagination.css +79 -0
- package/dist/cjs/sidebar.cjs +476 -0
- package/dist/cjs/sidebar.css +171 -0
- package/dist/cjs/stepper.cjs +270 -0
- package/dist/cjs/stepper.css +153 -0
- package/dist/cjs/tabs.cjs +260 -0
- package/dist/cjs/tabs.css +122 -0
- package/dist/cjs/top-navigation.cjs +363 -0
- package/dist/cjs/top-navigation.css +127 -0
- package/dist/cjs/tree-view.cjs +373 -0
- package/dist/cjs/tree-view.css +109 -0
- package/dist/cjs/workspace-switcher.cjs +249 -0
- package/dist/cjs/workspace-switcher.css +100 -0
- package/dist/esm/217.css +79 -0
- package/dist/esm/217.js +202 -0
- package/dist/esm/294.css +100 -0
- package/dist/esm/294.js +114 -0
- package/dist/esm/375.css +153 -0
- package/dist/esm/375.js +120 -0
- package/dist/esm/555.css +171 -0
- package/dist/esm/555.js +232 -0
- package/dist/esm/655.css +58 -0
- package/dist/esm/655.js +87 -0
- package/dist/esm/66.css +46 -0
- package/dist/esm/66.js +92 -0
- package/dist/esm/694.css +109 -0
- package/dist/esm/694.js +227 -0
- package/dist/esm/814.css +197 -0
- package/dist/esm/814.js +146 -0
- package/dist/esm/862.css +127 -0
- package/dist/esm/862.js +130 -0
- package/dist/esm/913.css +119 -0
- package/dist/esm/913.js +121 -0
- package/dist/esm/953.js +87 -0
- package/dist/esm/breadcrumbs.d.ts +2 -0
- package/dist/esm/breadcrumbs.js +1 -0
- package/dist/esm/command-navigation.d.ts +2 -0
- package/dist/esm/command-navigation.js +1 -0
- package/dist/esm/components/breadcrumbs/Breadcrumbs.css.d.ts +6 -0
- package/dist/esm/components/breadcrumbs/Breadcrumbs.d.ts +58 -0
- package/dist/esm/components/breadcrumbs/index.d.ts +1 -0
- package/dist/esm/components/command-navigation/CommandNavigation.css.d.ts +4 -0
- package/dist/esm/components/command-navigation/CommandNavigation.d.ts +50 -0
- package/dist/esm/components/command-navigation/index.d.ts +1 -0
- package/dist/esm/components/navigation-menu/NavigationMenu.css.d.ts +13 -0
- package/dist/esm/components/navigation-menu/NavigationMenu.d.ts +69 -0
- package/dist/esm/components/navigation-menu/index.d.ts +1 -0
- package/dist/esm/components/pagination/Pagination.css.d.ts +13 -0
- package/dist/esm/components/pagination/Pagination.d.ts +69 -0
- package/dist/esm/components/pagination/getPaginationRange.d.ts +15 -0
- package/dist/esm/components/pagination/index.d.ts +2 -0
- package/dist/esm/components/sidebar/Sidebar.css.d.ts +60 -0
- package/dist/esm/components/sidebar/Sidebar.d.ts +82 -0
- package/dist/esm/components/sidebar/index.d.ts +1 -0
- package/dist/esm/components/stepper/Stepper.css.d.ts +10 -0
- package/dist/esm/components/stepper/Stepper.d.ts +57 -0
- package/dist/esm/components/stepper/index.d.ts +1 -0
- package/dist/esm/components/tabs/Tabs.css.d.ts +6 -0
- package/dist/esm/components/tabs/Tabs.d.ts +39 -0
- package/dist/esm/components/tabs/index.d.ts +1 -0
- package/dist/esm/components/top-navigation/TopNavigation.css.d.ts +13 -0
- package/dist/esm/components/top-navigation/TopNavigation.d.ts +67 -0
- package/dist/esm/components/top-navigation/index.d.ts +1 -0
- package/dist/esm/components/tree-view/TreeView.css.d.ts +8 -0
- package/dist/esm/components/tree-view/TreeView.d.ts +43 -0
- package/dist/esm/components/tree-view/index.d.ts +1 -0
- package/dist/esm/components/workspace-switcher/WorkspaceSwitcher.css.d.ts +9 -0
- package/dist/esm/components/workspace-switcher/WorkspaceSwitcher.d.ts +43 -0
- package/dist/esm/components/workspace-switcher/index.d.ts +1 -0
- package/dist/esm/index.d.ts +10 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/navigation-menu.d.ts +2 -0
- package/dist/esm/navigation-menu.js +1 -0
- package/dist/esm/pagination.d.ts +2 -0
- package/dist/esm/pagination.js +1 -0
- package/dist/esm/sidebar.d.ts +2 -0
- package/dist/esm/sidebar.js +1 -0
- package/dist/esm/stepper.d.ts +2 -0
- package/dist/esm/stepper.js +1 -0
- package/dist/esm/tabs.d.ts +2 -0
- package/dist/esm/tabs.js +1 -0
- package/dist/esm/top-navigation.d.ts +2 -0
- package/dist/esm/top-navigation.js +1 -0
- package/dist/esm/tree-view.d.ts +2 -0
- package/dist/esm/tree-view.js +1 -0
- package/dist/esm/workspace-switcher.d.ts +2 -0
- package/dist/esm/workspace-switcher.js +1 -0
- package/package.json +146 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as RadixNavigationMenu from '@radix-ui/react-navigation-menu';
|
|
2
|
+
import { type ElementType, type ReactNode } from 'react';
|
|
3
|
+
export type NavigationMenuRootProps = RadixNavigationMenu.NavigationMenuProps;
|
|
4
|
+
export type NavigationMenuListProps = RadixNavigationMenu.NavigationMenuListProps;
|
|
5
|
+
export type NavigationMenuItemProps = RadixNavigationMenu.NavigationMenuItemProps;
|
|
6
|
+
export type NavigationMenuTriggerProps = RadixNavigationMenu.NavigationMenuTriggerProps;
|
|
7
|
+
export type NavigationMenuLinkProps = RadixNavigationMenu.NavigationMenuLinkProps;
|
|
8
|
+
export type NavigationMenuContentProps = RadixNavigationMenu.NavigationMenuContentProps;
|
|
9
|
+
export type NavigationMenuIndicatorProps = RadixNavigationMenu.NavigationMenuIndicatorProps;
|
|
10
|
+
export type NavigationMenuViewportProps = RadixNavigationMenu.NavigationMenuViewportProps;
|
|
11
|
+
export interface NavigationMenuLinkSpec {
|
|
12
|
+
/** Unique within the menu — used as the React key. */
|
|
13
|
+
key: string;
|
|
14
|
+
label: ReactNode;
|
|
15
|
+
href?: string;
|
|
16
|
+
/** Shown under `label` inside a dropdown panel. Ignored on a top-level item with no `content`. */
|
|
17
|
+
description?: ReactNode;
|
|
18
|
+
/** Marks this as the current page. */
|
|
19
|
+
active?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface NavigationMenuItemSpec {
|
|
22
|
+
/** Unique within the menu — used as the React key. */
|
|
23
|
+
key: string;
|
|
24
|
+
label: ReactNode;
|
|
25
|
+
/** A plain, non-dropdown item when set instead of `links`. */
|
|
26
|
+
href?: string;
|
|
27
|
+
/** Marks this as the current page. Only meaningful alongside `href` — a trigger's own open/closed state is tracked separately. */
|
|
28
|
+
active?: boolean;
|
|
29
|
+
/** Renders a dropdown panel listing these as a grid instead of a plain link. */
|
|
30
|
+
links?: NavigationMenuLinkSpec[];
|
|
31
|
+
}
|
|
32
|
+
export interface NavigationMenuProps extends Omit<NavigationMenuRootProps, 'children'> {
|
|
33
|
+
items: NavigationMenuItemSpec[];
|
|
34
|
+
/**
|
|
35
|
+
* Component to render an item's link with — swap in your router's own
|
|
36
|
+
* `Link` for client-side navigation instead of a plain `<a>`'s full page
|
|
37
|
+
* reload. Applies to every rendered link, top-level and inside a
|
|
38
|
+
* dropdown panel alike. Defaults to `'a'`.
|
|
39
|
+
*/
|
|
40
|
+
linkComponent?: ElementType;
|
|
41
|
+
}
|
|
42
|
+
export declare const NavigationMenu: {
|
|
43
|
+
({ items, linkComponent, ...rest }: NavigationMenuProps): import("react").JSX.Element;
|
|
44
|
+
displayName: string;
|
|
45
|
+
} & {
|
|
46
|
+
Root: import("react").ForwardRefExoticComponent<RadixNavigationMenu.NavigationMenuProps & import("react").RefAttributes<HTMLElement>>;
|
|
47
|
+
List: {
|
|
48
|
+
({ className, ...rest }: NavigationMenuListProps): import("react").JSX.Element;
|
|
49
|
+
displayName: string;
|
|
50
|
+
};
|
|
51
|
+
Item: import("react").ForwardRefExoticComponent<RadixNavigationMenu.NavigationMenuItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
52
|
+
Trigger: import("react").ForwardRefExoticComponent<RadixNavigationMenu.NavigationMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
53
|
+
Link: {
|
|
54
|
+
({ className, ...rest }: NavigationMenuLinkProps): import("react").JSX.Element;
|
|
55
|
+
displayName: string;
|
|
56
|
+
};
|
|
57
|
+
Content: {
|
|
58
|
+
({ className, ...rest }: NavigationMenuContentProps): import("react").JSX.Element;
|
|
59
|
+
displayName: string;
|
|
60
|
+
};
|
|
61
|
+
Indicator: {
|
|
62
|
+
({ className, ...rest }: NavigationMenuIndicatorProps): import("react").JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
Viewport: {
|
|
66
|
+
({ className, ...rest }: NavigationMenuViewportProps): import("react").JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NavigationMenu, type NavigationMenuContentProps, type NavigationMenuIndicatorProps, type NavigationMenuItemProps, type NavigationMenuItemSpec, type NavigationMenuLinkProps, type NavigationMenuLinkSpec, type NavigationMenuListProps, type NavigationMenuProps, type NavigationMenuRootProps, type NavigationMenuTriggerProps, type NavigationMenuViewportProps, } from './NavigationMenu';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const list: string;
|
|
2
|
+
export declare const item: string;
|
|
3
|
+
export declare const indicator: string;
|
|
4
|
+
export declare const link: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
5
|
+
active: {
|
|
6
|
+
true: {
|
|
7
|
+
color: `var(--${string})`;
|
|
8
|
+
fontWeight: `var(--${string})`;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
export declare const ellipsis: string;
|
|
13
|
+
export declare const boundaryIcon: string;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ElementType, type ReactNode } from 'react';
|
|
2
|
+
export type PaginationRootProps = ComponentPropsWithoutRef<'nav'>;
|
|
3
|
+
export type PaginationListProps = ComponentPropsWithoutRef<'ul'>;
|
|
4
|
+
export type PaginationItemProps = ComponentPropsWithoutRef<'li'>;
|
|
5
|
+
export interface PaginationLinkProps extends ComponentPropsWithoutRef<'button'> {
|
|
6
|
+
/** Renders as this element/component instead of a native `<button>` — e.g. an `<a>` or your router's own `Link`, for a page reachable by real URL. */
|
|
7
|
+
as?: ElementType;
|
|
8
|
+
/** Marks this as the current page. */
|
|
9
|
+
active?: boolean;
|
|
10
|
+
/** Only meaningful when `as` renders an anchor — not part of `<button>`'s own props. */
|
|
11
|
+
href?: string;
|
|
12
|
+
}
|
|
13
|
+
export type PaginationEllipsisProps = ComponentPropsWithoutRef<'span'>;
|
|
14
|
+
export interface PaginationPreviousProps extends Omit<PaginationLinkProps, 'active' | 'children'> {
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export interface PaginationNextProps extends Omit<PaginationLinkProps, 'active' | 'children'> {
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export interface PaginationProps extends Omit<PaginationRootProps, 'onChange'> {
|
|
21
|
+
/** Current page, 1-indexed. */
|
|
22
|
+
page: number;
|
|
23
|
+
totalPages: number;
|
|
24
|
+
onPageChange: (page: number) => void;
|
|
25
|
+
/** How many pages stay visible on each side of the current page. Defaults to 1. */
|
|
26
|
+
siblingCount?: number;
|
|
27
|
+
/** How many pages stay visible at the very start/end of the trail. Defaults to 1. */
|
|
28
|
+
boundaryCount?: number;
|
|
29
|
+
/**
|
|
30
|
+
* When given, every page (including Previous/Next) renders as a real,
|
|
31
|
+
* independently-navigable link instead of a button — `onPageChange`
|
|
32
|
+
* still fires either way, for keeping your own state in sync. Receives
|
|
33
|
+
* the target page number.
|
|
34
|
+
*/
|
|
35
|
+
getHref?: (page: number) => string;
|
|
36
|
+
/**
|
|
37
|
+
* Component to render a page's link with when `getHref` is set — swap in
|
|
38
|
+
* your router's own `Link` for client-side navigation instead of a plain
|
|
39
|
+
* `<a>`'s full page reload. Defaults to `'a'`.
|
|
40
|
+
*/
|
|
41
|
+
linkComponent?: ElementType;
|
|
42
|
+
}
|
|
43
|
+
export declare const Pagination: {
|
|
44
|
+
({ page, totalPages, onPageChange, siblingCount, boundaryCount, getHref, linkComponent, ...rest }: PaginationProps): import("react").JSX.Element;
|
|
45
|
+
displayName: string;
|
|
46
|
+
} & {
|
|
47
|
+
Root: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
48
|
+
List: {
|
|
49
|
+
({ className, children, ...rest }: PaginationListProps): import("react").JSX.Element;
|
|
50
|
+
displayName: string;
|
|
51
|
+
};
|
|
52
|
+
Item: {
|
|
53
|
+
({ className, ...rest }: PaginationItemProps): import("react").JSX.Element;
|
|
54
|
+
displayName: string;
|
|
55
|
+
};
|
|
56
|
+
Link: import("react").ForwardRefExoticComponent<PaginationLinkProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
57
|
+
Previous: {
|
|
58
|
+
({ children, ...rest }: PaginationPreviousProps): import("react").JSX.Element;
|
|
59
|
+
displayName: string;
|
|
60
|
+
};
|
|
61
|
+
Next: {
|
|
62
|
+
({ children, ...rest }: PaginationNextProps): import("react").JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
Ellipsis: {
|
|
66
|
+
({ className, children, ...rest }: PaginationEllipsisProps): import("react").JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const ELLIPSIS: "ellipsis";
|
|
2
|
+
export type PaginationRangeItem = number | typeof ELLIPSIS;
|
|
3
|
+
/**
|
|
4
|
+
* Computes which page numbers to render, collapsing the middle into a
|
|
5
|
+
* single ellipsis once the trail gets too long to show in full — always
|
|
6
|
+
* keeping the first/last `boundaryCount` pages and the `siblingCount`
|
|
7
|
+
* pages on either side of `page` visible.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately pads the range near a boundary rather than collapsing as
|
|
10
|
+
* soon as siblingCount/boundaryCount allow: a single hidden page never
|
|
11
|
+
* becomes an ellipsis (`1 2 [3] 4 5` shows `3` directly, not `…`), which
|
|
12
|
+
* is what keeps `page=1` from looking as sparse as `1 2 … 20` — the shape
|
|
13
|
+
* this follows is the same one GitHub/MUI's pagination controls use.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getPaginationRange: (page: number, totalPages: number, siblingCount?: number, boundaryCount?: number) => PaginationRangeItem[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Pagination, type PaginationEllipsisProps, type PaginationItemProps, type PaginationLinkProps, type PaginationListProps, type PaginationNextProps, type PaginationPreviousProps, type PaginationProps, type PaginationRootProps, } from './Pagination';
|
|
2
|
+
export { ELLIPSIS, getPaginationRange, type PaginationRangeItem } from './getPaginationRange';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare const root: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
2
|
+
collapsed: {
|
|
3
|
+
true: {
|
|
4
|
+
width: "4.5rem";
|
|
5
|
+
};
|
|
6
|
+
false: {
|
|
7
|
+
width: "16rem";
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}>;
|
|
11
|
+
export declare const header: string;
|
|
12
|
+
export declare const truncatedContent: string;
|
|
13
|
+
export declare const content: string;
|
|
14
|
+
export declare const footer: string;
|
|
15
|
+
export declare const section: string;
|
|
16
|
+
export declare const sectionLabel: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
17
|
+
collapsed: {
|
|
18
|
+
true: {
|
|
19
|
+
opacity: number;
|
|
20
|
+
pointerEvents: "none";
|
|
21
|
+
};
|
|
22
|
+
false: {
|
|
23
|
+
opacity: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}>;
|
|
27
|
+
export declare const item: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
28
|
+
active: {
|
|
29
|
+
true: {
|
|
30
|
+
backgroundColor: `var(--${string})`;
|
|
31
|
+
color: `var(--${string})`;
|
|
32
|
+
fontWeight: `var(--${string})`;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
collapsed: {
|
|
36
|
+
true: {
|
|
37
|
+
justifyContent: "center";
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
}>;
|
|
41
|
+
export declare const itemIcon: string;
|
|
42
|
+
export declare const itemLabel: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
43
|
+
collapsed: {
|
|
44
|
+
true: {
|
|
45
|
+
width: number;
|
|
46
|
+
opacity: number;
|
|
47
|
+
};
|
|
48
|
+
false: {
|
|
49
|
+
opacity: number;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
}>;
|
|
53
|
+
export declare const collapseTrigger: string;
|
|
54
|
+
export declare const collapseTriggerIcon: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
55
|
+
collapsed: {
|
|
56
|
+
true: {
|
|
57
|
+
transform: "rotate(180deg)";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
}>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ElementType, type ReactNode } from 'react';
|
|
2
|
+
/** Whether the enclosing `Sidebar.Root` is currently collapsed — for a consumer's own header/footer content to adapt to. */
|
|
3
|
+
export declare const useSidebarCollapsed: () => boolean;
|
|
4
|
+
export interface SidebarRootProps extends ComponentPropsWithoutRef<'nav'> {
|
|
5
|
+
collapsed?: boolean;
|
|
6
|
+
defaultCollapsed?: boolean;
|
|
7
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
export type SidebarHeaderProps = ComponentPropsWithoutRef<'div'>;
|
|
10
|
+
export type SidebarContentProps = ComponentPropsWithoutRef<'div'>;
|
|
11
|
+
export type SidebarFooterProps = ComponentPropsWithoutRef<'div'>;
|
|
12
|
+
export interface SidebarSectionProps extends ComponentPropsWithoutRef<'div'> {
|
|
13
|
+
label?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export interface SidebarItemProps extends ComponentPropsWithoutRef<'button'> {
|
|
16
|
+
/** Renders as this element/component instead of a native `<button>` — e.g. your router's own `Link`, for real navigation instead of a click handler. */
|
|
17
|
+
as?: ElementType;
|
|
18
|
+
icon?: ReactNode;
|
|
19
|
+
/** Marks this as the current page/section. */
|
|
20
|
+
active?: boolean;
|
|
21
|
+
/** Only meaningful when `as="a"` (or a router `Link`) — not part of `<button>`'s own props. */
|
|
22
|
+
href?: string;
|
|
23
|
+
}
|
|
24
|
+
export type SidebarCollapseTriggerProps = ComponentPropsWithoutRef<'button'>;
|
|
25
|
+
export interface SidebarItemSpec {
|
|
26
|
+
/** Unique within the sidebar — used as the React key. */
|
|
27
|
+
key: string;
|
|
28
|
+
label: ReactNode;
|
|
29
|
+
icon?: ReactNode;
|
|
30
|
+
active?: boolean;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
href?: string;
|
|
33
|
+
onClick?: () => void;
|
|
34
|
+
}
|
|
35
|
+
export interface SidebarSectionSpec {
|
|
36
|
+
/** Unique within the sidebar — used as the React key. */
|
|
37
|
+
key: string;
|
|
38
|
+
label?: ReactNode;
|
|
39
|
+
items: SidebarItemSpec[];
|
|
40
|
+
}
|
|
41
|
+
export interface SidebarProps extends Pick<SidebarRootProps, 'collapsed' | 'defaultCollapsed' | 'onCollapsedChange'> {
|
|
42
|
+
header?: ReactNode;
|
|
43
|
+
footer?: ReactNode;
|
|
44
|
+
sections: SidebarSectionSpec[];
|
|
45
|
+
/** Renders the built-in collapse/expand toggle in the header. Defaults to true. */
|
|
46
|
+
collapsible?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Component to render an item with when it has an `href` — swap in your
|
|
49
|
+
* router's own `Link` for client-side navigation instead of a plain
|
|
50
|
+
* `<a>`'s full page reload. Receives `href` like a native anchor; if your
|
|
51
|
+
* router's `Link` takes `to` instead, wrap it: `({ href, ...props }) =>
|
|
52
|
+
* <RouterLink to={href} {...props} />`. Defaults to `'a'`.
|
|
53
|
+
*/
|
|
54
|
+
linkComponent?: ElementType;
|
|
55
|
+
}
|
|
56
|
+
export declare const Sidebar: {
|
|
57
|
+
({ header: headerContent, footer: footerContent, sections, collapsible, linkComponent, collapsed, defaultCollapsed, onCollapsedChange, }: SidebarProps): import("react").JSX.Element;
|
|
58
|
+
displayName: string;
|
|
59
|
+
} & {
|
|
60
|
+
Root: import("react").ForwardRefExoticComponent<SidebarRootProps & import("react").RefAttributes<HTMLElement>>;
|
|
61
|
+
Header: {
|
|
62
|
+
({ className, ...rest }: SidebarHeaderProps): import("react").JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
Content: {
|
|
66
|
+
({ className, ...rest }: SidebarContentProps): import("react").JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
69
|
+
Section: {
|
|
70
|
+
({ label, className, children, ...rest }: SidebarSectionProps): import("react").JSX.Element;
|
|
71
|
+
displayName: string;
|
|
72
|
+
};
|
|
73
|
+
Item: import("react").ForwardRefExoticComponent<SidebarItemProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
74
|
+
Footer: {
|
|
75
|
+
({ className, ...rest }: SidebarFooterProps): import("react").JSX.Element;
|
|
76
|
+
displayName: string;
|
|
77
|
+
};
|
|
78
|
+
CollapseTrigger: {
|
|
79
|
+
({ className, ...rest }: SidebarCollapseTriggerProps): import("react").JSX.Element;
|
|
80
|
+
displayName: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Sidebar, useSidebarCollapsed, type SidebarContentProps, type SidebarFooterProps, type SidebarHeaderProps, type SidebarItemProps, type SidebarItemSpec, type SidebarProps, type SidebarRootProps, type SidebarSectionProps, type SidebarSectionSpec, } from './Sidebar';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const root: string;
|
|
2
|
+
export declare const step: string;
|
|
3
|
+
export declare const indicatorArea: string;
|
|
4
|
+
export declare const connector: string;
|
|
5
|
+
export declare const indicator: string;
|
|
6
|
+
export declare const indicatorIcon: string;
|
|
7
|
+
export declare const indicatorButton: string;
|
|
8
|
+
export declare const content: string;
|
|
9
|
+
export declare const label: string;
|
|
10
|
+
export declare const description: string;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
export type StepperOrientation = 'horizontal' | 'vertical';
|
|
3
|
+
export type StepperState = 'upcoming' | 'current' | 'completed' | 'error';
|
|
4
|
+
export interface StepperRootProps extends ComponentPropsWithoutRef<'ol'> {
|
|
5
|
+
orientation?: StepperOrientation;
|
|
6
|
+
}
|
|
7
|
+
export interface StepperStepProps extends ComponentPropsWithoutRef<'li'> {
|
|
8
|
+
/** Defaults to `'upcoming'`. */
|
|
9
|
+
state?: StepperState;
|
|
10
|
+
}
|
|
11
|
+
export interface StepperIndicatorProps extends ComponentPropsWithoutRef<'button'> {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export type StepperContentProps = ComponentPropsWithoutRef<'div'>;
|
|
15
|
+
export type StepperLabelProps = ComponentPropsWithoutRef<'span'>;
|
|
16
|
+
export type StepperDescriptionProps = ComponentPropsWithoutRef<'span'>;
|
|
17
|
+
export interface StepperStepSpec {
|
|
18
|
+
/** Unique within the sequence — used as the React key. Defaults to the step's index. */
|
|
19
|
+
key?: string;
|
|
20
|
+
label: ReactNode;
|
|
21
|
+
description?: ReactNode;
|
|
22
|
+
/** Overrides the computed state for this one step — e.g. a validation failure on the current step. */
|
|
23
|
+
error?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface StepperProps extends Omit<StepperRootProps, 'children'> {
|
|
26
|
+
steps: StepperStepSpec[];
|
|
27
|
+
/** 0-indexed: steps before this are `completed`, this one is `current`, the rest are `upcoming`. */
|
|
28
|
+
activeStep: number;
|
|
29
|
+
/** When given, every step's indicator becomes a button calling this with its index — whether jumping ahead makes sense is a decision for the consumer, not this component. */
|
|
30
|
+
onStepClick?: (index: number) => void;
|
|
31
|
+
}
|
|
32
|
+
export declare const Stepper: {
|
|
33
|
+
({ steps, activeStep, onStepClick, ...rest }: StepperProps): import("react").JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
} & {
|
|
36
|
+
Root: import("react").ForwardRefExoticComponent<StepperRootProps & import("react").RefAttributes<HTMLOListElement>>;
|
|
37
|
+
Step: {
|
|
38
|
+
({ state, className, ...rest }: StepperStepProps): import("react").JSX.Element;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
41
|
+
Indicator: {
|
|
42
|
+
({ children, onClick, className, ...rest }: StepperIndicatorProps): import("react").JSX.Element;
|
|
43
|
+
displayName: string;
|
|
44
|
+
};
|
|
45
|
+
Content: {
|
|
46
|
+
({ className, ...rest }: StepperContentProps): import("react").JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
49
|
+
Label: {
|
|
50
|
+
({ className, ...rest }: StepperLabelProps): import("react").JSX.Element;
|
|
51
|
+
displayName: string;
|
|
52
|
+
};
|
|
53
|
+
Description: {
|
|
54
|
+
({ className, ...rest }: StepperDescriptionProps): import("react").JSX.Element;
|
|
55
|
+
displayName: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Stepper, type StepperContentProps, type StepperDescriptionProps, type StepperIndicatorProps, type StepperLabelProps, type StepperOrientation, type StepperProps, type StepperRootProps, type StepperState, type StepperStepProps, type StepperStepSpec, } from './Stepper';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as RadixTabs from '@radix-ui/react-tabs';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
export type TabsRootProps = RadixTabs.TabsProps;
|
|
4
|
+
export type TabsListProps = RadixTabs.TabsListProps;
|
|
5
|
+
export type TabsTriggerProps = RadixTabs.TabsTriggerProps;
|
|
6
|
+
export type TabsContentProps = Omit<RadixTabs.TabsContentProps, 'forceMount'>;
|
|
7
|
+
export interface TabsContentGroupProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TabsItemSpec {
|
|
12
|
+
/** Unique within the tab list — also Radix's own selection key. */
|
|
13
|
+
value: string;
|
|
14
|
+
label: ReactNode;
|
|
15
|
+
content: ReactNode;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface TabsProps extends Omit<TabsRootProps, 'children'> {
|
|
19
|
+
tabs: TabsItemSpec[];
|
|
20
|
+
}
|
|
21
|
+
export declare const Tabs: {
|
|
22
|
+
({ tabs, ...rest }: TabsProps): import("react").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
} & {
|
|
25
|
+
Root: import("react").ForwardRefExoticComponent<RadixTabs.TabsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
|
+
List: {
|
|
27
|
+
({ className, children, ...rest }: TabsListProps): import("react").JSX.Element;
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
30
|
+
Trigger: import("react").ForwardRefExoticComponent<RadixTabs.TabsTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
31
|
+
Content: {
|
|
32
|
+
({ className, ...rest }: TabsContentProps): import("react").JSX.Element;
|
|
33
|
+
displayName: string;
|
|
34
|
+
};
|
|
35
|
+
ContentGroup: {
|
|
36
|
+
({ children, className }: TabsContentGroupProps): import("react").JSX.Element;
|
|
37
|
+
displayName: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tabs, type TabsContentGroupProps, type TabsContentProps, type TabsItemSpec, type TabsListProps, type TabsProps, type TabsRootProps, type TabsTriggerProps, } from './Tabs';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const root: string;
|
|
2
|
+
export declare const brand: string;
|
|
3
|
+
export declare const content: string;
|
|
4
|
+
export declare const actions: string;
|
|
5
|
+
export declare const item: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
6
|
+
active: {
|
|
7
|
+
true: {
|
|
8
|
+
borderBottomColor: `var(--${string})`;
|
|
9
|
+
color: `var(--${string})`;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
export declare const mobileTrigger: string;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ElementType, type ReactNode } from 'react';
|
|
2
|
+
export interface TopNavigationRootProps extends ComponentPropsWithoutRef<'nav'> {
|
|
3
|
+
/** Whether the below-`md` mobile menu is open. */
|
|
4
|
+
open?: boolean;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface TopNavigationBrandProps extends ComponentPropsWithoutRef<'a'> {
|
|
9
|
+
as?: ElementType;
|
|
10
|
+
}
|
|
11
|
+
export type TopNavigationContentProps = ComponentPropsWithoutRef<'div'>;
|
|
12
|
+
export type TopNavigationActionsProps = ComponentPropsWithoutRef<'div'>;
|
|
13
|
+
export interface TopNavigationItemProps extends ComponentPropsWithoutRef<'button'> {
|
|
14
|
+
/** Renders as this element/component instead of a native `<button>` — e.g. your router's own `Link`. */
|
|
15
|
+
as?: ElementType;
|
|
16
|
+
/** Marks this as the current page/section. */
|
|
17
|
+
active?: boolean;
|
|
18
|
+
/** Only meaningful when `as="a"` (or a router `Link`) — not part of `<button>`'s own props. */
|
|
19
|
+
href?: string;
|
|
20
|
+
}
|
|
21
|
+
export type TopNavigationMobileTriggerProps = ComponentPropsWithoutRef<'button'>;
|
|
22
|
+
export interface TopNavigationItemSpec {
|
|
23
|
+
/** Unique within the bar — used as the React key. */
|
|
24
|
+
key: string;
|
|
25
|
+
label: ReactNode;
|
|
26
|
+
active?: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
href?: string;
|
|
29
|
+
onClick?: () => void;
|
|
30
|
+
}
|
|
31
|
+
export interface TopNavigationProps extends Pick<TopNavigationRootProps, 'open' | 'defaultOpen' | 'onOpenChange'> {
|
|
32
|
+
brand?: ReactNode;
|
|
33
|
+
brandHref?: string;
|
|
34
|
+
items: TopNavigationItemSpec[];
|
|
35
|
+
actions?: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Component to render the brand and any `href` item with — swap in your
|
|
38
|
+
* router's own `Link` for client-side navigation instead of a plain
|
|
39
|
+
* `<a>`'s full page reload. Receives `href` like a native anchor; if your
|
|
40
|
+
* router's `Link` takes `to` instead, wrap it: `({ href, ...props }) =>
|
|
41
|
+
* <RouterLink to={href} {...props} />`. Defaults to `'a'`.
|
|
42
|
+
*/
|
|
43
|
+
linkComponent?: ElementType;
|
|
44
|
+
}
|
|
45
|
+
export declare const TopNavigation: {
|
|
46
|
+
({ brand: brandContent, brandHref, items, actions: actionsContent, linkComponent, open, defaultOpen, onOpenChange, }: TopNavigationProps): import("react").JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
} & {
|
|
49
|
+
Root: import("react").ForwardRefExoticComponent<TopNavigationRootProps & import("react").RefAttributes<HTMLElement>>;
|
|
50
|
+
Brand: {
|
|
51
|
+
({ as: Component, className, ...rest }: TopNavigationBrandProps): import("react").JSX.Element;
|
|
52
|
+
displayName: string;
|
|
53
|
+
};
|
|
54
|
+
Content: {
|
|
55
|
+
({ className, ...rest }: TopNavigationContentProps): import("react").JSX.Element;
|
|
56
|
+
displayName: string;
|
|
57
|
+
};
|
|
58
|
+
Item: import("react").ForwardRefExoticComponent<TopNavigationItemProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
59
|
+
Actions: {
|
|
60
|
+
({ className, ...rest }: TopNavigationActionsProps): import("react").JSX.Element;
|
|
61
|
+
displayName: string;
|
|
62
|
+
};
|
|
63
|
+
MobileTrigger: {
|
|
64
|
+
({ className, ...rest }: TopNavigationMobileTriggerProps): import("react").JSX.Element;
|
|
65
|
+
displayName: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TopNavigation, type TopNavigationActionsProps, type TopNavigationBrandProps, type TopNavigationContentProps, type TopNavigationItemProps, type TopNavigationItemSpec, type TopNavigationMobileTriggerProps, type TopNavigationProps, type TopNavigationRootProps, } from './TopNavigation';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const root: string;
|
|
2
|
+
export declare const group: string;
|
|
3
|
+
export declare const item: string;
|
|
4
|
+
export declare const row: string;
|
|
5
|
+
export declare const expandTrigger: string;
|
|
6
|
+
export declare const expandTriggerSpacer: string;
|
|
7
|
+
export declare const icon: string;
|
|
8
|
+
export declare const label: string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
export interface TreeViewRootProps extends Omit<ComponentPropsWithoutRef<'ul'>, 'onSelect'> {
|
|
3
|
+
selectedId?: string;
|
|
4
|
+
/** Called for both a click and Enter/Space on a treeitem — not the native DOM `onSelect` text-selection event `<ul>` normally has. */
|
|
5
|
+
onSelect?: (id: string) => void;
|
|
6
|
+
expandedIds?: string[];
|
|
7
|
+
defaultExpandedIds?: string[];
|
|
8
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
9
|
+
}
|
|
10
|
+
export type TreeViewGroupProps = ComponentPropsWithoutRef<'ul'>;
|
|
11
|
+
export interface TreeViewItemProps extends Omit<ComponentPropsWithoutRef<'li'>, 'id'> {
|
|
12
|
+
id: string;
|
|
13
|
+
label: ReactNode;
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** A nested `TreeView.Group` — its presence alone makes this a branch node with an expand/collapse trigger. */
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export interface TreeViewNodeSpec {
|
|
20
|
+
/** Unique across the whole tree — used as the React key and passed to `onSelect`/`onExpandedChange`. */
|
|
21
|
+
id: string;
|
|
22
|
+
label: ReactNode;
|
|
23
|
+
icon?: ReactNode;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
children?: TreeViewNodeSpec[];
|
|
26
|
+
}
|
|
27
|
+
export interface TreeViewProps extends Omit<TreeViewRootProps, 'children'> {
|
|
28
|
+
items: TreeViewNodeSpec[];
|
|
29
|
+
}
|
|
30
|
+
export declare const TreeView: {
|
|
31
|
+
({ items, ...rest }: TreeViewProps): import("react").JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
} & {
|
|
34
|
+
Root: import("react").ForwardRefExoticComponent<TreeViewRootProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
35
|
+
Group: {
|
|
36
|
+
({ className, children, ...rest }: TreeViewGroupProps): import("react").JSX.Element;
|
|
37
|
+
displayName: string;
|
|
38
|
+
};
|
|
39
|
+
Item: {
|
|
40
|
+
({ id, label: labelContent, icon: iconContent, disabled, children, className, ...rest }: TreeViewItemProps): import("react").JSX.Element;
|
|
41
|
+
displayName: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TreeView, type TreeViewGroupProps, type TreeViewItemProps, type TreeViewNodeSpec, type TreeViewProps, type TreeViewRootProps, } from './TreeView';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const avatar: string;
|
|
2
|
+
export declare const avatarImage: string;
|
|
3
|
+
export declare const trigger: string;
|
|
4
|
+
export declare const triggerText: string;
|
|
5
|
+
export declare const triggerName: string;
|
|
6
|
+
export declare const triggerDescription: string;
|
|
7
|
+
export declare const triggerIcon: string;
|
|
8
|
+
export declare const item: string;
|
|
9
|
+
export declare const itemCheck: string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
export { avatarImage } from './WorkspaceSwitcher.css';
|
|
3
|
+
export interface WorkspaceSpec {
|
|
4
|
+
/** Unique within the list — used as the React key and passed back to `onWorkspaceChange`. */
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
/** Shown under `name` inside the dropdown — e.g. a plan tier or member count. Not shown on the trigger. */
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
/** A custom avatar (e.g. an `<img className={avatarImage}>`, exported alongside this type) — falls back to `name`'s initials on a solid background. */
|
|
10
|
+
avatar?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface WorkspaceAvatarProps extends ComponentPropsWithoutRef<'span'> {
|
|
13
|
+
workspace: Pick<WorkspaceSpec, 'name' | 'avatar'>;
|
|
14
|
+
}
|
|
15
|
+
export interface WorkspaceSwitcherTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
16
|
+
workspace: WorkspaceSpec;
|
|
17
|
+
}
|
|
18
|
+
export interface WorkspaceSwitcherItemProps {
|
|
19
|
+
workspace: WorkspaceSpec;
|
|
20
|
+
active?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface WorkspaceSwitcherProps {
|
|
23
|
+
workspaces: WorkspaceSpec[];
|
|
24
|
+
activeWorkspaceId: string;
|
|
25
|
+
onWorkspaceChange: (id: string) => void;
|
|
26
|
+
/** Renders a "Create workspace" action below a separator when given. */
|
|
27
|
+
onCreateWorkspace?: () => void;
|
|
28
|
+
createWorkspaceLabel?: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export declare const WorkspaceSwitcher: {
|
|
31
|
+
({ workspaces, activeWorkspaceId, onWorkspaceChange, onCreateWorkspace, createWorkspaceLabel, }: WorkspaceSwitcherProps): import("react").JSX.Element | null;
|
|
32
|
+
displayName: string;
|
|
33
|
+
} & {
|
|
34
|
+
Trigger: import("react").ForwardRefExoticComponent<WorkspaceSwitcherTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
35
|
+
Item: {
|
|
36
|
+
({ workspace, active }: WorkspaceSwitcherItemProps): import("react").JSX.Element;
|
|
37
|
+
displayName: string;
|
|
38
|
+
};
|
|
39
|
+
Avatar: {
|
|
40
|
+
({ workspace, className, ...rest }: WorkspaceAvatarProps): import("react").JSX.Element;
|
|
41
|
+
displayName: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { avatarImage, WorkspaceSwitcher, type WorkspaceAvatarProps, type WorkspaceSpec, type WorkspaceSwitcherItemProps, type WorkspaceSwitcherProps, type WorkspaceSwitcherTriggerProps, } from './WorkspaceSwitcher';
|