An open source design system that's fully customizable and agent ready
TypeScript
fix(cli): normalize ChatComposer template widths and drawer showcase radius (#4463)
Kenton Quatmanf94bbebbb4f3
diff --git a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerAttachments.tsx b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerAttachments.tsxindex 53cff68291..c437a7cf57 100644--- a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerAttachments.tsx+++ b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerAttachments.tsx@@ -8,7 +8,7 @@ import {Stack} from '@astryxdesign/core/Layout';export default function ChatComposerAttachments() {return (- <Stack direction="vertical" style={{width: '100%', maxWidth: 450}}>+ <Stack direction="vertical" width={450} maxWidth="100%"><ChatComposeronSubmit={value => {console.log('Sent:', value);diff --git a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerFlat.tsx b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerFlat.tsxindex 60e332c821..b03d5e22e2 100644--- a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerFlat.tsx+++ b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerFlat.tsx@@ -16,7 +16,7 @@ import {export default function ChatComposerFlat() {return (- <Stack direction="vertical" gap={2} style={{width: '100%', maxWidth: 450}}>+ <Stack direction="vertical" gap={2} width={450} maxWidth="100%"><Text type="supporting" color="secondary">elevation="none" — flat, with a text-input-style border andfocus ringdiff --git a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerFooterActions.tsx b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerFooterActions.tsxindex fe085ab37d..fad17f4d64 100644--- a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerFooterActions.tsx+++ b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerFooterActions.tsx@@ -16,7 +16,7 @@ import {export default function ChatComposerFooterActions() {return (- <Stack direction="vertical" gap={4} style={{width: '100%', maxWidth: 450}}>+ <Stack direction="vertical" gap={4} width={450} maxWidth="100%"><Stack direction="vertical" gap={1}><Text type="supporting" color="secondary">Model selector and settings dropdownsdiff --git a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsxindex d26b4ad59a..ea2ab7af34 100644--- a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx+++ b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerFullFeatured.tsx@@ -27,10 +27,7 @@ export default function ChatComposerFullFeatured() {const [isStreaming, setIsStreaming] = useState(false);return (- <Stack- direction="vertical"- gap={4}- style={{width: '100%', maxWidth: 450}}>+ <Stack direction="vertical" gap={4} width={450} maxWidth="100%"><Text type="supporting" color="secondary">All slots populated</Text>diff --git a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerShowcase.tsx b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerShowcase.tsxindex 48d0713e26..0eb011e479 100644--- a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerShowcase.tsx+++ b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerShowcase.tsx@@ -7,11 +7,8 @@ import {Stack} from '@astryxdesign/core/Layout';export default function ChatComposerShowcase() {return (- <Stack direction="vertical" width="100%" style={{maxWidth: 450}}>- <ChatComposer- onSubmit={() => {}}- placeholder="Type a message…"- />+ <Stack direction="vertical" width={450} maxWidth="100%">+ <ChatComposer onSubmit={() => {}} placeholder="Type a message…" /></Stack>);}diff --git a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerSimple.tsx b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerSimple.tsxindex a465f926f2..f0a0d63035 100644--- a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerSimple.tsx+++ b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerSimple.tsx@@ -7,7 +7,7 @@ import {Stack} from '@astryxdesign/core/Layout';export default function ChatComposerSimple() {return (- <Stack direction="vertical" style={{width: '100%', maxWidth: 450}}>+ <Stack direction="vertical" width={450} maxWidth="100%"><ChatComposeronSubmit={value => {console.log('Sent:', value);diff --git a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerStreaming.tsx b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerStreaming.tsxindex 37a96e492e..b1ab1ed722 100644--- a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerStreaming.tsx+++ b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerStreaming.tsx@@ -14,10 +14,7 @@ export default function ChatComposerStreaming() {);return (- <Stack- direction="vertical"- gap={4}- style={{width: '100%', maxWidth: 450}}>+ <Stack direction="vertical" gap={4} width={450} maxWidth="100%"><Stack direction="vertical" gap={1}><Text type="supporting" color="secondary">{isStreamingdiff --git a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerValidation.tsx b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerValidation.tsxindex 97aed7a1b2..b62022736b 100644--- a/packages/cli/templates/blocks/components/ChatComposer/ChatComposerValidation.tsx+++ b/packages/cli/templates/blocks/components/ChatComposer/ChatComposerValidation.tsx@@ -8,7 +8,7 @@ import {Text} from '@astryxdesign/core/Text';export default function ChatComposerValidation() {return (- <Stack direction="vertical" gap={4} style={{width: '100%', maxWidth: 450}}>+ <Stack direction="vertical" gap={4} width={450} maxWidth="100%"><Stack direction="vertical" gap={1}><Text type="supporting" color="secondary">Error message (with top position)diff --git a/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerAttachments.tsx b/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerAttachments.tsxindex 72c299df93..c05fdb59ce 100644--- a/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerAttachments.tsx+++ b/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerAttachments.tsx@@ -43,7 +43,7 @@ const IMAGE_ATTACHMENTS = [export default function ChatComposerDrawerAttachments() {return (- <Stack direction="vertical" gap={4} width={480}>+ <Stack direction="vertical" gap={4} width={450} maxWidth="100%"><ChatComposeronSubmit={() => {}}drawer={diff --git a/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerCollapsible.tsx b/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerCollapsible.tsxindex fa45b0ed7e..a6fc835eb9 100644--- a/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerCollapsible.tsx+++ b/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerCollapsible.tsx@@ -8,7 +8,7 @@ import {Stack} from '@astryxdesign/core/Layout';export default function ChatComposerDrawerCollapsible() {return (- <Stack direction="vertical" gap={4} width={480}>+ <Stack direction="vertical" gap={4} width={450} maxWidth="100%"><ChatComposeronSubmit={() => {}}drawer={diff --git a/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerFeedback.tsx b/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerFeedback.tsxindex 0ce20288c8..c39fd5b1e9 100644--- a/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerFeedback.tsx+++ b/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerFeedback.tsx@@ -19,7 +19,7 @@ export default function ChatComposerDrawerFeedback() {const [selected, setSelected] = useState<string | null>(null);return (- <Stack direction="vertical" style={{width: '100%', maxWidth: 450}}>+ <Stack direction="vertical" width={450} maxWidth="100%"><ChatComposeronSubmit={value => {console.log('Submit:', value, '| Answer:', selected);@@ -29,9 +29,7 @@ export default function ChatComposerDrawerFeedback() {<Stack direction="vertical" gap={1} width="100%"><List><ListItem- label={- <Text weight="bold">Do you want to proceed?</Text>- }+ label={<Text weight="bold">Do you want to proceed?</Text>}/>{options.map(opt => (<ListItemdiff --git a/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.tsx b/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.tsxindex 588debe32e..66253f6131 100644--- a/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.tsx+++ b/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.tsx@@ -12,12 +12,13 @@ import type {CSSProperties} from 'react';const drawerBorder: CSSProperties = {border: 'var(--border-width) solid var(--color-border)',- borderRadius: 'var(--radius-chat)',+ borderTopLeftRadius: 'var(--radius-chat)',+ borderTopRightRadius: 'var(--radius-chat)',};export default function ChatComposerDrawerShowcase() {return (- <Stack direction="vertical" gap={4} width={480}>+ <Stack direction="vertical" gap={4} width={450} maxWidth="100%"><ChatComposeronSubmit={() => {}}drawer={diff --git a/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx b/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsxindex fa76ec4697..173f1fe971 100644--- a/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx+++ b/packages/cli/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerWithProgress.tsx@@ -12,7 +12,7 @@ import {PaperClipIcon, AtSymbolIcon} from '@heroicons/react/24/outline';export default function ChatComposerDrawerWithProgress() {return (- <Stack direction="vertical" gap={4} width={480}>+ <Stack direction="vertical" gap={4} width={450} maxWidth="100%"><ChatComposeronSubmit={() => {}}drawer={diff --git a/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputControlledInput.tsx b/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputControlledInput.tsxindex 593c2de7f0..37724a47cb 100644--- a/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputControlledInput.tsx+++ b/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputControlledInput.tsx@@ -10,7 +10,7 @@ import {Text} from '@astryxdesign/core/Text';export default function ChatComposerInputControlledInput() {const [value, setValue] = useState('');return (- <Stack direction="vertical" gap={3} style={{width: 450, maxWidth: '100%'}}>+ <Stack direction="vertical" gap={3} width={450} maxWidth="100%"><ChatComposeronSubmit={() => setValue('')}value={value}diff --git a/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputDisabled.tsx b/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputDisabled.tsxindex eb9fad0213..5f98a614c0 100644--- a/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputDisabled.tsx+++ b/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputDisabled.tsx@@ -7,13 +7,11 @@ import {Stack} from '@astryxdesign/core/Layout';export default function ChatComposerInputDisabled() {return (- <Stack direction="vertical" style={{width: 450, maxWidth: '100%'}}>+ <Stack direction="vertical" width={450} maxWidth="100%"><ChatComposeronSubmit={() => {}}isDisabled- input={- <ChatComposerInput isDisabled placeholder="Input is disabled" />- }+ input={<ChatComposerInput isDisabled placeholder="Input is disabled" />}/></Stack>);diff --git a/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputMentionTrigger.tsx b/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputMentionTrigger.tsxindex b1fd059899..8aabbf4997 100644--- a/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputMentionTrigger.tsx+++ b/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputMentionTrigger.tsx@@ -43,7 +43,7 @@ export default function ChatComposerInputMentionTrigger() {};return (- <Stack direction="vertical" gap={3} style={{width: 450, maxWidth: '100%'}}>+ <Stack direction="vertical" gap={3} width={450} maxWidth="100%"><ChatComposeronSubmit={() => setValue('')}input={diff --git a/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputMultipleTriggers.tsx b/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputMultipleTriggers.tsxindex c27a3008ef..ce74983cbe 100644--- a/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputMultipleTriggers.tsx+++ b/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputMultipleTriggers.tsx@@ -54,7 +54,7 @@ export default function ChatComposerInputMultipleTriggers() {};return (- <Stack direction="vertical" gap={3} style={{width: 450, maxWidth: '100%'}}>+ <Stack direction="vertical" gap={3} width={450} maxWidth="100%"><Text type="supporting" color="secondary">Type @ for mentions (blue) or / for commands (yellow)</Text>diff --git a/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputShowcase.tsx b/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputShowcase.tsxindex 6d0b44eb80..7fca34d053 100644--- a/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputShowcase.tsx+++ b/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputShowcase.tsx@@ -7,7 +7,7 @@ import {Stack} from '@astryxdesign/core/Layout';export default function ChatComposerInputShowcase() {return (- <Stack direction="vertical" style={{width: 450, maxWidth: '100%'}}>+ <Stack direction="vertical" width={450} maxWidth="100%"><ChatComposeronSubmit={() => {}}input={diff --git a/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputSlashCommands.tsx b/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputSlashCommands.tsxindex e2939fa91c..5b6f448b55 100644--- a/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputSlashCommands.tsx+++ b/packages/cli/templates/blocks/components/ChatComposerInput/ChatComposerInputSlashCommands.tsx@@ -13,11 +13,31 @@ import type {SearchableItem} from '@astryxdesign/core/Typeahead';import {Stack} from '@astryxdesign/core/Layout';const COMMANDS: SearchableItem<{description: string}>[] = [- {id: 'summarize', label: 'summarize', auxiliaryData: {description: 'Summarize the conversation'}},- {id: 'translate', label: 'translate', auxiliaryData: {description: 'Translate text to another language'}},- {id: 'search', label: 'search', auxiliaryData: {description: 'Search the web or documents'}},- {id: 'code', label: 'code', auxiliaryData: {description: 'Generate or explain code'}},- {id: 'help', label: 'help', auxiliaryData: {description: 'Show available commands'}},+ {+ id: 'summarize',+ label: 'summarize',+ auxiliaryData: {description: 'Summarize the conversation'},+ },+ {+ id: 'translate',+ label: 'translate',+ auxiliaryData: {description: 'Translate text to another language'},+ },+ {+ id: 'search',+ label: 'search',+ auxiliaryData: {description: 'Search the web or documents'},+ },+ {+ id: 'code',+ label: 'code',+ auxiliaryData: {description: 'Generate or explain code'},+ },+ {+ id: 'help',+ label: 'help',+ auxiliaryData: {description: 'Show available commands'},+ },];const commandSource = createStaticSource(COMMANDS);@@ -40,7 +60,7 @@ export default function ChatComposerInputSlashCommands() {};return (- <Stack direction="vertical" style={{width: 450, maxWidth: '100%'}}>+ <Stack direction="vertical" width={450} maxWidth="100%"><ChatComposeronSubmit={() => {}}input={diff --git a/packages/cli/templates/blocks/components/ChatDictationButton/ChatDictationButtonBasic.tsx b/packages/cli/templates/blocks/components/ChatDictationButton/ChatDictationButtonBasic.tsxindex 69950a5bed..f69b73296a 100644--- a/packages/cli/templates/blocks/components/ChatDictationButton/ChatDictationButtonBasic.tsx+++ b/packages/cli/templates/blocks/components/ChatDictationButton/ChatDictationButtonBasic.tsx@@ -23,7 +23,7 @@ export default function ChatDictationButtonBasic() {});return (- <Stack direction="vertical" width="100%" style={{maxWidth: 450}}>+ <Stack direction="vertical" width={450} maxWidth="100%"><ChatComposeronSubmit={value => console.log('Submit:', value)}input={<ChatComposerInput handleRef={inputRef} />}diff --git a/packages/cli/templates/blocks/components/ChatDictationButton/ChatDictationButtonShowcase.tsx b/packages/cli/templates/blocks/components/ChatDictationButton/ChatDictationButtonShowcase.tsxindex 8007344f58..5d6623f2e0 100644--- a/packages/cli/templates/blocks/components/ChatDictationButton/ChatDictationButtonShowcase.tsx+++ b/packages/cli/templates/blocks/components/ChatDictationButton/ChatDictationButtonShowcase.tsx@@ -25,7 +25,7 @@ export default function ChatDictationButtonShowcase() {});return (- <VStack gap={4}>+ <VStack gap={4} width={450} maxWidth="100%"><Text type="supporting" color="secondary">Click the microphone to start dictating. Speech is transcribed into theinput.diff --git a/packages/cli/templates/blocks/components/ChatSendButton/ChatSendButtonInComposer.tsx b/packages/cli/templates/blocks/components/ChatSendButton/ChatSendButtonInComposer.tsxindex 1647b4b3a5..8f25bcba41 100644--- a/packages/cli/templates/blocks/components/ChatSendButton/ChatSendButtonInComposer.tsx+++ b/packages/cli/templates/blocks/components/ChatSendButton/ChatSendButtonInComposer.tsx@@ -7,7 +7,7 @@ import {Stack} from '@astryxdesign/core/Layout';export default function ChatSendButtonInComposer() {return (- <Stack direction="vertical" width="100%" style={{maxWidth: 450}}>+ <Stack direction="vertical" width={450} maxWidth="100%"><ChatComposeronSubmit={() => {}}value="Hello, how can you help?"