@trackunit/react-components 0.1.409 → 0.1.411
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
CHANGED
package/index.cjs.js
CHANGED
|
@@ -4222,15 +4222,15 @@ const cvaPageHeader = cssClassVarianceUtilities.cvaMerge([
|
|
|
4222
4222
|
]);
|
|
4223
4223
|
const cvaPageHeaderHeading = cssClassVarianceUtilities.cvaMerge(["flex", "text-slate-900", "text-2xl", "font-bold", "min-w-0"]);
|
|
4224
4224
|
const cvaPageHeaderHeadingContainer = cssClassVarianceUtilities.cvaMerge(["flex", "gap-x-4", "flex-wrap", "items-center"]);
|
|
4225
|
-
const cvaPageHeaderHeadingAccessoriesContainer = cssClassVarianceUtilities.cvaMerge([
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4225
|
+
const cvaPageHeaderHeadingAccessoriesContainer = cssClassVarianceUtilities.cvaMerge(["flex", "flex-wrap", "items-center", "gap-x-4", "gap-y-2", "grow"], {
|
|
4226
|
+
variants: {
|
|
4227
|
+
actionPosition: {
|
|
4228
|
+
right: ["justify-between"],
|
|
4229
|
+
},
|
|
4230
|
+
},
|
|
4231
|
+
});
|
|
4232
4232
|
const cvaPageHeaderChildContainer = cssClassVarianceUtilities.cvaMerge(["flex", "flex-wrap", "gap-x-6", "items-center"]);
|
|
4233
|
-
|
|
4233
|
+
cssClassVarianceUtilities.cvaMerge(["flex", "h-fit", "items-center", "gap-1"]);
|
|
4234
4234
|
const cvaPageHeaderLink = cssClassVarianceUtilities.cvaMerge([
|
|
4235
4235
|
"text-primary-600",
|
|
4236
4236
|
"hover:text-primary-700",
|
|
@@ -4249,11 +4249,13 @@ const cvaPageHeaderLink = cssClassVarianceUtilities.cvaMerge([
|
|
|
4249
4249
|
* @param {PageHeaderProps} props - The props for the PageHeader component
|
|
4250
4250
|
* @returns {JSX.Element} PageHeader component
|
|
4251
4251
|
*/
|
|
4252
|
-
const PageHeader = ({ className, dataTestId, action, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, linkText = "Help Center Article", }) => {
|
|
4252
|
+
const PageHeader = ({ className, dataTestId, action, actionPosition, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, linkText = "Help Center Article", }) => {
|
|
4253
4253
|
return (jsxRuntime.jsxs("div", { className: cvaPageHeaderContainer({
|
|
4254
4254
|
className,
|
|
4255
4255
|
withBorder: !tabsList,
|
|
4256
|
-
}), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { className: cvaPageHeader(), children: [jsxRuntime.jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer(
|
|
4256
|
+
}), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { className: cvaPageHeader(), children: [jsxRuntime.jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer({
|
|
4257
|
+
actionPosition: actionPosition ? actionPosition : null,
|
|
4258
|
+
}), "data-testid": dataTestId ? `${dataTestId}-heading-container` : undefined, children: [jsxRuntime.jsxs("div", { className: cvaPageHeaderHeadingContainer(), children: [backTo ? (jsxRuntime.jsx(Button, { asChild: true, className: "bg-black/5 hover:bg-black/10", prefix: jsxRuntime.jsx(Icon, { name: "ArrowLeft", size: "small" }), size: "small", square: true, variant: "ghost-neutral", children: jsxRuntime.jsx(reactRouter.Link, { to: backTo }) })) : undefined, jsxRuntime.jsxs("div", { className: "flex flex-col", children: [jsxRuntime.jsxs("div", { className: "flex flex-row items-center", children: [jsxRuntime.jsx("h1", { className: cvaPageHeaderHeading(), "data-testid": dataTestId ? `${dataTestId}-heading` : undefined, children: title }), description && !showLoading ? (jsxRuntime.jsx(Tooltip, { className: "ml-4 mt-1", dataTestId: dataTestId ? `${dataTestId}-tooltip` : undefined, iconProps: { name: "QuestionMarkCircle" }, label: description, placement: "bottom" })) : undefined, tag && !showLoading ? (jsxRuntime.jsx(Tag, { className: "ml-4 mt-1", color: tagColor, dataTestId: dataTestId ? `${dataTestId}-tag` : undefined, children: tag })) : undefined] }), link ? (jsxRuntime.jsxs(reactRouter.Link, { className: cvaPageHeaderLink(), "data-testid": "tooltip-link", target: "_blank", to: link, children: [linkText, jsxRuntime.jsx(Icon, { name: "ArrowTopRightOnSquare", size: "small" })] })) : undefined] }), showLoading ? (jsxRuntime.jsx(Spinner, { centering: "vertically", dataTestId: dataTestId ? `${dataTestId}-spinner` : undefined })) : null] }), jsxRuntime.jsx("div", { children: action })] }), children ? jsxRuntime.jsx("div", { className: cvaPageHeaderChildContainer(), children: children }) : null] }), tabsList] }));
|
|
4257
4259
|
};
|
|
4258
4260
|
|
|
4259
4261
|
const cvaPagination = cssClassVarianceUtilities.cvaMerge(["flex", "items-center", "gap-1"]);
|
package/index.esm.js
CHANGED
|
@@ -4202,15 +4202,15 @@ const cvaPageHeader = cvaMerge([
|
|
|
4202
4202
|
]);
|
|
4203
4203
|
const cvaPageHeaderHeading = cvaMerge(["flex", "text-slate-900", "text-2xl", "font-bold", "min-w-0"]);
|
|
4204
4204
|
const cvaPageHeaderHeadingContainer = cvaMerge(["flex", "gap-x-4", "flex-wrap", "items-center"]);
|
|
4205
|
-
const cvaPageHeaderHeadingAccessoriesContainer = cvaMerge([
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4205
|
+
const cvaPageHeaderHeadingAccessoriesContainer = cvaMerge(["flex", "flex-wrap", "items-center", "gap-x-4", "gap-y-2", "grow"], {
|
|
4206
|
+
variants: {
|
|
4207
|
+
actionPosition: {
|
|
4208
|
+
right: ["justify-between"],
|
|
4209
|
+
},
|
|
4210
|
+
},
|
|
4211
|
+
});
|
|
4212
4212
|
const cvaPageHeaderChildContainer = cvaMerge(["flex", "flex-wrap", "gap-x-6", "items-center"]);
|
|
4213
|
-
|
|
4213
|
+
cvaMerge(["flex", "h-fit", "items-center", "gap-1"]);
|
|
4214
4214
|
const cvaPageHeaderLink = cvaMerge([
|
|
4215
4215
|
"text-primary-600",
|
|
4216
4216
|
"hover:text-primary-700",
|
|
@@ -4229,11 +4229,13 @@ const cvaPageHeaderLink = cvaMerge([
|
|
|
4229
4229
|
* @param {PageHeaderProps} props - The props for the PageHeader component
|
|
4230
4230
|
* @returns {JSX.Element} PageHeader component
|
|
4231
4231
|
*/
|
|
4232
|
-
const PageHeader = ({ className, dataTestId, action, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, linkText = "Help Center Article", }) => {
|
|
4232
|
+
const PageHeader = ({ className, dataTestId, action, actionPosition, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, linkText = "Help Center Article", }) => {
|
|
4233
4233
|
return (jsxs("div", { className: cvaPageHeaderContainer({
|
|
4234
4234
|
className,
|
|
4235
4235
|
withBorder: !tabsList,
|
|
4236
|
-
}), "data-testid": dataTestId, children: [jsxs("div", { className: cvaPageHeader(), children: [jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer(
|
|
4236
|
+
}), "data-testid": dataTestId, children: [jsxs("div", { className: cvaPageHeader(), children: [jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer({
|
|
4237
|
+
actionPosition: actionPosition ? actionPosition : null,
|
|
4238
|
+
}), "data-testid": dataTestId ? `${dataTestId}-heading-container` : undefined, children: [jsxs("div", { className: cvaPageHeaderHeadingContainer(), children: [backTo ? (jsx(Button, { asChild: true, className: "bg-black/5 hover:bg-black/10", prefix: jsx(Icon, { name: "ArrowLeft", size: "small" }), size: "small", square: true, variant: "ghost-neutral", children: jsx(Link, { to: backTo }) })) : undefined, jsxs("div", { className: "flex flex-col", children: [jsxs("div", { className: "flex flex-row items-center", children: [jsx("h1", { className: cvaPageHeaderHeading(), "data-testid": dataTestId ? `${dataTestId}-heading` : undefined, children: title }), description && !showLoading ? (jsx(Tooltip, { className: "ml-4 mt-1", dataTestId: dataTestId ? `${dataTestId}-tooltip` : undefined, iconProps: { name: "QuestionMarkCircle" }, label: description, placement: "bottom" })) : undefined, tag && !showLoading ? (jsx(Tag, { className: "ml-4 mt-1", color: tagColor, dataTestId: dataTestId ? `${dataTestId}-tag` : undefined, children: tag })) : undefined] }), link ? (jsxs(Link, { className: cvaPageHeaderLink(), "data-testid": "tooltip-link", target: "_blank", to: link, children: [linkText, jsx(Icon, { name: "ArrowTopRightOnSquare", size: "small" })] })) : undefined] }), showLoading ? (jsx(Spinner, { centering: "vertically", dataTestId: dataTestId ? `${dataTestId}-spinner` : undefined })) : null] }), jsx("div", { children: action })] }), children ? jsx("div", { className: cvaPageHeaderChildContainer(), children: children }) : null] }), tabsList] }));
|
|
4237
4239
|
};
|
|
4238
4240
|
|
|
4239
4241
|
const cvaPagination = cvaMerge(["flex", "items-center", "gap-1"]);
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@ import React, { ReactElement, ReactNode } from "react";
|
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
3
|
import { TabListProps } from "../Tabs/TabList";
|
|
4
4
|
import { TagColors } from "../Tag";
|
|
5
|
+
type ActionPosition = "right";
|
|
5
6
|
export interface PageHeaderProps extends CommonProps {
|
|
6
7
|
/**
|
|
7
8
|
* Text to be displayed in the header.
|
|
@@ -23,6 +24,10 @@ export interface PageHeaderProps extends CommonProps {
|
|
|
23
24
|
* Additional actions to be rendered along with the header.
|
|
24
25
|
*/
|
|
25
26
|
action?: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Enables the actions to be pushed to the right in the available space - the default is left side.
|
|
29
|
+
*/
|
|
30
|
+
actionPosition?: ActionPosition;
|
|
26
31
|
/**
|
|
27
32
|
* A tag that is displayed on the side of the header.
|
|
28
33
|
* A RectNode passed into the tag will be rendered as such.
|
|
@@ -55,4 +60,5 @@ export interface PageHeaderProps extends CommonProps {
|
|
|
55
60
|
* @param {PageHeaderProps} props - The props for the PageHeader component
|
|
56
61
|
* @returns {JSX.Element} PageHeader component
|
|
57
62
|
*/
|
|
58
|
-
export declare const PageHeader: ({ className, dataTestId, action, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, linkText, }: PageHeaderProps) =>
|
|
63
|
+
export declare const PageHeader: ({ className, dataTestId, action, actionPosition, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, linkText, }: PageHeaderProps) => ReactElement;
|
|
64
|
+
export {};
|
|
@@ -4,7 +4,9 @@ export declare const cvaPageHeaderContainer: (props?: ({
|
|
|
4
4
|
export declare const cvaPageHeader: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
5
5
|
export declare const cvaPageHeaderHeading: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
6
6
|
export declare const cvaPageHeaderHeadingContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
7
|
-
export declare const cvaPageHeaderHeadingAccessoriesContainer: (props?:
|
|
7
|
+
export declare const cvaPageHeaderHeadingAccessoriesContainer: (props?: ({
|
|
8
|
+
actionPosition?: "right" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
8
10
|
export declare const cvaPageHeaderChildContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
9
|
-
export declare const
|
|
11
|
+
export declare const cvaPageHeaderDescriptionContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
10
12
|
export declare const cvaPageHeaderLink: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|