@trackunit/react-components 1.10.96 → 1.10.99
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 -55
- package/index.esm.js +42 -55
- package/package.json +5 -5
- package/src/components/Card/Card.variants.d.ts +8 -7
- package/src/components/Card/CardBody.d.ts +7 -8
- package/src/components/Card/CardFooter.d.ts +6 -7
- package/src/components/Card/CardHeader.d.ts +10 -8
- package/src/components/DetailsList/DetailsList.d.ts +1 -3
- package/src/components/DetailsList/DetailsList.variants.d.ts +0 -1
- package/src/components/KPICard/KPICard.variants.d.ts +1 -1
- package/src/index.d.ts +0 -1
- package/src/common/Density.d.ts +0 -1
package/index.cjs.js
CHANGED
|
@@ -1209,75 +1209,62 @@ const cvaCard = cssClassVarianceUtilities.cvaMerge([
|
|
|
1209
1209
|
fullHeight: false,
|
|
1210
1210
|
},
|
|
1211
1211
|
});
|
|
1212
|
-
const
|
|
1212
|
+
const cvaCardFooterContainerRoot = cssClassVarianceUtilities.cvaMerge(["flex", "border-t", "border-neutral-200", "justify-end", "flex-row"], {
|
|
1213
1213
|
variants: {
|
|
1214
1214
|
border: {
|
|
1215
1215
|
default: "",
|
|
1216
1216
|
borderless: "border-t-0",
|
|
1217
1217
|
},
|
|
1218
|
-
|
|
1219
|
-
none: "",
|
|
1220
|
-
|
|
1221
|
-
compact: "gap-3 p-3",
|
|
1222
|
-
comfortable: "gap-4 p-4",
|
|
1223
|
-
kpi: "gap-3 px-3 pb-2 pt-3",
|
|
1224
|
-
spacious: "gap-4 p-6",
|
|
1225
|
-
auto: "component-card-spacing @sm:component-card-spacing-sm @md:component-card-spacing-md",
|
|
1218
|
+
padding: {
|
|
1219
|
+
none: "p-0",
|
|
1220
|
+
default: "p-4",
|
|
1226
1221
|
},
|
|
1227
1222
|
},
|
|
1228
1223
|
defaultVariants: {
|
|
1229
1224
|
border: "default",
|
|
1230
|
-
|
|
1225
|
+
padding: "default",
|
|
1231
1226
|
},
|
|
1232
1227
|
});
|
|
1228
|
+
const cvaCardFooterContainer = cssClassVarianceUtilities.cvaMerge(["justify-self-end", "grid", "auto-cols-max", "grid-flow-col", "gap-2"]);
|
|
1233
1229
|
const cvaCardHeader = cssClassVarianceUtilities.cvaMerge(["flex", "justify-between", "flex-1"]);
|
|
1234
1230
|
const cvaCardHeaderHeadingContainer = cssClassVarianceUtilities.cvaMerge(["flex", "gap-4", "items-center"]);
|
|
1235
|
-
const
|
|
1231
|
+
const cvaCardHeaderContainer = cssClassVarianceUtilities.cvaMerge(["flex", "border-b", "border-neutral-200"], {
|
|
1236
1232
|
variants: {
|
|
1237
1233
|
border: {
|
|
1238
1234
|
default: "",
|
|
1239
1235
|
borderless: "border-b-0",
|
|
1240
1236
|
},
|
|
1241
|
-
|
|
1242
|
-
none: "",
|
|
1243
|
-
|
|
1244
|
-
compact: "gap-3 p-3",
|
|
1245
|
-
comfortable: "gap-4 p-4",
|
|
1246
|
-
kpi: "gap-3 px-3 pb-2 pt-3",
|
|
1247
|
-
spacious: "gap-4 p-6",
|
|
1248
|
-
auto: "component-card-spacing @sm:component-card-spacing-sm @md:component-card-spacing-md",
|
|
1237
|
+
padding: {
|
|
1238
|
+
none: "p-0",
|
|
1239
|
+
default: "p-4",
|
|
1249
1240
|
},
|
|
1250
1241
|
},
|
|
1251
1242
|
defaultVariants: {
|
|
1252
1243
|
border: "default",
|
|
1253
|
-
|
|
1244
|
+
padding: "default",
|
|
1254
1245
|
},
|
|
1255
1246
|
});
|
|
1256
|
-
const
|
|
1247
|
+
const cvaCardBodyContainer$1 = cssClassVarianceUtilities.cvaMerge(["flex", "flex-grow", "overflow-auto"], {
|
|
1257
1248
|
variants: {
|
|
1258
|
-
disableGap: {
|
|
1259
|
-
true: "gap-0",
|
|
1260
|
-
false: "",
|
|
1261
|
-
},
|
|
1262
1249
|
direction: {
|
|
1263
1250
|
row: "flex-row",
|
|
1264
1251
|
"row-reverse": "flex-row-reverse",
|
|
1265
1252
|
column: "flex-col",
|
|
1266
1253
|
"column-reverse": "flex-col-reverse",
|
|
1267
1254
|
},
|
|
1268
|
-
|
|
1269
|
-
none: "",
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1255
|
+
padding: {
|
|
1256
|
+
none: "p-0",
|
|
1257
|
+
default: "p-4",
|
|
1258
|
+
},
|
|
1259
|
+
gap: {
|
|
1260
|
+
none: "gap-0",
|
|
1261
|
+
default: "gap-4",
|
|
1275
1262
|
},
|
|
1276
1263
|
},
|
|
1277
1264
|
defaultVariants: {
|
|
1278
|
-
disableGap: false,
|
|
1279
1265
|
direction: "column",
|
|
1280
|
-
|
|
1266
|
+
padding: "default",
|
|
1267
|
+
gap: "default",
|
|
1281
1268
|
},
|
|
1282
1269
|
});
|
|
1283
1270
|
|
|
@@ -1290,7 +1277,7 @@ const ROLE_CARD = "region";
|
|
|
1290
1277
|
* @returns {ReactElement} Card component
|
|
1291
1278
|
*/
|
|
1292
1279
|
const Card = react.forwardRef(function Card({ children, onClick, fullHeight = false, onMouseEnter, onMouseLeave, className, "data-testid": dataTestId, ...rest }, ref) {
|
|
1293
|
-
return (jsxRuntime.jsx("div", { className: cvaCard({ fullHeight, clickable: Boolean(onClick), className }), "data-testid": dataTestId, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, ref: ref, role: ROLE_CARD, ...rest, children: children }));
|
|
1280
|
+
return (jsxRuntime.jsx("div", { className: cvaCard({ fullHeight, clickable: Boolean(onClick), className }), "data-card": true, "data-testid": dataTestId, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, ref: ref, role: ROLE_CARD, ...rest, children: children }));
|
|
1294
1281
|
});
|
|
1295
1282
|
|
|
1296
1283
|
/**
|
|
@@ -1301,8 +1288,13 @@ const Card = react.forwardRef(function Card({ children, onClick, fullHeight = fa
|
|
|
1301
1288
|
* @param {CardBodyProps} props - The props for the CardBody component
|
|
1302
1289
|
* @returns {ReactElement} CardBody component
|
|
1303
1290
|
*/
|
|
1304
|
-
const CardBody = ({
|
|
1305
|
-
return (jsxRuntime.jsx("div", { className:
|
|
1291
|
+
const CardBody = ({ children, "data-testid": dataTestId, className, direction = "column", gap = "default", padding = "default", id, }) => {
|
|
1292
|
+
return (jsxRuntime.jsx("div", { className: cvaCardBodyContainer$1({
|
|
1293
|
+
gap,
|
|
1294
|
+
padding,
|
|
1295
|
+
className,
|
|
1296
|
+
direction,
|
|
1297
|
+
}), "data-card-body": true, "data-testid": dataTestId, id: id, children: children }));
|
|
1306
1298
|
};
|
|
1307
1299
|
|
|
1308
1300
|
/**
|
|
@@ -1313,12 +1305,12 @@ const CardBody = ({ density = "auto", children, "data-testid": dataTestId, class
|
|
|
1313
1305
|
* @param {CardFooterProps} props - The props for the CardFooter component
|
|
1314
1306
|
* @returns {ReactElement} CardFooter component
|
|
1315
1307
|
*/
|
|
1316
|
-
const CardFooter = ({ "data-testid": dataTestId, className, children,
|
|
1317
|
-
return (jsxRuntime.jsx("div", { className:
|
|
1318
|
-
density,
|
|
1308
|
+
const CardFooter = ({ "data-testid": dataTestId, className, children, padding = "default", hideSeparator = false, }) => {
|
|
1309
|
+
return (jsxRuntime.jsx("div", { className: cvaCardFooterContainerRoot({
|
|
1319
1310
|
border: hideSeparator ? "borderless" : "default",
|
|
1311
|
+
padding,
|
|
1320
1312
|
className,
|
|
1321
|
-
}), "data-testid": dataTestId, children: children }));
|
|
1313
|
+
}), "data-card-footer": true, "data-testid": dataTestId, children: jsxRuntime.jsx("div", { className: cvaCardFooterContainer(), children: children }) }));
|
|
1322
1314
|
};
|
|
1323
1315
|
|
|
1324
1316
|
const cvaHeading = cssClassVarianceUtilities.cvaMerge(["m-0", "leading-normal", "text-black"], {
|
|
@@ -1378,12 +1370,12 @@ const Heading = ({ variant = "primary", inverted = false, subtle = false, classN
|
|
|
1378
1370
|
* @param {CardHeaderProps} props - The props for the CardHeader component
|
|
1379
1371
|
* @returns {ReactElement} CardHeader component
|
|
1380
1372
|
*/
|
|
1381
|
-
const CardHeader = ({ heading, headingVariant = "secondary", subHeading, onClose, "data-testid": dataTestId, className, children, accessories, actions,
|
|
1382
|
-
return (jsxRuntime.jsx("div", { className:
|
|
1383
|
-
density,
|
|
1373
|
+
const CardHeader = ({ heading, headingVariant = "secondary", subHeading, onClose, "data-testid": dataTestId, className, children, accessories, actions, padding = "default", hideSeparator = false, }) => {
|
|
1374
|
+
return (jsxRuntime.jsx("div", { className: cvaCardHeaderContainer({
|
|
1384
1375
|
border: hideSeparator ? "borderless" : "default",
|
|
1376
|
+
padding,
|
|
1385
1377
|
className,
|
|
1386
|
-
}), "data-testid": dataTestId, children: jsxRuntime.jsxs("div", { className: cvaCardHeader(), children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", { className: cvaCardHeaderHeadingContainer(), children: [jsxRuntime.jsx(Heading, { className: "self-center", variant: headingVariant, children: heading }), accessories] }), subHeading !== null && subHeading !== undefined ? (jsxRuntime.jsx(Heading, { subtle: true, variant: "subtitle", children: subHeading })) : null, children] }), jsxRuntime.jsxs("div", { className: "flex place-items-center gap-x-2 gap-y-1", children: [actions, onClose ? (jsxRuntime.jsx(IconButton, { className: "!h-min", "data-testid": "card-header-close-button", icon: jsxRuntime.jsx(Icon, { name: "XMark", size: "small" }), onClick: onClose, variant: "ghost-neutral" })) : null] })] }) }));
|
|
1378
|
+
}), "data-card-header": true, "data-testid": dataTestId, children: jsxRuntime.jsxs("div", { className: cvaCardHeader(), children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", { className: cvaCardHeaderHeadingContainer(), children: [jsxRuntime.jsx(Heading, { className: "self-center", variant: headingVariant, children: heading }), accessories] }), subHeading !== null && subHeading !== undefined ? (jsxRuntime.jsx(Heading, { subtle: true, variant: "subtitle", children: subHeading })) : null, children] }), jsxRuntime.jsxs("div", { className: "flex place-items-center gap-x-2 gap-y-1", children: [actions, onClose ? (jsxRuntime.jsx(IconButton, { className: "!h-min", "data-testid": "card-header-close-button", icon: jsxRuntime.jsx(Icon, { name: "XMark", size: "small" }), onClick: onClose, variant: "ghost-neutral" })) : null] })] }) }));
|
|
1387
1379
|
};
|
|
1388
1380
|
|
|
1389
1381
|
const cvaClickable = cssClassVarianceUtilities.cvaMerge([
|
|
@@ -1779,12 +1771,8 @@ const CopyableText = ({ text, alternativeText, "data-testid": dataTestId, classN
|
|
|
1779
1771
|
return (jsxRuntime.jsx("span", { className: cvaCopyableText({ animating, className }), "data-testid": dataTestId, onAnimationEnd: () => setAnimating(false), onClick: handleOnClick, title: value, children: text }));
|
|
1780
1772
|
};
|
|
1781
1773
|
|
|
1782
|
-
const cvaDetailsList = cssClassVarianceUtilities.cvaMerge(["flex", "w-full", "min-w-0", "items-center", "truncate", "text-xs", "text-neutral-600", "font-medium"], {
|
|
1774
|
+
const cvaDetailsList = cssClassVarianceUtilities.cvaMerge(["flex", "w-full", "min-w-0", "items-center", "truncate", "text-xs", "text-neutral-600", "font-medium", "pt-0"], {
|
|
1783
1775
|
variants: {
|
|
1784
|
-
density: {
|
|
1785
|
-
default: "pt-0",
|
|
1786
|
-
compact: "pt-1",
|
|
1787
|
-
},
|
|
1788
1776
|
hasLink: {
|
|
1789
1777
|
true: "pl-1",
|
|
1790
1778
|
},
|
|
@@ -1801,12 +1789,11 @@ const cvaDetailsListItem = cssClassVarianceUtilities.cvaMerge(["last:truncate"])
|
|
|
1801
1789
|
* @param {object} props - Component props.
|
|
1802
1790
|
* @param {string[]} props.details - Values to render.
|
|
1803
1791
|
* @param {string} [props.className] - Optional CSS class for customization.
|
|
1804
|
-
* @param {"compact" | "default"} [props.density="default"] - Visual density of the list.
|
|
1805
1792
|
* @param {boolean} [props.hasLink=false] - Whether the parent component contains a link.
|
|
1806
1793
|
* @returns {ReactElement} The details list element.
|
|
1807
1794
|
*/
|
|
1808
|
-
const DetailsList = ({ details, className,
|
|
1809
|
-
return (jsxRuntime.jsx("div", { className: cvaDetailsList({ className,
|
|
1795
|
+
const DetailsList = ({ details, className, hasLink = false }) => {
|
|
1796
|
+
return (jsxRuntime.jsx("div", { className: cvaDetailsList({ className, 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))) }));
|
|
1810
1797
|
};
|
|
1811
1798
|
|
|
1812
1799
|
/**
|
|
@@ -3227,7 +3214,7 @@ const cvaKPIIconContainer = cssClassVarianceUtilities.cvaMerge(["flex", "items-c
|
|
|
3227
3214
|
},
|
|
3228
3215
|
},
|
|
3229
3216
|
});
|
|
3230
|
-
const
|
|
3217
|
+
const cvaCardBodyContainer = cssClassVarianceUtilities.cvaMerge(["grid", "grid-cols-[1fr_auto]", "px-3", "pb-2", "pt-3"], {
|
|
3231
3218
|
variants: {
|
|
3232
3219
|
iconName: {
|
|
3233
3220
|
true: "gap-2",
|
|
@@ -3248,7 +3235,7 @@ const KPICard = ({ isActive = false, onClick, className, "data-testid": dataTest
|
|
|
3248
3235
|
isClickable,
|
|
3249
3236
|
isActive,
|
|
3250
3237
|
className,
|
|
3251
|
-
}), "data-testid": dataTestId ? dataTestId : undefined, onClick: onClick, children: jsxRuntime.jsxs(CardBody, { className:
|
|
3238
|
+
}), "data-testid": dataTestId ? dataTestId : undefined, onClick: onClick, children: jsxRuntime.jsxs(CardBody, { className: cvaCardBodyContainer({ iconName: Boolean(iconName) }), gap: "none", padding: "none", children: [jsxRuntime.jsx(KPI, { ...rest, className: "p-0", "data-testid": dataTestId ? `${dataTestId}-kpi` : undefined, loading: loading }), iconName ? (jsxRuntime.jsx("div", { className: cvaKPIIconContainer({ iconColor }), children: jsxRuntime.jsx(Icon, { name: iconName, size: "small", type: "solid" }) })) : null, children] }) }));
|
|
3252
3239
|
};
|
|
3253
3240
|
|
|
3254
3241
|
const cvaListContainer = cssClassVarianceUtilities.cvaMerge(["overflow-y-auto", "overflow-x-hidden", "h-full"], {
|
package/index.esm.js
CHANGED
|
@@ -1207,75 +1207,62 @@ const cvaCard = cvaMerge([
|
|
|
1207
1207
|
fullHeight: false,
|
|
1208
1208
|
},
|
|
1209
1209
|
});
|
|
1210
|
-
const
|
|
1210
|
+
const cvaCardFooterContainerRoot = cvaMerge(["flex", "border-t", "border-neutral-200", "justify-end", "flex-row"], {
|
|
1211
1211
|
variants: {
|
|
1212
1212
|
border: {
|
|
1213
1213
|
default: "",
|
|
1214
1214
|
borderless: "border-t-0",
|
|
1215
1215
|
},
|
|
1216
|
-
|
|
1217
|
-
none: "",
|
|
1218
|
-
|
|
1219
|
-
compact: "gap-3 p-3",
|
|
1220
|
-
comfortable: "gap-4 p-4",
|
|
1221
|
-
kpi: "gap-3 px-3 pb-2 pt-3",
|
|
1222
|
-
spacious: "gap-4 p-6",
|
|
1223
|
-
auto: "component-card-spacing @sm:component-card-spacing-sm @md:component-card-spacing-md",
|
|
1216
|
+
padding: {
|
|
1217
|
+
none: "p-0",
|
|
1218
|
+
default: "p-4",
|
|
1224
1219
|
},
|
|
1225
1220
|
},
|
|
1226
1221
|
defaultVariants: {
|
|
1227
1222
|
border: "default",
|
|
1228
|
-
|
|
1223
|
+
padding: "default",
|
|
1229
1224
|
},
|
|
1230
1225
|
});
|
|
1226
|
+
const cvaCardFooterContainer = cvaMerge(["justify-self-end", "grid", "auto-cols-max", "grid-flow-col", "gap-2"]);
|
|
1231
1227
|
const cvaCardHeader = cvaMerge(["flex", "justify-between", "flex-1"]);
|
|
1232
1228
|
const cvaCardHeaderHeadingContainer = cvaMerge(["flex", "gap-4", "items-center"]);
|
|
1233
|
-
const
|
|
1229
|
+
const cvaCardHeaderContainer = cvaMerge(["flex", "border-b", "border-neutral-200"], {
|
|
1234
1230
|
variants: {
|
|
1235
1231
|
border: {
|
|
1236
1232
|
default: "",
|
|
1237
1233
|
borderless: "border-b-0",
|
|
1238
1234
|
},
|
|
1239
|
-
|
|
1240
|
-
none: "",
|
|
1241
|
-
|
|
1242
|
-
compact: "gap-3 p-3",
|
|
1243
|
-
comfortable: "gap-4 p-4",
|
|
1244
|
-
kpi: "gap-3 px-3 pb-2 pt-3",
|
|
1245
|
-
spacious: "gap-4 p-6",
|
|
1246
|
-
auto: "component-card-spacing @sm:component-card-spacing-sm @md:component-card-spacing-md",
|
|
1235
|
+
padding: {
|
|
1236
|
+
none: "p-0",
|
|
1237
|
+
default: "p-4",
|
|
1247
1238
|
},
|
|
1248
1239
|
},
|
|
1249
1240
|
defaultVariants: {
|
|
1250
1241
|
border: "default",
|
|
1251
|
-
|
|
1242
|
+
padding: "default",
|
|
1252
1243
|
},
|
|
1253
1244
|
});
|
|
1254
|
-
const
|
|
1245
|
+
const cvaCardBodyContainer$1 = cvaMerge(["flex", "flex-grow", "overflow-auto"], {
|
|
1255
1246
|
variants: {
|
|
1256
|
-
disableGap: {
|
|
1257
|
-
true: "gap-0",
|
|
1258
|
-
false: "",
|
|
1259
|
-
},
|
|
1260
1247
|
direction: {
|
|
1261
1248
|
row: "flex-row",
|
|
1262
1249
|
"row-reverse": "flex-row-reverse",
|
|
1263
1250
|
column: "flex-col",
|
|
1264
1251
|
"column-reverse": "flex-col-reverse",
|
|
1265
1252
|
},
|
|
1266
|
-
|
|
1267
|
-
none: "",
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1253
|
+
padding: {
|
|
1254
|
+
none: "p-0",
|
|
1255
|
+
default: "p-4",
|
|
1256
|
+
},
|
|
1257
|
+
gap: {
|
|
1258
|
+
none: "gap-0",
|
|
1259
|
+
default: "gap-4",
|
|
1273
1260
|
},
|
|
1274
1261
|
},
|
|
1275
1262
|
defaultVariants: {
|
|
1276
|
-
disableGap: false,
|
|
1277
1263
|
direction: "column",
|
|
1278
|
-
|
|
1264
|
+
padding: "default",
|
|
1265
|
+
gap: "default",
|
|
1279
1266
|
},
|
|
1280
1267
|
});
|
|
1281
1268
|
|
|
@@ -1288,7 +1275,7 @@ const ROLE_CARD = "region";
|
|
|
1288
1275
|
* @returns {ReactElement} Card component
|
|
1289
1276
|
*/
|
|
1290
1277
|
const Card = forwardRef(function Card({ children, onClick, fullHeight = false, onMouseEnter, onMouseLeave, className, "data-testid": dataTestId, ...rest }, ref) {
|
|
1291
|
-
return (jsx("div", { className: cvaCard({ fullHeight, clickable: Boolean(onClick), className }), "data-testid": dataTestId, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, ref: ref, role: ROLE_CARD, ...rest, children: children }));
|
|
1278
|
+
return (jsx("div", { className: cvaCard({ fullHeight, clickable: Boolean(onClick), className }), "data-card": true, "data-testid": dataTestId, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, ref: ref, role: ROLE_CARD, ...rest, children: children }));
|
|
1292
1279
|
});
|
|
1293
1280
|
|
|
1294
1281
|
/**
|
|
@@ -1299,8 +1286,13 @@ const Card = forwardRef(function Card({ children, onClick, fullHeight = false, o
|
|
|
1299
1286
|
* @param {CardBodyProps} props - The props for the CardBody component
|
|
1300
1287
|
* @returns {ReactElement} CardBody component
|
|
1301
1288
|
*/
|
|
1302
|
-
const CardBody = ({
|
|
1303
|
-
return (jsx("div", { className:
|
|
1289
|
+
const CardBody = ({ children, "data-testid": dataTestId, className, direction = "column", gap = "default", padding = "default", id, }) => {
|
|
1290
|
+
return (jsx("div", { className: cvaCardBodyContainer$1({
|
|
1291
|
+
gap,
|
|
1292
|
+
padding,
|
|
1293
|
+
className,
|
|
1294
|
+
direction,
|
|
1295
|
+
}), "data-card-body": true, "data-testid": dataTestId, id: id, children: children }));
|
|
1304
1296
|
};
|
|
1305
1297
|
|
|
1306
1298
|
/**
|
|
@@ -1311,12 +1303,12 @@ const CardBody = ({ density = "auto", children, "data-testid": dataTestId, class
|
|
|
1311
1303
|
* @param {CardFooterProps} props - The props for the CardFooter component
|
|
1312
1304
|
* @returns {ReactElement} CardFooter component
|
|
1313
1305
|
*/
|
|
1314
|
-
const CardFooter = ({ "data-testid": dataTestId, className, children,
|
|
1315
|
-
return (jsx("div", { className:
|
|
1316
|
-
density,
|
|
1306
|
+
const CardFooter = ({ "data-testid": dataTestId, className, children, padding = "default", hideSeparator = false, }) => {
|
|
1307
|
+
return (jsx("div", { className: cvaCardFooterContainerRoot({
|
|
1317
1308
|
border: hideSeparator ? "borderless" : "default",
|
|
1309
|
+
padding,
|
|
1318
1310
|
className,
|
|
1319
|
-
}), "data-testid": dataTestId, children: children }));
|
|
1311
|
+
}), "data-card-footer": true, "data-testid": dataTestId, children: jsx("div", { className: cvaCardFooterContainer(), children: children }) }));
|
|
1320
1312
|
};
|
|
1321
1313
|
|
|
1322
1314
|
const cvaHeading = cvaMerge(["m-0", "leading-normal", "text-black"], {
|
|
@@ -1376,12 +1368,12 @@ const Heading = ({ variant = "primary", inverted = false, subtle = false, classN
|
|
|
1376
1368
|
* @param {CardHeaderProps} props - The props for the CardHeader component
|
|
1377
1369
|
* @returns {ReactElement} CardHeader component
|
|
1378
1370
|
*/
|
|
1379
|
-
const CardHeader = ({ heading, headingVariant = "secondary", subHeading, onClose, "data-testid": dataTestId, className, children, accessories, actions,
|
|
1380
|
-
return (jsx("div", { className:
|
|
1381
|
-
density,
|
|
1371
|
+
const CardHeader = ({ heading, headingVariant = "secondary", subHeading, onClose, "data-testid": dataTestId, className, children, accessories, actions, padding = "default", hideSeparator = false, }) => {
|
|
1372
|
+
return (jsx("div", { className: cvaCardHeaderContainer({
|
|
1382
1373
|
border: hideSeparator ? "borderless" : "default",
|
|
1374
|
+
padding,
|
|
1383
1375
|
className,
|
|
1384
|
-
}), "data-testid": dataTestId, children: jsxs("div", { className: cvaCardHeader(), children: [jsxs("div", { children: [jsxs("div", { className: cvaCardHeaderHeadingContainer(), children: [jsx(Heading, { className: "self-center", variant: headingVariant, children: heading }), accessories] }), subHeading !== null && subHeading !== undefined ? (jsx(Heading, { subtle: true, variant: "subtitle", children: subHeading })) : null, children] }), jsxs("div", { className: "flex place-items-center gap-x-2 gap-y-1", children: [actions, onClose ? (jsx(IconButton, { className: "!h-min", "data-testid": "card-header-close-button", icon: jsx(Icon, { name: "XMark", size: "small" }), onClick: onClose, variant: "ghost-neutral" })) : null] })] }) }));
|
|
1376
|
+
}), "data-card-header": true, "data-testid": dataTestId, children: jsxs("div", { className: cvaCardHeader(), children: [jsxs("div", { children: [jsxs("div", { className: cvaCardHeaderHeadingContainer(), children: [jsx(Heading, { className: "self-center", variant: headingVariant, children: heading }), accessories] }), subHeading !== null && subHeading !== undefined ? (jsx(Heading, { subtle: true, variant: "subtitle", children: subHeading })) : null, children] }), jsxs("div", { className: "flex place-items-center gap-x-2 gap-y-1", children: [actions, onClose ? (jsx(IconButton, { className: "!h-min", "data-testid": "card-header-close-button", icon: jsx(Icon, { name: "XMark", size: "small" }), onClick: onClose, variant: "ghost-neutral" })) : null] })] }) }));
|
|
1385
1377
|
};
|
|
1386
1378
|
|
|
1387
1379
|
const cvaClickable = cvaMerge([
|
|
@@ -1777,12 +1769,8 @@ const CopyableText = ({ text, alternativeText, "data-testid": dataTestId, classN
|
|
|
1777
1769
|
return (jsx("span", { className: cvaCopyableText({ animating, className }), "data-testid": dataTestId, onAnimationEnd: () => setAnimating(false), onClick: handleOnClick, title: value, children: text }));
|
|
1778
1770
|
};
|
|
1779
1771
|
|
|
1780
|
-
const cvaDetailsList = cvaMerge(["flex", "w-full", "min-w-0", "items-center", "truncate", "text-xs", "text-neutral-600", "font-medium"], {
|
|
1772
|
+
const cvaDetailsList = cvaMerge(["flex", "w-full", "min-w-0", "items-center", "truncate", "text-xs", "text-neutral-600", "font-medium", "pt-0"], {
|
|
1781
1773
|
variants: {
|
|
1782
|
-
density: {
|
|
1783
|
-
default: "pt-0",
|
|
1784
|
-
compact: "pt-1",
|
|
1785
|
-
},
|
|
1786
1774
|
hasLink: {
|
|
1787
1775
|
true: "pl-1",
|
|
1788
1776
|
},
|
|
@@ -1799,12 +1787,11 @@ const cvaDetailsListItem = cvaMerge(["last:truncate"]);
|
|
|
1799
1787
|
* @param {object} props - Component props.
|
|
1800
1788
|
* @param {string[]} props.details - Values to render.
|
|
1801
1789
|
* @param {string} [props.className] - Optional CSS class for customization.
|
|
1802
|
-
* @param {"compact" | "default"} [props.density="default"] - Visual density of the list.
|
|
1803
1790
|
* @param {boolean} [props.hasLink=false] - Whether the parent component contains a link.
|
|
1804
1791
|
* @returns {ReactElement} The details list element.
|
|
1805
1792
|
*/
|
|
1806
|
-
const DetailsList = ({ details, className,
|
|
1807
|
-
return (jsx("div", { className: cvaDetailsList({ className,
|
|
1793
|
+
const DetailsList = ({ details, className, hasLink = false }) => {
|
|
1794
|
+
return (jsx("div", { className: cvaDetailsList({ className, 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))) }));
|
|
1808
1795
|
};
|
|
1809
1796
|
|
|
1810
1797
|
/**
|
|
@@ -3225,7 +3212,7 @@ const cvaKPIIconContainer = cvaMerge(["flex", "items-center", "justify-center",
|
|
|
3225
3212
|
},
|
|
3226
3213
|
},
|
|
3227
3214
|
});
|
|
3228
|
-
const
|
|
3215
|
+
const cvaCardBodyContainer = cvaMerge(["grid", "grid-cols-[1fr_auto]", "px-3", "pb-2", "pt-3"], {
|
|
3229
3216
|
variants: {
|
|
3230
3217
|
iconName: {
|
|
3231
3218
|
true: "gap-2",
|
|
@@ -3246,7 +3233,7 @@ const KPICard = ({ isActive = false, onClick, className, "data-testid": dataTest
|
|
|
3246
3233
|
isClickable,
|
|
3247
3234
|
isActive,
|
|
3248
3235
|
className,
|
|
3249
|
-
}), "data-testid": dataTestId ? dataTestId : undefined, onClick: onClick, children: jsxs(CardBody, { className:
|
|
3236
|
+
}), "data-testid": dataTestId ? dataTestId : undefined, onClick: onClick, children: jsxs(CardBody, { className: cvaCardBodyContainer({ iconName: Boolean(iconName) }), gap: "none", padding: "none", children: [jsx(KPI, { ...rest, className: "p-0", "data-testid": dataTestId ? `${dataTestId}-kpi` : undefined, loading: loading }), iconName ? (jsx("div", { className: cvaKPIIconContainer({ iconColor }), children: jsx(Icon, { name: iconName, size: "small", type: "solid" }) })) : null, children] }) }));
|
|
3250
3237
|
};
|
|
3251
3238
|
|
|
3252
3239
|
const cvaListContainer = cvaMerge(["overflow-y-auto", "overflow-x-hidden", "h-full"], {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.99",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"@floating-ui/react": "^0.26.25",
|
|
15
15
|
"string-ts": "^2.0.0",
|
|
16
16
|
"tailwind-merge": "^2.0.0",
|
|
17
|
-
"@trackunit/ui-design-tokens": "1.7.
|
|
18
|
-
"@trackunit/css-class-variance-utilities": "1.7.
|
|
19
|
-
"@trackunit/shared-utils": "1.9.
|
|
20
|
-
"@trackunit/ui-icons": "1.7.
|
|
17
|
+
"@trackunit/ui-design-tokens": "1.7.121",
|
|
18
|
+
"@trackunit/css-class-variance-utilities": "1.7.121",
|
|
19
|
+
"@trackunit/shared-utils": "1.9.121",
|
|
20
|
+
"@trackunit/ui-icons": "1.7.122",
|
|
21
21
|
"@tanstack/react-router": "1.114.29",
|
|
22
22
|
"es-toolkit": "^1.39.10",
|
|
23
23
|
"@tanstack/react-virtual": "3.13.12",
|
|
@@ -2,18 +2,19 @@ export declare const cvaCard: (props?: ({
|
|
|
2
2
|
clickable?: boolean | null | undefined;
|
|
3
3
|
fullHeight?: boolean | null | undefined;
|
|
4
4
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const cvaCardFooterContainerRoot: (props?: ({
|
|
6
6
|
border?: "default" | "borderless" | null | undefined;
|
|
7
|
-
|
|
7
|
+
padding?: "default" | "none" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
9
|
+
export declare const cvaCardFooterContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
9
10
|
export declare const cvaCardHeader: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
10
11
|
export declare const cvaCardHeaderHeadingContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
11
|
-
export declare const
|
|
12
|
+
export declare const cvaCardHeaderContainer: (props?: ({
|
|
12
13
|
border?: "default" | "borderless" | null | undefined;
|
|
13
|
-
|
|
14
|
+
padding?: "default" | "none" | null | undefined;
|
|
14
15
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
15
|
-
export declare const
|
|
16
|
-
disableGap?: boolean | null | undefined;
|
|
16
|
+
export declare const cvaCardBodyContainer: (props?: ({
|
|
17
17
|
direction?: "row" | "row-reverse" | "column" | "column-reverse" | null | undefined;
|
|
18
|
-
|
|
18
|
+
padding?: "default" | "none" | null | undefined;
|
|
19
|
+
gap?: "default" | "none" | null | undefined;
|
|
19
20
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
-
import { Density } from "../../common/Density";
|
|
4
3
|
export interface CardBodyProps extends CommonProps {
|
|
5
|
-
/**
|
|
6
|
-
* Sets gap, padding and margin.
|
|
7
|
-
*/
|
|
8
|
-
density?: Density;
|
|
9
4
|
/**
|
|
10
5
|
* Sets flex direction
|
|
11
6
|
*/
|
|
12
7
|
direction?: "row" | "row-reverse" | "column" | "column-reverse";
|
|
13
8
|
/**
|
|
14
|
-
*
|
|
9
|
+
* Controls inner padding of the body. Uses design tokens.
|
|
10
|
+
*/
|
|
11
|
+
padding?: "none" | "default";
|
|
12
|
+
/**
|
|
13
|
+
* Set gap size between child elements
|
|
15
14
|
*/
|
|
16
|
-
|
|
15
|
+
gap?: "none" | "default";
|
|
17
16
|
/**
|
|
18
17
|
* Child elements to render in the body
|
|
19
18
|
*/
|
|
@@ -31,4 +30,4 @@ export interface CardBodyProps extends CommonProps {
|
|
|
31
30
|
* @param {CardBodyProps} props - The props for the CardBody component
|
|
32
31
|
* @returns {ReactElement} CardBody component
|
|
33
32
|
*/
|
|
34
|
-
export declare const CardBody: ({
|
|
33
|
+
export declare const CardBody: ({ children, "data-testid": dataTestId, className, direction, gap, padding, id, }: CardBodyProps) => ReactElement;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
-
import { Density } from "../../common/Density";
|
|
4
3
|
export interface CardFooterProps extends CommonProps {
|
|
5
|
-
/**
|
|
6
|
-
* Sets gap, padding and margin.
|
|
7
|
-
*/
|
|
8
|
-
density?: Density;
|
|
9
4
|
/**
|
|
10
5
|
* Element to render in the footer
|
|
11
6
|
*/
|
|
12
7
|
children?: ReactNode | null;
|
|
13
8
|
/**
|
|
14
|
-
*
|
|
9
|
+
* Whether a separator line should be rendered
|
|
15
10
|
*/
|
|
16
11
|
hideSeparator?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Controls inner padding
|
|
14
|
+
*/
|
|
15
|
+
padding?: "none" | "default";
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
18
|
* A simple footer intended to use with Cards and Modals.
|
|
@@ -23,4 +22,4 @@ export interface CardFooterProps extends CommonProps {
|
|
|
23
22
|
* @param {CardFooterProps} props - The props for the CardFooter component
|
|
24
23
|
* @returns {ReactElement} CardFooter component
|
|
25
24
|
*/
|
|
26
|
-
export declare const CardFooter: ({ "data-testid": dataTestId, className, children,
|
|
25
|
+
export declare const CardFooter: ({ "data-testid": dataTestId, className, children, padding, hideSeparator, }: CardFooterProps) => ReactElement;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { MouseEventHandler, ReactElement, ReactNode } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
-
import { Density } from "../../common/Density";
|
|
4
3
|
import { HeadingVariant } from "../Heading/Heading";
|
|
5
4
|
export interface CardHeaderProps extends CommonProps {
|
|
6
5
|
/**
|
|
@@ -21,23 +20,26 @@ export interface CardHeaderProps extends CommonProps {
|
|
|
21
20
|
*/
|
|
22
21
|
accessories?: ReactNode;
|
|
23
22
|
/**
|
|
24
|
-
*
|
|
23
|
+
* Whether a separator line should be rendered
|
|
25
24
|
*/
|
|
26
|
-
|
|
25
|
+
hideSeparator?: boolean;
|
|
27
26
|
/**
|
|
28
|
-
*
|
|
27
|
+
* @deprecated Use `actions` to render a custom close button and handle its `onClick` instead.
|
|
28
|
+
* Function to call when the close button is clicked.
|
|
29
29
|
*/
|
|
30
|
-
hideSeparator?: boolean;
|
|
31
|
-
/** Function to call when the close button is clicked */
|
|
32
30
|
onClose?: MouseEventHandler<HTMLButtonElement>;
|
|
33
31
|
/**
|
|
34
|
-
* Children to render in the header
|
|
32
|
+
* Children to render in the header.
|
|
35
33
|
*/
|
|
36
34
|
children?: ReactNode | null;
|
|
37
35
|
/**
|
|
38
36
|
* For buttons or other actions to render in the header
|
|
39
37
|
*/
|
|
40
38
|
actions?: ReactNode | null;
|
|
39
|
+
/**
|
|
40
|
+
* Controls inner padding
|
|
41
|
+
*/
|
|
42
|
+
padding?: "none" | "default";
|
|
41
43
|
}
|
|
42
44
|
/**
|
|
43
45
|
* Header for Cards.
|
|
@@ -45,4 +47,4 @@ export interface CardHeaderProps extends CommonProps {
|
|
|
45
47
|
* @param {CardHeaderProps} props - The props for the CardHeader component
|
|
46
48
|
* @returns {ReactElement} CardHeader component
|
|
47
49
|
*/
|
|
48
|
-
export declare const CardHeader: ({ heading, headingVariant, subHeading, onClose, "data-testid": dataTestId, className, children, accessories, actions,
|
|
50
|
+
export declare const CardHeader: ({ heading, headingVariant, subHeading, onClose, "data-testid": dataTestId, className, children, accessories, actions, padding, hideSeparator, }: CardHeaderProps) => ReactElement;
|
|
@@ -2,7 +2,6 @@ import { ReactElement } from "react";
|
|
|
2
2
|
interface DetailsListProps {
|
|
3
3
|
details: Array<string>;
|
|
4
4
|
className?: string;
|
|
5
|
-
density?: "compact" | "default";
|
|
6
5
|
hasLink?: boolean;
|
|
7
6
|
}
|
|
8
7
|
/**
|
|
@@ -11,9 +10,8 @@ interface DetailsListProps {
|
|
|
11
10
|
* @param {object} props - Component props.
|
|
12
11
|
* @param {string[]} props.details - Values to render.
|
|
13
12
|
* @param {string} [props.className] - Optional CSS class for customization.
|
|
14
|
-
* @param {"compact" | "default"} [props.density="default"] - Visual density of the list.
|
|
15
13
|
* @param {boolean} [props.hasLink=false] - Whether the parent component contains a link.
|
|
16
14
|
* @returns {ReactElement} The details list element.
|
|
17
15
|
*/
|
|
18
|
-
export declare const DetailsList: ({ details, className,
|
|
16
|
+
export declare const DetailsList: ({ details, className, hasLink }: DetailsListProps) => ReactElement;
|
|
19
17
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare const cvaDetailsList: (props?: ({
|
|
2
|
-
density?: "default" | "compact" | null | undefined;
|
|
3
2
|
hasLink?: boolean | null | undefined;
|
|
4
3
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
4
|
export declare const cvaDetailsListItem: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
@@ -5,6 +5,6 @@ export declare const cvaKPICard: (props?: ({
|
|
|
5
5
|
export declare const cvaKPIIconContainer: (props?: ({
|
|
6
6
|
iconColor?: "success" | "warning" | "danger" | "info" | "neutral" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const cvaCardBodyContainer: (props?: ({
|
|
9
9
|
iconName?: boolean | null | undefined;
|
|
10
10
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
package/src/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./common/AllOrNone";
|
|
2
2
|
export * from "./common/AriaProps";
|
|
3
3
|
export * from "./common/CommonProps";
|
|
4
|
-
export * from "./common/Density";
|
|
5
4
|
export * from "./common/PackageNameStoryComponent";
|
|
6
5
|
export * from "./common/Size";
|
|
7
6
|
export * from "./common/StorybookProps";
|
package/src/common/Density.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Density = "none" | "dense" | "compact" | "comfortable" | "spacious" | "auto";
|