@trackunit/react-components 0.1.295 → 0.1.297
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/index.cjs.js +3414 -3303
- package/index.esm.js +3412 -3304
- package/package.json +3 -2
- package/src/components/Breadcrumb/Breadcrumb.d.ts +26 -0
- package/src/components/Breadcrumb/Breadcrumb.variant.d.ts +7 -0
- package/src/components/Breadcrumb/BreadcrumbForLargeScreen.d.ts +6 -0
- package/src/components/Breadcrumb/BreadcrumbForSmallScreen.d.ts +6 -0
- package/src/components/Breadcrumb/BreadcumbForMediumScreen.d.ts +6 -0
- package/src/components/Breadcrumb/index.d.ts +1 -0
- package/src/components/Breadcrumb/utils/types.d.ts +16 -0
- package/src/components/Breadcrumb/utils/useBreadcrumbItemsToRender.d.ts +5 -0
- package/src/components/VirtualizedList/VirtualizedList.d.ts +6 -1
- package/src/components/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.297",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"@tanstack/react-router": "1.19.1",
|
|
28
28
|
"string-ts": "^2.0.0",
|
|
29
29
|
"tailwind-merge": "^2.0.0",
|
|
30
|
-
"@trackunit/react-table-pagination": "*"
|
|
30
|
+
"@trackunit/react-table-pagination": "*",
|
|
31
|
+
"uuid": "^9.0.1"
|
|
31
32
|
},
|
|
32
33
|
"module": "./index.esm.js",
|
|
33
34
|
"main": "./index.cjs.js"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BreadcrumbContainerProps, BreadcrumbItemRenderProps, BreadcrumbProps } from "./utils/types";
|
|
3
|
+
/**
|
|
4
|
+
* The breadcrumb component shows a user's location in a website or application. Breadcrumbs are particularly useful when a large amount of content is organized in a hierarchical manner. They streamline navigation, minimize the steps required to revisit previous pages, and offer contextual insights to the users.
|
|
5
|
+
*
|
|
6
|
+
* ### When to use
|
|
7
|
+
* Use breadcrumbs when deep navigation is available, on apps or pages where users might dive into content and could benefit from a quick way to return to higher levels. Breadcrumbs display the current screen as the final item in the list to make it clear where the user is.
|
|
8
|
+
*
|
|
9
|
+
* ### When not to use
|
|
10
|
+
* Do not use on the first hierarchal level, such as a home page or a main page, as there is no previous step the user can get to.
|
|
11
|
+
* Avoid using breadcrumbs to indicate forthcoming steps. For processes with sequential steps, use a wizard flow instead.
|
|
12
|
+
*
|
|
13
|
+
* @param {BreadcrumbProps} props - The props for the Breadcrumb component
|
|
14
|
+
* @returns {JSX.Element} Breadcrumb component
|
|
15
|
+
*/
|
|
16
|
+
export declare const Breadcrumb: ({ className, dataTestId, breadcrumbItems, back }: BreadcrumbProps) => JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* BreadcrumbContainer is a helper component that renders the breadcrumb items based on the screen size.
|
|
19
|
+
*
|
|
20
|
+
* @param {BreadcrumbContainerProps} props - The props for the BreadcrumbContainer component
|
|
21
|
+
*/
|
|
22
|
+
export declare const BreadcrumbContainer: ({ dataTestId, breadcrumbItems }: BreadcrumbContainerProps) => JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* BreadcrumbItem is a helper component that renders the individual breadcrumb item.
|
|
25
|
+
*/
|
|
26
|
+
export declare const BreadcrumbItem: ({ item, dataTestId }: BreadcrumbItemRenderProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const cvaBreadcrumb: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const cvaBreadcrumbItem: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
3
|
+
export declare const cvaBreadcrumbForLargeScreen: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
4
|
+
export declare const cvaBreadcrumbForMediumScreen: (props?: ({
|
|
5
|
+
expanded?: boolean | null | undefined;
|
|
6
|
+
defaultVariants?: "expanded" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BreadcrumbContainerProps } from "./utils/types";
|
|
3
|
+
/**
|
|
4
|
+
* BreadcrumbForLargeScreen is a helper component that renders the breadcrumb items for large screens.
|
|
5
|
+
*/
|
|
6
|
+
export declare const BreadcrumbForLargeScreen: ({ dataTestId, breadcrumbItems }: BreadcrumbContainerProps) => JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BreadcrumbContainerProps } from "./utils/types";
|
|
3
|
+
/**
|
|
4
|
+
* BreadcrumbForSmallScreen is a helper component that renders the breadcrumb items for small screens.
|
|
5
|
+
*/
|
|
6
|
+
export declare const BreadcrumbForSmallScreen: ({ dataTestId, breadcrumbItems }: BreadcrumbContainerProps) => JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BreadcrumbContainerProps } from "./utils/types";
|
|
3
|
+
/**
|
|
4
|
+
* BreadcrumbForMediumScreen is a helper component that renders the breadcrumb items for medium screens.
|
|
5
|
+
*/
|
|
6
|
+
export declare const BreadcrumbForMediumScreen: ({ dataTestId, breadcrumbItems }: BreadcrumbContainerProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Breadcrumb";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonProps } from "../../../common";
|
|
3
|
+
export interface BreadcrumbItemProps {
|
|
4
|
+
label: string;
|
|
5
|
+
to: string;
|
|
6
|
+
}
|
|
7
|
+
export interface BreadcrumbProps extends CommonProps {
|
|
8
|
+
breadcrumbItems: BreadcrumbItemProps[];
|
|
9
|
+
back: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface BreadcrumbContainerProps extends CommonProps {
|
|
12
|
+
breadcrumbItems: React.ReactElement<BreadcrumbItemProps>[];
|
|
13
|
+
}
|
|
14
|
+
export interface BreadcrumbItemRenderProps extends CommonProps {
|
|
15
|
+
item: React.ReactElement<BreadcrumbItemProps>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BreadcrumbItemProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* useBreadcrumbItemsToRender is a custom hook that takes an array of BreadcrumbItemProps and returns an array of React.ReactElement
|
|
4
|
+
*/
|
|
5
|
+
export declare const useBreadcrumbItemsToRender: (breadcrumbItems: BreadcrumbItemProps[]) => React.ReactElement<BreadcrumbItemProps>[];
|
|
@@ -4,12 +4,15 @@ import { RelayPagination } from "@trackunit/react-table-pagination";
|
|
|
4
4
|
import { CommonProps } from "../../common/CommonProps";
|
|
5
5
|
import { cvaVirtualizedListItem } from "./VirtualizedList.variants";
|
|
6
6
|
type Separator = NonNullable<VariantProps<typeof cvaVirtualizedListItem>["separator"]>;
|
|
7
|
+
type LoadingIndicator = "spinner" | "skeletonLines";
|
|
7
8
|
export interface VirtualizedListProps extends CommonProps {
|
|
8
9
|
count: number;
|
|
9
10
|
rowHeight?: number;
|
|
10
11
|
pagination?: RelayPagination;
|
|
11
12
|
children: (index: number) => JSX.Element;
|
|
12
13
|
separator?: Separator;
|
|
14
|
+
loadingIndicator?: LoadingIndicator;
|
|
15
|
+
skeletonLinesHeight?: string;
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* Render a performant virtualized list of items. Optionally with infinite scrolling.
|
|
@@ -19,6 +22,8 @@ export interface VirtualizedListProps extends CommonProps {
|
|
|
19
22
|
* @property {RelayPagination | undefined} pagination - Pagination configuration for the list.
|
|
20
23
|
* @property {separator} [separator="line"] - The separator style between items in the list.
|
|
21
24
|
* @property {(index: number) => JSX.Element} children - A function that takes an index and returns the JSX element to be rendered at said index.
|
|
25
|
+
* @property {loadingIndicator} [loadingIndicator="spinner"] - The type of loading indicator in the list.
|
|
26
|
+
* @property {skeletonLinesHeight} [skeletonLinesHeight="2rem"] - The height of the skeleton lines.
|
|
22
27
|
*/
|
|
23
|
-
export declare const VirtualizedList: ({ count, rowHeight, pagination, children, className, dataTestId, separator, }: VirtualizedListProps) => JSX.Element;
|
|
28
|
+
export declare const VirtualizedList: ({ count, rowHeight, pagination, children, className, dataTestId, separator, loadingIndicator, skeletonLinesHeight, }: VirtualizedListProps) => JSX.Element;
|
|
24
29
|
export {};
|