@aortl/admin-react 0.19.0 → 0.20.0

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/dist/index.mjs CHANGED
@@ -1522,9 +1522,13 @@ function StatCard({ variant = "default", label, value, detail, trend, icon, comp
1522
1522
  }
1523
1523
  //#endregion
1524
1524
  //#region src/Timeline.tsx
1525
- function TimelineRoot({ numbered, className, ...rest }) {
1525
+ function TimelineRoot({ numbered, horizontal, className, ...rest }) {
1526
1526
  return /* @__PURE__ */ jsx("ol", {
1527
- className: cn(["timeline", numbered && "timeline-numbered"], className),
1527
+ className: cn([
1528
+ "timeline",
1529
+ numbered && "timeline-numbered",
1530
+ horizontal && "timeline-horizontal"
1531
+ ], className),
1528
1532
  ...rest
1529
1533
  });
1530
1534
  }
@@ -2581,8 +2585,9 @@ function PropertyListLabel({ className, ...rest }) {
2581
2585
  ...rest
2582
2586
  });
2583
2587
  }
2584
- function PropertyListValue({ numeric, copyable, empty, copyValue, className, classNames, children, ...rest }) {
2588
+ function PropertyListValue({ numeric, copyable, empty, copyValue, className, classNames, children, onClick, ...rest }) {
2585
2589
  const ddRef = useRef(null);
2590
+ const copyButtonRef = useRef(null);
2586
2591
  const [copied, setCopied] = useState(false);
2587
2592
  async function handleCopy() {
2588
2593
  const text = copyValue ?? ddRef.current?.textContent?.trim() ?? "";
@@ -2593,6 +2598,14 @@ function PropertyListValue({ numeric, copyable, empty, copyValue, className, cla
2593
2598
  setTimeout(() => setCopied(false), 1200);
2594
2599
  } catch {}
2595
2600
  }
2601
+ function handleCellClick(event) {
2602
+ onClick?.(event);
2603
+ if (event.defaultPrevented) return;
2604
+ if (window.getSelection()?.toString()) return;
2605
+ const interactive = event.target.closest("a, button, input, select, textarea");
2606
+ if (interactive && interactive !== copyButtonRef.current) return;
2607
+ handleCopy();
2608
+ }
2596
2609
  return /* @__PURE__ */ jsxs("dd", {
2597
2610
  ref: ddRef,
2598
2611
  className: cn([
@@ -2601,12 +2614,13 @@ function PropertyListValue({ numeric, copyable, empty, copyValue, className, cla
2601
2614
  copyable && "property-list-value-copyable",
2602
2615
  empty && "property-list-value-empty"
2603
2616
  ], className),
2617
+ onClick: copyable ? handleCellClick : onClick,
2604
2618
  ...rest,
2605
2619
  children: [children, /* @__PURE__ */ jsxs("button", {
2620
+ ref: copyButtonRef,
2606
2621
  type: "button",
2607
2622
  "aria-label": "Copy",
2608
2623
  className: cn("property-list-copy", classNames?.copy),
2609
- onClick: handleCopy,
2610
2624
  "data-copied": copied ? "true" : void 0,
2611
2625
  children: [/* @__PURE__ */ jsx(CopyGlyph, { className: cn("property-list-copy-icon", void 0) }), /* @__PURE__ */ jsx(CheckGlyph, { className: cn("property-list-copy-icon-copied", void 0) })]
2612
2626
  })]