@proteos/ui 0.79.0 → 0.80.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.cjs CHANGED
@@ -1664,7 +1664,7 @@ function ChannelIcon({ channel, className, label }) {
1664
1664
  const Icon = channelIcon(channel);
1665
1665
  return label !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: chunk4ACELYEP_cjs.cn("size-4", className), role: "img", "aria-label": label }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: chunk4ACELYEP_cjs.cn("size-4", className), "aria-hidden": true });
1666
1666
  }
1667
- function Checkbox({ children, className, ...props }) {
1667
+ function Checkbox({ children, className, size = "md", ...props }) {
1668
1668
  return /* @__PURE__ */ jsxRuntime.jsx(
1669
1669
  reactAriaComponents.Checkbox,
1670
1670
  {
@@ -1677,8 +1677,9 @@ function Checkbox({ children, className, ...props }) {
1677
1677
  // scroll clipping, and focusing it makes the browser scroll a
1678
1678
  // container the user cannot scroll back (the roles permission
1679
1679
  // matrix, where toggling a row threw the page off-screen).
1680
- "group relative inline-flex items-center gap-2.5 cursor-pointer",
1681
- "font-sans text-[14px] text-ink-2 select-none",
1680
+ "group relative inline-flex items-center cursor-pointer",
1681
+ size === "sm" ? "gap-2 text-[13px]" : "gap-2.5 text-[14px]",
1682
+ "font-sans text-ink-2 select-none",
1682
1683
  "data-[disabled]:opacity-45 data-[disabled]:cursor-not-allowed",
1683
1684
  typeof className === "function" ? className(renderProps) : className
1684
1685
  ),
@@ -1689,7 +1690,8 @@ function Checkbox({ children, className, ...props }) {
1689
1690
  "aria-hidden": true,
1690
1691
  className: chunk4ACELYEP_cjs.cn(
1691
1692
  "relative inline-flex items-center justify-center shrink-0",
1692
- "size-[18px] rounded-[4px] border bg-surface",
1693
+ size === "sm" ? "size-4" : "size-[18px]",
1694
+ "rounded-[4px] border bg-surface",
1693
1695
  "border-ink-4",
1694
1696
  "transition-[background-color,border-color,box-shadow] duration-150",
1695
1697
  // hovered
@@ -1700,12 +1702,13 @@ function Checkbox({ children, className, ...props }) {
1700
1702
  // focus ring on the box
1701
1703
  "group-data-[focus-visible]:shadow-[var(--shadow-focus)]"
1702
1704
  ),
1703
- children: renderProps.isIndeterminate ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block h-px w-2.5 bg-surface" }) : /* @__PURE__ */ jsxRuntime.jsx(
1705
+ children: renderProps.isIndeterminate ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: chunk4ACELYEP_cjs.cn("block h-px bg-surface", size === "sm" ? "w-2" : "w-2.5") }) : /* @__PURE__ */ jsxRuntime.jsx(
1704
1706
  "svg",
1705
1707
  {
1706
1708
  viewBox: "0 0 12 12",
1707
1709
  className: chunk4ACELYEP_cjs.cn(
1708
- "size-3 text-surface transition-opacity duration-150",
1710
+ size === "sm" ? "size-2.5" : "size-3",
1711
+ "text-surface transition-opacity duration-150",
1709
1712
  renderProps.isSelected ? "opacity-100" : "opacity-0"
1710
1713
  ),
1711
1714
  "aria-hidden": true,
@@ -7554,7 +7557,7 @@ function RadioGroup({
7554
7557
  }
7555
7558
  );
7556
7559
  }
7557
- function Radio({ children, className, ...props }) {
7560
+ function Radio({ children, className, size = "md", ...props }) {
7558
7561
  return /* @__PURE__ */ jsxRuntime.jsxs(
7559
7562
  reactAriaComponents.Radio,
7560
7563
  {
@@ -7564,8 +7567,9 @@ function Radio({ children, className, ...props }) {
7564
7567
  // visually-hidden <input> is absolutely positioned and must resolve
7565
7568
  // against this radio, not a far-away shell, or focusing it scrolls
7566
7569
  // the clipped page.
7567
- "group relative inline-flex items-center gap-2.5 cursor-pointer",
7568
- "font-sans text-[14px] text-ink-2 select-none",
7570
+ "group relative inline-flex items-center cursor-pointer",
7571
+ size === "sm" ? "gap-2 text-[13px]" : "gap-2.5 text-[14px]",
7572
+ "font-sans text-ink-2 select-none",
7569
7573
  "data-[disabled]:opacity-45 data-[disabled]:cursor-not-allowed",
7570
7574
  typeof className === "function" ? className(renderProps) : className
7571
7575
  ),
@@ -7576,7 +7580,8 @@ function Radio({ children, className, ...props }) {
7576
7580
  "aria-hidden": true,
7577
7581
  className: chunk4ACELYEP_cjs.cn(
7578
7582
  "relative inline-flex items-center justify-center shrink-0",
7579
- "size-[18px] rounded-full border bg-surface border-ink-4",
7583
+ size === "sm" ? "size-4" : "size-[18px]",
7584
+ "rounded-full border bg-surface border-ink-4",
7580
7585
  "transition-[border-color,box-shadow] duration-150",
7581
7586
  "group-data-[hovered]:border-ink",
7582
7587
  "group-data-[selected]:border-ink",
@@ -7586,7 +7591,8 @@ function Radio({ children, className, ...props }) {
7586
7591
  "span",
7587
7592
  {
7588
7593
  className: chunk4ACELYEP_cjs.cn(
7589
- "block size-[10px] rounded-full bg-accent",
7594
+ size === "sm" ? "size-2" : "size-[10px]",
7595
+ "block rounded-full bg-accent",
7590
7596
  "transition-opacity duration-150 opacity-0",
7591
7597
  "group-data-[selected]:opacity-100"
7592
7598
  )
@@ -9668,99 +9674,321 @@ function InlineAddFilter({ onClick }) {
9668
9674
  }
9669
9675
  );
9670
9676
  }
9671
- var recordUpdateStyles = tailwindVariants.tv({
9677
+ var avaActionReviewStyles = tailwindVariants.tv({
9672
9678
  slots: {
9673
- root: "flex flex-col min-w-0 text-ink",
9674
- summary: "px-4 pt-3 pb-1 text-[13px] text-ink-3",
9675
- rows: "flex flex-col px-4 divide-y divide-rule",
9679
+ root: "@container flex h-full min-h-0 min-w-0 flex-1 flex-col text-ink",
9680
+ // In a short host the head gives way and scrolls before the body would
9681
+ // collapse and push the foot out of the box (a long summary, many problems).
9682
+ head: [
9683
+ "flex min-h-0 flex-col gap-1.5 overflow-y-auto [scrollbar-width:thin] [&>*]:shrink-0",
9684
+ "border-b border-rule-2 px-3 pt-3 pb-2.5 @md:px-4"
9685
+ ],
9686
+ title: "flex min-w-0 items-baseline gap-2",
9687
+ eyebrow: "shrink-0 font-mono text-[10.5px] font-medium uppercase tracking-[0.08em] text-ink-4",
9688
+ titleText: "min-w-0 flex-1 truncate text-[13.5px] font-medium",
9689
+ titleAction: "shrink-0 self-center",
9690
+ reason: "text-[12px] leading-[1.4] text-ink-3",
9691
+ summary: "text-[13px] leading-[1.45] text-ink-2",
9692
+ summaryMore: "flex flex-wrap items-baseline gap-2.5",
9693
+ summaryMeta: "font-mono text-[11px] leading-[1.4] text-ink-3",
9694
+ problem: [
9695
+ "flex gap-1.5 rounded-sm px-2 py-1 text-[12.5px] leading-[1.4] text-warning",
9696
+ "bg-[color-mix(in_oklab,var(--color-warning)_10%,var(--color-surface))]"
9697
+ ],
9698
+ body: "min-h-20 flex-1 overflow-y-auto [scrollbar-width:thin]",
9699
+ rows: "flex flex-col px-3 @md:px-4",
9676
9700
  errors: [
9677
- "mx-4 my-3 flex gap-2 rounded-md px-3 py-2 text-[13px] text-danger",
9701
+ "mx-3 mt-2.5 flex gap-2 rounded-md px-3 py-2 text-[13px] text-danger @md:mx-4",
9678
9702
  "bg-[color-mix(in_oklab,var(--color-danger)_8%,var(--color-surface))]"
9679
9703
  ],
9680
- footer: "flex items-center justify-end gap-2 px-4 py-3"
9704
+ footer: "flex shrink-0 flex-wrap items-center justify-between gap-1.5 border-t border-rule-2 px-3 py-2 @md:px-4",
9705
+ actions: "ml-auto flex items-center gap-1",
9706
+ hint: "basis-full text-[12px] leading-[1.35] text-ink-3"
9681
9707
  }
9682
9708
  });
9683
- var recordUpdateRowStyles = tailwindVariants.tv({
9709
+ var avaActionReviewRowStyles = tailwindVariants.tv({
9684
9710
  slots: {
9685
- // fieldset resets (UA border / padding / min-content width) included.
9686
- root: "flex flex-col gap-1.5 m-0 border-0 px-0 py-2.5 min-w-0",
9711
+ // fieldset resets (UA border / padding / min-content width) included. The
9712
+ // hairline comes after `border-0`: a row's own reset would otherwise beat
9713
+ // a divider set on its parent.
9714
+ root: "m-0 flex min-w-0 flex-col gap-1.5 border-0 border-t border-rule-2 px-0 pt-2 pb-2.5 first:border-t-0",
9687
9715
  labelRow: [
9688
- "flex items-center gap-2 min-h-7",
9716
+ "flex min-h-7 items-center gap-2",
9689
9717
  "font-mono text-[10.5px] uppercase tracking-[0.08em] text-ink-4"
9690
9718
  ],
9691
- tag: "normal-case tracking-normal text-[10px] rounded-full px-1.5 py-px",
9692
- cells: "grid grid-cols-1 sm:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-2 sm:gap-3",
9693
- from: "min-w-0 opacity-70",
9694
- arrow: "size-3.5 shrink-0 text-ink-4 rotate-90 sm:rotate-0 justify-self-center",
9719
+ tag: "rounded-full px-1.5 py-px text-[10px] normal-case tracking-normal",
9720
+ cells: "grid grid-cols-[16px_minmax(0,1fr)] items-start gap-x-1.5 gap-y-1",
9721
+ from: "col-span-full min-w-0",
9722
+ arrow: "flex h-8 items-center justify-center text-ink-4 [&_svg]:size-3.5",
9723
+ arrowStacked: "",
9724
+ arrowBeside: "hidden",
9695
9725
  to: "min-w-0",
9696
- hint: "text-[12px] text-ink-4",
9726
+ hint: "text-[12px] text-ink-3",
9697
9727
  error: "text-[12px] text-danger",
9698
- removed: "text-[13px] italic text-ink-4"
9728
+ removed: "whitespace-nowrap font-sans text-[12.5px] italic normal-case tracking-normal"
9699
9729
  },
9700
9730
  variants: {
9701
9731
  state: {
9702
9732
  changed: {},
9733
+ added: {
9734
+ tag: "bg-surface-2 text-ink-3"
9735
+ },
9703
9736
  unresolved: {
9704
- tag: "text-warning bg-[color-mix(in_oklab,var(--color-warning)_12%,var(--color-surface))]"
9737
+ tag: "bg-[color-mix(in_oklab,var(--color-warning)_12%,var(--color-surface))] text-warning"
9705
9738
  },
9706
9739
  rejected: {
9707
- tag: "text-danger bg-[color-mix(in_oklab,var(--color-danger)_10%,var(--color-surface))]"
9740
+ tag: "bg-[color-mix(in_oklab,var(--color-danger)_10%,var(--color-surface))] text-danger"
9708
9741
  },
9709
- removed: { labelRow: "line-through decoration-ink-4/60" }
9742
+ removed: { root: "pt-0.5 pb-0.5" }
9743
+ },
9744
+ /** Long values read better one above the other at any width. */
9745
+ isLong: {
9746
+ false: {
9747
+ cells: "@md:grid-cols-[minmax(0,1fr)_14px_minmax(0,1fr)] @md:gap-x-2.5 @md:gap-y-0",
9748
+ from: "@md:col-auto",
9749
+ arrowStacked: "@md:hidden",
9750
+ arrowBeside: "@md:block"
9751
+ },
9752
+ true: {}
9710
9753
  }
9711
9754
  },
9712
- defaultVariants: { state: "changed" }
9755
+ defaultVariants: { state: "changed", isLong: false }
9713
9756
  });
9714
- function RecordUpdate({ className, children, ...props }) {
9715
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: chunk4ACELYEP_cjs.cn(recordUpdateStyles().root(), className), children });
9757
+ function AvaActionReview({ className, children, ...props }) {
9758
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: chunk4ACELYEP_cjs.cn(avaActionReviewStyles().root(), className), children });
9759
+ }
9760
+ function AvaActionReviewHead({
9761
+ className,
9762
+ children,
9763
+ ...props
9764
+ }) {
9765
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: chunk4ACELYEP_cjs.cn(avaActionReviewStyles().head(), className), children });
9716
9766
  }
9717
- function RecordUpdateSummary({
9767
+ function AvaActionReviewTitle({
9768
+ eyebrow,
9769
+ action,
9718
9770
  className,
9719
9771
  children,
9720
9772
  ...props
9721
9773
  }) {
9722
- return /* @__PURE__ */ jsxRuntime.jsx("p", { ...props, className: chunk4ACELYEP_cjs.cn(recordUpdateStyles().summary(), className), children });
9774
+ const styles4 = avaActionReviewStyles();
9775
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props, className: chunk4ACELYEP_cjs.cn(styles4.title(), className), children: [
9776
+ eyebrow ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles4.eyebrow(), children: eyebrow }) : null,
9777
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles4.titleText(), children }),
9778
+ action ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles4.titleAction(), children: action }) : null
9779
+ ] });
9723
9780
  }
9724
- function RecordUpdateRows({
9781
+ function AvaActionReviewReason({
9725
9782
  className,
9726
9783
  children,
9727
9784
  ...props
9728
9785
  }) {
9729
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: chunk4ACELYEP_cjs.cn(recordUpdateStyles().rows(), className), children });
9786
+ return /* @__PURE__ */ jsxRuntime.jsx("p", { ...props, className: chunk4ACELYEP_cjs.cn(avaActionReviewStyles().reason(), className), children });
9730
9787
  }
9731
- function RecordUpdateErrors({ errors, className, ...props }) {
9788
+ function AvaActionReviewSummary({
9789
+ meta,
9790
+ moreLabel = "More",
9791
+ lessLabel = "Less",
9792
+ className,
9793
+ children,
9794
+ ...props
9795
+ }) {
9796
+ const styles4 = avaActionReviewStyles();
9797
+ const textRef = react.useRef(null);
9798
+ const [isOpen, setIsOpen] = react.useState(false);
9799
+ const [isClamped, setIsClamped] = react.useState(false);
9800
+ react.useLayoutEffect(() => {
9801
+ const text = textRef.current;
9802
+ if (!text || isOpen) return;
9803
+ const measure = () => setIsClamped(text.scrollHeight > text.clientHeight + 1);
9804
+ measure();
9805
+ if (typeof ResizeObserver === "undefined") return;
9806
+ const observer = new ResizeObserver(measure);
9807
+ observer.observe(text);
9808
+ return () => observer.disconnect();
9809
+ }, [isOpen, children]);
9810
+ const canToggle = isOpen || isClamped;
9811
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props, className: chunk4ACELYEP_cjs.cn("flex flex-col gap-1", className), children: [
9812
+ children ? /* @__PURE__ */ jsxRuntime.jsx("p", { ref: textRef, className: chunk4ACELYEP_cjs.cn(styles4.summary(), !isOpen && "line-clamp-2"), children }) : null,
9813
+ canToggle || meta ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles4.summaryMore(), children: [
9814
+ canToggle ? /* @__PURE__ */ jsxRuntime.jsx(
9815
+ chunk4ACELYEP_cjs.Button,
9816
+ {
9817
+ variant: "link",
9818
+ size: "sm",
9819
+ className: "h-auto py-0 text-[12.5px]",
9820
+ "aria-expanded": isOpen,
9821
+ onPress: () => setIsOpen((open) => !open),
9822
+ children: isOpen ? lessLabel : moreLabel
9823
+ }
9824
+ ) : null,
9825
+ meta ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles4.summaryMeta(), children: meta }) : null
9826
+ ] }) : null
9827
+ ] });
9828
+ }
9829
+ function AvaActionReviewProblem({
9830
+ className,
9831
+ children,
9832
+ ...props
9833
+ }) {
9834
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props, className: chunk4ACELYEP_cjs.cn(avaActionReviewStyles().problem(), className), children: [
9835
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlert, { className: "mt-[3px] size-3 shrink-0", "aria-hidden": true }),
9836
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0", children })
9837
+ ] });
9838
+ }
9839
+ function AvaActionReviewBody({
9840
+ className,
9841
+ children,
9842
+ ...props
9843
+ }) {
9844
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: chunk4ACELYEP_cjs.cn(avaActionReviewStyles().body(), className), children });
9845
+ }
9846
+ function AvaActionReviewRows({
9847
+ className,
9848
+ children,
9849
+ ...props
9850
+ }) {
9851
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: chunk4ACELYEP_cjs.cn(avaActionReviewStyles().rows(), className), children });
9852
+ }
9853
+ function AvaActionReviewErrors({ errors, className, ...props }) {
9732
9854
  if (errors.length === 0) return null;
9733
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props, role: "alert", className: chunk4ACELYEP_cjs.cn(recordUpdateStyles().errors(), className), children: [
9734
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "size-4 shrink-0 mt-px", "aria-hidden": true }),
9735
- /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1 min-w-0", children: errors.map((error) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: error }, error)) })
9855
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props, role: "alert", className: chunk4ACELYEP_cjs.cn(avaActionReviewStyles().errors(), className), children: [
9856
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "mt-px size-4 shrink-0", "aria-hidden": true }),
9857
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex min-w-0 flex-col gap-1", children: errors.map((error) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: error }, error)) })
9736
9858
  ] });
9737
9859
  }
9738
- function RecordUpdateFooter({
9860
+ function AvaActionReviewFooter({
9861
+ className,
9862
+ children,
9863
+ ...props
9864
+ }) {
9865
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: chunk4ACELYEP_cjs.cn(avaActionReviewStyles().footer(), className), children });
9866
+ }
9867
+ function AvaActionReviewActions({
9868
+ className,
9869
+ children,
9870
+ ...props
9871
+ }) {
9872
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: chunk4ACELYEP_cjs.cn(avaActionReviewStyles().actions(), className), children });
9873
+ }
9874
+ function AvaActionReviewHint({
9739
9875
  className,
9740
9876
  children,
9741
9877
  ...props
9742
9878
  }) {
9743
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className: chunk4ACELYEP_cjs.cn(recordUpdateStyles().footer(), className), children });
9879
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, className: chunk4ACELYEP_cjs.cn(avaActionReviewStyles().hint(), className), children });
9744
9880
  }
9745
- function RecordUpdateRow({
9881
+ function AvaActionReviewAddField({
9882
+ groups,
9883
+ onPick,
9884
+ id,
9885
+ isDisabled = false,
9886
+ label = "Add field",
9887
+ searchLabel = "Find a field",
9888
+ emptyText = "No other fields match."
9889
+ }) {
9890
+ const { contains } = reactAriaComponents.useFilter({ sensitivity: "base" });
9891
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.DialogTrigger, { children: [
9892
+ /* @__PURE__ */ jsxRuntime.jsxs(
9893
+ chunk4ACELYEP_cjs.Button,
9894
+ {
9895
+ ...id !== void 0 ? { id } : {},
9896
+ variant: "ghost",
9897
+ size: "sm",
9898
+ className: "px-1.5",
9899
+ isDisabled,
9900
+ children: [
9901
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { "aria-hidden": true }),
9902
+ label
9903
+ ]
9904
+ }
9905
+ ),
9906
+ /* @__PURE__ */ jsxRuntime.jsx(
9907
+ reactAriaComponents.Popover,
9908
+ {
9909
+ placement: "top start",
9910
+ offset: 6,
9911
+ className: chunk4ACELYEP_cjs.cn(
9912
+ "w-[260px] max-w-[calc(100vw-2rem)] rounded-md border border-rule bg-surface p-1",
9913
+ "shadow-[var(--shadow-float)] outline-none",
9914
+ "entering:animate-enter-slide-up exiting:animate-exit-slide-up"
9915
+ ),
9916
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Dialog, { "aria-label": label, className: "flex max-h-[290px] flex-col outline-none", children: ({ close }) => /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.Autocomplete, { filter: contains, children: [
9917
+ /* @__PURE__ */ jsxRuntime.jsxs(
9918
+ reactAriaComponents.SearchField,
9919
+ {
9920
+ "aria-label": searchLabel,
9921
+ autoFocus: true,
9922
+ className: chunk4ACELYEP_cjs.cn(
9923
+ "mb-1 flex shrink-0 items-center gap-1.5 rounded-sm border border-rule px-2 py-1",
9924
+ "focus-within:border-accent"
9925
+ ),
9926
+ children: [
9927
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "size-3.5 shrink-0 text-ink-4", "aria-hidden": true }),
9928
+ /* @__PURE__ */ jsxRuntime.jsx(
9929
+ reactAriaComponents.Input,
9930
+ {
9931
+ placeholder: searchLabel,
9932
+ className: "w-full min-w-0 bg-transparent text-[13px] outline-none placeholder:text-ink-4"
9933
+ }
9934
+ )
9935
+ ]
9936
+ }
9937
+ ),
9938
+ /* @__PURE__ */ jsxRuntime.jsx(
9939
+ Menu,
9940
+ {
9941
+ "aria-label": label,
9942
+ className: "min-h-0 overflow-y-auto [scrollbar-width:thin]",
9943
+ onAction: (key) => {
9944
+ onPick(String(key));
9945
+ close();
9946
+ },
9947
+ renderEmptyState: () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2.5 py-2 text-[12.5px] text-ink-3", children: emptyText }),
9948
+ children: groups.map((group, index) => /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.MenuSection, { children: [
9949
+ group.label ? /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Header, { className: "px-2.5 pt-2 pb-1 font-mono text-[10.5px] uppercase tracking-[0.08em] text-ink-4", children: group.label }) : null,
9950
+ group.options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
9951
+ MenuItem,
9952
+ {
9953
+ id: option.id,
9954
+ textValue: option.label,
9955
+ ...option.icon ? { icon: option.icon } : {},
9956
+ children: option.label
9957
+ },
9958
+ option.id
9959
+ ))
9960
+ ] }, group.label ?? index))
9961
+ }
9962
+ )
9963
+ ] }) })
9964
+ }
9965
+ )
9966
+ ] });
9967
+ }
9968
+ function AvaActionReviewRow({
9746
9969
  label,
9747
9970
  from,
9748
9971
  to,
9749
9972
  state = "changed",
9973
+ isLong = false,
9750
9974
  hint,
9751
9975
  errorMessage,
9752
9976
  onRemove,
9753
9977
  onRestore,
9754
9978
  removeLabel = "Remove change",
9755
9979
  restoreLabel = "Restore change",
9980
+ fromLabel = "Current",
9981
+ toLabel = "New",
9982
+ addedLabel = "added",
9756
9983
  unresolvedLabel = "needs a value",
9757
9984
  rejectedLabel = "not possible",
9758
9985
  removedText = "Kept as it is",
9759
9986
  className,
9760
9987
  ...props
9761
9988
  }) {
9762
- const styles4 = recordUpdateRowStyles({ state });
9989
+ const styles4 = avaActionReviewRowStyles({ state, isLong });
9763
9990
  const isRemoved = state === "removed";
9991
+ const hasCells = from !== void 0 && state !== "rejected";
9764
9992
  return /* @__PURE__ */ jsxRuntime.jsxs(
9765
9993
  "fieldset",
9766
9994
  {
@@ -9770,7 +9998,9 @@ function RecordUpdateRow({
9770
9998
  className: chunk4ACELYEP_cjs.cn(styles4.root(), className),
9771
9999
  children: [
9772
10000
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles4.labelRow(), children: [
9773
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: label }),
10001
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: isRemoved ? /* @__PURE__ */ jsxRuntime.jsx("s", { children: label }) : label }),
10002
+ isRemoved ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles4.removed(), children: removedText }) : null,
10003
+ state === "added" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles4.tag(), children: addedLabel }) : null,
9774
10004
  state === "unresolved" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles4.tag(), children: unresolvedLabel }) : null,
9775
10005
  state === "rejected" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles4.tag(), children: rejectedLabel }) : null,
9776
10006
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto flex items-center", children: isRemoved ? onRestore && /* @__PURE__ */ jsxRuntime.jsx(
@@ -9784,11 +10014,20 @@ function RecordUpdateRow({
9784
10014
  }
9785
10015
  ) : onRemove && /* @__PURE__ */ jsxRuntime.jsx(chunk4ACELYEP_cjs.Button, { variant: "ghost", size: "icon-sm", "aria-label": removeLabel, onPress: onRemove, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, {}) }) })
9786
10016
  ] }),
9787
- isRemoved ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles4.removed(), children: removedText }) : from === void 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles4.to(), children: to }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles4.cells(), children: [
9788
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles4.from(), children: from }),
9789
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, { className: styles4.arrow(), "aria-hidden": true }),
9790
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles4.to(), children: to })
9791
- ] }),
10017
+ isRemoved ? null : hasCells ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles4.cells(), children: [
10018
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles4.from(), children: [
10019
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: fromLabel }),
10020
+ from
10021
+ ] }),
10022
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles4.arrow(), "aria-hidden": true, children: [
10023
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CornerDownRight, { className: styles4.arrowStacked() }),
10024
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, { className: styles4.arrowBeside() })
10025
+ ] }),
10026
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles4.to(), children: [
10027
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: toLabel }),
10028
+ to
10029
+ ] })
10030
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles4.to(), children: to }),
9792
10031
  !isRemoved && hint ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles4.hint(), children: hint }) : null,
9793
10032
  !isRemoved && errorMessage ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles4.error(), role: "alert", children: errorMessage }) : null
9794
10033
  ]
@@ -9916,6 +10155,7 @@ function Switch({
9916
10155
  children,
9917
10156
  labelPlacement = "end",
9918
10157
  description,
10158
+ size = "md",
9919
10159
  className,
9920
10160
  ...props
9921
10161
  }) {
@@ -9931,8 +10171,9 @@ function Switch({
9931
10171
  // without a positioned label it escapes an overflow-auto ancestor and
9932
10172
  // its containing block becomes the page shell, so focusing it (any
9933
10173
  // press) scrolls the clipped shell and the whole tab goes blank.
9934
- "group relative inline-flex items-center gap-3 cursor-pointer select-none",
9935
- "font-sans text-[14px] text-ink-2",
10174
+ "group relative inline-flex items-center cursor-pointer select-none",
10175
+ size === "sm" ? "gap-2 text-[13px]" : "gap-3 text-[14px]",
10176
+ "font-sans text-ink-2",
9936
10177
  labelPlacement === "start" && "flex-row-reverse",
9937
10178
  "data-[disabled]:opacity-45 data-[disabled]:cursor-not-allowed",
9938
10179
  typeof className === "function" ? className(renderProps) : className
@@ -9944,7 +10185,8 @@ function Switch({
9944
10185
  "aria-hidden": true,
9945
10186
  className: chunk4ACELYEP_cjs.cn(
9946
10187
  "relative inline-block shrink-0",
9947
- "w-[38px] h-[22px] rounded-pill border",
10188
+ size === "sm" ? "w-8 h-[18px]" : "w-[38px] h-[22px]",
10189
+ "rounded-pill border",
9948
10190
  "bg-surface-3 border-rule",
9949
10191
  "transition-[background-color,border-color] duration-150",
9950
10192
  "group-data-[selected]:bg-accent group-data-[selected]:border-accent",
@@ -9955,9 +10197,9 @@ function Switch({
9955
10197
  {
9956
10198
  className: chunk4ACELYEP_cjs.cn(
9957
10199
  "absolute top-[1px] left-[1px]",
9958
- "block size-[18px] rounded-full bg-surface",
10200
+ "block rounded-full bg-surface",
9959
10201
  "transition-transform duration-200",
9960
- "group-data-[selected]:translate-x-[16px]"
10202
+ size === "sm" ? "size-3.5 group-data-[selected]:translate-x-[14px]" : "size-[18px] group-data-[selected]:translate-x-[16px]"
9961
10203
  )
9962
10204
  }
9963
10205
  )
@@ -9977,8 +10219,8 @@ function Switch({
9977
10219
  className: chunk4ACELYEP_cjs.cn(
9978
10220
  fieldHintStyles,
9979
10221
  "leading-[1.45]",
9980
- // Track (38px) + gap-3 (12px): the copy starts under the label text.
9981
- labelPlacement === "end" && "pl-[50px]",
10222
+ // Track + gap: the copy starts under the label text.
10223
+ labelPlacement === "end" && (size === "sm" ? "pl-10" : "pl-[50px]"),
9982
10224
  props.isDisabled && "opacity-45"
9983
10225
  ),
9984
10226
  children: description
@@ -10374,6 +10616,20 @@ exports.AttachmentChip = AttachmentChip;
10374
10616
  exports.AttributePicker = AttributePicker;
10375
10617
  exports.AttributeType = AttributeType;
10376
10618
  exports.AttributeTypeIcon = AttributeTypeIcon;
10619
+ exports.AvaActionReview = AvaActionReview;
10620
+ exports.AvaActionReviewActions = AvaActionReviewActions;
10621
+ exports.AvaActionReviewAddField = AvaActionReviewAddField;
10622
+ exports.AvaActionReviewBody = AvaActionReviewBody;
10623
+ exports.AvaActionReviewErrors = AvaActionReviewErrors;
10624
+ exports.AvaActionReviewFooter = AvaActionReviewFooter;
10625
+ exports.AvaActionReviewHead = AvaActionReviewHead;
10626
+ exports.AvaActionReviewHint = AvaActionReviewHint;
10627
+ exports.AvaActionReviewProblem = AvaActionReviewProblem;
10628
+ exports.AvaActionReviewReason = AvaActionReviewReason;
10629
+ exports.AvaActionReviewRow = AvaActionReviewRow;
10630
+ exports.AvaActionReviewRows = AvaActionReviewRows;
10631
+ exports.AvaActionReviewSummary = AvaActionReviewSummary;
10632
+ exports.AvaActionReviewTitle = AvaActionReviewTitle;
10377
10633
  exports.AvailabilityCalendar = AvailabilityCalendar;
10378
10634
  exports.Avatar = Avatar;
10379
10635
  exports.AvatarGroup = AvatarGroup;
@@ -10478,12 +10734,6 @@ exports.RecordFilterBuilderPanel = RecordFilterBuilderPanel;
10478
10734
  exports.RecordFilterButton = RecordFilterButton;
10479
10735
  exports.RecordFilterChips = RecordFilterChips;
10480
10736
  exports.RecordFilterEditor = RecordFilterEditor;
10481
- exports.RecordUpdate = RecordUpdate;
10482
- exports.RecordUpdateErrors = RecordUpdateErrors;
10483
- exports.RecordUpdateFooter = RecordUpdateFooter;
10484
- exports.RecordUpdateRow = RecordUpdateRow;
10485
- exports.RecordUpdateRows = RecordUpdateRows;
10486
- exports.RecordUpdateSummary = RecordUpdateSummary;
10487
10737
  exports.RenderChipItemProvider = RenderChipItemProvider;
10488
10738
  exports.RenderValueInputProvider = RenderValueInputProvider;
10489
10739
  exports.SELECTION_COLUMN_ID = SELECTION_COLUMN_ID;
@@ -10521,6 +10771,8 @@ exports.addPendingLeaf = addPendingLeaf;
10521
10771
  exports.addSubgroup = addSubgroup;
10522
10772
  exports.arityOf = arityOf;
10523
10773
  exports.attachmentChipStyles = attachmentChipStyles;
10774
+ exports.avaActionReviewRowStyles = avaActionReviewRowStyles;
10775
+ exports.avaActionReviewStyles = avaActionReviewStyles;
10524
10776
  exports.availabilityCalendarStyles = availabilityCalendarStyles;
10525
10777
  exports.avatarGroupStyles = avatarGroupStyles;
10526
10778
  exports.avatarStyles = avatarStyles;
@@ -10587,8 +10839,6 @@ exports.progressRingStyles = progressRingStyles;
10587
10839
  exports.publishDraftMessageOutcome = publishDraftMessageOutcome;
10588
10840
  exports.rebaseRowOnFieldChange = rebaseRowOnFieldChange;
10589
10841
  exports.rebaseRowOnOperatorChange = rebaseRowOnOperatorChange;
10590
- exports.recordUpdateRowStyles = recordUpdateRowStyles;
10591
- exports.recordUpdateStyles = recordUpdateStyles;
10592
10842
  exports.registerDraftMessageActions = registerDraftMessageActions;
10593
10843
  exports.removeLeaf = removeLeaf;
10594
10844
  exports.removeSubgroup = removeSubgroup;