@shapesos/clay 0.3.1 → 0.4.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.
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/chat/chat-root/chat-root.tsx","../src/chat/chat-context/chat-context.ts","../src/chat/chat-root/chat-root-styles.ts","../src/chat/chat-message-content/chat-message-content.tsx","../src/chat/chat-message-content/chat-message-content-styles.ts","../src/chat/chat-message-actions/chat-message-actions.tsx","../node_modules/@tabler/icons-react/src/defaultAttributes.ts","../node_modules/@tabler/icons-react/src/createReactComponent.ts","../node_modules/@tabler/icons-react/src/icons/IconArrowUp.ts","../node_modules/@tabler/icons-react/src/icons/IconCheck.ts","../node_modules/@tabler/icons-react/src/icons/IconCopy.ts","../node_modules/@tabler/icons-react/src/icons/IconThumbDown.ts","../node_modules/@tabler/icons-react/src/icons/IconThumbUp.ts","../node_modules/@tabler/icons-react/src/icons/IconPlayerStopFilled.ts","../src/chat/hooks/use-copy-to-clipboard.ts","../src/utils/clipboard.ts","../src/chat/chat-message-actions/chat-message-actions-styles.ts","../src/chat/chat-message/chat-message-styles.ts","../src/chat/chat-message/chat-message.tsx","../src/chat/hooks/use-auto-scroll.ts","../src/chat/chat-message-list/chat-message-list-styles.ts","../src/chat/chat-message-list/chat-message-list.tsx","../src/chat/chat-composer/chat-composer.tsx","../src/chat/chat-composer/chat-composer-styles.ts","../src/chat/chat-namespace.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport type { ChatMessage, ChatContextValue } from \"../types\";\nimport { ChatContext } from \"../chat-context/chat-context\";\nimport { RootContainer } from \"./chat-root-styles\";\n\nexport interface ChatRootProps {\n messages: ChatMessage[];\n onSendMessage: (content: string) => void;\n isLoading?: boolean;\n onStop?: () => void;\n onCopyMessage?: (messageId: string) => void;\n onThumbUpClick?: (messageId: string, isHelpful: boolean | null) => void;\n onThumbDownClick?: (messageId: string, isHelpful: boolean | null) => void;\n children: ReactNode;\n}\n\nexport function ChatRoot({\n messages,\n onSendMessage,\n isLoading = false,\n onStop,\n onCopyMessage,\n onThumbUpClick,\n onThumbDownClick,\n children,\n}: ChatRootProps) {\n const contextValue = useMemo<ChatContextValue>(\n () => ({ messages, onSendMessage, isLoading, onStop, onCopyMessage, onThumbUpClick, onThumbDownClick }),\n [messages, onSendMessage, isLoading, onStop, onCopyMessage, onThumbUpClick, onThumbDownClick]\n );\n\n return (\n <ChatContext.Provider value={contextValue}>\n <RootContainer>{children}</RootContainer>\n </ChatContext.Provider>\n );\n}\n","import { createContext, useContext } from \"react\";\nimport type { ChatContextValue } from \"../types\";\n\nexport const ChatContext = createContext<ChatContextValue | null>(null);\n\nexport function useChatContext(): ChatContextValue {\n const context = useContext(ChatContext);\n if (!context) {\n throw new Error(\"useChatContext must be used within a Chat.Root component\");\n }\n return context;\n}\n","import styled from \"styled-components\";\n\nexport const RootContainer = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n`;\n","import ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\n\nimport { ContentWrapper } from \"./chat-message-content-styles\";\n\ninterface ChatMessageContentProps {\n content: string;\n}\n\nexport function ChatMessageContent({ content }: ChatMessageContentProps) {\n return (\n <ContentWrapper>\n <ReactMarkdown remarkPlugins={[remarkGfm]}>{content}</ReactMarkdown>\n </ContentWrapper>\n );\n}\n","import styled from \"styled-components\";\n\nimport { colors } from \"../../tokens/colors\";\nimport { typographyMixin, typographyTypes } from \"../../tokens/typography\";\n\nexport const ContentWrapper = styled.div`\n ${typographyMixin(typographyTypes.GEIST_BODY_XS_MEDIUM)};\n color: ${colors[\"brown-100\"]};\n word-break: break-word;\n\n & p {\n margin: 0;\n }\n\n & p + p {\n margin-top: 8px;\n }\n\n & ul,\n & ol {\n margin: 4px 0;\n padding-left: 20px;\n }\n\n & a {\n color: ${colors[\"brown-100\"]};\n text-decoration: underline;\n }\n\n & pre {\n overflow-x: auto;\n padding: 8px;\n margin: 4px 0;\n background: ${colors[\"brown-10\"]};\n border: 1px solid ${colors[\"brown-alpha-12\"]};\n border-radius: 8px;\n }\n\n & pre code {\n padding: 0;\n background: none;\n border-radius: 0;\n }\n\n & code {\n padding: 2px 4px;\n background: ${colors[\"brown-10\"]};\n border-radius: 4px;\n }\n\n & table {\n border-collapse: collapse;\n margin: 8px 0;\n width: 100%;\n }\n\n & th,\n & td {\n border: 1px solid ${colors[\"brown-alpha-12\"]};\n padding: 6px 12px;\n text-align: left;\n }\n\n & th {\n background: ${colors[\"brown-10\"]};\n font-weight: 600;\n }\n\n & blockquote {\n margin: 4px 0;\n padding-left: 12px;\n border-left: 3px solid ${colors[\"brown-30\"]};\n color: ${colors[\"brown-70\"]};\n }\n`;\n","import { useCallback } from \"react\";\nimport { IconCopy, IconCheck, IconThumbUp, IconThumbDown } from \"@tabler/icons-react\";\n\nimport { IconButton } from \"../../icon-button/icon-button\";\nimport { useChatContext } from \"../chat-context/chat-context\";\nimport { useCopyToClipboard } from \"../hooks/use-copy-to-clipboard\";\nimport type { MessageRole } from \"../types\";\nimport { ActionsContainer } from \"./chat-message-actions-styles\";\n\ninterface ChatMessageActionsProps {\n messageId: string;\n content: string;\n role: MessageRole;\n isHelpful?: boolean | null;\n}\n\nexport function ChatMessageActions({ messageId, content, role, isHelpful }: ChatMessageActionsProps) {\n const { onCopyMessage, onThumbUpClick, onThumbDownClick } = useChatContext();\n const { isCopied, copy } = useCopyToClipboard();\n\n const handleCopy = useCallback(() => {\n copy(content);\n onCopyMessage?.(messageId);\n }, [content, messageId, copy, onCopyMessage]);\n\n const handleThumbUp = useCallback(() => {\n onThumbUpClick?.(messageId, isHelpful === true ? null : true);\n }, [messageId, isHelpful, onThumbUpClick]);\n\n const handleThumbDown = useCallback(() => {\n onThumbDownClick?.(messageId, isHelpful === false ? null : false);\n }, [messageId, isHelpful, onThumbDownClick]);\n\n const isAssistant = role === \"assistant\";\n const hasFeedback = isAssistant && (onThumbUpClick || onThumbDownClick);\n\n return (\n <ActionsContainer>\n <IconButton\n icon={isCopied ? IconCheck : IconCopy}\n onClick={handleCopy}\n aria-label={isCopied ? \"Copied\" : \"Copy message\"}\n />\n\n {hasFeedback && (\n <IconButton\n icon={IconThumbUp}\n onClick={handleThumbUp}\n isSelected={isHelpful === true}\n aria-label=\"Good response\"\n />\n )}\n\n {hasFeedback && (\n <IconButton\n icon={IconThumbDown}\n onClick={handleThumbDown}\n isSelected={isHelpful === false}\n aria-label=\"Bad response\"\n />\n )}\n </ActionsContainer>\n );\n}\n","export default {\n outline: {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n },\n filled: {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'currentColor',\n stroke: 'none',\n },\n};\n","import { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes';\nimport type { IconNode, IconProps, Icon } from './types';\n\nconst createReactComponent = (\n type: 'outline' | 'filled',\n iconName: string,\n iconNamePascal: string,\n iconNode: IconNode,\n) => {\n const Component = forwardRef<SVGSVGElement, IconProps>(\n (\n { color = 'currentColor', size = 24, stroke = 2, title, className, children, ...rest }: IconProps,\n ref,\n ) =>\n createElement(\n 'svg',\n {\n ref,\n ...defaultAttributes[type],\n width: size,\n height: size,\n className: [`tabler-icon`, `tabler-icon-${iconName}`, className].join(' '),\n ...(type === 'filled'\n ? {\n fill: color,\n }\n : {\n strokeWidth: stroke,\n stroke: color,\n }),\n ...rest,\n },\n [\n title && createElement('title', { key: 'svg-title' }, title),\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...(Array.isArray(children) ? children : [children]),\n ],\n ),\n );\n\n Component.displayName = `${iconNamePascal}`;\n\n return Component;\n};\n\nexport default createReactComponent;\n","import createReactComponent from '../createReactComponent';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [[\"path\",{\"d\":\"M12 5l0 14\",\"key\":\"svg-0\"}],[\"path\",{\"d\":\"M18 11l-6 -6\",\"key\":\"svg-1\"}],[\"path\",{\"d\":\"M6 11l6 -6\",\"key\":\"svg-2\"}]]\n\nconst IconArrowUp = createReactComponent('outline', 'arrow-up', 'ArrowUp', __iconNode);\n\nexport default IconArrowUp;","import createReactComponent from '../createReactComponent';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [[\"path\",{\"d\":\"M5 12l5 5l10 -10\",\"key\":\"svg-0\"}]]\n\nconst IconCheck = createReactComponent('outline', 'check', 'Check', __iconNode);\n\nexport default IconCheck;","import createReactComponent from '../createReactComponent';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [[\"path\",{\"d\":\"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666\",\"key\":\"svg-0\"}],[\"path\",{\"d\":\"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1\",\"key\":\"svg-1\"}]]\n\nconst IconCopy = createReactComponent('outline', 'copy', 'Copy', __iconNode);\n\nexport default IconCopy;","import createReactComponent from '../createReactComponent';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [[\"path\",{\"d\":\"M7 13v-8a1 1 0 0 0 -1 -1h-2a1 1 0 0 0 -1 1v7a1 1 0 0 0 1 1h3a4 4 0 0 1 4 4v1a2 2 0 0 0 4 0v-5h3a2 2 0 0 0 2 -2l-1 -5a2 3 0 0 0 -2 -2h-7a3 3 0 0 0 -3 3\",\"key\":\"svg-0\"}]]\n\nconst IconThumbDown = createReactComponent('outline', 'thumb-down', 'ThumbDown', __iconNode);\n\nexport default IconThumbDown;","import createReactComponent from '../createReactComponent';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [[\"path\",{\"d\":\"M7 11v8a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-7a1 1 0 0 1 1 -1h3a4 4 0 0 0 4 -4v-1a2 2 0 0 1 4 0v5h3a2 2 0 0 1 2 2l-1 5a2 3 0 0 1 -2 2h-7a3 3 0 0 1 -3 -3\",\"key\":\"svg-0\"}]]\n\nconst IconThumbUp = createReactComponent('outline', 'thumb-up', 'ThumbUp', __iconNode);\n\nexport default IconThumbUp;","import createReactComponent from '../createReactComponent';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [[\"path\",{\"d\":\"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z\",\"key\":\"svg-0\"}]]\n\nconst IconPlayerStopFilled = createReactComponent('filled', 'player-stop-filled', 'PlayerStopFilled', __iconNode);\n\nexport default IconPlayerStopFilled;","import { useState, useCallback, useRef, useEffect } from \"react\";\n\nimport { copyToClipboard } from \"../../utils/clipboard\";\n\nconst RESET_DELAY_MS = 2000;\n\ninterface UseCopyToClipboardResult {\n isCopied: boolean;\n copy: (text: string) => void;\n}\n\nexport function useCopyToClipboard(): UseCopyToClipboardResult {\n const [isCopied, setIsCopied] = useState(false);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n };\n }, []);\n\n const copy = useCallback((text: string) => {\n copyToClipboard(text, {\n onSuccess: () => {\n setIsCopied(true);\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(() => {\n setIsCopied(false);\n timeoutRef.current = null;\n }, RESET_DELAY_MS);\n },\n });\n }, []);\n\n return { isCopied, copy };\n}\n","interface CopyToClipboardOptions {\n onSuccess?: () => void;\n onFailure?: (error: unknown) => void;\n}\n\nexport function copyToClipboard(text: string, options?: CopyToClipboardOptions): void {\n navigator.clipboard.writeText(text).then(\n () => options?.onSuccess?.(),\n (error) => options?.onFailure?.(error)\n );\n}\n","import styled from \"styled-components\";\n\nexport const ActionsContainer = styled.div`\n display: flex;\n gap: 2px;\n margin-top: 4px;\n opacity: 0;\n pointer-events: none;\n transition: opacity 150ms ease;\n`;\n","import styled from \"styled-components\";\n\nimport { colors } from \"../../tokens/colors\";\nimport { typographyMixin, typographyTypes } from \"../../tokens/typography\";\nimport { ActionsContainer } from \"../chat-message-actions/chat-message-actions-styles\";\nimport type { MessageRole } from \"../types\";\n\nexport const MessageRow = styled.div<{ $role: MessageRole }>`\n display: flex;\n justify-content: ${({ $role }) => ($role === \"user\" ? \"flex-end\" : \"flex-start\")};\n`;\n\nexport const MessageContainer = styled.div<{ $role: MessageRole }>`\n display: flex;\n flex-direction: column;\n align-items: ${({ $role }) => ($role === \"user\" ? \"flex-end\" : \"flex-start\")};\n max-width: 90%;\n\n &:hover ${ActionsContainer} {\n opacity: 1;\n pointer-events: auto;\n }\n`;\n\nexport const MessageBubble = styled.div<{ $role: MessageRole }>`\n ${typographyMixin(typographyTypes.GEIST_BODY_XS_MEDIUM)};\n color: ${colors[\"brown-100\"]};\n background: ${({ $role }) => ($role === \"user\" ? colors.white : \"transparent\")};\n padding: ${({ $role }) => ($role === \"user\" ? \"12px 16px\" : \"0\")};\n border-radius: ${({ $role }) => ($role === \"user\" ? \"16px\" : \"0\")};\n`;\n","import type { ChatMessage as ChatMessageType } from \"../types\";\nimport { ChatMessageContent } from \"../chat-message-content/chat-message-content\";\nimport { ChatMessageActions } from \"../chat-message-actions/chat-message-actions\";\nimport { MessageRow, MessageBubble, MessageContainer } from \"./chat-message-styles\";\n\ninterface ChatMessageProps {\n message: ChatMessageType;\n}\n\nexport function ChatMessage({ message }: ChatMessageProps) {\n return (\n <MessageRow $role={message.role}>\n <MessageContainer $role={message.role}>\n <MessageBubble $role={message.role}>\n <ChatMessageContent content={message.content} />\n </MessageBubble>\n <ChatMessageActions\n messageId={message.id}\n content={message.content}\n role={message.role}\n isHelpful={message.isHelpful}\n />\n </MessageContainer>\n </MessageRow>\n );\n}\n","import { useRef, useState, useEffect, useLayoutEffect, useCallback } from \"react\";\n\ninterface UseAutoScrollResult {\n scrollContainerRef: React.RefObject<HTMLDivElement | null>;\n sentinelRef: React.RefObject<HTMLDivElement | null>;\n isAtBottom: boolean;\n scrollToBottom: () => void;\n}\n\nexport function useAutoScroll(messageCount: number): UseAutoScrollResult {\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n const sentinelRef = useRef<HTMLDivElement>(null);\n const [isAtBottom, setIsAtBottom] = useState(true);\n const prevMessageCountRef = useRef(messageCount);\n const hasInitializedRef = useRef(false);\n\n // Phase 1: snap before paint — gets close but styled-components CSS\n // for the sentinel may not be injected yet, so scrollHeight can be short.\n useLayoutEffect(() => {\n const el = scrollContainerRef.current;\n if (el) {\n el.scrollTop = el.scrollHeight;\n }\n }, []);\n\n // Phase 2: snap after paint + rAF — styles are fully computed,\n // scrollHeight now includes the sentinel's height.\n useEffect(() => {\n if (!hasInitializedRef.current) {\n hasInitializedRef.current = true;\n requestAnimationFrame(() => {\n const el = scrollContainerRef.current;\n if (el) {\n el.scrollTop = el.scrollHeight;\n }\n });\n }\n }, []);\n\n // Track sentinel visibility for isAtBottom state\n useEffect(() => {\n const sentinel = sentinelRef.current;\n const scrollContainer = scrollContainerRef.current;\n if (!sentinel || !scrollContainer) return;\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n setIsAtBottom(entry.isIntersecting);\n },\n { root: scrollContainer, threshold: 0 }\n );\n\n observer.observe(sentinel);\n return () => observer.disconnect();\n }, []);\n\n // Smooth scroll to bottom when new messages are added\n useEffect(() => {\n if (!hasInitializedRef.current) return;\n\n if (messageCount > prevMessageCountRef.current) {\n requestAnimationFrame(() => {\n const el = scrollContainerRef.current;\n if (el) {\n el.scrollTo({ top: el.scrollHeight, behavior: \"smooth\" });\n }\n });\n }\n prevMessageCountRef.current = messageCount;\n }, [messageCount]);\n\n const scrollToBottom = useCallback(() => {\n const el = scrollContainerRef.current;\n if (el) {\n el.scrollTo({ top: el.scrollHeight, behavior: \"smooth\" });\n }\n }, []);\n\n return { scrollContainerRef, sentinelRef, isAtBottom, scrollToBottom };\n}\n","import styled from \"styled-components\";\n\nimport { colors } from \"../../tokens/colors\";\n\nexport const ListContainer = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow-y: auto;\n\n &::-webkit-scrollbar {\n width: 6px;\n }\n\n &::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n background: ${colors[\"brown-30\"]};\n border-radius: 3px;\n }\n`;\n\nexport const MessagesList = styled.div`\n display: flex;\n flex-direction: column;\n gap: 40px;\n padding: 0 16px 32px 16px;\n`;\n\nexport const ScrollSentinel = styled.div`\n flex-shrink: 0;\n height: 16px;\n`;\n","import { useChatContext } from \"../chat-context/chat-context\";\nimport { ChatMessage } from \"../chat-message/chat-message\";\nimport { useAutoScroll } from \"../hooks/use-auto-scroll\";\nimport { ListContainer, MessagesList, ScrollSentinel } from \"./chat-message-list-styles\";\n\nexport function ChatMessageList() {\n const { messages } = useChatContext();\n const { scrollContainerRef, sentinelRef } = useAutoScroll(messages.length);\n\n return (\n <ListContainer ref={scrollContainerRef} data-testid=\"chat-list-container\">\n <MessagesList>\n {messages.map((message) => (\n <ChatMessage key={message.id} message={message} />\n ))}\n </MessagesList>\n <ScrollSentinel ref={sentinelRef} data-testid=\"chat-scroll-sentinel\" />\n </ListContainer>\n );\n}\n","import { useState, useCallback, useRef, useEffect } from \"react\";\nimport type { KeyboardEvent, ChangeEvent } from \"react\";\nimport { IconArrowUp, IconPlayerStopFilled } from \"@tabler/icons-react\";\n\nimport { Icon } from \"../../icon/icon\";\nimport { useChatContext } from \"../chat-context/chat-context\";\nimport { ComposerContainer, TextArea, SendButton } from \"./chat-composer-styles\";\n\nexport interface ChatComposerProps {\n placeholder?: string;\n}\n\nexport function ChatComposer({ placeholder = \"Type a message...\" }: ChatComposerProps) {\n const { onSendMessage, isLoading, onStop } = useChatContext();\n const [value, setValue] = useState(\"\");\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n\n const isEmpty = value.trim().length === 0;\n\n const resizeTextArea = useCallback(() => {\n const el = textAreaRef.current;\n if (!el) return;\n el.style.height = \"auto\";\n el.style.height = `${el.scrollHeight}px`;\n }, []);\n\n useEffect(() => {\n resizeTextArea();\n }, [value, resizeTextArea]);\n\n useEffect(() => {\n textAreaRef.current?.focus();\n }, []);\n\n const handleSend = useCallback(() => {\n const trimmed = value.trim();\n if (!trimmed) return;\n onSendMessage(trimmed);\n setValue(\"\");\n requestAnimationFrame(() => textAreaRef.current?.focus());\n }, [value, onSendMessage]);\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault();\n handleSend();\n }\n },\n [handleSend]\n );\n\n const handleChange = useCallback((e: ChangeEvent<HTMLTextAreaElement>) => {\n setValue(e.target.value);\n }, []);\n\n const handleButtonClick = useCallback(() => {\n if (isLoading && onStop) {\n onStop();\n } else {\n handleSend();\n }\n }, [isLoading, onStop, handleSend]);\n\n return (\n <ComposerContainer>\n <TextArea\n ref={textAreaRef}\n value={value}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n rows={1}\n />\n <SendButton\n onClick={handleButtonClick}\n disabled={!isLoading && isEmpty}\n aria-label={isLoading ? \"Stop generating\" : \"Send message\"}\n >\n {isLoading ? <Icon icon={IconPlayerStopFilled} size={16} /> : <Icon icon={IconArrowUp} size={16} />}\n </SendButton>\n </ComposerContainer>\n );\n}\n","import styled from \"styled-components\";\n\nimport { colors } from \"../../tokens/colors\";\nimport { typographyMixin, typographyTypes } from \"../../tokens/typography\";\n\nexport const ComposerContainer = styled.div`\n position: relative;\n background: ${colors.white};\n border-radius: 12px;\n box-shadow: 0 0 4px 0 ${colors[\"brown-alpha-12\"]};\n padding: 8px 0;\n`;\n\nexport const TextArea = styled.textarea`\n display: block;\n width: 100%;\n resize: none;\n border: none;\n background: transparent;\n ${typographyMixin(typographyTypes.GEIST_BODY_XS_MEDIUM)};\n color: ${colors[\"brown-90\"]};\n padding: 4px 46px 4px 16px;\n min-height: 20px;\n max-height: 200px;\n overflow-y: auto;\n box-sizing: border-box;\n\n &::placeholder {\n color: ${colors[\"brown-60\"]};\n }\n\n &:focus {\n outline: none;\n }\n`;\n\nexport const SendButton = styled.button`\n position: absolute;\n bottom: 8px;\n right: 8px;\n width: 30px;\n height: 30px;\n border: none;\n border-radius: 12px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: ${colors[\"brown-100\"]};\n color: ${colors.white};\n transition: background-color 75ms;\n padding: 0;\n\n &:disabled {\n background: ${colors[\"brown-50\"]};\n cursor: default;\n }\n`;\n","import { ChatRoot } from \"./chat-root/chat-root\";\nimport { ChatMessageList } from \"./chat-message-list/chat-message-list\";\nimport { ChatComposer } from \"./chat-composer/chat-composer\";\n\nexport const Chat = {\n Root: ChatRoot,\n MessageList: ChatMessageList,\n Composer: ChatComposer,\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,eAAe;;;ACAxB,SAAS,eAAe,kBAAkB;AAGnC,IAAM,cAAc,cAAuC,IAAI;AAE/D,SAAS,iBAAmC;AACjD,QAAM,UAAU,WAAW,WAAW;AACtC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,0DAA0D;AAAA,EAC5E;AACA,SAAO;AACT;;;ACXA,OAAO,YAAY;AAEZ,IAAM,gBAAgB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;;;AFiC9B;AAjBC,SAAS,SAAS;AAAA,EACvB;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAkB;AAChB,QAAM,eAAe;A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QAAM,gBAAgBA;AAAA,IACpB,CAAC,MAA0C;AACzC,UAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,UAAU;AACpC,UAAE,eAAe;AACjB,mBAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,CAAC,UAAU;AAAA,EACb;AAEA,QAAM,eAAeA,aAAY,CAAC,MAAwC;AACxE,aAAS,EAAE,OAAO,KAAK;AAAA,EACzB,GAAG,CAAC,CAAC;AAEL,QAAM,oBAAoBA,aAAY,MAAM;AAC1C,QAAI,aAAa,QAAQ;AACvB,aAAO;AAAA,IACT,OAAO;AACL,iBAAW;AAAA,IACb;AAAA,EACF,GAAG,CAAC,WAAW,QAAQ,UAAU,CAAC;AAElC,SACE,gBAAAH,MAAC,qBACC;AAAA,oBAAAD;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL;AAAA,QACA,UAAU;AAAA,QACV,WAAW;AAAA,QACX;AAAA,QACA,MAAM;AAAA;AAAA,IACR;AAAA,IACA,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,UAAU,CAAC,aAAa;AAAA,QACxB,cAAY,YAAY,oBAAoB;AAAA,QAE3C,sBAAY,gBAAAA,KAAC,QAAK,MAAM,sBAAsB,MAAM,IAAI,IAAK,gBAAAA,KAAC,QAAK,MAAM,aAAa,MAAM,IAAI;AAAA;AAAA,IACnG;AAAA,KACF;AAEJ;;;AE/EO,IAAM,OAAO;AAAA,EAClB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,UAAU;AACZ;","names":["styled","styled","jsx","useCallback","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","styled","jsx","useCallback","styled","styled","jsx","jsxs","useRef","useState","useEffect","useCallback","styled","styled","jsx","jsxs","useState","useCallback","useRef","useEffect","styled","styled","jsx","jsxs","useState","useRef","useCallback","useEffect"]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-7AJSQJQ5.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/icon/icon.tsx","../src/icon/icon-styles.ts","../src/icon-button/icon-button.tsx","../src/icon-button/icon-button-styles.ts"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { IconWrapper, getStrokeWidth } from \"./icon-styles\";\nimport type { IconProps } from \"./types\";\n\nconst DEFAULT_SIZE = 16;\n\nexport const Icon = forwardRef<HTMLSpanElement, IconProps>(function Icon(\n { icon: IconComponent, size = DEFAULT_SIZE, color, className, \"aria-label\": ariaLabel },\n ref\n) {\n return (\n <IconWrapper\n ref={ref}\n className={className}\n $color={color}\n aria-label={ariaLabel}\n role={ariaLabel ? \"img\" : undefined}\n >\n <IconComponent width={size} height={size} strokeWidth={getStrokeWidth(size)} />\n </IconWrapper>\n );\n});\n","import styled from \"styled-components\";\n\nexport const STROKE_WIDTH_BY_SIZE: Record<number, number> = {\n 12: 1.2,\n 14: 1.2,\n 16: 1.8,\n 18: 1.8,\n 20: 1.8,\n 24: 1.8,\n};\n\nexport const DEFAULT_STROKE_WIDTH = 1.8;\n\nexport function getStrokeWidth(size: number): number {\n return STROKE_WIDTH_BY_SIZE[size] ?? DEFAULT_STROKE_WIDTH;\n}\n\nexport const IconWrapper = styled.span<{ $color?: string }>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: ${({ $color }) => $color ?? \"currentColor\"};\n flex-shrink: 0;\n`;\n","import { forwardRef } from \"react\";\n\nimport { Icon } from \"../icon/icon\";\nimport { Button } from \"./icon-button-styles\";\nimport type { IconButtonProps, IconButtonSize } from \"./types\";\n\nconst ICON_SIZE_BY_BUTTON_SIZE: Record<IconButtonSize, number> = {\n small: 14,\n medium: 16,\n};\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { icon, size = \"small\", isSelected = false, disabled = false, onClick, className, \"aria-label\": ariaLabel },\n ref\n) {\n return (\n <Button\n ref={ref}\n className={className}\n $size={size}\n $isSelected={isSelected}\n disabled={disabled}\n onClick={disabled ? undefined : onClick}\n aria-label={ariaLabel}\n >\n <Icon icon={icon} size={ICON_SIZE_BY_BUTTON_SIZE[size]} />\n </Button>\n );\n});\n","import styled from \"styled-components\";\n\nimport { colors } from \"../tokens/colors\";\nimport type { IconButtonSize } from \"./types\";\n\nconst DIMENSIONS: Record<IconButtonSize, number> = {\n small: 28,\n medium: 32,\n};\n\nconst BORDER_RADIUS: Record<IconButtonSize, number> = {\n small: 6,\n medium: 10,\n};\n\nexport const Button = styled.button<{\n $size: IconButtonSize;\n $isSelected: boolean;\n}>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ${({ $size }) => DIMENSIONS[$size]}px;\n height: ${({ $size }) => DIMENSIONS[$size]}px;\n padding: 0;\n border: none;\n border-radius: ${({ $size }) => BORDER_RADIUS[$size]}px;\n background: ${({ $isSelected }) => ($isSelected ? colors[\"brown-40\"] : \"transparent\")};\n color: ${colors[\"brown-100\"]};\n cursor: pointer;\n transition: background-color 100ms ease;\n\n &:hover {\n background: ${({ $isSelected }) => ($isSelected ? colors[\"brown-40\"] : colors[\"brown-20\"])};\n }\n\n &:active {\n background: ${colors[\"brown-40\"]};\n }\n\n &:disabled {\n color: ${colors[\"brown-50\"]};\n background: transparent;\n cursor: not-allowed;\n }\n`;\n"],"mappings":";;;;;AAAA,SAAS,kBAAkB;;;ACA3B,OAAO,YAAY;AAEZ,IAAM,uBAA+C;AAAA,EAC1D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEO,IAAM,uBAAuB;AAE7B,SAAS,eAAe,MAAsB;AACnD,SAAO,qBAAqB,IAAI,KAAK;AACvC;AAEO,IAAM,cAAc,OAAO;AAAA;AAAA;AAAA;AAAA,WAIvB,CAAC,EAAE,OAAO,MAAM,UAAU,cAAc;AAAA;AAAA;;;ADF7C;AAdN,IAAM,eAAe;AAEd,IAAM,OAAO,WAAuC,SAASA,MAClE,EAAE,MAAM,eAAe,OAAO,cAA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