@trackunit/react-components 0.1.107 → 0.1.110
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 +196 -116
- package/index.js +196 -117
- package/package.json +2 -1
- package/src/components/Alert/Alert.variants.d.ts +18 -0
- package/src/components/Card/Card.d.ts +1 -7
- package/src/components/Card/Card.variants.d.ts +13 -0
- package/src/components/Card/CardBody.d.ts +1 -8
- package/src/components/Clickable/Clickable.variants.d.ts +3 -0
- package/src/components/CopyableText/CopyableText.variants.d.ts +3 -0
- package/src/components/Timeline/Timeline.d.ts +2 -1
- package/src/index.d.ts +1 -0
package/index.cjs
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var tailwindStyledComponents = require('@trackunit/tailwind-styled-components');
|
|
7
6
|
var React = require('react');
|
|
7
|
+
var tailwindStyledComponents = require('@trackunit/tailwind-styled-components');
|
|
8
8
|
var uiIcons = require('@trackunit/ui-icons');
|
|
9
|
+
var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities');
|
|
9
10
|
var reactUse = require('react-use');
|
|
10
11
|
var reactDayPicker = require('react-day-picker');
|
|
11
12
|
var locale = require('date-fns/locale');
|
|
@@ -109,7 +110,7 @@ function __rest(s, e) {
|
|
|
109
110
|
* @returns {JSX.Element} Spinner component
|
|
110
111
|
*/
|
|
111
112
|
const Spinner = ({ mode = "light", size = "medium", centering = "centered", className, containerClassName, dataTestId, }) => {
|
|
112
|
-
return (jsxRuntime.jsx(Container$
|
|
113
|
+
return (jsxRuntime.jsx(Container$4, Object.assign({ "$mode": mode, "$centering": centering, className: containerClassName }, { children: jsxRuntime.jsx(StyledSpinner$1, { "$size": size, "$mode": mode, role: "spinbutton", className: className, "data-testid": dataTestId }) })));
|
|
113
114
|
};
|
|
114
115
|
const getSpinnerStyles = () => ({ $size }) => {
|
|
115
116
|
switch ($size) {
|
|
@@ -139,7 +140,7 @@ const StyledSpinner$1 = tailwindStyledComponents.tw.span `
|
|
|
139
140
|
${p => (p.$mode === "dark" ? tailwindStyledComponents.tws `tu-spinner--dark` : null)}
|
|
140
141
|
${getSpinnerStyles()}
|
|
141
142
|
`;
|
|
142
|
-
const Container$
|
|
143
|
+
const Container$4 = tailwindStyledComponents.tw.div `
|
|
143
144
|
tu-spinner--container
|
|
144
145
|
${getCenteringStyles()}
|
|
145
146
|
|
|
@@ -211,12 +212,12 @@ const StyledSpinner = tailwindStyledComponents.twx(Spinner) `
|
|
|
211
212
|
|
|
212
213
|
const IconButton = React__namespace.forwardRef((_a, ref) => {
|
|
213
214
|
var { icon, size = "small", square = true, circular, loading, disabled } = _a, rest = __rest(_a, ["icon", "size", "square", "circular", "loading", "disabled"]);
|
|
214
|
-
return (jsxRuntime.jsx(StyledButton, Object.assign({ size: size, square: square, "$circular": circular, disabled: disabled || loading, ref: ref }, rest, { children: jsxRuntime.jsx(IconContainer$
|
|
215
|
+
return (jsxRuntime.jsx(StyledButton, Object.assign({ size: size, square: square, "$circular": circular, disabled: disabled || loading, ref: ref }, rest, { children: jsxRuntime.jsx(IconContainer$1, { children: loading ? jsxRuntime.jsx(Spinner, { size: size }) : icon }) })));
|
|
215
216
|
});
|
|
216
217
|
const StyledButton = tailwindStyledComponents.twx(Button) `
|
|
217
218
|
${p => (p.$circular ? tailwindStyledComponents.tws `tu-button--rounded` : null)}
|
|
218
219
|
`;
|
|
219
|
-
const IconContainer$
|
|
220
|
+
const IconContainer$1 = tailwindStyledComponents.tw.div `
|
|
220
221
|
tu-button__container
|
|
221
222
|
${p => (p.$size === "small" ? tailwindStyledComponents.tws `tu-button__container--small` : null)}
|
|
222
223
|
`;
|
|
@@ -249,12 +250,12 @@ const Icon = ({ name, size = "large", className, dataTestId, color, onClick, fil
|
|
|
249
250
|
if (!IconComponent) {
|
|
250
251
|
return null;
|
|
251
252
|
}
|
|
252
|
-
return (jsxRuntime.jsx(React__namespace.Suspense, Object.assign({ fallback: jsxRuntime.jsx(LoadingDot, { className: iconSizeClassName }) }, { children: jsxRuntime.jsx(Root$
|
|
253
|
+
return (jsxRuntime.jsx(React__namespace.Suspense, Object.assign({ fallback: jsxRuntime.jsx(LoadingDot, { className: iconSizeClassName }) }, { children: jsxRuntime.jsx(Root$5, Object.assign({ "$color": color, onClick: onClick, "data-testid": dataTestId, ref: forwardedRef }, { children: jsxRuntime.jsx(IconComponent, { "data-testid": dataTestId ? `${dataTestId}-${name}` : name, className: `${iconSizeClassName} ${colorClassNames} ${className !== null && className !== void 0 ? className : ""} ${name} aspect-square`, style: fillColor ? Object.assign(Object.assign({}, style), { fill: fillColor }) : Object.assign({}, style) }) })) })));
|
|
253
254
|
};
|
|
254
255
|
const LoadingDot = tailwindStyledComponents.tw.span `
|
|
255
256
|
tu-loading-dot
|
|
256
257
|
`;
|
|
257
|
-
const Root$
|
|
258
|
+
const Root$5 = tailwindStyledComponents.tw.span `
|
|
258
259
|
tu-icon
|
|
259
260
|
${({ $color }) => {
|
|
260
261
|
switch ($color) {
|
|
@@ -373,6 +374,71 @@ const StyledText$3 = tailwindStyledComponents.tw.text `
|
|
|
373
374
|
${getTextWeight()}
|
|
374
375
|
`;
|
|
375
376
|
|
|
377
|
+
const cvaAlert = cssClassVarianceUtilities.cvaMerge(["flex", "relative", "p-4", "rounded"], {
|
|
378
|
+
variants: {
|
|
379
|
+
color: {
|
|
380
|
+
danger: "bg-danger-100",
|
|
381
|
+
warning: "bg-warning-100",
|
|
382
|
+
success: "bg-success-100",
|
|
383
|
+
info: "bg-info-100",
|
|
384
|
+
},
|
|
385
|
+
layout: {
|
|
386
|
+
default: "items-start",
|
|
387
|
+
inline: "items-center",
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
defaultVariants: {
|
|
391
|
+
layout: "default",
|
|
392
|
+
color: "info",
|
|
393
|
+
},
|
|
394
|
+
});
|
|
395
|
+
const cvaAlertDetails = cssClassVarianceUtilities.cvaMerge(["flex"]);
|
|
396
|
+
const cvaAlertContentBody = cssClassVarianceUtilities.cvaMerge(["grid", "gap-2", "flex-grow"]);
|
|
397
|
+
const cvaAlertRightAligned = cssClassVarianceUtilities.cvaMerge(["flex", "justify-end", "gap-2", "ml-2", "mt-4"], {
|
|
398
|
+
variants: {
|
|
399
|
+
layout: {
|
|
400
|
+
default: "",
|
|
401
|
+
inline: "mt-0 ml-auto items-center",
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
defaultVariants: {
|
|
405
|
+
layout: "default",
|
|
406
|
+
},
|
|
407
|
+
});
|
|
408
|
+
const cvaAlertContent = cssClassVarianceUtilities.cvaMerge(["grow"], {
|
|
409
|
+
variants: {
|
|
410
|
+
layout: {
|
|
411
|
+
default: "",
|
|
412
|
+
inline: "flex items-center w-full",
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
defaultVariants: {
|
|
416
|
+
layout: "default",
|
|
417
|
+
},
|
|
418
|
+
});
|
|
419
|
+
const cvaAlertCloseButtonContainer = cssClassVarianceUtilities.cvaMerge(["flex", "self-start", "w-min", "shrink-0"], {
|
|
420
|
+
variants: {
|
|
421
|
+
layout: {
|
|
422
|
+
default: "",
|
|
423
|
+
inline: "ml-4",
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
defaultVariants: {
|
|
427
|
+
layout: "default",
|
|
428
|
+
},
|
|
429
|
+
});
|
|
430
|
+
const cvaAlertIconContainer = cssClassVarianceUtilities.cvaMerge(["self-start", "mr-3", "shrink-0", "grid", "w-min"], {
|
|
431
|
+
variants: {
|
|
432
|
+
layout: {
|
|
433
|
+
default: "",
|
|
434
|
+
inline: "self-center",
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
defaultVariants: {
|
|
438
|
+
layout: "default",
|
|
439
|
+
},
|
|
440
|
+
});
|
|
441
|
+
|
|
376
442
|
/**
|
|
377
443
|
* The Alert component should be used to inform the user of important information.
|
|
378
444
|
*
|
|
@@ -380,7 +446,7 @@ const StyledText$3 = tailwindStyledComponents.tw.text `
|
|
|
380
446
|
* @returns {JSX.Element} Alert component
|
|
381
447
|
*/
|
|
382
448
|
const Alert = ({ color = "info", title, className, children, primaryAction, secondaryAction, onClose, dataTestId, autoScroll, inline = false, }) => {
|
|
383
|
-
const ref = React__namespace.useRef();
|
|
449
|
+
const ref = React__namespace.useRef(null);
|
|
384
450
|
const getIconFromColor = () => {
|
|
385
451
|
switch (color) {
|
|
386
452
|
case "danger":
|
|
@@ -403,51 +469,15 @@ const Alert = ({ color = "info", title, className, children, primaryAction, seco
|
|
|
403
469
|
return "primary";
|
|
404
470
|
}
|
|
405
471
|
};
|
|
406
|
-
const body = inline ? (jsxRuntime.jsxs("div", { children: [title && jsxRuntime.jsx(Text$1, Object.assign({ weight: "bold" }, { children: title !== null && title !== void 0 ? title : children })), children &&
|
|
472
|
+
const body = inline ? (jsxRuntime.jsxs("div", { children: [title && jsxRuntime.jsx(Text$1, Object.assign({ weight: "bold" }, { children: title !== null && title !== void 0 ? title : children })), children && jsxRuntime.jsx(Text$1, Object.assign({ weight: !title ? "bold" : "normal" }, { children: children }))] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [title && jsxRuntime.jsx(Text$1, Object.assign({ weight: "bold" }, { children: title !== null && title !== void 0 ? title : children })), children && jsxRuntime.jsx(Text$1, Object.assign({ weight: !title ? "bold" : "normal" }, { children: children }))] }));
|
|
407
473
|
React__namespace.useEffect(() => {
|
|
408
474
|
if (autoScroll) {
|
|
409
475
|
ref && ref.current && ref.current.scrollIntoView && ref.current.scrollIntoView();
|
|
410
476
|
}
|
|
411
477
|
}, [ref, autoScroll]);
|
|
412
|
-
|
|
413
|
-
};
|
|
414
|
-
|
|
415
|
-
${p => (p.$inline ? tailwindStyledComponents.tws `tu-alert__close-button-container--inline` : tailwindStyledComponents.tws `tu-alert__close-button-container`)}
|
|
416
|
-
`;
|
|
417
|
-
const getBackgroundColor = () => ({ $color }) => {
|
|
418
|
-
const colors = {
|
|
419
|
-
danger: tailwindStyledComponents.tws `tu-alert--danger`,
|
|
420
|
-
warning: tailwindStyledComponents.tws `tu-alert--warning`,
|
|
421
|
-
success: tailwindStyledComponents.tws `tu-alert--success`,
|
|
422
|
-
info: tailwindStyledComponents.tws `tu-alert--info`,
|
|
423
|
-
};
|
|
424
|
-
return colors[$color];
|
|
425
|
-
};
|
|
426
|
-
const Container$6 = tailwindStyledComponents.tw.div `
|
|
427
|
-
tu-alert
|
|
428
|
-
${p => (p.$inline ? tailwindStyledComponents.tws `tu-alert--inline` : null)}
|
|
429
|
-
${getBackgroundColor()}
|
|
430
|
-
`;
|
|
431
|
-
const Content$1 = tailwindStyledComponents.tw.div `
|
|
432
|
-
${p => (p.$inline ? tailwindStyledComponents.tws `tu-alert__content--inline` : tailwindStyledComponents.tws `tu-alert__content`)}
|
|
433
|
-
`;
|
|
434
|
-
const ContentDetails = tailwindStyledComponents.tw.div `
|
|
435
|
-
tu-alert__content-details
|
|
436
|
-
`;
|
|
437
|
-
const ContentBody = tailwindStyledComponents.tw.div `
|
|
438
|
-
tu-alert__content-body
|
|
439
|
-
`;
|
|
440
|
-
const Description = tailwindStyledComponents.twx(Text$1) `
|
|
441
|
-
${p => (p.$hasTitle ? tailwindStyledComponents.tws `tu-alert__description` : null)}
|
|
442
|
-
`;
|
|
443
|
-
const RightAligned = tailwindStyledComponents.tw.div `
|
|
444
|
-
tu-alert__right-aligned
|
|
445
|
-
${p => (p.$inline ? tailwindStyledComponents.tws `tu-alert__right-aligned--inline` : null)}
|
|
446
|
-
`;
|
|
447
|
-
const IconContainer$1 = tailwindStyledComponents.tw.div `
|
|
448
|
-
tu-alert__icon-container
|
|
449
|
-
${p => (p.$inline ? tailwindStyledComponents.tws `tu-alert__icon-container--inline` : null)}
|
|
450
|
-
`;
|
|
478
|
+
const layout = inline ? "inline" : "default";
|
|
479
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: cvaAlert({ color, layout, className }), "data-testid": dataTestId, ref: ref, role: "alert" }, { children: [jsxRuntime.jsx("div", Object.assign({ className: cvaAlertIconContainer({ layout }) }, { children: getIconFromColor() })), jsxRuntime.jsxs("div", Object.assign({ className: cvaAlertContent({ layout }) }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: cvaAlertDetails() }, { children: [jsxRuntime.jsx("div", Object.assign({ className: cvaAlertContentBody() }, { children: body })), onClose && !inline ? (jsxRuntime.jsx("div", Object.assign({ className: cvaAlertCloseButtonContainer({ layout }) }, { children: jsxRuntime.jsx(IconButton, { size: "small", variant: "transparent", color: "secondary", onClick: onClose, icon: jsxRuntime.jsx(Icon, { name: "XMarkIcon", size: "small" }), title: "Close Alert", circular: true }) }))) : null] })), (primaryAction || secondaryAction || onClose) && (jsxRuntime.jsxs("div", Object.assign({ className: cvaAlertRightAligned({ layout }) }, { children: [secondaryAction && (jsxRuntime.jsx(Button, Object.assign({ size: "small", variant: "transparent", color: getButtonColor(), onClick: secondaryAction.onClick, loading: secondaryAction === null || secondaryAction === void 0 ? void 0 : secondaryAction.loading }, { children: secondaryAction.label }))), primaryAction && (jsxRuntime.jsx(Button, Object.assign({ size: "small", color: getButtonColor(), onClick: primaryAction.onClick, loading: primaryAction === null || primaryAction === void 0 ? void 0 : primaryAction.loading }, { children: primaryAction.label }))), onClose && inline ? (jsxRuntime.jsx("div", Object.assign({ className: cvaAlertCloseButtonContainer({ layout }) }, { children: jsxRuntime.jsx(IconButton, { size: "small", variant: "transparent", color: "secondary", onClick: onClose, icon: jsxRuntime.jsx(Icon, { name: "XMarkIcon", size: "small" }), title: "Close Alert", circular: true }) }))) : null] })))] }))] })));
|
|
480
|
+
};
|
|
451
481
|
|
|
452
482
|
/**
|
|
453
483
|
* The Badge component is used to display a notification badge with an optional number value.
|
|
@@ -476,6 +506,58 @@ const StyledText$2 = tailwindStyledComponents.tw.text `
|
|
|
476
506
|
${getBadgeModifierClass()}
|
|
477
507
|
`;
|
|
478
508
|
|
|
509
|
+
const cvaCard = cssClassVarianceUtilities.cvaMerge([
|
|
510
|
+
"flex",
|
|
511
|
+
"border",
|
|
512
|
+
"flex-col",
|
|
513
|
+
"relative",
|
|
514
|
+
"bg-white",
|
|
515
|
+
"component-card-shadow",
|
|
516
|
+
"component-card-border",
|
|
517
|
+
"transition-shadow",
|
|
518
|
+
"ease-in-out",
|
|
519
|
+
], {
|
|
520
|
+
variants: {
|
|
521
|
+
clickable: {
|
|
522
|
+
false: "",
|
|
523
|
+
true: "cursor-pointer hover:shadow-md",
|
|
524
|
+
},
|
|
525
|
+
fullHeight: {
|
|
526
|
+
false: "",
|
|
527
|
+
true: "h-full",
|
|
528
|
+
},
|
|
529
|
+
},
|
|
530
|
+
defaultVariants: {
|
|
531
|
+
clickable: false,
|
|
532
|
+
fullHeight: false,
|
|
533
|
+
},
|
|
534
|
+
});
|
|
535
|
+
const cvaCardBody = cssClassVarianceUtilities.cvaMerge(["flex-grow", "overflow-auto"]);
|
|
536
|
+
const cvaCardFooterDensityContainer = cssClassVarianceUtilities.cvaMerge(["border-t-2", "border-neutral-200", "justify-end"], {
|
|
537
|
+
variants: {
|
|
538
|
+
border: {
|
|
539
|
+
default: "",
|
|
540
|
+
borderless: "border-t-0",
|
|
541
|
+
},
|
|
542
|
+
},
|
|
543
|
+
defaultVariants: {
|
|
544
|
+
border: "default",
|
|
545
|
+
},
|
|
546
|
+
});
|
|
547
|
+
const cvaCardHeader = cssClassVarianceUtilities.cvaMerge(["flex", "justify-between"]);
|
|
548
|
+
const cvaCardHeaderHeadingContainer = cssClassVarianceUtilities.cvaMerge(["flex", "gap-4", "items-center"]);
|
|
549
|
+
const cvaCardHeaderDensityContainer = cssClassVarianceUtilities.cvaMerge(["border-b-2", "border-neutral-200"], {
|
|
550
|
+
variants: {
|
|
551
|
+
border: {
|
|
552
|
+
default: "",
|
|
553
|
+
borderless: "border-b-0",
|
|
554
|
+
},
|
|
555
|
+
},
|
|
556
|
+
defaultVariants: {
|
|
557
|
+
border: "default",
|
|
558
|
+
},
|
|
559
|
+
});
|
|
560
|
+
|
|
479
561
|
const ROLE_CARD = "region";
|
|
480
562
|
/**
|
|
481
563
|
* The Card component is a container for UI elements, and is the main component of the modal.
|
|
@@ -485,28 +567,9 @@ const ROLE_CARD = "region";
|
|
|
485
567
|
* @returns {JSX.Element} Card component
|
|
486
568
|
*/
|
|
487
569
|
const Card = (_a) => {
|
|
488
|
-
var { children, onClick, fullHeight = false, onMouseEnter, onMouseLeave, className, dataTestId,
|
|
489
|
-
return (jsxRuntime.jsx(
|
|
490
|
-
};
|
|
491
|
-
const getOverflow$1 = () => ({ $overflow }) => {
|
|
492
|
-
if (!$overflow) {
|
|
493
|
-
return null;
|
|
494
|
-
}
|
|
495
|
-
const overflows = {
|
|
496
|
-
visible: tailwindStyledComponents.tws `overflow-visible`,
|
|
497
|
-
hidden: tailwindStyledComponents.tws `overflow-hidden`,
|
|
498
|
-
scroll: tailwindStyledComponents.tws `overflow-scroll`,
|
|
499
|
-
auto: tailwindStyledComponents.tws `overflow-auto`,
|
|
500
|
-
};
|
|
501
|
-
return overflows[$overflow];
|
|
502
|
-
};
|
|
503
|
-
const StyledCard$2 = tailwindStyledComponents.tw.div `
|
|
504
|
-
tu-card
|
|
505
|
-
${p => (p.$fullHeight ? `h-full` : null)}
|
|
506
|
-
|
|
507
|
-
${p => p.onClick && `tu-card--clickable`}
|
|
508
|
-
${getOverflow$1()}
|
|
509
|
-
`;
|
|
570
|
+
var { children, onClick, fullHeight = false, onMouseEnter, onMouseLeave, className, dataTestId, gridArea } = _a, rest = __rest(_a, ["children", "onClick", "fullHeight", "onMouseEnter", "onMouseLeave", "className", "dataTestId", "gridArea"]);
|
|
571
|
+
return (jsxRuntime.jsx("div", Object.assign({}, rest, { onClick: onClick, className: cvaCard({ fullHeight, clickable: Boolean(onClick), className }), onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, "data-testid": dataTestId, role: ROLE_CARD, style: { gridArea } }, { children: children })));
|
|
572
|
+
};
|
|
510
573
|
|
|
511
574
|
/**
|
|
512
575
|
* The DensityContainer component applies gap and padding.
|
|
@@ -517,7 +580,7 @@ const StyledCard$2 = tailwindStyledComponents.tw.div `
|
|
|
517
580
|
* @returns {JSX.Element} DensityContainer component
|
|
518
581
|
*/
|
|
519
582
|
const DensityContainer = ({ children, className, dataTestId, density, disableGap, direction, }) => {
|
|
520
|
-
return (jsxRuntime.jsx(StyledDensityContainer
|
|
583
|
+
return (jsxRuntime.jsx(StyledDensityContainer, Object.assign({ "$disableGap": disableGap, "$density": density, "$direction": direction, "data-testid": dataTestId, className: className }, { children: children })));
|
|
521
584
|
};
|
|
522
585
|
const getDirection = () => ({ $direction }) => {
|
|
523
586
|
$direction = $direction !== null && $direction !== void 0 ? $direction : "column";
|
|
@@ -549,7 +612,7 @@ const DensityFinder = ({ $density }) => {
|
|
|
549
612
|
return densityAuto;
|
|
550
613
|
}
|
|
551
614
|
};
|
|
552
|
-
const StyledDensityContainer
|
|
615
|
+
const StyledDensityContainer = tailwindStyledComponents.tw.div `
|
|
553
616
|
flex
|
|
554
617
|
${getDirection()}
|
|
555
618
|
${p => (p.$disableGap ? tailwindStyledComponents.tws `gap-0` : null)}
|
|
@@ -564,25 +627,9 @@ ${DensityFinder}
|
|
|
564
627
|
* @param {CardBodyProps} props - The props for the CardBody component
|
|
565
628
|
* @returns {JSX.Element} CardBody component
|
|
566
629
|
*/
|
|
567
|
-
const CardBody = ({ density = "auto",
|
|
568
|
-
return (jsxRuntime.jsx(
|
|
569
|
-
};
|
|
570
|
-
const getOverflow = () => ({ $overflow }) => {
|
|
571
|
-
if (!$overflow) {
|
|
572
|
-
return null;
|
|
573
|
-
}
|
|
574
|
-
const overflows = {
|
|
575
|
-
visible: tailwindStyledComponents.tws `overflow-visible`,
|
|
576
|
-
hidden: tailwindStyledComponents.tws `overflow-hidden`,
|
|
577
|
-
scroll: tailwindStyledComponents.tws `overflow-scroll`,
|
|
578
|
-
auto: tailwindStyledComponents.tws `overflow-auto`,
|
|
579
|
-
};
|
|
580
|
-
return overflows[$overflow];
|
|
581
|
-
};
|
|
582
|
-
const StyledDensityContainer = tailwindStyledComponents.twx(DensityContainer) `
|
|
583
|
-
${getOverflow()}
|
|
584
|
-
tu-card__body
|
|
585
|
-
`;
|
|
630
|
+
const CardBody = ({ density = "auto", children, dataTestId, className, disableGap }) => {
|
|
631
|
+
return (jsxRuntime.jsx(DensityContainer, Object.assign({ density: density, dataTestId: dataTestId, className: cvaCardBody({ className }), disableGap: disableGap }, { children: children })));
|
|
632
|
+
};
|
|
586
633
|
|
|
587
634
|
/**
|
|
588
635
|
* A simple footer intended to use with Cards and Modals.
|
|
@@ -593,12 +640,8 @@ const StyledDensityContainer = tailwindStyledComponents.twx(DensityContainer) `
|
|
|
593
640
|
* @returns {JSX.Element} CardFooter component
|
|
594
641
|
*/
|
|
595
642
|
const CardFooter = ({ dataTestId, className, children, density, hideSeparator = false }) => {
|
|
596
|
-
return (jsxRuntime.jsx(
|
|
597
|
-
};
|
|
598
|
-
const Container$5 = tailwindStyledComponents.twx(DensityContainer) `
|
|
599
|
-
tu-card__footer-density-container
|
|
600
|
-
${p => p.$hideSeparator && tailwindStyledComponents.tws `tu-card__footer-density-container--borderless`}
|
|
601
|
-
`;
|
|
643
|
+
return (jsxRuntime.jsx(DensityContainer, Object.assign({ dataTestId: dataTestId, className: cvaCardFooterDensityContainer({ border: hideSeparator ? "borderless" : "default", className }), density: density, direction: "row" }, { children: children })));
|
|
644
|
+
};
|
|
602
645
|
|
|
603
646
|
/**
|
|
604
647
|
* The Heading is used for a heading of a section (h1,h2,h3,h4).
|
|
@@ -642,18 +685,8 @@ const StyledHeading = tailwindStyledComponents.tw.div `
|
|
|
642
685
|
* @returns {JSX.Element} CardHeader component
|
|
643
686
|
*/
|
|
644
687
|
const CardHeader = ({ heading, headingVariant = "primary", subHeading, onClose, dataTestId, className, children, accessories, density, extraClassName, hideSeparator = false, }) => {
|
|
645
|
-
return (jsxRuntime.jsx(
|
|
646
|
-
};
|
|
647
|
-
const Root$5 = tailwindStyledComponents.twx(DensityContainer) `
|
|
648
|
-
tu-card__header-density-container
|
|
649
|
-
${p => p.$hideSeparator && tailwindStyledComponents.tws `tu-card__header-density-container--borderless`}
|
|
650
|
-
`;
|
|
651
|
-
const Container$4 = tailwindStyledComponents.tw.div `
|
|
652
|
-
tu-card__header
|
|
653
|
-
`;
|
|
654
|
-
const HeadingContainer$1 = tailwindStyledComponents.tw.div `
|
|
655
|
-
tu-card__header-heading-container
|
|
656
|
-
`;
|
|
688
|
+
return (jsxRuntime.jsx(DensityContainer, Object.assign({ dataTestId: dataTestId, className: cvaCardHeaderDensityContainer({ border: hideSeparator ? "borderless" : "default", className }), density: density }, { children: jsxRuntime.jsxs("div", Object.assign({ className: cvaCardHeader() }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: extraClassName }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: cvaCardHeaderHeadingContainer() }, { children: [jsxRuntime.jsx(Heading$1, Object.assign({ className: "self-center", variant: headingVariant }, { children: heading })), accessories] })), subHeading && (jsxRuntime.jsx(Heading$1, Object.assign({ subtle: true, variant: "subtitle" }, { children: subHeading }))), children] })), onClose && (jsxRuntime.jsx(IconButton, { dataTestId: "card-header-close-button", variant: "transparent", color: "secondary", onClick: onClose, icon: jsxRuntime.jsx(Icon, { name: "XMarkIcon", size: "small" }), className: "!h-min" }))] })) })));
|
|
689
|
+
};
|
|
657
690
|
|
|
658
691
|
/**
|
|
659
692
|
* The Collapse component is used to condense non-important information.
|
|
@@ -695,6 +728,31 @@ const StyledCollapsible = tailwindStyledComponents.tw.div `
|
|
|
695
728
|
tu-collapsible
|
|
696
729
|
`;
|
|
697
730
|
|
|
731
|
+
const cvaCopyableText = cssClassVarianceUtilities.cvaMerge([
|
|
732
|
+
"py-1",
|
|
733
|
+
"px-2",
|
|
734
|
+
"border",
|
|
735
|
+
"border-dashed",
|
|
736
|
+
"border-neutral-600",
|
|
737
|
+
"rounded",
|
|
738
|
+
"cursor-pointer",
|
|
739
|
+
"inline",
|
|
740
|
+
"transition-all",
|
|
741
|
+
"ease-in-out",
|
|
742
|
+
"leading-7",
|
|
743
|
+
"break-words",
|
|
744
|
+
], {
|
|
745
|
+
variants: {
|
|
746
|
+
animating: {
|
|
747
|
+
false: "",
|
|
748
|
+
true: "animate-copy",
|
|
749
|
+
},
|
|
750
|
+
},
|
|
751
|
+
defaultVariants: {
|
|
752
|
+
animating: false,
|
|
753
|
+
},
|
|
754
|
+
});
|
|
755
|
+
|
|
698
756
|
/**
|
|
699
757
|
* The CopyableText component is used where the user should have easy access to copy information.
|
|
700
758
|
*
|
|
@@ -710,11 +768,8 @@ const CopyableText = ({ text, alternativeText, dataTestId, className }) => {
|
|
|
710
768
|
copyToClipboard(value);
|
|
711
769
|
setAnimating(true);
|
|
712
770
|
};
|
|
713
|
-
return (jsxRuntime.jsx(
|
|
714
|
-
};
|
|
715
|
-
const StyledCopyableText = tailwindStyledComponents.tw.span `
|
|
716
|
-
tu-copyable-text
|
|
717
|
-
${p => (p.$animating ? tailwindStyledComponents.tws `tu-copyable-text--animating` : null)}`;
|
|
771
|
+
return (jsxRuntime.jsx("span", Object.assign({ className: cvaCopyableText({ animating, className }), "data-testid": dataTestId, onClick: handleOnClick, onAnimationEnd: () => setAnimating(false), title: value }, { children: text })));
|
|
772
|
+
};
|
|
718
773
|
|
|
719
774
|
const localeLookup = {
|
|
720
775
|
en: locale.enGB,
|
|
@@ -1957,9 +2012,9 @@ const Timeline = ({ className, dataTestId, children }) => {
|
|
|
1957
2012
|
* @param {TimeLineElementProps} props the props
|
|
1958
2013
|
* @returns {JSX.Element} component
|
|
1959
2014
|
*/
|
|
1960
|
-
const TimelineElement = ({ date, showTime, children, className, dataTestId = "timeline-date", dot = jsxRuntime.jsx(Indicator, { className: tailwindStyledComponents.tws `mt-[-1px]`, color: "neutral", icon: jsxRuntime.jsx(Icon, { name: "CalendarIcon", size: "large" }) }), header = defaultHeader(date, showTime), onClick, }) => {
|
|
2015
|
+
const TimelineElement = ({ date, showTime, children, className, dataTestId = "timeline-date", headerClassName, dot = jsxRuntime.jsx(Indicator, { className: tailwindStyledComponents.tws `mt-[-1px]`, color: "neutral", icon: jsxRuntime.jsx(Icon, { name: "CalendarIcon", size: "large" }) }), header = defaultHeader(date, showTime), onClick, }) => {
|
|
1961
2016
|
var _a;
|
|
1962
|
-
return (jsxRuntime.jsxs("li", Object.assign({ className: `${tailwindStyledComponents.tws `tu-timeline-element`}${(_a = " " + className) !== null && _a !== void 0 ? _a : ""} `, "data-date":
|
|
2017
|
+
return (jsxRuntime.jsxs("li", Object.assign({ className: `${tailwindStyledComponents.tws `tu-timeline-element`}${(_a = " " + className) !== null && _a !== void 0 ? _a : ""} `, "data-date": date, "data-testid": dataTestId && dataTestId, onClick: () => onClick && onClick() }, { children: [jsxRuntime.jsx("div", Object.assign({ className: tailwindStyledComponents.tws `tu-timeline-element__dot` }, { children: dot })), jsxRuntime.jsx("div", Object.assign({ className: headerClassName }, { children: header })), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", { children: jsxRuntime.jsx("div", { children: children }) })] })));
|
|
1963
2018
|
};
|
|
1964
2019
|
function defaultHeader(date, showTime) {
|
|
1965
2020
|
return `${dateFns.format(date, showTime ? "MMM d, yyyy H:mm" : "MMM d, yyyy")} (${dateFns.formatDistance(date, new Date(), {
|
|
@@ -2057,6 +2112,30 @@ const Bar = tailwindStyledComponents.tw.rect `
|
|
|
2057
2112
|
tu-value-bar__bar
|
|
2058
2113
|
`;
|
|
2059
2114
|
|
|
2115
|
+
const cvaClickable = cssClassVarianceUtilities.cvaMerge([
|
|
2116
|
+
"shadow-lg",
|
|
2117
|
+
"rounded-lg",
|
|
2118
|
+
"p-3",
|
|
2119
|
+
"bg-neutral-50",
|
|
2120
|
+
"transition-all",
|
|
2121
|
+
"border-2",
|
|
2122
|
+
"border-solid",
|
|
2123
|
+
"border-neutral-100",
|
|
2124
|
+
"cursor-pointer",
|
|
2125
|
+
"hover:border-primary-500",
|
|
2126
|
+
"hover:bg-primary-200",
|
|
2127
|
+
], {
|
|
2128
|
+
variants: {
|
|
2129
|
+
disabled: {
|
|
2130
|
+
false: "",
|
|
2131
|
+
true: "cursor-default hover:border-neutral-100 hover:bg-neutral-50",
|
|
2132
|
+
},
|
|
2133
|
+
},
|
|
2134
|
+
defaultVariants: {
|
|
2135
|
+
disabled: false,
|
|
2136
|
+
},
|
|
2137
|
+
});
|
|
2138
|
+
|
|
2060
2139
|
/**
|
|
2061
2140
|
* The MinTopFullContentLayout component.
|
|
2062
2141
|
*
|
|
@@ -2299,6 +2378,7 @@ exports.TitleNavContentLayout = TitleNavContentLayout;
|
|
|
2299
2378
|
exports.Tooltip = Tooltip;
|
|
2300
2379
|
exports.TwoColumnLayout = TwoColumnLayout;
|
|
2301
2380
|
exports.ValueBar = ValueBar;
|
|
2381
|
+
exports.cvaClickable = cvaClickable;
|
|
2302
2382
|
exports.docs = docs;
|
|
2303
2383
|
exports.getDevicePixelRatio = getDevicePixelRatio;
|
|
2304
2384
|
exports.getValueBarColorByValue = getValueBarColorByValue;
|
package/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { tw, tws, twx } from '@trackunit/tailwind-styled-components';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import React__default, { useState, useMemo, createContext, useContext, forwardRef, isValidElement, cloneElement, useCallback, useEffect, Children, useRef, useReducer, memo } from 'react';
|
|
4
|
+
import { tw, tws, twx } from '@trackunit/tailwind-styled-components';
|
|
5
5
|
import { HeroIconsArray, heroIconLookup, TrackunitSolidIconsArray, TrackunitOutlineIconsArray, trackunitIconLookup } from '@trackunit/ui-icons';
|
|
6
|
+
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
6
7
|
import { useMeasure, useCopyToClipboard } from 'react-use';
|
|
7
8
|
import { DayPicker as DayPicker$1 } from 'react-day-picker';
|
|
8
9
|
import { enGB, enUS, da, de, cs, nl, fr, fi, hu, it, nb, pl, pt, ru, ro, es, sv, ja, th } from 'date-fns/locale';
|
|
@@ -82,7 +83,7 @@ function __rest(s, e) {
|
|
|
82
83
|
* @returns {JSX.Element} Spinner component
|
|
83
84
|
*/
|
|
84
85
|
const Spinner = ({ mode = "light", size = "medium", centering = "centered", className, containerClassName, dataTestId, }) => {
|
|
85
|
-
return (jsx(Container$
|
|
86
|
+
return (jsx(Container$4, Object.assign({ "$mode": mode, "$centering": centering, className: containerClassName }, { children: jsx(StyledSpinner$1, { "$size": size, "$mode": mode, role: "spinbutton", className: className, "data-testid": dataTestId }) })));
|
|
86
87
|
};
|
|
87
88
|
const getSpinnerStyles = () => ({ $size }) => {
|
|
88
89
|
switch ($size) {
|
|
@@ -112,7 +113,7 @@ const StyledSpinner$1 = tw.span `
|
|
|
112
113
|
${p => (p.$mode === "dark" ? tws `tu-spinner--dark` : null)}
|
|
113
114
|
${getSpinnerStyles()}
|
|
114
115
|
`;
|
|
115
|
-
const Container$
|
|
116
|
+
const Container$4 = tw.div `
|
|
116
117
|
tu-spinner--container
|
|
117
118
|
${getCenteringStyles()}
|
|
118
119
|
|
|
@@ -184,12 +185,12 @@ const StyledSpinner = twx(Spinner) `
|
|
|
184
185
|
|
|
185
186
|
const IconButton = React.forwardRef((_a, ref) => {
|
|
186
187
|
var { icon, size = "small", square = true, circular, loading, disabled } = _a, rest = __rest(_a, ["icon", "size", "square", "circular", "loading", "disabled"]);
|
|
187
|
-
return (jsx(StyledButton, Object.assign({ size: size, square: square, "$circular": circular, disabled: disabled || loading, ref: ref }, rest, { children: jsx(IconContainer$
|
|
188
|
+
return (jsx(StyledButton, Object.assign({ size: size, square: square, "$circular": circular, disabled: disabled || loading, ref: ref }, rest, { children: jsx(IconContainer$1, { children: loading ? jsx(Spinner, { size: size }) : icon }) })));
|
|
188
189
|
});
|
|
189
190
|
const StyledButton = twx(Button) `
|
|
190
191
|
${p => (p.$circular ? tws `tu-button--rounded` : null)}
|
|
191
192
|
`;
|
|
192
|
-
const IconContainer$
|
|
193
|
+
const IconContainer$1 = tw.div `
|
|
193
194
|
tu-button__container
|
|
194
195
|
${p => (p.$size === "small" ? tws `tu-button__container--small` : null)}
|
|
195
196
|
`;
|
|
@@ -222,12 +223,12 @@ const Icon = ({ name, size = "large", className, dataTestId, color, onClick, fil
|
|
|
222
223
|
if (!IconComponent) {
|
|
223
224
|
return null;
|
|
224
225
|
}
|
|
225
|
-
return (jsx(React.Suspense, Object.assign({ fallback: jsx(LoadingDot, { className: iconSizeClassName }) }, { children: jsx(Root$
|
|
226
|
+
return (jsx(React.Suspense, Object.assign({ fallback: jsx(LoadingDot, { className: iconSizeClassName }) }, { children: jsx(Root$5, Object.assign({ "$color": color, onClick: onClick, "data-testid": dataTestId, ref: forwardedRef }, { children: jsx(IconComponent, { "data-testid": dataTestId ? `${dataTestId}-${name}` : name, className: `${iconSizeClassName} ${colorClassNames} ${className !== null && className !== void 0 ? className : ""} ${name} aspect-square`, style: fillColor ? Object.assign(Object.assign({}, style), { fill: fillColor }) : Object.assign({}, style) }) })) })));
|
|
226
227
|
};
|
|
227
228
|
const LoadingDot = tw.span `
|
|
228
229
|
tu-loading-dot
|
|
229
230
|
`;
|
|
230
|
-
const Root$
|
|
231
|
+
const Root$5 = tw.span `
|
|
231
232
|
tu-icon
|
|
232
233
|
${({ $color }) => {
|
|
233
234
|
switch ($color) {
|
|
@@ -346,6 +347,71 @@ const StyledText$3 = tw.text `
|
|
|
346
347
|
${getTextWeight()}
|
|
347
348
|
`;
|
|
348
349
|
|
|
350
|
+
const cvaAlert = cvaMerge(["flex", "relative", "p-4", "rounded"], {
|
|
351
|
+
variants: {
|
|
352
|
+
color: {
|
|
353
|
+
danger: "bg-danger-100",
|
|
354
|
+
warning: "bg-warning-100",
|
|
355
|
+
success: "bg-success-100",
|
|
356
|
+
info: "bg-info-100",
|
|
357
|
+
},
|
|
358
|
+
layout: {
|
|
359
|
+
default: "items-start",
|
|
360
|
+
inline: "items-center",
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
defaultVariants: {
|
|
364
|
+
layout: "default",
|
|
365
|
+
color: "info",
|
|
366
|
+
},
|
|
367
|
+
});
|
|
368
|
+
const cvaAlertDetails = cvaMerge(["flex"]);
|
|
369
|
+
const cvaAlertContentBody = cvaMerge(["grid", "gap-2", "flex-grow"]);
|
|
370
|
+
const cvaAlertRightAligned = cvaMerge(["flex", "justify-end", "gap-2", "ml-2", "mt-4"], {
|
|
371
|
+
variants: {
|
|
372
|
+
layout: {
|
|
373
|
+
default: "",
|
|
374
|
+
inline: "mt-0 ml-auto items-center",
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
defaultVariants: {
|
|
378
|
+
layout: "default",
|
|
379
|
+
},
|
|
380
|
+
});
|
|
381
|
+
const cvaAlertContent = cvaMerge(["grow"], {
|
|
382
|
+
variants: {
|
|
383
|
+
layout: {
|
|
384
|
+
default: "",
|
|
385
|
+
inline: "flex items-center w-full",
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
defaultVariants: {
|
|
389
|
+
layout: "default",
|
|
390
|
+
},
|
|
391
|
+
});
|
|
392
|
+
const cvaAlertCloseButtonContainer = cvaMerge(["flex", "self-start", "w-min", "shrink-0"], {
|
|
393
|
+
variants: {
|
|
394
|
+
layout: {
|
|
395
|
+
default: "",
|
|
396
|
+
inline: "ml-4",
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
defaultVariants: {
|
|
400
|
+
layout: "default",
|
|
401
|
+
},
|
|
402
|
+
});
|
|
403
|
+
const cvaAlertIconContainer = cvaMerge(["self-start", "mr-3", "shrink-0", "grid", "w-min"], {
|
|
404
|
+
variants: {
|
|
405
|
+
layout: {
|
|
406
|
+
default: "",
|
|
407
|
+
inline: "self-center",
|
|
408
|
+
},
|
|
409
|
+
},
|
|
410
|
+
defaultVariants: {
|
|
411
|
+
layout: "default",
|
|
412
|
+
},
|
|
413
|
+
});
|
|
414
|
+
|
|
349
415
|
/**
|
|
350
416
|
* The Alert component should be used to inform the user of important information.
|
|
351
417
|
*
|
|
@@ -353,7 +419,7 @@ const StyledText$3 = tw.text `
|
|
|
353
419
|
* @returns {JSX.Element} Alert component
|
|
354
420
|
*/
|
|
355
421
|
const Alert = ({ color = "info", title, className, children, primaryAction, secondaryAction, onClose, dataTestId, autoScroll, inline = false, }) => {
|
|
356
|
-
const ref = React.useRef();
|
|
422
|
+
const ref = React.useRef(null);
|
|
357
423
|
const getIconFromColor = () => {
|
|
358
424
|
switch (color) {
|
|
359
425
|
case "danger":
|
|
@@ -376,51 +442,15 @@ const Alert = ({ color = "info", title, className, children, primaryAction, seco
|
|
|
376
442
|
return "primary";
|
|
377
443
|
}
|
|
378
444
|
};
|
|
379
|
-
const body = inline ? (jsxs("div", { children: [title && jsx(Text$1, Object.assign({ weight: "bold" }, { children: title !== null && title !== void 0 ? title : children })), children &&
|
|
445
|
+
const body = inline ? (jsxs("div", { children: [title && jsx(Text$1, Object.assign({ weight: "bold" }, { children: title !== null && title !== void 0 ? title : children })), children && jsx(Text$1, Object.assign({ weight: !title ? "bold" : "normal" }, { children: children }))] })) : (jsxs(Fragment, { children: [title && jsx(Text$1, Object.assign({ weight: "bold" }, { children: title !== null && title !== void 0 ? title : children })), children && jsx(Text$1, Object.assign({ weight: !title ? "bold" : "normal" }, { children: children }))] }));
|
|
380
446
|
React.useEffect(() => {
|
|
381
447
|
if (autoScroll) {
|
|
382
448
|
ref && ref.current && ref.current.scrollIntoView && ref.current.scrollIntoView();
|
|
383
449
|
}
|
|
384
450
|
}, [ref, autoScroll]);
|
|
385
|
-
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
${p => (p.$inline ? tws `tu-alert__close-button-container--inline` : tws `tu-alert__close-button-container`)}
|
|
389
|
-
`;
|
|
390
|
-
const getBackgroundColor = () => ({ $color }) => {
|
|
391
|
-
const colors = {
|
|
392
|
-
danger: tws `tu-alert--danger`,
|
|
393
|
-
warning: tws `tu-alert--warning`,
|
|
394
|
-
success: tws `tu-alert--success`,
|
|
395
|
-
info: tws `tu-alert--info`,
|
|
396
|
-
};
|
|
397
|
-
return colors[$color];
|
|
398
|
-
};
|
|
399
|
-
const Container$6 = tw.div `
|
|
400
|
-
tu-alert
|
|
401
|
-
${p => (p.$inline ? tws `tu-alert--inline` : null)}
|
|
402
|
-
${getBackgroundColor()}
|
|
403
|
-
`;
|
|
404
|
-
const Content$1 = tw.div `
|
|
405
|
-
${p => (p.$inline ? tws `tu-alert__content--inline` : tws `tu-alert__content`)}
|
|
406
|
-
`;
|
|
407
|
-
const ContentDetails = tw.div `
|
|
408
|
-
tu-alert__content-details
|
|
409
|
-
`;
|
|
410
|
-
const ContentBody = tw.div `
|
|
411
|
-
tu-alert__content-body
|
|
412
|
-
`;
|
|
413
|
-
const Description = twx(Text$1) `
|
|
414
|
-
${p => (p.$hasTitle ? tws `tu-alert__description` : null)}
|
|
415
|
-
`;
|
|
416
|
-
const RightAligned = tw.div `
|
|
417
|
-
tu-alert__right-aligned
|
|
418
|
-
${p => (p.$inline ? tws `tu-alert__right-aligned--inline` : null)}
|
|
419
|
-
`;
|
|
420
|
-
const IconContainer$1 = tw.div `
|
|
421
|
-
tu-alert__icon-container
|
|
422
|
-
${p => (p.$inline ? tws `tu-alert__icon-container--inline` : null)}
|
|
423
|
-
`;
|
|
451
|
+
const layout = inline ? "inline" : "default";
|
|
452
|
+
return (jsxs("div", Object.assign({ className: cvaAlert({ color, layout, className }), "data-testid": dataTestId, ref: ref, role: "alert" }, { children: [jsx("div", Object.assign({ className: cvaAlertIconContainer({ layout }) }, { children: getIconFromColor() })), jsxs("div", Object.assign({ className: cvaAlertContent({ layout }) }, { children: [jsxs("div", Object.assign({ className: cvaAlertDetails() }, { children: [jsx("div", Object.assign({ className: cvaAlertContentBody() }, { children: body })), onClose && !inline ? (jsx("div", Object.assign({ className: cvaAlertCloseButtonContainer({ layout }) }, { children: jsx(IconButton, { size: "small", variant: "transparent", color: "secondary", onClick: onClose, icon: jsx(Icon, { name: "XMarkIcon", size: "small" }), title: "Close Alert", circular: true }) }))) : null] })), (primaryAction || secondaryAction || onClose) && (jsxs("div", Object.assign({ className: cvaAlertRightAligned({ layout }) }, { children: [secondaryAction && (jsx(Button, Object.assign({ size: "small", variant: "transparent", color: getButtonColor(), onClick: secondaryAction.onClick, loading: secondaryAction === null || secondaryAction === void 0 ? void 0 : secondaryAction.loading }, { children: secondaryAction.label }))), primaryAction && (jsx(Button, Object.assign({ size: "small", color: getButtonColor(), onClick: primaryAction.onClick, loading: primaryAction === null || primaryAction === void 0 ? void 0 : primaryAction.loading }, { children: primaryAction.label }))), onClose && inline ? (jsx("div", Object.assign({ className: cvaAlertCloseButtonContainer({ layout }) }, { children: jsx(IconButton, { size: "small", variant: "transparent", color: "secondary", onClick: onClose, icon: jsx(Icon, { name: "XMarkIcon", size: "small" }), title: "Close Alert", circular: true }) }))) : null] })))] }))] })));
|
|
453
|
+
};
|
|
424
454
|
|
|
425
455
|
/**
|
|
426
456
|
* The Badge component is used to display a notification badge with an optional number value.
|
|
@@ -449,6 +479,58 @@ const StyledText$2 = tw.text `
|
|
|
449
479
|
${getBadgeModifierClass()}
|
|
450
480
|
`;
|
|
451
481
|
|
|
482
|
+
const cvaCard = cvaMerge([
|
|
483
|
+
"flex",
|
|
484
|
+
"border",
|
|
485
|
+
"flex-col",
|
|
486
|
+
"relative",
|
|
487
|
+
"bg-white",
|
|
488
|
+
"component-card-shadow",
|
|
489
|
+
"component-card-border",
|
|
490
|
+
"transition-shadow",
|
|
491
|
+
"ease-in-out",
|
|
492
|
+
], {
|
|
493
|
+
variants: {
|
|
494
|
+
clickable: {
|
|
495
|
+
false: "",
|
|
496
|
+
true: "cursor-pointer hover:shadow-md",
|
|
497
|
+
},
|
|
498
|
+
fullHeight: {
|
|
499
|
+
false: "",
|
|
500
|
+
true: "h-full",
|
|
501
|
+
},
|
|
502
|
+
},
|
|
503
|
+
defaultVariants: {
|
|
504
|
+
clickable: false,
|
|
505
|
+
fullHeight: false,
|
|
506
|
+
},
|
|
507
|
+
});
|
|
508
|
+
const cvaCardBody = cvaMerge(["flex-grow", "overflow-auto"]);
|
|
509
|
+
const cvaCardFooterDensityContainer = cvaMerge(["border-t-2", "border-neutral-200", "justify-end"], {
|
|
510
|
+
variants: {
|
|
511
|
+
border: {
|
|
512
|
+
default: "",
|
|
513
|
+
borderless: "border-t-0",
|
|
514
|
+
},
|
|
515
|
+
},
|
|
516
|
+
defaultVariants: {
|
|
517
|
+
border: "default",
|
|
518
|
+
},
|
|
519
|
+
});
|
|
520
|
+
const cvaCardHeader = cvaMerge(["flex", "justify-between"]);
|
|
521
|
+
const cvaCardHeaderHeadingContainer = cvaMerge(["flex", "gap-4", "items-center"]);
|
|
522
|
+
const cvaCardHeaderDensityContainer = cvaMerge(["border-b-2", "border-neutral-200"], {
|
|
523
|
+
variants: {
|
|
524
|
+
border: {
|
|
525
|
+
default: "",
|
|
526
|
+
borderless: "border-b-0",
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
defaultVariants: {
|
|
530
|
+
border: "default",
|
|
531
|
+
},
|
|
532
|
+
});
|
|
533
|
+
|
|
452
534
|
const ROLE_CARD = "region";
|
|
453
535
|
/**
|
|
454
536
|
* The Card component is a container for UI elements, and is the main component of the modal.
|
|
@@ -458,28 +540,9 @@ const ROLE_CARD = "region";
|
|
|
458
540
|
* @returns {JSX.Element} Card component
|
|
459
541
|
*/
|
|
460
542
|
const Card = (_a) => {
|
|
461
|
-
var { children, onClick, fullHeight = false, onMouseEnter, onMouseLeave, className, dataTestId,
|
|
462
|
-
return (jsx(
|
|
463
|
-
};
|
|
464
|
-
const getOverflow$1 = () => ({ $overflow }) => {
|
|
465
|
-
if (!$overflow) {
|
|
466
|
-
return null;
|
|
467
|
-
}
|
|
468
|
-
const overflows = {
|
|
469
|
-
visible: tws `overflow-visible`,
|
|
470
|
-
hidden: tws `overflow-hidden`,
|
|
471
|
-
scroll: tws `overflow-scroll`,
|
|
472
|
-
auto: tws `overflow-auto`,
|
|
473
|
-
};
|
|
474
|
-
return overflows[$overflow];
|
|
475
|
-
};
|
|
476
|
-
const StyledCard$2 = tw.div `
|
|
477
|
-
tu-card
|
|
478
|
-
${p => (p.$fullHeight ? `h-full` : null)}
|
|
479
|
-
|
|
480
|
-
${p => p.onClick && `tu-card--clickable`}
|
|
481
|
-
${getOverflow$1()}
|
|
482
|
-
`;
|
|
543
|
+
var { children, onClick, fullHeight = false, onMouseEnter, onMouseLeave, className, dataTestId, gridArea } = _a, rest = __rest(_a, ["children", "onClick", "fullHeight", "onMouseEnter", "onMouseLeave", "className", "dataTestId", "gridArea"]);
|
|
544
|
+
return (jsx("div", Object.assign({}, rest, { onClick: onClick, className: cvaCard({ fullHeight, clickable: Boolean(onClick), className }), onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, "data-testid": dataTestId, role: ROLE_CARD, style: { gridArea } }, { children: children })));
|
|
545
|
+
};
|
|
483
546
|
|
|
484
547
|
/**
|
|
485
548
|
* The DensityContainer component applies gap and padding.
|
|
@@ -490,7 +553,7 @@ const StyledCard$2 = tw.div `
|
|
|
490
553
|
* @returns {JSX.Element} DensityContainer component
|
|
491
554
|
*/
|
|
492
555
|
const DensityContainer = ({ children, className, dataTestId, density, disableGap, direction, }) => {
|
|
493
|
-
return (jsx(StyledDensityContainer
|
|
556
|
+
return (jsx(StyledDensityContainer, Object.assign({ "$disableGap": disableGap, "$density": density, "$direction": direction, "data-testid": dataTestId, className: className }, { children: children })));
|
|
494
557
|
};
|
|
495
558
|
const getDirection = () => ({ $direction }) => {
|
|
496
559
|
$direction = $direction !== null && $direction !== void 0 ? $direction : "column";
|
|
@@ -522,7 +585,7 @@ const DensityFinder = ({ $density }) => {
|
|
|
522
585
|
return densityAuto;
|
|
523
586
|
}
|
|
524
587
|
};
|
|
525
|
-
const StyledDensityContainer
|
|
588
|
+
const StyledDensityContainer = tw.div `
|
|
526
589
|
flex
|
|
527
590
|
${getDirection()}
|
|
528
591
|
${p => (p.$disableGap ? tws `gap-0` : null)}
|
|
@@ -537,25 +600,9 @@ ${DensityFinder}
|
|
|
537
600
|
* @param {CardBodyProps} props - The props for the CardBody component
|
|
538
601
|
* @returns {JSX.Element} CardBody component
|
|
539
602
|
*/
|
|
540
|
-
const CardBody = ({ density = "auto",
|
|
541
|
-
return (jsx(
|
|
542
|
-
};
|
|
543
|
-
const getOverflow = () => ({ $overflow }) => {
|
|
544
|
-
if (!$overflow) {
|
|
545
|
-
return null;
|
|
546
|
-
}
|
|
547
|
-
const overflows = {
|
|
548
|
-
visible: tws `overflow-visible`,
|
|
549
|
-
hidden: tws `overflow-hidden`,
|
|
550
|
-
scroll: tws `overflow-scroll`,
|
|
551
|
-
auto: tws `overflow-auto`,
|
|
552
|
-
};
|
|
553
|
-
return overflows[$overflow];
|
|
554
|
-
};
|
|
555
|
-
const StyledDensityContainer = twx(DensityContainer) `
|
|
556
|
-
${getOverflow()}
|
|
557
|
-
tu-card__body
|
|
558
|
-
`;
|
|
603
|
+
const CardBody = ({ density = "auto", children, dataTestId, className, disableGap }) => {
|
|
604
|
+
return (jsx(DensityContainer, Object.assign({ density: density, dataTestId: dataTestId, className: cvaCardBody({ className }), disableGap: disableGap }, { children: children })));
|
|
605
|
+
};
|
|
559
606
|
|
|
560
607
|
/**
|
|
561
608
|
* A simple footer intended to use with Cards and Modals.
|
|
@@ -566,12 +613,8 @@ const StyledDensityContainer = twx(DensityContainer) `
|
|
|
566
613
|
* @returns {JSX.Element} CardFooter component
|
|
567
614
|
*/
|
|
568
615
|
const CardFooter = ({ dataTestId, className, children, density, hideSeparator = false }) => {
|
|
569
|
-
return (jsx(
|
|
570
|
-
};
|
|
571
|
-
const Container$5 = twx(DensityContainer) `
|
|
572
|
-
tu-card__footer-density-container
|
|
573
|
-
${p => p.$hideSeparator && tws `tu-card__footer-density-container--borderless`}
|
|
574
|
-
`;
|
|
616
|
+
return (jsx(DensityContainer, Object.assign({ dataTestId: dataTestId, className: cvaCardFooterDensityContainer({ border: hideSeparator ? "borderless" : "default", className }), density: density, direction: "row" }, { children: children })));
|
|
617
|
+
};
|
|
575
618
|
|
|
576
619
|
/**
|
|
577
620
|
* The Heading is used for a heading of a section (h1,h2,h3,h4).
|
|
@@ -615,18 +658,8 @@ const StyledHeading = tw.div `
|
|
|
615
658
|
* @returns {JSX.Element} CardHeader component
|
|
616
659
|
*/
|
|
617
660
|
const CardHeader = ({ heading, headingVariant = "primary", subHeading, onClose, dataTestId, className, children, accessories, density, extraClassName, hideSeparator = false, }) => {
|
|
618
|
-
return (jsx(
|
|
619
|
-
};
|
|
620
|
-
const Root$5 = twx(DensityContainer) `
|
|
621
|
-
tu-card__header-density-container
|
|
622
|
-
${p => p.$hideSeparator && tws `tu-card__header-density-container--borderless`}
|
|
623
|
-
`;
|
|
624
|
-
const Container$4 = tw.div `
|
|
625
|
-
tu-card__header
|
|
626
|
-
`;
|
|
627
|
-
const HeadingContainer$1 = tw.div `
|
|
628
|
-
tu-card__header-heading-container
|
|
629
|
-
`;
|
|
661
|
+
return (jsx(DensityContainer, Object.assign({ dataTestId: dataTestId, className: cvaCardHeaderDensityContainer({ border: hideSeparator ? "borderless" : "default", className }), density: density }, { children: jsxs("div", Object.assign({ className: cvaCardHeader() }, { children: [jsxs("div", Object.assign({ className: extraClassName }, { children: [jsxs("div", Object.assign({ className: cvaCardHeaderHeadingContainer() }, { children: [jsx(Heading$1, Object.assign({ className: "self-center", variant: headingVariant }, { children: heading })), accessories] })), subHeading && (jsx(Heading$1, Object.assign({ subtle: true, variant: "subtitle" }, { children: subHeading }))), children] })), onClose && (jsx(IconButton, { dataTestId: "card-header-close-button", variant: "transparent", color: "secondary", onClick: onClose, icon: jsx(Icon, { name: "XMarkIcon", size: "small" }), className: "!h-min" }))] })) })));
|
|
662
|
+
};
|
|
630
663
|
|
|
631
664
|
/**
|
|
632
665
|
* The Collapse component is used to condense non-important information.
|
|
@@ -668,6 +701,31 @@ const StyledCollapsible = tw.div `
|
|
|
668
701
|
tu-collapsible
|
|
669
702
|
`;
|
|
670
703
|
|
|
704
|
+
const cvaCopyableText = cvaMerge([
|
|
705
|
+
"py-1",
|
|
706
|
+
"px-2",
|
|
707
|
+
"border",
|
|
708
|
+
"border-dashed",
|
|
709
|
+
"border-neutral-600",
|
|
710
|
+
"rounded",
|
|
711
|
+
"cursor-pointer",
|
|
712
|
+
"inline",
|
|
713
|
+
"transition-all",
|
|
714
|
+
"ease-in-out",
|
|
715
|
+
"leading-7",
|
|
716
|
+
"break-words",
|
|
717
|
+
], {
|
|
718
|
+
variants: {
|
|
719
|
+
animating: {
|
|
720
|
+
false: "",
|
|
721
|
+
true: "animate-copy",
|
|
722
|
+
},
|
|
723
|
+
},
|
|
724
|
+
defaultVariants: {
|
|
725
|
+
animating: false,
|
|
726
|
+
},
|
|
727
|
+
});
|
|
728
|
+
|
|
671
729
|
/**
|
|
672
730
|
* The CopyableText component is used where the user should have easy access to copy information.
|
|
673
731
|
*
|
|
@@ -683,11 +741,8 @@ const CopyableText = ({ text, alternativeText, dataTestId, className }) => {
|
|
|
683
741
|
copyToClipboard(value);
|
|
684
742
|
setAnimating(true);
|
|
685
743
|
};
|
|
686
|
-
return (jsx(
|
|
687
|
-
};
|
|
688
|
-
const StyledCopyableText = tw.span `
|
|
689
|
-
tu-copyable-text
|
|
690
|
-
${p => (p.$animating ? tws `tu-copyable-text--animating` : null)}`;
|
|
744
|
+
return (jsx("span", Object.assign({ className: cvaCopyableText({ animating, className }), "data-testid": dataTestId, onClick: handleOnClick, onAnimationEnd: () => setAnimating(false), title: value }, { children: text })));
|
|
745
|
+
};
|
|
691
746
|
|
|
692
747
|
const localeLookup = {
|
|
693
748
|
en: enGB,
|
|
@@ -1930,9 +1985,9 @@ const Timeline = ({ className, dataTestId, children }) => {
|
|
|
1930
1985
|
* @param {TimeLineElementProps} props the props
|
|
1931
1986
|
* @returns {JSX.Element} component
|
|
1932
1987
|
*/
|
|
1933
|
-
const TimelineElement = ({ date, showTime, children, className, dataTestId = "timeline-date", dot = jsx(Indicator, { className: tws `mt-[-1px]`, color: "neutral", icon: jsx(Icon, { name: "CalendarIcon", size: "large" }) }), header = defaultHeader(date, showTime), onClick, }) => {
|
|
1988
|
+
const TimelineElement = ({ date, showTime, children, className, dataTestId = "timeline-date", headerClassName, dot = jsx(Indicator, { className: tws `mt-[-1px]`, color: "neutral", icon: jsx(Icon, { name: "CalendarIcon", size: "large" }) }), header = defaultHeader(date, showTime), onClick, }) => {
|
|
1934
1989
|
var _a;
|
|
1935
|
-
return (jsxs("li", Object.assign({ className: `${tws `tu-timeline-element`}${(_a = " " + className) !== null && _a !== void 0 ? _a : ""} `, "data-date":
|
|
1990
|
+
return (jsxs("li", Object.assign({ className: `${tws `tu-timeline-element`}${(_a = " " + className) !== null && _a !== void 0 ? _a : ""} `, "data-date": date, "data-testid": dataTestId && dataTestId, onClick: () => onClick && onClick() }, { children: [jsx("div", Object.assign({ className: tws `tu-timeline-element__dot` }, { children: dot })), jsx("div", Object.assign({ className: headerClassName }, { children: header })), jsx("div", {}), jsx("div", { children: jsx("div", { children: children }) })] })));
|
|
1936
1991
|
};
|
|
1937
1992
|
function defaultHeader(date, showTime) {
|
|
1938
1993
|
return `${format(date, showTime ? "MMM d, yyyy H:mm" : "MMM d, yyyy")} (${formatDistance(date, new Date(), {
|
|
@@ -2030,6 +2085,30 @@ const Bar = tw.rect `
|
|
|
2030
2085
|
tu-value-bar__bar
|
|
2031
2086
|
`;
|
|
2032
2087
|
|
|
2088
|
+
const cvaClickable = cvaMerge([
|
|
2089
|
+
"shadow-lg",
|
|
2090
|
+
"rounded-lg",
|
|
2091
|
+
"p-3",
|
|
2092
|
+
"bg-neutral-50",
|
|
2093
|
+
"transition-all",
|
|
2094
|
+
"border-2",
|
|
2095
|
+
"border-solid",
|
|
2096
|
+
"border-neutral-100",
|
|
2097
|
+
"cursor-pointer",
|
|
2098
|
+
"hover:border-primary-500",
|
|
2099
|
+
"hover:bg-primary-200",
|
|
2100
|
+
], {
|
|
2101
|
+
variants: {
|
|
2102
|
+
disabled: {
|
|
2103
|
+
false: "",
|
|
2104
|
+
true: "cursor-default hover:border-neutral-100 hover:bg-neutral-50",
|
|
2105
|
+
},
|
|
2106
|
+
},
|
|
2107
|
+
defaultVariants: {
|
|
2108
|
+
disabled: false,
|
|
2109
|
+
},
|
|
2110
|
+
});
|
|
2111
|
+
|
|
2033
2112
|
/**
|
|
2034
2113
|
* The MinTopFullContentLayout component.
|
|
2035
2114
|
*
|
|
@@ -2217,4 +2296,4 @@ const Layout = tw.div `
|
|
|
2217
2296
|
tu-layout-TwoColumnLayout
|
|
2218
2297
|
`;
|
|
2219
2298
|
|
|
2220
|
-
export { Alert, Badge, Button, Card, CardBody, CardFooter, CardHeader, Collapse, ContentGridArea, CopyableText, DayPicker, DayPickerPopover, DayRangePicker, DensityContainer, Drawer, ExternalLink, FilterListMapLayout, FullWidthRepeatingLayout, GridArea, Heading$1 as Heading, Icon, IconButton, Indicator, IntrinsicallyResponsiveGrid, MenuItem, MenuList, MinTopFullContentLayout, Modal, ModalBackdrop, MoreMenu, NavGridArea, PageHeader, Pagination, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tag, Text$1 as Text, Timeline, TimelineElement, Tip, TitleGridArea, TitleNavContentLayout, Tooltip, TwoColumnLayout, ValueBar, docs, getDevicePixelRatio, getValueBarColorByValue, useClickOutside, useContainerProps, useDebounce, useDevicePixelRatio, useIsFirstRender, useLocalStorage, useLocalStorageReducer, useModal, usePopoverContext, usePrompt, useResize, useTimeout };
|
|
2299
|
+
export { Alert, Badge, Button, Card, CardBody, CardFooter, CardHeader, Collapse, ContentGridArea, CopyableText, DayPicker, DayPickerPopover, DayRangePicker, DensityContainer, Drawer, ExternalLink, FilterListMapLayout, FullWidthRepeatingLayout, GridArea, Heading$1 as Heading, Icon, IconButton, Indicator, IntrinsicallyResponsiveGrid, MenuItem, MenuList, MinTopFullContentLayout, Modal, ModalBackdrop, MoreMenu, NavGridArea, PageHeader, Pagination, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tag, Text$1 as Text, Timeline, TimelineElement, Tip, TitleGridArea, TitleNavContentLayout, Tooltip, TwoColumnLayout, ValueBar, cvaClickable, docs, getDevicePixelRatio, getValueBarColorByValue, useClickOutside, useContainerProps, useDebounce, useDevicePixelRatio, useIsFirstRender, useLocalStorage, useLocalStorageReducer, useModal, usePopoverContext, usePrompt, useResize, useTimeout };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.110",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@floating-ui/react": "0.22.2",
|
|
11
|
+
"@trackunit/css-class-variance-utilities": "0.0.5",
|
|
11
12
|
"@trackunit/css-core": "0.0.85",
|
|
12
13
|
"@trackunit/tailwind-styled-components": "0.0.57",
|
|
13
14
|
"@trackunit/ui-design-tokens": "0.0.69",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const cvaAlert: (props?: ({
|
|
2
|
+
color?: "danger" | "warning" | "success" | "info" | null | undefined;
|
|
3
|
+
layout?: "default" | "inline" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
|
+
export declare const cvaAlertDetails: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
6
|
+
export declare const cvaAlertContentBody: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
7
|
+
export declare const cvaAlertRightAligned: (props?: ({
|
|
8
|
+
layout?: "default" | "inline" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
10
|
+
export declare const cvaAlertContent: (props?: ({
|
|
11
|
+
layout?: "default" | "inline" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
13
|
+
export declare const cvaAlertCloseButtonContainer: (props?: ({
|
|
14
|
+
layout?: "default" | "inline" | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
16
|
+
export declare const cvaAlertIconContainer: (props?: ({
|
|
17
|
+
layout?: "default" | "inline" | null | undefined;
|
|
18
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
3
|
export declare const ROLE_CARD = "region";
|
|
4
|
-
type Overflow = "visible" | "hidden" | "scroll" | "auto";
|
|
5
4
|
export interface CardProps extends CommonProps, React.InputHTMLAttributes<HTMLDivElement> {
|
|
6
5
|
/**
|
|
7
6
|
* Whether the card should have full height or not.
|
|
8
7
|
*/
|
|
9
8
|
fullHeight?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Whether the card should overflow contents.
|
|
12
|
-
*/
|
|
13
|
-
overflow?: Overflow;
|
|
14
9
|
/**
|
|
15
10
|
* The css grid area to place the card.
|
|
16
11
|
*
|
|
@@ -41,5 +36,4 @@ export interface CardProps extends CommonProps, React.InputHTMLAttributes<HTMLDi
|
|
|
41
36
|
* @param {CardProps} props - The props for the Card component
|
|
42
37
|
* @returns {JSX.Element} Card component
|
|
43
38
|
*/
|
|
44
|
-
export declare const Card: ({ children, onClick, fullHeight, onMouseEnter, onMouseLeave, className, dataTestId,
|
|
45
|
-
export {};
|
|
39
|
+
export declare const Card: ({ children, onClick, fullHeight, onMouseEnter, onMouseLeave, className, dataTestId, gridArea, ...rest }: CardProps) => JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const cvaCard: (props?: ({
|
|
2
|
+
clickable?: boolean | null | undefined;
|
|
3
|
+
fullHeight?: boolean | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
|
+
export declare const cvaCardBody: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
6
|
+
export declare const cvaCardFooterDensityContainer: (props?: ({
|
|
7
|
+
border?: "default" | "borderless" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
9
|
+
export declare const cvaCardHeader: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
10
|
+
export declare const cvaCardHeaderHeadingContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
11
|
+
export declare const cvaCardHeaderDensityContainer: (props?: ({
|
|
12
|
+
border?: "default" | "borderless" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { CommonProps, Density } from "../../common/CommonProps";
|
|
3
|
-
type Overflow = "visible" | "hidden" | "scroll" | "auto" | "inherit";
|
|
4
3
|
export interface CardBodyProps extends CommonProps {
|
|
5
|
-
/**
|
|
6
|
-
* Tells the body how to handle overflowing elements.
|
|
7
|
-
* Directly mapped to the overflow css property.
|
|
8
|
-
*/
|
|
9
|
-
overflow?: Overflow;
|
|
10
4
|
/**
|
|
11
5
|
* Sets gap, padding and margin.
|
|
12
6
|
*/
|
|
@@ -28,5 +22,4 @@ export interface CardBodyProps extends CommonProps {
|
|
|
28
22
|
* @param {CardBodyProps} props - The props for the CardBody component
|
|
29
23
|
* @returns {JSX.Element} CardBody component
|
|
30
24
|
*/
|
|
31
|
-
export declare const CardBody: ({ density,
|
|
32
|
-
export {};
|
|
25
|
+
export declare const CardBody: ({ density, children, dataTestId, className, disableGap }: CardBodyProps) => JSX.Element;
|
|
@@ -20,6 +20,7 @@ interface TimeLineElementProps extends CommonProps {
|
|
|
20
20
|
children: React.ReactNode;
|
|
21
21
|
dot?: React.ReactNode;
|
|
22
22
|
onClick?: () => void;
|
|
23
|
+
headerClassName?: string;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* TimelineElement - entry on a timeline - rendered with an icon on the timeline
|
|
@@ -28,5 +29,5 @@ interface TimeLineElementProps extends CommonProps {
|
|
|
28
29
|
* @param {TimeLineElementProps} props the props
|
|
29
30
|
* @returns {JSX.Element} component
|
|
30
31
|
*/
|
|
31
|
-
export declare const TimelineElement: ({ date, showTime, children, className, dataTestId, dot, header, onClick, }: TimeLineElementProps) => JSX.Element;
|
|
32
|
+
export declare const TimelineElement: ({ date, showTime, children, className, dataTestId, headerClassName, dot, header, onClick, }: TimeLineElementProps) => JSX.Element;
|
|
32
33
|
export {};
|