{"version":3,"file":"message-bubble.cjs","sources":["../../../components/message/message-bubble.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { ComponentProps } from 'react';\nimport { Text } from '../text/text';\nimport styles from './message.module.css';\n\nconst bubble = cva(styles.bubble, {\n  variants: {\n    variant: {\n      solid: styles['bubble-solid'],\n      outline: styles['bubble-outline'],\n      ghost: styles['bubble-ghost']\n    },\n    color: {\n      accent: styles['bubble-accent'],\n      neutral: styles['bubble-neutral'],\n      danger: styles['bubble-danger']\n    }\n  },\n  defaultVariants: {\n    variant: 'solid',\n    color: 'neutral'\n  }\n});\n\nconst GHOST_TEXT_VARIANT = {\n  neutral: 'primary',\n  accent: 'accent',\n  danger: 'danger'\n} as const;\n\nexport interface MessageBubbleProps\n  extends ComponentProps<'p'>,\n    VariantProps<typeof bubble> {\n  /**\n   * Visual style of the message surface. `\"ghost\"` drops the surface\n   * entirely — no background, border or padding — and renders the message as\n   * full-width body copy.\n   * @defaultValue \"solid\"\n   */\n  variant?: 'solid' | 'outline' | 'ghost';\n  /**\n   * Color of the message surface.\n   * @defaultValue \"neutral\"\n   */\n  color?: 'accent' | 'neutral' | 'danger';\n}\n\nexport function MessageBubble({\n  className,\n  variant = 'solid',\n  color = 'neutral',\n  ref,\n  ...props\n}: MessageBubbleProps) {\n  const bubbleProps = {\n    'data-slot': 'message-bubble',\n    'data-variant': variant,\n    'data-color': color,\n    className: bubble({ variant, color, className }),\n    ...props\n  };\n\n  // A ghost bubble has no surface, so it is plain body copy and takes its\n  // typography from Text. The others carry their own on the surface classes.\n  if (variant === 'ghost') {\n    return (\n      <Text\n        render={<p ref={ref} />}\n        size='small'\n        variant={GHOST_TEXT_VARIANT[color]}\n        {...bubbleProps}\n      />\n    );\n  }\n\n  return <p ref={ref} {...bubbleProps} />;\n}\n\nMessageBubble.displayName = 'Message.Bubble';\n"],"names":[],"mappings":";;;;;;;;AAOA;AACE;AACE;AACE;AACA;AACA;AACD;AACD;AACE;AACA;AACA;AACD;AACF;AACD;AACE;AACA;AACD;AACF;AAED;AACE;AACA;AACA;;;AA2BA;AACE;AACA;AACA;;AAEA;;;;AAKF;;;AAWA;AACF;AAEA;;"}