@trackunit/react-components 0.2.3 → 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
@@ -1703,7 +1703,7 @@ const cvaCollapse = cssClassVarianceUtilities.cvaMerge([
1703
1703
  "block",
1704
1704
  "border",
1705
1705
  "border-solid",
1706
- "border-secondary-200",
1706
+ "border-secondary-300",
1707
1707
  "rounded-md",
1708
1708
  "overflow-hidden",
1709
1709
  ]);
@@ -1712,8 +1712,8 @@ const cvaCollapseHeader = cssClassVarianceUtilities.cvaMerge([
1712
1712
  "items-center",
1713
1713
  "justify-between",
1714
1714
  "cursor-pointer",
1715
- "bg-secondary-50",
1716
- "hover:bg-secondary-200",
1715
+ "bg-white",
1716
+ "hover:bg-secondary-100",
1717
1717
  "px-3",
1718
1718
  "gap-4",
1719
1719
  "py-1.5",
@@ -1734,9 +1734,7 @@ const cvaCollapseAnimated = cssClassVarianceUtilities.cvaMerge(["overflow-y-hidd
1734
1734
  expanded: false,
1735
1735
  },
1736
1736
  });
1737
- const cvaChevronIcon = cssClassVarianceUtilities.cvaMerge([
1738
- "transition-transform"
1739
- ], {
1737
+ const cvaChevronIcon = cssClassVarianceUtilities.cvaMerge(["transition-transform"], {
1740
1738
  variants: {
1741
1739
  expanded: {
1742
1740
  true: "rotate-90",
@@ -4094,7 +4092,7 @@ const cvaMenuItemPrefix = cssClassVarianceUtilities.cvaMerge(["self-center", "fl
4094
4092
 
4095
4093
  /**
4096
4094
  * The MenuItem component is used to display a menu, primarily meant to be used in a list form.
4097
-
4095
+ *
4098
4096
  * @param {MenuItemProps} props - The props for the MenuItem component
4099
4097
  * @returns {JSX.Element} MenuItem component
4100
4098
  */
@@ -4289,17 +4287,17 @@ const cvaPageHeaderLink = cssClassVarianceUtilities.cvaMerge([
4289
4287
  * Pageheader component is used to display a page header.
4290
4288
  *
4291
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.
4292
-
4290
+ *
4293
4291
  * @param {PageHeaderProps} props - The props for the PageHeader component
4294
4292
  * @returns {JSX.Element} PageHeader component
4295
4293
  */
4296
- 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", }) => {
4297
4295
  return (jsxRuntime.jsxs("div", { className: cvaPageHeaderContainer({
4298
4296
  className,
4299
4297
  withBorder: !tabsList,
4300
4298
  }), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { className: cvaPageHeader(), children: [jsxRuntime.jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer({
4301
4299
  actionPosition: actionPosition ? actionPosition : null,
4302
- }), "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] }));
4303
4301
  };
4304
4302
 
4305
4303
  const cvaPagination = cssClassVarianceUtilities.cvaMerge(["flex", "items-center", "gap-1"]);
package/index.esm.js CHANGED
@@ -1683,7 +1683,7 @@ const cvaCollapse = cvaMerge([
1683
1683
  "block",
1684
1684
  "border",
1685
1685
  "border-solid",
1686
- "border-secondary-200",
1686
+ "border-secondary-300",
1687
1687
  "rounded-md",
1688
1688
  "overflow-hidden",
1689
1689
  ]);
@@ -1692,8 +1692,8 @@ const cvaCollapseHeader = cvaMerge([
1692
1692
  "items-center",
1693
1693
  "justify-between",
1694
1694
  "cursor-pointer",
1695
- "bg-secondary-50",
1696
- "hover:bg-secondary-200",
1695
+ "bg-white",
1696
+ "hover:bg-secondary-100",
1697
1697
  "px-3",
1698
1698
  "gap-4",
1699
1699
  "py-1.5",
@@ -1714,9 +1714,7 @@ const cvaCollapseAnimated = cvaMerge(["overflow-y-hidden", "transition-all"], {
1714
1714
  expanded: false,
1715
1715
  },
1716
1716
  });
1717
- const cvaChevronIcon = cvaMerge([
1718
- "transition-transform"
1719
- ], {
1717
+ const cvaChevronIcon = cvaMerge(["transition-transform"], {
1720
1718
  variants: {
1721
1719
  expanded: {
1722
1720
  true: "rotate-90",
@@ -4074,7 +4072,7 @@ const cvaMenuItemPrefix = cvaMerge(["self-center", "flex-grow-0", "text-slate-40
4074
4072
 
4075
4073
  /**
4076
4074
  * The MenuItem component is used to display a menu, primarily meant to be used in a list form.
4077
-
4075
+ *
4078
4076
  * @param {MenuItemProps} props - The props for the MenuItem component
4079
4077
  * @returns {JSX.Element} MenuItem component
4080
4078
  */
@@ -4269,17 +4267,17 @@ const cvaPageHeaderLink = cvaMerge([
4269
4267
  * Pageheader component is used to display a page header.
4270
4268
  *
4271
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.
4272
-
4270
+ *
4273
4271
  * @param {PageHeaderProps} props - The props for the PageHeader component
4274
4272
  * @returns {JSX.Element} PageHeader component
4275
4273
  */
4276
- 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", }) => {
4277
4275
  return (jsxs("div", { className: cvaPageHeaderContainer({
4278
4276
  className,
4279
4277
  withBorder: !tabsList,
4280
4278
  }), "data-testid": dataTestId, children: [jsxs("div", { className: cvaPageHeader(), children: [jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer({
4281
4279
  actionPosition: actionPosition ? actionPosition : null,
4282
- }), "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] }));
4283
4281
  };
4284
4282
 
4285
4283
  const cvaPagination = cvaMerge(["flex", "items-center", "gap-1"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.2.3",
3
+ "version": "0.3.1",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -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 {};