feat(saju-ui-v2): MascotBubble.jsx — 4 tone (ivory/navy/green/purple) + paw-bob
This commit is contained in:
40
src/pages/saju/_shell/MascotBubble.jsx
Normal file
40
src/pages/saju/_shell/MascotBubble.jsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import React from 'react';
|
||||
import { IconPaw } from './Icons';
|
||||
|
||||
const PALETTES = {
|
||||
ivory: { bg: '#FBF7EF', border: 'rgba(31,42,68,0.12)', text: '#1F2A44', paw: '#B89530' },
|
||||
navy: { bg: 'rgba(255,255,255,0.06)', border: 'rgba(212,175,55,0.35)', text: '#F7F2E8', paw: '#D4AF37' },
|
||||
green: { bg: '#FBF7EF', border: 'rgba(78,107,92,0.30)', text: '#1F2A44', paw: '#B89530' },
|
||||
purple: { bg: '#FBF7EF', border: 'rgba(106,76,124,0.30)', text: '#1F2A44', paw: '#B89530' },
|
||||
};
|
||||
|
||||
export default function MascotBubble({
|
||||
text, align = 'left', tone = 'ivory', tail = true, paw = true, style = {},
|
||||
}) {
|
||||
const p = PALETTES[tone] || PALETTES.ivory;
|
||||
return (
|
||||
<div style={{
|
||||
position: 'relative', background: p.bg, color: p.text,
|
||||
border: `1px solid ${p.border}`, borderRadius: 14,
|
||||
padding: '12px 14px',
|
||||
fontSize: 13, lineHeight: 1.55, letterSpacing: '-0.01em',
|
||||
maxWidth: 240, boxShadow: '0 2px 6px rgba(31,42,68,0.04)',
|
||||
...style,
|
||||
}}>
|
||||
<div style={{ whiteSpace: 'pre-line' }}>{text}</div>
|
||||
{paw && (
|
||||
<div style={{ marginTop: 4, textAlign: 'right', color: p.paw, opacity: 0.8 }}>
|
||||
<span className="paw-bob"><IconPaw size={12} color={p.paw} /></span>
|
||||
</div>
|
||||
)}
|
||||
{tail && (
|
||||
<div style={{
|
||||
position: 'absolute', bottom: -7, [align]: 22,
|
||||
width: 14, height: 14, background: p.bg,
|
||||
borderRight: `1px solid ${p.border}`, borderBottom: `1px solid ${p.border}`,
|
||||
transform: 'rotate(45deg)',
|
||||
}} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user