@gram-ai/elements 1.20.0 → 1.20.1
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/components/Chat/index.d.ts +5 -1
- package/dist/components/Chat/stories/Variants.stories.d.ts +2 -1
- package/dist/components/assistant-ui/assistant-modal.d.ts +5 -1
- package/dist/components/assistant-ui/assistant-sidecar.d.ts +5 -1
- package/dist/components/assistant-ui/thread-list.d.ts +5 -1
- package/dist/components/assistant-ui/thread.d.ts +5 -1
- package/dist/elements.cjs +1 -1
- package/dist/elements.cjs.map +1 -1
- package/dist/elements.css +1 -1
- package/dist/elements.js +81 -77
- package/dist/elements.js.map +1 -1
- package/dist/index-B52U8PL6.cjs.map +1 -1
- package/dist/index-DaF9fGY-.js.map +1 -1
- package/package.json +4 -2
- package/src/components/Chat/index.tsx +8 -4
- package/src/components/Chat/stories/Variants.stories.tsx +28 -1
- package/src/components/assistant-ui/assistant-modal.tsx +7 -2
- package/src/components/assistant-ui/assistant-sidecar.tsx +7 -2
- package/src/components/assistant-ui/thread-list.tsx +8 -3
- package/src/components/assistant-ui/thread.tsx +7 -2
package/dist/elements.js
CHANGED
|
@@ -46385,32 +46385,33 @@ const rY = ({ children: e }) => {
|
|
|
46385
46385
|
),
|
|
46386
46386
|
" ",
|
|
46387
46387
|
"before deploying to production."
|
|
46388
|
-
] }), km = () => {
|
|
46389
|
-
const
|
|
46388
|
+
] }), km = ({ className: e }) => {
|
|
46389
|
+
const t = Im(), n = xr(), { config: i } = Pt(), r = i.components ?? {}, o = i.api && "UNSAFE_apiKey" in i.api;
|
|
46390
46390
|
return /* @__PURE__ */ g(rp, { features: XP, children: /* @__PURE__ */ g(vb, { reducedMotion: "user", children: /* @__PURE__ */ g(
|
|
46391
46391
|
x0,
|
|
46392
46392
|
{
|
|
46393
46393
|
className: Z(
|
|
46394
46394
|
"aui-root aui-thread-root bg-background @container flex h-full flex-col",
|
|
46395
|
-
|
|
46395
|
+
t.className,
|
|
46396
|
+
e
|
|
46396
46397
|
),
|
|
46397
46398
|
children: /* @__PURE__ */ J(
|
|
46398
46399
|
I0,
|
|
46399
46400
|
{
|
|
46400
46401
|
className: Z(
|
|
46401
46402
|
"aui-thread-viewport relative mx-auto flex w-full flex-1 flex-col overflow-x-auto overflow-y-scroll pb-0!",
|
|
46402
|
-
|
|
46403
|
+
n("p-lg")
|
|
46403
46404
|
),
|
|
46404
46405
|
children: [
|
|
46405
|
-
/* @__PURE__ */ g(Fo, { empty: !0, children:
|
|
46406
|
-
|
|
46406
|
+
/* @__PURE__ */ g(Fo, { empty: !0, children: r.ThreadWelcome ? /* @__PURE__ */ g(r.ThreadWelcome, {}) : /* @__PURE__ */ g(aY, {}) }),
|
|
46407
|
+
o && /* @__PURE__ */ g(iY, {}),
|
|
46407
46408
|
/* @__PURE__ */ g(
|
|
46408
46409
|
eF,
|
|
46409
46410
|
{
|
|
46410
46411
|
components: {
|
|
46411
|
-
UserMessage:
|
|
46412
|
-
EditComposer:
|
|
46413
|
-
AssistantMessage:
|
|
46412
|
+
UserMessage: r.UserMessage ?? mY,
|
|
46413
|
+
EditComposer: r.EditComposer ?? vY,
|
|
46414
|
+
AssistantMessage: r.AssistantMessage ?? pY
|
|
46414
46415
|
}
|
|
46415
46416
|
}
|
|
46416
46417
|
),
|
|
@@ -46807,14 +46808,15 @@ function yY({ className: e, ...t }) {
|
|
|
46807
46808
|
}
|
|
46808
46809
|
);
|
|
46809
46810
|
}
|
|
46810
|
-
const VP = () => {
|
|
46811
|
-
const
|
|
46811
|
+
const VP = ({ className: e }) => {
|
|
46812
|
+
const t = xr();
|
|
46812
46813
|
return /* @__PURE__ */ J(
|
|
46813
46814
|
P0,
|
|
46814
46815
|
{
|
|
46815
46816
|
className: Z(
|
|
46816
|
-
"aui-root aui-thread-list-root flex flex-col items-stretch",
|
|
46817
|
-
|
|
46817
|
+
"aui-root aui-thread-list-root bg-background flex flex-col items-stretch",
|
|
46818
|
+
t("gap-sm"),
|
|
46819
|
+
e
|
|
46818
46820
|
),
|
|
46819
46821
|
children: [
|
|
46820
46822
|
/* @__PURE__ */ g(
|
|
@@ -46822,8 +46824,8 @@ const VP = () => {
|
|
|
46822
46824
|
{
|
|
46823
46825
|
className: Z(
|
|
46824
46826
|
"aui-thread-list-new-section border-b pb-2",
|
|
46825
|
-
|
|
46826
|
-
|
|
46827
|
+
t("py-sm"),
|
|
46828
|
+
t("px-sm")
|
|
46827
46829
|
),
|
|
46828
46830
|
children: /* @__PURE__ */ g(bY, {})
|
|
46829
46831
|
}
|
|
@@ -46833,8 +46835,8 @@ const VP = () => {
|
|
|
46833
46835
|
{
|
|
46834
46836
|
className: Z(
|
|
46835
46837
|
"aui-thread-list-items-section flex flex-col gap-1",
|
|
46836
|
-
|
|
46837
|
-
|
|
46838
|
+
t("py-xs"),
|
|
46839
|
+
t("px-sm")
|
|
46838
46840
|
),
|
|
46839
46841
|
children: /* @__PURE__ */ g(_Y, {})
|
|
46840
46842
|
}
|
|
@@ -46904,49 +46906,50 @@ const VP = () => {
|
|
|
46904
46906
|
duration: 0.25,
|
|
46905
46907
|
ease: mr
|
|
46906
46908
|
}
|
|
46907
|
-
}, kY = () => {
|
|
46908
|
-
const { config:
|
|
46909
|
-
() =>
|
|
46909
|
+
}, kY = ({ className: e }) => {
|
|
46910
|
+
const { config: t } = Pt(), n = Im(), i = ji(), r = xr(), [o, a] = we(t.modal?.defaultOpen ?? !1), { expandable: s, isExpanded: u, setIsExpanded: l } = HP(), c = t.modal?.title, d = t.modal?.icon, f = t.history?.enabled && t.history?.showThreadList !== !1, p = t.modal?.position ?? "bottom-right", m = EY(p), h = xe(
|
|
46911
|
+
() => t.modal?.dimensions?.default ?? {
|
|
46910
46912
|
width: "500px",
|
|
46911
46913
|
height: "600px",
|
|
46912
46914
|
maxHeight: "95vh"
|
|
46913
46915
|
},
|
|
46914
|
-
[
|
|
46915
|
-
),
|
|
46916
|
-
() =>
|
|
46916
|
+
[t.modal?.dimensions?.default]
|
|
46917
|
+
), y = xe(
|
|
46918
|
+
() => t.modal?.dimensions?.expanded ?? {
|
|
46917
46919
|
width: "70vw",
|
|
46918
46920
|
height: "90vh"
|
|
46919
46921
|
},
|
|
46920
|
-
[
|
|
46921
|
-
),
|
|
46922
|
-
(
|
|
46923
|
-
),
|
|
46922
|
+
[t.modal?.dimensions?.expanded]
|
|
46923
|
+
), w = ee(({ thread: k }) => k).messages.some(
|
|
46924
|
+
(k) => k.status?.type === "running"
|
|
46925
|
+
), x = u ? y.width : h.width, b = u ? y.height : h.height, $ = h.maxHeight;
|
|
46924
46926
|
return /* @__PURE__ */ g(rp, { features: yb, children: /* @__PURE__ */ g(vb, { reducedMotion: "user", transition: IY, children: /* @__PURE__ */ g(
|
|
46925
46927
|
"div",
|
|
46926
46928
|
{
|
|
46927
46929
|
className: Z(
|
|
46928
46930
|
"aui-root aui-modal-anchor fixed z-10",
|
|
46929
|
-
|
|
46930
|
-
|
|
46931
|
-
|
|
46932
|
-
|
|
46931
|
+
m,
|
|
46932
|
+
n.className,
|
|
46933
|
+
i("lg"),
|
|
46934
|
+
o && "shadow-xl",
|
|
46935
|
+
e
|
|
46933
46936
|
),
|
|
46934
|
-
children: /* @__PURE__ */ g(QP, { mode: "wait", children:
|
|
46937
|
+
children: /* @__PURE__ */ g(QP, { mode: "wait", children: o ? /* @__PURE__ */ J(
|
|
46935
46938
|
Hn.div,
|
|
46936
46939
|
{
|
|
46937
46940
|
layout: !0,
|
|
46938
46941
|
layoutId: "chat-container",
|
|
46939
46942
|
className: Z(
|
|
46940
46943
|
"aui-modal-content bg-popover text-popover-foreground flex flex-col overflow-hidden border [&>.aui-thread-root]:bg-inherit",
|
|
46941
|
-
|
|
46944
|
+
i("lg")
|
|
46942
46945
|
),
|
|
46943
46946
|
initial: !1,
|
|
46944
46947
|
style: {
|
|
46945
|
-
originX:
|
|
46946
|
-
originY:
|
|
46947
|
-
width:
|
|
46948
|
-
height:
|
|
46949
|
-
maxHeight:
|
|
46948
|
+
originX: p.includes("left") ? 0 : 1,
|
|
46949
|
+
originY: p.includes("top") ? 0 : 1,
|
|
46950
|
+
width: x,
|
|
46951
|
+
height: b,
|
|
46952
|
+
maxHeight: $
|
|
46950
46953
|
},
|
|
46951
46954
|
children: [
|
|
46952
46955
|
/* @__PURE__ */ J(
|
|
@@ -46954,8 +46957,8 @@ const VP = () => {
|
|
|
46954
46957
|
{
|
|
46955
46958
|
className: Z(
|
|
46956
46959
|
"aui-modal-header flex shrink-0 items-center justify-between border-b",
|
|
46957
|
-
|
|
46958
|
-
|
|
46960
|
+
r("h-header"),
|
|
46961
|
+
r("px-lg")
|
|
46959
46962
|
),
|
|
46960
46963
|
initial: { opacity: 0 },
|
|
46961
46964
|
animate: { opacity: 1 },
|
|
@@ -46970,11 +46973,11 @@ const VP = () => {
|
|
|
46970
46973
|
{
|
|
46971
46974
|
className: Z(
|
|
46972
46975
|
"text-md flex items-center gap-2 truncate font-medium",
|
|
46973
|
-
|
|
46976
|
+
w && "shimmer"
|
|
46974
46977
|
),
|
|
46975
46978
|
children: [
|
|
46976
|
-
/* @__PURE__ */ g("span", { className: "truncate", children:
|
|
46977
|
-
|
|
46979
|
+
/* @__PURE__ */ g("span", { className: "truncate", children: c }),
|
|
46980
|
+
w && /* @__PURE__ */ g(
|
|
46978
46981
|
sl,
|
|
46979
46982
|
{
|
|
46980
46983
|
className: "text-muted-foreground size-4.5 animate-spin",
|
|
@@ -46985,17 +46988,17 @@ const VP = () => {
|
|
|
46985
46988
|
}
|
|
46986
46989
|
) }),
|
|
46987
46990
|
/* @__PURE__ */ J("div", { className: "flex flex-row items-center justify-end gap-1", children: [
|
|
46988
|
-
|
|
46991
|
+
s ? /* @__PURE__ */ g(
|
|
46989
46992
|
"button",
|
|
46990
46993
|
{
|
|
46991
46994
|
type: "button",
|
|
46992
|
-
onClick: () =>
|
|
46995
|
+
onClick: () => l((k) => !k),
|
|
46993
46996
|
className: Z(
|
|
46994
46997
|
"text-muted-foreground hover:text-foreground hover:bg-accent flex h-8 cursor-pointer items-center rounded-md px-2 text-xs transition-colors"
|
|
46995
46998
|
),
|
|
46996
|
-
"aria-pressed":
|
|
46997
|
-
"aria-label":
|
|
46998
|
-
children:
|
|
46999
|
+
"aria-pressed": u,
|
|
47000
|
+
"aria-label": u ? "Collapse assistant" : "Expand assistant",
|
|
47001
|
+
children: u ? /* @__PURE__ */ g(
|
|
46999
47002
|
RF,
|
|
47000
47003
|
{
|
|
47001
47004
|
strokeWidth: 2,
|
|
@@ -47014,10 +47017,10 @@ const VP = () => {
|
|
|
47014
47017
|
"button",
|
|
47015
47018
|
{
|
|
47016
47019
|
onClick: () => {
|
|
47017
|
-
|
|
47020
|
+
a(!1), l(!1);
|
|
47018
47021
|
},
|
|
47019
47022
|
className: "text-muted-foreground hover:text-foreground hover:bg-accent -mr-1 flex size-8 cursor-pointer items-center justify-center rounded-md transition-colors",
|
|
47020
|
-
"aria-label": `Close ${
|
|
47023
|
+
"aria-label": `Close ${c}`,
|
|
47021
47024
|
children: /* @__PURE__ */ g(za, { className: "size-4.5" })
|
|
47022
47025
|
}
|
|
47023
47026
|
)
|
|
@@ -47037,7 +47040,7 @@ const VP = () => {
|
|
|
47037
47040
|
ease: mr
|
|
47038
47041
|
},
|
|
47039
47042
|
children: [
|
|
47040
|
-
|
|
47043
|
+
f && /* @__PURE__ */ g("div", { className: "aui-modal-thread-list w-56 shrink-0 overflow-y-auto border-r", children: /* @__PURE__ */ g(VP, {}) }),
|
|
47041
47044
|
/* @__PURE__ */ g("div", { className: "aui-modal-thread w-full flex-1 overflow-hidden", children: /* @__PURE__ */ g(km, {}) })
|
|
47042
47045
|
]
|
|
47043
47046
|
}
|
|
@@ -47050,13 +47053,13 @@ const VP = () => {
|
|
|
47050
47053
|
{
|
|
47051
47054
|
layout: !0,
|
|
47052
47055
|
layoutId: "chat-container",
|
|
47053
|
-
onClick: () =>
|
|
47056
|
+
onClick: () => a(!0),
|
|
47054
47057
|
className: Z(
|
|
47055
47058
|
"aui-modal-button bg-primary text-primary-foreground flex size-12 cursor-pointer items-center justify-center border shadow-lg transition-shadow hover:shadow-xl",
|
|
47056
|
-
|
|
47059
|
+
i("full")
|
|
47057
47060
|
),
|
|
47058
47061
|
initial: !1,
|
|
47059
|
-
"aria-label": `Open ${
|
|
47062
|
+
"aria-label": `Open ${c}`,
|
|
47060
47063
|
style: { originX: 1, originY: 1 },
|
|
47061
47064
|
children: /* @__PURE__ */ g(
|
|
47062
47065
|
Hn.div,
|
|
@@ -47066,7 +47069,7 @@ const VP = () => {
|
|
|
47066
47069
|
exit: { opacity: 0, scale: 0.8 },
|
|
47067
47070
|
transition: { duration: 0.2, ease: mr },
|
|
47068
47071
|
className: "flex size-full items-center justify-center",
|
|
47069
|
-
children:
|
|
47072
|
+
children: d ? d("closed") : /* @__PURE__ */ g(PF, { className: "size-6" })
|
|
47070
47073
|
}
|
|
47071
47074
|
)
|
|
47072
47075
|
},
|
|
@@ -47089,25 +47092,26 @@ function EY(e) {
|
|
|
47089
47092
|
GP(e);
|
|
47090
47093
|
}
|
|
47091
47094
|
}
|
|
47092
|
-
const TY = () => {
|
|
47093
|
-
const { config:
|
|
47094
|
-
(
|
|
47095
|
-
),
|
|
47095
|
+
const TY = ({ className: e }) => {
|
|
47096
|
+
const { config: t } = Pt(), n = Im(), i = t.sidecar ?? {}, { title: r, dimensions: o } = i, { isExpanded: a, setIsExpanded: s } = HP(), l = ee(({ thread: d }) => d).messages.some(
|
|
47097
|
+
(d) => d.status?.type === "running"
|
|
47098
|
+
), c = t.history?.enabled && t.history?.showThreadList !== !1;
|
|
47096
47099
|
return /* @__PURE__ */ g(rp, { features: yb, children: /* @__PURE__ */ J(
|
|
47097
47100
|
Hn.div,
|
|
47098
47101
|
{
|
|
47099
47102
|
initial: {
|
|
47100
|
-
width:
|
|
47101
|
-
height:
|
|
47103
|
+
width: o?.default?.width ?? "400px",
|
|
47104
|
+
height: o?.default?.height ?? "100vh"
|
|
47102
47105
|
},
|
|
47103
47106
|
animate: {
|
|
47104
|
-
width:
|
|
47105
|
-
height:
|
|
47107
|
+
width: a ? o?.expanded?.width ?? "800px" : o?.default?.width ?? "400px",
|
|
47108
|
+
height: a ? o?.expanded?.height ?? "100%" : o?.default?.height ?? "100vh"
|
|
47106
47109
|
},
|
|
47107
47110
|
transition: { duration: 0.3, ease: mr },
|
|
47108
47111
|
className: Z(
|
|
47109
47112
|
"aui-root aui-sidecar bg-popover text-popover-foreground fixed top-0 right-0 border-l",
|
|
47110
|
-
|
|
47113
|
+
n.className,
|
|
47114
|
+
e
|
|
47111
47115
|
),
|
|
47112
47116
|
children: [
|
|
47113
47117
|
/* @__PURE__ */ J("div", { className: "aui-sidecar-header flex h-14 items-center justify-between border-b px-4", children: [
|
|
@@ -47116,11 +47120,11 @@ const TY = () => {
|
|
|
47116
47120
|
{
|
|
47117
47121
|
className: Z(
|
|
47118
47122
|
"text-md flex items-center gap-2 font-medium",
|
|
47119
|
-
|
|
47123
|
+
l && "shimmer"
|
|
47120
47124
|
),
|
|
47121
47125
|
children: [
|
|
47122
|
-
|
|
47123
|
-
|
|
47126
|
+
r,
|
|
47127
|
+
l && /* @__PURE__ */ g(
|
|
47124
47128
|
sl,
|
|
47125
47129
|
{
|
|
47126
47130
|
className: "text-muted-foreground size-4.5 animate-spin",
|
|
@@ -47133,31 +47137,31 @@ const TY = () => {
|
|
|
47133
47137
|
/* @__PURE__ */ g("div", { className: "aui-sidecar-header-actions flex items-center gap-1", children: /* @__PURE__ */ g(
|
|
47134
47138
|
on,
|
|
47135
47139
|
{
|
|
47136
|
-
tooltip:
|
|
47140
|
+
tooltip: a ? "Collapse" : "Pop out",
|
|
47137
47141
|
variant: "ghost",
|
|
47138
47142
|
className: "aui-sidecar-popout size-8",
|
|
47139
|
-
onClick: () =>
|
|
47140
|
-
children:
|
|
47143
|
+
onClick: () => s((d) => !d),
|
|
47144
|
+
children: a ? /* @__PURE__ */ g(MF, { className: "size-4.5" }) : /* @__PURE__ */ g(DF, { className: "size-4.5" })
|
|
47141
47145
|
}
|
|
47142
47146
|
) })
|
|
47143
47147
|
] }),
|
|
47144
47148
|
/* @__PURE__ */ J("div", { className: "aui-sidecar-body flex h-[calc(100%-3.5rem)] overflow-hidden", children: [
|
|
47145
|
-
|
|
47149
|
+
c && /* @__PURE__ */ g("div", { className: "aui-sidecar-thread-list w-56 shrink-0 overflow-y-auto border-r", children: /* @__PURE__ */ g(VP, {}) }),
|
|
47146
47150
|
/* @__PURE__ */ g("div", { className: "aui-sidecar-content flex-1 overflow-hidden", children: /* @__PURE__ */ g(km, {}) })
|
|
47147
47151
|
] })
|
|
47148
47152
|
]
|
|
47149
47153
|
}
|
|
47150
47154
|
) });
|
|
47151
|
-
}, XY = () => {
|
|
47152
|
-
const { config:
|
|
47153
|
-
switch (
|
|
47155
|
+
}, XY = ({ className: e }) => {
|
|
47156
|
+
const { config: t } = Pt();
|
|
47157
|
+
switch (t.variant) {
|
|
47154
47158
|
case "standalone":
|
|
47155
|
-
return /* @__PURE__ */ g(km, {});
|
|
47159
|
+
return /* @__PURE__ */ g(km, { className: e });
|
|
47156
47160
|
case "sidecar":
|
|
47157
|
-
return /* @__PURE__ */ g(TY, {});
|
|
47161
|
+
return /* @__PURE__ */ g(TY, { className: e });
|
|
47158
47162
|
// If no variant is provided then fallback to the modal
|
|
47159
47163
|
default:
|
|
47160
|
-
return /* @__PURE__ */ g(kY, {});
|
|
47164
|
+
return /* @__PURE__ */ g(kY, { className: e });
|
|
47161
47165
|
}
|
|
47162
47166
|
};
|
|
47163
47167
|
export {
|