@vantageos/mosaic-blocks 0.5.28-alpha → 0.5.30-alpha

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
@@ -29,7 +29,7 @@ import { AlertDialog } from '@base-ui/react/alert-dialog';
29
29
  import { Popover } from '@base-ui/react/popover';
30
30
 
31
31
  // src/version.ts
32
- var version = "0.5.28-alpha";
32
+ var version = "0.5.30-alpha";
33
33
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
34
34
  return /* @__PURE__ */ jsx("div", { "data-mosaic-block": "placeholder", children: label });
35
35
  }
@@ -7429,6 +7429,9 @@ function MosaicMessageCard({
7429
7429
  bookmarkLabel,
7430
7430
  copyMessageLabel,
7431
7431
  aiSenderLabel,
7432
+ viewThreadLabel,
7433
+ likeAriaLabel,
7434
+ dislikeAriaLabel,
7432
7435
  className
7433
7436
  }) {
7434
7437
  const [bookmarked, setBookmarked] = React30.useState(message.bookmarked ?? false);
@@ -7544,7 +7547,7 @@ function MosaicMessageCard({
7544
7547
  "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
7545
7548
  hasLiked && "text-primary"
7546
7549
  ),
7547
- "aria-label": `Like (${likes})`,
7550
+ "aria-label": likeAriaLabel(likes),
7548
7551
  children: [
7549
7552
  icons.thumbUp,
7550
7553
  /* @__PURE__ */ jsx("span", { children: likes })
@@ -7562,7 +7565,7 @@ function MosaicMessageCard({
7562
7565
  "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
7563
7566
  hasDisliked && "text-destructive"
7564
7567
  ),
7565
- "aria-label": `Dislike (${dislikes})`,
7568
+ "aria-label": dislikeAriaLabel(dislikes),
7566
7569
  children: [
7567
7570
  icons.thumbDown,
7568
7571
  /* @__PURE__ */ jsx("span", { children: dislikes })
@@ -7692,7 +7695,7 @@ function MosaicMessageCard({
7692
7695
  className: "inline-flex h-7 items-center gap-1 rounded-md text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground px-2",
7693
7696
  children: [
7694
7697
  icons.msgSquare,
7695
- "View thread"
7698
+ viewThreadLabel
7696
7699
  ]
7697
7700
  }
7698
7701
  ) })
@@ -7746,6 +7749,9 @@ function MessageListDesktop({
7746
7749
  removeBookmarkLabel,
7747
7750
  bookmarkLabel,
7748
7751
  copyMessageLabel,
7752
+ viewThreadLabel,
7753
+ likeAriaLabel,
7754
+ dislikeAriaLabel,
7749
7755
  className
7750
7756
  }) {
7751
7757
  const [query, setQuery] = React30.useState("");
@@ -7789,7 +7795,10 @@ function MessageListDesktop({
7789
7795
  bookmarkAriaLabel,
7790
7796
  removeBookmarkLabel,
7791
7797
  bookmarkLabel,
7792
- copyMessageLabel
7798
+ copyMessageLabel,
7799
+ viewThreadLabel,
7800
+ likeAriaLabel,
7801
+ dislikeAriaLabel
7793
7802
  },
7794
7803
  message.id
7795
7804
  )),
@@ -7829,6 +7838,9 @@ function MessageListMobile({
7829
7838
  removeBookmarkLabel,
7830
7839
  bookmarkLabel,
7831
7840
  copyMessageLabel,
7841
+ viewThreadLabel,
7842
+ likeAriaLabel,
7843
+ dislikeAriaLabel,
7832
7844
  className
7833
7845
  }) {
7834
7846
  return /* @__PURE__ */ jsxs("div", { "data-slot": "message-list-mobile", className: cn62("flex flex-col", className), children: [
@@ -7850,6 +7862,9 @@ function MessageListMobile({
7850
7862
  removeBookmarkLabel,
7851
7863
  bookmarkLabel,
7852
7864
  copyMessageLabel,
7865
+ viewThreadLabel,
7866
+ likeAriaLabel,
7867
+ dislikeAriaLabel,
7853
7868
  compact: true
7854
7869
  },
7855
7870
  message.id
@@ -10044,6 +10059,7 @@ function MosaicCreateOrgDialog({
10044
10059
  orgNameFieldLabel,
10045
10060
  orgNamePlaceholder,
10046
10061
  slugFieldLabel,
10062
+ slugPlaceholder,
10047
10063
  descriptionFieldLabel,
10048
10064
  descriptionPlaceholder,
10049
10065
  cancelLabel,
@@ -10129,7 +10145,7 @@ function MosaicCreateOrgDialog({
10129
10145
  type: "text",
10130
10146
  value: slug,
10131
10147
  onChange: (e) => setSlug(e.target.value),
10132
- placeholder: "acme-inc",
10148
+ placeholder: slugPlaceholder,
10133
10149
  required: true,
10134
10150
  className: cn69(
10135
10151
  "w-full rounded-md border bg-background px-3 py-2 min-h-[40px] text-sm placeholder:text-muted-foreground",
@@ -10594,6 +10610,7 @@ function injectStyles8() {
10594
10610
  function MosaicDashboardContent({
10595
10611
  views,
10596
10612
  currentView,
10613
+ viewNotFoundLabel,
10597
10614
  className
10598
10615
  }) {
10599
10616
  const { isMobile } = useDevice();
@@ -10607,7 +10624,7 @@ function MosaicDashboardContent({
10607
10624
  "data-slot": "dashboard-content",
10608
10625
  className: cn70("h-full overflow-auto", isMobile ? "p-4" : "p-6", className),
10609
10626
  children: activeView ? /* @__PURE__ */ jsx("div", { className: "mosaic-content-view space-y-6", children: activeView.content }, currentView) : /* @__PURE__ */ jsxs("p", { className: "py-12 text-center text-sm text-muted-foreground", children: [
10610
- "View not found: ",
10627
+ viewNotFoundLabel,
10611
10628
  currentView
10612
10629
  ] })
10613
10630
  }
@@ -15660,7 +15677,1090 @@ function MosaicMemoryList({
15660
15677
  );
15661
15678
  }
15662
15679
  MosaicMemoryList.displayName = "MosaicMemoryList";
15680
+ var memorySearchFilterChipVariants = cva(
15681
+ [
15682
+ "inline-flex items-center justify-center whitespace-nowrap",
15683
+ "rounded-full border px-3 py-1 gap-1",
15684
+ "text-xs font-medium transition-colors",
15685
+ "focus-visible:outline-none focus-visible:ring-ring focus-visible:ring-[3px]"
15686
+ ],
15687
+ {
15688
+ variants: {
15689
+ selected: {
15690
+ true: "border-transparent bg-primary text-primary-foreground",
15691
+ false: "border-border bg-background text-foreground hover:bg-muted"
15692
+ }
15693
+ },
15694
+ defaultVariants: {
15695
+ selected: false
15696
+ }
15697
+ }
15698
+ );
15699
+ function cn104(...classes) {
15700
+ return classes.filter(Boolean).join(" ");
15701
+ }
15702
+ function SearchIcon8() {
15703
+ return /* @__PURE__ */ jsxs(
15704
+ "svg",
15705
+ {
15706
+ xmlns: "http://www.w3.org/2000/svg",
15707
+ width: "16",
15708
+ height: "16",
15709
+ viewBox: "0 0 24 24",
15710
+ fill: "none",
15711
+ stroke: "currentColor",
15712
+ strokeWidth: "2",
15713
+ strokeLinecap: "round",
15714
+ strokeLinejoin: "round",
15715
+ "aria-hidden": "true",
15716
+ children: [
15717
+ /* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8" }),
15718
+ /* @__PURE__ */ jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
15719
+ ]
15720
+ }
15721
+ );
15722
+ }
15723
+ function ClearIcon() {
15724
+ return /* @__PURE__ */ jsxs(
15725
+ "svg",
15726
+ {
15727
+ xmlns: "http://www.w3.org/2000/svg",
15728
+ width: "14",
15729
+ height: "14",
15730
+ viewBox: "0 0 24 24",
15731
+ fill: "none",
15732
+ stroke: "currentColor",
15733
+ strokeWidth: "2",
15734
+ strokeLinecap: "round",
15735
+ strokeLinejoin: "round",
15736
+ "aria-hidden": "true",
15737
+ children: [
15738
+ /* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
15739
+ /* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
15740
+ ]
15741
+ }
15742
+ );
15743
+ }
15744
+ function MosaicMemorySearch({
15745
+ query,
15746
+ onQueryChange,
15747
+ searchLabel,
15748
+ searchPlaceholder,
15749
+ clearButtonLabel,
15750
+ resultCount,
15751
+ formatResultCount,
15752
+ filters,
15753
+ selectedFilterIds,
15754
+ onFilterToggle,
15755
+ className,
15756
+ ref
15757
+ }) {
15758
+ return /* @__PURE__ */ jsxs("div", { ref, "data-slot": "memory-search", className: cn104("flex flex-col gap-2", className), children: [
15759
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
15760
+ /* @__PURE__ */ jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: /* @__PURE__ */ jsx(SearchIcon8, {}) }),
15761
+ /* @__PURE__ */ jsx(
15762
+ MosaicInput,
15763
+ {
15764
+ type: "search",
15765
+ "aria-label": searchLabel,
15766
+ placeholder: searchPlaceholder,
15767
+ value: query,
15768
+ onChange: (event) => onQueryChange(event.target.value),
15769
+ className: "pl-9 pr-9"
15770
+ }
15771
+ ),
15772
+ query.length > 0 && /* @__PURE__ */ jsx(
15773
+ "button",
15774
+ {
15775
+ type: "button",
15776
+ "aria-label": clearButtonLabel,
15777
+ onClick: () => onQueryChange(""),
15778
+ className: cn104(
15779
+ "absolute right-2 top-1/2 -translate-y-1/2",
15780
+ "flex size-5 items-center justify-center rounded-full",
15781
+ "text-muted-foreground hover:bg-muted hover:text-foreground",
15782
+ "focus-visible:outline-none focus-visible:ring-ring focus-visible:ring-[3px]"
15783
+ ),
15784
+ children: /* @__PURE__ */ jsx(ClearIcon, {})
15785
+ }
15786
+ )
15787
+ ] }),
15788
+ filters && filters.length > 0 && /* @__PURE__ */ jsx("div", { "data-slot": "memory-search-filters", className: "flex flex-wrap items-center gap-2", children: filters.map((filter) => {
15789
+ const isSelected = (selectedFilterIds ?? []).includes(filter.id);
15790
+ return /* @__PURE__ */ jsx(
15791
+ "button",
15792
+ {
15793
+ type: "button",
15794
+ "data-slot": "memory-search-filter-chip",
15795
+ "aria-pressed": isSelected,
15796
+ onClick: () => onFilterToggle?.(filter.id),
15797
+ className: memorySearchFilterChipVariants({ selected: isSelected }),
15798
+ children: filter.label
15799
+ },
15800
+ filter.id
15801
+ );
15802
+ }) }),
15803
+ /* @__PURE__ */ jsx("p", { "data-slot": "memory-search-result-count", className: "text-sm text-muted-foreground", children: formatResultCount(resultCount) })
15804
+ ] });
15805
+ }
15806
+ MosaicMemorySearch.displayName = "MosaicMemorySearch";
15807
+ var replyInputRootVariants = cva([
15808
+ "min-w-0 rounded-[14px] border border-border bg-card shadow-sm transition-colors",
15809
+ "focus-within:ring-[1px] focus-within:ring-ring"
15810
+ ]);
15811
+ var replyInputContextVariants = cva([
15812
+ "truncate border-border border-b px-3 py-2 text-muted-foreground text-xs"
15813
+ ]);
15814
+ var replyInputTextareaVariants = cva([
15815
+ "max-h-40 min-h-12 w-full resize-none bg-transparent px-3 pt-3 pb-1 text-sm outline-none",
15816
+ "placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-60"
15817
+ ]);
15818
+ var replyInputActionButtonVariants = cva(
15819
+ [
15820
+ "inline-flex h-7 shrink-0 items-center justify-center rounded-md px-2.5 text-xs transition-colors",
15821
+ "disabled:cursor-not-allowed disabled:opacity-30"
15822
+ ],
15823
+ {
15824
+ variants: {
15825
+ tone: {
15826
+ send: "bg-foreground text-background hover:bg-foreground/90",
15827
+ cancel: "bg-foreground/10 text-foreground hover:bg-foreground/20"
15828
+ }
15829
+ },
15830
+ defaultVariants: {
15831
+ tone: "send"
15832
+ }
15833
+ }
15834
+ );
15835
+ function cn105(...classes) {
15836
+ return classes.filter(Boolean).join(" ");
15837
+ }
15838
+ function MosaicReplyInput(props) {
15839
+ const {
15840
+ value,
15841
+ onValueChange,
15842
+ onSubmit,
15843
+ onCancel,
15844
+ context,
15845
+ contextAriaLabel,
15846
+ textareaAriaLabel,
15847
+ placeholder,
15848
+ sendButtonAriaLabel,
15849
+ cancelButtonAriaLabel,
15850
+ disabled = false,
15851
+ className,
15852
+ ref
15853
+ } = props;
15854
+ const textareaRef = useRef(null);
15855
+ const trimmedValue = value.trim();
15856
+ useEffect(() => {
15857
+ const textarea = textareaRef.current;
15858
+ if (!textarea) {
15859
+ return;
15860
+ }
15861
+ textarea.style.height = "auto";
15862
+ textarea.style.height = `${textarea.scrollHeight}px`;
15863
+ }, [value]);
15864
+ const submitValue = useCallback(() => {
15865
+ const text = value.trim();
15866
+ if (!text || disabled) {
15867
+ return;
15868
+ }
15869
+ onSubmit(text);
15870
+ }, [disabled, onSubmit, value]);
15871
+ const handleSubmit = useCallback(
15872
+ (event) => {
15873
+ event.preventDefault();
15874
+ submitValue();
15875
+ },
15876
+ [submitValue]
15877
+ );
15878
+ const handleKeyDown = useCallback(
15879
+ (event) => {
15880
+ if (event.key === "Enter" && !event.shiftKey) {
15881
+ event.preventDefault();
15882
+ submitValue();
15883
+ }
15884
+ },
15885
+ [submitValue]
15886
+ );
15887
+ return /* @__PURE__ */ jsxs(
15888
+ "form",
15889
+ {
15890
+ ref,
15891
+ "data-slot": "reply-input",
15892
+ className: cn105(replyInputRootVariants(), className),
15893
+ onSubmit: handleSubmit,
15894
+ children: [
15895
+ /* @__PURE__ */ jsx(
15896
+ "div",
15897
+ {
15898
+ "aria-label": contextAriaLabel,
15899
+ className: replyInputContextVariants(),
15900
+ "data-slot": "reply-input-context",
15901
+ children: context
15902
+ }
15903
+ ),
15904
+ /* @__PURE__ */ jsx(
15905
+ "textarea",
15906
+ {
15907
+ "data-slot": "reply-input-textarea",
15908
+ "aria-label": textareaAriaLabel,
15909
+ className: replyInputTextareaVariants(),
15910
+ disabled,
15911
+ onChange: (event) => onValueChange(event.target.value),
15912
+ onKeyDown: handleKeyDown,
15913
+ placeholder,
15914
+ ref: textareaRef,
15915
+ rows: 1,
15916
+ value
15917
+ }
15918
+ ),
15919
+ /* @__PURE__ */ jsxs("div", { className: "flex min-h-9 items-center justify-end gap-2 px-3 pt-1 pb-2", children: [
15920
+ /* @__PURE__ */ jsx(
15921
+ "button",
15922
+ {
15923
+ "aria-label": cancelButtonAriaLabel,
15924
+ className: replyInputActionButtonVariants({ tone: "cancel" }),
15925
+ "data-slot": "reply-input-cancel-button",
15926
+ disabled,
15927
+ onClick: onCancel,
15928
+ type: "button",
15929
+ children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\xD7" })
15930
+ }
15931
+ ),
15932
+ /* @__PURE__ */ jsx(
15933
+ "button",
15934
+ {
15935
+ "aria-label": sendButtonAriaLabel,
15936
+ className: replyInputActionButtonVariants({ tone: "send" }),
15937
+ "data-slot": "reply-input-send-button",
15938
+ disabled: disabled || trimmedValue.length === 0,
15939
+ type: "submit",
15940
+ children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2191" })
15941
+ }
15942
+ )
15943
+ ] })
15944
+ ]
15945
+ }
15946
+ );
15947
+ }
15948
+ MosaicReplyInput.displayName = "MosaicReplyInput";
15949
+ var threadViewRootVariants = cva(["flex min-w-0 flex-col gap-3"]);
15950
+ var threadViewRootMessageVariants = cva([
15951
+ "rounded-lg border border-border bg-card p-4 shadow-sm"
15952
+ ]);
15953
+ var threadViewRepliesVariants = cva(["flex flex-col gap-2 border-border border-l-2 pl-4"]);
15954
+ var threadViewReplyVariants = cva([
15955
+ "rounded-lg border border-border bg-muted/40 p-3 text-sm"
15956
+ ]);
15957
+ var threadViewEmptyVariants = cva(["px-1 py-2 text-muted-foreground text-sm"]);
15958
+ function cn106(...classes) {
15959
+ return classes.filter(Boolean).join(" ");
15960
+ }
15961
+ function MosaicThreadView(props) {
15962
+ const { root, replies, rootAriaLabel, repliesAriaLabel, emptyRepliesLabel, className, ref } = props;
15963
+ return /* @__PURE__ */ jsxs("div", { ref, "data-slot": "thread-view", className: cn106(threadViewRootVariants(), className), children: [
15964
+ /* @__PURE__ */ jsxs(
15965
+ "div",
15966
+ {
15967
+ "aria-label": rootAriaLabel,
15968
+ className: threadViewRootMessageVariants(),
15969
+ "data-slot": "thread-view-root",
15970
+ children: [
15971
+ root.author,
15972
+ root.content
15973
+ ]
15974
+ }
15975
+ ),
15976
+ /* @__PURE__ */ jsx(
15977
+ "div",
15978
+ {
15979
+ "aria-label": repliesAriaLabel,
15980
+ className: threadViewRepliesVariants(),
15981
+ "data-slot": "thread-view-replies",
15982
+ children: replies.length === 0 ? /* @__PURE__ */ jsx("p", { className: threadViewEmptyVariants(), "data-slot": "thread-view-empty", children: emptyRepliesLabel }) : replies.map((reply) => /* @__PURE__ */ jsxs("div", { className: threadViewReplyVariants(), "data-slot": "thread-view-reply", children: [
15983
+ reply.author,
15984
+ reply.content
15985
+ ] }, reply.id))
15986
+ }
15987
+ )
15988
+ ] });
15989
+ }
15990
+ MosaicThreadView.displayName = "MosaicThreadView";
15991
+ var threadIndicatorRootVariants = cva([
15992
+ "inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs transition-colors",
15993
+ "hover:bg-accent hover:text-accent-foreground",
15994
+ "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
15995
+ "disabled:cursor-not-allowed disabled:opacity-60"
15996
+ ]);
15997
+ var threadIndicatorCountVariants = cva([
15998
+ "inline-flex min-w-4 items-center justify-center rounded-full px-1.5 py-0.5",
15999
+ "bg-primary text-primary-foreground text-[10px] font-semibold leading-none"
16000
+ ]);
16001
+ function cn107(...classes) {
16002
+ return classes.filter(Boolean).join(" ");
16003
+ }
16004
+ function MosaicThreadIndicator(props) {
16005
+ const { replies, label, ariaLabel, onActivate, disabled = false, className, ref } = props;
16006
+ const unreadCount = replies.filter((reply) => reply.unread).length;
16007
+ return /* @__PURE__ */ jsxs(
16008
+ "button",
16009
+ {
16010
+ ref,
16011
+ "data-slot": "thread-indicator",
16012
+ type: "button",
16013
+ "aria-label": ariaLabel(unreadCount),
16014
+ className: cn107(threadIndicatorRootVariants(), className),
16015
+ disabled,
16016
+ onClick: onActivate,
16017
+ children: [
16018
+ /* @__PURE__ */ jsx("span", { "data-slot": "thread-indicator-label", children: label }),
16019
+ unreadCount > 0 && /* @__PURE__ */ jsx(
16020
+ "span",
16021
+ {
16022
+ "data-slot": "thread-indicator-count",
16023
+ "data-testid": "thread-indicator-count",
16024
+ className: threadIndicatorCountVariants(),
16025
+ children: unreadCount
16026
+ }
16027
+ )
16028
+ ]
16029
+ }
16030
+ );
16031
+ }
16032
+ MosaicThreadIndicator.displayName = "MosaicThreadIndicator";
16033
+ var mentionInputFieldVariants = cva([
16034
+ "flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm",
16035
+ "outline-none transition-colors placeholder:text-muted-foreground",
16036
+ "focus-visible:ring-1 focus-visible:ring-ring",
16037
+ "disabled:cursor-not-allowed disabled:opacity-50"
16038
+ ]);
16039
+ var mentionListVariants = cva(["m-0 max-h-64 list-none overflow-y-auto p-1"]);
16040
+ var mentionListItemVariants = cva(
16041
+ ["cursor-pointer rounded-sm px-2 py-1.5 text-sm outline-none"],
16042
+ {
16043
+ variants: {
16044
+ active: {
16045
+ true: "bg-accent text-accent-foreground",
16046
+ false: ""
16047
+ }
16048
+ },
16049
+ defaultVariants: {
16050
+ active: false
16051
+ }
16052
+ }
16053
+ );
16054
+ function cn108(...classes) {
16055
+ return classes.filter(Boolean).join(" ");
16056
+ }
16057
+ function findMentionStart(text, cursor, trigger) {
16058
+ for (let i = cursor - 1; i >= 0; i--) {
16059
+ const char = text[i];
16060
+ if (char === trigger) {
16061
+ return i;
16062
+ }
16063
+ if (/\s/.test(char)) {
16064
+ return null;
16065
+ }
16066
+ }
16067
+ return null;
16068
+ }
16069
+ function MosaicMentionInput({
16070
+ value,
16071
+ onValueChange,
16072
+ triggerCharacter,
16073
+ entries,
16074
+ renderEntry,
16075
+ getEntryText,
16076
+ onQueryChange,
16077
+ onSelectEntry,
16078
+ inputAriaLabel,
16079
+ listAriaLabel,
16080
+ emptyMessage,
16081
+ className,
16082
+ inputClassName
16083
+ }) {
16084
+ const inputRef = useRef(null);
16085
+ const [mentionStart, setMentionStart] = useState(null);
16086
+ const [activeIndex, setActiveIndex] = useState(0);
16087
+ const open = mentionStart !== null;
16088
+ function closeMention() {
16089
+ setMentionStart(null);
16090
+ setActiveIndex(0);
16091
+ onQueryChange(null);
16092
+ }
16093
+ function handleChange(event) {
16094
+ const nextValue = event.target.value;
16095
+ const cursor = event.target.selectionStart ?? nextValue.length;
16096
+ onValueChange(nextValue);
16097
+ const start = findMentionStart(nextValue, cursor, triggerCharacter);
16098
+ if (start === null) {
16099
+ if (open) {
16100
+ closeMention();
16101
+ }
16102
+ return;
16103
+ }
16104
+ setMentionStart(start);
16105
+ setActiveIndex(0);
16106
+ onQueryChange(nextValue.slice(start + triggerCharacter.length, cursor));
16107
+ }
16108
+ function selectEntry(entry) {
16109
+ if (mentionStart === null || !inputRef.current) {
16110
+ return;
16111
+ }
16112
+ const cursor = inputRef.current.selectionStart ?? value.length;
16113
+ const insertText = getEntryText(entry);
16114
+ const nextValue = `${value.slice(0, mentionStart)}${insertText} ${value.slice(cursor)}`;
16115
+ onValueChange(nextValue);
16116
+ onSelectEntry?.(entry);
16117
+ closeMention();
16118
+ }
16119
+ function handleKeyDown(event) {
16120
+ if (!open) {
16121
+ return;
16122
+ }
16123
+ if (event.key === "Escape") {
16124
+ event.preventDefault();
16125
+ closeMention();
16126
+ return;
16127
+ }
16128
+ if (event.key === "ArrowDown") {
16129
+ event.preventDefault();
16130
+ setActiveIndex((index) => Math.min(entries.length - 1, index + 1));
16131
+ return;
16132
+ }
16133
+ if (event.key === "ArrowUp") {
16134
+ event.preventDefault();
16135
+ setActiveIndex((index) => Math.max(0, index - 1));
16136
+ return;
16137
+ }
16138
+ if (event.key === "Enter") {
16139
+ const entry = entries[activeIndex];
16140
+ if (entry) {
16141
+ event.preventDefault();
16142
+ selectEntry(entry);
16143
+ }
16144
+ }
16145
+ }
16146
+ return /* @__PURE__ */ jsxs("div", { "data-slot": "mention-input", className, children: [
16147
+ /* @__PURE__ */ jsx(
16148
+ "input",
16149
+ {
16150
+ ref: inputRef,
16151
+ type: "text",
16152
+ "aria-label": inputAriaLabel,
16153
+ value,
16154
+ onChange: handleChange,
16155
+ onKeyDown: handleKeyDown,
16156
+ className: cn108(mentionInputFieldVariants(), inputClassName)
16157
+ }
16158
+ ),
16159
+ /* @__PURE__ */ jsx(
16160
+ MosaicPopover,
16161
+ {
16162
+ open,
16163
+ onOpenChange: (nextOpen) => {
16164
+ if (!nextOpen) {
16165
+ closeMention();
16166
+ }
16167
+ },
16168
+ anchor: inputRef,
16169
+ initialFocus: false,
16170
+ "aria-label": listAriaLabel,
16171
+ children: entries.length === 0 ? /* @__PURE__ */ jsx("p", { "data-slot": "mention-input-empty", className: "px-2 py-1.5 text-sm text-muted-foreground", children: emptyMessage }) : /* @__PURE__ */ jsx("ul", { "data-slot": "mention-input-list", className: mentionListVariants(), children: entries.map((entry, index) => /* @__PURE__ */ jsx(
16172
+ "li",
16173
+ {
16174
+ "data-slot": "mention-input-item",
16175
+ "aria-selected": index === activeIndex,
16176
+ className: mentionListItemVariants({ active: index === activeIndex }),
16177
+ onMouseEnter: () => setActiveIndex(index),
16178
+ onClick: () => selectEntry(entry),
16179
+ onKeyDown: (event) => {
16180
+ if (event.key === "Enter" || event.key === " ") {
16181
+ event.preventDefault();
16182
+ selectEntry(entry);
16183
+ }
16184
+ },
16185
+ children: renderEntry(entry, index, index === activeIndex)
16186
+ },
16187
+ entry.id
16188
+ )) })
16189
+ }
16190
+ )
16191
+ ] });
16192
+ }
16193
+ MosaicMentionInput.displayName = "MosaicMentionInput";
16194
+ function cn109(...classes) {
16195
+ return classes.filter(Boolean).join(" ");
16196
+ }
16197
+ function SearchIcon9() {
16198
+ return /* @__PURE__ */ jsxs(
16199
+ "svg",
16200
+ {
16201
+ xmlns: "http://www.w3.org/2000/svg",
16202
+ width: "16",
16203
+ height: "16",
16204
+ viewBox: "0 0 24 24",
16205
+ fill: "none",
16206
+ stroke: "currentColor",
16207
+ strokeWidth: "2",
16208
+ strokeLinecap: "round",
16209
+ strokeLinejoin: "round",
16210
+ "aria-hidden": "true",
16211
+ children: [
16212
+ /* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8" }),
16213
+ /* @__PURE__ */ jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
16214
+ ]
16215
+ }
16216
+ );
16217
+ }
16218
+ function ClearIcon2() {
16219
+ return /* @__PURE__ */ jsxs(
16220
+ "svg",
16221
+ {
16222
+ xmlns: "http://www.w3.org/2000/svg",
16223
+ width: "14",
16224
+ height: "14",
16225
+ viewBox: "0 0 24 24",
16226
+ fill: "none",
16227
+ stroke: "currentColor",
16228
+ strokeWidth: "2",
16229
+ strokeLinecap: "round",
16230
+ strokeLinejoin: "round",
16231
+ "aria-hidden": "true",
16232
+ children: [
16233
+ /* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
16234
+ /* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
16235
+ ]
16236
+ }
16237
+ );
16238
+ }
16239
+ function MosaicMessageSearch({
16240
+ query,
16241
+ onQueryChange,
16242
+ searchLabel,
16243
+ searchPlaceholder,
16244
+ clearButtonLabel,
16245
+ resultsSlot,
16246
+ emptyResultsLabel,
16247
+ className,
16248
+ ref
16249
+ }) {
16250
+ return /* @__PURE__ */ jsxs("div", { ref, "data-slot": "message-search", className: cn109("flex flex-col gap-2", className), children: [
16251
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
16252
+ /* @__PURE__ */ jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: /* @__PURE__ */ jsx(SearchIcon9, {}) }),
16253
+ /* @__PURE__ */ jsx(
16254
+ MosaicInput,
16255
+ {
16256
+ type: "search",
16257
+ "aria-label": searchLabel,
16258
+ placeholder: searchPlaceholder,
16259
+ value: query,
16260
+ onChange: (event) => onQueryChange(event.target.value),
16261
+ className: "pl-9 pr-9"
16262
+ }
16263
+ ),
16264
+ query.length > 0 && /* @__PURE__ */ jsx(
16265
+ "button",
16266
+ {
16267
+ type: "button",
16268
+ "aria-label": clearButtonLabel,
16269
+ onClick: () => onQueryChange(""),
16270
+ className: cn109(
16271
+ "absolute right-2 top-1/2 -translate-y-1/2",
16272
+ "flex size-5 items-center justify-center rounded-full",
16273
+ "text-muted-foreground hover:bg-muted hover:text-foreground",
16274
+ "focus-visible:outline-none focus-visible:ring-ring focus-visible:ring-[3px]"
16275
+ ),
16276
+ children: /* @__PURE__ */ jsx(ClearIcon2, {})
16277
+ }
16278
+ )
16279
+ ] }),
16280
+ resultsSlot ? /* @__PURE__ */ jsx("div", { "data-slot": "message-search-results", children: resultsSlot }) : emptyResultsLabel && /* @__PURE__ */ jsx("p", { "data-slot": "message-search-results", className: "text-sm text-muted-foreground", children: emptyResultsLabel })
16281
+ ] });
16282
+ }
16283
+ MosaicMessageSearch.displayName = "MosaicMessageSearch";
16284
+ var sessionCardVariants = cva(
16285
+ [
16286
+ "rounded-lg border border-border bg-card text-card-foreground shadow-sm transition-all",
16287
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
16288
+ ],
16289
+ {
16290
+ variants: {
16291
+ variant: {
16292
+ default: "p-5",
16293
+ compact: "flex items-center justify-between gap-3 p-3"
16294
+ },
16295
+ selectable: {
16296
+ true: "cursor-pointer hover:shadow-md",
16297
+ false: ""
16298
+ }
16299
+ },
16300
+ defaultVariants: {
16301
+ variant: "default",
16302
+ selectable: false
16303
+ }
16304
+ }
16305
+ );
16306
+ function cn110(...classes) {
16307
+ return classes.filter(Boolean).join(" ");
16308
+ }
16309
+ var ACTIVATION_KEYS = /* @__PURE__ */ new Set(["Enter", " "]);
16310
+ function MosaicSessionCard(props) {
16311
+ const { session, formatStatus, className, ref, onSelect, selectLabel } = props;
16312
+ const selectable = Boolean(onSelect);
16313
+ function activate() {
16314
+ onSelect?.(session.id);
16315
+ }
16316
+ const interactionProps = selectable ? {
16317
+ role: "button",
16318
+ tabIndex: 0,
16319
+ "aria-label": selectLabel,
16320
+ onClick: activate,
16321
+ onKeyDown: (event) => {
16322
+ if (ACTIVATION_KEYS.has(event.key)) {
16323
+ event.preventDefault();
16324
+ activate();
16325
+ }
16326
+ }
16327
+ } : {};
16328
+ const statusBadge = /* @__PURE__ */ jsx(MosaicBadge, { "data-slot": "session-card-status", children: formatStatus(session.status) });
16329
+ if (props.variant === "compact") {
16330
+ return /* @__PURE__ */ jsxs(
16331
+ MosaicCard,
16332
+ {
16333
+ ref,
16334
+ "data-slot": "session-card",
16335
+ "data-variant": "compact",
16336
+ className: cn110(sessionCardVariants({ variant: "compact", selectable }), className),
16337
+ ...interactionProps,
16338
+ children: [
16339
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-sm font-medium", children: session.title }),
16340
+ statusBadge
16341
+ ]
16342
+ }
16343
+ );
16344
+ }
16345
+ return /* @__PURE__ */ jsxs(
16346
+ MosaicCard,
16347
+ {
16348
+ ref,
16349
+ "data-slot": "session-card",
16350
+ "data-variant": "default",
16351
+ className: cn110(sessionCardVariants({ variant: "default", selectable }), className),
16352
+ ...interactionProps,
16353
+ children: [
16354
+ /* @__PURE__ */ jsxs(MosaicCardHeader, { className: "flex-row items-center justify-between gap-3 p-0", children: [
16355
+ /* @__PURE__ */ jsx("h3", { className: "line-clamp-1 text-base font-semibold", children: session.title }),
16356
+ statusBadge
16357
+ ] }),
16358
+ /* @__PURE__ */ jsx(MosaicCardContent, { className: "p-0 pt-3", children: /* @__PURE__ */ jsx(
16359
+ MosaicCardFooter,
16360
+ {
16361
+ "data-slot": "session-card-updated-at",
16362
+ className: "p-0 pt-2 text-xs text-muted-foreground",
16363
+ children: props.formatUpdatedAt(session.updatedAt)
16364
+ }
16365
+ ) })
16366
+ ]
16367
+ }
16368
+ );
16369
+ }
16370
+ MosaicSessionCard.displayName = "MosaicSessionCard";
16371
+ var sessionListVariants = cva([], {
16372
+ variants: {
16373
+ layout: {
16374
+ /** Single-column vertical stack, divided rows. */
16375
+ stack: "flex flex-col divide-y divide-border",
16376
+ /** Responsive tile grid. */
16377
+ grid: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
16378
+ /** Dense single-column stack — tighter row padding, no divider. */
16379
+ compact: "flex flex-col gap-1",
16380
+ /** Horizontal-scroll row of tiles. */
16381
+ inline: "flex flex-row gap-3 overflow-x-auto"
16382
+ }
16383
+ },
16384
+ defaultVariants: {
16385
+ layout: "stack"
16386
+ }
16387
+ });
16388
+ var sessionListItemVariants = cva([], {
16389
+ variants: {
16390
+ layout: {
16391
+ stack: "py-3",
16392
+ grid: "",
16393
+ compact: "py-1",
16394
+ inline: "shrink-0"
16395
+ }
16396
+ },
16397
+ defaultVariants: {
16398
+ layout: "stack"
16399
+ }
16400
+ });
16401
+ function cn111(...classes) {
16402
+ return classes.filter(Boolean).join(" ");
16403
+ }
16404
+ var NEXT_KEYS5 = /* @__PURE__ */ new Set(["ArrowRight", "ArrowDown"]);
16405
+ var PREV_KEYS5 = /* @__PURE__ */ new Set(["ArrowLeft", "ArrowUp"]);
16406
+ function MosaicSessionList({
16407
+ items,
16408
+ renderItem,
16409
+ layout = "stack",
16410
+ emptyMessage,
16411
+ className,
16412
+ itemClassName,
16413
+ ref
16414
+ }) {
16415
+ const itemRefs = useRef([]);
16416
+ const [focusedIndex, setFocusedIndex] = useState(0);
16417
+ function focusItem(index) {
16418
+ if (items.length === 0) {
16419
+ return;
16420
+ }
16421
+ const clamped = Math.max(0, Math.min(items.length - 1, index));
16422
+ setFocusedIndex(clamped);
16423
+ itemRefs.current[clamped]?.focus();
16424
+ }
16425
+ function handleKeyDown(event, index) {
16426
+ if (NEXT_KEYS5.has(event.key)) {
16427
+ event.preventDefault();
16428
+ focusItem(index + 1);
16429
+ } else if (PREV_KEYS5.has(event.key)) {
16430
+ event.preventDefault();
16431
+ focusItem(index - 1);
16432
+ } else if (event.key === "Home") {
16433
+ event.preventDefault();
16434
+ focusItem(0);
16435
+ } else if (event.key === "End") {
16436
+ event.preventDefault();
16437
+ focusItem(items.length - 1);
16438
+ }
16439
+ }
16440
+ if (items.length === 0) {
16441
+ return /* @__PURE__ */ jsx(
16442
+ "div",
16443
+ {
16444
+ ref,
16445
+ "data-slot": "session-list",
16446
+ "data-layout": layout,
16447
+ className: cn111(sessionListVariants({ layout }), className),
16448
+ children: /* @__PURE__ */ jsx(
16449
+ "p",
16450
+ {
16451
+ "data-slot": "session-list-empty",
16452
+ className: "py-12 text-center text-sm text-muted-foreground",
16453
+ children: emptyMessage
16454
+ }
16455
+ )
16456
+ }
16457
+ );
16458
+ }
16459
+ return /* @__PURE__ */ jsx(
16460
+ "ul",
16461
+ {
16462
+ ref,
16463
+ "data-slot": "session-list",
16464
+ "data-layout": layout,
16465
+ className: cn111("list-none", sessionListVariants({ layout }), className),
16466
+ children: items.map((item, index) => /* @__PURE__ */ jsx(
16467
+ "li",
16468
+ {
16469
+ ref: (node) => {
16470
+ itemRefs.current[index] = node;
16471
+ },
16472
+ "data-slot": "session-list-item",
16473
+ tabIndex: index === focusedIndex ? 0 : -1,
16474
+ onKeyDown: (event) => handleKeyDown(event, index),
16475
+ onFocus: () => setFocusedIndex(index),
16476
+ className: cn111(sessionListItemVariants({ layout }), itemClassName),
16477
+ children: renderItem(item, index)
16478
+ },
16479
+ item.id
16480
+ ))
16481
+ }
16482
+ );
16483
+ }
16484
+ MosaicSessionList.displayName = "MosaicSessionList";
16485
+ var editSessionDialogBodyVariants = cva(["flex flex-col gap-4"]);
16486
+ var editSessionDialogFieldVariants = cva(["flex flex-col gap-1.5"]);
16487
+ var editSessionDialogErrorVariants = cva(["text-xs font-medium text-destructive"]);
16488
+ var editSessionDialogFooterVariants = cva([
16489
+ "flex items-center justify-end gap-3 border-t border-border pt-4"
16490
+ ]);
16491
+ var editSessionDialogButtonVariants = cva(
16492
+ [
16493
+ "inline-flex min-h-9 items-center justify-center gap-2 rounded-md px-4 text-sm font-medium",
16494
+ "transition-colors disabled:cursor-not-allowed disabled:opacity-50"
16495
+ ],
16496
+ {
16497
+ variants: {
16498
+ intent: {
16499
+ cancel: "border border-border bg-background hover:bg-muted",
16500
+ save: "border border-transparent bg-primary text-primary-foreground hover:bg-primary/90"
16501
+ }
16502
+ },
16503
+ defaultVariants: {
16504
+ intent: "cancel"
16505
+ }
16506
+ }
16507
+ );
16508
+ function cn112(...classes) {
16509
+ return classes.filter(Boolean).join(" ");
16510
+ }
16511
+ function MosaicEditSessionDialog({
16512
+ open,
16513
+ onOpenChange,
16514
+ title,
16515
+ description,
16516
+ closeAriaLabel,
16517
+ name,
16518
+ onNameChange,
16519
+ nameLabel,
16520
+ namePlaceholder,
16521
+ nameError,
16522
+ classifications,
16523
+ classification,
16524
+ onClassificationChange,
16525
+ classificationLabel,
16526
+ isSaving,
16527
+ canSave,
16528
+ onSave,
16529
+ onCancel,
16530
+ saveButtonLabel,
16531
+ savingLabel,
16532
+ cancelButtonLabel,
16533
+ className
16534
+ }) {
16535
+ const nameErrorId = useId();
16536
+ if (!open) return null;
16537
+ return /* @__PURE__ */ jsx(
16538
+ MosaicAdaptiveModal,
16539
+ {
16540
+ isOpen: open,
16541
+ onClose: () => onOpenChange(false),
16542
+ title,
16543
+ description,
16544
+ closeAriaLabel,
16545
+ children: /* @__PURE__ */ jsxs(
16546
+ "div",
16547
+ {
16548
+ "data-slot": "edit-session-dialog",
16549
+ className: cn112(editSessionDialogBodyVariants(), className),
16550
+ children: [
16551
+ /* @__PURE__ */ jsxs("div", { className: editSessionDialogFieldVariants(), children: [
16552
+ /* @__PURE__ */ jsx("label", { htmlFor: "mosaic-edit-session-name", className: "text-sm font-medium text-foreground", children: nameLabel }),
16553
+ /* @__PURE__ */ jsx(
16554
+ MosaicInput,
16555
+ {
16556
+ id: "mosaic-edit-session-name",
16557
+ value: name,
16558
+ placeholder: namePlaceholder,
16559
+ onChange: (e) => onNameChange(e.target.value),
16560
+ "aria-invalid": nameError ? "true" : "false",
16561
+ "aria-describedby": nameError ? nameErrorId : void 0
16562
+ }
16563
+ ),
16564
+ nameError && /* @__PURE__ */ jsx("p", { id: nameErrorId, className: editSessionDialogErrorVariants(), children: nameError })
16565
+ ] }),
16566
+ /* @__PURE__ */ jsxs("div", { className: editSessionDialogFieldVariants(), children: [
16567
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: classificationLabel }),
16568
+ /* @__PURE__ */ jsx(
16569
+ MosaicSelect,
16570
+ {
16571
+ items: classifications,
16572
+ value: classification,
16573
+ onValueChange: (value) => {
16574
+ if (value) onClassificationChange(value);
16575
+ }
16576
+ }
16577
+ )
16578
+ ] }),
16579
+ /* @__PURE__ */ jsxs("div", { className: editSessionDialogFooterVariants(), children: [
16580
+ /* @__PURE__ */ jsx(
16581
+ "button",
16582
+ {
16583
+ type: "button",
16584
+ "data-slot": "edit-session-dialog-cancel-button",
16585
+ onClick: onCancel,
16586
+ disabled: isSaving,
16587
+ className: editSessionDialogButtonVariants({ intent: "cancel" }),
16588
+ children: cancelButtonLabel
16589
+ }
16590
+ ),
16591
+ /* @__PURE__ */ jsx(
16592
+ "button",
16593
+ {
16594
+ type: "button",
16595
+ "data-slot": "edit-session-dialog-save-button",
16596
+ onClick: onSave,
16597
+ disabled: !canSave || isSaving,
16598
+ "aria-busy": isSaving ? "true" : "false",
16599
+ className: editSessionDialogButtonVariants({ intent: "save" }),
16600
+ children: isSaving ? savingLabel : saveButtonLabel
16601
+ }
16602
+ )
16603
+ ] })
16604
+ ]
16605
+ }
16606
+ )
16607
+ }
16608
+ );
16609
+ }
16610
+ MosaicEditSessionDialog.displayName = "MosaicEditSessionDialog";
16611
+ var saveChatAsMemoryFormRootVariants = cva(["flex flex-col gap-4"]);
16612
+ var saveChatAsMemoryFormFieldVariants = cva(["flex flex-col gap-1.5"]);
16613
+ var saveChatAsMemoryFormErrorVariants = cva(["text-xs font-medium text-destructive"]);
16614
+ var saveChatAsMemoryFormFooterVariants = cva([
16615
+ "flex items-center justify-end gap-3 border-t border-border pt-4"
16616
+ ]);
16617
+ var saveChatAsMemoryFormButtonVariants = cva(
16618
+ [
16619
+ "inline-flex min-h-9 items-center justify-center gap-2 rounded-md px-4 text-sm font-medium",
16620
+ "transition-colors disabled:cursor-not-allowed disabled:opacity-50"
16621
+ ],
16622
+ {
16623
+ variants: {
16624
+ intent: {
16625
+ cancel: "border border-border bg-background hover:bg-muted",
16626
+ save: "border border-transparent bg-primary text-primary-foreground hover:bg-primary/90"
16627
+ }
16628
+ },
16629
+ defaultVariants: {
16630
+ intent: "cancel"
16631
+ }
16632
+ }
16633
+ );
16634
+ function cn113(...classes) {
16635
+ return classes.filter(Boolean).join(" ");
16636
+ }
16637
+ function MosaicSaveChatAsMemoryForm({
16638
+ title,
16639
+ onTitleChange,
16640
+ titleLabel,
16641
+ titlePlaceholder,
16642
+ titleError,
16643
+ content,
16644
+ onContentChange,
16645
+ contentLabel,
16646
+ contentPlaceholder,
16647
+ contentError,
16648
+ tags,
16649
+ onAddTag,
16650
+ onRemoveTag,
16651
+ tagsLabel,
16652
+ tagInputPlaceholder,
16653
+ removeTagAriaLabel,
16654
+ suggestedTags,
16655
+ maxTags,
16656
+ isSaving,
16657
+ canSave,
16658
+ onSave,
16659
+ onCancel,
16660
+ saveLabel,
16661
+ savingLabel,
16662
+ cancelLabel,
16663
+ className
16664
+ }) {
16665
+ const titleErrorId = useId();
16666
+ const contentErrorId = useId();
16667
+ return /* @__PURE__ */ jsxs(
16668
+ "div",
16669
+ {
16670
+ "data-slot": "save-chat-as-memory-form",
16671
+ className: cn113(saveChatAsMemoryFormRootVariants(), className),
16672
+ children: [
16673
+ /* @__PURE__ */ jsxs("div", { className: saveChatAsMemoryFormFieldVariants(), children: [
16674
+ /* @__PURE__ */ jsx(
16675
+ "label",
16676
+ {
16677
+ htmlFor: "mosaic-save-chat-as-memory-title",
16678
+ className: "text-sm font-medium text-foreground",
16679
+ children: titleLabel
16680
+ }
16681
+ ),
16682
+ /* @__PURE__ */ jsx(
16683
+ MosaicInput,
16684
+ {
16685
+ id: "mosaic-save-chat-as-memory-title",
16686
+ value: title,
16687
+ placeholder: titlePlaceholder,
16688
+ onChange: (e) => onTitleChange(e.target.value),
16689
+ "aria-invalid": titleError ? "true" : "false",
16690
+ "aria-describedby": titleError ? titleErrorId : void 0
16691
+ }
16692
+ ),
16693
+ titleError && /* @__PURE__ */ jsx("p", { id: titleErrorId, className: saveChatAsMemoryFormErrorVariants(), children: titleError })
16694
+ ] }),
16695
+ /* @__PURE__ */ jsxs("div", { className: saveChatAsMemoryFormFieldVariants(), children: [
16696
+ /* @__PURE__ */ jsx(
16697
+ "label",
16698
+ {
16699
+ htmlFor: "mosaic-save-chat-as-memory-content",
16700
+ className: "text-sm font-medium text-foreground",
16701
+ children: contentLabel
16702
+ }
16703
+ ),
16704
+ /* @__PURE__ */ jsx(
16705
+ MosaicTextarea,
16706
+ {
16707
+ id: "mosaic-save-chat-as-memory-content",
16708
+ value: content,
16709
+ placeholder: contentPlaceholder,
16710
+ onChange: (e) => onContentChange(e.target.value),
16711
+ rows: 4,
16712
+ "aria-invalid": contentError ? "true" : "false",
16713
+ "aria-describedby": contentError ? contentErrorId : void 0
16714
+ }
16715
+ ),
16716
+ contentError && /* @__PURE__ */ jsx("p", { id: contentErrorId, className: saveChatAsMemoryFormErrorVariants(), children: contentError })
16717
+ ] }),
16718
+ /* @__PURE__ */ jsxs("div", { className: saveChatAsMemoryFormFieldVariants(), children: [
16719
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: tagsLabel }),
16720
+ /* @__PURE__ */ jsx(
16721
+ MosaicTagInput,
16722
+ {
16723
+ tags,
16724
+ onAddTag,
16725
+ onRemoveTag,
16726
+ placeholder: tagInputPlaceholder,
16727
+ removeTagAriaLabel,
16728
+ suggestions: suggestedTags,
16729
+ maxTags
16730
+ }
16731
+ )
16732
+ ] }),
16733
+ /* @__PURE__ */ jsxs("div", { className: saveChatAsMemoryFormFooterVariants(), children: [
16734
+ /* @__PURE__ */ jsx(
16735
+ "button",
16736
+ {
16737
+ type: "button",
16738
+ "data-slot": "save-chat-as-memory-form-cancel-button",
16739
+ onClick: onCancel,
16740
+ disabled: isSaving,
16741
+ className: saveChatAsMemoryFormButtonVariants({ intent: "cancel" }),
16742
+ children: cancelLabel
16743
+ }
16744
+ ),
16745
+ /* @__PURE__ */ jsx(
16746
+ "button",
16747
+ {
16748
+ type: "button",
16749
+ "data-slot": "save-chat-as-memory-form-save-button",
16750
+ onClick: onSave,
16751
+ disabled: !canSave || isSaving,
16752
+ "aria-busy": isSaving ? "true" : "false",
16753
+ className: saveChatAsMemoryFormButtonVariants({ intent: "save" }),
16754
+ children: isSaving ? savingLabel : saveLabel
16755
+ }
16756
+ )
16757
+ ] })
16758
+ ]
16759
+ }
16760
+ );
16761
+ }
16762
+ MosaicSaveChatAsMemoryForm.displayName = "MosaicSaveChatAsMemoryForm";
15663
16763
 
15664
- export { MosaicAccordion, MosaicAccordionItem, MosaicAccordionPanel, MosaicAccordionTrigger, MosaicActivityFeed, MosaicActivityItem, MosaicAdaptiveGrid, MosaicAdaptiveModal, MosaicAdaptiveNavigation, MosaicAddMemoryForm, MosaicAgentBuilderModal, MosaicAgentCard, MosaicAgentChat, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, MosaicAgentEditor, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, MosaicAgentPreview, MosaicAgentTeamPreview, MosaicAlertDialog, MosaicAlertDialogAction, MosaicAlertDialogCancel, MosaicAlertDialogContent, MosaicAlertDialogDescription, MosaicAlertDialogFooter, MosaicAlertDialogHeader, MosaicAlertDialogOverlay, MosaicAlertDialogPortal, MosaicAlertDialogTitle, MosaicAlertDialogTrigger, MosaicAnimatedList, MosaicApiKeyPanel, MosaicAppSidebar, MosaicApprovalPrompt, MosaicAvatar, MosaicBadge, MosaicBlurredOrb, MosaicButton, MosaicCard, MosaicCardContent, MosaicCardDescription, MosaicCardFooter, MosaicCardHeader, MosaicCardTitle, MosaicChatComposer, MosaicChatMessage, MosaicChatSidebar, MosaicChatThread, MosaicCheckbox, MosaicClerkOrgSwitcher, MosaicClerkWebhookHandler, MosaicCollapsible, MosaicCollapsiblePanel, MosaicCollapsibleTrigger, MosaicCombobox, MosaicCounter, MosaicCreateOrgDialog, MosaicDashboardContent, MosaicDashboardHeader, MosaicDashboardLayout, MosaicDataTable, MosaicDeleteConfirmationDialog, MosaicDeviceProvider, MosaicDocumentUpload, MosaicDrawer, MosaicDropdownMenu, MosaicEditMemoryDialog, MosaicEmptyState, MosaicFallingPattern, MosaicFeature3Col, MosaicFeatureCenteredMedia, MosaicField, MosaicFieldControl, MosaicFieldDescription, MosaicFieldError, MosaicFieldLabel, MosaicFilterBar, MosaicFilterSidebar, MosaicFooterSimple, MosaicHeroSplit, MosaicInput, MosaicInputGroup, MosaicIntegrationsBadge, MosaicInviteMemberDialog, MosaicKanbanBoard, MosaicKanbanColumn, MosaicLogosGrid, MosaicMainNav, MosaicMarkdown, MosaicMarketplaceCard, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, MosaicMemberList, MosaicMemoryCard, MosaicMemoryDashboard, MosaicMemoryGrid, MosaicMemoryList, MosaicMessageCard, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, MosaicModelSelector, MosaicModuleCard, MosaicModuleForm, MosaicModuleLibrary, MosaicMultiOrgIndicator, MosaicMultiTenantProvider, MosaicNavbar, MosaicOrgPanel, MosaicOrgProfilePage, MosaicOrgRoleBadge, MosaicOrgSwitcher, MosaicPdfViewer, MosaicPopover, MosaicPreferencesPanel, MosaicPricingCard, MosaicProfilePanel, MosaicProgress, MosaicQuickActionCard, MosaicQuickActionsMenu, MosaicQuickAgentSelector, MosaicQuickStartPanel, MosaicRadioGroup, MosaicRadioGroupItem, MosaicResizableSplitPane, MosaicSaveTemplateModal, MosaicScrollArea, MosaicSelect, MosaicSelectorModal, MosaicSeparator, MosaicSignInLayout, MosaicSignUpLayout, MosaicSkeleton, MosaicSlider, MosaicStatsGrid, MosaicStepPipeline, MosaicSwitch, MosaicTabs, MosaicTabsList, MosaicTabsPanel, MosaicTabsTrigger, MosaicTagInput, MosaicTemplateAgentCard, MosaicTemplateCard, MosaicTemplateCategoryChips, MosaicTemplateGallery, MosaicTemplateList, MosaicTemplateManagementPanel, MosaicTemplatePreview, MosaicTestimonialsGrid, MosaicTextarea, MosaicThemeProvider, MosaicThemeToggle, MosaicToast, MosaicToastProvider, MosaicToolToggleList, MosaicTooltip, MosaicTooltipContent, MosaicTooltipProvider, MosaicTooltipRoot, MosaicTooltipTrigger, MosaicUrlScraper, MosaicUserButton, Placeholder, addMemoryFormButtonVariants, addMemoryFormErrorVariants, addMemoryFormFieldVariants, addMemoryFormFooterVariants, addMemoryFormRootVariants, agentBuilderModalBackdropVariants, agentBuilderModalPopupVariants, agentChatRootVariants, agentEditorVariants, agentPreviewVariants, alertDialogContentVariants, alertDialogOverlayVariants, badgeVariants, buttonVariants, chatMessageBubbleVariants, chatMessageContainerVariants, chatMessageToolStatusVariants, chatSidebarThreadVariants, drawerBackdropVariants, drawerPopupVariants, editMemoryDialogBackdropVariants, editMemoryDialogErrorVariants, editMemoryDialogFieldVariants, editMemoryDialogPopupVariants, marketplaceCardVariants, memoryDashboardViewToggleButtonVariants, memoryGridVariants, memoryListItemVariants, memoryListVariants, pdfViewerFrameVariants, pdfViewerStatusVariants, pdfViewerToolbarButtonVariants, popoverPopupVariants, saveTemplateModalBodyVariants, saveTemplateModalButtonVariants, saveTemplateModalErrorVariants, saveTemplateModalFieldVariants, saveTemplateModalFooterVariants, skeletonVariants, splitPaneCollapseButtonVariants, splitPaneHandleVariants, splitPaneRootVariants, tagInputFieldVariants, tagInputRemoveButtonVariants, tagInputRootVariants, tagInputTagVariants, templateAgentCardBadgeVariants, templateAgentCardTagVariants, templateAgentCardVariants, templateCategoryChipVariants, templateListVariants, templateManagementRowVariants, toastCardVariants, toastDismissButtonVariants, toastProviderPositionVariants, toastTitleVariants, toolToggleListRowVariants, toolToggleListSectionVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
16764
+ export { MosaicAccordion, MosaicAccordionItem, MosaicAccordionPanel, MosaicAccordionTrigger, MosaicActivityFeed, MosaicActivityItem, MosaicAdaptiveGrid, MosaicAdaptiveModal, MosaicAdaptiveNavigation, MosaicAddMemoryForm, MosaicAgentBuilderModal, MosaicAgentCard, MosaicAgentChat, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, MosaicAgentEditor, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, MosaicAgentPreview, MosaicAgentTeamPreview, MosaicAlertDialog, MosaicAlertDialogAction, MosaicAlertDialogCancel, MosaicAlertDialogContent, MosaicAlertDialogDescription, MosaicAlertDialogFooter, MosaicAlertDialogHeader, MosaicAlertDialogOverlay, MosaicAlertDialogPortal, MosaicAlertDialogTitle, MosaicAlertDialogTrigger, MosaicAnimatedList, MosaicApiKeyPanel, MosaicAppSidebar, MosaicApprovalPrompt, MosaicAvatar, MosaicBadge, MosaicBlurredOrb, MosaicButton, MosaicCard, MosaicCardContent, MosaicCardDescription, MosaicCardFooter, MosaicCardHeader, MosaicCardTitle, MosaicChatComposer, MosaicChatMessage, MosaicChatSidebar, MosaicChatThread, MosaicCheckbox, MosaicClerkOrgSwitcher, MosaicClerkWebhookHandler, MosaicCollapsible, MosaicCollapsiblePanel, MosaicCollapsibleTrigger, MosaicCombobox, MosaicCounter, MosaicCreateOrgDialog, MosaicDashboardContent, MosaicDashboardHeader, MosaicDashboardLayout, MosaicDataTable, MosaicDeleteConfirmationDialog, MosaicDeviceProvider, MosaicDocumentUpload, MosaicDrawer, MosaicDropdownMenu, MosaicEditMemoryDialog, MosaicEditSessionDialog, MosaicEmptyState, MosaicFallingPattern, MosaicFeature3Col, MosaicFeatureCenteredMedia, MosaicField, MosaicFieldControl, MosaicFieldDescription, MosaicFieldError, MosaicFieldLabel, MosaicFilterBar, MosaicFilterSidebar, MosaicFooterSimple, MosaicHeroSplit, MosaicInput, MosaicInputGroup, MosaicIntegrationsBadge, MosaicInviteMemberDialog, MosaicKanbanBoard, MosaicKanbanColumn, MosaicLogosGrid, MosaicMainNav, MosaicMarkdown, MosaicMarketplaceCard, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, MosaicMemberList, MosaicMemoryCard, MosaicMemoryDashboard, MosaicMemoryGrid, MosaicMemoryList, MosaicMemorySearch, MosaicMentionInput, MosaicMessageCard, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, MosaicMessageSearch, MosaicModelSelector, MosaicModuleCard, MosaicModuleForm, MosaicModuleLibrary, MosaicMultiOrgIndicator, MosaicMultiTenantProvider, MosaicNavbar, MosaicOrgPanel, MosaicOrgProfilePage, MosaicOrgRoleBadge, MosaicOrgSwitcher, MosaicPdfViewer, MosaicPopover, MosaicPreferencesPanel, MosaicPricingCard, MosaicProfilePanel, MosaicProgress, MosaicQuickActionCard, MosaicQuickActionsMenu, MosaicQuickAgentSelector, MosaicQuickStartPanel, MosaicRadioGroup, MosaicRadioGroupItem, MosaicReplyInput, MosaicResizableSplitPane, MosaicSaveChatAsMemoryForm, MosaicSaveTemplateModal, MosaicScrollArea, MosaicSelect, MosaicSelectorModal, MosaicSeparator, MosaicSessionCard, MosaicSessionList, MosaicSignInLayout, MosaicSignUpLayout, MosaicSkeleton, MosaicSlider, MosaicStatsGrid, MosaicStepPipeline, MosaicSwitch, MosaicTabs, MosaicTabsList, MosaicTabsPanel, MosaicTabsTrigger, MosaicTagInput, MosaicTemplateAgentCard, MosaicTemplateCard, MosaicTemplateCategoryChips, MosaicTemplateGallery, MosaicTemplateList, MosaicTemplateManagementPanel, MosaicTemplatePreview, MosaicTestimonialsGrid, MosaicTextarea, MosaicThemeProvider, MosaicThemeToggle, MosaicThreadIndicator, MosaicThreadView, MosaicToast, MosaicToastProvider, MosaicToolToggleList, MosaicTooltip, MosaicTooltipContent, MosaicTooltipProvider, MosaicTooltipRoot, MosaicTooltipTrigger, MosaicUrlScraper, MosaicUserButton, Placeholder, addMemoryFormButtonVariants, addMemoryFormErrorVariants, addMemoryFormFieldVariants, addMemoryFormFooterVariants, addMemoryFormRootVariants, agentBuilderModalBackdropVariants, agentBuilderModalPopupVariants, agentChatRootVariants, agentEditorVariants, agentPreviewVariants, alertDialogContentVariants, alertDialogOverlayVariants, badgeVariants, buttonVariants, chatMessageBubbleVariants, chatMessageContainerVariants, chatMessageToolStatusVariants, chatSidebarThreadVariants, drawerBackdropVariants, drawerPopupVariants, editMemoryDialogBackdropVariants, editMemoryDialogErrorVariants, editMemoryDialogFieldVariants, editMemoryDialogPopupVariants, editSessionDialogBodyVariants, editSessionDialogButtonVariants, editSessionDialogErrorVariants, editSessionDialogFieldVariants, editSessionDialogFooterVariants, marketplaceCardVariants, memoryDashboardViewToggleButtonVariants, memoryGridVariants, memoryListItemVariants, memoryListVariants, memorySearchFilterChipVariants, mentionInputFieldVariants, mentionListItemVariants, mentionListVariants, pdfViewerFrameVariants, pdfViewerStatusVariants, pdfViewerToolbarButtonVariants, popoverPopupVariants, replyInputActionButtonVariants, replyInputContextVariants, replyInputRootVariants, replyInputTextareaVariants, saveChatAsMemoryFormButtonVariants, saveChatAsMemoryFormErrorVariants, saveChatAsMemoryFormFieldVariants, saveChatAsMemoryFormFooterVariants, saveChatAsMemoryFormRootVariants, saveTemplateModalBodyVariants, saveTemplateModalButtonVariants, saveTemplateModalErrorVariants, saveTemplateModalFieldVariants, saveTemplateModalFooterVariants, sessionCardVariants, sessionListItemVariants, sessionListVariants, skeletonVariants, splitPaneCollapseButtonVariants, splitPaneHandleVariants, splitPaneRootVariants, tagInputFieldVariants, tagInputRemoveButtonVariants, tagInputRootVariants, tagInputTagVariants, templateAgentCardBadgeVariants, templateAgentCardTagVariants, templateAgentCardVariants, templateCategoryChipVariants, templateListVariants, templateManagementRowVariants, threadIndicatorCountVariants, threadIndicatorRootVariants, threadViewEmptyVariants, threadViewRepliesVariants, threadViewReplyVariants, threadViewRootMessageVariants, threadViewRootVariants, toastCardVariants, toastDismissButtonVariants, toastProviderPositionVariants, toastTitleVariants, toolToggleListRowVariants, toolToggleListSectionVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
15665
16765
  //# sourceMappingURL=index.js.map
15666
16766
  //# sourceMappingURL=index.js.map