@trackunit/react-components 1.9.44 → 1.9.47
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 +42 -6
- package/index.esm.js +42 -6
- package/package.json +6 -6
- package/src/components/DetailsList/DetailsList.d.ts +3 -1
- package/src/components/DetailsList/DetailsList.variants.d.ts +1 -0
- package/src/components/ExternalLink/ExternalLink.d.ts +6 -2
- package/src/components/ExternalLink/ExternalLink.variants.d.ts +3 -1
package/index.cjs.js
CHANGED
|
@@ -2345,6 +2345,12 @@ const cvaDetailsList = cssClassVarianceUtilities.cvaMerge(["flex", "w-full", "mi
|
|
|
2345
2345
|
default: "pt-0",
|
|
2346
2346
|
compact: "pt-1",
|
|
2347
2347
|
},
|
|
2348
|
+
hasLink: {
|
|
2349
|
+
true: "pl-1",
|
|
2350
|
+
},
|
|
2351
|
+
},
|
|
2352
|
+
defaultVariants: {
|
|
2353
|
+
hasLink: false,
|
|
2348
2354
|
},
|
|
2349
2355
|
});
|
|
2350
2356
|
const cvaDetailsListItem = cssClassVarianceUtilities.cvaMerge(["last:truncate"]);
|
|
@@ -2356,10 +2362,11 @@ const cvaDetailsListItem = cssClassVarianceUtilities.cvaMerge(["last:truncate"])
|
|
|
2356
2362
|
* @param {string[]} props.details - Values to render.
|
|
2357
2363
|
* @param {string} [props.className] - Optional CSS class for customization.
|
|
2358
2364
|
* @param {"compact" | "default"} [props.density="default"] - Visual density of the list.
|
|
2365
|
+
* @param {boolean} [props.hasLink=false] - Whether the parent component contains a link.
|
|
2359
2366
|
* @returns {ReactElement} The details list element.
|
|
2360
2367
|
*/
|
|
2361
|
-
const DetailsList = ({ details, className, density = "default" }) => {
|
|
2362
|
-
return (jsxRuntime.jsx("div", { className: cvaDetailsList({ className, density }), children: details.map((value, index, array) => (jsxRuntime.jsxs(react.Fragment, { children: [jsxRuntime.jsx("span", { className: cvaDetailsListItem({ className }), children: value }), index < array.length - 1 && (jsxRuntime.jsx("div", { className: "mx-0.5 flex items-center", children: jsxRuntime.jsx(Icon, { className: "w-4 text-neutral-300", color: "neutral", name: "Slash", size: "small" }) }))] }, index))) }));
|
|
2368
|
+
const DetailsList = ({ details, className, density = "default", hasLink = false, }) => {
|
|
2369
|
+
return (jsxRuntime.jsx("div", { className: cvaDetailsList({ className, density, hasLink }), children: details.map((value, index, array) => (jsxRuntime.jsxs(react.Fragment, { children: [jsxRuntime.jsx("span", { className: cvaDetailsListItem({ className }), children: value }), index < array.length - 1 && (jsxRuntime.jsx("div", { className: "mx-0.5 flex items-center", children: jsxRuntime.jsx(Icon, { className: "w-4 text-neutral-300", color: "neutral", name: "Slash", size: "small" }) }))] }, index))) }));
|
|
2363
2370
|
};
|
|
2364
2371
|
|
|
2365
2372
|
/**
|
|
@@ -2536,16 +2543,45 @@ const EmptyValue = ({ className, dataTestId }) => {
|
|
|
2536
2543
|
return (jsxRuntime.jsx("div", { className: cvaEmptyValue({ className }), "data-testid": dataTestId, children: "-" }));
|
|
2537
2544
|
};
|
|
2538
2545
|
|
|
2539
|
-
const cvaExternalLink = cssClassVarianceUtilities.cvaMerge(["underline", "
|
|
2546
|
+
const cvaExternalLink = cssClassVarianceUtilities.cvaMerge(["underline", "decoration-[1.5px]", "underline-offset-2", "text-sm"], {
|
|
2547
|
+
variants: {
|
|
2548
|
+
color: {
|
|
2549
|
+
primary: [
|
|
2550
|
+
"text-primary-600",
|
|
2551
|
+
"hover:text-primary-800",
|
|
2552
|
+
"decoration-primary-600",
|
|
2553
|
+
"hover:decoration-primary-800",
|
|
2554
|
+
"font-medium",
|
|
2555
|
+
],
|
|
2556
|
+
neutral: [
|
|
2557
|
+
"text-neutral-800",
|
|
2558
|
+
"hover:text-neutral-900",
|
|
2559
|
+
"decoration-neutral-200",
|
|
2560
|
+
"hover:no-underline",
|
|
2561
|
+
"hover:bg-neutral-200",
|
|
2562
|
+
"rounded",
|
|
2563
|
+
"px-1",
|
|
2564
|
+
"py-0.5",
|
|
2565
|
+
"transition-all",
|
|
2566
|
+
"duration-150",
|
|
2567
|
+
"ease-in-out",
|
|
2568
|
+
"font-semibold",
|
|
2569
|
+
],
|
|
2570
|
+
},
|
|
2571
|
+
},
|
|
2572
|
+
defaultVariants: {
|
|
2573
|
+
color: "primary",
|
|
2574
|
+
},
|
|
2575
|
+
});
|
|
2540
2576
|
|
|
2541
2577
|
/**
|
|
2542
|
-
*
|
|
2578
|
+
* Link is an interactive element that allows users to navigate between different parts of an application or to external resources. Links are used to indicate clickable text.
|
|
2543
2579
|
|
|
2544
2580
|
* @param {ExternalLinkProps} props - The props for the external link component
|
|
2545
2581
|
* @returns {ReactElement} External Link component
|
|
2546
2582
|
*/
|
|
2547
|
-
const ExternalLink = ({ rel = "noreferrer", target = "_blank", href, className, children = href, title = href, dataTestId, onClick, }) => {
|
|
2548
|
-
return (jsxRuntime.jsx("a", { className: cvaExternalLink({ className }), "data-testid": dataTestId, href: href, onClick: onClick, rel: rel, target: target, title: title, children: children }));
|
|
2583
|
+
const ExternalLink = ({ rel = "noreferrer", target = "_blank", href, className, children = href, title = href, dataTestId, onClick, color = "primary", }) => {
|
|
2584
|
+
return (jsxRuntime.jsx("a", { className: cvaExternalLink({ className, color }), "data-testid": dataTestId, href: href, onClick: onClick, rel: rel, target: target, title: title, children: children }));
|
|
2549
2585
|
};
|
|
2550
2586
|
|
|
2551
2587
|
const cvaHighlight = cssClassVarianceUtilities.cvaMerge([
|
package/index.esm.js
CHANGED
|
@@ -2343,6 +2343,12 @@ const cvaDetailsList = cvaMerge(["flex", "w-full", "min-w-0", "items-center", "t
|
|
|
2343
2343
|
default: "pt-0",
|
|
2344
2344
|
compact: "pt-1",
|
|
2345
2345
|
},
|
|
2346
|
+
hasLink: {
|
|
2347
|
+
true: "pl-1",
|
|
2348
|
+
},
|
|
2349
|
+
},
|
|
2350
|
+
defaultVariants: {
|
|
2351
|
+
hasLink: false,
|
|
2346
2352
|
},
|
|
2347
2353
|
});
|
|
2348
2354
|
const cvaDetailsListItem = cvaMerge(["last:truncate"]);
|
|
@@ -2354,10 +2360,11 @@ const cvaDetailsListItem = cvaMerge(["last:truncate"]);
|
|
|
2354
2360
|
* @param {string[]} props.details - Values to render.
|
|
2355
2361
|
* @param {string} [props.className] - Optional CSS class for customization.
|
|
2356
2362
|
* @param {"compact" | "default"} [props.density="default"] - Visual density of the list.
|
|
2363
|
+
* @param {boolean} [props.hasLink=false] - Whether the parent component contains a link.
|
|
2357
2364
|
* @returns {ReactElement} The details list element.
|
|
2358
2365
|
*/
|
|
2359
|
-
const DetailsList = ({ details, className, density = "default" }) => {
|
|
2360
|
-
return (jsx("div", { className: cvaDetailsList({ className, density }), children: details.map((value, index, array) => (jsxs(Fragment, { children: [jsx("span", { className: cvaDetailsListItem({ className }), children: value }), index < array.length - 1 && (jsx("div", { className: "mx-0.5 flex items-center", children: jsx(Icon, { className: "w-4 text-neutral-300", color: "neutral", name: "Slash", size: "small" }) }))] }, index))) }));
|
|
2366
|
+
const DetailsList = ({ details, className, density = "default", hasLink = false, }) => {
|
|
2367
|
+
return (jsx("div", { className: cvaDetailsList({ className, density, hasLink }), children: details.map((value, index, array) => (jsxs(Fragment, { children: [jsx("span", { className: cvaDetailsListItem({ className }), children: value }), index < array.length - 1 && (jsx("div", { className: "mx-0.5 flex items-center", children: jsx(Icon, { className: "w-4 text-neutral-300", color: "neutral", name: "Slash", size: "small" }) }))] }, index))) }));
|
|
2361
2368
|
};
|
|
2362
2369
|
|
|
2363
2370
|
/**
|
|
@@ -2534,16 +2541,45 @@ const EmptyValue = ({ className, dataTestId }) => {
|
|
|
2534
2541
|
return (jsx("div", { className: cvaEmptyValue({ className }), "data-testid": dataTestId, children: "-" }));
|
|
2535
2542
|
};
|
|
2536
2543
|
|
|
2537
|
-
const cvaExternalLink = cvaMerge(["underline", "
|
|
2544
|
+
const cvaExternalLink = cvaMerge(["underline", "decoration-[1.5px]", "underline-offset-2", "text-sm"], {
|
|
2545
|
+
variants: {
|
|
2546
|
+
color: {
|
|
2547
|
+
primary: [
|
|
2548
|
+
"text-primary-600",
|
|
2549
|
+
"hover:text-primary-800",
|
|
2550
|
+
"decoration-primary-600",
|
|
2551
|
+
"hover:decoration-primary-800",
|
|
2552
|
+
"font-medium",
|
|
2553
|
+
],
|
|
2554
|
+
neutral: [
|
|
2555
|
+
"text-neutral-800",
|
|
2556
|
+
"hover:text-neutral-900",
|
|
2557
|
+
"decoration-neutral-200",
|
|
2558
|
+
"hover:no-underline",
|
|
2559
|
+
"hover:bg-neutral-200",
|
|
2560
|
+
"rounded",
|
|
2561
|
+
"px-1",
|
|
2562
|
+
"py-0.5",
|
|
2563
|
+
"transition-all",
|
|
2564
|
+
"duration-150",
|
|
2565
|
+
"ease-in-out",
|
|
2566
|
+
"font-semibold",
|
|
2567
|
+
],
|
|
2568
|
+
},
|
|
2569
|
+
},
|
|
2570
|
+
defaultVariants: {
|
|
2571
|
+
color: "primary",
|
|
2572
|
+
},
|
|
2573
|
+
});
|
|
2538
2574
|
|
|
2539
2575
|
/**
|
|
2540
|
-
*
|
|
2576
|
+
* Link is an interactive element that allows users to navigate between different parts of an application or to external resources. Links are used to indicate clickable text.
|
|
2541
2577
|
|
|
2542
2578
|
* @param {ExternalLinkProps} props - The props for the external link component
|
|
2543
2579
|
* @returns {ReactElement} External Link component
|
|
2544
2580
|
*/
|
|
2545
|
-
const ExternalLink = ({ rel = "noreferrer", target = "_blank", href, className, children = href, title = href, dataTestId, onClick, }) => {
|
|
2546
|
-
return (jsx("a", { className: cvaExternalLink({ className }), "data-testid": dataTestId, href: href, onClick: onClick, rel: rel, target: target, title: title, children: children }));
|
|
2581
|
+
const ExternalLink = ({ rel = "noreferrer", target = "_blank", href, className, children = href, title = href, dataTestId, onClick, color = "primary", }) => {
|
|
2582
|
+
return (jsx("a", { className: cvaExternalLink({ className, color }), "data-testid": dataTestId, href: href, onClick: onClick, rel: rel, target: target, title: title, children: children }));
|
|
2547
2583
|
};
|
|
2548
2584
|
|
|
2549
2585
|
const cvaHighlight = cvaMerge([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.47",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"@floating-ui/react": "^0.26.25",
|
|
17
17
|
"string-ts": "^2.0.0",
|
|
18
18
|
"tailwind-merge": "^2.0.0",
|
|
19
|
-
"@trackunit/ui-design-tokens": "1.7.
|
|
20
|
-
"@trackunit/css-class-variance-utilities": "1.7.
|
|
21
|
-
"@trackunit/shared-utils": "1.9.
|
|
22
|
-
"@trackunit/ui-icons": "1.7.
|
|
23
|
-
"@trackunit/react-test-setup": "1.4.
|
|
19
|
+
"@trackunit/ui-design-tokens": "1.7.33",
|
|
20
|
+
"@trackunit/css-class-variance-utilities": "1.7.32",
|
|
21
|
+
"@trackunit/shared-utils": "1.9.32",
|
|
22
|
+
"@trackunit/ui-icons": "1.7.34",
|
|
23
|
+
"@trackunit/react-test-setup": "1.4.32",
|
|
24
24
|
"@tanstack/react-router": "1.114.29",
|
|
25
25
|
"es-toolkit": "^1.39.10",
|
|
26
26
|
"@tanstack/react-virtual": "3.13.12"
|
|
@@ -3,6 +3,7 @@ interface DetailsListProps {
|
|
|
3
3
|
details: Array<string>;
|
|
4
4
|
className?: string;
|
|
5
5
|
density?: "compact" | "default";
|
|
6
|
+
hasLink?: boolean;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* Renders a one-line list of details separated by a Slash icon.
|
|
@@ -11,7 +12,8 @@ interface DetailsListProps {
|
|
|
11
12
|
* @param {string[]} props.details - Values to render.
|
|
12
13
|
* @param {string} [props.className] - Optional CSS class for customization.
|
|
13
14
|
* @param {"compact" | "default"} [props.density="default"] - Visual density of the list.
|
|
15
|
+
* @param {boolean} [props.hasLink=false] - Whether the parent component contains a link.
|
|
14
16
|
* @returns {ReactElement} The details list element.
|
|
15
17
|
*/
|
|
16
|
-
export declare const DetailsList: ({ details, className, density }: DetailsListProps) => ReactElement;
|
|
18
|
+
export declare const DetailsList: ({ details, className, density, hasLink, }: DetailsListProps) => ReactElement;
|
|
17
19
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const cvaDetailsList: (props?: ({
|
|
2
2
|
density?: "default" | "compact" | null | undefined;
|
|
3
|
+
hasLink?: boolean | null | undefined;
|
|
3
4
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
4
5
|
export declare const cvaDetailsListItem: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
@@ -17,6 +17,10 @@ export interface ExternalLinkProps extends CommonProps {
|
|
|
17
17
|
* Where to display the linked URL. Defaults to "_blank".
|
|
18
18
|
*/
|
|
19
19
|
target?: "_blank" | "_self" | "_parent" | "top";
|
|
20
|
+
/**
|
|
21
|
+
* The color variant of the link. Defaults to "primary".
|
|
22
|
+
*/
|
|
23
|
+
color?: "primary" | "neutral";
|
|
20
24
|
/**
|
|
21
25
|
* Used to specify the relationship between the link and the current document. Defaults to "noreferrer".
|
|
22
26
|
*/
|
|
@@ -24,9 +28,9 @@ export interface ExternalLinkProps extends CommonProps {
|
|
|
24
28
|
onClick?: (event: MouseEvent<HTMLAnchorElement, globalThis.MouseEvent>) => void;
|
|
25
29
|
}
|
|
26
30
|
/**
|
|
27
|
-
*
|
|
31
|
+
* Link is an interactive element that allows users to navigate between different parts of an application or to external resources. Links are used to indicate clickable text.
|
|
28
32
|
|
|
29
33
|
* @param {ExternalLinkProps} props - The props for the external link component
|
|
30
34
|
* @returns {ReactElement} External Link component
|
|
31
35
|
*/
|
|
32
|
-
export declare const ExternalLink: ({ rel, target, href, className, children, title, dataTestId, onClick, }: ExternalLinkProps) => ReactElement;
|
|
36
|
+
export declare const ExternalLink: ({ rel, target, href, className, children, title, dataTestId, onClick, color, }: ExternalLinkProps) => ReactElement;
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export declare const cvaExternalLink: (props?:
|
|
1
|
+
export declare const cvaExternalLink: (props?: ({
|
|
2
|
+
color?: "primary" | "neutral" | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|