import type { SxProps, Theme } from '@mui/material' import { CHAT_MAX_WIDTH } from '../const' export const styles = { header: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: ({ spacing }) => spacing(1), }, headerTitle: { flexGrow: 1, px: ({ spacing }) => spacing(0.5), }, headerActions: { display: 'flex', alignItems: 'center', marginLeft: ({ spacing }) => spacing(2), gap: ({ spacing }) => spacing(0.5), }, footerWrapper: { padding: ({ spacing }) => spacing(1), }, /** * Rounded input box, matching the reference ChatFooter. A two-column grid: * main column (input + optional slots) | send button, bottom-aligned so it * stays at the end as the input grows. NO vertical padding — the textarea's own * padding sets the ~32px single-line height, so the box hugs the input. */ footerBox: { maxWidth: CHAT_MAX_WIDTH, width: '100%', margin: '0 auto', display: 'grid', gridTemplateColumns: '1fr auto', alignItems: 'end', columnGap: ({ spacing }) => spacing(0.5), backgroundColor: ({ palette }) => palette.default?.background ?? 'rgba(44, 48, 50, 0.04)', borderRadius: ({ spacing }) => spacing(0.5), paddingInline: ({ spacing }) => spacing(0.5), }, /** Main grid area: input stacked above the (optional) slots row. */ footerMain: { minWidth: 0, display: 'flex', flexDirection: 'column', gap: ({ spacing }) => spacing(0.5), }, /** * Send-button grid area, bottom-aligned (matches the reference flex-end row) so * the button stays at the bottom as the input grows. The small bottom padding * keeps it off the box edge — in the single-line state it reads as vertically * centered (4px top / 4px bottom around the 24px button in the 32px row). */ footerSend: { alignSelf: 'end', paddingBottom: ({ spacing }) => spacing(0.5), '& .MuiIconButton-root': { padding: ({ spacing }) => spacing(0.5), }, }, /** The chrome-less multiline input (no underline / no filled affordance). */ footerInput: { width: '100%', typography: 'body2', // The Meridian theme styles multiline InputBase as a tall "comment field" // (min-height: 96px on the root, 12px/14px textarea padding). Override both to // get the compact chat field: kill the root min-height and use the reference's // 6px/10px padding — both need !important to beat the theme override. Height // then comes from MUI's TextareaAutosize (minRows=1/maxRows=8): one line // (~32px) → grows → scrolls. // // TextareaAutosize renders a hidden shadow