@proteos/ui 0.78.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.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { cn, Button, Skeleton } from './chunk-XRN5MNDX.js';
2
2
  export { Button, Skeleton, buttonStyles, cn, skeletonStyles } from './chunk-XRN5MNDX.js';
3
- import { icons, Contact, Paperclip, BookText, Banknote, UsersRound, User, Link2, Braces, Brackets, ToggleLeft, CircleDot, Calendar, Hash, Type, File, FileImage, FileText, FileSpreadsheet, FileArchive, Loader2, X, ChevronLeft, ChevronRight, Shapes, Search, Phone, AudioLines, Video, Mic, AtSign, MessagesSquare, Camera, Send, Linkedin, MessageCircle, Mail, Pipette, Pencil, ChevronDown, GripVertical, SendHorizontal, CircleX, Download, Square, RotateCcw, Pause, Play, RotateCw, AlertCircle, Undo2, ArrowRight, Check, CircleCheck, CircleAlert, Info } from 'lucide-react';
3
+ import { icons, Contact, Paperclip, BookText, Banknote, UsersRound, User, Link2, Braces, Brackets, ToggleLeft, CircleDot, Calendar, Hash, Type, File, FileImage, FileText, FileSpreadsheet, FileArchive, Loader2, X, ChevronLeft, ChevronRight, Shapes, Search, Phone, AudioLines, Video, Mic, AtSign, MessagesSquare, Camera, Send, Linkedin, MessageCircle, Mail, Pipette, Pencil, ChevronDown, GripVertical, SendHorizontal, CircleX, Download, Square, RotateCcw, Pause, Play, RotateCw, TriangleAlert, AlertCircle, Plus, Undo2, CornerDownRight, ArrowRight, Check, CircleCheck, CircleAlert, Info } from 'lucide-react';
4
4
  import { tv } from 'tailwind-variants';
5
- import { Tabs as Tabs$1, TabPanel, Tab, TabList, MenuTrigger as MenuTrigger$1, SubmenuTrigger as SubmenuTrigger$1, DialogTrigger, Popover as Popover$1, Dialog, DropZone, Text, FileTrigger, Heading, Calendar as Calendar$1, Button as Button$1, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell, CalendarStateContext, Label, Input as Input$1, ListBox, ListBoxItem, TooltipTrigger as TooltipTrigger$1, Tooltip as Tooltip$1, Breadcrumbs as Breadcrumbs$1, Breadcrumb, Link, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, FieldError, TextField, ComboBox, ComboBoxStateContext, Select as Select$1, SelectValue, ModalOverlay, Modal as Modal$1, DatePicker as DatePicker$1, Group, DateInput, DateSegment, ToggleButtonGroup, ToggleButton, Slider as Slider$1, SliderTrack, SliderThumb, Menu as Menu$1, MenuItem as MenuItem$1, Disclosure, DisclosurePanel, ProgressBar as ProgressBar$1, RadioGroup as RadioGroup$1, Radio as Radio$1, Separator as Separator$1, Switch as Switch$1, TextArea, TimeField as TimeField$1, UNSTABLE_ToastQueue, UNSTABLE_ToastRegion, UNSTABLE_Toast, UNSTABLE_ToastContent, DatePickerStateContext } from 'react-aria-components';
5
+ import { Tabs as Tabs$1, TabPanel, Tab, TabList, MenuTrigger as MenuTrigger$1, SubmenuTrigger as SubmenuTrigger$1, DialogTrigger, Popover as Popover$1, Dialog, DropZone, Text, FileTrigger, Heading, Calendar as Calendar$1, Button as Button$1, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell, CalendarStateContext, Label, Input as Input$1, ListBox, ListBoxItem, TooltipTrigger as TooltipTrigger$1, Tooltip as Tooltip$1, Breadcrumbs as Breadcrumbs$1, Breadcrumb, Link, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, FieldError, TextField, ComboBox, ComboBoxStateContext, Select as Select$1, SelectValue, ModalOverlay, Modal as Modal$1, DatePicker as DatePicker$1, Group, DateInput, DateSegment, ToggleButtonGroup, ToggleButton, Slider as Slider$1, SliderTrack, SliderThumb, Menu as Menu$1, MenuItem as MenuItem$1, Disclosure, DisclosurePanel, ProgressBar as ProgressBar$1, RadioGroup as RadioGroup$1, Radio as Radio$1, useFilter, Autocomplete, SearchField, MenuSection, Header, Separator as Separator$1, Switch as Switch$1, TextArea, TimeField as TimeField$1, UNSTABLE_ToastQueue, UNSTABLE_ToastRegion, UNSTABLE_Toast, UNSTABLE_ToastContent, DatePickerStateContext } from 'react-aria-components';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
7
  import { lazy, createContext, memo, useRef, useEffect, useContext, useState, useMemo, Children, isValidElement, useLayoutEffect, useSyncExternalStore, useCallback, Suspense, useId, Fragment as Fragment$1 } from 'react';
8
8
  import { formatAmount, parseAmount } from '@proteos/sdk';
@@ -1663,7 +1663,7 @@ function ChannelIcon({ channel, className, label }) {
1663
1663
  const Icon = channelIcon(channel);
1664
1664
  return label !== void 0 ? /* @__PURE__ */ jsx(Icon, { className: cn("size-4", className), role: "img", "aria-label": label }) : /* @__PURE__ */ jsx(Icon, { className: cn("size-4", className), "aria-hidden": true });
1665
1665
  }
1666
- function Checkbox({ children, className, ...props }) {
1666
+ function Checkbox({ children, className, size = "md", ...props }) {
1667
1667
  return /* @__PURE__ */ jsx(
1668
1668
  Checkbox$1,
1669
1669
  {
@@ -1676,8 +1676,9 @@ function Checkbox({ children, className, ...props }) {
1676
1676
  // scroll clipping, and focusing it makes the browser scroll a
1677
1677
  // container the user cannot scroll back (the roles permission
1678
1678
  // matrix, where toggling a row threw the page off-screen).
1679
- "group relative inline-flex items-center gap-2.5 cursor-pointer",
1680
- "font-sans text-[14px] text-ink-2 select-none",
1679
+ "group relative inline-flex items-center cursor-pointer",
1680
+ size === "sm" ? "gap-2 text-[13px]" : "gap-2.5 text-[14px]",
1681
+ "font-sans text-ink-2 select-none",
1681
1682
  "data-[disabled]:opacity-45 data-[disabled]:cursor-not-allowed",
1682
1683
  typeof className === "function" ? className(renderProps) : className
1683
1684
  ),
@@ -1688,7 +1689,8 @@ function Checkbox({ children, className, ...props }) {
1688
1689
  "aria-hidden": true,
1689
1690
  className: cn(
1690
1691
  "relative inline-flex items-center justify-center shrink-0",
1691
- "size-[18px] rounded-[4px] border bg-surface",
1692
+ size === "sm" ? "size-4" : "size-[18px]",
1693
+ "rounded-[4px] border bg-surface",
1692
1694
  "border-ink-4",
1693
1695
  "transition-[background-color,border-color,box-shadow] duration-150",
1694
1696
  // hovered
@@ -1699,12 +1701,13 @@ function Checkbox({ children, className, ...props }) {
1699
1701
  // focus ring on the box
1700
1702
  "group-data-[focus-visible]:shadow-[var(--shadow-focus)]"
1701
1703
  ),
1702
- children: renderProps.isIndeterminate ? /* @__PURE__ */ jsx("span", { className: "block h-px w-2.5 bg-surface" }) : /* @__PURE__ */ jsx(
1704
+ children: renderProps.isIndeterminate ? /* @__PURE__ */ jsx("span", { className: cn("block h-px bg-surface", size === "sm" ? "w-2" : "w-2.5") }) : /* @__PURE__ */ jsx(
1703
1705
  "svg",
1704
1706
  {
1705
1707
  viewBox: "0 0 12 12",
1706
1708
  className: cn(
1707
- "size-3 text-surface transition-opacity duration-150",
1709
+ size === "sm" ? "size-2.5" : "size-3",
1710
+ "text-surface transition-opacity duration-150",
1708
1711
  renderProps.isSelected ? "opacity-100" : "opacity-0"
1709
1712
  ),
1710
1713
  "aria-hidden": true,
@@ -7553,7 +7556,7 @@ function RadioGroup({
7553
7556
  }
7554
7557
  );
7555
7558
  }
7556
- function Radio({ children, className, ...props }) {
7559
+ function Radio({ children, className, size = "md", ...props }) {
7557
7560
  return /* @__PURE__ */ jsxs(
7558
7561
  Radio$1,
7559
7562
  {
@@ -7563,8 +7566,9 @@ function Radio({ children, className, ...props }) {
7563
7566
  // visually-hidden <input> is absolutely positioned and must resolve
7564
7567
  // against this radio, not a far-away shell, or focusing it scrolls
7565
7568
  // the clipped page.
7566
- "group relative inline-flex items-center gap-2.5 cursor-pointer",
7567
- "font-sans text-[14px] text-ink-2 select-none",
7569
+ "group relative inline-flex items-center cursor-pointer",
7570
+ size === "sm" ? "gap-2 text-[13px]" : "gap-2.5 text-[14px]",
7571
+ "font-sans text-ink-2 select-none",
7568
7572
  "data-[disabled]:opacity-45 data-[disabled]:cursor-not-allowed",
7569
7573
  typeof className === "function" ? className(renderProps) : className
7570
7574
  ),
@@ -7575,7 +7579,8 @@ function Radio({ children, className, ...props }) {
7575
7579
  "aria-hidden": true,
7576
7580
  className: cn(
7577
7581
  "relative inline-flex items-center justify-center shrink-0",
7578
- "size-[18px] rounded-full border bg-surface border-ink-4",
7582
+ size === "sm" ? "size-4" : "size-[18px]",
7583
+ "rounded-full border bg-surface border-ink-4",
7579
7584
  "transition-[border-color,box-shadow] duration-150",
7580
7585
  "group-data-[hovered]:border-ink",
7581
7586
  "group-data-[selected]:border-ink",
@@ -7585,7 +7590,8 @@ function Radio({ children, className, ...props }) {
7585
7590
  "span",
7586
7591
  {
7587
7592
  className: cn(
7588
- "block size-[10px] rounded-full bg-accent",
7593
+ size === "sm" ? "size-2" : "size-[10px]",
7594
+ "block rounded-full bg-accent",
7589
7595
  "transition-opacity duration-150 opacity-0",
7590
7596
  "group-data-[selected]:opacity-100"
7591
7597
  )
@@ -9667,99 +9673,321 @@ function InlineAddFilter({ onClick }) {
9667
9673
  }
9668
9674
  );
9669
9675
  }
9670
- var recordUpdateStyles = tv({
9676
+ var avaActionReviewStyles = tv({
9671
9677
  slots: {
9672
- root: "flex flex-col min-w-0 text-ink",
9673
- summary: "px-4 pt-3 pb-1 text-[13px] text-ink-3",
9674
- rows: "flex flex-col px-4 divide-y divide-rule",
9678
+ root: "@container flex h-full min-h-0 min-w-0 flex-1 flex-col text-ink",
9679
+ // In a short host the head gives way and scrolls before the body would
9680
+ // collapse and push the foot out of the box (a long summary, many problems).
9681
+ head: [
9682
+ "flex min-h-0 flex-col gap-1.5 overflow-y-auto [scrollbar-width:thin] [&>*]:shrink-0",
9683
+ "border-b border-rule-2 px-3 pt-3 pb-2.5 @md:px-4"
9684
+ ],
9685
+ title: "flex min-w-0 items-baseline gap-2",
9686
+ eyebrow: "shrink-0 font-mono text-[10.5px] font-medium uppercase tracking-[0.08em] text-ink-4",
9687
+ titleText: "min-w-0 flex-1 truncate text-[13.5px] font-medium",
9688
+ titleAction: "shrink-0 self-center",
9689
+ reason: "text-[12px] leading-[1.4] text-ink-3",
9690
+ summary: "text-[13px] leading-[1.45] text-ink-2",
9691
+ summaryMore: "flex flex-wrap items-baseline gap-2.5",
9692
+ summaryMeta: "font-mono text-[11px] leading-[1.4] text-ink-3",
9693
+ problem: [
9694
+ "flex gap-1.5 rounded-sm px-2 py-1 text-[12.5px] leading-[1.4] text-warning",
9695
+ "bg-[color-mix(in_oklab,var(--color-warning)_10%,var(--color-surface))]"
9696
+ ],
9697
+ body: "min-h-20 flex-1 overflow-y-auto [scrollbar-width:thin]",
9698
+ rows: "flex flex-col px-3 @md:px-4",
9675
9699
  errors: [
9676
- "mx-4 my-3 flex gap-2 rounded-md px-3 py-2 text-[13px] text-danger",
9700
+ "mx-3 mt-2.5 flex gap-2 rounded-md px-3 py-2 text-[13px] text-danger @md:mx-4",
9677
9701
  "bg-[color-mix(in_oklab,var(--color-danger)_8%,var(--color-surface))]"
9678
9702
  ],
9679
- footer: "flex items-center justify-end gap-2 px-4 py-3"
9703
+ 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",
9704
+ actions: "ml-auto flex items-center gap-1",
9705
+ hint: "basis-full text-[12px] leading-[1.35] text-ink-3"
9680
9706
  }
9681
9707
  });
9682
- var recordUpdateRowStyles = tv({
9708
+ var avaActionReviewRowStyles = tv({
9683
9709
  slots: {
9684
- // fieldset resets (UA border / padding / min-content width) included.
9685
- root: "flex flex-col gap-1.5 m-0 border-0 px-0 py-2.5 min-w-0",
9710
+ // fieldset resets (UA border / padding / min-content width) included. The
9711
+ // hairline comes after `border-0`: a row's own reset would otherwise beat
9712
+ // a divider set on its parent.
9713
+ 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",
9686
9714
  labelRow: [
9687
- "flex items-center gap-2 min-h-7",
9715
+ "flex min-h-7 items-center gap-2",
9688
9716
  "font-mono text-[10.5px] uppercase tracking-[0.08em] text-ink-4"
9689
9717
  ],
9690
- tag: "normal-case tracking-normal text-[10px] rounded-full px-1.5 py-px",
9691
- cells: "grid grid-cols-1 sm:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-2 sm:gap-3",
9692
- from: "min-w-0 opacity-70",
9693
- arrow: "size-3.5 shrink-0 text-ink-4 rotate-90 sm:rotate-0 justify-self-center",
9718
+ tag: "rounded-full px-1.5 py-px text-[10px] normal-case tracking-normal",
9719
+ cells: "grid grid-cols-[16px_minmax(0,1fr)] items-start gap-x-1.5 gap-y-1",
9720
+ from: "col-span-full min-w-0",
9721
+ arrow: "flex h-8 items-center justify-center text-ink-4 [&_svg]:size-3.5",
9722
+ arrowStacked: "",
9723
+ arrowBeside: "hidden",
9694
9724
  to: "min-w-0",
9695
- hint: "text-[12px] text-ink-4",
9725
+ hint: "text-[12px] text-ink-3",
9696
9726
  error: "text-[12px] text-danger",
9697
- removed: "text-[13px] italic text-ink-4"
9727
+ removed: "whitespace-nowrap font-sans text-[12.5px] italic normal-case tracking-normal"
9698
9728
  },
9699
9729
  variants: {
9700
9730
  state: {
9701
9731
  changed: {},
9732
+ added: {
9733
+ tag: "bg-surface-2 text-ink-3"
9734
+ },
9702
9735
  unresolved: {
9703
- tag: "text-warning bg-[color-mix(in_oklab,var(--color-warning)_12%,var(--color-surface))]"
9736
+ tag: "bg-[color-mix(in_oklab,var(--color-warning)_12%,var(--color-surface))] text-warning"
9704
9737
  },
9705
9738
  rejected: {
9706
- tag: "text-danger bg-[color-mix(in_oklab,var(--color-danger)_10%,var(--color-surface))]"
9739
+ tag: "bg-[color-mix(in_oklab,var(--color-danger)_10%,var(--color-surface))] text-danger"
9707
9740
  },
9708
- removed: { labelRow: "line-through decoration-ink-4/60" }
9741
+ removed: { root: "pt-0.5 pb-0.5" }
9742
+ },
9743
+ /** Long values read better one above the other at any width. */
9744
+ isLong: {
9745
+ false: {
9746
+ cells: "@md:grid-cols-[minmax(0,1fr)_14px_minmax(0,1fr)] @md:gap-x-2.5 @md:gap-y-0",
9747
+ from: "@md:col-auto",
9748
+ arrowStacked: "@md:hidden",
9749
+ arrowBeside: "@md:block"
9750
+ },
9751
+ true: {}
9709
9752
  }
9710
9753
  },
9711
- defaultVariants: { state: "changed" }
9754
+ defaultVariants: { state: "changed", isLong: false }
9712
9755
  });
9713
- function RecordUpdate({ className, children, ...props }) {
9714
- return /* @__PURE__ */ jsx("div", { ...props, className: cn(recordUpdateStyles().root(), className), children });
9756
+ function AvaActionReview({ className, children, ...props }) {
9757
+ return /* @__PURE__ */ jsx("div", { ...props, className: cn(avaActionReviewStyles().root(), className), children });
9758
+ }
9759
+ function AvaActionReviewHead({
9760
+ className,
9761
+ children,
9762
+ ...props
9763
+ }) {
9764
+ return /* @__PURE__ */ jsx("div", { ...props, className: cn(avaActionReviewStyles().head(), className), children });
9715
9765
  }
9716
- function RecordUpdateSummary({
9766
+ function AvaActionReviewTitle({
9767
+ eyebrow,
9768
+ action,
9717
9769
  className,
9718
9770
  children,
9719
9771
  ...props
9720
9772
  }) {
9721
- return /* @__PURE__ */ jsx("p", { ...props, className: cn(recordUpdateStyles().summary(), className), children });
9773
+ const styles4 = avaActionReviewStyles();
9774
+ return /* @__PURE__ */ jsxs("div", { ...props, className: cn(styles4.title(), className), children: [
9775
+ eyebrow ? /* @__PURE__ */ jsx("span", { className: styles4.eyebrow(), children: eyebrow }) : null,
9776
+ /* @__PURE__ */ jsx("span", { className: styles4.titleText(), children }),
9777
+ action ? /* @__PURE__ */ jsx("span", { className: styles4.titleAction(), children: action }) : null
9778
+ ] });
9722
9779
  }
9723
- function RecordUpdateRows({
9780
+ function AvaActionReviewReason({
9724
9781
  className,
9725
9782
  children,
9726
9783
  ...props
9727
9784
  }) {
9728
- return /* @__PURE__ */ jsx("div", { ...props, className: cn(recordUpdateStyles().rows(), className), children });
9785
+ return /* @__PURE__ */ jsx("p", { ...props, className: cn(avaActionReviewStyles().reason(), className), children });
9729
9786
  }
9730
- function RecordUpdateErrors({ errors, className, ...props }) {
9787
+ function AvaActionReviewSummary({
9788
+ meta,
9789
+ moreLabel = "More",
9790
+ lessLabel = "Less",
9791
+ className,
9792
+ children,
9793
+ ...props
9794
+ }) {
9795
+ const styles4 = avaActionReviewStyles();
9796
+ const textRef = useRef(null);
9797
+ const [isOpen, setIsOpen] = useState(false);
9798
+ const [isClamped, setIsClamped] = useState(false);
9799
+ useLayoutEffect(() => {
9800
+ const text = textRef.current;
9801
+ if (!text || isOpen) return;
9802
+ const measure = () => setIsClamped(text.scrollHeight > text.clientHeight + 1);
9803
+ measure();
9804
+ if (typeof ResizeObserver === "undefined") return;
9805
+ const observer = new ResizeObserver(measure);
9806
+ observer.observe(text);
9807
+ return () => observer.disconnect();
9808
+ }, [isOpen, children]);
9809
+ const canToggle = isOpen || isClamped;
9810
+ return /* @__PURE__ */ jsxs("div", { ...props, className: cn("flex flex-col gap-1", className), children: [
9811
+ children ? /* @__PURE__ */ jsx("p", { ref: textRef, className: cn(styles4.summary(), !isOpen && "line-clamp-2"), children }) : null,
9812
+ canToggle || meta ? /* @__PURE__ */ jsxs("div", { className: styles4.summaryMore(), children: [
9813
+ canToggle ? /* @__PURE__ */ jsx(
9814
+ Button,
9815
+ {
9816
+ variant: "link",
9817
+ size: "sm",
9818
+ className: "h-auto py-0 text-[12.5px]",
9819
+ "aria-expanded": isOpen,
9820
+ onPress: () => setIsOpen((open) => !open),
9821
+ children: isOpen ? lessLabel : moreLabel
9822
+ }
9823
+ ) : null,
9824
+ meta ? /* @__PURE__ */ jsx("span", { className: styles4.summaryMeta(), children: meta }) : null
9825
+ ] }) : null
9826
+ ] });
9827
+ }
9828
+ function AvaActionReviewProblem({
9829
+ className,
9830
+ children,
9831
+ ...props
9832
+ }) {
9833
+ return /* @__PURE__ */ jsxs("div", { ...props, className: cn(avaActionReviewStyles().problem(), className), children: [
9834
+ /* @__PURE__ */ jsx(TriangleAlert, { className: "mt-[3px] size-3 shrink-0", "aria-hidden": true }),
9835
+ /* @__PURE__ */ jsx("span", { className: "min-w-0", children })
9836
+ ] });
9837
+ }
9838
+ function AvaActionReviewBody({
9839
+ className,
9840
+ children,
9841
+ ...props
9842
+ }) {
9843
+ return /* @__PURE__ */ jsx("div", { ...props, className: cn(avaActionReviewStyles().body(), className), children });
9844
+ }
9845
+ function AvaActionReviewRows({
9846
+ className,
9847
+ children,
9848
+ ...props
9849
+ }) {
9850
+ return /* @__PURE__ */ jsx("div", { ...props, className: cn(avaActionReviewStyles().rows(), className), children });
9851
+ }
9852
+ function AvaActionReviewErrors({ errors, className, ...props }) {
9731
9853
  if (errors.length === 0) return null;
9732
- return /* @__PURE__ */ jsxs("div", { ...props, role: "alert", className: cn(recordUpdateStyles().errors(), className), children: [
9733
- /* @__PURE__ */ jsx(AlertCircle, { className: "size-4 shrink-0 mt-px", "aria-hidden": true }),
9734
- /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-1 min-w-0", children: errors.map((error) => /* @__PURE__ */ jsx("li", { children: error }, error)) })
9854
+ return /* @__PURE__ */ jsxs("div", { ...props, role: "alert", className: cn(avaActionReviewStyles().errors(), className), children: [
9855
+ /* @__PURE__ */ jsx(AlertCircle, { className: "mt-px size-4 shrink-0", "aria-hidden": true }),
9856
+ /* @__PURE__ */ jsx("ul", { className: "flex min-w-0 flex-col gap-1", children: errors.map((error) => /* @__PURE__ */ jsx("li", { children: error }, error)) })
9735
9857
  ] });
9736
9858
  }
9737
- function RecordUpdateFooter({
9859
+ function AvaActionReviewFooter({
9860
+ className,
9861
+ children,
9862
+ ...props
9863
+ }) {
9864
+ return /* @__PURE__ */ jsx("div", { ...props, className: cn(avaActionReviewStyles().footer(), className), children });
9865
+ }
9866
+ function AvaActionReviewActions({
9867
+ className,
9868
+ children,
9869
+ ...props
9870
+ }) {
9871
+ return /* @__PURE__ */ jsx("div", { ...props, className: cn(avaActionReviewStyles().actions(), className), children });
9872
+ }
9873
+ function AvaActionReviewHint({
9738
9874
  className,
9739
9875
  children,
9740
9876
  ...props
9741
9877
  }) {
9742
- return /* @__PURE__ */ jsx("div", { ...props, className: cn(recordUpdateStyles().footer(), className), children });
9878
+ return /* @__PURE__ */ jsx("span", { ...props, className: cn(avaActionReviewStyles().hint(), className), children });
9743
9879
  }
9744
- function RecordUpdateRow({
9880
+ function AvaActionReviewAddField({
9881
+ groups,
9882
+ onPick,
9883
+ id,
9884
+ isDisabled = false,
9885
+ label = "Add field",
9886
+ searchLabel = "Find a field",
9887
+ emptyText = "No other fields match."
9888
+ }) {
9889
+ const { contains } = useFilter({ sensitivity: "base" });
9890
+ return /* @__PURE__ */ jsxs(DialogTrigger, { children: [
9891
+ /* @__PURE__ */ jsxs(
9892
+ Button,
9893
+ {
9894
+ ...id !== void 0 ? { id } : {},
9895
+ variant: "ghost",
9896
+ size: "sm",
9897
+ className: "px-1.5",
9898
+ isDisabled,
9899
+ children: [
9900
+ /* @__PURE__ */ jsx(Plus, { "aria-hidden": true }),
9901
+ label
9902
+ ]
9903
+ }
9904
+ ),
9905
+ /* @__PURE__ */ jsx(
9906
+ Popover$1,
9907
+ {
9908
+ placement: "top start",
9909
+ offset: 6,
9910
+ className: cn(
9911
+ "w-[260px] max-w-[calc(100vw-2rem)] rounded-md border border-rule bg-surface p-1",
9912
+ "shadow-[var(--shadow-float)] outline-none",
9913
+ "entering:animate-enter-slide-up exiting:animate-exit-slide-up"
9914
+ ),
9915
+ children: /* @__PURE__ */ jsx(Dialog, { "aria-label": label, className: "flex max-h-[290px] flex-col outline-none", children: ({ close }) => /* @__PURE__ */ jsxs(Autocomplete, { filter: contains, children: [
9916
+ /* @__PURE__ */ jsxs(
9917
+ SearchField,
9918
+ {
9919
+ "aria-label": searchLabel,
9920
+ autoFocus: true,
9921
+ className: cn(
9922
+ "mb-1 flex shrink-0 items-center gap-1.5 rounded-sm border border-rule px-2 py-1",
9923
+ "focus-within:border-accent"
9924
+ ),
9925
+ children: [
9926
+ /* @__PURE__ */ jsx(Search, { className: "size-3.5 shrink-0 text-ink-4", "aria-hidden": true }),
9927
+ /* @__PURE__ */ jsx(
9928
+ Input$1,
9929
+ {
9930
+ placeholder: searchLabel,
9931
+ className: "w-full min-w-0 bg-transparent text-[13px] outline-none placeholder:text-ink-4"
9932
+ }
9933
+ )
9934
+ ]
9935
+ }
9936
+ ),
9937
+ /* @__PURE__ */ jsx(
9938
+ Menu,
9939
+ {
9940
+ "aria-label": label,
9941
+ className: "min-h-0 overflow-y-auto [scrollbar-width:thin]",
9942
+ onAction: (key) => {
9943
+ onPick(String(key));
9944
+ close();
9945
+ },
9946
+ renderEmptyState: () => /* @__PURE__ */ jsx("div", { className: "px-2.5 py-2 text-[12.5px] text-ink-3", children: emptyText }),
9947
+ children: groups.map((group, index) => /* @__PURE__ */ jsxs(MenuSection, { children: [
9948
+ group.label ? /* @__PURE__ */ jsx(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,
9949
+ group.options.map((option) => /* @__PURE__ */ jsx(
9950
+ MenuItem,
9951
+ {
9952
+ id: option.id,
9953
+ textValue: option.label,
9954
+ ...option.icon ? { icon: option.icon } : {},
9955
+ children: option.label
9956
+ },
9957
+ option.id
9958
+ ))
9959
+ ] }, group.label ?? index))
9960
+ }
9961
+ )
9962
+ ] }) })
9963
+ }
9964
+ )
9965
+ ] });
9966
+ }
9967
+ function AvaActionReviewRow({
9745
9968
  label,
9746
9969
  from,
9747
9970
  to,
9748
9971
  state = "changed",
9972
+ isLong = false,
9749
9973
  hint,
9750
9974
  errorMessage,
9751
9975
  onRemove,
9752
9976
  onRestore,
9753
9977
  removeLabel = "Remove change",
9754
9978
  restoreLabel = "Restore change",
9979
+ fromLabel = "Current",
9980
+ toLabel = "New",
9981
+ addedLabel = "added",
9755
9982
  unresolvedLabel = "needs a value",
9756
9983
  rejectedLabel = "not possible",
9757
9984
  removedText = "Kept as it is",
9758
9985
  className,
9759
9986
  ...props
9760
9987
  }) {
9761
- const styles4 = recordUpdateRowStyles({ state });
9988
+ const styles4 = avaActionReviewRowStyles({ state, isLong });
9762
9989
  const isRemoved = state === "removed";
9990
+ const hasCells = from !== void 0 && state !== "rejected";
9763
9991
  return /* @__PURE__ */ jsxs(
9764
9992
  "fieldset",
9765
9993
  {
@@ -9769,7 +9997,9 @@ function RecordUpdateRow({
9769
9997
  className: cn(styles4.root(), className),
9770
9998
  children: [
9771
9999
  /* @__PURE__ */ jsxs("div", { className: styles4.labelRow(), children: [
9772
- /* @__PURE__ */ jsx("span", { className: "truncate", children: label }),
10000
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: isRemoved ? /* @__PURE__ */ jsx("s", { children: label }) : label }),
10001
+ isRemoved ? /* @__PURE__ */ jsx("span", { className: styles4.removed(), children: removedText }) : null,
10002
+ state === "added" ? /* @__PURE__ */ jsx("span", { className: styles4.tag(), children: addedLabel }) : null,
9773
10003
  state === "unresolved" ? /* @__PURE__ */ jsx("span", { className: styles4.tag(), children: unresolvedLabel }) : null,
9774
10004
  state === "rejected" ? /* @__PURE__ */ jsx("span", { className: styles4.tag(), children: rejectedLabel }) : null,
9775
10005
  /* @__PURE__ */ jsx("span", { className: "ml-auto flex items-center", children: isRemoved ? onRestore && /* @__PURE__ */ jsx(
@@ -9783,11 +10013,20 @@ function RecordUpdateRow({
9783
10013
  }
9784
10014
  ) : onRemove && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": removeLabel, onPress: onRemove, children: /* @__PURE__ */ jsx(X, {}) }) })
9785
10015
  ] }),
9786
- isRemoved ? /* @__PURE__ */ jsx("div", { className: styles4.removed(), children: removedText }) : from === void 0 ? /* @__PURE__ */ jsx("div", { className: styles4.to(), children: to }) : /* @__PURE__ */ jsxs("div", { className: styles4.cells(), children: [
9787
- /* @__PURE__ */ jsx("div", { className: styles4.from(), children: from }),
9788
- /* @__PURE__ */ jsx(ArrowRight, { className: styles4.arrow(), "aria-hidden": true }),
9789
- /* @__PURE__ */ jsx("div", { className: styles4.to(), children: to })
9790
- ] }),
10016
+ isRemoved ? null : hasCells ? /* @__PURE__ */ jsxs("div", { className: styles4.cells(), children: [
10017
+ /* @__PURE__ */ jsxs("div", { className: styles4.from(), children: [
10018
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: fromLabel }),
10019
+ from
10020
+ ] }),
10021
+ /* @__PURE__ */ jsxs("div", { className: styles4.arrow(), "aria-hidden": true, children: [
10022
+ /* @__PURE__ */ jsx(CornerDownRight, { className: styles4.arrowStacked() }),
10023
+ /* @__PURE__ */ jsx(ArrowRight, { className: styles4.arrowBeside() })
10024
+ ] }),
10025
+ /* @__PURE__ */ jsxs("div", { className: styles4.to(), children: [
10026
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: toLabel }),
10027
+ to
10028
+ ] })
10029
+ ] }) : /* @__PURE__ */ jsx("div", { className: styles4.to(), children: to }),
9791
10030
  !isRemoved && hint ? /* @__PURE__ */ jsx("div", { className: styles4.hint(), children: hint }) : null,
9792
10031
  !isRemoved && errorMessage ? /* @__PURE__ */ jsx("div", { className: styles4.error(), role: "alert", children: errorMessage }) : null
9793
10032
  ]
@@ -9915,6 +10154,7 @@ function Switch({
9915
10154
  children,
9916
10155
  labelPlacement = "end",
9917
10156
  description,
10157
+ size = "md",
9918
10158
  className,
9919
10159
  ...props
9920
10160
  }) {
@@ -9930,8 +10170,9 @@ function Switch({
9930
10170
  // without a positioned label it escapes an overflow-auto ancestor and
9931
10171
  // its containing block becomes the page shell, so focusing it (any
9932
10172
  // press) scrolls the clipped shell and the whole tab goes blank.
9933
- "group relative inline-flex items-center gap-3 cursor-pointer select-none",
9934
- "font-sans text-[14px] text-ink-2",
10173
+ "group relative inline-flex items-center cursor-pointer select-none",
10174
+ size === "sm" ? "gap-2 text-[13px]" : "gap-3 text-[14px]",
10175
+ "font-sans text-ink-2",
9935
10176
  labelPlacement === "start" && "flex-row-reverse",
9936
10177
  "data-[disabled]:opacity-45 data-[disabled]:cursor-not-allowed",
9937
10178
  typeof className === "function" ? className(renderProps) : className
@@ -9943,7 +10184,8 @@ function Switch({
9943
10184
  "aria-hidden": true,
9944
10185
  className: cn(
9945
10186
  "relative inline-block shrink-0",
9946
- "w-[38px] h-[22px] rounded-pill border",
10187
+ size === "sm" ? "w-8 h-[18px]" : "w-[38px] h-[22px]",
10188
+ "rounded-pill border",
9947
10189
  "bg-surface-3 border-rule",
9948
10190
  "transition-[background-color,border-color] duration-150",
9949
10191
  "group-data-[selected]:bg-accent group-data-[selected]:border-accent",
@@ -9954,9 +10196,9 @@ function Switch({
9954
10196
  {
9955
10197
  className: cn(
9956
10198
  "absolute top-[1px] left-[1px]",
9957
- "block size-[18px] rounded-full bg-surface",
10199
+ "block rounded-full bg-surface",
9958
10200
  "transition-transform duration-200",
9959
- "group-data-[selected]:translate-x-[16px]"
10201
+ size === "sm" ? "size-3.5 group-data-[selected]:translate-x-[14px]" : "size-[18px] group-data-[selected]:translate-x-[16px]"
9960
10202
  )
9961
10203
  }
9962
10204
  )
@@ -9976,8 +10218,8 @@ function Switch({
9976
10218
  className: cn(
9977
10219
  fieldHintStyles,
9978
10220
  "leading-[1.45]",
9979
- // Track (38px) + gap-3 (12px): the copy starts under the label text.
9980
- labelPlacement === "end" && "pl-[50px]",
10221
+ // Track + gap: the copy starts under the label text.
10222
+ labelPlacement === "end" && (size === "sm" ? "pl-10" : "pl-[50px]"),
9981
10223
  props.isDisabled && "opacity-45"
9982
10224
  ),
9983
10225
  children: description
@@ -10347,6 +10589,6 @@ function ToastRegion({ queue, className }) {
10347
10589
  );
10348
10590
  }
10349
10591
 
10350
- export { ATTRIBUTE_TYPES, ATTRIBUTE_TYPE_ICONS, AttachmentChip, AttributePicker, AttributeType, AttributeTypeIcon, AvailabilityCalendar, Avatar, AvatarGroup, Badge, BadgeAction, BadgeGroup, BadgeMultiSelect, BooleanCell, Breadcrumbs, COLUMN_DRAG_KIND, CONVERSATION_BRIEF_OUTCOME_LABEL, Card, CardBody, CardContent, CardEyebrow, CardFeatureTitle, CardFooter, CardHeader, CardTitle, ChannelIcon, Checkbox, CheckboxGroup, ChipValue, ColorInput, Combobox, Command, CommandHint, ConversationBriefCard, ConversationBriefPreview, ConversationBriefReview, CurrencyInput, DRAFT_OUTCOME_LABEL, DataTable, DataTableEmpty, DataTableError, DataTableSkeleton, DateCell, DatePicker, DateTimeCell, DateTimePicker, DraftMessageCard, DraftMessageComposer, DraftMessageReview, EmptyState, ErrorAnimation, FIELD_LABEL_SEPARATOR, FieldCaret, FileField, FileViewer, FileViewerFallbackCard, FilterRow, FilterValueInput, FrameStrip, GlowFrame, IconPicker, ImageAttachment, ImageLightbox, Input, Kbd, LinkCell, MAX_COMPOSER_ATTACHMENT_BYTES, MAX_DECODE_BYTES, MediaControls, MediaMarkerTrack, MediaPlayer, MediaStage, MediaTimeline, MediaVideoStage, MediaWaveform, Menu, MenuItem, MenuPopover, MenuTrigger, MessageComposer, Modal, ModalBody, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalTitle, MultiSelect, NavGroup, NavItem, NavSection, OPERATORS, OperatorPicker, Orb, PROTECTED_COMBOS, Popover, PopoverContent, PopoverPanelBody, PopoverPanelFooter, PopoverPanelHeader, PressableCard, ProgressBar, ProgressRing, Radio, RadioGroup, RecipientSelect, RecordFilterBuilderPanel, RecordFilterButton, RecordFilterChips, RecordFilterEditor, RecordUpdate, RecordUpdateErrors, RecordUpdateFooter, RecordUpdateRow, RecordUpdateRows, RecordUpdateSummary, RenderChipItemProvider, RenderValueInputProvider, SELECTION_COLUMN_ID, SegmentedControl, Select, Separator, Slider, Stepper, StepperStep, SubmenuTrigger, SuccessAnimation, Switch, Table, TableBody, TableCell, TableHeader, TableHeaderCell, TableHeaderSpacer, TableRow, TableScroller, Tabs, TagInput, TextShimmer, Textarea, TimeField, TimeSlotList, ToastRegion, Tooltip, TooltipTrigger, TruncateCell, __resetDraftMessageActions, __resetDraftMessageOutcomes, addLeaf as addFilterLeaf, addPendingLeaf, addSubgroup, arityOf, attachmentChipStyles, availabilityCalendarStyles, avatarGroupStyles, avatarStyles, badgeGroupOverflowStyles, badgeGroupStyles, badgeStyles, cardStyles2 as cardStyles, channelIcon, contactPhoneNumbers, conversationBriefCardStyles, conversationBriefOutcomeFor, countLeaves, createConversationBriefClient, createDraftMessageClient, createToastQueue, currentMediaMarkers, decodePeaks, defaultValueFor, draftMessageCardStyles, draftMessageComposerStyles, draftOutcomeFor, emptyStateStyles, fieldControlStyles, fieldErrorStyles, fieldHintStyles, fieldLabelStyles, fileViewerFallbackCardStyles, fileViewerStyles, fitBadgeCount, fitMediaBox, formatFileSize, formatMediaTime, formatValue, frameStripStyles, getPlatform, glowFrameStyles, iconForContentType, imageAttachmentStyles, imageLightboxStyles, isColumnDragData, isDialableConversationBrief, isDraftReviewOutcome, isEditableTarget, isPreviewableImageName, joinFieldLabel, makeActionsColumn, maskPeaks, mediaControlsStyles, mediaMarkersStyles, mediaPlayerStyles, mediaTimelineStyles, mediaVideoStageStyles, mediaWaveformStyles, messageComposerStyles, namesOf, navItemStyles, normalizeHexColor, operatorById, operatorsForType, parseCombo, peaksFromChannels, progressBarStyles, progressRingStyles, publishDraftMessageOutcome, rebaseRowOnFieldChange, rebaseRowOnOperatorChange, recordUpdateRowStyles, recordUpdateStyles, registerDraftMessageActions, removeLeaf, removeSubgroup, replaceLeaf, resolveLucideIcon, resolveLucideIconName, segmentedControlStyles, setJoiner, sliderStyles, spokenMediaTime, stepperStyles, subscribeDraftMessageOutcome, summaryFor, tableCellStyles, tableHeaderCellStyles, tabsStyles, terminalKindFor, textShimmerStyles, timeSlotListStyles, toastStyles, updateLeaf, updateSubgroup, useActiveCommands, useAttributeTypeIcon, useCommand, useDiscoveryActive, useDraftMessageActions, useDraftMessageOutcome, useEscapeKey, useInfiniteScrollSentinel, useMediaPlayer, useRenderChipItem, useRenderValueInput, useShowDetails, viewerKindForContentType, wrapLeafInGroup };
10592
+ export { ATTRIBUTE_TYPES, ATTRIBUTE_TYPE_ICONS, AttachmentChip, AttributePicker, AttributeType, AttributeTypeIcon, AvaActionReview, AvaActionReviewActions, AvaActionReviewAddField, AvaActionReviewBody, AvaActionReviewErrors, AvaActionReviewFooter, AvaActionReviewHead, AvaActionReviewHint, AvaActionReviewProblem, AvaActionReviewReason, AvaActionReviewRow, AvaActionReviewRows, AvaActionReviewSummary, AvaActionReviewTitle, AvailabilityCalendar, Avatar, AvatarGroup, Badge, BadgeAction, BadgeGroup, BadgeMultiSelect, BooleanCell, Breadcrumbs, COLUMN_DRAG_KIND, CONVERSATION_BRIEF_OUTCOME_LABEL, Card, CardBody, CardContent, CardEyebrow, CardFeatureTitle, CardFooter, CardHeader, CardTitle, ChannelIcon, Checkbox, CheckboxGroup, ChipValue, ColorInput, Combobox, Command, CommandHint, ConversationBriefCard, ConversationBriefPreview, ConversationBriefReview, CurrencyInput, DRAFT_OUTCOME_LABEL, DataTable, DataTableEmpty, DataTableError, DataTableSkeleton, DateCell, DatePicker, DateTimeCell, DateTimePicker, DraftMessageCard, DraftMessageComposer, DraftMessageReview, EmptyState, ErrorAnimation, FIELD_LABEL_SEPARATOR, FieldCaret, FileField, FileViewer, FileViewerFallbackCard, FilterRow, FilterValueInput, FrameStrip, GlowFrame, IconPicker, ImageAttachment, ImageLightbox, Input, Kbd, LinkCell, MAX_COMPOSER_ATTACHMENT_BYTES, MAX_DECODE_BYTES, MediaControls, MediaMarkerTrack, MediaPlayer, MediaStage, MediaTimeline, MediaVideoStage, MediaWaveform, Menu, MenuItem, MenuPopover, MenuTrigger, MessageComposer, Modal, ModalBody, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalTitle, MultiSelect, NavGroup, NavItem, NavSection, OPERATORS, OperatorPicker, Orb, PROTECTED_COMBOS, Popover, PopoverContent, PopoverPanelBody, PopoverPanelFooter, PopoverPanelHeader, PressableCard, ProgressBar, ProgressRing, Radio, RadioGroup, RecipientSelect, RecordFilterBuilderPanel, RecordFilterButton, RecordFilterChips, RecordFilterEditor, RenderChipItemProvider, RenderValueInputProvider, SELECTION_COLUMN_ID, SegmentedControl, Select, Separator, Slider, Stepper, StepperStep, SubmenuTrigger, SuccessAnimation, Switch, Table, TableBody, TableCell, TableHeader, TableHeaderCell, TableHeaderSpacer, TableRow, TableScroller, Tabs, TagInput, TextShimmer, Textarea, TimeField, TimeSlotList, ToastRegion, Tooltip, TooltipTrigger, TruncateCell, __resetDraftMessageActions, __resetDraftMessageOutcomes, addLeaf as addFilterLeaf, addPendingLeaf, addSubgroup, arityOf, attachmentChipStyles, avaActionReviewRowStyles, avaActionReviewStyles, availabilityCalendarStyles, avatarGroupStyles, avatarStyles, badgeGroupOverflowStyles, badgeGroupStyles, badgeStyles, cardStyles2 as cardStyles, channelIcon, contactPhoneNumbers, conversationBriefCardStyles, conversationBriefOutcomeFor, countLeaves, createConversationBriefClient, createDraftMessageClient, createToastQueue, currentMediaMarkers, decodePeaks, defaultValueFor, draftMessageCardStyles, draftMessageComposerStyles, draftOutcomeFor, emptyStateStyles, fieldControlStyles, fieldErrorStyles, fieldHintStyles, fieldLabelStyles, fileViewerFallbackCardStyles, fileViewerStyles, fitBadgeCount, fitMediaBox, formatFileSize, formatMediaTime, formatValue, frameStripStyles, getPlatform, glowFrameStyles, iconForContentType, imageAttachmentStyles, imageLightboxStyles, isColumnDragData, isDialableConversationBrief, isDraftReviewOutcome, isEditableTarget, isPreviewableImageName, joinFieldLabel, makeActionsColumn, maskPeaks, mediaControlsStyles, mediaMarkersStyles, mediaPlayerStyles, mediaTimelineStyles, mediaVideoStageStyles, mediaWaveformStyles, messageComposerStyles, namesOf, navItemStyles, normalizeHexColor, operatorById, operatorsForType, parseCombo, peaksFromChannels, progressBarStyles, progressRingStyles, publishDraftMessageOutcome, rebaseRowOnFieldChange, rebaseRowOnOperatorChange, registerDraftMessageActions, removeLeaf, removeSubgroup, replaceLeaf, resolveLucideIcon, resolveLucideIconName, segmentedControlStyles, setJoiner, sliderStyles, spokenMediaTime, stepperStyles, subscribeDraftMessageOutcome, summaryFor, tableCellStyles, tableHeaderCellStyles, tabsStyles, terminalKindFor, textShimmerStyles, timeSlotListStyles, toastStyles, updateLeaf, updateSubgroup, useActiveCommands, useAttributeTypeIcon, useCommand, useDiscoveryActive, useDraftMessageActions, useDraftMessageOutcome, useEscapeKey, useInfiniteScrollSentinel, useMediaPlayer, useRenderChipItem, useRenderValueInput, useShowDetails, viewerKindForContentType, wrapLeafInGroup };
10351
10593
  //# sourceMappingURL=index.js.map
10352
10594
  //# sourceMappingURL=index.js.map