@trackunit/react-components 0.1.297 → 0.1.299

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
@@ -268,13 +268,16 @@ const cvaTag = cssClassVarianceUtilities.cvaMerge([
268
268
  unknown: "bg-unknown-100 text-unknown-700",
269
269
  moving: "bg-neutral-100 text-neutral-700",
270
270
  active: "bg-neutral-100 text-neutral-700",
271
- contractor: "bg-contractor-100 text-contractor-700",
272
- dealer: "bg-dealer-100 text-dealer-700",
273
- rental: "bg-rental-100 text-rental-700",
274
- oem: "bg-oem-100 text-oem-700",
275
- service: "bg-service-100 text-service-700",
276
- distributor: "bg-distributor-100 text-distributor-700",
277
- other_customer_type: "bg-other_customer_type-100 text-other_customer_type-700",
271
+ customer_type_contractor: "bg-customer_type_contractor-100 text-customer_type_contractor-700",
272
+ customer_type_dealer: "bg-customer_type_dealer-100 text-customer_type_dealer-700",
273
+ customer_type_rental: "bg-customer_type_rental-100 text-customer_type_rental-700",
274
+ customer_type_oem: "bg-customer_type_oem-100 text-customer_type_oem-700",
275
+ customer_type_service: "bg-customer_type_service-100 text-customer_type_service-700",
276
+ customer_type_distributor: "bg-customer_type_distributor-100 text-customer_type_distributor-700",
277
+ customer_type_other_customer_type: "bg-customer_type_other_customer_type-100 text-customer_type_other_customer_type-700",
278
+ customer_source_user_defined: "bg-customer_source_user_defined-100 text-customer_source_user_defined-700",
279
+ customer_source_classic_migration: "bg-customer_source_classic_migration-100 text-customer_source_classic_migration-700",
280
+ customer_source_system_defined: "bg-customer_source_system_defined-100 text-customer_source_system_defined-700",
278
281
  },
279
282
  },
280
283
  defaultVariants: {
@@ -1664,30 +1667,52 @@ const CardHeader = ({ heading, headingVariant = "primary", subHeading, onClose,
1664
1667
 
1665
1668
  const cvaCollapse = cssClassVarianceUtilities.cvaMerge([
1666
1669
  "block",
1667
- "w-full",
1668
1670
  "border",
1669
1671
  "border-solid",
1670
1672
  "border-secondary-200",
1671
- "rounded",
1673
+ "rounded-md",
1672
1674
  "overflow-hidden",
1673
1675
  ]);
1674
1676
  const cvaCollapseHeader = cssClassVarianceUtilities.cvaMerge([
1675
1677
  "flex",
1676
- "w-full",
1677
1678
  "items-center",
1678
1679
  "justify-between",
1679
1680
  "cursor-pointer",
1680
1681
  "bg-secondary-50",
1681
- "px-4",
1682
+ "hover:bg-secondary-200",
1683
+ "px-3",
1682
1684
  "gap-4",
1683
- "py-2",
1685
+ "py-1.5",
1684
1686
  "transition-all",
1685
1687
  ], {
1686
1688
  variants: { expanded: { true: ["border-secondary-200", "border-b", "border-solid"], false: "" } },
1687
1689
  });
1688
1690
  const cvaCollapseLabelContainer = cssClassVarianceUtilities.cvaMerge(["flex", "items-center", "gap-2"]);
1689
- const cvaCollapsible = cssClassVarianceUtilities.cvaMerge(["block", "relative", "w-full", "p-4"]);
1690
- const cvaCollapseAnimated = cssClassVarianceUtilities.cvaMerge(["overflow-y-hidden", "transition-all"]);
1691
+ const cvaCollapsible = cssClassVarianceUtilities.cvaMerge(["block", "relative", "p-4"]);
1692
+ const cvaCollapseAnimated = cssClassVarianceUtilities.cvaMerge(["overflow-y-hidden", "transition-all"], {
1693
+ variants: {
1694
+ expanded: {
1695
+ true: "block",
1696
+ false: "hidden",
1697
+ },
1698
+ },
1699
+ defaultVariants: {
1700
+ expanded: false,
1701
+ },
1702
+ });
1703
+ const cvaChevronIcon = cssClassVarianceUtilities.cvaMerge([
1704
+ "transition-transform"
1705
+ ], {
1706
+ variants: {
1707
+ expanded: {
1708
+ true: "rotate-90",
1709
+ false: "",
1710
+ },
1711
+ },
1712
+ defaultVariants: {
1713
+ expanded: false,
1714
+ },
1715
+ });
1691
1716
 
1692
1717
  /**
1693
1718
  * The Collapse component is used to condense non-important information.
@@ -1703,11 +1728,11 @@ const Collapse = ({ id, initialExpanded = false, onToggle, label, children, clas
1703
1728
  }
1704
1729
  setExpanded(!expanded);
1705
1730
  }, [expanded, onToggle]);
1706
- return (jsxRuntime.jsxs("div", { className: cvaCollapse({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { "aria-controls": id, "aria-expanded": expanded, className: cvaCollapseHeader({ expanded, className: headerClassName }), onClick: handleClick, role: "button", children: [jsxRuntime.jsxs("div", { className: cvaCollapseLabelContainer(), children: [jsxRuntime.jsx(Text, { type: "span", weight: "bold", children: label }), jsxRuntime.jsx(IconButton, { icon: jsxRuntime.jsx(Icon, { name: "ChevronUpDown", size: "small" }), size: "medium", variant: "ghost-neutral" })] }), headerAddon ? headerAddon : null] }), jsxRuntime.jsx(Collapsible, { expanded: expanded, id: id, children: children })] }));
1731
+ return (jsxRuntime.jsxs("div", { className: cvaCollapse({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { "aria-controls": id, "aria-expanded": expanded, className: cvaCollapseHeader({ expanded, className: headerClassName }), onClick: handleClick, role: "button", children: [jsxRuntime.jsxs("div", { className: cvaCollapseLabelContainer(), children: [jsxRuntime.jsx(Icon, { className: cvaChevronIcon({ expanded }), name: "ChevronRight", size: "small" }), jsxRuntime.jsx(Text, { type: "span", weight: "bold", children: label })] }), headerAddon ? headerAddon : null] }), jsxRuntime.jsx(Collapsible, { expanded: expanded, id: id, children: children })] }));
1707
1732
  };
1708
1733
  const Collapsible = ({ children, expanded, id }) => {
1709
1734
  const [ref, { height }] = reactUse.useMeasure();
1710
- return (jsxRuntime.jsx("div", { className: cvaCollapseAnimated(), id: id, style: { height: expanded ? height : "0" }, children: jsxRuntime.jsx("div", { ref: ref, children: jsxRuntime.jsx("div", { className: cvaCollapsible(), children: children }) }) }));
1735
+ return (jsxRuntime.jsx("div", { className: cvaCollapseAnimated({ expanded }), id: id, style: { height: expanded ? height : "0" }, children: jsxRuntime.jsx("div", { ref: ref, children: jsxRuntime.jsx("div", { className: cvaCollapsible(), children: children }) }) }));
1711
1736
  };
1712
1737
 
1713
1738
  const cvaCopyableText = cssClassVarianceUtilities.cvaMerge([
package/index.esm.js CHANGED
@@ -237,13 +237,16 @@ const cvaTag = cvaMerge([
237
237
  unknown: "bg-unknown-100 text-unknown-700",
238
238
  moving: "bg-neutral-100 text-neutral-700",
239
239
  active: "bg-neutral-100 text-neutral-700",
240
- contractor: "bg-contractor-100 text-contractor-700",
241
- dealer: "bg-dealer-100 text-dealer-700",
242
- rental: "bg-rental-100 text-rental-700",
243
- oem: "bg-oem-100 text-oem-700",
244
- service: "bg-service-100 text-service-700",
245
- distributor: "bg-distributor-100 text-distributor-700",
246
- other_customer_type: "bg-other_customer_type-100 text-other_customer_type-700",
240
+ customer_type_contractor: "bg-customer_type_contractor-100 text-customer_type_contractor-700",
241
+ customer_type_dealer: "bg-customer_type_dealer-100 text-customer_type_dealer-700",
242
+ customer_type_rental: "bg-customer_type_rental-100 text-customer_type_rental-700",
243
+ customer_type_oem: "bg-customer_type_oem-100 text-customer_type_oem-700",
244
+ customer_type_service: "bg-customer_type_service-100 text-customer_type_service-700",
245
+ customer_type_distributor: "bg-customer_type_distributor-100 text-customer_type_distributor-700",
246
+ customer_type_other_customer_type: "bg-customer_type_other_customer_type-100 text-customer_type_other_customer_type-700",
247
+ customer_source_user_defined: "bg-customer_source_user_defined-100 text-customer_source_user_defined-700",
248
+ customer_source_classic_migration: "bg-customer_source_classic_migration-100 text-customer_source_classic_migration-700",
249
+ customer_source_system_defined: "bg-customer_source_system_defined-100 text-customer_source_system_defined-700",
247
250
  },
248
251
  },
249
252
  defaultVariants: {
@@ -1633,30 +1636,52 @@ const CardHeader = ({ heading, headingVariant = "primary", subHeading, onClose,
1633
1636
 
1634
1637
  const cvaCollapse = cvaMerge([
1635
1638
  "block",
1636
- "w-full",
1637
1639
  "border",
1638
1640
  "border-solid",
1639
1641
  "border-secondary-200",
1640
- "rounded",
1642
+ "rounded-md",
1641
1643
  "overflow-hidden",
1642
1644
  ]);
1643
1645
  const cvaCollapseHeader = cvaMerge([
1644
1646
  "flex",
1645
- "w-full",
1646
1647
  "items-center",
1647
1648
  "justify-between",
1648
1649
  "cursor-pointer",
1649
1650
  "bg-secondary-50",
1650
- "px-4",
1651
+ "hover:bg-secondary-200",
1652
+ "px-3",
1651
1653
  "gap-4",
1652
- "py-2",
1654
+ "py-1.5",
1653
1655
  "transition-all",
1654
1656
  ], {
1655
1657
  variants: { expanded: { true: ["border-secondary-200", "border-b", "border-solid"], false: "" } },
1656
1658
  });
1657
1659
  const cvaCollapseLabelContainer = cvaMerge(["flex", "items-center", "gap-2"]);
1658
- const cvaCollapsible = cvaMerge(["block", "relative", "w-full", "p-4"]);
1659
- const cvaCollapseAnimated = cvaMerge(["overflow-y-hidden", "transition-all"]);
1660
+ const cvaCollapsible = cvaMerge(["block", "relative", "p-4"]);
1661
+ const cvaCollapseAnimated = cvaMerge(["overflow-y-hidden", "transition-all"], {
1662
+ variants: {
1663
+ expanded: {
1664
+ true: "block",
1665
+ false: "hidden",
1666
+ },
1667
+ },
1668
+ defaultVariants: {
1669
+ expanded: false,
1670
+ },
1671
+ });
1672
+ const cvaChevronIcon = cvaMerge([
1673
+ "transition-transform"
1674
+ ], {
1675
+ variants: {
1676
+ expanded: {
1677
+ true: "rotate-90",
1678
+ false: "",
1679
+ },
1680
+ },
1681
+ defaultVariants: {
1682
+ expanded: false,
1683
+ },
1684
+ });
1660
1685
 
1661
1686
  /**
1662
1687
  * The Collapse component is used to condense non-important information.
@@ -1672,11 +1697,11 @@ const Collapse = ({ id, initialExpanded = false, onToggle, label, children, clas
1672
1697
  }
1673
1698
  setExpanded(!expanded);
1674
1699
  }, [expanded, onToggle]);
1675
- return (jsxs("div", { className: cvaCollapse({ className }), "data-testid": dataTestId, children: [jsxs("div", { "aria-controls": id, "aria-expanded": expanded, className: cvaCollapseHeader({ expanded, className: headerClassName }), onClick: handleClick, role: "button", children: [jsxs("div", { className: cvaCollapseLabelContainer(), children: [jsx(Text, { type: "span", weight: "bold", children: label }), jsx(IconButton, { icon: jsx(Icon, { name: "ChevronUpDown", size: "small" }), size: "medium", variant: "ghost-neutral" })] }), headerAddon ? headerAddon : null] }), jsx(Collapsible, { expanded: expanded, id: id, children: children })] }));
1700
+ return (jsxs("div", { className: cvaCollapse({ className }), "data-testid": dataTestId, children: [jsxs("div", { "aria-controls": id, "aria-expanded": expanded, className: cvaCollapseHeader({ expanded, className: headerClassName }), onClick: handleClick, role: "button", children: [jsxs("div", { className: cvaCollapseLabelContainer(), children: [jsx(Icon, { className: cvaChevronIcon({ expanded }), name: "ChevronRight", size: "small" }), jsx(Text, { type: "span", weight: "bold", children: label })] }), headerAddon ? headerAddon : null] }), jsx(Collapsible, { expanded: expanded, id: id, children: children })] }));
1676
1701
  };
1677
1702
  const Collapsible = ({ children, expanded, id }) => {
1678
1703
  const [ref, { height }] = useMeasure();
1679
- return (jsx("div", { className: cvaCollapseAnimated(), id: id, style: { height: expanded ? height : "0" }, children: jsx("div", { ref: ref, children: jsx("div", { className: cvaCollapsible(), children: children }) }) }));
1704
+ return (jsx("div", { className: cvaCollapseAnimated({ expanded }), id: id, style: { height: expanded ? height : "0" }, children: jsx("div", { ref: ref, children: jsx("div", { className: cvaCollapsible(), children: children }) }) }));
1680
1705
  };
1681
1706
 
1682
1707
  const cvaCopyableText = cvaMerge([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.1.297",
3
+ "version": "0.1.299",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -4,4 +4,9 @@ export declare const cvaCollapseHeader: (props?: ({
4
4
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
5
5
  export declare const cvaCollapseLabelContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
6
6
  export declare const cvaCollapsible: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
7
- export declare const cvaCollapseAnimated: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
7
+ export declare const cvaCollapseAnimated: (props?: ({
8
+ expanded?: boolean | null | undefined;
9
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
10
+ export declare const cvaChevronIcon: (props?: ({
11
+ expanded?: boolean | null | undefined;
12
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -1,4 +1,4 @@
1
- import React, { ReactElement } from "react";
1
+ 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";
@@ -28,7 +28,7 @@ export interface PageHeaderProps extends CommonProps {
28
28
  * A RectNode passed into the tag will be rendered as such.
29
29
  * A string passed into the tag will render it using the tag component.
30
30
  */
31
- tag?: string;
31
+ tag?: string | ReactNode;
32
32
  /**
33
33
  * A theme color value can be used for tag component
34
34
  */
@@ -1,8 +1,8 @@
1
- import { ActivityColors, CriticalityColors, CustomerTypeColors, GeneralColors, IntentColors } from "@trackunit/ui-design-tokens";
1
+ import { ActivityColors, CriticalityColors, CustomerDataSourceColors, CustomerTypeColors, GeneralColors, IntentColors } from "@trackunit/ui-design-tokens";
2
2
  import * as React from "react";
3
3
  import { CommonProps, Size } from "../../common/CommonProps";
4
4
  export type TagSize = Extract<Size, "small" | "medium">;
5
- export type TagColors = IntentColors | GeneralColors | CriticalityColors | ActivityColors | CustomerTypeColors;
5
+ export type TagColors = IntentColors | GeneralColors | CriticalityColors | ActivityColors | CustomerTypeColors | CustomerDataSourceColors;
6
6
  export interface TagProps extends CommonProps {
7
7
  /**
8
8
  * The color of the tag.
@@ -1,7 +1,7 @@
1
1
  export declare const cvaTag: (props?: ({
2
2
  size?: "small" | "medium" | null | undefined;
3
3
  layout?: "default" | "withIcon" | null | undefined;
4
- color?: "primary" | "secondary" | "accent" | "neutral" | "black" | "white" | "info" | "success" | "warning" | "danger" | "good" | "low" | "critical" | "working" | "stopped" | "idle" | "unknown" | "moving" | "active" | "contractor" | "dealer" | "rental" | "oem" | "service" | "distributor" | "other_customer_type" | null | undefined;
4
+ color?: "primary" | "secondary" | "accent" | "neutral" | "black" | "white" | "info" | "success" | "warning" | "danger" | "good" | "low" | "critical" | "working" | "stopped" | "idle" | "unknown" | "moving" | "active" | "customer_type_contractor" | "customer_type_dealer" | "customer_type_rental" | "customer_type_oem" | "customer_type_service" | "customer_type_distributor" | "customer_type_other_customer_type" | "customer_source_user_defined" | "customer_source_classic_migration" | "customer_source_system_defined" | null | undefined;
5
5
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
6
6
  export declare const cvaTagIconContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
7
7
  export declare const cvaTagIcon: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;