@trackunit/react-components 0.3.0 → 0.3.1
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
CHANGED
|
@@ -4092,7 +4092,7 @@ const cvaMenuItemPrefix = cssClassVarianceUtilities.cvaMerge(["self-center", "fl
|
|
|
4092
4092
|
|
|
4093
4093
|
/**
|
|
4094
4094
|
* The MenuItem component is used to display a menu, primarily meant to be used in a list form.
|
|
4095
|
-
|
|
4095
|
+
*
|
|
4096
4096
|
* @param {MenuItemProps} props - The props for the MenuItem component
|
|
4097
4097
|
* @returns {JSX.Element} MenuItem component
|
|
4098
4098
|
*/
|
|
@@ -4287,17 +4287,17 @@ const cvaPageHeaderLink = cssClassVarianceUtilities.cvaMerge([
|
|
|
4287
4287
|
* Pageheader component is used to display a page header.
|
|
4288
4288
|
*
|
|
4289
4289
|
* PageHeader can be used to highlight the page topic, display important information about the page, and carry the action items related to the current page.
|
|
4290
|
-
|
|
4290
|
+
*
|
|
4291
4291
|
* @param {PageHeaderProps} props - The props for the PageHeader component
|
|
4292
4292
|
* @returns {JSX.Element} PageHeader component
|
|
4293
4293
|
*/
|
|
4294
|
-
const PageHeader = ({ className, dataTestId, action, actionPosition, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, linkText = "Help Center Article", }) => {
|
|
4294
|
+
const PageHeader = ({ className, dataTestId, action, actionPosition, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, descriptionIcon, linkText = "Help Center Article", }) => {
|
|
4295
4295
|
return (jsxRuntime.jsxs("div", { className: cvaPageHeaderContainer({
|
|
4296
4296
|
className,
|
|
4297
4297
|
withBorder: !tabsList,
|
|
4298
4298
|
}), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { className: cvaPageHeader(), children: [jsxRuntime.jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer({
|
|
4299
4299
|
actionPosition: actionPosition ? actionPosition : null,
|
|
4300
|
-
}), "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] }));
|
|
4300
|
+
}), "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: descriptionIcon !== null && descriptionIcon !== void 0 ? descriptionIcon : "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] }));
|
|
4301
4301
|
};
|
|
4302
4302
|
|
|
4303
4303
|
const cvaPagination = cssClassVarianceUtilities.cvaMerge(["flex", "items-center", "gap-1"]);
|
package/index.esm.js
CHANGED
|
@@ -4072,7 +4072,7 @@ const cvaMenuItemPrefix = cvaMerge(["self-center", "flex-grow-0", "text-slate-40
|
|
|
4072
4072
|
|
|
4073
4073
|
/**
|
|
4074
4074
|
* The MenuItem component is used to display a menu, primarily meant to be used in a list form.
|
|
4075
|
-
|
|
4075
|
+
*
|
|
4076
4076
|
* @param {MenuItemProps} props - The props for the MenuItem component
|
|
4077
4077
|
* @returns {JSX.Element} MenuItem component
|
|
4078
4078
|
*/
|
|
@@ -4267,17 +4267,17 @@ const cvaPageHeaderLink = cvaMerge([
|
|
|
4267
4267
|
* Pageheader component is used to display a page header.
|
|
4268
4268
|
*
|
|
4269
4269
|
* PageHeader can be used to highlight the page topic, display important information about the page, and carry the action items related to the current page.
|
|
4270
|
-
|
|
4270
|
+
*
|
|
4271
4271
|
* @param {PageHeaderProps} props - The props for the PageHeader component
|
|
4272
4272
|
* @returns {JSX.Element} PageHeader component
|
|
4273
4273
|
*/
|
|
4274
|
-
const PageHeader = ({ className, dataTestId, action, actionPosition, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, linkText = "Help Center Article", }) => {
|
|
4274
|
+
const PageHeader = ({ className, dataTestId, action, actionPosition, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, descriptionIcon, linkText = "Help Center Article", }) => {
|
|
4275
4275
|
return (jsxs("div", { className: cvaPageHeaderContainer({
|
|
4276
4276
|
className,
|
|
4277
4277
|
withBorder: !tabsList,
|
|
4278
4278
|
}), "data-testid": dataTestId, children: [jsxs("div", { className: cvaPageHeader(), children: [jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer({
|
|
4279
4279
|
actionPosition: actionPosition ? actionPosition : null,
|
|
4280
|
-
}), "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] }));
|
|
4280
|
+
}), "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: descriptionIcon !== null && descriptionIcon !== void 0 ? descriptionIcon : "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] }));
|
|
4281
4281
|
};
|
|
4282
4282
|
|
|
4283
4283
|
const cvaPagination = cvaMerge(["flex", "items-center", "gap-1"]);
|
package/package.json
CHANGED
|
@@ -55,7 +55,7 @@ export interface MenuItemProps extends CommonProps {
|
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* The MenuItem component is used to display a menu, primarily meant to be used in a list form.
|
|
58
|
-
|
|
58
|
+
*
|
|
59
59
|
* @param {MenuItemProps} props - The props for the MenuItem component
|
|
60
60
|
* @returns {JSX.Element} MenuItem component
|
|
61
61
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IconName } from "@trackunit/ui-icons";
|
|
1
2
|
import React, { ReactElement, ReactNode } from "react";
|
|
2
3
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
4
|
import { TabListProps } from "../Tabs/TabList";
|
|
@@ -50,15 +51,19 @@ export interface PageHeaderProps extends CommonProps {
|
|
|
50
51
|
* The link to the previous page which will be rendered inside an IconButton component to the left of the heading.
|
|
51
52
|
*/
|
|
52
53
|
backTo?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The icon to be used in the description.
|
|
56
|
+
*/
|
|
57
|
+
descriptionIcon?: IconName;
|
|
53
58
|
tabsList?: ReactElement<TabListProps>;
|
|
54
59
|
}
|
|
55
60
|
/**
|
|
56
61
|
* Pageheader component is used to display a page header.
|
|
57
62
|
*
|
|
58
63
|
* PageHeader can be used to highlight the page topic, display important information about the page, and carry the action items related to the current page.
|
|
59
|
-
|
|
64
|
+
*
|
|
60
65
|
* @param {PageHeaderProps} props - The props for the PageHeader component
|
|
61
66
|
* @returns {JSX.Element} PageHeader component
|
|
62
67
|
*/
|
|
63
|
-
export declare const PageHeader: ({ className, dataTestId, action, actionPosition, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, linkText, }: PageHeaderProps) => ReactElement;
|
|
68
|
+
export declare const PageHeader: ({ className, dataTestId, action, actionPosition, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, descriptionIcon, linkText, }: PageHeaderProps) => ReactElement;
|
|
64
69
|
export {};
|