@arc-lo/ui 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +70 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +70 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -151,6 +151,10 @@ interface PromptBoxFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
151
151
|
}
|
|
152
152
|
declare const Footer: react.ForwardRefExoticComponent<PromptBoxFooterProps & react.RefAttributes<HTMLDivElement>>;
|
|
153
153
|
interface PromptBoxSubmitProps extends HTMLAttributes<HTMLButtonElement> {
|
|
154
|
+
/** Visual variant. "default" = text, "icon" = arrow icon only, "icon-text" = icon + text. Default: "default" */
|
|
155
|
+
variant?: "default" | "icon" | "icon-text";
|
|
156
|
+
/** Custom loading label. Default: "Sending..." */
|
|
157
|
+
loadingLabel?: string;
|
|
154
158
|
}
|
|
155
159
|
declare const SubmitButton: react.ForwardRefExoticComponent<PromptBoxSubmitProps & react.RefAttributes<HTMLButtonElement>>;
|
|
156
160
|
interface PromptBoxSuggestionsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
@@ -314,9 +318,26 @@ declare const SystemMessage: react.ForwardRefExoticComponent<ChatThreadSystemMes
|
|
|
314
318
|
interface ChatThreadScrollAnchorProps extends HTMLAttributes<HTMLDivElement> {
|
|
315
319
|
}
|
|
316
320
|
declare const ScrollAnchor: react.ForwardRefExoticComponent<ChatThreadScrollAnchorProps & react.RefAttributes<HTMLDivElement>>;
|
|
321
|
+
interface ChatThreadAvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
322
|
+
/** Image URL for the avatar */
|
|
323
|
+
src?: string;
|
|
324
|
+
/** Initials to display when no src is provided */
|
|
325
|
+
initials?: string;
|
|
326
|
+
/** Custom icon element */
|
|
327
|
+
icon?: ReactNode;
|
|
328
|
+
/** Background color. Default: accent for assistant, surface-secondary for user */
|
|
329
|
+
color?: string;
|
|
330
|
+
/** Text/icon color. Default: auto based on background */
|
|
331
|
+
textColor?: string;
|
|
332
|
+
/** Size in px. Default: 28 */
|
|
333
|
+
size?: number;
|
|
334
|
+
}
|
|
335
|
+
declare const Avatar: react.ForwardRefExoticComponent<ChatThreadAvatarProps & react.RefAttributes<HTMLDivElement>>;
|
|
317
336
|
|
|
318
337
|
declare const index$2_AssistantMessage: typeof AssistantMessage;
|
|
338
|
+
declare const index$2_Avatar: typeof Avatar;
|
|
319
339
|
type index$2_ChatThreadAssistantMessageProps = ChatThreadAssistantMessageProps;
|
|
340
|
+
type index$2_ChatThreadAvatarProps = ChatThreadAvatarProps;
|
|
320
341
|
type index$2_ChatThreadMessageProps = ChatThreadMessageProps;
|
|
321
342
|
type index$2_ChatThreadMessagesProps = ChatThreadMessagesProps;
|
|
322
343
|
type index$2_ChatThreadRootProps = ChatThreadRootProps;
|
|
@@ -330,7 +351,7 @@ declare const index$2_ScrollAnchor: typeof ScrollAnchor;
|
|
|
330
351
|
declare const index$2_SystemMessage: typeof SystemMessage;
|
|
331
352
|
declare const index$2_UserMessage: typeof UserMessage;
|
|
332
353
|
declare namespace index$2 {
|
|
333
|
-
export { index$2_AssistantMessage as AssistantMessage, type index$2_ChatThreadAssistantMessageProps as ChatThreadAssistantMessageProps, type index$2_ChatThreadMessageProps as ChatThreadMessageProps, type index$2_ChatThreadMessagesProps as ChatThreadMessagesProps, type index$2_ChatThreadRootProps as ChatThreadRootProps, type index$2_ChatThreadScrollAnchorProps as ChatThreadScrollAnchorProps, type index$2_ChatThreadSystemMessageProps as ChatThreadSystemMessageProps, type index$2_ChatThreadUserMessageProps as ChatThreadUserMessageProps, index$2_Message as Message, type index$2_MessageRole as MessageRole, index$2_Messages as Messages, Root$2 as Root, index$2_ScrollAnchor as ScrollAnchor, index$2_SystemMessage as SystemMessage, index$2_UserMessage as UserMessage };
|
|
354
|
+
export { index$2_AssistantMessage as AssistantMessage, index$2_Avatar as Avatar, type index$2_ChatThreadAssistantMessageProps as ChatThreadAssistantMessageProps, type index$2_ChatThreadAvatarProps as ChatThreadAvatarProps, type index$2_ChatThreadMessageProps as ChatThreadMessageProps, type index$2_ChatThreadMessagesProps as ChatThreadMessagesProps, type index$2_ChatThreadRootProps as ChatThreadRootProps, type index$2_ChatThreadScrollAnchorProps as ChatThreadScrollAnchorProps, type index$2_ChatThreadSystemMessageProps as ChatThreadSystemMessageProps, type index$2_ChatThreadUserMessageProps as ChatThreadUserMessageProps, index$2_Message as Message, type index$2_MessageRole as MessageRole, index$2_Messages as Messages, Root$2 as Root, index$2_ScrollAnchor as ScrollAnchor, index$2_SystemMessage as SystemMessage, index$2_UserMessage as UserMessage };
|
|
334
355
|
}
|
|
335
356
|
|
|
336
357
|
interface ImageGenRootProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
package/dist/index.d.ts
CHANGED
|
@@ -151,6 +151,10 @@ interface PromptBoxFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
151
151
|
}
|
|
152
152
|
declare const Footer: react.ForwardRefExoticComponent<PromptBoxFooterProps & react.RefAttributes<HTMLDivElement>>;
|
|
153
153
|
interface PromptBoxSubmitProps extends HTMLAttributes<HTMLButtonElement> {
|
|
154
|
+
/** Visual variant. "default" = text, "icon" = arrow icon only, "icon-text" = icon + text. Default: "default" */
|
|
155
|
+
variant?: "default" | "icon" | "icon-text";
|
|
156
|
+
/** Custom loading label. Default: "Sending..." */
|
|
157
|
+
loadingLabel?: string;
|
|
154
158
|
}
|
|
155
159
|
declare const SubmitButton: react.ForwardRefExoticComponent<PromptBoxSubmitProps & react.RefAttributes<HTMLButtonElement>>;
|
|
156
160
|
interface PromptBoxSuggestionsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
@@ -314,9 +318,26 @@ declare const SystemMessage: react.ForwardRefExoticComponent<ChatThreadSystemMes
|
|
|
314
318
|
interface ChatThreadScrollAnchorProps extends HTMLAttributes<HTMLDivElement> {
|
|
315
319
|
}
|
|
316
320
|
declare const ScrollAnchor: react.ForwardRefExoticComponent<ChatThreadScrollAnchorProps & react.RefAttributes<HTMLDivElement>>;
|
|
321
|
+
interface ChatThreadAvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
322
|
+
/** Image URL for the avatar */
|
|
323
|
+
src?: string;
|
|
324
|
+
/** Initials to display when no src is provided */
|
|
325
|
+
initials?: string;
|
|
326
|
+
/** Custom icon element */
|
|
327
|
+
icon?: ReactNode;
|
|
328
|
+
/** Background color. Default: accent for assistant, surface-secondary for user */
|
|
329
|
+
color?: string;
|
|
330
|
+
/** Text/icon color. Default: auto based on background */
|
|
331
|
+
textColor?: string;
|
|
332
|
+
/** Size in px. Default: 28 */
|
|
333
|
+
size?: number;
|
|
334
|
+
}
|
|
335
|
+
declare const Avatar: react.ForwardRefExoticComponent<ChatThreadAvatarProps & react.RefAttributes<HTMLDivElement>>;
|
|
317
336
|
|
|
318
337
|
declare const index$2_AssistantMessage: typeof AssistantMessage;
|
|
338
|
+
declare const index$2_Avatar: typeof Avatar;
|
|
319
339
|
type index$2_ChatThreadAssistantMessageProps = ChatThreadAssistantMessageProps;
|
|
340
|
+
type index$2_ChatThreadAvatarProps = ChatThreadAvatarProps;
|
|
320
341
|
type index$2_ChatThreadMessageProps = ChatThreadMessageProps;
|
|
321
342
|
type index$2_ChatThreadMessagesProps = ChatThreadMessagesProps;
|
|
322
343
|
type index$2_ChatThreadRootProps = ChatThreadRootProps;
|
|
@@ -330,7 +351,7 @@ declare const index$2_ScrollAnchor: typeof ScrollAnchor;
|
|
|
330
351
|
declare const index$2_SystemMessage: typeof SystemMessage;
|
|
331
352
|
declare const index$2_UserMessage: typeof UserMessage;
|
|
332
353
|
declare namespace index$2 {
|
|
333
|
-
export { index$2_AssistantMessage as AssistantMessage, type index$2_ChatThreadAssistantMessageProps as ChatThreadAssistantMessageProps, type index$2_ChatThreadMessageProps as ChatThreadMessageProps, type index$2_ChatThreadMessagesProps as ChatThreadMessagesProps, type index$2_ChatThreadRootProps as ChatThreadRootProps, type index$2_ChatThreadScrollAnchorProps as ChatThreadScrollAnchorProps, type index$2_ChatThreadSystemMessageProps as ChatThreadSystemMessageProps, type index$2_ChatThreadUserMessageProps as ChatThreadUserMessageProps, index$2_Message as Message, type index$2_MessageRole as MessageRole, index$2_Messages as Messages, Root$2 as Root, index$2_ScrollAnchor as ScrollAnchor, index$2_SystemMessage as SystemMessage, index$2_UserMessage as UserMessage };
|
|
354
|
+
export { index$2_AssistantMessage as AssistantMessage, index$2_Avatar as Avatar, type index$2_ChatThreadAssistantMessageProps as ChatThreadAssistantMessageProps, type index$2_ChatThreadAvatarProps as ChatThreadAvatarProps, type index$2_ChatThreadMessageProps as ChatThreadMessageProps, type index$2_ChatThreadMessagesProps as ChatThreadMessagesProps, type index$2_ChatThreadRootProps as ChatThreadRootProps, type index$2_ChatThreadScrollAnchorProps as ChatThreadScrollAnchorProps, type index$2_ChatThreadSystemMessageProps as ChatThreadSystemMessageProps, type index$2_ChatThreadUserMessageProps as ChatThreadUserMessageProps, index$2_Message as Message, type index$2_MessageRole as MessageRole, index$2_Messages as Messages, Root$2 as Root, index$2_ScrollAnchor as ScrollAnchor, index$2_SystemMessage as SystemMessage, index$2_UserMessage as UserMessage };
|
|
334
355
|
}
|
|
335
356
|
|
|
336
357
|
interface ImageGenRootProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
package/dist/index.js
CHANGED
|
@@ -632,10 +632,16 @@ var Footer = forwardRef(
|
|
|
632
632
|
}
|
|
633
633
|
);
|
|
634
634
|
Footer.displayName = "PromptBox.Footer";
|
|
635
|
+
var ArrowUpIcon = () => /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M12 19V5M5 12l7-7 7 7" }) });
|
|
635
636
|
var SubmitButton = forwardRef(
|
|
636
|
-
({ children, className, ...props }, ref) => {
|
|
637
|
+
({ children, variant = "default", loadingLabel, className, ...props }, ref) => {
|
|
637
638
|
const { value, isSubmitting, disabled } = usePromptBoxContext();
|
|
638
639
|
const isEmpty = !value.trim();
|
|
640
|
+
const isIcon = variant === "icon";
|
|
641
|
+
const content = children ?? (isIcon ? isSubmitting ? /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", className: "animate-spin", children: /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }) : /* @__PURE__ */ jsx(ArrowUpIcon, {}) : variant === "icon-text" ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
642
|
+
isSubmitting ? /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", className: "animate-spin", children: /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }) : /* @__PURE__ */ jsx(ArrowUpIcon, {}),
|
|
643
|
+
isSubmitting ? loadingLabel ?? "Sending..." : "Send"
|
|
644
|
+
] }) : isSubmitting ? loadingLabel ?? "Sending..." : "Send");
|
|
639
645
|
return /* @__PURE__ */ jsx(
|
|
640
646
|
"button",
|
|
641
647
|
{
|
|
@@ -644,11 +650,12 @@ var SubmitButton = forwardRef(
|
|
|
644
650
|
disabled: isEmpty || isSubmitting || disabled,
|
|
645
651
|
style: { backgroundColor: themeVars.accent, color: themeVars.accentFg },
|
|
646
652
|
className: cn(
|
|
647
|
-
"arclo-prompt-submit ml-auto
|
|
653
|
+
"arclo-prompt-submit ml-auto transition-all hover:brightness-90 disabled:opacity-25 cursor-pointer disabled:cursor-default",
|
|
654
|
+
isIcon ? "rounded-xl p-2" : "rounded-xl px-4 py-2 text-sm font-medium",
|
|
648
655
|
className
|
|
649
656
|
),
|
|
650
657
|
...props,
|
|
651
|
-
children:
|
|
658
|
+
children: content
|
|
652
659
|
}
|
|
653
660
|
);
|
|
654
661
|
}
|
|
@@ -1312,6 +1319,7 @@ Output.displayName = "ToolCall.Output";
|
|
|
1312
1319
|
var chat_thread_exports = {};
|
|
1313
1320
|
__export(chat_thread_exports, {
|
|
1314
1321
|
AssistantMessage: () => AssistantMessage,
|
|
1322
|
+
Avatar: () => Avatar,
|
|
1315
1323
|
Message: () => Message,
|
|
1316
1324
|
Messages: () => Messages,
|
|
1317
1325
|
Root: () => Root6,
|
|
@@ -1491,6 +1499,65 @@ var ScrollAnchor = forwardRef(
|
|
|
1491
1499
|
}
|
|
1492
1500
|
);
|
|
1493
1501
|
ScrollAnchor.displayName = "ChatThread.ScrollAnchor";
|
|
1502
|
+
var Avatar = forwardRef(
|
|
1503
|
+
({
|
|
1504
|
+
src,
|
|
1505
|
+
initials,
|
|
1506
|
+
icon,
|
|
1507
|
+
color,
|
|
1508
|
+
textColor,
|
|
1509
|
+
size = 28,
|
|
1510
|
+
className,
|
|
1511
|
+
style,
|
|
1512
|
+
...props
|
|
1513
|
+
}, ref) => {
|
|
1514
|
+
const bg = color ?? themeVars.accent;
|
|
1515
|
+
const fg = textColor ?? themeVars.accentFg;
|
|
1516
|
+
if (src) {
|
|
1517
|
+
return /* @__PURE__ */ jsx(
|
|
1518
|
+
"div",
|
|
1519
|
+
{
|
|
1520
|
+
ref,
|
|
1521
|
+
className: cn(
|
|
1522
|
+
"arclo-chat-avatar shrink-0 overflow-hidden rounded-full",
|
|
1523
|
+
className
|
|
1524
|
+
),
|
|
1525
|
+
style: { width: size, height: size, ...style },
|
|
1526
|
+
...props,
|
|
1527
|
+
children: /* @__PURE__ */ jsx(
|
|
1528
|
+
"img",
|
|
1529
|
+
{
|
|
1530
|
+
src,
|
|
1531
|
+
alt: initials ?? "Avatar",
|
|
1532
|
+
className: "h-full w-full object-cover"
|
|
1533
|
+
}
|
|
1534
|
+
)
|
|
1535
|
+
}
|
|
1536
|
+
);
|
|
1537
|
+
}
|
|
1538
|
+
return /* @__PURE__ */ jsx(
|
|
1539
|
+
"div",
|
|
1540
|
+
{
|
|
1541
|
+
ref,
|
|
1542
|
+
className: cn(
|
|
1543
|
+
"arclo-chat-avatar shrink-0 flex items-center justify-center rounded-full font-semibold",
|
|
1544
|
+
className
|
|
1545
|
+
),
|
|
1546
|
+
style: {
|
|
1547
|
+
width: size,
|
|
1548
|
+
height: size,
|
|
1549
|
+
backgroundColor: bg,
|
|
1550
|
+
color: fg,
|
|
1551
|
+
fontSize: size * 0.4,
|
|
1552
|
+
...style
|
|
1553
|
+
},
|
|
1554
|
+
...props,
|
|
1555
|
+
children: icon ?? initials ?? "?"
|
|
1556
|
+
}
|
|
1557
|
+
);
|
|
1558
|
+
}
|
|
1559
|
+
);
|
|
1560
|
+
Avatar.displayName = "ChatThread.Avatar";
|
|
1494
1561
|
|
|
1495
1562
|
// src/image-gen/index.ts
|
|
1496
1563
|
var image_gen_exports = {};
|