@agentiffai/design 0.1.6 → 0.1.7
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/copilotkit/index.cjs +45 -24
- package/dist/copilotkit/index.cjs.map +1 -1
- package/dist/copilotkit/index.d.cts +9 -1
- package/dist/copilotkit/index.d.ts +9 -1
- package/dist/copilotkit/index.js +45 -24
- package/dist/copilotkit/index.js.map +1 -1
- package/dist/index.cjs +15 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/public/assets/avatar-transparent-bg.png +0 -0
|
@@ -14,6 +14,14 @@ interface CustomCopilotSidebarProps$1 {
|
|
|
14
14
|
onSetOpen?: (open: boolean) => void;
|
|
15
15
|
instructions?: string;
|
|
16
16
|
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* When true, disables the chat button and prevents opening the sidebar.
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Message to display as tooltip when disabled.
|
|
23
|
+
*/
|
|
24
|
+
disabledReason?: string;
|
|
17
25
|
}
|
|
18
26
|
/**
|
|
19
27
|
* CustomCopilotSidebar - A CopilotSidebar wrapper using our custom components
|
|
@@ -28,7 +36,7 @@ interface CustomCopilotSidebarProps$1 {
|
|
|
28
36
|
* </CustomCopilotSidebar>
|
|
29
37
|
* ```
|
|
30
38
|
*/
|
|
31
|
-
declare function CustomCopilotSidebar$1({ children, defaultOpen, onSetOpen, instructions, className, }: CustomCopilotSidebarProps$1): react_jsx_runtime.JSX.Element;
|
|
39
|
+
declare function CustomCopilotSidebar$1({ children, defaultOpen, onSetOpen, instructions, className, disabled, disabledReason, }: CustomCopilotSidebarProps$1): react_jsx_runtime.JSX.Element;
|
|
32
40
|
declare namespace CustomCopilotSidebar$1 {
|
|
33
41
|
var displayName: string;
|
|
34
42
|
}
|
|
@@ -14,6 +14,14 @@ interface CustomCopilotSidebarProps$1 {
|
|
|
14
14
|
onSetOpen?: (open: boolean) => void;
|
|
15
15
|
instructions?: string;
|
|
16
16
|
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* When true, disables the chat button and prevents opening the sidebar.
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Message to display as tooltip when disabled.
|
|
23
|
+
*/
|
|
24
|
+
disabledReason?: string;
|
|
17
25
|
}
|
|
18
26
|
/**
|
|
19
27
|
* CustomCopilotSidebar - A CopilotSidebar wrapper using our custom components
|
|
@@ -28,7 +36,7 @@ interface CustomCopilotSidebarProps$1 {
|
|
|
28
36
|
* </CustomCopilotSidebar>
|
|
29
37
|
* ```
|
|
30
38
|
*/
|
|
31
|
-
declare function CustomCopilotSidebar$1({ children, defaultOpen, onSetOpen, instructions, className, }: CustomCopilotSidebarProps$1): react_jsx_runtime.JSX.Element;
|
|
39
|
+
declare function CustomCopilotSidebar$1({ children, defaultOpen, onSetOpen, instructions, className, disabled, disabledReason, }: CustomCopilotSidebarProps$1): react_jsx_runtime.JSX.Element;
|
|
32
40
|
declare namespace CustomCopilotSidebar$1 {
|
|
33
41
|
var displayName: string;
|
|
34
42
|
}
|
package/dist/copilotkit/index.js
CHANGED
|
@@ -481,25 +481,24 @@ var Avatar = styled4.img`
|
|
|
481
481
|
height: 32px;
|
|
482
482
|
border-radius: 50%;
|
|
483
483
|
object-fit: cover;
|
|
484
|
-
background-color:
|
|
484
|
+
background-color: transparent;
|
|
485
485
|
`;
|
|
486
486
|
var AvatarInitials = styled4.div`
|
|
487
487
|
width: 32px;
|
|
488
488
|
height: 32px;
|
|
489
489
|
border-radius: 50%;
|
|
490
|
-
|
|
491
|
-
color: white;
|
|
490
|
+
overflow: hidden;
|
|
492
491
|
display: flex;
|
|
493
492
|
align-items: center;
|
|
494
493
|
justify-content: center;
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
494
|
+
background-color: #1e3a5f; /* Dark blue background */
|
|
495
|
+
padding: 4px; /* Make the avatar image smaller inside the circle */
|
|
496
|
+
box-sizing: border-box;
|
|
499
497
|
|
|
500
|
-
|
|
501
|
-
width:
|
|
502
|
-
height:
|
|
498
|
+
img {
|
|
499
|
+
width: 100%;
|
|
500
|
+
height: 100%;
|
|
501
|
+
object-fit: contain;
|
|
503
502
|
}
|
|
504
503
|
`;
|
|
505
504
|
var ContentContainer = styled4.div`
|
|
@@ -841,7 +840,7 @@ var AssistantMessage = ({
|
|
|
841
840
|
] });
|
|
842
841
|
};
|
|
843
842
|
return /* @__PURE__ */ jsxs(MessageContainer, { className, children: [
|
|
844
|
-
/* @__PURE__ */ jsx(AvatarContainer, { children: avatarUrl ? /* @__PURE__ */ jsx(Avatar, { src: avatarUrl, alt: "Assistant avatar" }) : /* @__PURE__ */ jsx(AvatarInitials, { children: /* @__PURE__ */ jsx(
|
|
843
|
+
/* @__PURE__ */ jsx(AvatarContainer, { children: avatarUrl ? /* @__PURE__ */ jsx(Avatar, { src: avatarUrl, alt: "Assistant avatar" }) : /* @__PURE__ */ jsx(AvatarInitials, { children: /* @__PURE__ */ jsx(Avatar, { src: "/assets/avatar-transparent-bg.png", alt: "AI Assistant" }) }) }),
|
|
845
844
|
/* @__PURE__ */ jsx(ContentContainer, { children: renderContent() })
|
|
846
845
|
] });
|
|
847
846
|
};
|
|
@@ -1307,7 +1306,8 @@ var InputWrapper = styled4.div`
|
|
|
1307
1306
|
box-sizing: border-box;
|
|
1308
1307
|
|
|
1309
1308
|
&:focus-within {
|
|
1310
|
-
|
|
1309
|
+
/* Subtle focus indication without bold colored border */
|
|
1310
|
+
border-color: rgba(255, 255, 255, 0.3);
|
|
1311
1311
|
background-color: rgba(50, 50, 52, 0.6);
|
|
1312
1312
|
}
|
|
1313
1313
|
`;
|
|
@@ -1561,9 +1561,7 @@ var InputAdapter = ({
|
|
|
1561
1561
|
autoFocus: isVisible,
|
|
1562
1562
|
"aria-label": "Chat message input",
|
|
1563
1563
|
suggestions: [
|
|
1564
|
-
{ text: "
|
|
1565
|
-
{ text: "Identify actionable tasks" },
|
|
1566
|
-
{ text: "Summarize key points" }
|
|
1564
|
+
{ text: "Explore workflows" }
|
|
1567
1565
|
],
|
|
1568
1566
|
onSuggestionSelect: handleSuggestionSelect
|
|
1569
1567
|
}
|
|
@@ -1973,11 +1971,22 @@ var GlobalSidebarStyles = createGlobalStyle`
|
|
|
1973
1971
|
flex-shrink: 0 !important;
|
|
1974
1972
|
white-space: nowrap !important;
|
|
1975
1973
|
}
|
|
1974
|
+
|
|
1975
|
+
/* Remove teal/cyan outline from all inputs */
|
|
1976
|
+
.copilotKitSidebar input,
|
|
1977
|
+
.copilotKitSidebar input:focus,
|
|
1978
|
+
.copilotKitSidebar input:focus-visible,
|
|
1979
|
+
.copilotKitSidebar textarea,
|
|
1980
|
+
.copilotKitSidebar textarea:focus,
|
|
1981
|
+
.copilotKitSidebar textarea:focus-visible {
|
|
1982
|
+
outline: none !important;
|
|
1983
|
+
outline-color: transparent !important;
|
|
1984
|
+
box-shadow: none !important;
|
|
1985
|
+
}
|
|
1976
1986
|
`;
|
|
1977
1987
|
var StyledChatButton = styled4.button`
|
|
1978
1988
|
position: fixed;
|
|
1979
|
-
|
|
1980
|
-
bottom: max(88px, calc(env(safe-area-inset-bottom, 80px) + 8px));
|
|
1989
|
+
bottom: 8px;
|
|
1981
1990
|
right: 8px;
|
|
1982
1991
|
width: 36px;
|
|
1983
1992
|
height: 36px;
|
|
@@ -2012,7 +2021,9 @@ function CustomCopilotSidebar({
|
|
|
2012
2021
|
defaultOpen = false,
|
|
2013
2022
|
onSetOpen,
|
|
2014
2023
|
instructions,
|
|
2015
|
-
className
|
|
2024
|
+
className,
|
|
2025
|
+
disabled = false,
|
|
2026
|
+
disabledReason = "Start a free trial to enable AI chat"
|
|
2016
2027
|
}) {
|
|
2017
2028
|
const HeaderAdapterWithClose = (_props) => {
|
|
2018
2029
|
const { setOpen } = useChatContext();
|
|
@@ -2028,16 +2039,26 @@ function CustomCopilotSidebar({
|
|
|
2028
2039
|
const CustomButton = (_props) => {
|
|
2029
2040
|
const { open, setOpen } = useChatContext();
|
|
2030
2041
|
const handleClick = () => {
|
|
2042
|
+
if (disabled) return;
|
|
2031
2043
|
const newOpenState = !open;
|
|
2032
2044
|
setOpen(newOpenState);
|
|
2033
2045
|
onSetOpen?.(newOpenState);
|
|
2034
2046
|
};
|
|
2047
|
+
const disabledStyles = disabled ? {
|
|
2048
|
+
background: "rgba(100, 100, 100, 0.5)",
|
|
2049
|
+
boxShadow: "none",
|
|
2050
|
+
cursor: "not-allowed",
|
|
2051
|
+
opacity: 0.6
|
|
2052
|
+
} : {};
|
|
2035
2053
|
return /* @__PURE__ */ jsx(
|
|
2036
2054
|
StyledChatButton,
|
|
2037
2055
|
{
|
|
2038
2056
|
onClick: handleClick,
|
|
2039
|
-
"aria-label": open ? "Close chat" : "Open chat",
|
|
2057
|
+
"aria-label": disabled ? disabledReason : open ? "Close chat" : "Open chat",
|
|
2058
|
+
"aria-disabled": disabled,
|
|
2059
|
+
title: disabled ? disabledReason : void 0,
|
|
2040
2060
|
type: "button",
|
|
2061
|
+
style: disabledStyles,
|
|
2041
2062
|
children: /* @__PURE__ */ jsxs(
|
|
2042
2063
|
"svg",
|
|
2043
2064
|
{
|
|
@@ -2047,7 +2068,8 @@ function CustomCopilotSidebar({
|
|
|
2047
2068
|
fill: "currentColor",
|
|
2048
2069
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2049
2070
|
role: "img",
|
|
2050
|
-
"aria-
|
|
2071
|
+
"aria-hidden": "true",
|
|
2072
|
+
style: disabled ? { fill: "rgba(255, 255, 255, 0.5)" } : void 0,
|
|
2051
2073
|
children: [
|
|
2052
2074
|
/* @__PURE__ */ jsx("title", { children: "Chat" }),
|
|
2053
2075
|
/* @__PURE__ */ jsx("path", { d: "M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z" })
|
|
@@ -2189,8 +2211,8 @@ var InputWrapper2 = styled4.div`
|
|
|
2189
2211
|
transition: all 0.2s ease;
|
|
2190
2212
|
|
|
2191
2213
|
&:focus-within {
|
|
2192
|
-
border
|
|
2193
|
-
|
|
2214
|
+
/* Subtle focus indication without bold colored border */
|
|
2215
|
+
border-color: rgba(255, 255, 255, 0.3);
|
|
2194
2216
|
}
|
|
2195
2217
|
|
|
2196
2218
|
&:hover:not(:focus-within) {
|
|
@@ -2269,8 +2291,7 @@ var SendButton = styled4.button`
|
|
|
2269
2291
|
}
|
|
2270
2292
|
|
|
2271
2293
|
&:focus-visible {
|
|
2272
|
-
outline:
|
|
2273
|
-
outline-offset: 2px;
|
|
2294
|
+
outline: none;
|
|
2274
2295
|
}
|
|
2275
2296
|
|
|
2276
2297
|
svg {
|