@trackunit/react-components 0.1.238 → 0.1.239

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.esm.js CHANGED
@@ -44,43 +44,6 @@ const useContainerProps = ({ className, dataTestId }) => {
44
44
  return containerProps;
45
45
  };
46
46
 
47
- /******************************************************************************
48
- Copyright (c) Microsoft Corporation.
49
-
50
- Permission to use, copy, modify, and/or distribute this software for any
51
- purpose with or without fee is hereby granted.
52
-
53
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
54
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
55
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
56
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
57
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
58
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
59
- PERFORMANCE OF THIS SOFTWARE.
60
- ***************************************************************************** */
61
-
62
- function __rest(s, e) {
63
- var t = {};
64
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
65
- t[p] = s[p];
66
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
67
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
68
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
69
- t[p[i]] = s[p[i]];
70
- }
71
- return t;
72
- }
73
-
74
- function __awaiter(thisArg, _arguments, P, generator) {
75
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
76
- return new (P || (P = Promise))(function (resolve, reject) {
77
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
78
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
79
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
80
- step((generator = generator.apply(thisArg, _arguments || [])).next());
81
- });
82
- }
83
-
84
47
  const cvaIcon = cvaMerge(["aspect-square", "inline-grid", "relative"], {
85
48
  variants: {
86
49
  color: {
@@ -167,6 +130,7 @@ cvaMerge([
167
130
  ]);
168
131
 
169
132
  const iconPalette = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, intentPalette), generalPalette), criticalityPalette), activityPalette), utilizationPalette), sitesPalette), rentalStatusPalette);
133
+ // eslint-disable-next-line local-rules/no-typescript-assertion
170
134
  const iconColorNames = Object.keys(iconPalette).map(key => key.toLowerCase()); // This users the object in the Object.keys() to infer the type of the keys.
171
135
  const isSafari = () => {
172
136
  const ua = navigator.userAgent.toLowerCase();
@@ -202,10 +166,7 @@ const Icon = ({ name, size = "large", className, dataTestId, color, onClick, typ
202
166
  useTagRef.current.setAttribute("href", href[correctIconType]);
203
167
  }
204
168
  }, [correctIconType, href]);
205
- if (!iconName) {
206
- return null;
207
- }
208
- return (jsx("span", { className: cvaIcon({ color, size, className }), onClick: onClick, "data-testid": dataTestId, ref: forwardedRef, children: jsx("svg", { viewBox: correctIconType === "mini" ? "0 0 20 20" : "0 0 24 24", "data-testid": dataTestId ? `${dataTestId}-${iconName}` : iconName, style: style, children: jsx("use", { href: href[correctIconType], ref: useTagRef }) }) }));
169
+ return (jsx("span", { className: cvaIcon({ color, size, className }), onClick: onClick, "data-testid": dataTestId, ref: forwardedRef, children: jsxs("svg", { viewBox: correctIconType === "mini" ? "0 0 20 20" : "0 0 24 24", "data-testid": dataTestId ? `${dataTestId}-${iconName}` : iconName, style: style, role: "img", children: [jsx("title", { children: iconName }), jsx("use", { href: href[correctIconType], ref: useTagRef })] }) }));
209
170
  };
210
171
 
211
172
  const cvaTag = cvaMerge([
@@ -284,12 +245,12 @@ const cvaTagIcon = cvaMerge(["cursor-pointer", "transition-opacity", "hover:opac
284
245
  * @param {TagProps} props - The props for the tag component
285
246
  * @returns {JSX.Element} tag component
286
247
  */
287
- const Tag = React.forwardRef((_a, ref) => {
288
- var { className, dataTestId, children, size = "medium", onClose, color = "primary", disabled = false } = _a; __rest(_a, ["className", "dataTestId", "children", "size", "onClose", "color", "disabled"]);
289
- return (jsxs("span", { className: cvaTag({ className, size, color, layout: Boolean(onClose) ? "withIcon" : "default" }), "data-testid": dataTestId && `${dataTestId}-tag`, ref: ref, children: [children, Boolean(onClose) && !disabled && (
248
+ const Tag = React.forwardRef(({ className, dataTestId, children, size = "medium", onClose, color = "primary", disabled = false }, ref) => {
249
+ return (jsxs("span", { className: cvaTag({ className, size, color, layout: onClose ? "withIcon" : "default" }), "data-testid": dataTestId, ref: ref, children: [children, Boolean(onClose) && !disabled ? (
290
250
  // a fix for multiselect deselecting tags working together with fade out animation
291
- jsx("div", { className: cvaTagIconContainer(), onMouseDown: onClose, children: jsx(Icon, { name: "XCircle", dataTestId: dataTestId + "Icon", type: "solid", size: size, style: { WebkitTransition: "-webkit-transform 0.150s" }, className: cvaTagIcon() }) }))] }));
251
+ jsx("div", { className: cvaTagIconContainer(), onMouseDown: onClose, children: jsx(Icon, { name: "XCircle", dataTestId: dataTestId + "Icon", type: "solid", size: size, style: { WebkitTransition: "-webkit-transform 0.150s" }, className: cvaTagIcon() }) })) : null] }));
292
252
  });
253
+ Tag.displayName = "Tag";
293
254
 
294
255
  /**
295
256
  * A component used to display the package name and version in the Storybook docs.
@@ -298,6 +259,43 @@ const PackageNameStoryComponent = ({ packageJSON }) => {
298
259
  return (jsxs("div", { className: "flex gap-2", children: [jsx(Tag, { color: "secondary", children: packageJSON === null || packageJSON === void 0 ? void 0 : packageJSON.name }), jsxs(Tag, { color: "secondary", children: ["v", packageJSON === null || packageJSON === void 0 ? void 0 : packageJSON.version] })] }));
299
260
  };
300
261
 
262
+ /******************************************************************************
263
+ Copyright (c) Microsoft Corporation.
264
+
265
+ Permission to use, copy, modify, and/or distribute this software for any
266
+ purpose with or without fee is hereby granted.
267
+
268
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
269
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
270
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
271
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
272
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
273
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
274
+ PERFORMANCE OF THIS SOFTWARE.
275
+ ***************************************************************************** */
276
+
277
+ function __rest(s, e) {
278
+ var t = {};
279
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
280
+ t[p] = s[p];
281
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
282
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
283
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
284
+ t[p[i]] = s[p[i]];
285
+ }
286
+ return t;
287
+ }
288
+
289
+ function __awaiter(thisArg, _arguments, P, generator) {
290
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
291
+ return new (P || (P = Promise))(function (resolve, reject) {
292
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
293
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
294
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
295
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
296
+ });
297
+ }
298
+
301
299
  const cvaText = cvaMerge(["text-black", "m-0", "relative", "text-sm", "font-normal"], {
302
300
  variants: {
303
301
  align: {
@@ -374,7 +372,7 @@ const Text = (_a) => {
374
372
  subtle,
375
373
  disabled,
376
374
  className,
377
- }), "data-testid": dataTestId, children }, rest));
375
+ }), "data-testid": dataTestId }, rest), children);
378
376
  };
379
377
 
380
378
  const cvaSpinner = cvaMerge([
@@ -447,10 +445,9 @@ const cvaButton = cvaMerge([
447
445
  "outline-current",
448
446
  "transition-all",
449
447
  "ease-in-out",
450
- "component-button-border",
451
448
  "cursor-pointer",
452
449
  "flex-none",
453
- "py-1.5",
450
+ "component-button-border",
454
451
  "component-button-padding",
455
452
  "component-button-height",
456
453
  "focus:ring",
@@ -460,7 +457,6 @@ const cvaButton = cvaMerge([
460
457
  "text-sm",
461
458
  "font-medium",
462
459
  "align-middle",
463
- "h-min",
464
460
  ], {
465
461
  variants: {
466
462
  color: {
@@ -523,9 +519,24 @@ const cvaButton = cvaMerge([
523
519
  ],
524
520
  },
525
521
  size: {
526
- small: ["py-1", "px-2"],
527
- medium: "",
528
- large: ["py-2", "px-4"],
522
+ /**
523
+ * TLDR; Calculating min-height so button sizes are (more) consistently sized.
524
+ *
525
+ * OK. let me explain this one.
526
+ * min-h here is to match the height of a button that has text inside
527
+ * We could just use the same min-h-[var(--line-height-sm)]) for all sizes
528
+ * but then the button would be too small since button is using box-sizing: border-box
529
+ * and what we really want is to make sure it's _content_ is the same height as a
530
+ * button with text inside.
531
+ * We could then change the box-sizing to content-box but that would break other things
532
+ * and be inconsistent with almost all everything else.
533
+ *
534
+ * So we need to add padding to the min-height calculation. Two times the vertical
535
+ * padding aka py-1 * 2 aka --spacing-1 * 2 aka spacing-2 (for small).
536
+ */
537
+ small: ["py-1", "px-2", "min-h-[calc(var(--line-height-sm)+var(--spacing-2))]"],
538
+ medium: ["py-1.5", "px-3", "min-h-[calc(var(--line-height-sm)+var(--spacing-3))]"],
539
+ large: ["py-2", "px-4", "min-h-[calc(var(--line-height-sm)+var(--spacing-4))]"],
529
540
  },
530
541
  rounded: {
531
542
  true: ["rounded-full"],
@@ -549,6 +560,21 @@ const cvaButton = cvaMerge([
549
560
  },
550
561
  },
551
562
  compoundVariants: [
563
+ {
564
+ square: true,
565
+ size: "small",
566
+ className: ["p-1"], // square is easier with same padding on all sides
567
+ },
568
+ {
569
+ square: true,
570
+ size: "medium",
571
+ className: ["p-1.5"],
572
+ },
573
+ {
574
+ square: true,
575
+ size: "large",
576
+ className: ["p-2"],
577
+ },
552
578
  {
553
579
  color: "primary",
554
580
  variant: "transparent",
@@ -608,19 +634,6 @@ const cvaButton = cvaMerge([
608
634
  variant: "filled",
609
635
  },
610
636
  });
611
- const cvaButtonSpinner = cvaMerge(["!w-[1em]", "!h-[1em]"]);
612
- const cvaIconButtonContainer = cvaMerge(["w-5", "h-5", "flex", "justify-center", "items-center", "box-border"], {
613
- variants: {
614
- size: {
615
- small: ["flex", "justify-center", "items-center", "box-border"],
616
- medium: "",
617
- large: "",
618
- },
619
- },
620
- defaultVariants: {
621
- size: "medium",
622
- },
623
- });
624
637
 
625
638
  /**
626
639
  * Buttons allow users to perform an action when triggered.
@@ -635,16 +648,18 @@ const Button = React.forwardRef((_a, ref) => {
635
648
  type,
636
649
  role,
637
650
  onClick,
638
- tabIndex, disabled: disabled || loading, className: cvaButton({ rounded: circular, disabled, size, square, color, variant, fullWidth, className }), "aria-label": title, "data-testid": dataTestId, children: (jsxs(Fragment, { children: [loading && jsx(Spinner, { className: cvaButtonSpinner(), centering: "vertically" }), prefix, children, suffix] })) }, rest));
651
+ tabIndex, disabled: disabled || loading, className: cvaButton({ rounded: circular, disabled, size, square, color, variant, fullWidth, className }), "aria-label": title, "data-testid": dataTestId }, rest), jsxs(Fragment, { children: [loading ? jsx(Spinner, { size: "small", centering: "vertically" }) : null, prefix, children, suffix] }));
639
652
  });
653
+ Button.displayName = "Button";
640
654
 
641
655
  /**
642
656
  * The IconButton is used for a button with an icon.
643
657
  */
644
658
  const IconButton = React.forwardRef((_a, ref) => {
645
659
  var { icon, size = "small", square = true, loading, disabled } = _a, rest = __rest(_a, ["icon", "size", "square", "loading", "disabled"]);
646
- return (jsx(Button, Object.assign({ size: size, square: square, disabled: disabled || loading, ref: ref }, rest, { children: jsx("div", { className: cvaIconButtonContainer({ size }), children: loading ? jsx(Spinner, { size: size }) : icon }) })));
660
+ return (jsx(Button, Object.assign({ size: size, prefix: !loading ? icon : undefined, square: square, loading: loading, disabled: disabled || loading, ref: ref }, rest)));
647
661
  });
662
+ IconButton.displayName = "IconButton";
648
663
 
649
664
  /**
650
665
  * The StarButton component is used for favorite actions or similar.
@@ -708,11 +723,13 @@ const Alert = ({ color = "info", title, className, children, primaryAction, seco
708
723
  }
709
724
  };
710
725
  React.useEffect(() => {
726
+ var _a, _b;
711
727
  if (autoScroll) {
712
- ref && ref.current && ref.current.scrollIntoView && ref.current.scrollIntoView();
728
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
729
+ (_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView) === null || _b === void 0 ? void 0 : _b.call(_a);
713
730
  }
714
731
  }, [ref, autoScroll]);
715
- return (jsxs("div", { className: cvaAlert({ color, className }), "data-testid": dataTestId, ref: ref, role: "alert", children: [jsxs("div", { className: cvaAlertContentContainer(), children: [jsx("div", { className: cvaAlertIconContainer(), children: getIconFromColor() }), jsxs("div", { className: cvaContent(), children: [title ? jsx(Text, { weight: "bold", children: title }) : null, children ? (jsx(Text, { type: typeof children === "string" || typeof children === "number" ? "p" : "span", weight: !title ? "bold" : "normal", children: children })) : null] }), onClose ? (jsx("div", { className: cvaAlertCloseButtonContainer(), children: jsx(IconButton, { size: "small", variant: "transparent", color: "secondary", onClick: onClose, icon: jsx(Icon, { name: "XMark", size: "small" }), title: "Close Alert", circular: true }) })) : null] }), (primaryAction || secondaryAction) && (jsxs("div", { className: cvaAlertActionsContainer(), children: [secondaryAction && (jsx(Button, { 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, { size: "small", color: getButtonColor(), onClick: primaryAction.onClick, loading: primaryAction === null || primaryAction === void 0 ? void 0 : primaryAction.loading, children: primaryAction.label }))] }))] }));
732
+ return (jsxs("div", { className: cvaAlert({ color, className }), "data-testid": dataTestId, ref: ref, role: "alert", children: [jsxs("div", { className: cvaAlertContentContainer(), children: [jsx("div", { className: cvaAlertIconContainer(), children: getIconFromColor() }), jsxs("div", { className: cvaContent(), children: [title ? jsx(Text, { weight: "bold", children: title }) : null, children ? (jsx(Text, { type: typeof children === "string" || typeof children === "number" ? "p" : "span", weight: !title ? "bold" : "normal", children: children })) : null] }), onClose ? (jsx("div", { className: cvaAlertCloseButtonContainer(), children: jsx(IconButton, { size: "small", variant: "transparent", color: "secondary", onClick: onClose, icon: jsx(Icon, { name: "XMark", size: "small" }), title: "Close Alert", circular: true }) })) : null] }), primaryAction || secondaryAction ? (jsxs("div", { className: cvaAlertActionsContainer(), children: [secondaryAction ? (jsx(Button, { size: "small", variant: "transparent", color: getButtonColor(), onClick: secondaryAction.onClick, loading: secondaryAction.loading, children: secondaryAction.label })) : null, primaryAction ? (jsx(Button, { size: "small", color: getButtonColor(), onClick: primaryAction.onClick, loading: primaryAction.loading, children: primaryAction.label })) : null] })) : null] }));
716
733
  };
717
734
 
718
735
  const cvaBadge = cvaMerge([
@@ -788,7 +805,7 @@ const cvaCard = cvaMerge([
788
805
  fullHeight: false,
789
806
  },
790
807
  });
791
- const cvaCardFooterDensityContainer = cvaMerge(["flex border-t-2", "border-neutral-200", "justify-end", "flex-row"], {
808
+ const cvaCardFooterDensityContainer = cvaMerge(["flex", "border-t-2", "border-neutral-200", "justify-end", "flex-row"], {
792
809
  variants: {
793
810
  border: {
794
811
  default: "",
@@ -809,7 +826,7 @@ const cvaCardFooterDensityContainer = cvaMerge(["flex border-t-2", "border-neutr
809
826
  });
810
827
  const cvaCardHeader = cvaMerge(["flex", "justify-between", "flex-1"]);
811
828
  const cvaCardHeaderHeadingContainer = cvaMerge(["flex", "gap-4", "items-center"]);
812
- const cvaCardHeaderDensityContainer = cvaMerge(["flex border-b-2", "border-neutral-200"], {
829
+ const cvaCardHeaderDensityContainer = cvaMerge(["flex", "border-b-2", "border-neutral-200"], {
813
830
  variants: {
814
831
  border: {
815
832
  default: "",
@@ -955,7 +972,7 @@ const CardHeader = ({ heading, headingVariant = "primary", subHeading, onClose,
955
972
  density,
956
973
  border: hideSeparator ? "borderless" : "default",
957
974
  className,
958
- }), children: jsxs("div", { className: cvaCardHeader(), children: [jsxs("div", { className: extraClassName, children: [jsxs("div", { className: cvaCardHeaderHeadingContainer(), children: [jsx(Heading, { className: "self-center", variant: headingVariant, children: heading }), accessories] }), subHeading && (jsx(Heading, { 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: "XMark", size: "small" }), className: "!h-min" }))] }) }));
975
+ }), children: jsxs("div", { className: cvaCardHeader(), children: [jsxs("div", { className: extraClassName, children: [jsxs("div", { className: cvaCardHeaderHeadingContainer(), children: [jsx(Heading, { className: "self-center", variant: headingVariant, children: heading }), accessories] }), subHeading ? (jsx(Heading, { subtle: true, variant: "subtitle", children: subHeading })) : null, children] }), onClose ? (jsx(IconButton, { dataTestId: "card-header-close-button", variant: "transparent", color: "secondary", onClick: onClose, icon: jsx(Icon, { name: "XMark", size: "small" }), className: "!h-min" })) : null] }) }));
959
976
  };
960
977
 
961
978
  const cvaCollapse = cvaMerge([
@@ -1195,11 +1212,11 @@ const cvaPopoverTitleContainer = cvaMerge(["flex", "items-center", "px-2", "py-1
1195
1212
  const cvaPopoverTitleText = cvaMerge(["flex-1", "text-neutral-500"]);
1196
1213
 
1197
1214
  const PopoverContent = React__default.forwardRef(function PopoverContent(_a, propRef) {
1198
- var _b, _c, _d;
1215
+ var _b;
1199
1216
  var { className, dataTestId, children, portalId } = _a, props = __rest(_a, ["className", "dataTestId", "children", "portalId"]);
1200
- const _e = usePopoverContext(), { context: floatingContext, customProps } = _e, context = __rest(_e, ["context", "customProps"]);
1217
+ const _c = usePopoverContext(), { context: floatingContext, customProps } = _c, context = __rest(_c, ["context", "customProps"]);
1201
1218
  const ref = useMergeRefs([context.refs.setFloating, propRef]);
1202
- return (jsx(FloatingPortal, { id: portalId !== null && portalId !== void 0 ? portalId : "tu-floating-ui", children: context.isOpen && (jsx(FloatingFocusManager, { guards: false, context: floatingContext, modal: context.isModal, closeOnFocusOut: false, order: ["reference", "content"], returnFocus: false, children: jsx("div", Object.assign({ ref: ref, className: cvaPopoverContainer({ className: className !== null && className !== void 0 ? className : customProps.className }), "data-testid": (_b = dataTestId !== null && dataTestId !== void 0 ? dataTestId : customProps.dataTestId) !== null && _b !== void 0 ? _b : "popover-content", style: Object.assign({ position: context.strategy, top: (_c = context.y) !== null && _c !== void 0 ? _c : 0, left: (_d = context.x) !== null && _d !== void 0 ? _d : 0, width: "max-content" }, props.style), "aria-labelledby": context.labelId, "aria-describedby": context.descriptionId }, context.getFloatingProps(props), { children: typeof children === "function" ? children(() => context.setIsOpen(false)) : children })) })) }));
1219
+ return (jsx(FloatingPortal, { id: portalId !== null && portalId !== void 0 ? portalId : "tu-floating-ui", children: context.isOpen ? (jsx(FloatingFocusManager, { guards: false, context: floatingContext, modal: context.isModal, closeOnFocusOut: false, order: ["reference", "content"], returnFocus: false, children: jsx("div", Object.assign({ ref: ref, className: cvaPopoverContainer({ className: className !== null && className !== void 0 ? className : customProps.className }), "data-testid": (_b = dataTestId !== null && dataTestId !== void 0 ? dataTestId : customProps.dataTestId) !== null && _b !== void 0 ? _b : "popover-content", style: Object.assign({ position: context.strategy, top: context.y, left: context.x, width: "max-content" }, props.style), "aria-labelledby": context.labelId, "aria-describedby": context.descriptionId }, context.getFloatingProps(props), { children: typeof children === "function" ? children(() => context.setIsOpen(false)) : children })) })) : null }));
1203
1220
  });
1204
1221
 
1205
1222
  /**
@@ -1215,7 +1232,7 @@ const PopoverTitle = ({ children, action, divider = false, className, dataTestId
1215
1232
  const PopoverTrigger = forwardRef(function PopoverTrigger(_a, propRef) {
1216
1233
  var { children, renderButton } = _a, props = __rest(_a, ["children", "renderButton"]);
1217
1234
  const context = usePopoverContext();
1218
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1235
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, local-rules/no-typescript-assertion
1219
1236
  const childrenRef = children.ref;
1220
1237
  const ref = useMergeRefs([context.refs.setReference, propRef, childrenRef]);
1221
1238
  if (!renderButton && isValidElement(children)) {
@@ -1254,7 +1271,7 @@ const DayRangePicker = ({ onRangeSelect, selectedDays, disabledDays, dataTestId,
1254
1271
  onRangeSelect({ from, to });
1255
1272
  }
1256
1273
  }, [onRangeSelect]);
1257
- return (jsx(DayPicker$1, { mode: "range", onSelect: onSelect, selected: selectedDays, defaultMonth: selectedDays && selectedDays.from, locale: locale, disabled: disabledDays, className: `custom-day-picker range-picker ${className !== null && className !== void 0 ? className : ""}`, max: max, footer: jsx("div", { "data-testid": dataTestId }) }));
1274
+ return (jsx(DayPicker$1, { mode: "range", onSelect: onSelect, selected: selectedDays, defaultMonth: selectedDays ? selectedDays.from : undefined, locale: locale, disabled: disabledDays, className: `custom-day-picker range-picker ${className !== null && className !== void 0 ? className : ""}`, max: max, footer: jsx("div", { "data-testid": dataTestId }) }));
1258
1275
  };
1259
1276
 
1260
1277
  const cvaDrawerOverlay = cvaMerge([
@@ -1322,7 +1339,6 @@ const cvaSkeletonLine = cvaMerge([
1322
1339
 
1323
1340
  /**
1324
1341
  * Display placeholder lines before the data gets loaded to reduce load-time frustration.
1325
-
1326
1342
  */
1327
1343
  const SkeletonLines = memo(({ margin = "10px 0", lines = 1, height, width = "100%", className, dataTestId }) => {
1328
1344
  const skeletonLines = [];
@@ -1344,6 +1360,7 @@ const SkeletonLines = memo(({ margin = "10px 0", lines = 1, height, width = "100
1344
1360
  // eslint-disable-next-line react/jsx-no-useless-fragment
1345
1361
  return jsx(Fragment, { children: skeletonLines });
1346
1362
  });
1363
+ SkeletonLines.displayName = "SkeletonLines";
1347
1364
 
1348
1365
  const cvaContainerStyles = cvaMerge([
1349
1366
  "flex",
@@ -1424,8 +1441,8 @@ const ExternalLink = ({ rel = "noreferrer", target = "_blank", href, className,
1424
1441
  return (jsx("a", { onClick: onClick, "data-testid": dataTestId, className: cvaExternalLink({ className }), title: title, href: href, rel: rel, target: target, children: children }));
1425
1442
  };
1426
1443
 
1427
- const cvaTooltipFlexContainer = cvaMerge("inline-flex hover:cursor-pointer");
1428
- const cvaTooltipIcon = cvaMerge("flex h-max w-fit text-slate-300 transition hover:cursor-pointer hover:text-slate-400", {
1444
+ const cvaTooltipFlexContainer = cvaMerge(["inline-flex", "hover:cursor-pointer"]);
1445
+ const cvaTooltipIcon = cvaMerge(["flex", "h-max", "w-fit", "text-slate-300", "transition", "hover:cursor-pointer", "hover:text-slate-400"], {
1429
1446
  variants: {
1430
1447
  color: {
1431
1448
  light: "hover:text-white",
@@ -1436,7 +1453,7 @@ const cvaTooltipIcon = cvaMerge("flex h-max w-fit text-slate-300 transition hove
1436
1453
  },
1437
1454
  },
1438
1455
  });
1439
- const cvaTooltipPopover = cvaMerge("pointer-events-none origin-center");
1456
+ const cvaTooltipPopover = cvaMerge(["pointer-events-none", "origin-center"]);
1440
1457
  const cvaTooltipPopoverTail = cvaMerge("", {
1441
1458
  variants: {
1442
1459
  placement: {
@@ -1464,7 +1481,7 @@ const cvaTooltipPopoverTail = cvaMerge("", {
1464
1481
  },
1465
1482
  });
1466
1483
  cvaMerge(["component-popover-border", "z-popover", "animate-fade-in-fast"]);
1467
- const cvaTooltipPopoverContent = cvaMerge("max-w-sm rounded p-2", {
1484
+ const cvaTooltipPopoverContent = cvaMerge(["max-w-sm", "rounded", "p-2"], {
1468
1485
  variants: {
1469
1486
  color: {
1470
1487
  light: "bg-white shadow-lg",
@@ -1508,11 +1525,11 @@ const Tooltip = ({ children, dataTestId = "tool-tip", disabled, className, label
1508
1525
  whileElementsMounted: autoUpdate,
1509
1526
  });
1510
1527
  const { isMounted } = useTransitionStatus(context);
1511
- const wrappedChildren = (jsx("div", { className: cvaTooltipFlexContainer({ className }), "data-testid": dataTestId && `${dataTestId}-parent`, children: children }));
1528
+ const wrappedChildren = (jsx("div", { className: cvaTooltipFlexContainer({ className }), "data-testid": dataTestId ? `${dataTestId}-parent` : null, children: children }));
1512
1529
  if (disabled) {
1513
1530
  return wrappedChildren;
1514
1531
  }
1515
- return (jsxs(Popover, { className: cvaTooltipPopover(), placement: placement === "auto" ? "bottom" : placement, activation: { hover: true }, dataTestId: dataTestId !== null && dataTestId !== void 0 ? dataTestId : "", children: [jsx(PopoverTrigger, { className: cvaTooltipIcon({ color: mode }), ref: refs.setReference, onMouseEnter: () => setIsOpen(true), onMouseLeave: () => setIsOpen(false), "data-testid": dataTestId && `${dataTestId}-trigger`, children: children === undefined ? (jsx("div", { children: jsx(Icon, Object.assign({ name: "QuestionMarkCircle", size: "small", dataTestId: dataTestId && `${dataTestId}-icon` }, iconProps)) })) : (wrappedChildren) }), isMounted && (jsx("div", { ref: refs.setFloating, style: floatingStyles, children: jsx(PopoverContent, { children: jsxs("div", { "aria-label": typeof label === "string" ? label : undefined, className: cvaTooltipPopoverContent({ color: mode }), "data-testid": `${dataTestId}-content`, children: [jsx(Text, { inverted: mode === "dark", type: contentTextType, children: label }), placement !== "auto" && jsx(FloatingArrowContainer, { arrowRef: arrowRef, mode: mode })] }) }) }))] }));
1532
+ return (jsxs(Popover, { className: cvaTooltipPopover(), placement: placement === "auto" ? "bottom" : placement, activation: { hover: true }, dataTestId: dataTestId, children: [jsx(PopoverTrigger, { className: cvaTooltipIcon({ color: mode }), ref: refs.setReference, onMouseEnter: () => setIsOpen(true), onMouseLeave: () => setIsOpen(false), "data-testid": dataTestId ? `${dataTestId}-trigger` : null, children: children === undefined ? (jsx("div", { children: jsx(Icon, Object.assign({ name: "QuestionMarkCircle", size: "small", dataTestId: dataTestId ? `${dataTestId}-icon` : undefined }, iconProps)) })) : (wrappedChildren) }), isMounted ? (jsx("div", { ref: refs.setFloating, style: floatingStyles, children: jsx(PopoverContent, { children: jsxs("div", { "aria-label": typeof label === "string" ? label : undefined, className: cvaTooltipPopoverContent({ color: mode }), "data-testid": `${dataTestId}-content`, children: [jsx(Text, { inverted: mode === "dark", type: contentTextType, children: label }), placement !== "auto" && jsx(FloatingArrowContainer, { arrowRef: arrowRef, mode: mode })] }) }) })) : null] }));
1516
1533
  };
1517
1534
 
1518
1535
  const cvaIndicator = cvaMerge(["flex", "items-center"]);
@@ -1615,7 +1632,7 @@ const cvaIndicatorIconBackground = cvaMerge(["rounded-full", "items-center", "ju
1615
1632
  */
1616
1633
  const Indicator = (_a) => {
1617
1634
  var { dataTestId, icon, label, color = "unknown", withBackground = true, withLabel = true, ping = false, className } = _a, rest = __rest(_a, ["dataTestId", "icon", "label", "color", "withBackground", "withLabel", "ping", "className"]);
1618
- return (jsx(Tooltip, { className: className, disabled: withLabel, label: label, placement: "bottom", children: jsxs("div", Object.assign({ className: cvaIndicator(), "data-testid": dataTestId, "aria-label": label }, rest, { children: [jsxs("div", { className: cvaIndicatorIconBackground({ color, background: withBackground ? "visible" : "hidden" }), "data-testid": dataTestId ? `${dataTestId}-background` : "indicator-background", children: [ping && (jsx("div", { className: cvaIndicatorPing({ color }), "data-testid": dataTestId ? `${dataTestId}-ping` : "indicator-ping" })), icon] }), label !== undefined && withLabel && (jsx("div", { className: cvaIndicatorLabel(), "data-testid": dataTestId ? `${dataTestId}-label` : "indicator-label", children: label }))] })) }));
1635
+ return (jsx(Tooltip, { className: className, disabled: withLabel, label: label, placement: "bottom", children: jsxs("div", Object.assign({ className: cvaIndicator(), "data-testid": dataTestId, "aria-label": label }, rest, { children: [jsxs("div", { className: cvaIndicatorIconBackground({ color, background: withBackground ? "visible" : "hidden" }), "data-testid": dataTestId ? `${dataTestId}-background` : "indicator-background", children: [ping ? jsx("div", { className: cvaIndicatorPing({ color }), "data-testid": dataTestId ? `${dataTestId}-ping` : "indicator-ping" }) : null, icon] }), label !== undefined && withLabel ? jsx("div", { className: cvaIndicatorLabel(), "data-testid": dataTestId ? `${dataTestId}-label` : "indicator-label", children: label }) : null] })) }));
1619
1636
  };
1620
1637
 
1621
1638
  const cvaMenuItem = cvaMerge([
@@ -1702,7 +1719,7 @@ const MenuItem = ({ className, dataTestId, label, size, children, selected, focu
1702
1719
  }), onClick: e => {
1703
1720
  stopPropagation && e.stopPropagation();
1704
1721
  onClick && onClick(e);
1705
- }, tabIndex: 0, children: [prefix && (jsx("div", { className: cvaMenuItemPrefix({ selected }), "data-testid": dataTestId && `${dataTestId}-prefix`, children: prefix })), children && typeof children !== "string" ? (children) : (jsx("div", { className: cvaMenuItemLabel(), "data-testid": dataTestId && `${dataTestId}-label`, children: children !== null && children !== void 0 ? children : label })), suffix && (jsx("div", { className: cvaMenuItemSuffix({ selected }), "data-testid": dataTestId && `${dataTestId}-suffix`, children: suffix }))] })));
1722
+ }, tabIndex: 0, children: [prefix ? jsx("div", { className: cvaMenuItemPrefix({ selected }), "data-testid": dataTestId ? `${dataTestId}-prefix` : null, children: prefix }) : null, children && typeof children !== "string" ? (children) : (jsx("div", { className: cvaMenuItemLabel(), "data-testid": dataTestId ? `${dataTestId}-label` : null, children: children !== null && children !== void 0 ? children : label })), suffix ? jsx("div", { className: cvaMenuItemSuffix({ selected }), "data-testid": dataTestId ? `${dataTestId}-suffix` : null, children: suffix }) : null] })));
1706
1723
  };
1707
1724
 
1708
1725
  const cvaMenuList = cvaMerge(["shadow-md", "rounded-lg", "z-20", "bg-white", "p-1", "border", "border-slate-300", "gap-1", "grid"], {
@@ -1730,7 +1747,7 @@ const MenuList = (_a) => {
1730
1747
  var { dataTestId, className, children, withStickyHeader = false, showDivider = false } = _a, args = __rest(_a, ["dataTestId", "className", "children", "withStickyHeader", "showDivider"]);
1731
1748
  const childrenArr = Children.toArray(children);
1732
1749
  const isLastItem = (index) => index === childrenArr.length - 1;
1733
- return (jsx("div", { "data-testid": dataTestId, className: cvaMenuList({ stickyHeader: withStickyHeader, className }), tabIndex: 0, role: "list", onClick: args.onClick, children: Children.map(childrenArr, (menuItem, index) => (jsxs(Fragment, { children: [menuItem, showDivider && !isLastItem(index) && jsx("hr", { className: cvaMenuListDivider() })] }))) }));
1750
+ return (jsx("div", { "data-testid": dataTestId, className: cvaMenuList({ stickyHeader: withStickyHeader, className }), tabIndex: 0, role: "list", onClick: args.onClick, children: Children.map(childrenArr, (menuItem, index) => (jsxs(Fragment, { children: [menuItem, showDivider && !isLastItem(index) ? jsx("hr", { className: cvaMenuListDivider() }) : null] }))) }));
1734
1751
  };
1735
1752
 
1736
1753
  const cvaMoreMenu = cvaMerge(["p-4"]);
@@ -1794,12 +1811,9 @@ const cvaModalBackdrop = cvaMerge([
1794
1811
  const ModalBackdrop = ({ children, isVisible, onClick }) => {
1795
1812
  const ref = React.useRef(null);
1796
1813
  return (jsx("div", { ref: ref, className: cvaModalBackdrop({ show: isVisible }), onMouseDown: e => {
1797
- var _a, _b;
1798
1814
  // only react on click on backdrop - accessing first child to get around styled element element
1799
- if (ref.current !== null) {
1800
- if ((e === null || e === void 0 ? void 0 : e.target) === ((_b = (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b[0])) {
1801
- onClick();
1802
- }
1815
+ if (ref.current !== null && e.target === ref.current.children[0]) {
1816
+ onClick();
1803
1817
  }
1804
1818
  }, children: children }));
1805
1819
  };
@@ -1813,8 +1827,9 @@ const ModalBackdrop = ({ children, isVisible, onClick }) => {
1813
1827
  const Modal = React.forwardRef(({ isOpen, children, dataTestId, className, role = "", onDismissClick = () => {
1814
1828
  return;
1815
1829
  }, }, ref) => {
1816
- return (jsx(ModalBackdrop, { isVisible: isOpen, onClick: onDismissClick, children: isOpen && (jsx("div", { className: cvaModalContainer(), ref: ref, role: role, children: jsx(Card, { dataTestId: dataTestId, className: cvaModalCard({ className }), children: children }) })) }));
1830
+ return (jsx(ModalBackdrop, { isVisible: isOpen, onClick: onDismissClick, children: isOpen ? (jsx("div", { className: cvaModalContainer(), ref: ref, role: role, children: jsx(Card, { dataTestId: dataTestId, className: cvaModalCard({ className }), children: children }) })) : null }));
1817
1831
  });
1832
+ Modal.displayName = "Modal";
1818
1833
 
1819
1834
  /**
1820
1835
  * The useModal component should be used to inform the user of important information.
@@ -1827,10 +1842,12 @@ const useModal = ({ closeOnOutsideClick } = {}) => {
1827
1842
  const { isOpen, togglePortal, openPortal, closePortal, Portal } = usePortal({
1828
1843
  closeOnOutsideClick,
1829
1844
  onPortalClick: ({ target }) => {
1845
+ var _a;
1830
1846
  if (!closeOnOutsideClick) {
1831
1847
  return;
1832
1848
  }
1833
- const clickingOutsideModal = modalRef && modalRef.current && !modalRef.current.contains(target);
1849
+ // eslint-disable-next-line local-rules/no-typescript-assertion
1850
+ const clickingOutsideModal = !((_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.contains(target));
1834
1851
  if (clickingOutsideModal) {
1835
1852
  closePortal();
1836
1853
  }
@@ -1848,7 +1865,7 @@ const useModal = ({ closeOnOutsideClick } = {}) => {
1848
1865
  };
1849
1866
  };
1850
1867
 
1851
- const cvaPageHeaderContainer = cvaMerge(["bg-white"], {
1868
+ const cvaPageHeaderContainer = cvaMerge(["bg-white", "tu-page-header"], {
1852
1869
  variants: {
1853
1870
  withBorder: {
1854
1871
  true: ["border-b", "border-b-secondary-200"],
@@ -1857,10 +1874,9 @@ const cvaPageHeaderContainer = cvaMerge(["bg-white"], {
1857
1874
  },
1858
1875
  });
1859
1876
  const cvaPageHeader = cvaMerge([
1860
- "min-h-[72px]",
1861
1877
  "box-border",
1862
- "px-6",
1863
- "py-5",
1878
+ "py-responsive-space",
1879
+ "px-responsive-space-lg",
1864
1880
  "flex",
1865
1881
  "flex-wrap",
1866
1882
  "items-center",
@@ -1869,7 +1885,7 @@ const cvaPageHeader = cvaMerge([
1869
1885
  "justify-between",
1870
1886
  ]);
1871
1887
  const cvaPageHeaderHeading = cvaMerge(["flex", "text-slate-900", "text-2xl", "font-bold", "min-w-0"]);
1872
- const cvaPageHeaderHeadingContainer = cvaMerge(["flex", "gap-x-4", "items-center"]);
1888
+ const cvaPageHeaderHeadingContainer = cvaMerge(["flex", "gap-x-4", "flex-wrap", "items-center"]);
1873
1889
  const cvaPageHeaderHeadingAccessoriesContainer = cvaMerge([
1874
1890
  "flex",
1875
1891
  "flex-wrap",
@@ -1878,6 +1894,16 @@ const cvaPageHeaderHeadingAccessoriesContainer = cvaMerge([
1878
1894
  "gap-y-2",
1879
1895
  ]);
1880
1896
  const cvaPageHeaderChildContainer = cvaMerge(["flex", "flex-wrap", "gap-x-6", "items-center"]);
1897
+ const cvaPageHeaderDescriptionAndLinkContainer = cvaMerge(["flex", "h-fit", "items-center", "gap-1"]);
1898
+ const cvaPageHeaderLink = cvaMerge([
1899
+ "text-primary-600",
1900
+ "hover:text-primary-700",
1901
+ "flex",
1902
+ "items-center",
1903
+ "gap-1",
1904
+ "text-xs",
1905
+ "underline",
1906
+ ]);
1881
1907
 
1882
1908
  /**
1883
1909
  * Pageheader component is used to display a page header.
@@ -1889,9 +1915,9 @@ const cvaPageHeaderChildContainer = cvaMerge(["flex", "flex-wrap", "gap-x-6", "i
1889
1915
  */
1890
1916
  const PageHeader = ({ className, dataTestId, action, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, linkText = "Help Center Article", }) => {
1891
1917
  return (jsxs("div", { className: cvaPageHeaderContainer({
1892
- className: `${className} tu-page-header`,
1893
- withBorder: !Boolean(tabsList),
1894
- }), "data-testid": dataTestId, children: [jsxs("div", { className: cvaPageHeader(), children: [jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer(), "data-testid": dataTestId && `${dataTestId}-heading-container`, children: [jsxs("div", { className: cvaPageHeaderHeadingContainer(), children: [backTo && (jsx(IconButton, { to: backTo, renderAs: Link, color: "tertiary", variant: "transparent", size: "small", icon: jsx(Icon, { name: "ArrowLeft" }) })), jsx("h1", { className: cvaPageHeaderHeading(), "data-testid": dataTestId && `${dataTestId}-heading`, children: title }), description && !showLoading && (jsxs("div", { className: "flex h-fit items-center gap-1", children: [jsx(Tooltip, { label: description, dataTestId: dataTestId && `${dataTestId}-tooltip`, iconProps: { name: "QuestionMarkCircle" }, placement: "bottom" }), link && (jsxs(Link, { to: link, "data-testid": "tooltip-link", target: "_blank", className: "text-primary-600 hover:text-primary-700 flex h-4 items-center gap-1 text-xs underline", children: [linkText, jsx(Icon, { name: "ArrowTopRightOnSquare", size: "small" })] }))] }))] }), tag && !showLoading && (jsx(Tag, { dataTestId: dataTestId, color: tagColor, children: tag })), showLoading && jsx(Spinner, { dataTestId: dataTestId && `${dataTestId}-spinner`, centering: "vertically" }), action] }), jsx("div", { className: cvaPageHeaderChildContainer(), children: children })] }), tabsList] }));
1918
+ className,
1919
+ withBorder: !tabsList,
1920
+ }), "data-testid": dataTestId, children: [jsxs("div", { className: cvaPageHeader(), children: [jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer(), "data-testid": dataTestId ? `${dataTestId}-heading-container` : undefined, children: [jsxs("div", { className: cvaPageHeaderHeadingContainer(), children: [backTo ? (jsx(IconButton, { to: backTo, renderAs: Link, color: "tertiary", variant: "transparent", size: "small", icon: jsx(Icon, { name: "ArrowLeft" }) })) : undefined, jsx("h1", { className: cvaPageHeaderHeading(), "data-testid": dataTestId ? `${dataTestId}-heading` : undefined, children: title }), description && !showLoading ? (jsxs("div", { className: cvaPageHeaderDescriptionAndLinkContainer(), children: [jsx(Tooltip, { label: description, dataTestId: dataTestId ? `${dataTestId}-tooltip` : undefined, iconProps: { name: "QuestionMarkCircle" }, placement: "bottom" }), link ? (jsxs(Link, { to: link, "data-testid": "tooltip-link", target: "_blank", className: cvaPageHeaderLink(), children: [linkText, jsx(Icon, { name: "ArrowTopRightOnSquare", size: "small" })] })) : undefined] })) : undefined] }), tag && !showLoading ? (jsx(Tag, { dataTestId: dataTestId ? `${dataTestId}-tag` : undefined, color: tagColor, children: tag })) : undefined, showLoading ? (jsx(Spinner, { dataTestId: dataTestId ? `${dataTestId}-spinner` : undefined, centering: "vertically" })) : null, action] }), children ? jsx("div", { className: cvaPageHeaderChildContainer(), children: children }) : null] }), tabsList] }));
1895
1921
  };
1896
1922
 
1897
1923
  const cvaPagination = cvaMerge(["flex", "items-center", "gap-1"]);
@@ -1940,7 +1966,7 @@ const Pagination = ({ previousPage, nextPage, canPreviousPage, canNextPage, page
1940
1966
  if (loading) {
1941
1967
  return (jsx("div", { className: cvaPagination({ className }), children: jsx(SkeletonLines, { height: 16, width: 150 }) }));
1942
1968
  }
1943
- return (jsxs("div", { "data-testid": dataTestId, className: cvaPagination({ className }), children: [jsx(IconButton, { onClick: () => handlePageChange("prev"), disabled: cursorBase ? !canPreviousPage || false : page !== undefined && page <= 0, "data-testid": "prev-page", icon: jsx(Icon, { name: "ChevronLeft", size: "small" }), size: "small", color: "secondary", variant: "transparent" }), !cursorBase && (jsxs(Fragment, { children: [jsx("div", { className: cvaPaginationText(), "data-testid": "current-page", children: currentPage }), jsx("div", { className: cvaPaginationText(), "data-testid": "page-count", children: pageCount !== null && pageCount !== undefined && getTranslatedCount && getTranslatedCount(pageCount) })] })), jsx(IconButton, { onClick: () => handlePageChange("next"), disabled: cursorBase
1969
+ return (jsxs("div", { "data-testid": dataTestId, className: cvaPagination({ className }), children: [jsx(IconButton, { onClick: () => handlePageChange("prev"), disabled: cursorBase ? !canPreviousPage || false : page !== undefined && page <= 0, "data-testid": "prev-page", icon: jsx(Icon, { name: "ChevronLeft", size: "small" }), size: "small", color: "secondary", variant: "transparent" }), !cursorBase && (jsxs(Fragment, { children: [jsx("div", { className: cvaPaginationText(), "data-testid": "current-page", children: currentPage }), jsx("div", { className: cvaPaginationText(), "data-testid": "page-count", children: pageCount !== null && pageCount !== undefined && getTranslatedCount ? getTranslatedCount(pageCount) : null })] })), jsx(IconButton, { onClick: () => handlePageChange("next"), disabled: cursorBase
1944
1970
  ? !canNextPage || false
1945
1971
  : page !== undefined && pageCount !== undefined && pageCount !== null && page >= pageCount - 1, "data-testid": "next-page", icon: jsx(Icon, { name: "ChevronRight", size: "small" }), size: "small", color: "secondary", variant: "transparent" })] }));
1946
1972
  };
@@ -1986,8 +2012,7 @@ const usePrompt = (message, when = true) => {
1986
2012
  };
1987
2013
  }, [message, when]);
1988
2014
  const confirmExit = useCallback(() => {
1989
- const confirm = window.confirm(message);
1990
- return confirm;
2015
+ return window.confirm(message);
1991
2016
  }, [message]);
1992
2017
  useConfirmExit(confirmExit, when);
1993
2018
  };
@@ -2037,11 +2062,11 @@ const Spacer = ({ size = "medium", border = false, dataTestId, className }) => {
2037
2062
  * @returns {JSX.Element} SectionHeader component
2038
2063
  */
2039
2064
  const SectionHeader = ({ title, subtitle, dataTestId, addons }) => {
2040
- return (jsxs("div", { className: "flex flex-col", children: [jsx(HelmetProvider, { children: jsx(Helmet, { title: title }) }), jsxs("div", { className: "mb-2 flex flex-row gap-2", children: [jsxs("div", { className: "flex grow flex-col gap-2", children: [jsx(Heading, { variant: "secondary", dataTestId: dataTestId, children: title }), subtitle && (jsx(Heading, { variant: "subtitle", subtle: true, children: subtitle }))] }), addons && jsx("div", { className: "flex gap-2", children: addons })] }), jsx(Spacer, { size: "small" })] }));
2065
+ return (jsxs("div", { className: "flex flex-col", children: [jsx(HelmetProvider, { children: jsx(Helmet, { title: title }) }), jsxs("div", { className: "mb-2 flex flex-row gap-2", children: [jsxs("div", { className: "flex grow flex-col gap-2", children: [jsx(Heading, { variant: "secondary", dataTestId: dataTestId, children: title }), subtitle ? jsx(Heading, { variant: "subtitle", subtle: true, children: subtitle }) : null] }), addons ? jsx("div", { className: "flex gap-2", children: addons }) : null] }), jsx(Spacer, { size: "small" })] }));
2041
2066
  };
2042
2067
 
2043
- const cvaSidebar = cvaMerge(["apply grid", "grid-cols-fr-min", "items-center"]);
2044
- const cvaSidebarChildContainer = cvaMerge(["apply flex", "overflow-hidden", "gap-2", "p-1", "max-w-full"], {
2068
+ const cvaSidebar = cvaMerge(["apply", "grid", "grid-cols-fr-min", "items-center"]);
2069
+ const cvaSidebarChildContainer = cvaMerge(["apply", "flex", "overflow-hidden", "gap-2", "p-1", "max-w-full"], {
2045
2070
  variants: {
2046
2071
  breakpoint: {
2047
2072
  xs: ["xs:overflow-visible", "xs:p-0", "xs:grid", "xs:grid-cols-1", "xs:w-full"],
@@ -2079,7 +2104,7 @@ const useOverflowItems = ({ threshold = 1, childUniqueIdentifierAttribute = "id"
2079
2104
  }, [childUniqueIdentifierAttribute]);
2080
2105
  const observe = useCallback(() => {
2081
2106
  const node = overflowContainerRef.current;
2082
- if (node && node.children) {
2107
+ if (node) {
2083
2108
  const root = overflowContainerRef.current;
2084
2109
  const options = { root, threshold };
2085
2110
  const observer = new IntersectionObserver(handleIntersection, options);
@@ -2132,7 +2157,7 @@ const Sidebar = ({ childContainerClassName, children, breakpoint = "lg", classNa
2132
2157
  }
2133
2158
  return "visible";
2134
2159
  };
2135
- return (jsxs("div", { className: cvaSidebar({ className }), "data-testid": dataTestId, children: [jsx("div", { ref: overflowContainerRef, className: cvaSidebarChildContainer({ breakpoint, className: childContainerClassName }), "data-testid": dataTestId && `${dataTestId}-child-container`, children: React__default.Children.map(children, child => {
2160
+ return (jsxs("div", { className: cvaSidebar({ className }), "data-testid": dataTestId, children: [jsx("div", { ref: overflowContainerRef, className: cvaSidebarChildContainer({ breakpoint, className: childContainerClassName }), "data-testid": dataTestId ? `${dataTestId}-child-container` : null, children: React__default.Children.map(children, child => {
2136
2161
  return React__default.cloneElement(child, {
2137
2162
  className: `${child.props.className} ${itemVisibilityClassName(child.props.id)}`,
2138
2163
  });
@@ -2140,12 +2165,12 @@ const Sidebar = ({ childContainerClassName, children, breakpoint = "lg", classNa
2140
2165
  circular: false,
2141
2166
  variant: "transparent",
2142
2167
  color: "secondary",
2143
- }, popoverProps: { placement: "bottom-end" } }, moreMenuProps, { className: `${(moreMenuProps === null || moreMenuProps === void 0 ? void 0 : moreMenuProps.className) || ""} !p-0`, dataTestId: dataTestId && `${dataTestId}-more-menu`, children: close => (jsx(MenuList, Object.assign({}, menuListProps, { dataTestId: dataTestId && `${dataTestId}-menu-list`, children: React__default.Children.map(children, child => {
2168
+ }, popoverProps: { placement: "bottom-end" } }, moreMenuProps, { className: `${(moreMenuProps === null || moreMenuProps === void 0 ? void 0 : moreMenuProps.className) || ""} !p-0`, dataTestId: dataTestId ? `${dataTestId}-more-menu` : undefined, children: close => (jsx(MenuList, Object.assign({}, menuListProps, { dataTestId: dataTestId ? `${dataTestId}-menu-list` : undefined, children: React__default.Children.map(children, child => {
2144
2169
  return itemOverflowMap[child.props.id]
2145
2170
  ? React__default.cloneElement(child, {
2146
2171
  onClick: () => {
2147
2172
  var _a, _b;
2148
- (_b = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
2173
+ (_b = (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
2149
2174
  close();
2150
2175
  },
2151
2176
  })
@@ -2207,7 +2232,7 @@ const cvaTab = cvaMerge([
2207
2232
  */
2208
2233
  const Tab = (_a) => {
2209
2234
  var { value, isFullWidth = false, iconName, dataTestId, className, children, suffix, asChild, appendTabStylesToChildIfAsChild = true } = _a, rest = __rest(_a, ["value", "isFullWidth", "iconName", "dataTestId", "className", "children", "suffix", "asChild", "appendTabStylesToChildIfAsChild"]);
2210
- const renderContent = () => (jsxs(Fragment, { children: [iconName && jsx(Icon, { name: iconName, size: "small" }), React__default.isValidElement(children) ? children.props.children : children, suffix] }));
2235
+ const renderContent = () => (jsxs(Fragment, { children: [iconName ? jsx(Icon, { name: iconName, size: "small" }) : null, React__default.isValidElement(children) ? children.props.children : children, suffix] }));
2211
2236
  const commonProps = Object.assign({ className: appendTabStylesToChildIfAsChild ? cvaTab({ className, isFullWidth }) : className }, rest);
2212
2237
  return (jsx(Trigger, { asChild: true, value: value, children: asChild && typeof children !== "string" ? (React__default.cloneElement(children, Object.assign(Object.assign({}, commonProps), { children: renderContent() }))) : (jsx("button", Object.assign({}, commonProps, { "data-testid": dataTestId, children: renderContent() }))) }));
2213
2238
  };
@@ -2217,7 +2242,7 @@ const Tab = (_a) => {
2217
2242
  */
2218
2243
  const TabContent = (_a) => {
2219
2244
  var { className, dataTestId, children } = _a, rest = __rest(_a, ["className", "dataTestId", "children"]);
2220
- return (jsx(Content, Object.assign({ "data-testid": `${dataTestId}-content`, className: cvaTabContent({ className }) }, rest, { children: children })));
2245
+ return (jsx(Content, Object.assign({ "data-testid": dataTestId ? `${dataTestId}-content` : undefined, className: cvaTabContent({ className }) }, rest, { children: children })));
2221
2246
  };
2222
2247
 
2223
2248
  /**
@@ -2269,7 +2294,7 @@ const Timeline = ({ className, dataTestId, children }) => {
2269
2294
  * @returns {JSX.Element} component
2270
2295
  */
2271
2296
  const TimelineElement = ({ date, showTime, children, className, dataTestId = "timeline-date", dot = jsx(Indicator, { className: "mt-[-1px]", color: "neutral", icon: jsx(Icon, { name: "Calendar", size: "large" }) }), header = defaultHeader(date, showTime), onClick, }) => {
2272
- return (jsxs("li", { className: cvaTimelineElement({ className }), "data-date": `${date}`, "data-testid": dataTestId && `${dataTestId}`, onClick: () => onClick && onClick(), children: [jsx("div", { className: cvaTimelineDot(), children: dot }), jsx("div", { children: header }), jsx("div", {}), jsx("div", { children: jsx("div", { children: children }) })] }));
2297
+ return (jsxs("li", { className: cvaTimelineElement({ className }), "data-date": `${date}`, "data-testid": dataTestId ? `${dataTestId}` : null, onClick: () => onClick && onClick(), children: [jsx("div", { className: cvaTimelineDot(), children: dot }), jsx("div", { children: header }), jsx("div", {}), jsx("div", { children: jsx("div", { children: children }) })] }));
2273
2298
  };
2274
2299
  function defaultHeader(date, showTime) {
2275
2300
  return `${format(date, showTime ? "MMM d, yyyy H:mm" : "MMM d, yyyy")} (${formatDistance(date, new Date(), {
@@ -2384,7 +2409,7 @@ const ValueBar = ({ value, min = 0, max = 100, unit, size = "small", levelColors
2384
2409
  const score = getScore(value, min, max);
2385
2410
  const barFillColor = levelColors ? getFillColor(score, levelColors) : getDefaultFillColor(score);
2386
2411
  const barWidth = showValue && size === "small" ? 90 : 100;
2387
- return (jsx("svg", { className: cvaValueBar({ size, className }), "data-testid": dataTestId, children: jsxs("g", { children: [jsx("rect", { className: cvaValueBarProgress({ fill: "background" }), width: `${barWidth}%`, rx: "5" }), jsx("rect", { className: cvaValueBarProgress(), width: `${score * barWidth}%`, fill: barFillColor, rx: "5" }), showValue && size === "large" && (jsxs("text", { className: cvaValueBarText({ size }), x: "12", y: "23", fill: valueColor !== null && valueColor !== void 0 ? valueColor : "white", children: [Number(value.toFixed(1)), unit || ""] })), showValue && size === "small" && (jsxs("text", { className: cvaValueBarText({ size }), x: `${barWidth + 2}%`, y: "11", fill: valueColor !== null && valueColor !== void 0 ? valueColor : color("NEUTRAL", 400, "CSS"), children: [Number(value.toFixed(1)), unit || ""] }))] }) }));
2412
+ return (jsx("svg", { className: cvaValueBar({ size, className }), "data-testid": dataTestId, role: "img", children: jsxs("g", { children: [jsx("rect", { className: cvaValueBarProgress({ fill: "background" }), width: `${barWidth}%`, rx: "5", "data-testid": "value-bar-svg-rect-0" }), jsx("rect", { className: cvaValueBarProgress(), width: `${score * barWidth}%`, fill: barFillColor, rx: "5", "data-testid": "value-bar-svg-rect-1" }), showValue && size === "large" ? (jsxs("text", { className: cvaValueBarText({ size }), x: "12", y: "23", fill: valueColor !== null && valueColor !== void 0 ? valueColor : "white", children: [Number(value.toFixed(1)), unit || ""] })) : null, showValue && size === "small" ? (jsxs("text", { className: cvaValueBarText({ size }), x: `${barWidth + 2}%`, y: "11", fill: valueColor !== null && valueColor !== void 0 ? valueColor : color("NEUTRAL", 400, "CSS"), children: [Number(value.toFixed(1)), unit || ""] })) : null] }) }));
2388
2413
  };
2389
2414
 
2390
2415
  const cvaWidgetBodyDensityContainer = cvaMerge([
@@ -2606,6 +2631,7 @@ const useClickOutside = (el, options = {}, onClick) => {
2606
2631
  active = options.active !== undefined ? options.active : active;
2607
2632
  }
2608
2633
  const handler = (ev) => {
2634
+ // eslint-disable-next-line local-rules/no-typescript-assertion
2609
2635
  const target = ev.target;
2610
2636
  if (els.every(ref => !ref.current || !ref.current.contains(target))) {
2611
2637
  onClick && onClick(ev);
@@ -2757,20 +2783,9 @@ function useDevicePixelRatio(options) {
2757
2783
  }
2758
2784
  const updateDpr = () => setCurrentDpr(getDevicePixelRatio({ defaultDpr, maxDpr, round }));
2759
2785
  const mediaMatcher = window.matchMedia(`screen and (resolution: ${currentDpr}dppx)`);
2760
- // Safari 13.1 does not have `addEventListener`, but does have `addListener`
2761
- if (mediaMatcher.addEventListener) {
2762
- mediaMatcher.addEventListener("change", updateDpr);
2763
- }
2764
- else {
2765
- mediaMatcher.addListener(updateDpr);
2766
- }
2786
+ mediaMatcher.addEventListener("change", updateDpr);
2767
2787
  return () => {
2768
- if (mediaMatcher.removeEventListener) {
2769
- mediaMatcher.removeEventListener("change", updateDpr);
2770
- }
2771
- else {
2772
- mediaMatcher.removeListener(updateDpr);
2773
- }
2788
+ mediaMatcher.removeEventListener("change", updateDpr);
2774
2789
  };
2775
2790
  }, [currentDpr, defaultDpr, maxDpr, round]);
2776
2791
  return currentDpr;
@@ -2785,8 +2800,7 @@ function getDevicePixelRatio(options) {
2785
2800
  const { defaultDpr = 1, maxDpr = 3, round = true } = options || {};
2786
2801
  const hasDprProp = typeof window !== "undefined" && typeof window.devicePixelRatio === "number";
2787
2802
  const dpr = hasDprProp ? window.devicePixelRatio : defaultDpr;
2788
- const rounded = Math.min(Math.max(1, round ? Math.floor(dpr) : dpr), maxDpr);
2789
- return rounded;
2803
+ return Math.min(Math.max(1, round ? Math.floor(dpr) : dpr), maxDpr);
2790
2804
  }
2791
2805
 
2792
2806
  /**
@@ -2982,4 +2996,4 @@ const useVisibilityChange = ({ onChange, targetState = "hidden" }) => {
2982
2996
  }, [onChange, targetState]);
2983
2997
  };
2984
2998
 
2985
- export { Alert, Badge, Button, Card, CardBody, CardFooter, CardHeader, Collapse, CopyableText, DayPicker, DayPickerPopover, DayRangePicker, Drawer, EmptyState, ExternalLink, Heading, Icon, IconButton, Indicator, MenuItem, MenuList, Modal, ModalBackdrop, MoreMenu, PackageNameStoryComponent, PageHeader, Pagination, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tab, TabContent, TabList, Tabs, Tag, Text, Timeline, TimelineElement, Tooltip, ValueBar, WidgetBody, cvaButton, cvaButtonSpinner, cvaClickable, cvaIconButtonContainer, cvaIndicator, cvaIndicatorIcon, cvaIndicatorIconBackground, cvaIndicatorLabel, cvaIndicatorPing, cvaMenuItem, cvaMenuItemLabel, cvaMenuItemPrefix, cvaMenuItemSuffix, docs, getDevicePixelRatio, getValueBarColorByValue, iconColorNames, iconPalette, setLocalStorage, useClickOutside, useContainerProps, useContinuousTimeout, useDebounce, useDevicePixelRatio, useGeometry, useHover, useIsFirstRender, useIsFullscreen, useIsTextCutOff, useLocalStorage, useLocalStorageReducer, useModal, useOptionallyElevatedState, useOverflowItems, usePopoverContext, usePrompt, useResize, useSelfUpdatingRef, useTimeout, useVisibilityChange };
2999
+ export { Alert, Badge, Button, Card, CardBody, CardFooter, CardHeader, Collapse, CopyableText, DayPicker, DayPickerPopover, DayRangePicker, Drawer, EmptyState, ExternalLink, Heading, Icon, IconButton, Indicator, MenuItem, MenuList, Modal, ModalBackdrop, MoreMenu, PackageNameStoryComponent, PageHeader, Pagination, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tab, TabContent, TabList, Tabs, Tag, Text, Timeline, TimelineElement, Tooltip, ValueBar, WidgetBody, cvaButton, cvaClickable, cvaIndicator, cvaIndicatorIcon, cvaIndicatorIconBackground, cvaIndicatorLabel, cvaIndicatorPing, cvaMenuItem, cvaMenuItemLabel, cvaMenuItemPrefix, cvaMenuItemSuffix, docs, getDevicePixelRatio, getValueBarColorByValue, iconColorNames, iconPalette, setLocalStorage, useClickOutside, useContainerProps, useContinuousTimeout, useDebounce, useDevicePixelRatio, useGeometry, useHover, useIsFirstRender, useIsFullscreen, useIsTextCutOff, useLocalStorage, useLocalStorageReducer, useModal, useOptionallyElevatedState, useOverflowItems, usePopoverContext, usePrompt, useResize, useSelfUpdatingRef, useTimeout, useVisibilityChange };